MediaWiki:Gadget-TwinkleV3.js
Appearance
Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
/* _______________________________________________________________________________
* | |
* | === WARNING: GLOBAL GADGET FILE === |
* | Changes to this page affect many users. |
* | Please discuss changes on the talk page or on [[WT:Gadget]] before editing. |
* |_______________________________________________________________________________|
*
* Built from source code at GitHub repository [https://github.com/wikimedia-gadgets/twinkle-enwiki]
* All changes should be made in the repository. Please do not attempt to edit this file directly.
*/
/* <nowiki> */
!function(){var e={930:function(e){function t(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,a(e,t)}function a(e,t){return a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},a(e,t)}e.exports=function(){"use strict";var e=function(){function e(e){this.locale=e}var t=e.prototype;return t.convertPlural=function(t,a){var i=new RegExp("\\d+=","i");if(!a||0===a.length)return"";for(var o=0;o<a.length;o++){var n=a[o];if(i.test(n)){if(parseInt(n.slice(0,n.indexOf("=")),10)===t)return n.slice(n.indexOf("=")+1);a[o]=void 0}}a=a.filter((function(e){return!!e}));var r=e.pluralRules[this.locale];r||(r={one:"i = 1 and v = 0"});var s=this.getPluralForm(t,r);return a[s=Math.min(s,a.length-1)]},t.getPluralForm=function(e,t){for(var a=["zero","one","two","few","many","other"],i=0,o=mw.libs.pluralRuleParser,n=0;n<a.length;n++)if(t[a[n]]){if(o(t[a[n]],e))return i;i++}return i},t.convertNumber=function(e,t){var a=this.digitTransformTable(this.locale),i=String(e),o="";if(!a)return e;if(t){if(parseFloat(e,10)===e)return e;var n=[];for(var r in a)n[a[r]]=r;a=n}for(var s=0;s<i.length;s++)a[i[s]]?o+=a[i[s]]:o+=i[s];return t?parseFloat(o,10):o},t.convertGrammar=function(e,t){return e},t.gender=function(e,t){if(!t||0===t.length)return"";for(;t.length<2;)t.push(t[t.length-1]);return"male"===e?t[0]:"female"===e?t[1]:3===t.length?t[2]:t[0]},t.digitTransformTable=function(t){return!!e.digitTransforms[t]&&e.digitTransforms[t].split("")},e}();e.pluralRules={},e.digitTransforms={};var a={bs:function(e){function a(){return e.apply(this,arguments)||this}return t(a,e),a.prototype.convertGrammar=function(e,t){switch(t){case"instrumental":e="s "+e;break;case"lokativ":e="o "+e}return e},a}(e),default:e,dsb:function(e){function a(){return e.apply(this,arguments)||this}return t(a,e),a.prototype.convertGrammar=function(e,t){switch(t){case"instrumental":e="z "+e;break;case"lokatiw":e="wo "+e}return e},a}(e),fi:function(e){function a(){return e.apply(this,arguments)||this}return t(a,e),a.prototype.convertGrammar=function(e,t){var a=e.match(/[aou][^\xe4\xf6y]*$/i),i=e;switch(e.match(/wiki$/i)&&(a=!1),e.match(/[bcdfghjklmnpqrstvwxz]$/i)&&(e+="i"),t){case"genitive":e+="n";break;case"elative":e+=a?"sta":"st\xe4";break;case"partitive":e+=a?"a":"\xe4";break;case"illative":e+=e.slice(-1)+"n";break;case"inessive":e+=a?"ssa":"ss\xe4";break;default:e=i}return e},a}(e),ga:function(e){function a(){return e.apply(this,arguments)||this}return t(a,e),a.prototype.convertGrammar=function(e,t){if("ainmlae"===t)switch(e){case"an Domhnach":e="D\xe9 Domhnaigh";break;case"an Luan":e="D\xe9 Luain";break;case"an Mh\xe1irt":e="D\xe9 Mh\xe1irt";break;case"an Ch\xe9adaoin":e="D\xe9 Ch\xe9adaoin";break;case"an D\xe9ardaoin":e="D\xe9ardaoin";break;case"an Aoine":e="D\xe9 hAoine";break;case"an Satharn":e="D\xe9 Sathairn"}return e},a}(e),he:function(e){function a(){return e.apply(this,arguments)||this}return t(a,e),a.prototype.convertGrammar=function(e,t){switch(t){case"prefixed":case"\u05ea\u05d7\u05d9\u05dc\u05d9\u05ea":"\u05d5"===e.slice(0,1)&&"\u05d5\u05d5"!==e.slice(0,2)&&(e="\u05d5"+e),"\u05d4"===e.slice(0,1)&&(e=e.slice(1)),(e.slice(0,1)<"\u05d0"||e.slice(0,1)>"\u05ea")&&(e="\u05be"+e)}return e},a}(e),hsb:function(e){function a(){return e.apply(this,arguments)||this}return t(a,e),a.prototype.convertGrammar=function(e,t){switch(t){case"instrumental":e="z "+e;break;case"lokatiw":e="wo "+e}return e},a}(e),hu:function(e){function a(){return e.apply(this,arguments)||this}return t(a,e),a.prototype.convertGrammar=function(e,t){switch(t){case"rol":e+="r\xf3l";break;case"ba":e+="ba";break;case"k":e+="k"}return e},a}(e),hy:function(e){function a(){return e.apply(this,arguments)||this}return t(a,e),a.prototype.convertGrammar=function(e,t){return"genitive"===t&&("\u0561"===e.slice(-1)?e=e.slice(0,-1)+"\u0561\u0575\u056b":"\u0578"===e.slice(-1)?e=e.slice(0,-1)+"\u0578\u0575\u056b":"\u0563\u056b\u0580\u0584"===e.slice(-4)?e=e.slice(0,-4)+"\u0563\u0580\u0584\u056b":e+="\u056b"),e},a}(e),la:function(e){function a(){return e.apply(this,arguments)||this}return t(a,e),a.prototype.convertGrammar=function(e,t){switch(t){case"genitive":e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(/u[ms]$/i,"i")).replace(/ommunia$/i,"ommunium")).replace(/a$/i,"ae")).replace(/libri$/i,"librorum")).replace(/nuntii$/i,"nuntiorum")).replace(/tio$/i,"tionis")).replace(/ns$/i,"ntis")).replace(/as$/i,"atis")).replace(/es$/i,"ei");break;case"accusative":e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(/u[ms]$/i,"um")).replace(/ommunia$/i,"am")).replace(/a$/i,"ommunia")).replace(/libri$/i,"libros")).replace(/nuntii$/i,"nuntios")).replace(/tio$/i,"tionem")).replace(/ns$/i,"ntem")).replace(/as$/i,"atem")).replace(/es$/i,"em");break;case"ablative":e=(e=(e=(e=(e=(e=(e=(e=(e=e.replace(/u[ms]$/i,"o")).replace(/ommunia$/i,"ommunibus")).replace(/a$/i,"a")).replace(/libri$/i,"libris")).replace(/nuntii$/i,"nuntiis")).replace(/tio$/i,"tione")).replace(/ns$/i,"nte")).replace(/as$/i,"ate")).replace(/es$/i,"e")}return e},a}(e),os:function(e){function a(){return e.apply(this,arguments)||this}return t(a,e),a.prototype.convertGrammar=function(e,t){var a,i,o,n;switch(a="\u043c\xe6",i="",o="",n="",e.match(/\u0442\xe6$/i)?(e=e.slice(0,-1),a="\xe6\u043c"):e.match(/[\u0430\xe6\u0435\u0451\u0438\u043e\u044b\u044d\u044e\u044f]$/i)?i="\u0439":e.match(/\u0443$/i)?e.slice(-2,-1).match(/[\u0430\xe6\u0435\u0451\u0438\u043e\u044b\u044d\u044e\u044f]$/i)||(i="\u0439"):e.match(/[\u0431\u0432\u0433\u0434\u0436\u0437\u0439\u043a\u043b\u043c\u043d\u043e\u043f\u0440\u0441\u0442\u0444\u0445\u0446\u0447\u0448\u0449\u044c\u044a]$/i)||(o="-"),t){case"genitive":n=o+i+"\u044b";break;case"dative":n=o+i+"\xe6\u043d";break;case"allative":n=o+a;break;case"ablative":n="\u0439"===i?o+i+"\xe6":o+i+"\xe6\u0439";break;case"superessive":n=o+i+"\u044b\u043b";break;case"equative":n=o+i+"\u0430\u0443";break;case"comitative":n=o+"\u0438\u043c\xe6"}return e+n},a}(e),ru:function(e){function a(){return e.apply(this,arguments)||this}return t(a,e),a.prototype.convertGrammar=function(e,t){return"genitive"===t&&("\u044c"===e.slice(-1)?e=e.slice(0,-1)+"\u044f":"\u0438\u044f"===e.slice(-2)?e=e.slice(0,-2)+"\u0438\u0438":"\u043a\u0430"===e.slice(-2)?e=e.slice(0,-2)+"\u043a\u0438":"\u0442\u0438"===e.slice(-2)?e=e.slice(0,-2)+"\u0442\u0435\u0439":"\u0434\u044b"===e.slice(-2)?e=e.slice(0,-2)+"\u0434\u043e\u0432":"\u043d\u0438\u043a"===e.slice(-3)&&(e=e.slice(0,-3)+"\u043d\u0438\u043a\u0430")),e},a}(e),sl:function(e){function a(){return e.apply(this,arguments)||this}return t(a,e),a.prototype.convertGrammar=function(e,t){switch(t){case"mestnik":e="o "+e;break;case"orodnik":e="z "+e}return e},a}(e),uk:function(e){function a(){return e.apply(this,arguments)||this}return t(a,e),a.prototype.convertGrammar=function(e,t){switch(t){case"genitive":"\u044c"===e.slice(-1)?e=e.slice(0,-1)+"\u044f":"\u0456\u044f"===e.slice(-2)?e=e.slice(0,-2)+"\u0456\u0457":"\u043a\u0430"===e.slice(-2)?e=e.slice(0,-2)+"\u043a\u0438":"\u0442\u0438"===e.slice(-2)?e=e.slice(0,-2)+"\u0442\u0435\u0439":"\u0434\u044b"===e.slice(-2)?e=e.slice(0,-2)+"\u0434\u043e\u0432":"\u043d\u0438\u043a"===e.slice(-3)&&(e=e.slice(0,-3)+"\u043d\u0438\u043a\u0430");break;case"accusative":"\u0456\u044f"===e.slice(-2)&&(e=e.slice(0,-2)+"\u0456\u044e")}return e},a}(e)},i=new RegExp("(?:([A-Za-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02b8\u02bb-\u02c1\u02d0\u02d1\u02e0-\u02e4\u02ee\u0370-\u0373\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0482\u048a-\u052f\u0531-\u0556\u0559-\u055f\u0561-\u0587\u0589\u0903-\u0939\u093b\u093d-\u0940\u0949-\u094c\u094e-\u0950\u0958-\u0961\u0964-\u0980\u0982\u0983\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd-\u09c0\u09c7\u09c8\u09cb\u09cc\u09ce\u09d7\u09dc\u09dd\u09df-\u09e1\u09e6-\u09f1\u09f4-\u09fa\u0a03\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a3e-\u0a40\u0a59-\u0a5c\u0a5e\u0a66-\u0a6f\u0a72-\u0a74\u0a83\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd-\u0ac0\u0ac9\u0acb\u0acc\u0ad0\u0ae0\u0ae1\u0ae6-\u0af0\u0af9\u0b02\u0b03\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b3e\u0b40\u0b47\u0b48\u0b4b\u0b4c\u0b57\u0b5c\u0b5d\u0b5f-\u0b61\u0b66-\u0b77\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bbe\u0bbf\u0bc1\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcc\u0bd0\u0bd7\u0be6-\u0bf2\u0c01-\u0c03\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c41-\u0c44\u0c58-\u0c5a\u0c60\u0c61\u0c66-\u0c6f\u0c7f\u0c82\u0c83\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd-\u0cc4\u0cc6-\u0cc8\u0cca\u0ccb\u0cd5\u0cd6\u0cde\u0ce0\u0ce1\u0ce6-\u0cef\u0cf1\u0cf2\u0d02\u0d03\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d-\u0d40\u0d46-\u0d48\u0d4a-\u0d4c\u0d4e\u0d57\u0d5f-\u0d61\u0d66-\u0d75\u0d79-\u0d7f\u0d82\u0d83\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0dcf-\u0dd1\u0dd8-\u0ddf\u0de6-\u0def\u0df2-\u0df4\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e4f-\u0e5b\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0ed0-\u0ed9\u0edc-\u0edf\u0f00-\u0f17\u0f1a-\u0f34\u0f36\u0f38\u0f3e-\u0f47\u0f49-\u0f6c\u0f7f\u0f85\u0f88-\u0f8c\u0fbe-\u0fc5\u0fc7-\u0fcc\u0fce-\u0fda\u1000-\u102c\u1031\u1038\u103b\u103c\u103f-\u1057\u105a-\u105d\u1061-\u1070\u1075-\u1081\u1083\u1084\u1087-\u108c\u108e-\u109c\u109e-\u10c5\u10c7\u10cd\u10d0-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1360-\u137c\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u167f\u1681-\u169a\u16a0-\u16f8\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1735\u1736\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17b6\u17be-\u17c5\u17c7\u17c8\u17d4-\u17da\u17dc\u17e0-\u17e9\u1810-\u1819\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1923-\u1926\u1929-\u192b\u1930\u1931\u1933-\u1938\u1946-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u19d0-\u19da\u1a00-\u1a16\u1a19\u1a1a\u1a1e-\u1a55\u1a57\u1a61\u1a63\u1a64\u1a6d-\u1a72\u1a80-\u1a89\u1a90-\u1a99\u1aa0-\u1aad\u1b04-\u1b33\u1b35\u1b3b\u1b3d-\u1b41\u1b43-\u1b4b\u1b50-\u1b6a\u1b74-\u1b7c\u1b82-\u1ba1\u1ba6\u1ba7\u1baa\u1bae-\u1be5\u1be7\u1bea-\u1bec\u1bee\u1bf2\u1bf3\u1bfc-\u1c2b\u1c34\u1c35\u1c3b-\u1c49\u1c4d-\u1c7f\u1cc0-\u1cc7\u1cd3\u1ce1\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u200e\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u214f\u2160-\u2188\u2336-\u237a\u2395\u249c-\u24e9\u26ac\u2800-\u28ff\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d70\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u302e\u302f\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u3190-\u31ba\u31f0-\u321c\u3220-\u324f\u3260-\u327b\u327f-\u32b0\u32c0-\u32cb\u32d0-\u32fe\u3300-\u3376\u337b-\u33dd\u33e0-\u33fe\u3400-\u4db5\u4e00-\u9fd5\ua000-\ua48c\ua4d0-\ua60c\ua610-\ua62b\ua640-\ua66e\ua680-\ua69d\ua6a0-\ua6ef\ua6f2-\ua6f7\ua722-\ua787\ua789-\ua7ad\ua7b0-\ua7b7\ua7f7-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua824\ua827\ua830-\ua837\ua840-\ua873\ua880-\ua8c3\ua8ce-\ua8d9\ua8f2-\ua8fd\ua900-\ua925\ua92e-\ua946\ua952\ua953\ua95f-\ua97c\ua983-\ua9b2\ua9b4\ua9b5\ua9ba\ua9bb\ua9bd-\ua9cd\ua9cf-\ua9d9\ua9de-\ua9e4\ua9e6-\ua9fe\uaa00-\uaa28\uaa2f\uaa30\uaa33\uaa34\uaa40-\uaa42\uaa44-\uaa4b\uaa4d\uaa50-\uaa59\uaa5c-\uaa7b\uaa7d-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaaeb\uaaee-\uaaf5\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab65\uab70-\uabe4\uabe6\uabe7\uabe9-\uabec\uabf0-\uabf9\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\ue000-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc]|\ud800[\udc00-\udc0b]|\ud800[\udc0d-\udc26]|\ud800[\udc28-\udc3a]|\ud800\udc3c|\ud800\udc3d|\ud800[\udc3f-\udc4d]|\ud800[\udc50-\udc5d]|\ud800[\udc80-\udcfa]|\ud800\udd00|\ud800\udd02|\ud800[\udd07-\udd33]|\ud800[\udd37-\udd3f]|\ud800[\uddd0-\uddfc]|\ud800[\ude80-\ude9c]|\ud800[\udea0-\uded0]|\ud800[\udf00-\udf23]|\ud800[\udf30-\udf4a]|\ud800[\udf50-\udf75]|\ud800[\udf80-\udf9d]|\ud800[\udf9f-\udfc3]|\ud800[\udfc8-\udfd5]|\ud801[\udc00-\udc9d]|\ud801[\udca0-\udca9]|\ud801[\udd00-\udd27]|\ud801[\udd30-\udd63]|\ud801\udd6f|\ud801[\ude00-\udf36]|\ud801[\udf40-\udf55]|\ud801[\udf60-\udf67]|\ud804\udc00|\ud804[\udc02-\udc37]|\ud804[\udc47-\udc4d]|\ud804[\udc66-\udc6f]|\ud804[\udc82-\udcb2]|\ud804\udcb7|\ud804\udcb8|\ud804[\udcbb-\udcc1]|\ud804[\udcd0-\udce8]|\ud804[\udcf0-\udcf9]|\ud804[\udd03-\udd26]|\ud804\udd2c|\ud804[\udd36-\udd43]|\ud804[\udd50-\udd72]|\ud804[\udd74-\udd76]|\ud804[\udd82-\uddb5]|\ud804[\uddbf-\uddc9]|\ud804\uddcd|\ud804[\uddd0-\udddf]|\ud804[\udde1-\uddf4]|\ud804[\ude00-\ude11]|\ud804[\ude13-\ude2e]|\ud804\ude32|\ud804\ude33|\ud804\ude35|\ud804[\ude38-\ude3d]|\ud804[\ude80-\ude86]|\ud804\ude88|\ud804[\ude8a-\ude8d]|\ud804[\ude8f-\ude9d]|\ud804[\ude9f-\udea9]|\ud804[\udeb0-\udede]|\ud804[\udee0-\udee2]|\ud804[\udef0-\udef9]|\ud804\udf02|\ud804\udf03|\ud804[\udf05-\udf0c]|\ud804\udf0f|\ud804\udf10|\ud804[\udf13-\udf28]|\ud804[\udf2a-\udf30]|\ud804\udf32|\ud804\udf33|\ud804[\udf35-\udf39]|\ud804[\udf3d-\udf3f]|\ud804[\udf41-\udf44]|\ud804\udf47|\ud804\udf48|\ud804[\udf4b-\udf4d]|\ud804\udf50|\ud804\udf57|\ud804[\udf5d-\udf63]|\ud805[\udc80-\udcb2]|\ud805\udcb9|\ud805[\udcbb-\udcbe]|\ud805\udcc1|\ud805[\udcc4-\udcc7]|\ud805[\udcd0-\udcd9]|\ud805[\udd80-\uddb1]|\ud805[\uddb8-\uddbb]|\ud805\uddbe|\ud805[\uddc1-\udddb]|\ud805[\ude00-\ude32]|\ud805\ude3b|\ud805\ude3c|\ud805\ude3e|\ud805[\ude41-\ude44]|\ud805[\ude50-\ude59]|\ud805[\ude80-\udeaa]|\ud805\udeac|\ud805\udeae|\ud805\udeaf|\ud805\udeb6|\ud805[\udec0-\udec9]|\ud805[\udf00-\udf19]|\ud805\udf20|\ud805\udf21|\ud805\udf26|\ud805[\udf30-\udf3f]|\ud806[\udca0-\udcf2]|\ud806\udcff|\ud806[\udec0-\udef8]|\ud808[\udc00-\udf99]|\ud809[\udc00-\udc6e]|\ud809[\udc70-\udc74]|\ud809[\udc80-\udd43]|\ud80c[\udc00-\udfff]|\ud80d[\udc00-\udc2e]|\ud811[\udc00-\ude46]|\ud81a[\udc00-\ude38]|\ud81a[\ude40-\ude5e]|\ud81a[\ude60-\ude69]|\ud81a\ude6e|\ud81a\ude6f|\ud81a[\uded0-\udeed]|\ud81a\udef5|\ud81a[\udf00-\udf2f]|\ud81a[\udf37-\udf45]|\ud81a[\udf50-\udf59]|\ud81a[\udf5b-\udf61]|\ud81a[\udf63-\udf77]|\ud81a[\udf7d-\udf8f]|\ud81b[\udf00-\udf44]|\ud81b[\udf50-\udf7e]|\ud81b[\udf93-\udf9f]|\ud82c\udc00|\ud82c\udc01|\ud82f[\udc00-\udc6a]|\ud82f[\udc70-\udc7c]|\ud82f[\udc80-\udc88]|\ud82f[\udc90-\udc99]|\ud82f\udc9c|\ud82f\udc9f|\ud834[\udc00-\udcf5]|\ud834[\udd00-\udd26]|\ud834[\udd29-\udd66]|\ud834[\udd6a-\udd72]|\ud834\udd83|\ud834\udd84|\ud834[\udd8c-\udda9]|\ud834[\uddae-\udde8]|\ud834[\udf60-\udf71]|\ud835[\udc00-\udc54]|\ud835[\udc56-\udc9c]|\ud835\udc9e|\ud835\udc9f|\ud835\udca2|\ud835\udca5|\ud835\udca6|\ud835[\udca9-\udcac]|\ud835[\udcae-\udcb9]|\ud835\udcbb|\ud835[\udcbd-\udcc3]|\ud835[\udcc5-\udd05]|\ud835[\udd07-\udd0a]|\ud835[\udd0d-\udd14]|\ud835[\udd16-\udd1c]|\ud835[\udd1e-\udd39]|\ud835[\udd3b-\udd3e]|\ud835[\udd40-\udd44]|\ud835\udd46|\ud835[\udd4a-\udd50]|\ud835[\udd52-\udea5]|\ud835[\udea8-\udeda]|\ud835[\udedc-\udf14]|\ud835[\udf16-\udf4e]|\ud835[\udf50-\udf88]|\ud835[\udf8a-\udfc2]|\ud835[\udfc4-\udfcb]|\ud836[\udc00-\uddff]|\ud836[\ude37-\ude3a]|\ud836[\ude6d-\ude74]|\ud836[\ude76-\ude83]|\ud836[\ude85-\ude8b]|\ud83c[\udd10-\udd2e]|\ud83c[\udd30-\udd69]|\ud83c[\udd70-\udd9a]|\ud83c[\udde6-\ude02]|\ud83c[\ude10-\ude3a]|\ud83c[\ude40-\ude48]|\ud83c\ude50|\ud83c\ude51|[\ud840-\ud868][\udc00-\udfff]|\ud869[\udc00-\uded6]|\ud869[\udf00-\udfff]|[\ud86a-\ud86c][\udc00-\udfff]|\ud86d[\udc00-\udf34]|\ud86d[\udf40-\udfff]|\ud86e[\udc00-\udc1d]|\ud86e[\udc20-\udfff]|[\ud86f-\ud872][\udc00-\udfff]|\ud873[\udc00-\udea1]|\ud87e[\udc00-\ude1d]|[\udb80-\udbbe][\udc00-\udfff]|\udbbf[\udc00-\udffd]|[\udbc0-\udbfe][\udc00-\udfff]|\udbff[\udc00-\udffd])|([\u0590\u05be\u05c0\u05c3\u05c6\u05c8-\u05ff\u07c0-\u07ea\u07f4\u07f5\u07fa-\u0815\u081a\u0824\u0828\u082e-\u0858\u085c-\u089f\u200f\ufb1d\ufb1f-\ufb28\ufb2a-\ufb4f\u0608\u060b\u060d\u061b-\u064a\u066d-\u066f\u0671-\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u0710\u0712-\u072f\u074b-\u07a5\u07b1-\u07bf\u08a0-\u08e2\ufb50-\ufd3d\ufd40-\ufdcf\ufdf0-\ufdfc\ufdfe\ufdff\ufe70-\ufefe]|\ud802[\udc00-\udd1e]|\ud802[\udd20-\ude00]|\ud802\ude04|\ud802[\ude07-\ude0b]|\ud802[\ude10-\ude37]|\ud802[\ude3b-\ude3e]|\ud802[\ude40-\udee4]|\ud802[\udee7-\udf38]|\ud802[\udf40-\udfff]|\ud803[\udc00-\ude5f]|\ud803[\ude7f-\udfff]|\ud83a[\udc00-\udccf]|\ud83a[\udcd7-\udfff]|\ud83b[\udc00-\uddff]|\ud83b[\udf00-\udfff]|\ud83b[\udf00-\udfff]|\ud83b[\udf00-\udfff]|\ud83b[\udf00-\udfff]|\ud83b[\udf00-\udfff]|\ud83b[\udf00-\udfff]|\ud83b[\udf00-\udfff]|\ud83b[\udf00-\udfff]|\ud83b[\udf00-\udfff]|\ud83b[\udf00-\udfff]|\ud83b[\udf00-\udfff]|\ud83b[\udf00-\udfff]|\ud83b[\udf00-\udfff]|\ud83b[\ude00-\udeef]|\ud83b[\udef2-\udeff]))"),o=function(){function e(e){this.locale=e,this.language=new(a[e]||a.default)(e)}var t=e.prototype;return t.emit=function(e,t){var a,i,o,r=this;switch(typeof e){case"string":case"number":a=e;break;case"object":i=e.slice(1).map((function(e){return r.emit(e,t)})),a="function"==typeof this[o=e[0].toLowerCase()]?this[o](i,t):"{{"+new n(this.locale).simpleParse(e[0],t)+i.map((function(e){return"|"+e}))+"}}";break;case"undefined":a="";break;default:throw new Error("unexpected type in AST: "+typeof e)}return a},t.concat=function(e){var t="";return e.forEach((function(e){t+=e})),t},t.replace=function(e,t){var a=parseInt(e[0],10);return a<t.length?t[a]:"$"+(a+1)},t.plural=function(e){var t=parseFloat(this.language.convertNumber(e[0],10)),a=e.slice(1);return a.length?this.language.convertPlural(t,a):""},t.gender=function(e){var t=e[0],a=e.slice(1);return this.language.gender(t,a)},t.grammar=function(e){var t=e[0],a=e[1];return a&&t&&this.language.convertGrammar(a,t)},t.bidi=function(e){var t=function(e){var t=e.match(i);return t?void 0===t[2]?"ltr":"rtl":null}(e[0]);return"ltr"===t?"\u202a"+e[0]+"\u202c":"rtl"===t?"\u202b"+e[0]+"\u202c":e[0]},t.formatnum=function(e){var t=!!e[1]&&"R"===e[1],a=e[0];return"string"==typeof a||"number"==typeof a?this.language.convertNumber(a,t):a},e}(),n=function(){function e(e){this.locale=e,this.emitter=new o(this.locale)}var t=e.prototype;return t.parse=function(e,t){if(e.includes("{{")){var a=function(e){var t,a,i,o,n,r,s,l=0;function c(e){return function(){for(var t=0;t<e.length;t++){var a=e[t]();if(null!==a)return a}return null}}function d(e){for(var t=l,a=[],i=0;i<e.length;i++){var o=e[i]();if(null===o)return l=t,null;a.push(o)}return a}function p(e,t){return function(){for(var a=l,i=[],o=t();null!==o;)i.push(o),o=t();return i.length<e?(l=a,null):i}}function u(t){var a=t.length;return function(){var i=null;return e.slice(l,l+a)===t&&(i=t,l+=a),i}}function m(t){return function(){var a=e.slice(l).match(t);return null===a?null:(l+=a[0].length,a[0])}}var g,f,h=u("|"),b=u(":"),v=u("\\"),y=m(/^./),w=u("$"),k=m(/^\d+/),x=m(/^[^{}$\\]/),P=m(/^[^{}$\\|]/);function T(){var e=d([v,y]);return null===e?null:e[1]}function C(){var e=d([w,k]);return null===e?null:["REPLACE",parseInt(e[1],10)-1]}function N(){var e=d([h,p(0,r)]);if(null===e)return null;var t=e[1];return t.length>1?["CONCAT"].concat(t):t[0]}function R(){var e=d([o,b,C]);return null===e?null:[e[0],e[2]]}function M(){var e=d([o,b,r]);return null===e?null:[e[0],e[2]]}t=c([T,P]),a=c([T,x]),g=m(/^[ !"$&'()*,./0-9;=?@A-Z^_`a-z~\x80-\xFF+-]+/),f=function(e){return e.toString()},o=function(){var e=g();return null===e?null:f(e)},i=c([function(){var e=d([c([R,M]),p(0,N)]);return null===e?null:e[0].concat(e[1])},function(){var e=d([o,p(0,N)]);return null===e?null:[e[0]].concat(e[1])}]);var A=u("{{"),E=u("}}");function W(){var e=d([A,i,E]);return null===e?null:e[1]}if(n=c([W,C,function(){var e=p(1,a)();return null===e?null:e.join("")}]),r=c([W,C,function(){var e=p(1,t)();return null===e?null:e.join("")}]),s=function(){var e=p(0,n)();return null===e?null:["CONCAT"].concat(e)}(),null===s||l!==e.length)throw new Error("Parse error at position "+l.toString()+" in input: "+e);return s}(e);return this.emitter.emit(a,t)}return this.simpleParse(e,t)},t.simpleParse=function(e,t){return e.replace(/\$(\d+)/g,(function(e,a){var i=parseInt(a,10)-1;return void 0!==t[i]?t[i]:"$"+a}))},e}(),r=function(){function e(e){this.sourceMap=new Map}var t=e.prototype;return t.load=function(e,t){if("object"!=typeof e)throw new Error("Invalid message source. Must be an object");if(t){if(!/^[a-zA-Z0-9-]+$/.test(t))throw new Error("Invalid locale "+t);for(var a in e)if(0!==a.indexOf("@")){if("object"==typeof e[a])return this.load(e);if("string"!=typeof e[a])throw new Error("Invalid message for message "+a+" in "+t+" locale.");break}this.sourceMap.has(t)?this.sourceMap.set(t,Object.assign(this.sourceMap.get(t),e)):this.sourceMap.set(t,e)}else for(t in e)this.load(e[t],t)},t.getMessage=function(e,t){var a=this.sourceMap.get(t);return a?a[e]:null},t.hasLocale=function(e){return this.sourceMap.has(e)},e}();return function(){function t(e,t){var a=void 0===t?{}:t,i=a.finalFallback,o=void 0===i?"en":i,s=a.messages;this.locale=e,this.parser=new n(this.locale),this.messageStore=new r,s&&this.load(s,this.locale),this.fallbackLocales=[],this.finalFallback=o}var a=t.prototype;return a.load=function(e,t){return this.messageStore.load(e,t||this.locale)},a.i18n=function(e){for(var t=arguments.length,a=new Array(t>1?t-1:0),i=1;i<t;i++)a[i-1]=arguments[i];return this.parser.parse(this.getMessage(e),a)},a.setLocale=function(e){this.locale=e,this.parser=new n(this.locale)},a.getFallbackLocales=function(){return[].concat(this.fallbackLocales,[this.finalFallback])},a.setFallbackLocales=function(e){this.fallbackLocales=e},a.setPluralRules=function(t,a){e.pluralRules[t]=a},a.setDigitTransforms=function(t,a){e.digitTransforms[t]=a},a.getMessage=function(e){for(var t=this.locale,a=0,i=this.getFallbackLocales();t;){var o=t.split("-"),n=o.length;do{var r=o.slice(0,n).join("-"),s=this.messageStore.getMessage(e,r);if("string"==typeof s)return s;n--}while(n);t=i[a],a++}return e},a.registerParserPlugin=function(e,t){o.prototype[e]=t},t}()}()},425:function(e,t,a){"use strict";var i={};a.r(i),a.d(i,{pi:function(){return r},ZT:function(){return n}});var o=function(e,t){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var a in t)t.hasOwnProperty(a)&&(e[a]=t[a])},o(e,t)};function n(e,t){function a(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(a.prototype=t.prototype,new a)}var r=function(){return r=Object.assign||function(e){for(var t,a=1,i=arguments.length;a<i;a++)for(var o in t=arguments[a])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},r.apply(this,arguments)};var s,l=mw.config.get("wgNamespaceIds"),c=l[""],d=(l.talk,l.special,l.file),p=l.template,u=(l.category,l.project),m=(l.user,l.user_talk);!function(e){e.botUsernameRegex=/bot\b/i,e.flaggedRevsNamespaces=[c,u],e.permalinkSpecialPageName="Special:PermanentLink",e.redirectTagAliases=["#REDIRECT"],e.signatureTimestampFormat=null}(s||(s={}));var g,f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(Error);function h(e){return e?Array.isArray(e)?e:[e]:[]}function b(e){var t=mw.Title.newFromUserInput(e);return t?t.getNameText():e}function v(e){return mw.util.getParamValue(e)}function y(e,t,a){return'<a target="_blank" href="'+mw.util.getUrl(t,a)+'">'+e+"</a>"}function w(e,t){return e.ns-t.ns||(e.title>t.title?1:-1)}function k(e){var t=Morebits.htmlNode("a"," >");t.setAttribute("class","tw-arrowpage-link"),t.setAttribute("href",mw.util.getUrl(e.value)),t.setAttribute("target","_blank"),e.nextElementSibling.append(t)}function x(e){var t=$(e),a=Morebits.htmlNode("a",t.val());a.setAttribute("class","tw-batchpage-link"),a.setAttribute("href",mw.util.getUrl(t.val())),a.setAttribute("target","_blank"),t.next().prepend([a," "])}function P(e,t){return"{{"+e+C(t).filter((function(e){e[0];return!!e[1]})).map((function(e){return"|"+e[0]+"="+e[1]})).join("")+"}}"}function T(e){return Object.values?Object.values(e):Object.keys(e).map((function(t){return e[t]}))}function C(e){return Object.entries?Object.entries(e):Object.keys(e).map((function(t){return[t,e[t]]}))}function N(e,t){return String.prototype.startsWith?e.startsWith(t):0===e.indexOf(t)}!function(e){e.scriptName="Twinkle",e.language=v("uselang")||mw.config.get("wgContentLanguage"),e.userAgent="Twinkle ("+mw.config.get("wgWikiID")+")",e.changeTags="",e.summaryAd=" ("+e.scriptName+")",e.preModuleInitHooks=[],e.preModuleInitHooksWithConfig=[],e.registeredModules=[],e.activeSpecialPages=["Block","Contributions","Recentchanges","Recentchangeslinked"].concat(Morebits.userIsSysop?["DeletedContributions","Prefixindex"]:[]),e.messageOverrides={},e.extraMwMessages=[]}(g||(g={}));var R,M=a(930),A=a.n(M),E=function(e){function t(t,a,i){return a=$.extend({action:"query",format:"json",formatversion:"2",uselang:g.language,errorlang:g.language,errorsuselocal:!0,tags:g.changeTags},a),e.call(this,t,a,null,i,null)||this}return n(t,e),t.prototype.post=function(t){return t||(t={}),t.headers||(t.headers={}),t.headers["Api-User-Agent"]=g.userAgent,e.prototype.post.call(this,t)},t}(Morebits.wiki.api);var W,S,I=["colon-separator","semicolon-separator","word-separator","comma-separator","and","parentheses","percent","blanknamespace","protectlogpage","stable-logpage","duration-hours","duration-days","duration-weeks","duration-years","protect-expiry-indefinite","group-autoconfirmed","group-sysop","protectexpiry","restriction-edit","restriction-move","restriction-create","restriction-level-autoconfirmed","restriction-level-sysop","block-expiry","blocklogpage","period-am","period-pm","january","jan","february","feb","march","mar","april","apr","may_long","may","june","jun","july","jul","august","aug","september","sep","october","oct","november","nov","december","dec","sunday","sun","monday","mon","tuesday","tue","wednesday","wed","thursday","thu","friday","fri","saturday","sat","sunday","sun"],D=JSON.parse('{"@metadata":{"authors":["SD0001"]},"tooltip-mark":"?","relative-today":"[Today at] h:mm A","relative-prevday":"[Yesterday at] h:mm A","relative-nextday":"[Tomorrow at] h:mm A","relative-thisweek":"dddd [at] h:mm A","relative-pastweek":"[Last] dddd [at] h:mm A","relative-other":"YYYY-MM-DD","done":"Done","api-error":"$1 \\"$2\\" occurred while contacting the API.","invalid-token-retrying":"Invalid token. Getting a new token and retrying...","getting-token":"Retrieving token...","opening-page":"Opening page \\"$1\\"","retrieving-page":"Retrieving page...","protected-edit-warning":"You are about to make an edit to the fully protected page \\"$1\\" (protection expiring {{date:$1|relative|utc}} (UTC)).\\n\\nClick OK to proceed with the edit, or Cancel to skip this edit.","protected-indef-edit-warning":"You are about to make an edit to the fully protected page \\"$1\\" (protected indefinitely).\\n\\nClick OK to proceed with the edit, or Cancel to skip this edit.","protected-aborted":"Edit to fully protected page was aborted.","saving-page":"Saving page...","getting-creator":"Retrieving page creation information","token-fetch-fail":"Failed to retrieve edit token.","invalid-title":"The page title is invalid: $1","cross-redirect-abort":"$1 is a cross-namespace redirect to $2, aborted","redirected":"Redirected from $1 to $2","redirect-resolution-fail":"Could not resolve redirects for: $1","api-error-unknown":"Unknown error received from API while saving page","editconflict-purging":"Edit conflict detected, purging server cache","editconflict-retrying":"Edit conflict detected, reapplying edit","save-failed-retrying":"Save failed, retrying in $1 seconds ...","moving-page":"moving page...","batch-starting":"Performing batch operation","batch-no-pages":"no pages specified","batch-done-page":"completed ([[$1]])","batch-progress":"Done ($1/$2 actions completed successfully)","submit":"Submit Query","bullet-separator":" \u2022 ","revert-mismatch":"The retrieved revision does not match the requested revision.","revert-curid-fail":"Failed to retrieve current revision ID.","revert-user-fail":"Failed to retrieve user who made the revision.","revert-summary":"Restored revision $1 by $2","hidden-user":"an unknown user","querying-user":"Querying user \\"$1\\"","fetching-userinfo":"Retrieving user information...","failed-timestamp":"Failed to retrieve current timestamp.","failed-token":"Failed to retrieve token.","failed-userinfo":"Failed to retrieve user info for $1.","already-blocked-indef":"$1 is already blocked (indefinitely; by $2), would you like to override the block?","already-blocked":"$1 is already blocked (until {{date:$2|relative}}; by $3), would you like to override the block?","reblock-aborted":"Reblock aborted","invalid-block-expiry":"You must provide a valid block expiration.","ip-indef-confirm":"$1 is an IP address, do you really want to block it indefinitely? \\n\\nClick OK to proceed with the block, or Cancel to abort.","ip-indef-aborted":"Indefinite block of IP address was aborted.","admin-block-confirm":"$1 is an administrator, are you sure you want to block them? \\n\\nClick OK to proceed with the block, or Cancel to abort.","admin-block-aborted":"Block of administrator was aborted.","partial-usertalk":"Partial blocks cannot prevent talk page access unless also restricting {{ns:3}} namespace.","blocking":"blocking user...","not-blocked":"User is not blocked.","indirect-block":"User is not directly blocked, but rather $1 is.","unblocking":"unblocking user...","notify-fail-iprange":"Cannot notify IP ranges","notify-self-skip":"You ($1) created this page; skipping user notification","notify-fail-noexist":"Cannot notify the user because the user does not exist.","notify-fail-template":"User talk page transcludes {{$1}}, aborting notification","notify-fail-optout":"User has opted out of this notification, aborting","notify-fail-bot":"User is a bot, aborting notification","notify-fail-blocked":"User is indefinitely blocked, aborting notification","notifying-user":"Notifying $1","watching-user":"Watching user page...","info":"Info","note":"Note","error":"Error","link-rollback":"rollback","link-vandalism":"vandalism","link-goodfaith-rollback":"rollback (AGF)","restore-revision":"restore this version","fetching-data":"Grabbing data of earlier revisions","saving-reverted":"Saving reverted contents","prompt-reason-restore":"Please specify a reason for the revert: ","reversion-complete":"Reversion completed","cant-edit-protected":"Unable to edit the page, it\'s probably protected.","no-revisions":"We have less than one additional revision, thus impossible to revert.","bad-revid":"The most recent revision ID received from the server, <strong>$1</strong>, is less than the ID of the displayed revision. This could indicate that the current revision has been deleted, the server is lagging, or that bad data has been received. Stopping revert.","revid-mismatch":"Latest revision <strong>$1</strong> doesn\'t equal our revision <strong>$2</strong>","latest-rev-same-user":"Latest revision was also made by <strong>$1</strong>. As we assume vandalism, we will proceed to revert.","latest-rev-same-64":"Latest revision was made by <strong>$1</strong>, which is on the same /64 subnet. As we assume vandalism, we will proceed to revert.","latest-rev-other-user-goodfaith":"Latest revision was made by <strong>$1</strong>. As we assume good faith, we will stop the revert, as the problem might have been fixed.","latest-rev-other-user":"Latest revision was made by <strong>$1</strong>, but we will stop the revert.","latest-rev-bot":"Latest revision was made by <strong>$1</strong>, a trusted bot, and the revision before was made by our vandal, so we will proceed with the revert.","latest-rev-reverted":"Latest revision was made by <strong>$1</strong>, so it might have already been reverted, we will stop the revert.","bot-revert":"Vandalism revert was chosen on <strong>$1</strong>. As this is a trusted bot, we assume you wanted to revert vandalism made by the previous user instead.","bot-revert-goodfaith":"Good faith revert was chosen on <strong>$1</strong>. This is a trusted bot and thus AGF rollback will not proceed.","bot-revert-prompt":"Normal revert was chosen, but the most recent edit was made by a trusted bot ($1). Do you want to revert the revision before instead?","bot-revert-previous":"Normal revert was chosen on <strong>$1</strong>. This is a trusted bot, and per confirmation, we\'ll revert the previous revision instead.","bot-revert-selected":"Normal revert was chosen on <strong>$1</strong>. This is a trusted bot, but per confirmation, revert on selected revision will proceed.","ipv6-same-user":"Treating consecutive IPv6 addresses in the same /64 as the same user","no-previous-revision":"No previous revision found. Perhaps <strong>$1</strong> is the only contributor, or they have made more than {{formatnum:$2}} edits in a row.","no-edits-revert":"As it is not possible to revert zero revisions, we will stop this revert. It could be that the edit has already been reverted, but the revision ID was still the same.","revert-multiple-prompt":"$1 has made {{formatnum:$2}} edits in a row. Are you sure you want to revert them all?","stopping":"Stopping revert.","revision-age":" revision <strong>$1</strong> that was made <strong>{{formatnum:$2}}</strong> revisions ago by $3","summary-prompt":"An optional comment for the edit summary: ","user-aborted":"Aborted by user.","restore-summary":"Restored revision $1 by %USER%","goodfaith-summary":"Reverted good faith edits by %USER%","vandalism-summary":"Reverted {{formatnum:$1}} {{plural:$1|edit|edits}} by %USER% to last revision by $2","normal-summary":"Reverted {{formatnum:$1}} {{plural:$1|edit|edits}} by %USER%","revert-confirm":"Reverting page: are you sure?","revert-complete":"Reversion completed","opening-talk":"Opening user talk page edit form for user <strong>$1</strong>","pcreview-comment":"Automatically reviewing reversion","pcreview-accepting":"Automatically accepting your changes","diff-last":"Last","diff-last-tooltip":"Show most recent diff","diff-since":"Since","diff-since-tooltip":"Show difference between last diff and the revision made by previous user","diff-sincemine":"Since mine","diff-sincemine-tooltip":"Show difference between last diff and my last revision","diff-current":"Current","diff-current-tooltip":"Show difference to current revision","diff-error":"no suitable earlier revision found, or $1 is the only contributor. Aborting.","reason":"Reason:","reason-tooltip":"You can use wikimarkup in your reason. Twinkle will automatically sign your post.","loading":"Loading...","select-all":"Select All","deselect-all":"Deselect All","fetching-list":"Grabbing list of pages","option-delete":"Delete pages","option-talks":"Delete associated talk pages (except user talk pages)","option-redirects":"Delete redirects to deleted pages","option-subpages":"Delete subpages of deleted pages","option-subpage-talks":"Delete talk pages of deleted subpages","option-subpage-redirects":"Delete redirects to deleted subpages","option-subpage-unlink":"Unlink backlinks to each deleted subpage (in Main and Portal namespaces only)","option-unlink":"Unlink backlinks to each page (in Main and Portal namespaces only)","option-unlink-file":"Remove usages of each file (in all namespaces)","pages-label":"Pages to delete","complete":"Batch deletion is now complete","confirm-protected":"You are about to delete {{formatnum:$1}} fully protected page(s). Are you sure?","dbatch-give-reason":"You need to give a reason, you cabal crony!","dbatch-no-pages":"nothing to delete, aborting","deleting":"Deleting pages","starting":"Initiating requested tasks","deleting-page":"Deleting page $1","deleting-subpages":"Deleting subpages","deleting-subpage":"Deleting subpage $1","fetching-backlinks":"Grabbing backlinks","fetching-filelinks":"Grabbing file links","fetching-redirects":"Grabbing redirects","check-talk":"Checking whether talk page exists","deleting-redirects":"Deleting redirects to $1","delete-redirect-summary":"Redirect to deleted page \\"$1\\"","deleting-talk":"Deleting talk page of page $1","delete-talk-summary":"Talk page of deleted page \\"$1\\"","unlink-page":"Unlinking backlinks to $1","unlink-on":"Unlinking on $1","unlink-summary":"Removing link(s) to deleted page $1","unlink-img-on":"Removing file usages on $1","img-comment":"Commented out because image was deleted","unlink-img-summary":"Removing instance of file $1 that has been deleted because \\"$2\\"","undbatch-restore-talks":"Restore talk pages of undeleted pages if they existed","undbatch-pages-label":"Pages to undelete","undbatch-complete":"Batch undeletion is now complete","undbatch-confirm-protected":"You are about to undelete {{formatnum:$1}} fully create protected page(s). Are you sure?","undbatch-no-pages":"nothing to undelete, aborting","undeleting":"Undeleting pages","undeleting-page":"Undeleting page $1","check-talk-deleted":"Checking talk page for deleted revisions","undeleting-talk-status":"Undeleting talk page of $1","undeleting-talk-summary":"Undeleting talk page of \\"$1\\"","create-protected-indef":"(fully create protected indefinitely)","create-protected":"(fully create protected, expires $1 (UTC))","unlink-title":"Unlinking backlinks","unlink-title-file":"Unlinking backlinks and file usages","unlink-intro":"This tool allows you to unlink all incoming links (\\"backlinks\\") that point to this page. For instance, <code>[[$1|link text]]</code> would become <code>link text</code> and <code>[[$1]]</code> would become <code>$1</code>. Use it with caution.","unlink-intro-file":"This tool allows you to unlink all incoming links (\\"backlinks\\") that point to this page and/or hide all inclusions of this file by wrapping them in <!-- --> comment markup. For instance, <code>[[:$1|link text]]</code> would become <code>link text</code> and <code>[[$1]]</code> would become <code><!-- [[$1]] --></code>. Use it with caution.","unlink-give-reason":"You must specify a reason for unlinking.","unlink-select-one":"You must select at least one item to unlink.","unlink-status-links-files":"Unlinking backlinks and instances of file usage","unlink-status-links":"Unlinking backlinks","unlink-status-files":"Unlinking instances of file usage","unlink-in":"Unlinking in page \\"$1\\"","no-file-usage":"No instances of file usage found.","file-usage":"File usage","first-n-files":"First {{formatnum:$1}} file usages shown.","backlinks":"Backlinks","no-backlinks":"No backlinks found.","first-n-links":"First {{formatnum:$1}} backlinks shown.","change-twpref":"You can change this with your Twinkle preferences, linked at the bottom of this Twinkle window","selected-namespaces":"Selected namespaces: {{list:$1}}","commented-out":"Commented out","no-links-files-found":"Didn\'t find any backlinks or file usages on the page.","no-links-found":"Didn\'t find any backlinks on the page.","no-files-found":"Didn\'t find any file usages on the page.","summary-links-files":"Commenting out use(s) of file / Removing link(s) to \\"$1\\"","summary-links":"Removing link(s) to \\"$1\\"","summary-files":"Commenting out use(s) of file to \\"$1\\"","protect-action-type":"Type of action","protect-protect-label":"Protect page","protect-protect-tooltip":"Apply actual protection to the page.","protect-tag-label":"Tag page with protection template","protect-tag-tooltip":"If the protecting admin forgot to apply a protection template, or you have just protected the page without tagging, you can use this to apply the appropriate protection tag.","protect-request-label":"Request page protection","protect-request-tooltip":"If you want to request protection via WP:RPP.","protect-request-sysop-tooltip":"If you want to request protection via WP:RPP instead of doing the protection by yourself.","preset":"Preset","choose-preset":"Choose a preset:","prev-protections":"Previous protections","past-protected":"This page has been protected in the past","sysops-contacted":"Have you attempted to contact the protecting admins ({{list:$1}}) first?","unprotected-time":"unprotected {{date:$1|relative|utc}}","expired-time":"expired {{date:$1|relative|utc}}","expires-time":"expires {{date:$1|relative|utc}}","reset-time":"reset {{date:$1|relative|utc}}","duration-months":"$1 {{plural:$1|month|months}}","protect-options":"Protection options","protect-edit-modify":"Modify edit protection","protect-edit-modify-tooltip":"If this is turned off, the edit protection level, and expiry time, will be left as is.","protect-edit-label":"Edit protection:","protect-move-modify":"Modify move protection","protect-move-modify-tooltip":"If this is turned off, the move protection level, and expiry time, will be left as is.","protect-move-label":"Move protection:","protect-stable-modify":"Modify pending changes protection","protect-stable-modify-tooltip":"If this is turned off, the pending changes level, and expiry time, will be left as is.","protect-stable-label":"Pending changes:","protect-create-label":"Create protection:","protect-reason":"Reason (for protection log):","protect-current-label":"Current protection level","protect-current-none":"<b>no protection</b>","protect-current":"<b>$1: $2</b>","protect-current-cascading":"<b>$1: $2 (cascading)</b>","protect-current-stable":"<b>Pending changes: $1</b>","protect-cascade-from":"<b>Cascading protection</b> from [[$1]]","by-sysop":"by [[{{ns:3}}:$1|$1]]","duration-label":"Duration:","protect-notes-label":"Notes:","note-requested-label":"$1 request","note-requested-tooltip":"Add a note to the protection log that this was requested at $1","note-requested":"requested at $1","request-revid-label":"$1 revision ID","request-revid-tooltip":"Optional revision ID of the $1 page where protection was requested.","protect-select-tag":"Choose protection template:","protect-tag-small-label":"Iconify","protect-tag-small-tooltip":"Will use the |small=yes feature of the template, and only render it as a keylock","protect-tag-noinclude-label":"Wrap protection template with <noinclude>","protect-tag-noinclude-tooltip":"Will wrap the protection template in <noinclude> tags, so that it won\'t transclude","protect-request-preset-label":"Type of protection","protect-request-type-label":"Type and reason:","temporary":"Temporary","custom-expiry-prompt":"Enter a custom expiry time. \\nYou can use relative times, like \\"1 minute\\" or \\"19 days\\", or absolute timestamps, \\"yyyymmddhhmm\\" (e.g. \\"200602011405\\" is Feb 1, 2006, at 14:05 UTC).","all-users":"All","custom-expiry-label":"Custom...","protect-request-exists":"There is already a protection request for this page at [[$1]], aborting.","protect-tag-adding":"Applying protection template","protect-tag-none-status":"nothing to do","protect-tag-exists-prompt":"{{$1}} was found on the page. \\nClick OK to remove it, or click Cancel to leave it there.","protect-tag-removing":"Removing protection template","protect-tag-abort":"Redirect category shell present","nothing-to-do":"nothing to do","block-window-title":"Block or issue block template to $1","block-self-warn":"You are about to block yourself! Are you sure you want to proceed?","block-action":"Block user","block-action-tooltip":"Block the relevant user with the given options. If partial block is unchecked, this will be a sitewide block.","block-partial":"Partial block","block-partial-tooltip":"Enable partial blocks and partial block templates.","block-tag":"Add block template to user talk page","block-tag-tooltip":"Add block template to user talk page","block-64-field-label":"Convert to /64 rangeblock","block-64-help":"It\'s usually fine, if not better, to block the /64 range ([[Special:Contributions/$1|$1]]).","block-64-label":"Block the /64 instead","block-64-template":"Any template issued will go to the original IP: $1","block-tag-options":"Template options","block-block-options":"Block options","block-expiry-indefinite":"indefinite","unblock-label":"Unblock this user","block-custom-expiry":"Custom expiry","block-custom-expiry-tooltip":"You can use relative times, like \\"1 minute\\" or \\"19 days\\", or absolute timestamps, \\"yyyymmddhhmm\\" (e.g. \\"200602011405\\" is Feb 1, 2006, at 14:05 UTC).","fetching-userinfo-error":"Error fetching user info","block-prior-label":"Prior block settings","block-pages-label":"Specific pages to block from editing","block-pages-tooltip":"10 page max.","block-namespaces-label":"Namespace blocks","block-namespaces-tooltip":"Block from editing these namespaces.","block-nocreate-label":"Block account creation","block-noemail-label":"Block user from sending email","block-disabletalk-label":"Prevent this user from editing their own talk page while blocked","block-partial-disabletalk-tooltip":"If issuing a partial block, this MUST remain unchecked unless you are also preventing them from editing User talk space","block-auto-label":"Autoblock any IP addresses used (hardblock)","block-hard-label":"Block logged-in users from using this IP address (hardblock)","block-watch-label":"Watch user and user talk pages","block-reason-label":"Reason (for block log):","block-reason-tooltip":"Consider adding helpful details to the default message.","block-see-label":"See also:","block-see-tooltip":"Insert a \\"see also\\" message to indicate whether the filter log or deleted contributions played a role in the decision to block.","block-see-filter":"Filter log","block-see-deleted":"Deleted contribs","block-tag-template":"Choose talk page template:","block-linked-label":"Linked page","block-linked-tooltip":"A page can be linked within the notice, perhaps if it was the primary target of disruption. Leave empty for no page to be linked.","block-partial-area-label":"Area blocked from","block-partial-area-tooltip":"Optional explanation of the pages or namespaces the user was blocked from editing.","block-tag-expiry":"Period of blocking:","block-tag-expiry-tooltip":"The period the blocking is due for, for example 24 hours, 2 weeks, indefinite etc...","block-tag-reason-label":"You have been blocked for ...","block-tag-reason-tooltip":"An optional reason, to replace the default generic reason. Only available for the generic block templates.","block-tag-noexpiry-label":"Do not include expiry in template","block-tag-noexpiry-tooltip":"Instead of including the duration, make the block template read \\"You have been blocked temporarily...\\"","block-tag-notalk-label":"Talk page access disabled","block-tag-notalk-tooltip":"Make the block template state that the user\'s talk page access has been removed","block-tag-noemail-label":"User blocked from sending email","block-tag-noemail-tooltip":"If the area is not provided, make the block template state that the user\'s email access has been removed","block-tag-nocreate-label":"User blocked from creating accounts","block-tag-nocreate-tooltip":"If the area is not provided, make the block template state that the user\'s ability to create accounts has been removed","select2-badsearch":"Incomplete or invalid search term","block-namespaces-placeholder":"Select namespaces to block user from","block-pages-placeholder":"Select pages to block user from","block-current-partial":"$1 is partially blocked","block-current":"$1 is blocked sitewide","block-current-range":"$1 is blocked sitewide as a rangeblock","block-current-in-range":"$1 is blocked sitewide within a /$2 rangeblock ($3)","block-current-partial-range":"$1 is partially blocked as a rangeblock","block-current-partial-in-range":"$1 is partially blocked within a /$2 rangeblock ($3)","block-expiry-date":"expires {{date:$1|relative|utc}}","block-current-change":"This form will change the existing block.","block-current-add":"This form will add an additional block.","unblocked-ago":"unblocked {{date:$1|relative|utc}}","block-expired":"$1, expired {{date:$2|relative|utc}}","block-log-current":"Previous blocks","block-log-past":"This user has been blocked in the past","block-partial-blank":"No pages or namespaces were selected, nor were email or account creation restrictions applied; please select at least one option to apply a partial block!","block-warn-noexpiry":"Please provide an expiry!","block-warn-indef-ip":"Can\'t indefinitely block an IP address!","block-warn-noreason":"Please provide a reason for the block!","block-doing":"Executing block","block-warn-partial-usertalk":"Partial blocks cannot prevent talk page access unless also restricting them from editing User talk space!","block-conflict":"The block status of $1 has changed. Last block log entry:","block-conflict-block":"Blocked by $1 with comment \\"$2\\". Expiring {{date:$3|relative|utc}}. Do you want to override with your settings?","block-conflict-unblock":"Unblocked by $1 with comment \\"$2\\". ({{date:$3|relative|utc}}.) Do you want to override with your settings?","block-noop":"Please give Twinkle something to do!","block-complete":"Actions complete, loading user talk page in a few seconds","block-tagging-status":"User talk page modification","block-blank-talk":"Blanking talk page per preferences and creating a new talk page section for this month","block-new-section":"Will create a new talk page section for this month, as none was found","search-tags":"Filter tag list:","summary-added":"Added {{list:$1}} {{plural:$2|tag|tags}}","summary-removed":"Removed {{list:$1}} {{plural:$2|tag|tags}}","summary-added-removed":"Added {{list:$1}}; and removed {{list:$2}} {{plural:$3|tag|tags}}","status-added":"Added $1 {{plural:$1|tag|tags}}","status-removed":"Removed $1 {{plural:$1|tag|tags}}","status-added-removed":"Added $1 {{plural:$1|tag|tags}}; Removed $2 {{plural:$2|tag|tags}}","untag-from-read":"For removal of existing tags, please open Tag menu from the current version of article","tags-present-header":"Tags already present","mark-patrolled":"Mark the page as patrolled/reviewed","tag-complete":"Tagging complete, reloading $1 in a few seconds","select-one":"You must select at least one tag!","getting-redirects":"Getting template redirects","cant-reposition":"Failed to find {{$1}} on the page... skip repositioning","cant-remove":"Failed to find {{$1}} on the page... cannot remove","untagging":"Untagging","removing":"Already present tags: removing de-selected tags","resolved-redirect":"Resolved template redirect {{$1}} to {{$2}}","tagging-status":"Tagging $1","tag-fetching-redirects":"Getting redirects for {{list:$1}}","xfd-venue-label":"Deletion discussion venue:","xfd-venue-tooltip":"When activated, a default choice is made, based on what namespace you are in. This default should be the most appropriate.","notify-creator-label":"Notify page creator if possible","notify-creator-tooltip":"A notification template will be placed on the creator\'s talk page if this is true.","deletion-reason-here":"Your deletion rationale is provided below, which you can copy and paste into a new XFD dialog if you wish to try again:","looking-old-nominations":"Looking for prior nominations of this page","bad-venue":"Unrecognised venue: $1","nomination-complete-redirect":"Nomination complete, now redirecting to the discussion page","protected-no-editreq":"Page protected and nowhere to add an edit request, aborting","protected-editreq":"Page protected, requesting edit","posting-editreq":"Automatically posting edit request on talk page","xfd-editreq-title":"Edit request to complete $1 nomination","xfd-editreq-failed":"Unable to add edit request, the talk page may be protected","fetching-creator":"Finding page creator","notifying-creator":"Notifying initial contributor ($1)","pref-logxfdnominations-label":"Keep a log in userspace of all pages you nominate for a deletion discussion (XfD)","pref-logxfdnominations-tooltip":"The userspace log offers a good way to keep track of all pages you nominate for XfD using Twinkle.","pref-xfdlogpagename-label":"Keep the deletion discussion userspace log at this user subpage","pref-xfdlogpagename-tooltip":"Enter a subpage name in this box. You will find your XfD log at User:<i>username</i>/<i>subpage name</i>. Only works if you turn on the XfD userspace log.","pref-xfdwatchpage-label":"Add the nominated page to watchlist","pref-xfdwatchdiscussion-label":"Add the deletion discussion page to watchlist","pref-xfdwatchlist-label":"Add the daily log or list page to the watchlist","pref-xfdwatchlist-tooltip":"This only applies for venues where the discussion takes place on a newly-created page which is transcluded on to a log or list page.","pref-xfdwatchuser-label":"Add user talk page of initial contributor to watchlist (when notifying)"}'),U=(v("uselang")||mw.config.get("wgContentLanguage"),{date:function(e){var t="function"==typeof e[0].getTime?new Morebits.date(e[0].getTime()):new Morebits.date(e[0]),a=e[1],i="utc"===e[2]?"utc":void 0;return"relative"===a?t.calendar(i):t.format(a,i)},int:function(e){var t=e[0],a=e.slice(1);return F.apply(void 0,(0,i.__spreadArray)([t],a))},ns:function(e){var t=String(e[0]).trim();return/^\d+$/.test(t)||(t=String(mw.config.get("wgNamespaceIds")[t.replace(/ /g,"_").toLowerCase()])),t=mw.config.get("wgFormattedNamespaces")[t],t||""},ucfirst:function(e){return Morebits.string.toUpperCaseFirstChar(e[0])},lcfirst:function(e){return Morebits.string.toLowerCaseFirstChar(e[0])},list:function(e){for(var t=e[0],a="",i=0;i<t.length;i++)a+=t[i],t.length-2===i?a+=F("and")+F("word-separator"):t.length-1!==i&&(a+=F("comma-separator"));return a},sysop:function(e){return Morebits.userIsSysop?e[1]:e[2]}});function L(e){W.load(e,g.language)}function F(e){for(var t=[],a=1;a<arguments.length;a++)t[a-1]=arguments[a];if(!W)throw new Error("Can't emit messages before initMessaging() has run!");return S?"("+e+")":W.i18n.apply(W,(0,i.__spreadArray)([e],t))}var O;function _(e,t){for(var a=[],i=0;i<e.length;i+=50)a.push(R.getMessages(e.slice(i,i+50),{amlang:t,maxage:31536e3,smaxage:31536e3,uselang:"content"}).then((function(e){L(e)})));return Promise.all(a)}function q(e){if("en"===e)return Promise.resolve();var t="tw-i18n-"+e,a=mw.storage.getObject(t);return a&&new Morebits.date(a["@timestamp"]).add(2,"days").isAfter(new Date)?(G(a),Promise.resolve()):$.get("https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/gadgets/TwinkleCore/+/i18n/build-i18n/"+e+".json?format=text").then((function(e){var a=JSON.parse(decodeURIComponent(window.atob(e).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join("")));G(a),mw.requestIdleCallback((function(){a["@timestamp"]=(new Date).toISOString(),a["@fallbacks"]=W.getFallbackLocales(),mw.storage.setObject(t,a)}))}),(function(e){mw.log.warn("[twinkle]: no messages loaded from gerrit.",e)}))}function G(e){W.setFallbackLocales(e["@fallbacks"]),delete e["@fallbacks"],delete e["@timestamp"];for(var t=0,a=C(e);t<a.length;t++){var i=a[t],o=i[0],n=i[1];N(o,"@")||(n["@pluralrules"]&&W.setPluralRules(o,n["@pluralrules"]),n["@digittransforms"]&&W.setDigitTransforms(o,n["@digittransforms"]))}W.load(e)}var B={optionsVersion:2,userTalkPageMode:"tab",dialogLargeFont:!1,disabledModules:[],disabledSysopModules:[],portletArea:null,portletId:null,portletName:null,portletType:null,portletNext:null,autolevelStaleDays:3,revertMaxRevisions:50,batchMax:5e3,batchChunks:50,summaryAd:" ([[WP:TW|TW]])",deletionSummaryAd:" ([[WP:TW|TW]])",protectionSummaryAd:" ([[WP:TW|TW]])",logXfdNominations:!1,xfdLogPageName:"XfD log",noLogOnXfdNomination:[],xfdWatchDiscussion:"default",xfdWatchList:"no",xfdWatchPage:"default",xfdWatchUser:"default",xfdWatchRelated:"default",markXfdPagesAsPatrolled:!0,autoMenuAfterRollback:!1,openTalkPage:["agf","norm","vand"],openTalkPageOnAutoRevert:!1,rollbackInPlace:!1,markRevertedPagesAsMinor:["vand"],watchRevertedPages:["agf","norm","vand","torev"],watchRevertedExpiry:"1 month",offerReasonOnNormalRevert:!0,confirmOnFluff:!1,confirmOnMobileFluff:!0,showRollbackLinks:["diff","others"],speedySelectionStyle:"buttonClick",watchSpeedyPages:["g3","g5","g10","g11","g12"],watchSpeedyExpiry:"1 month",markSpeedyPagesAsPatrolled:!1,defaultWarningGroup:"1",combinedSingletMenus:!1,showSharedIPNotice:!0,watchWarnings:"1 month",oldSelect:!1,customWarningList:[],spiWatchReport:"yes",topWelcomes:!1,watchWelcomes:"3 months",insertUsername:!0,quickWelcomeMode:"norm",quickWelcomeTemplate:"welcome",customWelcomeList:[],customWelcomeSignature:!0,markSharedIPAsMinor:!0,markTalkbackAsMinor:!0,insertTalkbackSignature:!0,talkbackHeading:"New message from "+mw.config.get("wgUserName"),mailHeading:"You've got mail!"};function j(e){e.forEach((function(e){B[e.name]=e.value}))}function V(e){return"object"==typeof O&&void 0!==O[e]?O[e]:"object"==typeof window.TwinkleConfig&&void 0!==window.TwinkleConfig[e]?window.TwinkleConfig[e]:"object"==typeof window.FriendlyConfig&&void 0!==window.FriendlyConfig[e]?window.FriendlyConfig[e]:B[e]}var Y=function(){function e(){}return e.addGroup=function(t,a){e.sections[t]=a},e.addPreference=function(t,a){e.sections[t].preferences.push(a)},e.init=function(){if(mw.config.get("wgNamespaceNumber")===mw.config.get("wgNamespaceIds").project&&"Twinkle/Preferences"===mw.config.get("wgTitle")&&"view"===mw.config.get("wgAction")){if(!document.getElementById("twinkle-config"))return;document.getElementById("twinkle-config-titlebar").style.backgroundImage="url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAkCAMAAAB%2FqqA%2BAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAEhQTFRFr73ZobTPusjdsMHZp7nVwtDhzNbnwM3fu8jdq7vUt8nbxtDkw9DhpbfSvMrfssPZqLvVztbno7bRrr7W1d%2Fs1N7qydXk0NjpkW7Q%2BgAAADVJREFUeNoMwgESQCAAAMGLkEIi%2FP%2BnbnbpdB59app5Vdg0sXAoMZCpGoFbK6ciuy6FX4ABAEyoAef0BXOXAAAAAElFTkSuQmCC)";var t=document.getElementById("twinkle-config-content");if(t.textContent="",window.TwinkleConfig||window.FriendlyConfig){var a=document.createElement("p");a.innerHTML='<table class="plainlinks ombox ombox-content"><tr><td class="mbox-image"><img alt="" src="https://upload.wikimedia.org/wikipedia/commons/3/38/Imbox_content.png" /></td><td class="mbox-text"><p><big><b>Before modifying your settings here,</b> you must remove your old Twinkle and Friendly settings from your personal skin JavaScript.</big></p><p>To do this, you can <a href="'+mw.util.getUrl("User:"+mw.config.get("wgUserName")+"/"+mw.config.get("skin")+".js",{action:"edit"})+'" target="_blank"><b>edit your personal skin javascript file</b></a> or <a href="'+mw.util.getUrl("User:"+mw.config.get("wgUserName")+"/common.js",{action:"edit"})+'" target="_blank"><b>your common.js file</b></a>, removing all lines of code that refer to <code>TwinkleConfig</code> and <code>FriendlyConfig</code>.</p></td></tr></table>',t.appendChild(a)}var i=document.createElement("div");i.className="toc",i.style.marginLeft="0.4em";var o=document.createElement("div");o.id="toctitle";var n=document.createElement("h2");n.textContent="Contents ",o.appendChild(n);var r=document.createElement("span");r.className="toctoggle",r.appendChild(document.createTextNode("["));var s=document.createElement("a");s.className="internal",s.setAttribute("href","#tw-tocshowhide"),s.textContent="hide",r.appendChild(s),r.appendChild(document.createTextNode("]")),o.appendChild(r),i.appendChild(o);var l=document.createElement("ul");s.addEventListener("click",(function(){var e=$(l);e.toggle(),e.find(":visible").length?s.textContent="hide":s.textContent="show"}),!1),i.appendChild(l),t.appendChild(i);var c=document.createElement("form");c.setAttribute("action","javascript:void(0)"),c.addEventListener("submit",e.save,!0),t.appendChild(c);var d=document.createElement("table");d.style.width="100%",c.appendChild(d),T(e.sections).forEach((function(t){if(t.hidden||t.adminOnly&&!Morebits.userIsSysop)return!0;var a=document.createElement("li");a.className="toclevel-1";var i=document.createElement("a");i.setAttribute("href","#"+t.module),i.appendChild(document.createTextNode(t.title)),a.appendChild(i),l.appendChild(a);var o=document.createElement("tr"),n=document.createElement("td");n.setAttribute("colspan","3");var r=document.createElement("h4");r.style.borderBottom="1px solid gray",r.style.marginTop="0.2em",r.id=t.module,r.appendChild(document.createTextNode(t.title)),n.appendChild(r),o.appendChild(n),d.appendChild(o);var s=1;return t.preferences.forEach((function(t){if(t.adminOnly&&!Morebits.userIsSysop)return!0;(o=document.createElement("tr")).style.marginBottom="0.2em",s++%2==0&&(o.style.backgroundColor="rgba(128, 128, 128, 0.1)"),n=document.createElement("td");var a,i,r=V(t.name);switch(t.type){case"boolean":n.setAttribute("colspan","2"),a=document.createElement("label"),(i=document.createElement("input")).setAttribute("type","checkbox"),i.setAttribute("id",t.name),i.setAttribute("name",t.name),!0===r&&i.setAttribute("checked","checked"),a.appendChild(i),a.appendChild(document.createTextNode(" "+t.label)),n.appendChild(a);break;case"string":case"integer":n.style.textAlign="right",n.style.paddingRight="0.5em",(a=document.createElement("label")).setAttribute("for",t.name),a.appendChild(document.createTextNode(t.label+":")),n.appendChild(a),o.appendChild(n),(n=document.createElement("td")).style.paddingRight="1em",(i=document.createElement("input")).setAttribute("type","text"),i.setAttribute("id",t.name),i.setAttribute("name",t.name),"integer"===t.type&&(i.setAttribute("size",6),i.setAttribute("type","number"),i.setAttribute("step","1")),r&&i.setAttribute("value",r),n.appendChild(i);break;case"enum":n.style.textAlign="right",n.style.paddingRight="0.5em",(a=document.createElement("label")).setAttribute("for",t.name),a.appendChild(document.createTextNode(t.label+":")),n.appendChild(a),o.appendChild(n),(n=document.createElement("td")).style.paddingRight="1em",(i=document.createElement("select")).setAttribute("id",t.name),i.setAttribute("name",t.name),$.each(t.enumValues,(function(e,t){var a=document.createElement("option");a.setAttribute("value",e),(r===e||"boolean"==typeof r&&(r&&"yes"===e||!r&&"no"===e))&&a.setAttribute("selected","selected"),a.appendChild(document.createTextNode(t)),i.appendChild(a)})),n.appendChild(i);break;case"set":n.setAttribute("colspan","2"),(a=document.createElement("label")).appendChild(document.createTextNode(t.label+":")),n.appendChild(a);var l=document.createElement("div");l.style.paddingLeft="1em";var c=function(e,a){var i=document.createElement("label");i.style.marginRight="0.7em",i.style.display="inline-block";var o=document.createElement("input");o.setAttribute("type","checkbox"),o.setAttribute("id",t.name+"_"+e),o.setAttribute("name",t.name+"_"+e),r&&-1!==r.indexOf(e)&&o.setAttribute("checked","checked"),"unlinkNamespaces"===t.name&&r&&-1!==r.indexOf(parseInt(e,10))&&o.setAttribute("checked","checked"),i.appendChild(o),i.appendChild(document.createTextNode(a)),l.appendChild(i)};t.setDisplayOrder?$.each(t.setDisplayOrder,(function(e,a){c(a,t.setValues[a])})):$.each(t.setValues,c),n.appendChild(l);break;case"customList":n.style.textAlign="right",n.style.paddingRight="0.5em",(a=document.createElement("label")).setAttribute("for",t.name),a.appendChild(document.createTextNode(t.label+":")),n.appendChild(a),o.appendChild(n),(n=document.createElement("td")).style.paddingRight="1em";var p=document.createElement("button");p.setAttribute("id",t.name),p.setAttribute("name",t.name),p.setAttribute("type","button"),p.addEventListener("click",z.display,!1),$(p).data({value:r,pref:t}),p.appendChild(document.createTextNode("Edit items")),n.appendChild(p);break;default:alert("twinkleconfig: unknown data type for preference "+t.name)}if(o.appendChild(n),(n=document.createElement("td")).style.fontSize="90%",n.style.color="gray",t.helptip&&(n.innerHTML=t.helptip.replace(/{{(.+?)}}/g,'{{<a href="'+mw.util.getUrl("Template:")+'$1" target="_blank">$1</a>}}')),"customList"!==t.type){var u=document.createElement("a");u.setAttribute("href","#tw-reset"),u.setAttribute("id","twinkle-config-reset-"+t.name),u.addEventListener("click",e.resetPrefLink,!1),u.style.cssFloat="right",u.style.margin="0 0.6em",u.appendChild(document.createTextNode("Reset")),n.appendChild(u)}return o.appendChild(n),d.appendChild(o),!0})),!0}));var p=document.createElement("div");p.setAttribute("id","twinkle-config-buttonpane"),p.style.backgroundColor="#BCCADF",p.style.padding="0.5em";var u=document.createElement("button");u.setAttribute("id","twinkle-config-submit"),u.setAttribute("type","submit"),u.appendChild(document.createTextNode("Save changes")),p.appendChild(u);var m=document.createElement("span");m.className="plainlinks",m.style.marginLeft="2.4em",m.style.fontSize="90%";var g=document.createElement("a");if(g.setAttribute("href","#tw-reset-all"),g.setAttribute("id","twinkle-config-resetall"),g.addEventListener("click",e.resetAllPrefs,!1),g.appendChild(document.createTextNode("Restore defaults")),m.appendChild(g),p.appendChild(m),c.appendChild(p),window.location.hash){var f=window.location.hash;window.location.hash="",window.location.hash=f}}else if(mw.config.get("wgNamespaceNumber")===mw.config.get("wgNamespaceIds").user&&0===mw.config.get("wgTitle").indexOf(mw.config.get("wgUserName"))&&".js"===mw.config.get("wgPageName").slice(-3)){var h=document.createElement("div");h.setAttribute("id","twinkle-config-headerbox");var b,v=mw.config.get("wgPageName").slice(mw.config.get("wgPageName").lastIndexOf("/")+1,mw.config.get("wgPageName").lastIndexOf(".js"));"twinkleoptions"===v?(h.setAttribute("class","config-twopt-box"),mw.config.get("wgArticleId")>0?h.appendChild(document.createTextNode("This page contains your Twinkle preferences. You can change them using the ")):h.appendChild(document.createTextNode("You can customize Twinkle to suit your preferences by using the ")),(b=document.createElement("a")).setAttribute("href",mw.util.getUrl(mw.config.get("wgFormattedNamespaces")[mw.config.get("wgNamespaceIds").project]+":Twinkle/Preferences")),b.appendChild(document.createTextNode("Twinkle preferences panel")),h.appendChild(b),h.appendChild(document.createTextNode(", or by editing this page.")),$(h).insertAfter($("#contentSub"))):-1!==["monobook","vector","cologneblue","modern","timeless","minerva","common"].indexOf(v)&&(h.setAttribute("class","config-userskin-box"),h.appendChild(document.createTextNode("If you want to set Twinkle preferences, you can use the ")),(b=document.createElement("a")).setAttribute("href",mw.util.getUrl(mw.config.get("wgFormattedNamespaces")[mw.config.get("wgNamespaceIds").project]+":Twinkle/Preferences")),b.appendChild(document.createTextNode("Twinkle preferences panel")),h.appendChild(b),h.appendChild(document.createTextNode(".")),$(h).insertAfter($("#contentSub")))}},e.resetPrefLink=function(t){var a=t.target.id.substring(21);return T(e.sections).forEach((function(t){if(t.hidden||t.adminOnly&&!Morebits.userIsSysop)return!0;var i=!1;return t.preferences.forEach((function(t){return t.name!==a||(e.resetPref(t),i=!0,!1)})),!i&&void 0})),!1},e.resetPref=function(e){switch(e.type){case"boolean":document.getElementById(e.name).checked=B[e.name];break;case"string":case"integer":case"enum":document.getElementById(e.name).value=B[e.name];break;case"set":$.each(e.setValues,(function(t){var a=document.getElementById(e.name+"_"+t);a&&(a.checked=-1!==B[e.name].indexOf(t))}));break;case"customList":$(document.getElementById(e.name)).data("value",B[e.name]);break;default:alert("twinkleconfig: unknown data type for preference "+e.name)}},e.resetAllPrefs=function(){return T(e.sections).forEach((function(t){return t.hidden||t.adminOnly&&!Morebits.userIsSysop||t.preferences.forEach((function(t){t.adminOnly&&!Morebits.userIsSysop||e.resetPref(t)})),!0})),!1},e.save=function(t){Morebits.status.init(document.getElementById("twinkle-config-content"));var a=mw.config.get("wgFormattedNamespaces")[mw.config.get("wgNamespaceIds").user]+":"+mw.config.get("wgUserName")+"/twinkleoptions.js",i=new Morebits.wiki.page(a,"Saving preferences to "+a);return i.setCallbackParameters(t.target),i.load(e.writePrefs),!1},e.writePrefs=function(t){var a=t.getCallbackParameters(),i={optionsVersion:2.1};T(e.sections).forEach((function(e){e.adminOnly&&!Morebits.userIsSysop||e.preferences.forEach((function(t){var o;if(!t.adminOnly||Morebits.userIsSysop)if(e.hidden)O&&(o=O[t.name]);else switch(t.type){case"boolean":o=a[t.name].checked;break;case"string":case"enum":o=a[t.name].value;break;case"integer":o=parseInt(a[t.name].value,10),isNaN(o)&&(Morebits.status.warn("Saving","The value you specified for "+t.name+" ("+a[t.name].value+") was invalid. The save will continue, but the invalid data value will be skipped."),o=null);break;case"set":o=[],t.setDisplayOrder?$.each(t.setDisplayOrder,(function(e,i){a[t.name+"_"+i].checked&&o.push(i)})):$.each(t.setValues,(function(e){a[t.name+"_"+e].checked&&o.push(e)}));break;case"customList":o=$(a[t.name]).data("value");break;default:alert("twinkleconfig: unknown data type for preference "+t.name)}void 0===o||function(e,t){if(Array.isArray(e)){if(e.length!==t.length)return!1;for(var a=e.sort(),i=t.sort(),o=0;a[o];++o){if("object"==typeof a[o]&&(a[o].label!==i[o].label||a[o].value!==i[o].value))return!1;if(a[o].toString()!==i[o].toString())return!1}return!0}return e===t}(o,B[t.name])||(i[t.name]=o)}))}));var o="// twinkleoptions.js: personal Twinkle preferences file\n//\n// NOTE: The easiest way to change your Twinkle preferences is by using the\n// Twinkle preferences panel, at [["+Morebits.pageNameNorm+']].\n//\n// This file is AUTOMATICALLY GENERATED. Any changes you make (aside from\n// changing the configuration parameters in a valid-JavaScript way) will be\n// overwritten the next time you click "save" in the Twinkle preferences\n// panel. If modifying this file, make sure to use correct JavaScript.\n// <no"+"wiki>\n\nwindow.Twinkle.prefs = ';o+=JSON.stringify(i,null,2),o+=";\n\n// </no"+"wiki>\n// End of twinkleoptions.js\n",t.setPageText(o),t.setEditSummary("Saving Twinkle preferences: automatic edit from [[:"+Morebits.pageNameNorm+"]]"),t.setChangeTags(g.changeTags),t.setCreateOption("recreate"),t.save(e.saveSuccess)},e.saveSuccess=function(e){e.getStatusElement().info("successful");var t=document.createElement("div");t.className="successbox",t.style.fontSize="100%",t.style.marginTop="2em",t.innerHTML='<p><b>Your Twinkle preferences have been saved.</b></p><p>To see the changes, you will need to <b>clear your browser cache entirely</b> (see <a href="'+mw.util.getUrl("WP:BYPASS")+'" title="WP:BYPASS">WP:BYPASS</a> for instructions).</p>',Morebits.status.root.appendChild(t);var a=document.createElement("br");a.style.clear="both",Morebits.status.root.appendChild(a)},e.sections={general:{title:"General",module:"general",preferences:[{name:"userTalkPageMode",label:"When opening a user talk page, open it",type:"enum",enumValues:{window:"In a window, replacing other user talks",tab:"In a new tab",blank:"In a totally new window"},default:"tab"},{name:"dialogLargeFont",label:"Use larger text in Twinkle dialogs",type:"boolean",default:!1},{name:"disabledModules",label:"Turn off the selected Twinkle modules",helptip:"Anything you select here will NOT be available for use, so act with care. Uncheck to reactivate.",type:"set",setValues:{arv:"ARV",warn:"Warn",welcome:"Welcome",shared:"Shared IP",talkback:"Talkback",speedy:"CSD",prod:"PROD",xfd:"XfD",image:"Image (DI)",protect:"Protect (RPP)",tag:"Tag",diff:"Diff",unlink:"Unlink",fluff:"Revert and rollback"},default:[]},{name:"disabledSysopModules",label:"Turn off the selected admin-only modules",helptip:"Anything you select here will NOT be available for use, so act with care. Uncheck to reactivate.",adminOnly:!0,type:"set",setValues:{block:"Block",deprod:"DePROD",batchdelete:"D-batch",batchprotect:"P-batch",batchundelete:"Und-batch"},default:[]}]},hidden:{title:"Hidden",hidden:!0,preferences:[{name:"portletArea",type:"string"},{name:"portletId",type:"string"},{name:"portletName",type:"string"},{name:"portletType",type:"string"},{name:"portletNext",type:"string"},{name:"revertMaxRevisions",type:"integer",default:50},{name:"autolevelStaleDays",type:"integer",default:3},{name:"batchMax",type:"integer",adminOnly:!0,default:5e3},{name:"batchChunks",type:"integer",adminOnly:!0,default:50}]}},e.watchlistEnums={yes:"Add to watchlist (indefinitely)",no:"Don't add to watchlist",default:"Follow your site preferences","1 week":"Watch for 1 week","1 month":"Watch for 1 month","3 months":"Watch for 3 months","6 months":"Watch for 6 months"},e.commonSets={csdCriteria:{db:"Custom rationale ({{db}})",g1:"G1",g2:"G2",g3:"G3",g4:"G4",g5:"G5",g6:"G6",g7:"G7",g8:"G8",g10:"G10",g11:"G11",g12:"G12",g13:"G13",g14:"G14",a1:"A1",a2:"A2",a3:"A3",a5:"A5",a7:"A7",a9:"A9",a10:"A10",a11:"A11",u1:"U1",u2:"U2",u3:"U3",u5:"U5",f1:"F1",f2:"F2",f3:"F3",f7:"F7",f8:"F8",f9:"F9",f10:"F10",c1:"C1",r2:"R2",r3:"R3",r4:"R4",p1:"P1",p2:"P2"},csdCriteriaDisplayOrder:["db","g1","g2","g3","g4","g5","g6","g7","g8","g10","g11","g12","g13","g14","a1","a2","a3","a5","a7","a9","a10","a11","u1","u2","u3","u5","f1","f2","f3","f7","f8","f9","f10","c1","r2","r3","r4","p1","p2"],csdCriteriaNotification:{db:"Custom rationale ({{db}})",g1:"G1",g2:"G2",g3:"G3",g4:"G4",g6:'G6 ("copy-paste move" only)',g10:"G10",g11:"G11",g12:"G12",g13:"G13",g14:"G14",a1:"A1",a2:"A2",a3:"A3",a5:"A5",a7:"A7",a9:"A9",a10:"A10",a11:"A11",u3:"U3",u5:"U5",f1:"F1",f2:"F2",f3:"F3",f7:"F7",f9:"F9",f10:"F10",c1:"C1",r2:"R2",r3:"R3",r4:"R4",p1:"P1",p2:"P2"},csdCriteriaNotificationDisplayOrder:["db","g1","g2","g3","g4","g6","g10","g11","g12","g13","g14","a1","a2","a3","a5","a7","a9","a10","a11","u3","u5","f1","f2","f3","f7","f9","f10","c1","r2","r3","r4","p1","p2"],csdAndDICriteria:{db:"Custom rationale ({{db}})",g1:"G1",g2:"G2",g3:"G3",g4:"G4",g5:"G5",g6:"G6",g7:"G7",g8:"G8",g10:"G10",g11:"G11",g12:"G12",g13:"G13",g14:"G14",a1:"A1",a2:"A2",a3:"A3",a5:"A5",a7:"A7",a9:"A9",a10:"A10",a11:"A11",u1:"U1",u2:"U2",u3:"U3",u5:"U5",f1:"F1",f2:"F2",f3:"F3",f4:"F4",f5:"F5",f6:"F6",f7:"F7",f8:"F8",f9:"F9",f10:"F10",f11:"F11",c1:"C1",r2:"R2",r3:"R3",r4:"R4",p1:"P1",p2:"P2"},csdAndDICriteriaDisplayOrder:["db","g1","g2","g3","g4","g5","g6","g7","g8","g10","g11","g12","g13","g14","a1","a2","a3","a5","a7","a9","a10","a11","u1","u2","u3","u5","f1","f2","f3","f4","f5","f6","f7","f8","f9","f10","f11","c1","r2","r3","r4","p1","p2"],namespacesNoSpecial:{0:"Article",1:"Talk (article)",2:"User",3:"User talk",4:"Wikipedia",5:"Wikipedia talk",6:"File",7:"File talk",8:"MediaWiki",9:"MediaWiki talk",10:"Template",11:"Template talk",12:"Help",13:"Help talk",14:"Category",15:"Category talk",100:"Portal",101:"Portal talk",108:"Book",109:"Book talk",118:"Draft",119:"Draft talk",710:"TimedText",711:"TimedText talk",828:"Module",829:"Module talk"}},e}(),z=function(){function e(){}return e.addRow=function(e,t,a){var i=document.createElement("tr"),o=document.createElement("td"),n=document.createElement("button");n.setAttribute("type","button"),n.addEventListener("click",(function(){$(i).remove()}),!1),n.textContent="Remove",o.appendChild(n),i.appendChild(o),o=document.createElement("td");var r=document.createElement("input");r.setAttribute("type","text"),r.className="twinkle-config-customlist-value",r.style.width="97%",t&&r.setAttribute("value",t),o.appendChild(r),i.appendChild(o),o=document.createElement("td"),(r=document.createElement("input")).setAttribute("type","text"),r.className="twinkle-config-customlist-label",r.style.width="98%",a&&r.setAttribute("value",a),o.appendChild(r),i.appendChild(o),e.appendChild(i)},e.display=function(t){var a=$(t.target),i=a.data("value"),o=a.data("pref"),n=new Morebits.simpleWindow(720,400);n.setTitle(o.label),n.setScriptName("Twinkle preferences");var r=document.createElement("div"),s=document.createElement("table");s.className="wikitable",s.style.margin="1.4em 1em",s.style.width="auto";var l=document.createElement("tbody"),c=document.createElement("tr"),d=document.createElement("th");d.style.width="5%",c.appendChild(d),(d=document.createElement("th")).style.width="35%",d.textContent=o.customListValueTitle?o.customListValueTitle:"Value",c.appendChild(d),(d=document.createElement("th")).style.width="60%",d.textContent=o.customListLabelTitle?o.customListLabelTitle:"Label",c.appendChild(d),l.appendChild(c);var p=!1;$.each(i,(function(t,a){p=!0,e.addRow(l,a.value,a.label)})),p||e.addRow(l);var u=document.createElement("tfoot");c=document.createElement("tr");var m=document.createElement("td");m.setAttribute("colspan","3");var g=document.createElement("button");g.style.minWidth="8em",g.setAttribute("type","button"),g.addEventListener("click",(function(){e.addRow(l)}),!1),g.textContent="Add",m.appendChild(g),c.appendChild(m),u.appendChild(c),s.appendChild(l),s.appendChild(u),r.appendChild(s);var f=document.createElement("button");f.setAttribute("type","submit"),f.addEventListener("click",(function(){e.save(a,l),n.close()}),!1),f.textContent="Save changes",r.appendChild(f),(f=document.createElement("button")).setAttribute("type","submit"),f.addEventListener("click",(function(){e.reset(a,l)}),!1),f.textContent="Reset",r.appendChild(f),(f=document.createElement("button")).setAttribute("type","submit"),f.addEventListener("click",(function(){n.close()}),!1),f.textContent="Cancel",r.appendChild(f),n.setContent(r),n.display()},e.reset=function(t,a){var i=$(t),o=i.data("pref"),n=i.data("value");Y.resetPref(o),$(a).find("tr").slice(1).remove();var r=i.data("value");$.each(r,(function(t,i){e.addRow(a,i.value,i.label)})),i.data("value",n)},e.save=function(e,t){var a=[],i={};$(t).find('input[type="text"]').each((function(e,t){$(t).hasClass("twinkle-config-customlist-value")?i={value:t.value}:(i.label=t.value,(i.value||i.label)&&a.push(i))})),$(e).data("value",a)},e}();function H(e,t,a,i){null!==V("portletArea")&&function(e,t,a,i,o){var n=document.getElementById(e)||document.querySelector(e);if(!n)return null;var r,s=document.getElementById(t);if(s)return s.parentNode&&s.parentNode===n?s:null;o&&(r=document.getElementById(o));var l,c,d=mw.config.get("skin");("vector"!==d||"left-navigation"!==e&&"right-navigation"!==e)&&(i=null);switch(d){case"vector":"portal"!==e&&"left-navigation"!==e&&"right-navigation"!==e&&(e="mw-panel"),l="mw-portlet vector-menu vector-menu-"+("mw-panel"===e?"portal":"menu"===i?"dropdown vector-menu-dropdown-noicon":"tabs"),c="vector-menu-content";break;case"modern":"mw_portlets"!==e&&"mw_contentwrapper"!==e&&(e="mw_portlets"),l="portlet";break;case"timeless":l="mw-portlet",c="mw-portlet-body";break;default:e="column-one",l="portlet"}var p=document.createElement("nav");p.setAttribute("aria-labelledby",t+"-label"),p.className=l+" emptyPortlet",p.id=t,r&&r.parentNode===n?n.insertBefore(p,r):n.appendChild(p);var u=document.createElement("h3");u.id=t+"-label";var m=document.createElement("ul");if("vector"===d){if(m.className="vector-menu-content-list",-1!==l.indexOf("vector-menu-dropdown")){var g=document.createElement("input");g.className="vector-menu-checkbox",g.setAttribute("type","checkbox"),g.setAttribute("aria-labelledby",t+"-label"),p.appendChild(g);var f=document.createElement("span");f.appendChild(document.createTextNode(a)),u.appendChild(f);var h=document.createElement("a");h.href="#",$(h).click((function(e){e.preventDefault()})),u.appendChild(h)}}else u.appendChild(document.createTextNode(a));if(p.appendChild(u),c){var b=document.createElement("div");b.className=c,b.appendChild(m),p.appendChild(b)}else p.appendChild(m)}(V("portletArea"),V("portletId"),V("portletName"),V("portletType"),V("portletNext"));var o=mw.util.addPortletLink(V("portletId"),"string"==typeof e?e:"#",t,a,i);return $(".client-js .skin-vector #p-cactions").css("margin-right","initial"),"function"==typeof e&&$(o).click((function(t){e(),t.preventDefault()})),$.collapsibleTabs&&$.collapsibleTabs.handleResize(),o}var K=function(){function e(){}return e.userPreferences=function(){},e.prototype.addPreference=function(e){Y.addPreference(this.moduleName,e)},e.prototype.beforeAddMenu=function(){},e.prototype.addMenu=function(){var e=this;this.beforeAddMenu(),H((function(){return e.makeWindow()}),this.portletName,this.portletId||"twinkle-"+this.moduleName.toLowerCase(),this.portletTooltip)},e.prototype.makeWindow=function(){},e}();function X(e){var t=e.userPreferences();t&&(Y.addGroup(e.moduleName,r(r({},t),{module:e.moduleName})),j(t.preferences.map((function(e){return{name:e.name,value:e.default}})))),J.includes(e.moduleName)||(g[e.moduleName.toLowerCase()]=new e)}var J=[];var Q=JSON.parse('{"@comment":"This file contains project-specific overrides for twinkle-core messages.","goodfaith-summary":"Reverted [[WP:AGF|good faith]] edits by %USER%","delete-redirect-summary":"[[WP:CSD#G8|G8]]: Redirect to deleted page \\"$1\\"","delete-talk-summary":"[[WP:CSD#G8|G8]]: [[Help:Talk page|Talk page]] of deleted page \\"$1\\"","block-64-help":"It\'s usually fine, if not better, to [[WP:/64|just block the /64]] range ([[Special:Contributions/$1|$1]]).","undeleting-talk-summary":"Undeleting [[Help:Talk page|talk page]] of \\"$1\\"","protect-tag-small-label":"Iconify (small=yes)","pref-xfdwatchdiscussion-tooltip":"This refers to the discussion subpage (for AfD and MfD) or the daily log page (for TfD, CfD, RfD and FfD)","pref-xfdwatchlist-label":"Add the daily log/list page to the watchlist (AfD and MfD)","pref-xfdwatchlist-tooltip":"This only applies for AfD and MfD, where the discussions are transcluded onto a daily log page (for AfD) or the main MfD page (for MfD)."}'),Z=function(e,t){return Z=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])},Z(e,t)};function ee(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function a(){this.constructor=e}Z(e,t),e.prototype=null===t?Object.create(t):(a.prototype=t.prototype,new a)}Object.create;Object.create;var te=function(e){function t(t,a){var i=e.call(this,t,a)||this;if(g.changeTags.length)i.setChangeTags(g.changeTags);else{var o=i.setEditSummary.bind(i);i.setEditSummary=function(e){o(e+g.summaryAd)}}return["load","lookupCreation","save","append","prepend","newSection","deletePage","undeletePage","protect","stabilize"].forEach((function(e){var t=i[e].bind(i);i[e]=function(e,a){var i=this,o=$.Deferred();return t((function(t){e&&e.call(i,i),o.resolve(t instanceof Morebits.wiki.api?t:i)}),(function(e){if(a&&a.call(i,i),e instanceof Morebits.wiki.api){var t=new f(e.getErrorCode()+": "+e.getErrorText());t.code=e.getErrorCode(),t.info=e.getErrorText(),t.response=e.getResponse(),o.reject(t)}else o.reject(new Error(e))})),o}})),i}return n(t,e),t}(Morebits.wiki.page),ae=function(e){function t(t,a){var i=e.call(this,t,a)||this;return i.setScriptName(g.scriptName),i}return n(t,e),t.prototype.setFooterLinks=function(e){var t=this;e&&C(e).forEach((function(e){t.addFooterLink(e[0],e[1])}))},t}(Morebits.simpleWindow),ie=function(e){function t(){var a=e.call(this)||this;if(a.moduleName="XFD",a.portletName="XFD",a.portletId="twinkle-xfd",a.windowTitle="Start a deletion discussion (XfD)",mw.config.get("wgNamespaceNumber")<0||!mw.config.get("wgArticleId")||6===mw.config.get("wgNamespaceNumber")&&document.getElementById("mw-sharedupload"))return a;for(var i=0,o=t.modeList;i<o.length;i++){var n=o[i];if(n.isDefaultChoice()){a.mode=new n;break}}return a.portletTooltip=a.getMenuTooltip(),a.addMenu(),a}return n(t,e),t.prototype.getMenuTooltip=function(){return this.mode?this.mode.getMenuTooltip():"Start a deletion discussion"},t.prototype.makeWindow=function(){var e=new ae(700,400);e.setTitle(this.windowTitle),e.setFooterLinks(this.footerlinks),this.makeForm(e)},t.prototype.makeForm=function(e){var a=this;this.Window=e;var i=new Morebits.quickForm((function(){a.mode.evaluate()}));i.append({type:"select",name:"venue",label:F("xfd-venue-label"),tooltip:F("xfd-venue-tooltip"),event:this.onCategoryChange.bind(this),list:t.modeList.map((function(e){return{type:"option",label:e.venueLabel,selected:a.mode instanceof e,value:e.venueCode}}))}),i.append({type:"div",id:"wrong-venue-warn",style:"color: red; font-style: italic"}),i.append({type:"checkbox",list:[{label:F("notify-creator-label"),value:"notify",name:"notifycreator",tooltip:F("notify-creator-tooltip"),checked:!0}]}),this.fieldset=i.append({type:"field",label:"Work area",name:"work_area"});var o=document.createElement("a");$(o).click((function(){a.mode.preview(a.result)})),o.style.cursor="pointer",o.textContent="Preview",i.append({type:"div",id:"xfdpreview",label:[o]}),i.append({type:"div",id:"twinklexfd-previewbox",style:"display: none"}),i.append({type:"submit"}),this.result=i.render(),e.setContent(this.result),e.display(),this.result.previewer=new Morebits.wiki.preview(document.getElementById("twinklexfd-previewbox"));var n=document.createEvent("Event");return n.initEvent("change",!0,!0),this.result.venue.dispatchEvent(n),i},t.prototype.onCategoryChange=function(e){var a=e.target.value,i=e.target.form,o=t.modeList.filter((function(e){return e.venueCode===a}))[0];if(!o)throw new Error(F("bad-venue",a));this.mode=new o,this.mode.result=this.result,this.mode.Window=this.Window,$("#wrong-venue-warn").text(this.mode.getVenueWarning()||""),i.previewer.closePreview();var n=this.mode.generateFieldset().render();$(this.result).find("fieldset[name=work_area]").replaceWith(n),this.mode.postRender(n)},t.userPreferences=function(){return{title:"XfD (deletion discussions)",preferences:[{name:"logXfdNominations",label:F("pref-logxfdnominations-label"),helptip:F("pref-logxfdnominations-tooltip"),type:"boolean",default:!1},{name:"xfdLogPageName",label:F("pref-xfdlogpagename-label"),helptip:F("pref-xfdlogpagename-tooltip"),type:"string",default:"XfD log"},{name:"xfdWatchPage",label:F("pref-xfdwatchpage-label"),helptip:F("pref-xfdwatchpage-tooltip"),type:"enum",enumValues:Y.watchlistEnums,default:"default"},{name:"xfdWatchDiscussion",label:F("pref-xfdwatchdiscussion-label"),helptip:F("pref-xfdwatchdiscussion-tooltip"),type:"enum",enumValues:Y.watchlistEnums,default:"default"},{name:"xfdWatchList",label:F("pref-xfdwatchlist-label"),helptip:F("pref-xfdwatchlist-tooltip"),type:"enum",enumValues:Y.watchlistEnums,default:"no"},{name:"xfdWatchUser",label:F("pref-xfdwatchuser-label"),helptip:F("pref-xfdwatchuser-tooltip"),type:"enum",enumValues:Y.watchlistEnums,default:"default"}]}},t.moduleName="XFD",t}(K),oe=function(){function e(){}return e.isDefaultChoice=function(){return!1},e.prototype.getMenuTooltip=function(){return"Nominate page for deletion"},e.prototype.generateFieldset=function(){return this.fieldset=new Morebits.quickForm.element({type:"field",label:this.getFieldsetLabel(),name:"work_area"}),this.fieldset},e.prototype.appendReasonArea=function(){this.fieldset.append({type:"textarea",name:"reason",label:F("reason"),value:$(this.result).find("textarea").val()||"",tooltip:F("reason-tooltip")})},e.prototype.postRender=function(e){},e.prototype.getVenueWarning=function(){},e.prototype.preprocessParams=function(){},e.prototype.preview=function(e){this.params=Morebits.quickForm.getInputData(e),this.preprocessParams(),this.showPreview(e)},e.prototype.showPreview=function(e){var t=this.getDiscussionWikitext();e.previewer.beginRender(t,"WP:TW")},e.prototype.evaluate=function(){this.params=Morebits.quickForm.getInputData(this.result),this.preprocessParams(),this.validateInput()&&(Morebits.simpleWindow.setButtonsEnabled(!1),Morebits.status.init(this.result),this.tm=new Morebits.taskManager(this))},e.prototype.validateInput=function(){return!0},e.prototype.printReasonText=function(){Morebits.status.printUserText(this.params.reason,F("deletion-reason-here"))},e.prototype.redirectToDiscussion=function(){var e=this.params.discussionpage||this.params.logpage;Morebits.status.actionCompleted(F("nomination-complete-redirect")),setTimeout((function(){window.location.href=mw.util.getUrl(e)}),Morebits.wiki.actionCompleted.timeOut)},e.prototype.determineDiscussionPage=function(){var e=this,t=this.params;return new E(F("looking-old-nominations"),{action:"query",list:"allpages",apprefix:new mw.Title(this.discussionPagePrefix).getMain()+"/"+Morebits.pageNameNorm,apnamespace:4,apfilterredir:"nonredirects",aplimit:"max",format:"json"}).post().then((function(a){var i=a.getResponse().query.allpages;if(i.length<=0)t.numbering=t.number="";else{for(var o=0,n=new RegExp("^"+Morebits.string.escapeRegExp(e.discussionPagePrefix+"/"+Morebits.pageNameNorm)+"\\s*\\(\\s*(\\d+)(?:(?:th|nd|rd|st) nom(?:ination)?)?\\s*\\)\\s*$"),r=0;r<i.length;++r){var s=i[r].title;if(s!==e.discussionPagePrefix+"/"+Morebits.pageNameNorm){var l=n.exec(s);l&&(o=Math.max(o,Number(l[1])))}else o=Math.max(o,1)}t.number=function(e){switch(e){case 1:return"";case 2:return"2nd";case 3:return"3rd";default:return e+"th"}}(o+1),t.numbering=o>0?" ("+t.number+" nomination)":""}t.discussionpage=e.discussionPagePrefix+"/"+Morebits.pageNameNorm+t.numbering,a.getStatusElement().info("next in order is "+t.discussionpage)}))},e.prototype.autoEditRequest=function(e){var t=this.params,a=new mw.Title(e.getPageName()).getTalkPage().toText();if(a===e.getPageName())return e.getStatusElement().error(F("protected-no-editreq")),$.Deferred().reject();e.getStatusElement().warn(F("protected-editreq"));var i="{{subst:Xfd edit protected|page="+e.getPageName()+"|discussion="+t.discussionpage+"|tag=<no"+"wiki>"+t.tagText+"</no"+"wiki>}}",o=new te(a,F("posting-editreq"));return o.setNewSectionTitle(F("xfd-editreq-title",t.venue)),o.setNewSectionText(i),o.setCreateOption("recreate"),o.setWatchlist(V("xfdWatchPage")),o.setFollowRedirect(!0),o.newSection().catch((function(){return o.getStatusElement().warn(F("xfd-editreq-failed")),$.Deferred().reject()}))},e.prototype.fetchCreatorInfo=function(){var e=this,t=new te(Morebits.pageNameNorm,F("fetching-creator"));return t.setLookupNonRedirectCreator(this.params.lookupNonRedirectCreator),t.lookupCreation().then((function(){e.params.initialContrib=t.getCreator(),t.getStatusElement().info("Found "+t.getCreator())}))},e.prototype.notifyTalkPage=function(e,t){var a=this.params,i=mw.Title.newFromText(e,m),o=i.getNamespaceId(),n=i.getRelativeText(m);t=t||new Morebits.status(F("notifying-creator",n));var r=i.toText();if(3===o&&n===mw.config.get("wgUserName"))return a.initialContrib=null,t.warn(F("notify-self-skip",n)),$.Deferred().resolve();var s=new te(r,t);return s.setAppendText("\n\n"+this.getNotifyText()),s.setEditSummary(this.getNotifyEditSummary()),s.setCreateOption("recreate"),"RfD"===a.venue&&3!==o?s.setWatchlist(V("xfdWatchRelated")):s.setWatchlist(V("xfdWatchUser")),s.setFollowRedirect(!0,!1),s.append().catch((function(){a.initialContrib=null}))},e.prototype.getNotifyText=function(){return"{{subst:"+this.params.venue+" notice|1="+Morebits.pageNameNorm+"}} ~~~~"},e.prototype.getNotifyEditSummary=function(){return"Notification: [["+this.params.discussionpage+"|listing]] of [[:"+Morebits.pageNameNorm+"]] at [[WP:"+this.getFieldsetLabel()+"]]."},e.prototype.notifyCreator=function(){return this.params.notifycreator?this.notifyTalkPage(this.params.initialContrib):(this.params.intialContrib=null,$.Deferred().resolve())},e.prototype.addToLog=function(){var e=this.params;if(!V("logXfdNominations")||-1!==V("noLogOnXfdNomination").indexOf(e.venue.toLowerCase()))return $.Deferred().resolve();var t=new Morebits.userspaceLogger(V("xfdLogPageName"));return t.initialText="This is a log of all [[WP:XFD|deletion discussion]] nominations made by this user using [[WP:TW|Twinkle]]'s XfD module.\n\nIf you no longer wish to keep this log, you can turn it off using the [[Wikipedia:Twinkle/Preferences|preferences panel]], and nominate this page for speedy deletion under [[WP:CSD#U1|CSD U1]]."+(Morebits.userIsSysop?"\n\nThis log does not track XfD-related deletions made using Twinkle.":""),t.changeTags=g.changeTags,t.log(this.getUserspaceLoggingText(),this.getUserspaceLoggingEditSummary())},e.prototype.getUserspaceLoggingEditSummary=function(){return"Logging "+this.params.venue+" nomination of [[:"+Morebits.pageNameNorm+"]]."},e.prototype.getUserspaceLoggingText1=function(){return"\n\t\t\t# [[:{{subst:FULLPAGENAME}}]]: {{subst:#ifeq:{{subst:NAMESPACENUMBER}}|6| ([{{fullurl:Special:Log|page={{urlencode:{{subst:FULLPAGENAME}}}}}} log])|}} nominated at [[WP:{{subst:uc:$1}}|$1]]{{subst:#if:$2|; notified {{user|1=$2}}|}}\n\t\t"},e.prototype.getUserspaceLoggingText=function(){var e=this.params,t=mw.config.get("wgNamespaceNumber")===d?" ([{{fullurl:Special:Log|page="+mw.util.wikiUrlencode(mw.config.get("wgPageName"))+"}} log])":"",a=e.discussionpage?"[["+e.discussionpage+"|nominated]]":"nominated",i="# [[:"+Morebits.pageNameNorm+"]]:"+t+" "+a+" at [[WP:"+e.venue+"|"+e.venue+"]]";return i+=this.getUserspaceLoggingExtraInfo(),e.initialContrib&&e.notifycreator&&(i+="; notified {{user|1="+e.initialContrib+"}}"),i+=" ~~~~~",e.reason&&(i+="\n#* '''Reason''': "+Morebits.string.formatReasonForLog(e.reason)),i},e.prototype.getUserspaceLoggingExtraInfo=function(){return""},e}();var ne,re="short description|hatnote|main|correct title|dablink|distinguish|for|further|selfref|year dab|similar names|highway detail hatnote|broader|about(?:-distinguish| other people)?|other\\s?(?:hurricane(?: use)?s|people|persons|places|ships|uses(?: of)?)|redirect(?:-(?:distinguish|synonym|multi))?|see\\s?(?:wiktionary|also(?: if exists)?)";function se(e){if($(e).length)if(ne)$(e).html(ne);else{var t=new Morebits.wiki.preview($(e)[0]);t.beginRender("({{Find sources|"+Morebits.pageNameNorm+"}})","WP:AFD").then((function(){ne=t.previewbox.innerHTML,$(e).removeClass("morebits-previewbox")}))}}var le=["Template:Retired","Template:Deceased Wikipedian"],ce=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.discussionPagePrefix="Wikipedia:Articles for deletion",t}return ee(t,e),t.isDefaultChoice=function(){return 0===mw.config.get("wgNamespaceNumber")&&!Morebits.isPageRedirect()},t.prototype.getFieldsetLabel=function(){return"Articles for deletion"},t.prototype.getVenueWarning=function(){return 0!==mw.config.get("wgNamespaceNumber")?"AfD is generally appropriate only for articles.":mw.config.get("wgIsRedirect")?"Please use RfD for redirects.":void 0},t.prototype.getMenuTooltip=function(){return"Nominate article for deletion or move"},t.prototype.generateFieldset=function(){this.fieldset=e.prototype.generateFieldset.call(this),this.fieldset.append({type:"div",label:"",style:"margin-bottom: 5px;"}),this.fieldset.append({type:"checkbox",list:[{label:"Wrap deletion tag with <noinclude>",value:"noinclude",name:"noinclude",tooltip:"Will wrap the deletion tag in <noinclude> tags, so that it won't transclude. This option is not normally required."}]}),this.fieldset.append({type:"select",name:"xfdcat",label:"Choose what category this nomination belongs in:",list:[{type:"option",label:"Unknown",value:"?",selected:!0},{type:"option",label:"Media and music",value:"M"},{type:"option",label:"Organisation, corporation, or product",value:"O"},{type:"option",label:"Biographical",value:"B"},{type:"option",label:"Society topics",value:"S"},{type:"option",label:"Web or internet",value:"W"},{type:"option",label:"Games or sports",value:"G"},{type:"option",label:"Science and technology",value:"T"},{type:"option",label:"Fiction and the arts",value:"F"},{type:"option",label:"Places and transportation",value:"P"},{type:"option",label:"Indiscernible or unclassifiable topic",value:"I"},{type:"option",label:"Debate not yet sorted",value:"U"}]});var t=this.fieldset.append({type:"select",multiple:!0,name:"delsortCats",label:"Choose deletion sorting categories: ",tooltip:"Select a few categories that are specifically relevant to the subject of the article. Be as precise as possible; categories like People and USA should only be used when no other categories apply."});return $.each({People:["People","Academics and educators","Actors and filmmakers","Artists","Authors","Bands and musicians","Businesspeople","Politicians","Sportspeople","Women","Lists of people"],Arts:["Arts","Fictional elements","Science fiction and fantasy"],"Arts/Culinary":["Food and drink","Wine"],"Arts/Language":["Language","Academic journals","Bibliographies","Journalism","Literature","Logic","News media","Philosophy","Poetry"],"Arts/Performing":["Albums and songs","Dance","Film","Magic","Music","Radio","Television","Theatre","Video games"],"Arts/Visual arts":["Visual arts","Architecture","Fashion","Photography"],"Arts/Comics and animation":["Comics and animation","Anime and manga","Webcomics"],"Places of interest":["Museums and libraries","Shopping malls"],Topical:["Animal","Bilateral relations","Conservatism","Conspiracy theories","Crime","Disability","Discrimination","Entertainment","Ethnic groups","Events","Finance","Games","Health and fitness","History","Law","Military","Organizations","Paranormal","Piracy","Politics","Terrorism"],"Topical/Business":["Business","Advertising","Companies","Management","Products"],"Topical/Culture":["Beauty pageants","Fashion","Mythology","Popular culture","Sexuality and gender"],"Topical/Education":["Education","Fraternities and sororities","Schools"],"Topical/Religion":["Religion","Atheism","Bible","Buddhism","Christianity","Islam","Judaism","Hinduism","Paganism","Sikhism","Spirituality"],"Topical/Science":["Science","Archaeology","Astronomy","Behavioural science","Biology","Economics","Engineering","Environment","Geography","Mathematics","Medicine","Organisms","Psychiatry","Psychology","Social science"],"Topical/Sports":["Sports","American football","Baseball","Basketball","Bodybuilding","Boxing","Cricket","Cycling","Football","Golf","Handball","Horse racing","Ice hockey","Motorsport","Rugby union","Softball","Martial arts","Wrestling"],"Topical/Technology":["Technology","Aviation","Computing","Firearms","Internet","Software","Transportation","Websites"],"Wikipedia page type":["Disambiguations","Lists"],"Geographic/Africa":["Africa","Algeria","Democratic Republic of the Congo","Egypt","Ethiopia","Ghana","Kenya","Libya","Mauritius","Morocco","Nigeria","Somalia","South Africa","Zimbabwe"],"Geographic/Asia":["Asia","Afghanistan","Bangladesh","Brunei","Cambodia","China","Hong Kong","Indonesia","Japan","Korea","Laos","Malaysia","Maldives","Mongolia","Myanmar","Nepal","Pakistan","Philippines","Singapore","South Korea","Sri Lanka","Taiwan","Thailand","Vietnam"],"Geographic/Asia/Central Asia":["Central Asia","Kazakhstan","Kyrgyzstan","Tajikistan","Turkmenistan","Uzbekistan"],"Geographic/Asia/Middle East":["Middle East","Bahrain","Iran","Iraq","Israel","Jordan","Kuwait","Lebanon","Libya","Palestine","Qatar","Saudi Arabia","Syria","United Arab Emirates","Yemen"],"Geographic/Asia/India":["India","Kerala"],"Geographic/Europe":["Europe","Albania","Armenia","Austria","Azerbaijan","Belarus","Belgium","Bosnia and Herzegovina","Bulgaria","Croatia","Cyprus","Czech Republic","Denmark","Estonia","Finland","France","Georgia (country)","Germany","Greece","Hungary","Iceland","Ireland","Italy","Jersey","Kosovo","Latvia","Lithuania","Luxembourg","Malta","Moldova","Montenegro","Netherlands","North Macedonia","Norway","Poland","Portugal","Romania","Russia","Serbia","Slovakia","Slovenia","Spain","Sweden","Switzerland","Turkey","Ukraine","Yugoslavia"],"Geographic/Europe/United Kingdom":["United Kingdom","England","Northern Ireland","Scotland","Wales"],"Geographic/Oceania":["Oceania","Antarctica","Australia","New Zealand"],"Geographic/Americas/Canada":["Canada","Alberta","British Columbia","Manitoba","Nova Scotia","Ontario","Quebec"],"Geographic/Americas/Latin America":["Latin America","Caribbean","South America","Argentina","Barbados","Belize","Bolivia","Brazil","Chile","Colombia","Costa Rica","Cuba","Ecuador","El Salvador","Grenada","Guatemala","Haiti","Mexico","Nicaragua","Panama","Paraguay","Peru","Puerto Rico","Trinidad and Tobago","Uruguay","Venezuela"],"Geographic/Americas/USA":["United States of America","Alabama","Alaska","Arizona","Arkansas","California","Colorado","Connecticut","Delaware","Florida","Georgia (U.S. state)","Hawaii","Idaho","Illinois","Indiana","Iowa","Kansas","Kentucky","Louisiana","Maine","Maryland","Massachusetts","Michigan","Minnesota","Mississippi","Missouri","Montana","Nebraska","Nevada","New Hampshire","New Jersey","New Mexico","New York","North Carolina","North Dakota","Ohio","Oklahoma","Oregon","Pennsylvania","Rhode Island","South Carolina","South Dakota","Tennessee","Texas","Utah","Vermont","Virginia","Washington","Washington, D.C.","West Virginia","Wisconsin","Wyoming"],"Geographic/Unsorted":["Islands"]},(function(e,a){var i=t.append({type:"optgroup",label:e});a.forEach((function(e){i.append({type:"option",label:e,value:e})}))})),this.appendReasonArea(),this.fieldset},t.prototype.postRender=function(e){se("#twinkle-xfd-findsources"),$(e).find("[name=delsortCats]").attr("data-placeholder","Select delsort pages").select2({width:"100%",matcher:Morebits.select2.matchers.optgroupFull,templateResult:Morebits.select2.highlightSearchMatches,language:{searching:Morebits.select2.queryInterceptor},templateSelection:function(e){return $("<a>").text(e.text).attr({href:mw.util.getUrl("Wikipedia:WikiProject_Deletion_sorting/"+e.text),target:"_blank"})}}),mw.util.addCSS(".select2-container--default.select2-container--focus .select2-selection--multiple { border: 1px solid #aaa; }.select2-results .select2-results__option { padding-top: 1px; padding-bottom: 1px; }.select2-results .select2-results__group { padding-top: 1px; padding-bottom: 1px; } .select2-container .select2-dropdown .select2-results { font-size: 13px; }.select2-container .selection .select2-selection__rendered { font-size: 13px; }.select2-selection__choice__remove { font-size: 130%; }")},t.prototype.evaluate=function(){var t=this;e.prototype.evaluate.call(this),this.tm.add(this.checkPage,[]),this.tm.add(this.determineDiscussionPage,[]),this.tm.add(this.createDiscussionPage,[this.checkPage,this.determineDiscussionPage],this.printReasonText),this.tm.add(this.tagPage,[this.checkPage,this.createDiscussionPage]),this.tm.add(this.addToList,[this.createDiscussionPage]),this.tm.add(this.addToDelsortLists,[this.createDiscussionPage]),this.tm.add(this.patrolPage,[this.checkPage]),this.tm.add(this.fetchCreatorInfo,[]),this.tm.add(this.notifyCreator,[this.createDiscussionPage,this.fetchCreatorInfo]),this.tm.add(this.addToLog,[this.notifyCreator]),this.tm.execute().then((function(){return t.redirectToDiscussion()}))},t.prototype.preprocessParams=function(){this.params.lookupNonRedirectCreator=!0},t.prototype.checkPage=function(){var e=this,t=new te(mw.config.get("wgPageName"),"Adding deletion tag to article");return t.setFollowRedirect(!0),t.load().then((function(){var a=t.getPageText(),i=t.getStatusElement();if(e.params.articleLoadTime=t.getLoadTime(),!t.exists())return i.error("It seems that the page doesn't exist; perhaps it has already been deleted"),$.Deferred().reject();var o=a.replace(/<!--.*AfD.*\n\{\{(?:Article for deletion\/dated|AfDM).*\}\}\n<!--.*(?:\n<!--.*)?AfD.*(?:\s*\n)?/g,"");if(a!==o){if(!confirm("An AfD tag was found on this article. Maybe someone beat you to it. \nClick OK to replace the current AfD tag (not recommended), or Cancel to abandon your nomination."))return i.error("Article already tagged with AfD tag, and you chose to abort"),window.location.reload(),$.Deferred().reject();t.setPageText(o)}return t}))},t.prototype.tagPage=function(e){var t=this.params;if(t.tagText=(t.noinclude?"<noinclude>{{":"{{")+(""===t.number?"subst:afd|help=off":"subst:afdx|"+t.number+"|help=off")+(t.noinclude?"}}</noinclude>\n":"}}\n"),e.canEdit()){var a=e.getPageText(),i=(a=a.replace(/\{\{\s*(dated prod|dated prod blp|Prod blp\/dated|Proposed deletion\/dated|prod2|Proposed deletion endorsed|Userspace draft)\s*(\|(?:\{\{[^{}]*\}\}|[^{}])*)?\}\}\s*/gi,"")).replace(/\{\{\s*(db(-\w*)?|delete|(?:hang|hold)[- ]?on)\s*(\|(?:\{\{[^{}]*\}\}|[^{}])*)?\}\}\s*/gi,"");return a!==i&&confirm("A speedy deletion tag was found on this page. Should it be removed?")&&(a=i),a=new Morebits.wikitext.page(a).insertAfterTemplates(t.tagText,re).getText(),e.setPageText(a),e.setEditSummary("Nominated for deletion; see [[:"+t.discussionpage+"]]."),e.setWatchlist(V("xfdWatchPage")),e.setCreateOption("nocreate"),e.save()}return this.autoEditRequest(e)},t.prototype.getDiscussionWikitext=function(){var e=this.params;return P("subst:afd2",{text:Morebits.string.formatReasonText(e.reason,!0),pg:Morebits.pageNameNorm,cat:e.xfdcat})+e.delsortCats.map((function(e){return"\n{{subst:delsort|"+e+"|~~~~}}"})).join("")},t.prototype.createDiscussionPage=function(){var e=this,t=this.params,a=new te(t.discussionpage,"Creating article deletion discussion page");return a.load().then((function(){return a.setPageText(e.getDiscussionWikitext()),a.setEditSummary("Creating deletion discussion page for [[:"+Morebits.pageNameNorm+"]]."),a.setWatchlist(V("xfdWatchDiscussion")),a.setCreateOption("createonly"),a.save()}))},t.prototype.addToList=function(){var e=this.params,t=new Morebits.date(e.articleLoadTime),a=new te("Wikipedia:Articles for deletion/Log/"+t.format("YYYY MMMM D","utc"),"Adding discussion to today's list");return a.setFollowRedirect(!0),a.load().then((function(){var t,i=a.getStatusElement(),o="{{subst:afd3|pg="+Morebits.pageNameNorm+e.numbering+"}}\n";if(a.exists()){var n=a.getPageText()+"\n";if((t=n.replace(/(<!-- Add new entries to the TOP of the following list -->\n+)/,"$1"+o))===n){var r=document.createElement("a");return r.setAttribute("href",mw.util.getUrl("Wikipedia:Twinkle/Fixing AFD")+"?action=purge"),r.appendChild(document.createTextNode("How to fix AFD")),i.error(["Could not find the target spot for the discussion. To fix this problem, please see ",r,"."]),$.Deferred().reject()}}else t="{{subst:AfD log}}\n"+o;return a.setPageText(t),a.setEditSummary("Adding [[:"+e.discussionpage+"]]."),a.setWatchlist(V("xfdWatchList")),a.setCreateOption("recreate"),a.save()}))},t.prototype.addToDelsortLists=function(){var e=this.params,t=e.delsortCats.map((function(t){var a=new te("Wikipedia:WikiProject Deletion sorting/"+t,"Adding to list of "+t+"-related deletion discussions");return a.setFollowRedirect(!0),a.load().then((function(){var t=e.discussionpage,i=a.getPageText().replace("directly below this line --\x3e","directly below this line --\x3e\n{{"+t+"}}");return a.setPageText(i),a.setEditSummary("Listing [[:"+t+"]]."),a.setCreateOption("nocreate"),a.save().catch((function(){}))}))}));return $.when.apply($,t)},t.prototype.patrolPage=function(){return V("markXfdPagesAsPatrolled")&&new te(Morebits.pageNameNorm).triage(),$.Deferred().resolve()},t.prototype.getNotifyText=function(){return P("subst:afd notice",{1:Morebits.pageNameNorm,order:this.params.numbering?"|order= "+this.params.numbering:""})+" ~~~~"},t.venueCode="AfD",t.venueLabel="AfD (Articles for deletion)",t}(oe),de=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ee(t,e),t.prototype.getFieldsetLabel=function(){return"Templates for discussion"},t.prototype.getMenuTooltip=function(){return"Start a discussion for deleting or merging this template"},t.isDefaultChoice=function(){return-1!==[10,828].indexOf(mw.config.get("wgNamespaceNumber"))},t.prototype.generateFieldset=function(){this.fieldset=e.prototype.generateFieldset.call(this);var t="Scribunto"===mw.config.get("wgPageContentModel")?"module":"template";return this.fieldset.append({type:"select",label:"Choose type of action wanted: ",name:"xfdcat",event:function(e){var a=e.target,i=a.form.tfdtarget;"TfM"!==a.value||i?($(Morebits.quickForm.getElementContainer(i)).remove(),i=null):(i=new Morebits.quickForm.element({name:"tfdtarget",type:"input",label:"Other "+t+" to be merged: ",tooltip:"Required. Should not include the "+Morebits.string.toUpperCaseFirstChar(t)+": namespace prefix.",required:!0}),a.parentNode.appendChild(i.render()))},list:[{type:"option",label:"Deletion",value:"TfD",selected:!0},{type:"option",label:"Merge",value:"TfM"}]}),this.fieldset.append({type:"select",name:"templatetype",label:"Deletion tag display style: ",tooltip:"Which <code>type=</code> parameter to pass to the TfD tag template.",list:"module"===t?[{type:"option",value:"module",label:"Module",selected:!0}]:[{type:"option",value:"standard",label:"Standard",selected:!0},{type:"option",value:"sidebar",label:"Sidebar/infobox",selected:!!$(".infobox").length},{type:"option",value:"inline",label:"Inline template",selected:!!$(".mw-parser-output > p .Inline-Template").length},{type:"option",value:"tiny",label:"Tiny inline"}]}),this.fieldset.append({type:"checkbox",list:[{label:"Wrap deletion tag with <noinclude> (for substituted templates only)",value:"noinclude",name:"noinclude",tooltip:"Will wrap the deletion tag in <noinclude> tags, so that it won't get substituted along with the template.",disabled:"module"===t,checked:!!$(".box-Subst_only").length}]}),this.fieldset.append({type:"checkbox",list:[{label:"Notify users of the template",value:"devpages",name:"devpages",tooltip:"A notification template will be sent to Twinkle, AWB, and RedWarn if this is true.",checked:!0}]}),this.appendReasonArea(),this.fieldset},t.prototype.preprocessParams=function(){this.params.tfdtarget&&(this.params.tfdtarget=b(this.params.tfdtarget)),this.params.scribunto="Scribunto"===mw.config.get("wgPageContentModel"),"TfM"===this.params.xfdcat&&(this.params.otherTemplateName=(this.params.scribunto?"Module:":"Template:")+this.params.tfdtarget)},t.prototype.evaluate=function(){var t=this;e.prototype.evaluate.call(this),this.tm.add(this.tagPage,[]),this.tm.add(this.addToList,[this.tagPage],this.printReasonText),this.tm.add(this.watchModule,[]),this.tm.add(this.fetchCreatorInfo,[]),this.tm.add(this.notifyCreator,[this.fetchCreatorInfo]),this.tm.add(this.notifyOtherCreator,[this.fetchCreatorInfo]),this.tm.add(this.notifyDevs,[this.addToList]),this.tm.add(this.addToLog,[this.notifyCreator]),this.tm.execute().then((function(){return t.redirectToDiscussion()}))},t.prototype.tagPage=function(){return"TfM"===this.params.xfdcat?this.tagPagesForMerge():this.tagPageForDeletion()},t.prototype.setLogPageAndDiscussionPage=function(e){var t=new Morebits.date(e);this.params.logpage="Wikipedia:Templates for discussion/Log/"+t.format("YYYY MMMM D","utc"),this.params.discussionpage=this.params.logpage+"#"+Morebits.pageNameNorm},t.prototype.tagPageForDeletion=function(){var e=this,t=this.params,a=new te(Morebits.pageNameNorm+(t.scribunto?"/doc":""),"Tagging "+(t.scribunto?"module documentation":"template")+" with deletion tag");return a.setFollowRedirect(!0),a.load().then((function(){e.setLogPageAndDiscussionPage(a.getLoadTime());var i=a.getPageText();return t.tagText="{{subst:template for discussion|help=off"+("standard"!==t.templatetype?"|type="+t.templatetype:"")+"}}","sanitized-css"===a.getContentModel()?t.tagText="/* "+t.tagText+" */":(t.noinclude&&(t.tagText="<noinclude>"+t.tagText+"</noinclude>"),t.tagText+="standard"===t.templatetype||"sidebar"===t.templatetype?"\n":""),a.canEdit()&&-1!==["wikitext","sanitized-css"].indexOf(a.getContentModel())?(a.setPageText(t.tagText+i),a.setEditSummary("Nominated for deletion; see [[:"+t.discussionpage+"]]."),a.setWatchlist(V("xfdWatchPage")),t.scribunto&&a.setCreateOption("recreate"),a.save()):e.autoEditRequest(a)}))},t.prototype.tagPagesForMerge=function(){var e=this,t=this.params,a=t.scribunto?"/doc":"",i=t.scribunto?"module documentation":"template",o=new te(""+Morebits.pageNameNorm+a,"Tagging "+i+" with merge tag");o.setFollowRedirect(!0);var n=o.load().then((function(){return e.setLogPageAndDiscussionPage(o.getLoadTime()),e.tagForMerge(o,e.params)})),r=new te(""+t.otherTemplateName+a,"Tagging other "+i+" with merge tag");r.setFollowRedirect(!0);var s=r.load().then((function(){return e.setLogPageAndDiscussionPage(o.getLoadTime()),e.tagForMerge(r,$.extend({},t,{otherTemplateName:Morebits.pageNameNorm}))}));return $.when(n,s)},t.prototype.tagForMerge=function(e,t){var a=e.getPageText();return t.tagText="{{subst:tfm|help=off|"+("standard"!==t.templatetype?"type="+t.templatetype+"|":"")+"1="+t.otherTemplateName.replace(/^(?:Template|Module):/,"")+"}}","sanitized-css"===e.getContentModel()?t.tagText="/* "+t.tagText+" */":(t.noinclude&&(t.tagText="<noinclude>"+t.tagText+"</noinclude>"),t.tagText+="standard"===t.templatetype||"sidebar"===t.templatetype?"\n":""),e.canEdit()&&-1!==["wikitext","sanitized-css"].indexOf(e.getContentModel())?(e.setPageText(t.tagText+a),e.setEditSummary("Listed for merging with [[:"+t.otherTemplateName+"]]; see [[:"+t.discussionpage+"]]."),e.setWatchlist(V("xfdWatchPage")),t.scribunto&&e.setCreateOption("recreate"),e.save()):this.autoEditRequest(e)},t.prototype.addToList=function(){var e=this,t=this.params,a=new te(t.logpage,"Adding discussion to today's log");return a.setFollowRedirect(!0),a.load().then((function(){var i,o=a.getStatusElement(),n=e.getDiscussionWikitext();if(a.exists()){var r=a.getPageText();if((i=r.replace("--\x3e","--\x3e\n"+n))===r)return o.error("failed to find target spot for the discussion"),$.Deferred().reject()}else i="{{subst:TfD log}}\n"+n;return a.setPageText(i),a.setEditSummary("Adding "+("TfD"===t.xfdcat?"deletion nomination":"merge listing")+" of [[:"+Morebits.pageNameNorm+"]]."),a.setWatchlist(V("xfdWatchDiscussion")),a.setCreateOption("recreate"),a.save()}))},t.prototype.notifyOtherCreator=function(){var e=this;if(!this.params.otherTemplateName)return $.Deferred().resolve();var t=new te(this.params.otherTemplateName,"Finding other page creator");return t.lookupCreation().then((function(){var a=t.getCreator();if(t.getStatusElement().info("Found "+a),a!==e.params.initialContrib)return e.notifyTalkPage(a)}))},t.prototype.notifyDevs=function(){var e=this;if(!this.params.devpages)return $.Deferred().resolve();var t=mw.config.get("wgCategories");return $.when.apply($,C({"Templates used by Twinkle":"Wikipedia talk:Twinkle","Templates used by AutoWikiBrowser":"Wikipedia talk:AutoWikiBrowser","Templates used by RedWarn":"Wikipedia talk:RedWarn"}).filter((function(e){var a=e[0];e[1];return t.includes(a)})).map((function(t){t[0];var a=t[1];return e.notifyTalkPage(a,new Morebits.status("Notifying "+a+" of template nomination"))})))},t.prototype.watchModule=function(){var e=this.params;if(!e.scribunto)return $.Deferred().resolve();var t=V("xfdWatchPage");if(!("no"!==t&&("default"!==t||!!parseInt(mw.user.options.get("watchdefault"),10))))return $.Deferred().resolve();var a={action:"watch",titles:[mw.config.get("wgPageName")],token:mw.user.tokens.get("watchToken"),watchlistexpiry:"default"!==t&&"yes"!==t&&t};return"TfM"===e.xfdcat&&a.titles.push(e.otherTemplateName),new E("Adding Module to watchlist",a).post()},t.prototype.getDiscussionWikitext=function(){return P("subst:"+this.params.xfdcat+"2",{text:Morebits.string.formatReasonText(this.params.reason,!0),1:mw.config.get("wgTitle"),module:this.params.scribunto?"Module:":"",2:this.params.tfdtarget})},t.prototype.getNotifyText=function(){var e="{{subst:tfd notice";return"TfM"===this.params.xfdcat&&(e="\n{{subst:Tfm notice|2="+this.params.tfdtarget),e+="|1="+Morebits.pageNameNorm+"}} ~~~~"},t.prototype.getUserspaceLoggingExtraInfo=function(){var e=this.params,t="";if("TfM"===e.xfdcat&&(t+=" (merge)",e.tfdtarget)){var a="Scribunto"===mw.config.get("wgPageContentModel")?"Module:":"Template:";t+="; Other "+a.toLowerCase()+" [[",/^:?(?:template|module):/i.test(e.tfdtarget)||(t+=a),t+=e.tfdtarget+"]]"}return t},t.venueCode="TfD",t.venueLabel="TfD (Templates for discussion)",t}(oe),pe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ee(t,e),t.isDefaultChoice=function(){return 6===mw.config.get("wgNamespaceNumber")},t.prototype.getFieldsetLabel=function(){return"Files for discussion"},t.prototype.getMenuTooltip=function(){return"Start a discussion for deleting this file"},t.prototype.getVenueWarning=function(){if(6!==mw.config.get("wgNamespaceNumber"))return"FFD is selected but this page doesn't look like a file!"},t.prototype.generateFieldset=function(){return this.fieldset=e.prototype.generateFieldset.call(this),this.appendReasonArea(),this.fieldset},t.prototype.preview=function(e){var t=this;this.params=Morebits.quickForm.getInputData(e),this.preprocessParams(),this.fetchCreatorInfo().then((function(){t.showPreview(e)}))},t.prototype.evaluate=function(){var t=this;e.prototype.evaluate.call(this),this.tm.add(this.fetchCreatorInfo,[]),this.tm.add(this.tagPage,[]),this.tm.add(this.addToList,[this.fetchCreatorInfo,this.tagPage],this.printReasonText),this.tm.add(this.notifyCreator,[this.fetchCreatorInfo]),this.tm.add(this.addToLog,[this.notifyCreator]),this.tm.execute().then((function(){return t.redirectToDiscussion()}))},t.prototype.tagPage=function(){var e=this,t=this.params,a=new te(mw.config.get("wgPageName"),"Adding deletion tag to file page");return a.setFollowRedirect(!0),a.load().then((function(){var i=a.getPageText(),o=new Morebits.date(a.getLoadTime()).format("YYYY MMMM D","utc");return t.logpage="Wikipedia:Files for discussion/"+o,t.discussionpage=t.logpage+"#"+Morebits.pageNameNorm,t.tagText="{{ffd|log="+o+"|help=off}}\n",a.canEdit()?(i=i.replace(/\{\{(mtc|(copy |move )?to ?commons|move to wikimedia commons|copy to wikimedia commons)[^}]*\}\}/gi,""),a.setPageText(t.tagText+i),a.setEditSummary("Listed for discussion at [[:"+t.discussionpage+"]]."),a.setWatchlist(V("xfdWatchPage")),a.setCreateOption("recreate"),a.save()):e.autoEditRequest(a)}))},t.prototype.addToList=function(){var e=this,t=this.params,a=new te(t.logpage,"Adding discussion to today's list");return a.setFollowRedirect(!0),a.load().then((function(){var t=a.getPageText();return a.exists()||(t="{{subst:FfD log}}"),a.setPageText(t+"\n\n"+e.getDiscussionWikitext()),a.setEditSummary("Adding [[:"+Morebits.pageNameNorm+"]]."),a.setWatchlist(V("xfdWatchDiscussion")),a.setCreateOption("recreate"),a.save()}))},t.prototype.getDiscussionWikitext=function(){return P("subst:ffd2",{Reason:Morebits.string.formatReasonText(this.params.reason,!0),1:mw.config.get("wgTitle"),Uploader:this.params.initialContrib})},t.venueCode="FfD",t.venueLabel="FfD (Files for discussion)",t}(oe),ue=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ee(t,e),t.isDefaultChoice=function(){return 14===mw.config.get("wgNamespaceNumber")||10===mw.config.get("wgNamespaceNumber")&&/-stub$/.test(Morebits.pageNameNorm)},t.prototype.getFieldsetLabel=function(){return"Categories for discussion"},t.prototype.getMenuTooltip=function(){return"Nominate article for deletion or move"},t.prototype.getVenueWarning=function(){if(-1===[10,14].indexOf(mw.config.get("wgNamespaceNumber")))return"CfD is only for categories and stub templates."},t.prototype.generateFieldset=function(){this.fieldset=e.prototype.generateFieldset.call(this);var t=14===mw.config.get("wgNamespaceNumber");return this.fieldset.append({type:"select",label:"Choose type of action wanted: ",name:"xfdcat",list:t?[{type:"option",label:"Deletion",value:"CfD",selected:!0},{type:"option",label:"Merge",value:"CfM"},{type:"option",label:"Renaming",value:"CfR"},{type:"option",label:"Split",value:"CfS"},{type:"option",label:"Convert into article",value:"CfC"}]:[{type:"option",label:"Stub Deletion",value:"SfD-t",selected:!0},{type:"option",label:"Stub Renaming",value:"SfR-t"}],event:function(e){var a=e.target.value,i=e.target.form.cfdtarget,o=e.target.form.cfdtarget2;i.disabled="CfD"===a||"SfD-t"===a,t?("CfS"===a?Morebits.quickForm.setElementLabel(i,"Target categories: "):"CfC"===a?Morebits.quickForm.setElementLabel(i,"Target article: "):Morebits.quickForm.setElementLabel(i,"Target category: "),"CfS"===a?o?(o.disabled=!1,$(o).show()):((o=document.createElement("input")).setAttribute("name","cfdtarget2"),o.setAttribute("type","text"),o.setAttribute("required","true"),i.parentNode.appendChild(o)):($(o).prop("disabled",!0),$(o).hide())):Morebits.quickForm.setElementLabel(i,"Target stub template: ")}}),this.fieldset.append({type:"input",name:"cfdtarget",label:"Target category: ",disabled:!0,required:!0,value:""}),this.appendReasonArea(),this.fieldset},t.prototype.preprocessParams=function(){this.params.cfdtarget&&(this.params.cfdtarget=b(this.params.cfdtarget)),this.params.cfdtarget2&&(this.params.cfdtarget2=b(this.params.cfdtarget2));this.params.action={CfD:"deletion","SfD-t":"deletion",CfM:"merging",CfR:"renaming","SfR-t":"renaming",CfS:"splitting",CfC:"conversion"}[this.params.xfdcat],this.params.stub=14!==mw.config.get("wgNamespaceNumber")},t.prototype.evaluate=function(){var t=this;e.prototype.evaluate.call(this),this.tm.add(this.tagPage,[]),this.tm.add(this.addToList,[this.tagPage],this.printReasonText),this.tm.add(this.fetchCreatorInfo,[]),this.tm.add(this.notifyCreator,[this.fetchCreatorInfo,this.tagPage]),this.tm.add(this.addToLog,[this.notifyCreator]),this.tm.execute().then((function(){return t.redirectToDiscussion()}))},t.prototype.tagPage=function(){var e=this,t=this.params,a=new te(mw.config.get("wgPageName"),"Tagging category with "+t.action+" tag");return a.setFollowRedirect(!0),a.load().then((function(){var i=new Morebits.date(a.getLoadTime());t.logpage="Wikipedia:Categories for discussion/Log/"+i.format("YYYY MMMM D","utc"),t.discussionpage=t.logpage+"#"+Morebits.pageNameNorm;var o=a.getPageText();t.tagText=P("subst:"+t.xfdcat,{1:t.cfdtarget,2:t.cfdtarget2})+"\n";var n=(t.stub?"Stub template":"Category")+" being considered for "+t.action+("CfC"===t.xfdcat?" to an article":"")+"; see [[:"+t.discussionpage+"]].";return a.canEdit()?(a.setPageText(t.tagText+o),a.setEditSummary(n),a.setWatchlist(V("xfdWatchPage")),a.setCreateOption("recreate"),a.save()):e.autoEditRequest(a)}))},t.prototype.addToList=function(){var e=this,t=this.params,a=new te(t.logpage,"Adding discussion to today's list");return a.setFollowRedirect(!0),a.load().then((function(){var i,o=a.getStatusElement(),n=e.getDiscussionWikitext();if(a.exists()){var r=a.getPageText();if((i=r.replace("below this line --\x3e","below this line --\x3e\n"+n))===r)return o.error("failed to find target spot for the discussion"),$.Deferred().reject()}else i="{{subst:CfD log}}\n"+n;return a.setPageText(i),a.setEditSummary("Adding "+t.action+" nomination of [[:"+Morebits.pageNameNorm+"]]."),a.setWatchlist(V("xfdWatchDiscussion")),a.setCreateOption("recreate"),a.save()}))},t.prototype.getDiscussionWikitext=function(){return P("subst:"+this.params.xfdcat+"2",{text:Morebits.string.formatReasonText(this.params.reason,!0),1:mw.config.get("wgTitle"),2:this.params.cfdtarget,3:this.params.cfdtarget2})},t.prototype.getNotifyText=function(){return P("subst:cfd notice",{action:this.params.action,1:Morebits.pageNameNorm,stub:10===mw.config.get("wgNamespaceNumber")?"yes":null})+" ~~~~"},t.prototype.getUserspaceLoggingExtraInfo=function(){var e=this.params,t="";if(t+=" ("+e.xfdcat+")",e.cfdtarget){var a="s"===e.xfdcat.charAt(0)?"Template:":":Category:";t+="; "+e.action+" to [["+a+e.cfdtarget+"]]","CfS"===e.xfdcat&&e.cfdtarget2&&(t+=", [["+a+e.cfdtarget2+"]]")}return t},t.venueCode="CfD",t.venueLabel="CfD (Categories for discussion)",t}(oe),me=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ee(t,e),t.prototype.getMenuTooltip=function(){return"Nominate article for deletion or move"},t.prototype.getFieldsetLabel=function(){return"Categories for speedy renaming"},t.prototype.getVenueWarning=function(){if(-1===[10,14].indexOf(mw.config.get("wgNamespaceNumber")))return"CfD is only for categories and stub templates."},t.prototype.generateFieldset=function(){return this.fieldset=e.prototype.generateFieldset.call(this),this.fieldset.append({type:"select",label:"C2 sub-criterion: ",name:"xfdcat",tooltip:"See WP:CFDS for full explanations.",list:[{type:"option",label:"C2A: Typographic and spelling fixes",value:"C2A",selected:!0},{type:"option",label:"C2B: Naming conventions and disambiguation",value:"C2B"},{type:"option",label:"C2C: Consistency with names of similar categories",value:"C2C"},{type:"option",label:"C2D: Rename to match article name",value:"C2D"},{type:"option",label:"C2E: Author request",value:"C2E"},{type:"option",label:"C2F: One eponymous article",value:"C2F"}]}),this.fieldset.append({type:"input",name:"cfdstarget",label:"New name: ",required:!0}),this.appendReasonArea(),this.fieldset},t.prototype.preprocessParams=function(){var e,t,a;this.params.cfdstarget&&(this.params.cfdstarget=(e=this.params.cfdstarget,t=14,(a=mw.Title.newFromUserInput(e,t))?a.toText():e))},t.prototype.evaluate=function(){var t=this;e.prototype.evaluate.call(this),this.tm.add(this.tagPage,[]),this.tm.add(this.addToList,[],this.printReasonText),this.tm.add(this.addToLog,[this.addToList]),this.tm.execute().then((function(){return t.redirectToDiscussion()}))},t.prototype.tagPage=function(){var e=this,t=this.params,a=new te(mw.config.get("wgPageName"),"Tagging category with rename tag");return a.setFollowRedirect(!0),a.load().then((function(){var i=a.getPageText();return t.tagText="{{subst:cfr-speedy|1="+t.cfdstarget.replace(/^:?Category:/,"")+"}}\n",a.canEdit()?(a.setPageText(t.tagText+i),a.setEditSummary("Listed for speedy renaming; see [[WP:CFDS|Categories for discussion/Speedy]]."),a.setWatchlist(V("xfdWatchPage")),a.setCreateOption("recreate"),a.save()):e.autoEditRequest(a)}))},t.prototype.addToList=function(){var e=this,t=new te("Wikipedia:Categories for discussion/Speedy","Adding discussion to the list");return t.setFollowRedirect(!0),t.load().then((function(){var a=t.getPageText(),i=t.getStatusElement(),o=a.replace("BELOW THIS LINE --\x3e","BELOW THIS LINE --\x3e\n"+e.getDiscussionWikitext());return o===a?(i.error("failed to find target spot for the discussion"),$.Deferred().reject()):(t.setPageText(o),t.setEditSummary("Adding [[:"+Morebits.pageNameNorm+"]]."),t.setWatchlist(V("xfdWatchDiscussion")),t.setCreateOption("recreate"),t.save())}))},t.prototype.getDiscussionWikitext=function(){var e=this.params;return"* [[:"+Morebits.pageNameNorm+"]] to [[:"+e.cfdstarget+"]]\xa0\u2013 "+e.xfdcat+(e.reason?": "+Morebits.string.formatReasonText(e.reason):".")+" ~~~~"},t.prototype.getUserspaceLoggingExtraInfo=function(){var e=this.params,t="";return t+=" ("+e.xfdcat+")",e.cfdstarget&&e.cfdstarget.length>9&&(t+="; New name: [[:"+e.cfdstarget+"]]"),t},t.venueCode="CfDS",t.venueLabel="CfDS (Categories for speedy renaming)",t}(oe),ge=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.discussionPagePrefix="Wikipedia:Miscellany for deletion",t}return ee(t,e),t.isDefaultChoice=function(){return-1===[0,6,10,14,828].indexOf(mw.config.get("wgNamespaceNumber"))||0===Morebits.pageNameNorm.indexOf("Template:User ",0)},t.prototype.getMenuTooltip=function(){return"Nominate article for deletion or move"},t.prototype.getFieldsetLabel=function(){return"Miscellany for deletion"},t.prototype.generateFieldset=function(){return this.fieldset=e.prototype.generateFieldset.call(this),this.fieldset.append({type:"checkbox",list:[{label:"Wrap deletion tag with <noinclude>",value:"noinclude",name:"noinclude",tooltip:"Will wrap the deletion tag in <noinclude> tags, so that it won't transclude. Select this option for userboxes."}]}),2!==mw.config.get("wgNamespaceNumber")&&3!==mw.config.get("wgNamespaceNumber")||!mw.config.exists("wgRelevantUserName")||this.fieldset.append({type:"checkbox",list:[{label:"Notify owner of userspace (if they are not the page creator)",value:"notifyuserspace",name:"notifyuserspace",tooltip:"If the user in whose userspace this page is located is not the page creator (for example, the page is a rescued article stored as a userspace draft), notify the userspace owner as well.",checked:!0}]}),this.appendReasonArea(),this.fieldset},t.prototype.preprocessParams=function(){this.params.userspaceOwner=mw.config.get("wgRelevantUserName")},t.prototype.evaluate=function(){var t=this;e.prototype.evaluate.call(this),this.tm.add(this.determineDiscussionPage,[]),this.tm.add(this.tagPage,[this.determineDiscussionPage]),this.tm.add(this.addToList,[this.determineDiscussionPage]),this.tm.add(this.createDiscussionPage,[this.determineDiscussionPage],this.printReasonText),this.tm.add(this.fetchCreatorInfo,[]),this.tm.add(this.notifyCreator,[this.fetchCreatorInfo]),this.tm.add(this.notifyUserspaceOwner,[this.fetchCreatorInfo]),this.tm.add(this.addToLog,[this.notifyCreator,this.notifyUserspaceOwner]),this.tm.execute().then((function(){return t.redirectToDiscussion()}))},t.prototype.tagPage=function(){var e=this,t=this.params,a=new te(mw.config.get("wgPageName"),"Tagging page with deletion tag");return a.setFollowRedirect(!0),a.load().then((function(){var i=a.getPageText();return t.tagText="{{"+(""===t.number?"mfd":"mfdx|"+t.number)+"|help=off}}",-1!==["javascript","css","sanitized-css"].indexOf(mw.config.get("wgPageContentModel"))?t.tagText="/* "+t.tagText+" */\n":(t.tagText+="\n",t.noinclude&&(t.tagText="<noinclude>"+t.tagText+"</noinclude>")),a.canEdit()&&-1!==["wikitext","javascript","css","sanitized-css"].indexOf(a.getContentModel())?(a.setPageText(t.tagText+i),a.setEditSummary("Nominated for deletion; see [[:"+t.discussionpage+"]]."),a.setWatchlist(V("xfdWatchPage")),a.setCreateOption("nocreate"),a.save()):e.autoEditRequest(a)}))},t.prototype.createDiscussionPage=function(){var e=this,t=this.params,a=new te(t.discussionpage,"Creating deletion discussion page");return a.load().then((function(){return a.setPageText(e.getDiscussionWikitext()),a.setEditSummary("Creating deletion discussion page for [[:"+Morebits.pageNameNorm+"]]."),a.setWatchlist(V("xfdWatchDiscussion")),a.setCreateOption("createonly"),a.save()}))},t.prototype.getDiscussionWikitext=function(){return P("subst:mfd2",{text:Morebits.string.formatReasonText(this.params.reason,!0),pg:Morebits.pageNameNorm})},t.prototype.addToList=function(){var e=this.params,t=new te("Wikipedia:Miscellany for deletion","Adding discussion to today's list");return t.setPageSection(2),t.setFollowRedirect(!0),t.load().then((function(){var a=t.getPageText(),i=t.getStatusElement(),o=new Morebits.date(t.getLoadTime()),n=o.format("===MMMM D, YYYY===\n","utc"),r=new RegExp(o.format("(===[\\s]*MMMM[\\s]+D,[\\s]+YYYY[\\s]*===)","utc")),s="{{subst:mfd3|pg="+Morebits.pageNameNorm+e.numbering+"}}";return r.test(a)?(i.info("Found today's section, proceeding to add new entry"),a=a.replace(r,"$1\n"+s)):(i.info("No section for today found, proceeding to create one"),a=a.replace("===",n+s+"\n\n===")),t.setPageText(a),t.setEditSummary("Adding [[:"+e.discussionpage+"]]."),t.setWatchlist(V("xfdWatchList")),t.setCreateOption("recreate"),t.save()}))},t.prototype.notifyUserspaceOwner=function(){var e=this.params;return e.notifyuserspace&&e.userspaceOwner!==e.initialContrib?this.notifyTalkPage(e.userspaceOwner,new Morebits.status("Notifying owner of userspace ("+e.userspaceOwner+")")):$.Deferred().resolve()},t.prototype.getNotifyText=function(){var e="{{subst:mfd notice";return this.params.numbering&&(e+="|order= "+this.params.numbering),e+="|1="+Morebits.pageNameNorm+"}} ~~~~"},t.prototype.getUserspaceLoggingExtraInfo=function(){var e=this.params,t="";return e.notifyuserspace&&e.userspaceOwner&&e.userspaceOwner!==e.initialContrib&&(t+="; notified {{user|1="+e.userspaceOwner+"}}"),t},t.venueCode="mfD",t.venueLabel="MfD (Miscellany for deletion)",t}(oe),fe=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ee(t,e),t.isDefaultChoice=function(){return!!mw.config.get("wgIsRedirect")||!!document.getElementById("softredirect")},t.prototype.getFieldsetLabel=function(){return"Redirects for discussion"},t.prototype.getMenuTooltip=function(){return"Nominate redirect to be deleted or retargeted"},t.prototype.getUserspaceLoggingExtraInfo=function(){var e=this.params,t="";return e.rfdtarget&&(t+="; Target: [[:"+e.rfdtarget+"]]",e.relatedpage&&(t+=" (notified)")),t},t.prototype.generateFieldset=function(){return this.fieldset=e.prototype.generateFieldset.call(this),this.fieldset.append({type:"checkbox",list:[{label:"Notify target page if possible",value:"relatedpage",name:"relatedpage",tooltip:"A notification template will be placed on the talk page of this redirect's target if this is true.",checked:!0}]}),this.appendReasonArea(),this.fieldset},t.prototype.preview=function(e){var t=this;this.params=Morebits.quickForm.getInputData(e),this.findTarget().then((function(){t.showPreview(e)}))},t.prototype.evaluate=function(){var t=this;e.prototype.evaluate.call(this),this.tm.add(this.findTarget,[]),this.tm.add(this.tagPage,[this.findTarget]),this.tm.add(this.addToList,[this.findTarget,this.tagPage],this.printReasonText),this.tm.add(this.fetchCreatorInfo,[]),this.tm.add(this.notifyCreator,[this.fetchCreatorInfo,this.tagPage]),this.tm.add(this.notifyTargetTalk,[this.fetchCreatorInfo,this.tagPage]),this.tm.add(this.addToLog,[this.notifyCreator]),this.tm.execute().then((function(){return t.redirectToDiscussion()}))},t.prototype.findTarget=function(){var e=this,t=!!document.getElementById("softredirect"),a={action:"query",curtimestamp:!0,format:"json",titles:!t&&mw.config.get("wgPageName"),redirects:!t};return t&&(this.params.rfdtarget=document.getElementById("softredirect").textContent.replace(/^:+/,"")),new E("Finding target of redirect",a).post().then((function(a){var i=a.getResponse();e.params.curtimestamp=i.curtimestamp;var o=new Morebits.date(e.params.curtimestamp);if(e.params.logpage="Wikipedia:Redirects for discussion/Log/"+o.format("YYYY MMMM D","utc"),e.params.discussionpage=e.params.logpage+"#"+Morebits.pageNameNorm,!t){var n=i.query.redirects&&i.query.redirects[0].to;if(!n){var r="No target found. this page does not appear to be a redirect, aborting";return"history"===mw.config.get("wgAction")&&(r+=". If this is a soft redirect, try again from the content page, not the page history."),a.getStatusElement().error(r),$.Deferred().reject()}e.params.rfdtarget=n,e.params.section=i.query.redirects[0].tofragment}}))},t.prototype.tagPage=function(){var e=this,t=this.params,a=new te(mw.config.get("wgPageName"),"Adding deletion tag to redirect");return a.setFollowRedirect(!1),a.load().then((function(){var i=a.getPageText();return t.tagText="{{subst:rfd|"+(10===mw.config.get("wgNamespaceNumber")?"showontransclusion=1|":"")+"content=\n",a.canEdit()?(a.setPageText(t.tagText+i+"\n}}"),a.setEditSummary("Listed for discussion at [[:"+t.discussionpage+"]]."),a.setWatchlist(V("xfdWatchPage")),a.setCreateOption("nocreate"),a.save()):e.autoEditRequest(a)}))},t.prototype.getDiscussionWikitext=function(){var e=this.params;return P("subst:rfd2",{text:(e.reason?Morebits.string.formatReasonText(e.reason):"")+" ~~~~",redirect:Morebits.pageNameNorm,target:e.rfdtarget&&e.rfdtarget+(e.section?"#"+e.section:"")})},t.prototype.addToList=function(){var e=this,t=this.params,a=new te(t.logpage,"Adding discussion to today's log");return a.setFollowRedirect(!0),a.load().then((function(){var t,i=a.getStatusElement(),o=e.getDiscussionWikitext();if(a.exists()){var n=a.getPageText();if((t=n.replace(/(<!-- Add new entries directly below this line\.? -->)/,"$1\n"+o))===n)return i.error("failed to find target spot for the discussion"),$.Deferred().reject()}else t="{{subst:RfD log}}"+o;return a.setPageText(t),a.setEditSummary("Adding [[:"+Morebits.pageNameNorm+"]]."),a.setWatchlist(V("xfdWatchDiscussion")),a.setCreateOption("recreate"),a.save()}))},t.prototype.notifyTargetTalk=function(){if(!this.params.relatedpage)return $.Deferred().resolve();var e=new mw.Title(this.params.rfdtarget).getTalkPage(),t=new Morebits.status("Notifying target talk page","doing");return this.params.rfdtarget===mw.config.get("wgPageName")?(t.warn("Circular redirect; skipping target page notification"),$.Deferred().resolve()):document.getElementById("softredirect")?(t.warn("Soft redirect; skipping target page notification"),$.Deferred().resolve()):3===e.getNamespaceId()&&e.getNameText()===this.params.initialContrib?(t.warn("Target is initial contributor; skipping target page notification"),$.Deferred().resolve()):3===e.getNamespaceId()&&e.getNameText()===mw.config.get("wgUserName")?(t.warn("You ("+mw.config.get("wgUserName")+") are the target; skipping target page notification"),$.Deferred().resolve()):this.notifyTalkPage(e.toText(),t)},t.venueCode="RfD",t.venueLabel="RfD (Redirects for discussion)",t}(oe),he=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ee(t,e),t.prototype.getFieldsetLabel=function(){return"Requested moves"},t.prototype.getVenueWarning=function(){if(14===mw.config.get("wgNamespaceNumber"))return"Please use CfD or CfDS for category renames."},t.prototype.generateFieldset=function(){var t=this;return this.fieldset=e.prototype.generateFieldset.call(this),this.fieldset.append({type:"checkbox",list:[{label:"Uncontroversial technical request",value:"rmtr",name:"rmtr",tooltip:"Use this option when you are unable to perform this uncontroversial move yourself because of a technical reason (e.g. a page already exists at the new title, or the page is protected)",checked:!1,event:function(e){t.result.newname.required=e.target.checked}}]}),this.fieldset.append({type:"input",name:"newname",label:"New title: ",tooltip:"Required for technical requests. Otherwise, if unsure of the appropriate title, you may leave it blank."}),this.appendReasonArea(),this.fieldset},t.prototype.getDiscussionWikitext=function(){var e=new mw.Title(Morebits.pageNameNorm).getSubjectPage().toText(),t=this.params;return(t.rmtr?"{{subst:RMassist|1="+e+"|2="+t.newname:"{{subst:Requested move|current1="+e+"|new1="+t.newname)+"|reason="+t.reason+"}}"},t.prototype.preprocessParams=function(){this.params.discussionpage=this.params.rmtr?"Wikipedia:Requested moves/Technical requests":new mw.Title(Morebits.pageNameNorm).getTalkPage().toText()},t.prototype.showPreview=function(e){var t=this.getDiscussionWikitext();e.previewer.beginRender(t,this.params.discussionpage)},t.prototype.evaluate=function(){var t=this;e.prototype.evaluate.call(this),this.tm.add(this.addToList,[],this.printReasonText),this.tm.add(this.addToLog,[this.addToList]),this.tm.execute().then((function(){return t.redirectToDiscussion()}))},t.prototype.addToList=function(){return this.params.rmtr?this.listAtRMTR():this.listAtTalk()},t.prototype.listAtTalk=function(){var e=this.params,t=new te(e.discussionpage,"Adding entry on talk page");return t.setAppendText("\n\n"+this.getDiscussionWikitext()),t.setFollowRedirect(!0),t.setEditSummary("Proposing move"+(e.newname?" to [[:"+e.newname+"]]":"")),t.setCreateOption("recreate"),t.setWatchlist(V("xfdWatchDiscussion")),t.append()},t.prototype.listAtRMTR=function(){var e=this,t=new te(this.params.discussionpage,"Adding entry at WP:RM/TR");return t.setFollowRedirect(!0),t.setPageSection(2),t.load().then((function(){var a=t.getPageText(),i=t.getStatusElement(),o=a.replace(/---- and enter on a new line.* -->/,"$&\n"+e.getDiscussionWikitext());return a===o?(i.error("failed to find target spot for the entry"),$.Deferred().reject()):(t.setPageText(o),t.setEditSummary("Adding [[:"+Morebits.pageNameNorm+"]]."),t.save())}))},t.prototype.getUserspaceLoggingExtraInfo=function(){var e=this.params,t="";return e.rmtr&&(t+=" (technical)"),e.newname&&(t+="; New name: [[:"+e.newname+"]]"),t},t.venueCode="RM",t.venueLabel="RM (Requested moves)",t}(oe);ie.modeList=[ce,fe,ue,me,de,pe,ge,he];var be=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.footerlinks={"About deletion discussions":"WP:XFD","XfD prefs":"WP:TW/PREF#xfd","Twinkle help":"WP:TW/DOC#xfd","Give feedback":"WT:TW"},t}return ee(t,e),t.userPreferences=function(){var t=e.userPreferences.call(this);return t.preferences=t.preferences.concat([{name:"noLogOnXfdNomination",label:"Do not create a userspace log entry when nominating at this venue",type:"set",setValues:{afd:"AfD",tfd:"TfD",ffd:"FfD",cfd:"CfD",cfds:"CfD/S",mfd:"MfD",rfd:"RfD",rm:"RM"},default:[]},{name:"xfdWatchRelated",label:"Add the redirect's target page to watchlist (when notifying)",helptip:"This only applies for RfD, when leaving a notification on the talk page of the target of the redirect",type:"enum",enumValues:Y.watchlistEnums,default:"default"},{name:"markXfdPagesAsPatrolled",label:"Mark page as patrolled/reviewed when nominating for AFD (if possible)",type:"boolean",default:!0}]),t},t}(ie),ve=function(e){function t(){var a=e.call(this)||this;a.moduleName="Tag",a.portletName="Tag",a.portletId="twinkle-tag";for(var i=0,o=t.modeList;i<o.length;i++){var n=o[i];if(n.isActive()){a.mode=new n;break}}return a.mode?(a.portletTooltip=a.mode.getMenuTooltip(),a.addMenu(),a):a}return n(t,e),t.prototype.makeWindow=function(){var e=new ae(630,500);e.setFooterLinks(this.footerlinks),this.mode.makeForm(e),this.mode.formRender(),this.mode.postRender()},t.userPreferences=function(){return{title:"Tag",preferences:[{name:"watchTaggedPages",label:"When tagging a page, how long to watch it for",type:"enum",enumValues:Y.watchlistEnums,default:"no"},{name:"markTaggedPagesAsMinor",label:"Mark addition of tags as a minor edit",type:"boolean",default:!1},{name:"markTaggedPagesAsPatrolled",label:'Check the "mark page as patrolled/reviewed" box by default',type:"boolean",default:!0}]}},t.makeArrowLinks=function(e){var t=Morebits.htmlNode("a",">");t.setAttribute("class","tag-template-link");var a=e.values;t.setAttribute("href",mw.util.getUrl((-1===a.indexOf(":")?"Template:":"")+(-1===a.indexOf("|")?a:a.slice(0,a.indexOf("|"))))),t.setAttribute("target","_blank"),$(e).parent().append("\xa0",t)},t.makeEditSummary=function(e,t,a){var i,o=function(e){var t="{{[[";return-1!==e.indexOf("|")&&(e=e.slice(0,e.indexOf("|"))),(t+=-1!==e.indexOf(":")?e:"Template:"+e+"|"+e)+"]]}}"};return e.length&&t.length?i=F("summary-added-removed",e.map(o),t.map(o),e.length+t.length):e.length?i=F("summary-added",e.map(o),e.length):t.length&&(i=F("summary-removed",t.map(o),t.length)),a&&(i+=F("colon-separator")+a),i.length>499&&(i=i.replace(/\[\[[^|]+\|([^\]]+)\]\]/g,"$1")),i},t.moduleName="Tag",t}(K),ye=function(){function e(){this.existingTags=[],this.removalSupported=!1,this.groupTemplateName=null,this.groupMinSize=1,this.assumeUnknownTagsGroupable=!0}return e.isActive=function(){return!1},e.prototype.canRemove=function(){return this.removalSupported&&mw.config.get("wgCurRevisionId")===mw.config.get("wgRevisionId")&&!mw.config.get("wgDiffNewId")},e.prototype.getMenuTooltip=function(){return"Add maintenance tags to the page"},e.prototype.getWindowTitle=function(){return"Add maintenance tags"},e.prototype.makeForm=function(e){var t=this;this.Window=e,this.Window.setTitle(this.getWindowTitle()),this.form=new Morebits.quickForm((function(){return t.evaluate()})),this.constructFlatObject(),this.form.append({type:"input",label:F("search-tags"),name:"quickfilter",size:"30px",event:we.onInputChange}),this.removalSupported&&!this.canRemove()&&this.form.append({type:"div",name:"untagnotice",label:Morebits.htmlNode("div",F("untag-from-read"))}),this.scrollbox=this.form.append({type:"div",id:"tagWorkArea",className:"morebits-scrollbox",style:"max-height: 28em"}),this.parseExistingTags(),this.makeExistingTagList(this.scrollbox),this.makeTagList(this.scrollbox);var a=V(this.getCustomTagPrefName());a&&a.length&&(this.scrollbox.append({type:"header",label:"Custom tags"}),this.scrollbox.append({type:"checkbox",name:"tags",list:a}))},e.prototype.getCustomTagPrefName=function(){return"custom"+Morebits.string.toUpperCaseFirstChar(this.name)+"TagList"},e.prototype.makeTagList=function(e){var t=this;Array.isArray(this.tagList)?this.makeTagListGroup(this.tagList,e):$.each(this.tagList,(function(a,i){if(e.append({type:"header",label:a}),Array.isArray(i))t.makeTagListGroup(i,e);else{var o=e.append({type:"div"});$.each(i,(function(e,a){o.append({type:"div",label:[Morebits.htmlNode("b",e)]}),t.makeTagListGroup(a,o)}))}}))},e.prototype.makeTagListGroup=function(e,t){var a=this,i=new Set(this.existingTags.filter((function(e){var t;return!(null===(t=a.flatObject[e])||void 0===t?void 0:t.dupeAllowed)})));t.append({type:"checkbox",name:"tags",list:e.filter((function(e){return!i.has(e.tag)})).map((function(e){return{label:"{{"+e.tag+"}}"+(e.description?": "+e.description:""),value:e.tag,subgroup:e.subgroup}}))})},e.prototype.makeExistingTagList=function(e){var t=this;if(this.existingTags.length){e.append({type:"header",label:F("tags-present-header")});var a=this.existingTags.map((function(e){return t.flatObject[e]||{tag:e}}));e.append({type:"checkbox",name:"existingTags",list:a.map((function(e){return{label:"{{"+e.tag+"}}"+(e.description?": "+e.description:""),value:e.tag,checked:!0,style:"font-style: italic"}}))})}},e.prototype.parseExistingTags=function(){},e.prototype.constructFlatObject=function(){var e=this;this.flatObject={},Array.isArray(this.tagList)?this.tagList.forEach((function(t){e.flatObject[t.tag]=t})):T(this.tagList).forEach((function(t){T(t).forEach((function(t){Array.isArray(t)?t.forEach((function(t){e.flatObject[t.tag]=t})):e.flatObject[t.tag]=t}))}))},e.prototype.formAppendPatrolLink=function(){document.getElementsByClassName("patrollink").length&&this.form.append({type:"checkbox",list:[{label:F("mark-patrolled"),value:"patrol",name:"patrol",checked:V("markTaggedPagesAsPatrolled")}]})},e.prototype.formRender=function(){this.form.append({type:"submit",className:"tw-tag-submit"}),this.result=this.form.render(),this.Window.setContent(this.result),this.Window.display()},e.prototype.postRender=function(){we.init(this.result),Morebits.quickForm.getElements(this.result,"tags").forEach(ve.makeArrowLinks),Morebits.quickForm.getElements(this.result,"existingTags").forEach(ve.makeArrowLinks),$(this.scrollbox).find("h5").css({"font-size":"110%"}),$(this.scrollbox).find("h5:not(:first-child)").css({"margin-top":"1em"}),$(this.scrollbox).find("div").filter(":has(span.quickformDescription)").css({"margin-top":"0.4em"});var e=$("<small>").attr("id","tw-tag-status");e.insertAfter($("button.tw-tag-submit"));var t=0,a=0;$("[name=tags], [name=existingTags]").on("click",(function(i){var o=i.target;"tags"===o.name?t+=o.checked?1:-1:"existingTags"===o.name&&(a+=o.checked?-1:1);var n="";t&&a?n=F("status-added-removed",t,a):t?n=F("status-added",t):a&&(n=F("status-removed",a)),e.text(" "+n)}))},e.prototype.evaluate=function(){var e=this;this.captureFormData();var t=this.checkInputs();if(t)return alert(t);this.preprocessParams(),Morebits.simpleWindow.setButtonsEnabled(!1),Morebits.status.init(this.result),this.action().then((function(){Morebits.status.actionCompleted(F("tag-complete",e.name)),setTimeout((function(){window.location.href=mw.util.getUrl(Morebits.pageNameNorm,{redirect:"no"})}),1e9)}))},e.prototype.captureFormData=function(){this.params=Morebits.quickForm.getInputData(this.result),this.params.tagsToRemove=this.result.getUnchecked("existingTags"),this.params.tagsToRetain=this.params.existingTags||[]},e.prototype.checkInputs=function(){return 0!==this.params.tags.length||this.canRemove()&&0!==this.params.tagsToRemove.length?this.validateInput():F("select-one")},e.prototype.validateInput=function(){},e.prototype.preprocessParams=function(){this.getTemplateParameters()},e.prototype.getTemplateParameters=function(){var e=this;this.templateParams={},this.params.tags.forEach((function(t){e.templateParams[t]={},h(e.flatObject[t]&&e.flatObject[t].subgroup).forEach((function(a){a.parameter&&(e.params[a.name]||a.required)&&(e.templateParams[t][a.parameter]=e.params[a.name]||"")}))}))},e.prototype.getTagRegex=function(e){return new RegExp("\\{\\{"+Morebits.pageNameRegex(e)+"\\s*(\\|[^}]*)?\\}\\}\\n?")},e.prototype.isGroupable=function(e){return this.flatObject[e]?!this.flatObject[e].excludeInGroup:this.assumeUnknownTagsGroupable},e.prototype.groupRegex=function(){var e="\\{\\{\\s*("+this.groupTemplateNameRegex+")\\s*(?:\\||\\}\\})";return new RegExp(e,this.groupTemplateNameRegexFlags)},e.prototype.getParameterText=function(e){return this.templateParams[e]?C(this.templateParams[e]).map((function(e){return"|"+e[0]+"="+e[1]})).join(""):(mw.log.warn("this.templateParams[tag] undefined"),"")},e.prototype.getTagText=function(e){return"{{"+(this.flatObject[e]&&this.flatObject[e].subst?"subst:":"")+e+this.getParameterText(e)+"}}"},e.prototype.makeTagSetText=function(e){var t=this;return e.map((function(e){return t.getTagText(e)+"\n"})).join("")},e.prototype.addTagsOutsideGroup=function(e){var t=this.makeTagSetText(e);this.pageText=this.insertTagText(t,this.pageText)},e.prototype.shiftTag=function(e){var t=this,a=!1;return this.pageText=this.pageText.replace(this.getTagRegex(e),(function(e){return a=!0,t.params.groupableExistingTagsText+=e.trim()+"\n",""})),a},e.prototype.spliceGroupableExistingTags=function(){var e=this;this.params.groupableExistingTagsText="";var t=this.params.groupableExistingTags.filter((function(t){return!e.shiftTag(t)}));return 0===t.length?$.Deferred().resolve(this.params.groupableExistingTagsText):new E(F("getting-redirects"),this.getRedirectsQuery(t)).post().then((function(t){return t.getResponse().query.pages.filter((function(e){return!e.missing&&!!e.linkshere})).forEach((function(t){var a=e.shiftTag(b(t.title));a||(a=t.linkshere.some((function(t){var a=b(t.title);return e.shiftTag(a)}))),a||new Morebits.status("Note",F("cant-reposition",b(t.title)))})),e.params.groupableExistingTagsText}))},e.prototype.removeTemplate=function(e){var t=!1;return this.pageText=this.pageText.replace(this.getTagRegex(e),(function(){return t=!0,""})),t},e.prototype.getRedirectsQuery=function(e){return{action:"query",prop:"linkshere",titles:e.map((function(e){return"Template:"+e})),redirects:1,lhnamespace:"10",lhshow:"redirect",lhlimit:"max",format:"json"}},e.prototype.removeTags=function(){var e=this,t=this.params;if(!t.tagsToRemove.length)return $.Deferred().resolve();Morebits.status.info(F("untagging"),F("removing"));var a=t.tagsToRemove.filter((function(t){return!e.removeTemplate(t)}));return 0===a.length?$.Deferred().resolve():new E(F("tag-fetching-redirects",a.map((function(e){return"{{"+e+"}}"}))),this.getRedirectsQuery(a)).post().then((function(t){var a=t.getResponse().query.pages.filter((function(e){return!e.missing&&!!e.linkshere||Morebits.status.warn(F("info"),F("cant-remove",b(e.title)))}));(t.getResponse().query.redirects||[]).forEach((function(e){var t=e.from,a=e.to;new Morebits.status("Note",F("resolved-redirect",b(t),b(a)))})),a.forEach((function(t){var a=e.removeTemplate(b(t.title));a||(a=t.linkshere.some((function(t){var a=b(t.title);return e.removeTemplate(a)}))),a||Morebits.status.warn(F("note"),F("cant-remove",b(t.title)))}))}))},e.prototype.initialCleanup=function(){},e.prototype.shouldAddGroup=function(){var e=this.params;return this.groupTemplateName&&!e.disableGrouping&&e.groupableExistingTags.length+e.groupableNewTags.length>=this.groupMinSize},e.prototype.addTagsIntoGroup=function(e){if(e){var t=this.groupRegex().exec(this.pageText),a=new RegExp("(\\{\\{\\s*"+t[1]+"\\s*(?:\\|(?:\\{\\{[^{}]*\\}\\}|[^{}])*)?)\\}\\}\\s*","im");this.pageText=this.pageText.replace(a,"$1"+e+"}}\n")}else if(void 0===e)throw new Error("tagText undefined")},e.prototype.insertTagText=function(e,t){return e+"\n"+t},e.prototype.finalCleanup=function(){var e=this;if(this.groupTemplateName&&!this.params.groupingDisabled){var t,a,i=new Morebits.unbinder(this.pageText);i.unbind("\\{\\{subst:CURRENT","\\}\\}");for(var o=0;o<this.groupMinSize;o++)i.content=i.content.replace((t=o,a=void 0,a="\\{\\{\\s*"+e.groupTemplateNameRegex+"\\s*\\|\\s*(",new RegExp(a+"(?:\\{\\{[^}]+\\}\\}\\s*){"+t+"})\\}\\}\\n?",e.groupTemplateNameRegexFlags)),"$1");this.pageText=i.rebind()}},e.prototype.action=function(){var e=this;return this.pageobj=new te(Morebits.pageNameNorm,F("tagging-status",this.name)),this.pageobj.load().then((function(){return e.pageText=e.pageobj.getPageText(),e.initialCleanup(),e.sortTags(),$.when(e.addAndRearrangeTags(),e.removeTags()).then((function(){return e.finalCleanup(),e.savePage()}))}))},e.prototype.sortTags=function(){},e.prototype.addAndRearrangeTags=function(){this.pageText=this.insertTagText(this.makeTagSetText(this.params.tags),this.pageText)},e.prototype.savePage=function(){return this.pageobj.setPageText(this.pageText),this.pageobj.setEditSummary(ve.makeEditSummary(this.params.tags,this.params.tagsToRemove,this.params.reason)),this.pageobj.setWatchlist(V("watchTaggedPages")),this.pageobj.setMinorEdit(V("markTaggedPagesAsMinor")),this.pageobj.setCreateOption("nocreate"),this.params.patrol&&this.pageobj.triage(),this.pageobj.save()},e}(),we=function(){function e(){}return e.init=function(t){e.$allCheckboxDivs=$(t).find("[name=tags], [name=existingTags]").parent(),e.$allHeaders=$(t).find("h5, .quickformDescription"),t.quickfilter.focus(),t.quickfilter.autocomplete="off",t.quickfilter.addEventListener("keypress",(function(e){if(13===e.keyCode)return e.preventDefault(),!1}))},e.onInputChange=function(){if(e.$allCheckboxDivs.find(".search-hit").each((function(e,t){var a=t.parentElement;a.innerHTML=a.textContent})),this.value){e.$allCheckboxDivs.hide(),e.$allHeaders.hide();var t=this.value,a=new RegExp(mw.util.escapeRegExp(t),"i");e.$allCheckboxDivs.find("label").each((function(){var e=this.textContent,i=a.exec(e);if(i){var o=document.createRange(),n=this.childNodes[0];o.selectNodeContents(n),o.setStart(n,i.index),o.setEnd(n,i.index+t.length);var r=$("<span>").addClass("search-hit").css("text-decoration","underline")[0];o.surroundContents(r),this.parentElement.style.display="block"}}))}else e.$allCheckboxDivs.show(),e.$allHeaders.show()},e}(),ke={"Grammar, punctuation, and spelling":{Abbreviation:[{tag:"R from acronym",description:"redirect from an acronym (e.g. POTUS) to its expanded form"},{tag:"R from initialism",description:"redirect from an initialism (e.g. AGF) to its expanded form"},{tag:"R from MathSciNet abbreviation",description:"redirect from MathSciNet publication title abbreviation to the unabbreviated title"},{tag:"R from NLM abbreviation",description:"redirect from a NLM publication title abbreviation to the unabbreviated title"}],Capitalisation:[{tag:"R from CamelCase",description:"redirect from a CamelCase title"},{tag:"R from other capitalisation",description:"redirect from a title with another method of capitalisation"},{tag:"R from miscapitalisation",description:"redirect from a capitalisation error"}],"Grammar & punctuation":[{tag:"R from modification",description:"redirect from a modification of the target's title, such as with words rearranged"},{tag:"R from plural",description:"redirect from a plural word to the singular equivalent"},{tag:"R to plural",description:"redirect from a singular noun to its plural form"}],"Parts of speech":[{tag:"R from verb",description:"redirect from an English-language verb or verb phrase"},{tag:"R from adjective",description:"redirect from an adjective (word or phrase that describes a noun)"}],Spelling:[{tag:"R from alternative spelling",description:"redirect from a title with a different spelling"},{tag:"R from ASCII-only",description:"redirect from a title in only basic ASCII to the formal title, with differences that are not diacritical marks or ligatures"},{tag:"R from diacritic",description:"redirect from a page name that has diacritical marks (accents, umlauts, etc.)"},{tag:"R to diacritic",description:"redirect to the article title with diacritical marks (accents, umlauts, etc.)"},{tag:"R from misspelling",description:"redirect from a misspelling or typographical error"}]},"Alternative names":{General:[{tag:"R from alternative language",description:"redirect from or to a title in another language",subgroup:[{name:"altLangFrom",type:"input",label:"From language (two-letter code): ",tooltip:"Enter the two-letter code of the language the redirect name is in; such as en for English, de for German",parameter:"from"},{name:"altLangTo",type:"input",label:"To language (two-letter code): ",tooltip:"Enter the two-letter code of the language the target name is in; such as en for English, de for German",parameter:"to"},{name:"altLangInfo",type:"div",label:"For a list of language codes, see [[Wikipedia:Template messages/Redirect language codes]]"}]},{tag:"R from alternative name",description:"redirect from a title that is another name, a pseudonym, a nickname, or a synonym"},{tag:"R from ambiguous sort name",description:"redirect from an ambiguous sort name to a page or list that disambiguates it"},{tag:"R from former name",description:"redirect from a former name or working title"},{tag:"R from historic name",description:"redirect from a name with a significant historic past as a region, city, etc. no longer known by that name"},{tag:"R from incomplete name",description:"R from incomplete name"},{tag:"R from incorrect name",description:"redirect from an erroneus name that is unsuitable as a title"},{tag:"R from less specific name",description:"redirect from a less specific title to a more specific, less general one"},{tag:"R from long name",description:"redirect from a more complete title"},{tag:"R from more specific name",description:"redirect from a more specific title to a less specific, more general one"},{tag:"R from short name",description:"redirect from a title that is a shortened form of a person's full name, a book title, or other more complete title"},{tag:"R from sort name",description:"redirect from the target's sort name, such as beginning with their surname rather than given name"},{tag:"R from synonym",description:"redirect from a semantic synonym of the target page title"}],People:[{tag:"R from birth name",description:"redirect from a person's birth name to a more common name"},{tag:"R from given name",description:"redirect from a person's given name"},{tag:"R from name with title",description:"redirect from a person's name preceded or followed by a title to the name with no title or with the title in parentheses"},{tag:"R from person",description:"redirect from a person or persons to a related article"},{tag:"R from personal name",description:"redirect from an individual's personal name to an article titled with their professional or other better known moniker"},{tag:"R from pseudonym",description:"redirect from a pseudonym"},{tag:"R from surname",description:"redirect from a title that is a surname"}],Technical:[{tag:"R from drug trade name",description:"redirect from (or to) the trade name of a drug to (or from) the international nonproprietary name (INN)"},{tag:"R from filename",description:"redirect from a title that is a filename of the target"},{tag:"R from molecular formula",description:"redirect from a molecular/chemical formula to its technical or trivial name"},{tag:"R from gene symbol",description:"redirect from a Human Genome Organisation (HUGO) symbol for a gene to an article about the gene"}],Organisms:[{tag:"R to scientific name",description:"redirect from the common name to the scientific name"},{tag:"R from scientific name",description:"redirect from the scientific name to the common name"},{tag:"R from alternative scientific name",description:"redirect from an alternative scientific name to the accepted scientific name"},{tag:"R from scientific abbreviation",description:"redirect from a scientific abbreviation"},{tag:"R to monotypic taxon",description:"redirect from the only lower-ranking member of a monotypic taxon to its monotypic taxon"},{tag:"R from monotypic taxon",description:"redirect from a monotypic taxon to its only lower-ranking member"},{tag:"R taxon with possibilities",description:"redirect from a title related to a living organism that potentially could be expanded into an article"}],Geography:[{tag:"R from name and country",description:"redirect from the specific name to the briefer name"},{tag:"R from more specific geographic name",description:"redirect from a geographic location that includes extraneous identifiers such as the county or region of a city"}]},"Navigation aids":{Navigation:[{tag:"R to anchor",description:"redirect from a topic that does not have its own page to an anchored part of a page on the subject"},{tag:"R avoided double redirect",description:"redirect from an alternative title for another redirect",subgroup:{name:"doubleRedirectTarget",type:"input",label:"Redirect target name",tooltip:"Enter the page this redirect would target if the page wasn't also a redirect",parameter:"1"}},{tag:"R from file metadata link",description:'redirect of a wikilink created from EXIF, XMP, or other information (i.e. the "metadata" section on some image description pages)'},{tag:"R to list entry",description:"redirect to a list which contains brief descriptions of subjects not notable enough to have separate articles"},{tag:"R mentioned in hatnote",description:"redirect from a title that is mentioned in a hatnote at the redirect target"},{tag:"R to section",description:"similar to {{R to list entry}}, but when list is organized in sections, such as list of characters in a fictional universe"},{tag:"R from shortcut",description:"redirect from a Wikipedia shortcut"},{tag:"R from template shortcut",description:"redirect from a shortcut page name in any namespace to a page in template namespace"}],Disambiguation:[{tag:"R from ambiguous term",description:'redirect from an ambiguous page name to a page that disambiguates it. This template should never appear on a page that has "(disambiguation)" in its title, use R to disambiguation page instead'},{tag:"R to disambiguation page",description:"redirect to a disambiguation page"},{tag:"R from incomplete disambiguation",description:"redirect from a page name that is too ambiguous to be the title of an article and should redirect to an appropriate disambiguation page"},{tag:"R from incorrect disambiguation",description:"redirect from a page name with incorrect disambiguation due to an error or previous editorial misconception"},{tag:"R from other disambiguation",description:"redirect from a page name with an alternative disambiguation qualifier"},{tag:"R from unnecessary disambiguation",description:"redirect from a page name that has an unneeded disambiguation qualifier"}],"Merge, duplicate & move":[{tag:"R from duplicated article",description:"redirect to a similar article in order to preserve its edit history"},{tag:"R with history",description:"redirect from a page containing substantive page history, kept to preserve content and attributions"},{tag:"R from move",description:"redirect from a page that has been moved/renamed"},{tag:"R from merge",description:"redirect from a merged page in order to preserve its edit history"}],Namespace:[{tag:"R from remote talk page",description:"redirect from a talk page in any talk namespace to a corresponding page that is more heavily watched"},{tag:"R to category namespace",description:"redirect from a page outside the category namespace to a category page"},{tag:"R to help namespace",description:"redirect from any page inside or outside of help namespace to a page in that namespace"},{tag:"R to main namespace",description:"redirect from a page outside the main-article namespace to an article in mainspace"},{tag:"R to portal namespace",description:"redirect from any page inside or outside of portal space to a page in that namespace"},{tag:"R to project namespace",description:"redirect from any page inside or outside of project (Wikipedia: or WP:) space to any page in the project namespace"},{tag:"R to user namespace",description:"redirect from a page outside the user namespace to a user page (not to a user talk page)"}]},Media:{General:[{tag:"R from book",description:"redirect from a book title to a more general, relevant article"},{tag:"R from album",description:"redirect from an album to a related topic such as the recording artist or a list of albums"},{tag:"R from song",description:"redirect from a song title to a more general, relevant article"},{tag:"R from television episode",description:"redirect from a television episode title to a related work or lists of episodes"}],Fiction:[{tag:"R from fictional character",description:"redirect from a fictional character to a related fictional work or list of characters"},{tag:"R from fictional element",description:"redirect from a fictional element (such as an object or concept) to a related fictional work or list of similar elements"},{tag:"R from fictional location",description:"redirect from a fictional location or setting to a related fictional work or list of places"}]},Miscellaneous:{"Related information":[{tag:"R to article without mention",description:"redirect to an article without any mention of the redirected word or phrase"},{tag:"R to decade",description:"redirect from a year to the decade article"},{tag:"R from domain name",description:"redirect from a domain name to an article about a website"},{tag:"R from phrase",description:"redirect from a phrase to a more general relevant article covering the topic"},{tag:"R from list topic",description:"redirect from the topic of a list to the equivalent list"},{tag:"R from member",description:"redirect from a member of a group to a related topic such as the group or organization"},{tag:"R to related topic",description:"redirect to an article about a similar topic"},{tag:"R from related word",description:"redirect from a related word"},{tag:"R from school",description:"redirect from a school article that had very little information"},{tag:"R from subtopic",description:"redirect from a title that is a subtopic of the target article"},{tag:"R to subtopic",description:"redirect to a subtopic of the redirect's title"},{tag:"R from Unicode character",description:"redirect from a single Unicode character to an article or Wikipedia project page that infers meaning for the symbol"},{tag:"R from Unicode code",description:"redirect from a Unicode code point to an article about the character it represents"}],"With possibilities":[{tag:"R with possibilities",description:"redirect from a specific title to a more general, less detailed article (something which can and should be expanded)"}],"ISO codes":[{tag:"R from ISO 4 abbreviation",description:"redirect from an ISO 4 publication title abbreviation to the unabbreviated title"},{tag:"R from ISO 639 code",description:"redirect from a title that is an ISO 639 language code to an article about the language"}],Printworthiness:[{tag:"R printworthy",description:"redirect from a title that would be helpful in a printed or CD/DVD version of Wikipedia"},{tag:"R unprintworthy",description:"redirect from a title that would NOT be helpful in a printed or CD/DVD version of Wikipedia"}]}},xe={"License and sourcing problem tags":[{tag:"Better source requested",description:"source info consists of bare image URL/generic base URL only"},{tag:"Non-free reduce",description:"non-low-resolution fair use image (or too-long audio clip, etc)"},{tag:"Orphaned non-free revisions",description:"fair use media with old revisions that need to be deleted",subst:!0,subgroup:{type:"hidden",name:"OrphanedNonFreeRevisionsDate",parameter:"date",value:"{{subst:date}}"}}],"Wikimedia Commons-related tags":[{tag:"Copy to Commons",description:"free media that should be copied to Commons",subgroup:{type:"hidden",name:"CopyToCommonsHuman",parameter:"human",value:mw.config.get("wgUserName")}},{tag:"Do not move to Commons",description:"file not suitable for moving to Commons",subgroup:[{type:"input",name:"DoNotMoveToCommons_reason",label:"Reason: ",tooltip:'Enter the reason why this image should not be moved to Commons (required). If the file is PD in the US but not in country of origin, enter "US only"',required:!0,parameter:"reason"},{type:"input",name:"DoNotMoveToCommons_expiry",label:"Expiration year: ",tooltip:"If this file can be moved to Commons beginning in a certain year, you can enter it here (optional).",parameter:"expiry"}]},{tag:"Keep local",description:"request to keep local copy of a Commons file",subgroup:{type:"input",name:"keeplocalName",label:"Commons image name if different: ",tooltip:"Name of the image on Commons (if different from local name), excluding the File: prefix:",parameter:"1"}},{tag:"Now Commons",description:"file has been copied to Commons",subst:!0,subgroup:{type:"input",name:"nowcommonsName",label:"Commons image name if different: ",tooltip:"Name of the image on Commons (if different from local name), excluding the File: prefix:",parameter:"1"}}],"Cleanup tags":[{tag:"Artifacts",description:"PNG contains residual compression artifacts"},{tag:"Bad font",description:"SVG uses fonts not available on the thumbnail server"},{tag:"Bad format",description:"PDF/DOC/... file should be converted to a more useful format"},{tag:"Bad GIF",description:"GIF that should be PNG, JPEG, or SVG"},{tag:"Bad JPEG",description:"JPEG that should be PNG or SVG"},{tag:"Bad SVG",description:"SVG containing raster grahpics"},{tag:"Bad trace",description:"auto-traced SVG requiring cleanup"},{tag:"Cleanup image",description:"general cleanup",subgroup:{type:"input",name:"cleanupimageReason",label:"Reason: ",tooltip:"Enter the reason for cleanup (required)",required:!0,parameter:"1"}},{tag:"ClearType",description:"image (not screenshot) with ClearType anti-aliasing"},{tag:"Imagewatermark",description:"image contains visible or invisible watermarking"},{tag:"NoCoins",description:"image using coins to indicate scale"},{tag:"Overcompressed JPEG",description:"JPEG with high levels of artifacts"},{tag:"Opaque",description:"opaque background should be transparent"},{tag:"Remove border",description:"unneeded border, white space, etc."},{tag:"Rename media",description:"file should be renamed according to the criteria at [[WP:FMV]]",subgroup:[{type:"input",name:"renamemediaNewname",label:"New name: ",tooltip:"Enter the new name for the image (optional)",parameter:"1"},{type:"input",name:"renamemediaReason",label:"Reason: ",tooltip:"Enter the reason for the rename (optional)",parameter:"2"}]},{tag:"Should be PNG",description:"GIF or JPEG should be lossless"},{tag:"Should be SVG",description:"PNG, GIF or JPEG should be vector graphics",subgroup:{name:"svgCategory",type:"select",list:[{label:"{{Should be SVG|other}}",value:"other"},{label:"{{Should be SVG|alphabet}}: character images, font examples, etc.",value:"alphabet"},{label:"{{Should be SVG|chemical}}: chemical diagrams, etc.",value:"chemical"},{label:"{{Should be SVG|circuit}}: electronic circuit diagrams, etc.",value:"circuit"},{label:"{{Should be SVG|coat of arms}}: coats of arms",value:"coat of arms"},{label:"{{Should be SVG|diagram}}: diagrams that do not fit any other subcategory",value:"diagram"},{label:"{{Should be SVG|emblem}}: emblems, free/libre logos, insignias, etc.",value:"emblem"},{label:"{{Should be SVG|fair use}}: fair-use images, fair-use logos",value:"fair use"},{label:"{{Should be SVG|flag}}: flags",value:"flag"},{label:"{{Should be SVG|graph}}: visual plots of data",value:"graph"},{label:"{{Should be SVG|logo}}: logos",value:"logo"},{label:"{{Should be SVG|map}}: maps",value:"map"},{label:"{{Should be SVG|music}}: musical scales, notes, etc.",value:"music"},{label:'{{Should be SVG|physical}}: "realistic" images of physical objects, people, etc.',value:"physical"},{label:"{{Should be SVG|symbol}}: miscellaneous symbols, icons, etc.",value:"symbol"}],parameter:"1"}},{tag:"Should be text",description:"image should be represented as text, tables, or math markup"}],"Image quality tags":[{tag:"Image hoax",description:"Image may be manipulated or constitute a hoax",subgroup:{type:"hidden",name:"ImageHoaxDate",parameter:"date",value:"{{subst:CURRENTMONTHNAME}} {{subst:CURRENTYEAR}}"}},{tag:"Image-blownout"},{tag:"Image-out-of-focus"},{tag:"Image-Poor-Quality",subgroup:{type:"input",name:"ImagePoorQualityReason",label:"Reason: ",tooltip:"Enter the reason why this image is so bad (required)",required:!0,parameter:"1"}},{tag:"Image-underexposure"},{tag:"Low quality chem",description:"disputed chemical structures",subgroup:{type:"input",name:"lowQualityChemReason",label:"Reason: ",tooltip:"Enter the reason why the diagram is disputed (required)",required:!0,parameter:"1"}}],"Replacement tags":[{tag:"Obsolete",description:"improved version available"},{tag:"PNG version available"},{tag:"Vector version available"}]};xe["Replacement tags"].forEach((function(e){e.subgroup={type:"input",label:"Replacement file: ",tooltip:"Enter the name of the file which replaces this one (required)",name:e.tag.replace(/ /g,"_")+"File",required:!0,parameter:"1"}}));var Pe=[{name:"translationLanguage",parameter:"1",type:"input",label:"Language of article (if known): ",tooltip:"Consider looking at [[WP:LRC]] for help. If listing the article at PNT, please try to avoid leaving this box blank, unless you are completely unsure."}].concat(0===mw.config.get("wgNamespaceNumber")?[{type:"checkbox",list:[{name:"translationPostAtPNT",label:"List this article at Wikipedia:Pages needing translation into English (PNT)",checked:!0}]},{name:"translationComments",type:"textarea",label:"Additional comments to post at PNT",tooltip:'Optional, and only relevant if "List this article ..." above is checked.'}]:[]);function Te(e){var t="Merge";switch(e){case"Merge from":t="Merge to";break;case"Merge to":t="Merge from"}return[{name:"mergeTarget",parameter:"1",type:"input",label:"Other article(s): ",tooltip:"If specifying multiple articles, separate them with pipe characters: Article one|Article two",required:!0},{type:"checkbox",list:[{name:"mergeTagOther",label:"Tag the other article with a {{"+t+"}} tag",checked:!0,tooltip:"Only available if a single article name is entered."}]}].concat(0===mw.config.get("wgNamespaceNumber")?{name:"mergeReason",type:"textarea",label:"Rationale for merge (will be posted on "+("Merge to"===e?"the other article's":"this article's")+" talk page):",tooltip:"Optional, but strongly recommended. Leave blank if not wanted. Only available if a single article name is entered."}:[])}var Ce={"Cleanup and maintenance tags":{"General cleanup":[{tag:"Cleanup",description:"requires cleanup",subgroup:{name:"cleanup",parameter:"reason",type:"input",label:"Specific reason why cleanup is needed: ",tooltip:"Required.",size:35,required:!0}},{tag:"Cleanup rewrite",description:"needs to be rewritten entirely to comply with Wikipedia's quality standards"},{tag:"Copy edit",description:"requires copy editing for grammar, style, cohesion, tone, or spelling",subgroup:{name:"copyEdit",parameter:"for",type:"input",label:'"This article may require copy editing for..." ',tooltip:'e.g. "consistent spelling". Optional.',size:35}}],"Potentially unwanted content":[{tag:"Close paraphrasing",description:"contains close paraphrasing of a non-free copyrighted source",subgroup:{name:"closeParaphrasing",parameter:"source",type:"input",label:"Source: ",tooltip:"Source that has been closely paraphrased"}},{tag:"Copypaste",description:"appears to have been copied and pasted from another location",excludeInGroup:!0,subgroup:{name:"copypaste",parameter:"url",type:"input",label:"Source URL: ",tooltip:"If known.",size:50}},{tag:"External links",description:"external links may not follow content policies or guidelines"},{tag:"Non-free",description:"may contain excessive or improper use of copyrighted materials"}],"Structure, formatting, and lead section":[{tag:"Cleanup reorganize",description:"needs reorganization to comply with Wikipedia's layout guidelines"},{tag:"Lead missing",description:"no lead section"},{tag:"Lead rewrite",description:"lead section needs to be rewritten to comply with guidelines"},{tag:"Lead too long",description:"lead section is too long for the length of the article"},{tag:"Lead too short",description:"lead section is too short and should be expanded to summarize key points"},{tag:"Sections",description:"needs to be divided into sections by topic"},{tag:"Too many sections",description:"too many section headers dividing up content, should be condensed"},{tag:"Very long",description:"too long to read and navigate comfortably"}],"Fiction-related cleanup":[{tag:"All plot",description:"almost entirely a plot summary"},{tag:"Fiction",description:"fails to distinguish between fact and fiction"},{tag:"In-universe",description:"subject is fictional and needs rewriting to provide a non-fictional perspective"},{tag:"Long plot",description:"plot summary is too long or excessively detailed"},{tag:"No plot",description:"needs a plot summary"}]},"General content issues":{"Importance and notability":[{tag:"Notability",description:"subject may not meet the general notability guideline",subgroup:{name:"notability",parameter:"1",type:"select",list:[{label:"{{notability}}: article's subject may not meet the general notability guideline",value:""},{label:"{{notability|Academics}}: notability guideline for academics",value:"Academics"},{label:"{{notability|Astro}}: notability guideline for astronomical objects",value:"Astro"},{label:"{{notability|Biographies}}: notability guideline for biographies",value:"Biographies"},{label:"{{notability|Books}}: notability guideline for books",value:"Books"},{label:"{{notability|Companies}}: notability guidelines for companies and organizations",value:"Companies"},{label:"{{notability|Events}}: notability guideline for events",value:"Events"},{label:"{{notability|Films}}: notability guideline for films",value:"Films"},{label:"{{notability|Geographic}}: notability guideline for geographic features",value:"Geographic"},{label:"{{notability|Lists}}: notability guideline for stand-alone lists",value:"Lists"},{label:"{{notability|Music}}: notability guideline for music",value:"Music"},{label:"{{notability|Neologisms}}: notability guideline for neologisms",value:"Neologisms"},{label:"{{notability|Numbers}}: notability guideline for numbers",value:"Numbers"},{label:"{{notability|Products}}: notability guideline for products and services",value:"Products"},{label:"{{notability|Sports}}: notability guideline for sports and athletics",value:"Sports"},{label:"{{notability|Television}}: notability guideline for television shows",value:"Television"},{label:"{{notability|Web}}: notability guideline for web content",value:"Web"}]}}],"Style of writing":[{tag:"Advert",description:"written like an advertisement"},{tag:"Cleanup tense",description:"does not follow guidelines on use of different tenses."},{tag:"Essay-like",description:"written like a personal reflection, personal essay, or argumentative essay"},{tag:"Fanpov",description:"written from a fan's point of view"},{tag:"Like resume",description:"written like a resume"},{tag:"Manual",description:"written like a manual or guidebook"},{tag:"Cleanup-PR",description:"reads like a press release or news article",subgroup:{type:"hidden",name:"cleanupPR1",parameter:"1",value:"article"}},{tag:"Over-quotation",description:"too many or too-lengthy quotations for an encyclopedic entry"},{tag:"Prose",description:"written in a list format but may read better as prose"},{tag:"Technical",description:"too technical for most readers to understand"},{tag:"Tone",description:"tone or style may not reflect the encyclopedic tone used on Wikipedia"}],"Sense (or lack thereof)":[{tag:"Confusing",description:"confusing or unclear"},{tag:"Incomprehensible",description:"very hard to understand or incomprehensible"},{tag:"Unfocused",description:"lacks focus or is about more than one topic"}],"Information and detail":[{tag:"Context",description:"insufficient context for those unfamiliar with the subject"},{tag:"Expert needed",description:"needs attention from an expert on the subject",subgroup:[{name:"expertNeeded",parameter:"1",type:"input",label:"Name of relevant WikiProject: ",tooltip:'Optionally, enter the name of a WikiProject which might be able to help recruit an expert. Don\'t include the "WikiProject" prefix.'},{name:"expertNeededReason",parameter:"reason",type:"input",label:"Reason: ",tooltip:"Short explanation describing the issue. Either Reason or Talk link is required."},{name:"expertNeededTalk",parameter:"talk",type:"input",label:"Talk discussion: ",tooltip:"Name of the section of this article's talk page where the issue is being discussed. Do not give a link, just the name of the section. Either Reason or Talk link is required."}]},{tag:"Overly detailed",description:"excessive amount of intricate detail"},{tag:"Undue weight",description:"lends undue weight to certain ideas, incidents, or controversies"}],Timeliness:[{tag:"Current",description:"documents a current event",excludeInGroup:!0},{tag:"Update",description:"needs additional up-to-date information added"}],"Neutrality, bias, and factual accuracy":[{tag:"Autobiography",description:"autobiography and may not be written neutrally"},{tag:"COI",description:"creator or major contributor may have a conflict of interest"},{tag:"Disputed",description:"questionable factual accuracy"},{tag:"Hoax",description:"may partially or completely be a hoax"},{tag:"Globalize",description:"may not represent a worldwide view of the subject",subgroup:[{type:"hidden",name:"globalize1",parameter:"1",value:"article"},{name:"globalizeRegion",parameter:"2",type:"input",label:"Over-represented country or region"}]},{tag:"Over-coverage",description:"extensive bias or disproportional coverage towards one or more specific regions"},{tag:"Paid contributions",description:"contains paid contributions, and may therefore require cleanup"},{tag:"Peacock",description:"contains wording that promotes the subject in a subjective manner without adding information"},{tag:"POV",description:"does not maintain a neutral point of view"},{tag:"Recentism",description:"slanted towards recent events"},{tag:"Too few opinions",description:"may not include all significant viewpoints"},{tag:"Undisclosed paid",description:"may have been created or edited in return for undisclosed payments"},{tag:"Weasel",description:"neutrality or verifiability is compromised by the use of weasel words"}],"Verifiability and sources":[{tag:"BLP sources",description:"BLP that needs additional sources for verification"},{tag:"BLP unsourced",description:"BLP that has no sources at all (use BLP PROD instead for new articles)"},{tag:"More citations needed",description:"needs additional references or sources for verification"},{tag:"One source",description:"relies largely or entirely on a single source"},{tag:"Original research",description:"contains original research"},{tag:"Primary sources",description:"relies too much on references to primary sources, and needs secondary sources"},{tag:"Self-published",description:"contains excessive or inappropriate references to self-published sources"},{tag:"Sources exist",description:"notable topic, sources are available that could be added to article"},{tag:"Third-party",description:"relies too heavily on sources too closely associated with the subject"},{tag:"Unreferenced",description:"does not cite any sources at all"},{tag:"Unreliable sources",description:"some references may not be reliable"}]},"Specific content issues":{Language:[{tag:"Not English",description:"written in a language other than English and needs translation",excludeInGroup:!0,subgroup:Pe.slice(0,1).concat([{type:"checkbox",list:[{name:"translationNotify",label:"Notify article creator",checked:!0,tooltip:"Places {{uw-notenglish}} on the creator's talk page."}]}]).concat(Pe.slice(1))},{tag:"Rough translation",description:"poor translation from another language",excludeInGroup:!0,subgroup:Pe},{tag:"Expand language",description:"should be expanded with text translated from a foreign-language article",excludeInGroup:!0,subgroup:[{type:"hidden",name:"expandLangTopic",parameter:"topic",required:!0},{name:"expandLanguageLangCode",parameter:"langcode",type:"input",label:"Language code: ",tooltip:"Language code of the language from which article is to be expanded from",required:!0},{name:"expandLanguageArticle",parameter:"otherarticle",type:"input",label:"Name of article: ",tooltip:"Name of article to be expanded from, without the interwiki prefix"}]}],Links:[{tag:"Dead end",description:"article has no links to other articles"},{tag:"Orphan",description:"linked to from no other articles"},{tag:"Overlinked",description:"too many duplicate and/or irrelevant links to other articles"},{tag:"Underlinked",description:"needs more wikilinks to other articles"}],"Referencing technique":[{tag:"Citation style",description:"unclear or inconsistent citation style"},{tag:"Cleanup bare URLs",description:"uses bare URLs for references, which are prone to link rot"},{tag:"More footnotes",description:"has some references, but insufficient inline citations"},{tag:"No footnotes",description:"has references, but lacks inline citations"}],Categories:[{tag:"Improve categories",description:"needs additional or more specific categories",excludeInGroup:!0},{tag:"Uncategorized",description:"not added to any categories",excludeInGroup:!0}]},Merging:[{tag:"History merge",description:"another page should be history merged into this one",excludeInGroup:!0,dupeAllowed:!0,subgroup:[{name:"histmergeOriginalPage",parameter:"originalpage",type:"input",label:"Other article: ",tooltip:"Name of the page that should be merged into this one (required).",required:!0},{name:"histmergeReason",parameter:"reason",type:"input",label:"Reason: ",tooltip:'Short explanation describing the reason a history merge is needed. Should probably begin with "because" and end with a period.'},{name:"histmergeSysopDetails",parameter:"details",type:"input",label:"Extra details: ",tooltip:"For complex cases, provide extra instructions for the reviewing administrator."}]},{tag:"Merge",description:"should be merged with another given article",excludeInGroup:!0,subgroup:Te("Merge")},{tag:"Merge from",description:"another given article should be merged into this one",excludeInGroup:!0,dupeAllowed:!0,subgroup:Te("Merge from")},{tag:"Merge to",description:"should be merged into another given article",excludeInGroup:!0,subgroup:Te("Merge to")}],Informational:[{tag:"GOCEinuse",description:"currently undergoing a major copy edit by the Guild of Copy Editors",excludeInGroup:!0},{tag:"In use",description:"undergoing a major edit for a short while",excludeInGroup:!0},{tag:"Under construction",description:"in the process of an expansion or major restructuring",excludeInGroup:!0}]},Ne=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.name="redirect",t.tagList=ke,t.removalSupported=!0,t.groupTemplateName="Redirect category shell",t.groupTemplateNameRegex="(?:R(?:edirect)?(?: ?cat)?(?:egory)? ?shell|Redr)",t.groupTemplateNameRegexFlags="i",t.groupMinSize=1,t.assumeUnknownTagsGroupable=!0,t}return ee(t,e),t.isActive=function(){return Morebits.isPageRedirect()},t.prototype.getMenuTooltip=function(){return"Tag redirect"},t.prototype.getWindowTitle=function(){return"Redirect tagging"},t.prototype.makeForm=function(t){e.prototype.makeForm.call(this,t),this.formAppendPatrolLink()},t.prototype.parseExistingTags=function(){var e=this;this.existingTags=[],this.canRemove()&&$(".rcat").each((function(t,a){var i=a.className.slice("rcat rcat-".length).replace(/_/g," ");e.existingTags.push(i)}))},t.prototype.sortTags=function(){var e=this,t=this.params;t.newTags=t.tags.filter((function(t){return!!(!e.getTagRegex(t).test(e.pageText)||e.flatObject[t]&&e.flatObject[t].dupeAllowed)||(Morebits.status.warn("Info","Found {{"+t+"}} on the "+e.name+" already... excluding"),!1)}))},t.prototype.addAndRearrangeTags=function(){var e=this,t=this.params,a=this.pageText.match(/\s*\{\{R(?:edirect)? [^{}]*?\}\}/gi)||[],i="";if(a.forEach((function(t){e.pageText=e.pageText.replace(t,""),i+=t.trim()+"\n"})),this.groupRegex().test(this.pageText))Morebits.status.info("Info","Adding tags inside existing {{Redirect category shell}}"),this.addTagsIntoGroup(i+this.makeTagSetText(t.newTags));else{Morebits.status.info("Info","Grouping tags inside {{Redirect category shell}}");var o="{{"+this.groupTemplateName+"|\n"+i+this.makeTagSetText(t.newTags)+"}}";this.pageText+="\n"+o}},t}(ye),Re=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.name="article",t.tagList=Ce,t.removalSupported=!0,t.groupTemplateName="Multiple issues",t.groupTemplateNameRegex="(?:multiple ?issues|article ?issues|mi)(?!\\s*\\|\\s*section\\s*=)",t.groupTemplateNameRegexFlags="i",t.groupMinSize=2,t.assumeUnknownTagsGroupable=!1,t}return ee(t,e),t.isActive=function(){return-1!==[0,118].indexOf(mw.config.get("wgNamespaceNumber"))&&!!mw.config.get("wgCurRevisionId")},t.prototype.getMenuTooltip=function(){return"Add or remove article maintenance tags"},t.prototype.getWindowTitle=function(){return"Article maintenance tagging"},t.prototype.makeForm=function(t){e.prototype.makeForm.call(this,t),this.form.append({type:"checkbox",list:[{label:"Group inside {{multiple issues}} if possible",value:"group",name:"group",tooltip:"If applying two or more templates supported by {{multiple issues}} and this box is checked, all supported templates will be grouped inside a {{multiple issues}} template.",checked:V("groupByDefault")}]}),this.form.append({type:"input",label:"Reason",name:"reason",tooltip:"Optional reason to be appended in edit summary. Recommended when removing tags.",size:"60px"}),this.formAppendPatrolLink()},t.prototype.getCustomTagPrefName=function(){return"customTagList"},t.prototype.parseExistingTags=function(){var e=this;this.existingTags=[],this.canRemove()&&($(".mw-parser-output").children().each((function(t,a){if("H2"===a.tagName)return!1;if(0===a.className.indexOf("box-")){if("box-Multiple_issues"===a.classList[0])return void $(a).find(".ambox").each((function(t,a){var i=a.classList[0].slice(4).replace(/_/g," ");e.existingTags.push(i)}));var i=a.classList[0].slice(4).replace(/_/g," ");e.existingTags.push(i)}})),$(".box-Uncategorized").length&&this.existingTags.push("Uncategorized"),$(".box-Improve_categories").length&&this.existingTags.push("Improve categories"))},t.prototype.validateInput=function(){var e=this.params,t=e.tags;return["Merge","Merge from","Merge to"].filter((function(e){return t.includes(e)})).length>1?"Please select only one of {{Merge}}, {{Merge from}} and {{Merge to}}. If several merges are required, use {{Merge}} and separate the article names with pipes (although in this case Twinkle cannot tag the other articles automatically).":(e.mergeTagOther||e.mergeReason)&&-1!==e.mergeTarget.indexOf("|")?'Tagging multiple articles in a merge, and starting a discussion for multiple articles, is not supported at the moment. Please turn off "tag other article", and/or clear out the "reason" box, and try again.':["Not English","Rough translation"].filter((function(e){return t.includes(e)})).length>1?"Please select only one of {{Not English}} and {{Rough translation}}..":void 0},t.prototype.preprocessParams=function(){var t=this;e.prototype.preprocessParams.call(this);var a=this.params;a.disableGrouping=!a.group,a.tags.forEach((function(e){switch(e){case"Not English":case"Rough translation":a.translationPostAtPNT&&(t.templateParams[e].listed="yes");break;case"Merge":case"Merge to":case"Merge from":if(a.mergeTag=e,a.mergeTarget=Morebits.string.toUpperCaseFirstChar(a.mergeTarget.replace(/_/g," ")),t.templateParams[e][1]=a.mergeTarget,0===mw.config.get("wgNamespaceNumber")&&(a.mergeReason||a.discussArticle)){if(!a.discussArticle){a.discussArticle="Merge to"===e?a.mergeTarget:mw.config.get("wgTitle"),a.nonDiscussArticle="Merge to"===e?mw.config.get("wgTitle"):a.mergeTarget;var i="[["+a.nonDiscussArticle+"]]"+("Merge"===a.mergeTag?" with ":" into ")+"[["+a.discussArticle+"]]";a.talkDiscussionTitleLinked="Proposed merge of "+i,a.talkDiscussionTitle=a.talkDiscussionTitleLinked.replace(/\[\[(.*?)\]\]/g,"$1")}t.templateParams[e].discuss="Talk:"+a.discussArticle+"#"+a.talkDiscussionTitle}}}))},t.prototype.initialCleanup=function(){this.pageText=this.pageText.replace(/\{\{\s*([Uu]serspace draft)\s*(\|(?:\{\{[^{}]*\}\}|[^{}])*)?\}\}\s*/g,"")},t.prototype.sortTags=function(){var e=this,t=this.params;t.newTags=t.tags.filter((function(a){return!e.getTagRegex(a).test(e.pageText)||e.flatObject[a]&&e.flatObject[a].dupeAllowed?"Uncategorized"!==a&&"Improve categories"!==a||(e.pageText+="\n\n"+e.getTagText(a),!1):(Morebits.status.warn("Info","Found {{"+a+"}} on the "+e.name+" already... excluding"),-1!==["Merge","Merge to"].indexOf(a)&&(t.mergeTarget=t.mergeReason=t.mergeTagOther=null),!1)})),this.groupTemplateName&&(t.groupableExistingTags=t.tagsToRetain.filter((function(t){return e.isGroupable(t)})),t.groupableNewTags=[],t.nonGroupableNewTags=[],t.newTags.forEach((function(a){e.isGroupable(a)?t.groupableNewTags.push(a):t.nonGroupableNewTags.push(a)})))},t.prototype.addAndRearrangeTags=function(){var e=this,t=this.params;return this.groupTemplateName?this.groupRegex().test(this.pageText)?(Morebits.status.info("Info","Adding supported tags inside existing {{multiple issues}} tag"),this.addTagsOutsideGroup(t.nonGroupableNewTags),this.spliceGroupableExistingTags().then((function(a){e.addTagsIntoGroup(a+e.makeTagSetText(t.groupableNewTags))}))):this.shouldAddGroup()?(Morebits.status.info("Info","Grouping supported tags inside {{multiple issues}}"),this.spliceGroupableExistingTags().then((function(a){var i="{{"+e.groupTemplateName+"|\n"+e.makeTagSetText(t.groupableNewTags)+a+"}}",o=e.makeTagSetText(t.nonGroupableNewTags);e.pageText=e.insertTagText(i+"\n"+o,e.pageText)}))):(this.addTagsOutsideGroup(t.newTags),$.Deferred().resolve()):(this.addTagsOutsideGroup(t.newTags),$.Deferred().resolve())},t.prototype.insertTagText=function(e,t){var a=new Morebits.wikitext.page(t);return a.insertAfterTemplates(e,"short description|hatnote|main|correct title|dablink|distinguish|for|further|selfref|year dab|similar names|highway detail hatnote|broader|about(?:-distinguish| other people)?|other\\s?(?:hurricane(?: use)?s|people|persons|places|ships|uses(?: of)?)|redirect(?:-(?:distinguish|synonym|multi))?|see\\s?(?:wiktionary|also(?: if exists)?)pp|pp-.*?|db|delete|db-.*?|speedy deletion-.*?|(?:proposed deletion|prod blp)\\/dated(?:\\s*\\|(?:concern|user|timestamp|help).*)+|salt|proposed deletion endorsed",null,"(?:\x3c!--.*AfD.*\\n\\{\\{(?:Article for deletion\\/dated|AfDM).*\\}\\}\\n\x3c!--.*(?:\\n\x3c!--.*)?AfD.*(?:\\s*\\n))?").getText()},t.prototype.getTagText=function(e){return"{{"+e+this.getParameterText(e)+"|date={{subst:CURRENTMONTHNAME}} {{subst:CURRENTYEAR}}}}"},t.prototype.savePage=function(){var t=this;return e.prototype.savePage.call(this).then((function(){return t.postSave(t.pageobj)}))},t.prototype.postSave=function(e){var t=this,a=this.params,i=[];if(a.mergeReason){var o=new te("Talk:"+a.discussArticle,"Posting rationale on talk page");o.setNewSectionText(a.mergeReason.trim()+" ~~~~"),o.setNewSectionTitle(a.talkDiscussionTitleLinked),o.setChangeTags(g.changeTags),o.setWatchlist(V("watchMergeDiscussions")),o.setCreateOption("recreate"),i.push(o.newSection())}if(a.mergeTagOther){var n="Merge";"Merge from"===a.mergeTag?n="Merge to":"Merge to"===a.mergeTag&&(n="Merge from");var r=new te(a.mergeTarget,"Tagging other page ("+a.mergeTarget+")");r.setChangeTags(g.changeTags),i.push(r.load().then((function(){t.templateParams[n]={1:Morebits.pageNameNorm,discuss:t.templateParams[a.mergeTag].discuss||""};var e=t.insertTagText(t.getTagText(n)+"\n",r.getPageText());return r.setPageText(e),r.setEditSummary(ve.makeEditSummary([n],[])),r.setWatchlist(V("watchTaggedPages")),r.setMinorEdit(V("markTaggedPagesAsMinor")),r.setCreateOption("nocreate"),r.save()})))}if(a.translationPostAtPNT){var s=new te("Wikipedia:Pages needing translation into English","Listing article at Wikipedia:Pages needing translation into English");s.setFollowRedirect(!0),i.push(s.load().then((function(){var e,t,i=s.getPageText(),o=-1!==a.tags.indexOf("Rough translation")?"duflu":"needtrans",n=a.translationLanguage,r=a.translationComments,l="{{subst:"+o+"|pg="+Morebits.pageNameNorm+"|Language="+(n||"uncertain")+"|Comments="+r.trim()+"}} ~~~~";if("duflu"===o?(e=i+"\n\n"+l,t="Translation cleanup requested on "):(e=i.replace(/\n+(==\s?Translated pages that could still use some cleanup\s?==)/,"\n\n"+l+"\n\n$1"),t="Translation"+(n?" from "+n:"")+" requested on "),e!==i)return s.setPageText(e),s.setEditSummary(t+" [[:"+Morebits.pageNameNorm+"]]"),s.setChangeTags(g.changeTags),s.setCreateOption("recreate"),s.save();s.getStatusElement().error("failed to find target spot for the discussion")})))}if(a.translationNotify){var l=new Morebits.status("Looking up creator");e.setStatusElement(l),i.push(e.lookupCreation().then((function(){var t=e.getCreator();if(l.info("Found "+t),t!==mw.config.get("wgUserName")){var i=new te("User talk:"+t,"Notifying initial contributor ("+t+")");return i.setNewSectionTitle("Your article [["+Morebits.pageNameNorm+"]]"),i.setNewSectionText("{{subst:uw-notenglish|1="+Morebits.pageNameNorm+(a.translationPostAtPNT?"":"|nopnt=yes")+"}} ~~~~"),i.setEditSummary("Notice: Please use English when contributing to the English Wikipedia."),i.setChangeTags(g.changeTags),i.setCreateOption("recreate"),i.setFollowRedirect(!0,!1),i.newSection()}l.warn("You ("+t+") created this page; skipping user notification")})))}return $.when.apply($,i)},t}(ye),Me=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.name="file",t.tagList=xe,t}return ee(t,e),t.isActive=function(){return 6===mw.config.get("wgNamespaceNumber")&&!document.getElementById("mw-sharedupload")&&!!document.getElementById("mw-imagepage-section-filehistory")},t.prototype.getMenuTooltip=function(){return"Add maintenance tags to file"},t.prototype.getWindowTitle=function(){return"File maintenance tagging"},t.prototype.makeForm=function(t){e.prototype.makeForm.call(this,t),this.formAppendPatrolLink()},t.prototype.validateInput=function(){for(var e=this.params,t=this.params.tags,a=0,i=[["Bad GIF","Bad JPEG","Bad SVG","Bad format"],["Should be PNG","Should be SVG","Should be text"],["Bad SVG","Vector version available"],["Bad JPEG","Overcompressed JPEG"],["PNG version available","Vector version available"]];a<i.length;a++){var o=i[a];if(o.filter((function(e){return t.includes(e)})).length>1)return"Please select only one of: {{"+o.join("}}, {{")+"}}."}var n=(n=$(".mime-type").text())&&n.split(/\//)[1]||mw.Title.newFromText(Morebits.pageNameNorm).getExtension();if(n){var r,s=n.toUpperCase();if("JPG"===s&&(n="JPEG"),"GIF"!==s&&-1!==(r=t.indexOf("Bad GIF"))||"JPEG"!==s&&-1!==(r=t.indexOf("Bad JPEG"))||"SVG"!==s&&-1!==(r=t.indexOf("Bad SVG"))){var l="This appears to be a "+n+" file, ";return-1!==["GIF","JPEG","SVG"].indexOf(s)?l+="please use {{Bad "+s+"}} instead.":l+="so {{"+t[r]+"}} is inappropriate.",l}if(-1!==t.toString().indexOf("Should be ")&&-1!==t.indexOf("Should be "+s))return"This is already a "+n+" file, so {{Should be "+s+"}} is inappropriate.";if(-1!==t.indexOf("Overcompressed JPEG")&&"JPEG"!==s)return"This appears to be a "+n+" file, so {{Overcompressed JPEG}} probably doesn't apply.";if("SVG"!==s){if(-1!==t.indexOf("Bad trace"))return"This appears to be a "+n+" file, so {{Bad trace}} probably doesn't apply.";if(-1!==t.indexOf("Bad font"))return"This appears to be a "+n+" file, so {{Bad font}} probably doesn't apply."}}if(-1!==t.indexOf("Do not move to Commons")&&e.DoNotMoveToCommons_expiry&&(!/^2\d{3}$/.test(e.DoNotMoveToCommons_expiry)||parseInt(e.DoNotMoveToCommons_expiry,10)<=(new Date).getFullYear()))return"Must be a valid future year."},t.prototype.initialCleanup=function(){var e=this;this.params.tags.forEach((function(t){switch(t){case"Keep local":case"Now Commons":case"Do not move to Commons":e.pageText=e.pageText.replace(/\{\{(mtc|(copy |move )?to ?commons|move to wikimedia commons|copy to wikimedia commons)[^}]*\}\}/gi,"");break;case"Vector version available":e.pageText=e.pageText.replace(/\{\{((convert to |convertto|should be |shouldbe|to)?svg|badpng|vectorize)[^}]*\}\}/gi,"");break;case"Orphaned non-free revisions":e.pageText=e.pageText.replace(/\{\{\s*(Template\s*:\s*)?(Non-free reduce|FairUseReduce|Fairusereduce|Fair Use Reduce|Fair use reduce|Reduce size|Reduce|Fair-use reduce|Image-toobig|Comic-ovrsize-img|Non-free-reduce|Nfr|Smaller image|Nonfree reduce)\s*(\|(?:\{\{[^{}]*\}\}|[^{}])*)?\}\}\s*/gi,"")}}))},t}(ye);ve.modeList=[Ne,Re,Me];var Ae=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.footerlinks={"Twinkle help":"WP:TW/DOC#tag"},t}return ee(t,e),t.userPreferences=function(){var t=e.userPreferences.call(this);return t.preferences=t.preferences.concat([{name:"watchTaggedVenues",label:"Add page to watchlist when tagging these type of pages",type:"set",setValues:{articles:"Articles",drafts:"Drafts",redirects:"Redirects",files:"Files"},default:["articles","drafts","redirects","files"]},{name:"watchMergeDiscussions",label:"Add talk pages to watchlist when starting merge discussions",type:"enum",enumValues:Y.watchlistEnums},{name:"groupByDefault",label:'Check the "group into {{multiple issues}}" box by default',type:"boolean",default:!0},{name:"customTagList",label:"Custom article/draft maintenance tags to display",helptip:"These appear as additional options at the bottom of the list of tags. For example, you could add new maintenance tags which have not yet been added to Twinkle's defaults.",type:"customList",customListValueTitle:"Template name (no curly brackets)",customListLabelTitle:"Text to show in Tag dialog",default:[]},{name:"customFileTagList",label:"Custom file maintenance tags to display",helptip:"Additional tags that you wish to add for files.",type:"customList",customListValueTitle:"Template name (no curly brackets)",customListLabelTitle:"Text to show in Tag dialog",default:[]},{name:"customRedirectTagList",label:"Custom redirect category tags to display",helptip:"Additional tags that you wish to add for redirects.",type:"customList",customListValueTitle:"Template name (no curly brackets)",customListLabelTitle:"Text to show in Tag dialog",default:[]}]),t},t}(ve),Ee=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.footerlinks={"Speedy deletion policy":"WP:CSD","CSD prefs":"WP:TW/PREF#speedy","Twinkle help":"WP:TW/DOC#speedy"},t.criteriaLists=[{label:"Custom rationale",visible:function(e){return!e.mode.isMultiple},list:[{label:"Custom rationale"+(Morebits.userIsSysop?" (custom deletion reason)":" using {{db}} template"),value:"reason",code:"db",tooltip:'{{db}} is short for "delete because". At least one of the other deletion criteria must still apply to the page, and you must make mention of this in your rationale. This is not a "catch-all" for when you can\'t find any criteria that fit.',subgroup:{name:"reason_1",parameter:"1",utparam:"2",type:"input",label:"Rationale: ",size:60},hideWhenMultiple:!0}]},{label:"Talk pages",visible:function(e){return e.namespace%2==1&&3!==e.namespace},list:[{label:"G8: Talk pages with no corresponding subject page",value:"talk",code:"g8",tooltip:"This excludes any page that is useful to the project - in particular, user talk pages, talk page archives, and talk pages for files that exist on Wikimedia Commons."}]},{label:"Files",visible:function(e){return!e.isRedirect&&[6,7].includes(e.namespace)},list:[{label:"F1: Redundant file",value:"redundantimage",code:"f1",tooltip:"Any file that is a redundant copy, in the same file format and same or lower resolution, of something else on Wikipedia. Likewise, other media that is a redundant copy, in the same format and of the same or lower quality. This does not apply to files duplicated on Wikimedia Commons, because of licence issues; these should be tagged with {{subst:ncd|Image:newname.ext}} or {{subst:ncd}} instead",subgroup:{name:"redundantimage_filename",parameter:"filename",log:"[[:$1]]",type:"input",label:"File this is redundant to: ",tooltip:'The "File:" prefix can be left off.'}},{label:"F2: Corrupt, missing, or empty file",value:"noimage",code:"f2",tooltip:"Before deleting this type of file, verify that the MediaWiki engine cannot read it by previewing a resized thumbnail of it. This also includes empty (i.e., no content) file description pages for Commons files"},{label:"F2: Unneeded file description page for a file on Commons",value:"fpcfail",code:"f2",tooltip:"An image, hosted on Commons, but with tags or information on its English Wikipedia description page that are no longer needed. (For example, a failed featured picture candidate.)",hideWhenMultiple:!0},{label:"F3: Improper license",value:"noncom",code:"f3",tooltip:'Files licensed as "for non-commercial use only", "non-derivative use" or "used with permission" that were uploaded on or after 2005-05-19, except where they have been shown to comply with the limited standards for the use of non-free content. This includes files licensed under a "Non-commercial Creative Commons License". Such files uploaded before 2005-05-19 may also be speedily deleted if they are not used in any articles'},{label:"F4: Lack of licensing information",value:"unksource",code:"f4",tooltip:'Files in category "Files with unknown source", "Files with unknown copyright status", or "Files with no copyright tag" that have been tagged with a template that places them in the category for more than seven days, regardless of when uploaded. Note, users sometimes specify their source in the upload summary, so be sure to check the circumstances of the file.',hideWhenUser:!0},{label:"F5: Unused non-free copyrighted file",value:"f5",code:"f5",tooltip:'Files that are not under a free license or in the public domain that are not used in any article, whose only use is in a deleted article, and that are very unlikely to be used on any other article. Reasonable exceptions may be made for files uploaded for an upcoming article. For other unused non-free files, use the "Orphaned fair use" option in Twinkle\'s DI tab.',hideWhenUser:!0},{label:"F6: Missing fair-use rationale",value:"norat",code:"f6",tooltip:'Any file without a fair use rationale may be deleted seven days after it is uploaded. Boilerplate fair use templates do not constitute a fair use rationale. Files uploaded before 2006-05-04 should not be deleted immediately; instead, the uploader should be notified that a fair-use rationale is needed. Files uploaded after 2006-05-04 can be tagged using the "No fair use rationale" option in Twinkle\'s DI module. Such files can be found in the dated subcategories of Category:Files with no fair use rationale.',hideWhenUser:!0},{label:"F7: Clearly invalid fair-use tag",value:"badfairuse1",code:"f7",tooltip:"This is only for files with a clearly invalid fair-use tag, such as a {{Non-free logo}} tag on a photograph of a mascot. For cases that require a waiting period (replaceable images or otherwise disputed rationales), use the options on Twinkle's DI tab.",subgroup:{name:"badfairuse_rationale",parameter:"rationale",type:"input",label:"Optional explanation: ",size:60}},{label:"F7: Fair-use media from a commercial image agency which is not the subject of sourced commentary",value:"badfairuse2",code:"f7",tooltip:"Non-free images or media from a commercial source (e.g., Associated Press, Getty), where the file itself is not the subject of sourced commentary, are considered an invalid claim of fair use and fail the strict requirements of WP:NFCC.",subgroup:{name:"badfairuse_rationale",parameter:"rationale",type:"input",label:"Optional explanation: ",size:60},hideWhenMultiple:!0},{label:"F8: File available as an identical or higher-resolution copy on Wikimedia Commons",value:"commons",code:"f8",tooltip:"Provided the following conditions are met: 1: The file format of both images is the same. 2: The file's license and source status is beyond reasonable doubt, and the license is undoubtedly accepted at Commons. 3: All information on the file description page is present on the Commons file description page. That includes the complete upload history with links to the uploader's local user pages. 4: The file is not protected, and the file description page does not contain a request not to move it to Commons. 5: If the file is available on Commons under a different name than locally, all local references to the file must be updated to point to the title used at Commons. 6: For {{c-uploaded}} files: They may be speedily deleted as soon as they are off the Main Page",subgroup:{name:"commons_filename",parameter:"filename",log:"[[commons:$1]]",type:"input",label:"Filename on Commons: ",value:Morebits.pageNameNorm,tooltip:'This can be left blank if the file has the same name on Commons as here. The "File:" prefix is optional.'},hideWhenMultiple:!0},{label:"F9: Unambiguous copyright infringement",value:"imgcopyvio",code:"f9",tooltip:"The file was copied from a website or other source that does not have a license compatible with Wikipedia, and the uploader neither claims fair use nor makes a credible assertion of permission of free use. Sources that do not have a license compatible with Wikipedia include stock photo libraries such as Getty Images or Corbis. Non-blatant copyright infringements should be discussed at Wikipedia:Files for deletion",subgroup:[{name:"imgcopyvio_url",parameter:"url",utparam:"url",type:"input",label:'URL of the copyvio, including the "http://". If the copyvio is of a non-internet source and you cannot provide a URL, you must use the deletion rationale box. ',size:60},{name:"imgcopyvio_rationale",parameter:"rationale",type:"input",label:"Deletion rationale for non-internet copyvios: ",size:60}]},{label:"F10: Useless non-media file",value:"badfiletype",code:"f10",tooltip:"Files uploaded that are neither image, sound, nor video files (e.g. .doc, .pdf, or .xls files) which are not used in any article and have no foreseeable encyclopedic use"},{label:"F11: No evidence of permission",value:"nopermission",code:"f11",tooltip:"If an uploader has specified a license and has named a third party as the source/copyright holder without providing evidence that this third party has in fact agreed, the item may be deleted seven days after notification of the uploader",hideWhenUser:!0},{label:"G8: File description page with no corresponding file",value:"imagepage",code:"g8",tooltip:"This is only for use when the file doesn't exist at all. Corrupt files, and local description pages for files on Commons, should use F2; implausible redirects should use R3; and broken Commons redirects should use R4."}]},{label:"Articles",visible:function(e){return!e.isRedirect&&[0,1].includes(e.namespace)},list:[{label:"A1: No context. Articles lacking sufficient context to identify the subject of the article.",value:"nocontext",code:"a1",tooltip:'Example: "He is a funny man with a red car. He makes people laugh." This applies only to very short articles. Context is different from content, treated in A3, below.'},{label:"A2: Foreign language articles that exist on another Wikimedia project",value:"foreign",code:"a2",tooltip:"If the article in question does not exist on another project, the template {{notenglish}} should be used instead. All articles in a non-English language that do not meet this criteria (and do not meet any other criteria for speedy deletion) should be listed at Pages Needing Translation (PNT) for review and possible translation",subgroup:{name:"foreign_source",parameter:"source",utparam:"source",log:"[[:$1]]",type:"input",label:"Interwiki link to the article on the foreign-language wiki: ",tooltip:"For example, fr:Bonjour"}},{label:"A3: No content whatsoever",value:"nocontent",code:"a3",tooltip:'Any article consisting only of links elsewhere (including hyperlinks, category tags and "see also" sections), a rephrasing of the title, and/or attempts to correspond with the person or group named by its title. This does not include disambiguation pages'},{label:"A5: Transwikied articles",value:"transwiki",code:"a5",tooltip:"Any article that has been discussed at Articles for Deletion (et al), where the outcome was to transwiki, and where the transwikification has been properly performed and the author information recorded. Alternately, any article that consists of only a dictionary definition, where the transwikification has been properly performed and the author information recorded",subgroup:{name:"transwiki_location",parameter:"location",utparam:"location",type:"input",label:"Link to where the page has been transwikied: ",tooltip:"For example, https://en.wiktionary.org/wiki/twinkle or [[wikt:twinkle]]"}},{label:"A7: No indication of importance (people, groups, companies, web content, individual animals, or organized events)",value:"a7",code:"a7",tooltip:"An article about a real person, group of people, band, club, company, web content, individual animal, tour, or party that does not assert the importance or significance of its subject. If controversial, or if a previous AfD has resulted in the article being kept, the article should be nominated for AfD instead",hideWhenSingle:!0},{label:"A7: No indication of importance (person)",value:"person",code:"a7",tooltip:"An article about a real person that does not assert the importance or significance of its subject. If controversial, or if there has been a previous AfD that resulted in the article being kept, the article should be nominated for AfD instead",hideWhenMultiple:!0},{label:"A7: No indication of importance (musician(s) or band)",value:"band",code:"a7",tooltip:"Article about a band, singer, musician, or musical ensemble that does not assert the importance or significance of the subject",hideWhenMultiple:!0},{label:"A7: No indication of importance (club, society or group)",value:"club",code:"a7",tooltip:"Article about a club, society or group that does not assert the importance or significance of the subject",hideWhenMultiple:!0},{label:"A7: No indication of importance (company or organization)",value:"corp",code:"a7",tooltip:"Article about a company or organization that does not assert the importance or significance of the subject",hideWhenMultiple:!0},{label:"A7: No indication of importance (website or web content)",value:"web",code:"a7",tooltip:"Article about a web site, blog, online forum, webcomic, podcast, or similar web content that does not assert the importance or significance of its subject",hideWhenMultiple:!0},{label:"A7: No indication of importance (individual animal)",value:"animal",code:"a7",tooltip:"Article about an individual animal (e.g. pet) that does not assert the importance or significance of its subject",hideWhenMultiple:!0},{label:"A7: No indication of importance (organized event)",value:"event",code:"a7",tooltip:"Article about an organized event (tour, function, meeting, party, etc.) that does not assert the importance or significance of its subject",hideWhenMultiple:!0},{label:"A9: Unremarkable musical recording where artist's article doesn't exist",value:"a9",code:"a9",tooltip:"An article about a musical recording which does not indicate why its subject is important or significant, and where the artist's article has never existed or has been deleted"},{label:"A10: Recently created article that duplicates an existing topic",value:"a10",code:"a10",tooltip:"A recently created article with no relevant page history that does not aim to expand upon, detail or improve information within any existing article(s) on the subject, and where the title is not a plausible redirect. This does not include content forks, split pages or any article that aims at expanding or detailing an existing one.",subgroup:{name:"a10_article",parameter:"article",utparam:"article",log:"[[:$1]]",type:"input",label:"Article that is duplicated: "}},{label:"A11: Obviously made up by creator, and no claim of significance",value:"madeup",code:"a11",tooltip:"An article which plainly indicates that the subject was invented/coined/discovered by the article's creator or someone they know personally, and does not credibly indicate why its subject is important or significant"}]},{label:"Categories",visible:function(e){return!e.isRedirect&&[14,15].includes(e.namespace)},list:[{label:"C1: Empty categories",value:"catempty",code:"c1",tooltip:"Categories that have been unpopulated for at least seven days. This does not apply to categories being discussed at WP:CFD, disambiguation categories, and certain other exceptions. If the category isn't relatively new, it possibly contained articles earlier, and deeper investigation is needed"},{label:"G8: Categories populated by a deleted or retargeted template",value:"templatecat",code:"g8",tooltip:"This is for situations where a category is effectively empty, because the template(s) that formerly placed pages in that category are now deleted. This excludes categories that are still in use.",subgroup:{name:"templatecat_rationale",parameter:"rationale",type:"input",label:"Optional explanation: ",size:60}},{label:"G8: Redirects to non-existent targets",value:"redirnone",code:"g8",tooltip:"This excludes any page that is useful to the project, and in particular: deletion discussions that are not logged elsewhere, user and user talk pages, talk page archives, plausible redirects that can be changed to valid targets, and file pages or talk pages for files that exist on Wikimedia Commons.",hideWhenMultiple:!0}]},{label:"User pages",visible:function(e){return[2,3].includes(e.namespace)},list:[{label:"U1: User request",value:"userreq",code:"u1",tooltip:"Personal subpages, upon request by their user. In some rare cases there may be administrative need to retain the page. Also, sometimes, main user pages may be deleted as well. See Wikipedia:User page for full instructions and guidelines",subgroup:3===mw.config.get("wgNamespaceNumber")&&-1===mw.config.get("wgTitle").indexOf("/")?{name:"userreq_rationale",parameter:"rationale",type:"input",label:"A mandatory rationale to explain why this user talk page should be deleted: ",tooltip:"User talk pages are deleted only in highly exceptional circumstances. See WP:DELTALK.",size:60}:null,hideSubgroupWhenMultiple:!0},{label:"U2: Nonexistent user",value:"nouser",code:"u2",tooltip:"User pages of users that do not exist (Check Special:Listusers)"},{label:"U3: Non-free galleries",value:"gallery",code:"u3",tooltip:'Galleries in the userspace which consist mostly of "fair use" or non-free files. Wikipedia\'s non-free content policy forbids users from displaying non-free files, even ones they have uploaded themselves, in userspace. It is acceptable to have free files, GFDL-files, Creative Commons and similar licenses along with public domain material, but not "fair use" files',hideWhenRedirect:!0},{label:"U5: Blatant WP:NOTWEBHOST violations",value:"notwebhost",code:"u5",tooltip:"Pages in userspace consisting of writings, information, discussions, and/or activities not closely related to Wikipedia's goals, where the owner has made few or no edits outside of userspace, with the exception of plausible drafts and pages adhering to WP:UPYES.",hideWhenRedirect:!0},{label:"G11: Promotional user page under a promotional user name",value:"spamuser",code:"g11",tooltip:"A promotional user page, with a username that promotes or implies affiliation with the thing being promoted. Note that simply having a page on a company or product in one's userspace does not qualify it for deletion. If a user page is spammy but the username is not, then consider tagging with regular G11 instead.",hideWhenMultiple:!0,hideWhenRedirect:!0},{label:"G13: AfC draft submission or a blank draft, stale by over 6 months",value:"afc",code:"g13",tooltip:"Any rejected or unsubmitted AfC draft submission or a blank draft, that has not been edited in over 6 months (excluding bot edits).",hideWhenMultiple:!0,hideWhenRedirect:!0,subgroup:{type:"hidden",name:"g13timestamp",parameter:"ts",value:"$TIMESTAMP"}}]},{label:"Portals",visible:function(e){return!e.isRedirect&&[100,101].includes(e.namespace)},list:[{label:"P1: Portal that would be subject to speedy deletion if it were an article",value:"p1",code:"p1",tooltip:"You must specify a single article criterion that applies in this case (A1, A3, A7, or A10).",subgroup:{name:"p1_criterion",parameter:"criterion",utparam:"criterion",log:"[[WP:CSD#:$1]]",type:"input",label:"Article criterion that would apply: "}},{label:"P2: Underpopulated portal (fewer than three non-stub articles)",value:"emptyportal",code:"p2",tooltip:"Any Portal based on a topic for which there is not a non-stub header article, and at least three non-stub articles detailing subject matter that would be appropriate to discuss under the title of that Portal"}]},{label:"General criteria",visible:function(){return!0},list:[{label:"G1: Patent nonsense. Pages consisting purely of incoherent text or gibberish with no meaningful content or history.",value:"nonsense",code:"g1",tooltip:"This does not include poor writing, partisan screeds, obscene remarks, vandalism, fictional material, material not in English, poorly translated material, implausible theories, or hoaxes. In short, if you can understand it, G1 does not apply.",hideInNamespaces:[2]},{label:"G2: Test page",value:"test",code:"g2",tooltip:"A page created to test editing or other Wikipedia functions. Pages in the User namespace are not included, nor are valid but unused or duplicate templates (although criterion T3 may apply).",hideInNamespaces:[2]},{label:"G3: Pure vandalism",value:"vandalism",code:"g3",tooltip:"Plain pure vandalism (including redirects left behind from pagemove vandalism)"},{label:"G3: Blatant hoax",value:"hoax",code:"g3",tooltip:"Blatant and obvious hoax, to the point of vandalism",hideWhenMultiple:!0},{label:"G4: Recreation of material deleted via a deletion discussion",value:"repost",code:"g4",tooltip:'A copy, by any title, of a page that was deleted via an XfD process or Deletion review, provided that the copy is substantially identical to the deleted version. This clause does not apply to content that has been "userfied", to content undeleted as a result of Deletion review, or if the prior deletions were proposed or speedy deletions, although in this last case, other speedy deletion criteria may still apply',subgroup:{name:"repost_xfd",parameter:"xfd",utparam:"xfd",log:"[[:$1]]",type:"input",label:"Page where the deletion discussion took place: ",tooltip:'Must start with "Wikipedia:"',size:60}},{label:"G5: Created by a banned or blocked user",value:"banned",code:"g5",tooltip:"Pages created by banned or blocked users in violation of their ban or block, and which have no substantial edits by others",subgroup:{name:"banned_user",parameter:"user",log:"[[:User:$1]]",type:"input",label:"Username of banned user (if available): ",tooltip:'Should not start with "User:"'}},{label:"G6: Move",value:"move",code:"g6",tooltip:"Making way for an uncontroversial move like reversing a redirect",subgroup:[{name:"move_page",parameter:"page",log:"[[:$1]]",type:"input",label:"Page to be moved here: "},{name:"move_reason",parameter:"reason",type:"input",label:"Reason: ",size:60}],hideWhenMultiple:!0},{label:"G6: XfD",value:"xfd",code:"g6",tooltip:'A deletion discussion (at AfD, FfD, RfD, TfD, CfD, or MfD) was closed as "delete", but the page wasn\'t actually deleted.',subgroup:{name:"xfd_fullvotepage",parameter:"fullvotepage",log:"[[:$1]]",type:"input",label:"Page where the deletion discussion was held: ",tooltip:'Must start with "Wikipedia:"',size:40},hideWhenMultiple:!0},{label:"G6: Copy-and-paste page move",value:"copypaste",code:"g6",tooltip:"This only applies for a copy-and-paste page move of another page that needs to be temporarily deleted to make room for a clean page move.",subgroup:[{name:"copypaste_sourcepage",parameter:"sourcepage",log:"[[:$1]]",type:"input",label:"Original page that was copy-pasted here: "},{name:"copypaste_topage",type:"hidden",value:Morebits.pageNameNorm,utparam:"to"}],hideWhenMultiple:!0},{label:"G6: Housekeeping and non-controversial cleanup",value:"g6",code:"g6",tooltip:"Other routine maintenance tasks",subgroup:{name:"g6_rationale",parameter:"rationale",type:"input",label:"Rationale: ",size:60}},{label:"G7: Author requests deletion, or author blanked",value:"author",code:"g7",tooltip:"Any page for which deletion is requested by the original author in good faith, provided the page's only substantial content was added by its author. If the author blanks the page, this can also be taken as a deletion request.",subgroup:{name:"author_rationale",parameter:"rationale",type:"input",label:"Optional explanation: ",tooltip:"Perhaps linking to where the author requested this deletion.",size:60},hideSubgroupWhenSysop:!0},{label:"G8: Pages dependent on a non-existent or deleted page",value:"g8",code:"g8",tooltip:"such as talk pages with no corresponding subject page; subpages with no parent page; file pages without a corresponding file; redirects to non-existent targets; or categories populated by deleted or retargeted templates. This excludes any page that is useful to the project, and in particular: deletion discussions that are not logged elsewhere, user and user talk pages, talk page archives, plausible redirects that can be changed to valid targets, and file pages or talk pages for files that exist on Wikimedia Commons.",subgroup:{name:"g8_rationale",parameter:"rationale",type:"input",label:"Optional explanation: ",size:60},hideSubgroupWhenSysop:!0},{label:"G8: Subpages with no parent page",value:"subpage",code:"g8",tooltip:"This excludes any page that is useful to the project, and in particular: deletion discussions that are not logged elsewhere, user and user talk pages, talk page archives, plausible redirects that can be changed to valid targets, and file pages or talk pages for files that exist on Wikimedia Commons.",hideWhenMultiple:!0,hideInNamespaces:[0,6,8]},{label:"G10: Attack page",value:"attack",redactContents:!0,code:"g10",tooltip:'Pages that serve no purpose but to disparage or threaten their subject or some other entity (e.g., "John Q. Doe is an imbecile"). This includes a biography of a living person that is negative in tone and unsourced, where there is no NPOV version in the history to revert to. Administrators deleting such pages should not quote the content of the page in the deletion summary!',subgroup:{type:"hidden",name:"attackBlanked",parameter:"blanked",value:"yes"}},{label:"G10: Wholly negative, unsourced BLP",value:"negublp",redactContents:!0,code:"g10",tooltip:"A biography of a living person that is entirely negative in tone and unsourced, where there is no neutral version in the history to revert to.",hideWhenMultiple:!0},{label:"G11: Unambiguous advertising or promotion",value:"spam",code:"g11",tooltip:"Pages which exclusively promote a company, product, group, service, or person and which would need to be fundamentally rewritten in order to become encyclopedic. Note that an article about a company or a product which describes its subject from a neutral point of view does not qualify for this criterion; an article that is blatant advertising should have inappropriate content as well"},{label:"G12: Unambiguous copyright infringement",value:"copyvio",code:"g12",tooltip:"Either: (1) Material was copied from another website that does not have a license compatible with Wikipedia, or is photography from a stock photo seller (such as Getty Images or Corbis) or other commercial content provider; (2) There is no non-infringing content in the page history worth saving; or (3) The infringement was introduced at once by a single person rather than created organically on wiki and then copied by another website such as one of the many Wikipedia mirrors",subgroup:[{name:"copyvio_url",parameter:"url",utparam:"url",type:"input",label:"URL (if available): ",tooltip:'If the material was copied from an online source, put the URL here, including the "http://" or "https://" protocol.',size:60},{name:"copyvio_url2",parameter:"url2",utparam:"url2",type:"input",label:"Additional URL: ",tooltip:'Optional. Should begin with "http://" or "https://"',size:60},{name:"copyvio_url3",parameter:"url3",utparam:"url3",type:"input",label:"Additional URL: ",tooltip:'Optional. Should begin with "http://" or "https://"',size:60}]},{label:"G13: Page in draft namespace or userspace AfC submission, stale by over 6 months",value:"afc",code:"g13",tooltip:"Any rejected or unsubmitted AfC submission in userspace or any non-redirect page in draft namespace, that has not been edited for more than 6 months. Blank drafts in either namespace are also included.",hideWhenRedirect:!0,showInNamespaces:[2,118]},{label:"G14: Unnecessary disambiguation page",value:"disambig",code:"g14",tooltip:'This only applies for orphaned disambiguation pages which either: (1) disambiguate only one existing Wikipedia page and whose title ends in "(disambiguation)" (i.e., there is a primary topic); or (2) disambiguate no (zero) existing Wikipedia pages, regardless of its title. It also applies to orphan "Foo (disambiguation)" redirects that target pages that are not disambiguation or similar disambiguation-like pages (such as set index articles or lists)'}]},{label:"Redirects",visible:function(e){return e.isRedirect},list:[{label:"R2: Redirect from mainspace to any other namespace except the Category:, Template:, Wikipedia:, Help: and Portal: namespaces",value:"rediruser",code:"r2",tooltip:"This does not include the pseudo-namespace shortcuts. If this was the result of a page move, consider waiting a day or two before deleting the redirect",showInNamespaces:[0]},{label:"R3: Recently created redirect from an implausible typo or misnomer",value:"redirtypo",code:"r3",tooltip:"However, redirects from common misspellings or misnomers are generally useful, as are redirects in other languages"},{label:"R4: File namespace redirect with a name that matches a Commons page",value:"redircom",code:"r4",tooltip:"The redirect should have no incoming links (unless the links are cleary intended for the file or redirect at Commons).",showInNamespaces:[6]},{label:"G6: Redirect to malplaced disambiguation page",value:"movedab",code:"g6",tooltip:"This only applies for redirects to disambiguation pages ending in (disambiguation) where a primary topic does not exist.",hideWhenMultiple:!0},{label:"G8: Redirects to non-existent targets",value:"redirnone",code:"g8",tooltip:"This excludes any page that is useful to the project, and in particular: deletion discussions that are not logged elsewhere, user and user talk pages, talk page archives, plausible redirects that can be changed to valid targets, and file pages or talk pages for files that exist on Wikimedia Commons.",hideWhenMultiple:!0}]}],t}return ee(t,e),t.prototype.getTaggingCode=function(){var e=this.params,t="";return e.normalizeds.length>1?(t="{{db-multiple",e.normalizeds.forEach((function(a,i){t+="|"+a.toUpperCase(),obj_entries(e.templateParams[i]).forEach((function(e){var a=e[0],i=e[1];parseInt(a,10)||(t+="|"+a+"="+i)}))})),t+="}}"):(t="{{db-"+e.csd[0],obj_entries(e.templateParams[0]).forEach((function(e){var a=e[0],i=e[1];t+="|"+a+"="+i})),e.notifyUser&&(t+="|help=off"),t+="}}"),t},t.prototype.preprocessParamInputs=function(){var e=this.params;e.banned_user&&(e.banned_user=e.banned_user.replace(/^\s*User:/i,"")),e.redundantimage_filename&&(e.redundantimage_filename=new mw.Title(e.redundantimage_filename,6).toText()),e.commons_filename&&e.commons_filename!==Morebits.pageNameNorm&&(e.commons_filename=new mw.Title(e.commons_filename,6).toText())},t.prototype.validateInputs=function(){var e=this.params,t=new Set(e.csd);return!t.has("userreq")||3!==mw.config.get("wgNamespaceNumber")||/\//.test(mw.config.get("wgTitle"))||e.userreq_rationale?t.has("repost")&&e.repost_xfd&&!/^(?:wp|wikipedia):/i.test(e.repost_xfd)?'CSD G4: The deletion discussion page name, if provided, must start with "Wikipedia:".':t.has("xfd")&&e.xfd_fullvotepage&&!/^(?:wp|wikipedia):/i.test(e.xfd_fullvotepage)?'CSD G6 (XFD): The deletion discussion page name, if provided, must start with "Wikipedia:".':!t.has("imgcopyvio")||e.imgcopyvio_url||e.imgcopyvio_rationale?void 0:"CSD F9: You must enter a url or reason (or both) when nominating a file under F9.":"CSD U1: Please specify a rationale when nominating user talk pages."},t.prototype.insertTagText=function(e,t){return new Morebits.wikitext.page(t).insertAfterTemplates(e+"\n",re).getText()},t}(function(e){function t(){var t=e.call(this)||this;return t.portletName="CSD",t.portletId="twinkle-csd",t.portletTooltip=Morebits.userIsSysop?"Delete page according to WP:CSD":"Request speedy deletion according to WP:CSD",t.windowTitle="Choose criteria for speedy deletion",t.addMenu(),t}return n(t,e),t.prototype.makeWindow=function(){var e=this;this.dialog=new ae(V("speedyWindowWidth"),V("speedyWindowHeight")),this.dialog.setTitle(this.windowTitle),this.dialog.setFooterLinks(this.footerlinks),this.hasCSD=!!$("#delete-reason").length,this.makeFlatObject();var t=new Morebits.quickForm((function(t){return e.evaluate(t)}),"radioClick"===V("speedySelectionStyle")?"change":null);if(this.form=t,Morebits.userIsSysop){t.append({type:"checkbox",list:[{label:"Tag page only, don't delete",value:"tag_only",name:"tag_only",tooltip:"If you just want to tag the page, instead of deleting it now",checked:!(this.hasCSD||V("deleteSysopDefaultToDelete")),event:function(t){var a=t.target.form,i=t.target.checked;a.deleteTalkPage&&(a.deleteTalkPage.checked=!i&&V("deleteTalkPageOnDelete")),a.deleteRedirects.checked=!i,a.delmultiple.checked=!1,a.notify.checked=i,a.warnusertalk.checked=!i&&!e.hasCSD,a.multiple.checked=!1,a.requestsalt.checked=!1,e.modeChanged(a),t.stopPropagation()}}]});var a=t.append({type:"div",name:"delete_options"});a.append({type:"header",label:"Delete-related options"}),mw.config.get("wgNamespaceNumber")%2!=0||2===mw.config.get("wgNamespaceNumber")&&!/\//.test(mw.config.get("wgTitle"))||a.append({type:"checkbox",list:[{label:"Also delete talk page",value:"deleteTalkPage",name:"deleteTalkPage",tooltip:"This option deletes the page's talk page in addition. If you choose the F8 (moved to Commons) criterion, this option is ignored and the talk page is *not* deleted.",checked:V("deleteTalkPageOnDelete"),event:function(e){return e.stopPropagation()}}]}),a.append({type:"checkbox",list:[{label:"Also delete all redirects",value:"deleteRedirects",name:"deleteRedirects",tooltip:"This option deletes all incoming redirects in addition. Avoid this option for procedural (e.g. move/merge) deletions.",checked:V("deleteRedirectsOnDelete"),event:function(e){return e.stopPropagation()}},{label:"Delete under multiple criteria",value:"delmultiple",name:"delmultiple",tooltip:"When selected, you can select several criteria that apply to the page. For example, G11 and A7 are a common combination for articles.",event:function(t){e.modeChanged(t.target.form),t.stopPropagation()}},{label:"Notify page creator of page deletion",value:"warnusertalk",name:"warnusertalk",tooltip:"A notification template will be placed on the talk page of the creator, IF you have a notification enabled in your Twinkle preferences for the criterion you choose AND this box is checked. The creator may be welcomed as well.",checked:!this.hasCSD,event:function(e){return e.stopPropagation()}}]})}var i=t.append({type:"div",name:"tag_options"});Morebits.userIsSysop&&i.append({type:"header",label:"Tag-related options"}),i.append({type:"checkbox",list:[{label:"Notify page creator if possible",value:"notify",name:"notify",tooltip:"A notification template will be placed on the talk page of the creator, IF you have a notification enabled in your Twinkle preferences for the criterion you choose AND this box is checked. The creator may be welcomed as well.",checked:!Morebits.userIsSysop||!(this.hasCSD||V("deleteSysopDefaultToDelete")),event:function(e){return e.stopPropagation()}},{label:"Tag for creation protection (salting) as well",value:"requestsalt",name:"requestsalt",tooltip:"When selected, the speedy deletion tag will be accompanied by a {{salt}} tag requesting that the deleting administrator apply creation protection. Only select if this page has been repeatedly recreated.",event:function(e){return e.stopPropagation()}},{label:"Tag with multiple criteria",value:"multiple",name:"multiple",tooltip:"When selected, you can select several criteria that apply to the page. For example, G11 and A7 are a common combination for articles.",event:function(t){e.modeChanged(t.target.form),t.stopPropagation()}}]}),t.append({type:"div",id:"prior-deletion-count",style:"font-style: italic"}),t.append({type:"div",name:"work_area",label:"Failed to initialize the CSD module. Please try again, or tell the Twinkle developers about the issue."}),"radioClick"!==V("speedySelectionStyle")&&t.append({type:"submit",className:"tw-speedy-submit"}),this.result=t.render(),this.dialog.setContent(this.result),this.dialog.display(),this.modeChanged(this.result),this.priorDeletionCount()},t.prototype.priorDeletionCount=function(){var e={action:"query",format:"json",list:"logevents",letype:"delete",leaction:"delete/delete",letitle:mw.config.get("wgPageName"),leprop:"",lelimit:5};new E("Checking for past deletions",e).post().then((function(e){var t=e.getResponse(),a=t.query.logevents.length;if(a){var i=a+" previous deletion";a>1&&(i+="s",t.continue&&(i="More than "+i),a>=3&&$("#prior-deletion-count").css("color","red"));var o=Morebits.htmlNode("a","(logs)");o.setAttribute("href",mw.util.getUrl("Special:Log",{page:mw.config.get("wgPageName")})),o.setAttribute("target","_blank"),$("#prior-deletion-count").text(i+" "),$("#prior-deletion-count").append(o)}}))},t.prototype.getMode=function(){var e=this.result;return this.mode={isSysop:!!e.tag_only&&!e.tag_only.checked,isMultiple:e.tag_only&&!e.tag_only.checked?e.delmultiple.checked:e.multiple.checked,isRadioClick:"radioClick"===V("speedySelectionStyle")}},t.prototype.modeChanged=function(e){var t=this;this.getMode(),$("[name=delete_options]").toggle(this.mode.isSysop),$("[name=tag_options]").toggle(!this.mode.isSysop),$("button.tw-speedy-submit").text(this.mode.isSysop?"Delete page":"Tag page");var a=new Morebits.quickForm.element({type:"div",name:"work_area"});if(this.mode.isMultiple&&this.mode.isRadioClick&&(a.append({type:"div",label:"When finished choosing criteria, click:"}),a.append({type:"button",name:"submit-multiple",label:this.mode.isSysop?"Delete page":"Tag page",event:function(e){t.evaluate(e),e.stopPropagation()}})),this.appendCriteriaLists(a),$(e).find("[name=work_area]").replaceWith(a.render()),this.mode.isSysop&&this.hasCSD){var i=$("input[name=csd][value=reason]")[0];if(i){"radioClick"!==V("speedySelectionStyle")&&i.click();var o=decodeURIComponent($("#delete-reason").text()).replace(/\+/g," ");$('input[name="csd.reason_1"]').val(o)}}},t.prototype.appendCriteriaLists=function(e){var t=this;this.namespace=mw.config.get("wgNamespaceNumber"),this.isRedirect=Morebits.isPageRedirect();var a=this.mode.isMultiple?"checkbox":"radio";this.criteriaLists.forEach((function(i){i.visible(t)&&(e.append({type:"header",label:i.label}),e.append({type:a,name:"csd",list:t.generateCsdList(i.list)}))}))},t.prototype.generateCsdList=function(e){var t=this,a=this.mode,i=function(e){$(e.target.form).find("input").prop("disabled",!0),$(e.target.form).children().css("color","gray"),$(e.target).parent().css("color","black").find("input").prop("disabled",!1),$(e.target).parent().find("input:text")[0].focus(),e.stopPropagation()},o=function(e){var i=a.isSysop?"evaluateSysop":"evaluateUser";t[i](e),e.stopPropagation()};return e.map((function(e){var n=$.extend({},e);if(a.isMultiple){if(n.hideWhenMultiple)return null;n.hideSubgroupWhenMultiple&&(n.subgroup=null)}else{if(n.hideWhenSingle)return null;n.hideSubgroupWhenSingle&&(n.subgroup=null)}if(a.isSysop){if(n.hideWhenSysop)return null;n.hideSubgroupWhenSysop&&(n.subgroup=null)}else{if(n.hideWhenUser)return null;n.hideSubgroupWhenUser&&(n.subgroup=null)}return Morebits.isPageRedirect()&&n.hideWhenRedirect||n.showInNamespaces&&n.showInNamespaces.indexOf(t.namespace)<0||n.hideInNamespaces&&n.hideInNamespaces.indexOf(t.namespace)>-1?null:(n.subgroup&&!a.isMultiple&&a.isRadioClick&&(n.subgroup=h(n.subgroup).concat({type:"button",name:"submit",label:a.isSysop?"Delete page":"Tag page",event:o}),n.event=i),n)})).filter((function(e){return e}))},t.prototype.makeFlatObject=function(){var e=this;this.flatObject={},this.criteriaLists.forEach((function(t){t.list.forEach((function(t){e.flatObject[t.value]=t}))}))},t.prototype.evaluate=function(e){var t=this;if("checkbox"!==e.target.type&&"text"!==e.target.type&&"select"!==e.target.type){if(this.params=Morebits.quickForm.getInputData(this.result),!this.params.csd||!this.params.csd.length)return alert("Please select a criterion!");this.preprocessParams();var a=this.validateInputs();if(a)return alert(a);Morebits.simpleWindow.setButtonsEnabled(!1),Morebits.status.init(this.result);var i=new Morebits.taskManager(this);i.add(this.fetchCreatorInfo,[]),this.mode.isSysop?(i.add(this.parseDeletionReason,[]),i.add(this.deletePage,[this.parseDeletionReason]),i.add(this.deleteTalk,[this.deletePage]),i.add(this.deleteRedirects,[this.deletePage]),i.add(this.noteToCreator,[this.deletePage,this.fetchCreatorInfo])):(i.add(this.checkPage,[]),i.add(this.tagPage,[this.checkPage]),i.add(this.patrolPage,[this.checkPage]),i.add(this.noteToCreator,[this.checkPage,this.fetchCreatorInfo]),i.add(this.addToLog,[this.noteToCreator])),i.execute().then((function(){Morebits.status.actionCompleted(t.mode.isSysop?"Deletion completed":"Tagging completed"),setTimeout((function(){window.location.href=mw.util.getUrl(Morebits.pageNameNorm)}),5e4)}))}},t.prototype.preprocessParams=function(){var e=this,t=this.params;t.csd=h(t.csd),t.normalizeds=t.csd.map((function(t){return e.flatObject[t].code})),this.getTemplateParameters(),this.getMode(),this.mode.isSysop?(t.promptForSummary=t.normalizeds.some((function(e){return-1!==V("promptForSpeedyDeletionSummary").indexOf(e)})),t.warnUser=t.warnusertalk&&t.normalizeds.some((function(e,a){return-1!==V("warnUserOnSpeedyDelete").indexOf(e)&&!("g6"===e&&"copypaste"!==t.values[a])}))):(t.notifyUser=t.notify&&t.normalizeds.some((function(e,a){return-1!==V("notifyUserOnSpeedyDeletionNomination").indexOf(e)&&!("g6"===e&&"copypaste"!==t.csd[a])})),t.redactContents=t.csd.some((function(t){return e.flatObject[t].redactContents}))),t.watch=t.normalizeds.some((function(e){return-1!==V("watchSpeedyPages").indexOf(e)&&V("watchSpeedyExpiry")})),t.welcomeuser=(t.notifyUser||t.warnUser)&&t.normalizeds.some((function(e){return-1!==V("welcomeUserOnSpeedyDeletionNotification").indexOf(e)})),this.preprocessParamInputs()},t.prototype.preprocessParamInputs=function(){},t.prototype.getTemplateParameters=function(){var e=this;this.params.templateParams=new Array(this.params.csd.length),this.params.csd.forEach((function(t,a){var i=e.flatObject[t],o={};h(i.subgroup).forEach((function(t){t.parameter&&e.params[t.name]&&(o[t.parameter]=e.params[t.name])})),e.params.templateParams[a]=o}))},t.prototype.getTaggingCode=function(){var e=this.params,t="";return e.normalizeds.length>1?(t="{{db-multiple",e.normalizeds.forEach((function(a,i){t+="|"+a.toUpperCase(),C(e.templateParams[i]).forEach((function(e){var a=e[0],i=e[1];parseInt(a,10)||(t+="|"+a+"="+i)}))})),t+="}}"):(t="{{db-"+e.csd[0],C(e.templateParams[0]).forEach((function(e){var a=e[0],i=e[1];t+="|"+a+"="+i})),e.notifyUser&&(t+="|help=off"),t+="}}"),t},t.prototype.getUserTalkParameters=function(){var e=this,t={};this.params.csd.forEach((function(a){h(e.flatObject[a].subgroup).forEach((function(a,i){a.utparam&&e.params[a.name]&&(t["key"+(i+1)]=a.utparam,t["value"+(i+1)]=e.params[a.name],t[a.utparam]=e.params[a.name])}))})),this.params.utparams=t},t.prototype.getUserNotificationText=function(){var e=this.params,t="";return e.normalizeds.length>1?(t="\n{{subst:db-"+(e.warnUser?"deleted":"notice")+"-multiple|1="+Morebits.pageNameNorm,e.normalizeds.forEach((function(e,a){t+="|"+(a+2)+"="+e.toUpperCase()}))):"db"===e.normalizeds[0]?t="\n{{subst:db-reason-"+(e.warnUser?"deleted":"notice")+"|1="+Morebits.pageNameNorm:(t="\n{{subst:db-csd-"+(e.warnUser?"deleted":"notice")+"-custom|1=","copypaste"===e.csd[0]?t+=e.templateParams[0].sourcepage:t+=Morebits.pageNameNorm,t+="|2="+e.csd[0]),this.getUserTalkParameters(),C(e.utparams).forEach((function(e){var a=e[0],i=e[1];t+="|"+a+"="+i})),t+=(e.welcomeuser?"":"|nowelcome=yes")+"}} ~~~~"},t.prototype.fetchCreatorInfo=function(){var e=this;if(!this.params.notifyUser&&!this.params.warnUser)return $.Deferred().resolve();var t=new te(Morebits.pageNameNorm,"Finding page creator");return t.lookupCreation().then((function(){e.params.initialContrib=t.getCreator(),t.getStatusElement().info("Found "+t.getCreator())}))},t.prototype.patrolPage=function(){return V("markSpeedyPagesAsPatrolled")&&new te(Morebits.pageNameNorm).triage(),$.Deferred().resolve()},t.prototype.checkPage=function(){var e=new te(mw.config.get("wgPageName"),"Tagging page");return e.setChangeTags(g.changeTags),e.load().then((function(){var t=e.getStatusElement();if(!e.exists())return t.error("It seems that the page doesn't exist; perhaps it has already been deleted"),$.Deferred().reject();var a=e.getPageText();t.status("Checking for tags on the page...");var i=/(?:\{\{\s*(db|delete|db-.*?|speedy deletion-.*?)(?:\s*\||\s*\}\}))/.exec(a);if(i&&!confirm("The page already has the CSD-related template {{"+i[1]+"}} on it. Do you want to add another CSD template?"))return $.Deferred().reject();var o=/\{\{((?:article for deletion|proposed deletion|prod blp|template for discussion)\/dated|[cfm]fd\b)/i.exec(a)||/#invoke:(RfD)/.exec(a);return o&&!confirm("The deletion-related template {{"+o[1]+"}} was found on the page. Do you still want to add a CSD template?")?$.Deferred().reject():e}))},t.prototype.tagPage=function(e){var t,a=this.params,i=e.getPageText(),o=this.getTaggingCode();if(-1!==a.normalizeds.indexOf("g13")&&(o=o.replace("$TIMESTAMP",e.getLastEditTime())),a.requestsalt&&(o="{{salt}}\n"+o),!e.canEdit()||-1===["wikitext","Scribunto","javascript","css","sanitized-css"].indexOf(e.getContentModel())){var n=new mw.Title(e.getPageName()).getTalkPage().toText();if(n===e.getPageName())return e.getStatusElement().error("Page protected and nowhere to add an edit request, aborting"),$.Deferred().reject();e.getStatusElement().warn("Unable to edit page, placing tag on talk page");var r=new te(n,"Automatically placing tag on talk page");return r.setNewSectionTitle(e.getPageName()+" nominated for CSD, request deletion"),r.setNewSectionText(o+"\n\nI was unable to tag "+e.getPageName()+" so please delete it. ~~~~"),r.setCreateOption("recreate"),r.setFollowRedirect(!0),r.setWatchlist(a.watch),r.setChangeTags(g.changeTags),r.newSection()}if(i=i.replace(/\{\{\s*([Uu]serspace draft)\s*(\|(?:\{\{[^{}]*\}\}|[^{}])*)?\}\}\s*/g,""),6===mw.config.get("wgNamespaceNumber")&&(i=i.replace(/\{\{(mtc|(copy |move )?to ?commons|move to wikimedia commons|copy to wikimedia commons)[^}]*\}\}/gi,"")),10===mw.config.get("wgNamespaceNumber")&&(o="<noinclude>"+o+"</noinclude>"),"Scribunto"===mw.config.get("wgPageContentModel")){for(var s="";-1!==o.indexOf("]"+s+"]");)s+="=";o="require('Module:Module wikitext')._addText(["+s+"["+o+"]"+s+"]);"}else-1!==["javascript","css","sanitized-css"].indexOf(mw.config.get("wgPageContentModel"))&&(o="/* "+o+" */");"db"===a.normalizeds[0]?t='Requesting [[WP:CSD|speedy deletion]] with rationale "'+a.templateParams[0][1]+'".':t="Requesting speedy deletion ("+a.normalizeds.map((function(e){return"[[WP:CSD#"+e.toUpperCase()+"|CSD "+e.toUpperCase()+"]]"})).join(", ")+").";return i=a.redactContents?o:this.insertTagText(o,i),e.setPageText(i),e.setEditSummary(t),e.setWatchlist(a.watch),e.save()},t.prototype.insertTagText=function(e,t){return e+"\n"+t},t.prototype.noteToCreator=function(){var e=this.params,t=e.initialContrib;if(!t)return $.Deferred().resolve();if(t===mw.config.get("wgUserName")?(Morebits.status.warn("Note","You ("+t+") created this page; skipping user notification"),t=null):t===mw.config.get("wgTitle")&&3===mw.config.get("wgNamespaceNumber")?(Morebits.status.warn("Note","Notifying initial contributor: this user created their own user talk page; skipping notification"),t=null):"Cyberbot I"!==t&&"SoxBot"!==t||"f2"!==e.normalizeds[0]?this.hasCSD&&e.warnUser&&!confirm("The page is has a deletion-related tag, and thus the creator has likely been notified. Do you want to notify them for this deletion as well?")&&(Morebits.status.info("Notifying initial contributor","canceled by user; skipping notification."),t=null):(Morebits.status.warn("Note","Notifying initial contributor: page created procedurally by bot; skipping notification"),t=null),!t)return e.initialContrib=null,$.Deferred().resolve();var a=new te("User talk:"+t,"Notifying initial contributor ("+t+")"),i="Notification: speedy deletion"+(e.warnUser?"":" nomination");return e.redactContents?i+=" of an attack page.":i+=" of [[:"+Morebits.pageNameNorm+"]].",a.setAppendText(this.getUserNotificationText()),a.setEditSummary(i),a.setChangeTags(g.changeTags),a.setCreateOption("recreate"),a.setFollowRedirect(!0,!1),a.append()},t.prototype.parseWikitext=function(e){var t=new Morebits.status("Building deletion summary"),a=new E("Parsing deletion template",{action:"parse",prop:"text",pst:"true",text:e,contentmodel:"wikitext",title:mw.config.get("wgPageName"),disablelimitreport:!0,format:"json"});return a.setStatusElement(t),a.post().then((function(e){var a=decodeURIComponent($(e.getResponse().parse.text).find("#delete-reason").text()).replace(/\+/g," ");return a?t.info("complete"):t.warn("Unable to generate summary from deletion template"),a}))},t.prototype.parseDeletionReason=function(){var e=this.params;if(e.normalizeds.length||"db"!==e.normalizeds[0]){var t=this.getTaggingCode();return this.parseWikitext(t).then((function(t){e.promptForSummary&&(t=prompt("Enter the deletion summary to use, or press OK to accept the automatically generated one.",t)),e.deleteReason=t}))}return e.deleteReason=prompt("Enter the deletion summary to use, which will be entered into the deletion log:",""),$.Deferred().resolve()},t.prototype.deletePage=function(){var e=this.params,t=new te(mw.config.get("wgPageName"),"Deleting page");return null===e.deleteReason?(Morebits.status.error("Asking for reason","User cancelled"),$.Deferred().reject()):e.deleteReason&&e.deleteReason.trim()?(t.setEditSummary(e.deleteReason),t.setChangeTags(g.changeTags),t.setWatchlist(e.watch),t.deletePage().then((function(){t.getStatusElement().info("done")}))):(Morebits.status.error("Asking for reason","you didn't give one. I don't know... what with admins and their apathetic antics... I give up..."),$.Deferred().reject())},t.prototype.deleteTalk=function(){if(this.params.deleteTalkPage&&"new"!==document.getElementById("ca-talk").className){var e=new te(new mw.Title(Morebits.pageNameNorm).getTalkPage().toText(),"Deleting talk page");return e.setEditSummary('[[WP:CSD#G8|G8]]: Talk page of deleted page "'+Morebits.pageNameNorm+'"'),e.setChangeTags(g.changeTags),e.deletePage().then((function(){e.getStatusElement().info("done")}))}return $.Deferred().resolve()},t.prototype.deleteRedirects=function(){var e,t,a=this,i=$.Deferred();if(this.params.deleteRedirects){var o=new E("getting list of redirects...",{action:"query",titles:mw.config.get("wgPageName"),prop:"redirects",rdlimit:"max",format:"json"});o.setStatusElement(new Morebits.status("Deleting redirects")),o.post().then((function(e){var t=e.getResponse().query.pages[0].redirects||[],a=t.length,o=e.getStatusElement();if(a){o.status("0%");var n=0,r=function(e){var t=Math.round(100*++n/a)+"%";o.update(t),e.getStatusElement().unlink(),n>=a&&(o.info(t+" (completed)"),i.resolve(),Morebits.wiki.removeCheckpoint())};Morebits.wiki.addCheckpoint(),t.forEach((function(e){var t=e.title,a=new te(t,'Deleting redirect "'+t+'"');a.setEditSummary('[[WP:CSD#G8|G8]]: Redirect to deleted page "'+Morebits.pageNameNorm+'"'),a.setChangeTags(g.changeTags),a.deletePage().then(r)}))}else o.status("no redirects found")}))}else i.resolve();var n=6===mw.config.get("wgNamespaceNumber");return e=$("<a>",{href:"#",text:"click here to go to the Unlink tool",css:{fontSize:"130%",fontWeight:"bold"},click:function(){Morebits.wiki.actionCompleted.redirect=null,a.dialog.close(),g.unlink.makeWindow(n?"Removing usages of and/or links to deleted file "+Morebits.pageNameNorm:"Removing links to deleted page "+Morebits.pageNameNorm)}}),t=$("<span>",{text:n?"To orphan backlinks and remove instances of file usage":"To orphan backlinks",css:{fontSize:"130%",fontWeight:"bold"}}),Morebits.status.info(t[0],e[0]),i},t.prototype.addToLog=function(){var e=this,t=this.params;if(!(V("logSpeedyNominations")&&t.normalizeds.some((function(e){return-1===V("noLogOnSpeedyNomination").indexOf(e)}))))return $.Deferred().resolve();var a=new Morebits.userspaceLogger(V("speedyLogPageName"));a.initialText="This is a log of all [[WP:CSD|speedy deletion]] nominations made by this user using [[WP:TW|Twinkle]]'s CSD module.\n\nIf you no longer wish to keep this log, you can turn it off using the [[Wikipedia:Twinkle/Preferences|preferences panel]], and nominate this page for speedy deletion under [[WP:CSD#U1|CSD U1]]."+(Morebits.userIsSysop?"\n\nThis log does not track outright speedy deletions made using Twinkle.":"");var i="",o=6===mw.config.get("wgNamespaceNumber")?" ([{{fullurl:Special:Log|page="+mw.util.wikiUrlencode(mw.config.get("wgPageName"))+"}} log])":"",n="Logging speedy deletion nomination",r="# [[:"+Morebits.pageNameNorm;(t.redactContents?(r+="|This]] attack page"+o+": ",n+=" of an attack page."):(r+="]]"+o+": ",n+=" of [[:"+Morebits.pageNameNorm+"]]."),t.normalizeds.length>1)?r+="multiple criteria ("+t.normalizeds.map((function(e){return"[[WP:CSD#"+e.toUpperCase()+"|"+e.toUpperCase()+"]]"})).join(", ")+")":"db"===t.normalizeds[0]?r+="{{tl|db-reason}}":r+="[[WP:CSD#"+t.normalizeds[0].toUpperCase()+"|CSD "+t.normalizeds[0].toUpperCase()+"]] ({{tl|db-"+t.csd[0]+"}})";return"db"===t.normalizeds[0]?i+=" {Custom rationale: "+t.templateParams[0][1]+"}":t.csd.forEach((function(a){var o=e.flatObject[a],n=o.code.toUpperCase();h(o.subgroup).forEach((function(e){var a=t[e.name];if(a&&e.parameter){if(e.log)a=Morebits.string.safeReplace(e.log,/\$1/g,a);else if(null===e.log)return;i+=" {"+n+" "+e.parameter+": "+a+"}"}}))})),t.requestsalt&&(r+="; requested creation protection ([[WP:SALT|salting]])"),i&&(r+="; additional information:"+i),t.initialContrib&&(r+="; notified {{user|1="+t.initialContrib+"}}"),r+=" ~~~~~\n",a.changeTags=g.changeTags,a.log(r,n)},t.prototype.validateInputs=function(){},t.prototype.userPreferences=function(){return{title:"CSD",preferences:[]}},t.moduleName="CSD",t}(K)),We=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.footerlinks={"Choosing a warning level":"WP:UWUL#Levels","Warn prefs":"WP:TW/PREF#warn","Twinkle help":"WP:TW/DOC#warn","Give feedback":"WT:TW"},t.warningLevels={level1:{label:"1: General note",selected:function(e){return 1===e}},level2:{label:"2: Caution",selected:function(e){return 2===e}},level3:{label:"3: Warning",selected:function(e){return 3===e}},level4:{label:"4: Final warning",selected:function(e){return 4===e}},level4im:{label:"4im: Only warning",selected:function(e){return 5===e}},singlenotice:{label:"Single-issue notices",selected:function(e){return 6===e},visible:function(){return!V("combinedSingletMenus")}},singlewarn:{label:"Single-issue warnings",selected:function(e){return 7===e},visible:function(){return!V("combinedSingletMenus")}},singlecombined:{label:"Single-issue messages",selected:function(e){return 6===e||7===e},visible:function(){return!!V("combinedSingletMenus")}},kitchensink:{label:"All warning templates",selected:function(e){return 10===e}},autolevel:{label:"Auto-select level (1-4)",selected:function(e){return 11===e}},custom:{label:"Custom warnings",selected:function(e){return 9===e},visible:function(){var e;return!!(null===(e=V("customWarningList"))||void 0===e?void 0:e.length)}}},t}return ee(t,e),t.prototype.processWarnings=function(){var e={"Common warnings":{"uw-vandalism":{level1:{label:"Vandalism",summary:"General note: Unconstructive editing"},level2:{label:"Vandalism",summary:"Caution: Unconstructive editing"},level3:{label:"Vandalism",summary:"Warning: Vandalism"},level4:{label:"Vandalism",summary:"Final warning: Vandalism"},level4im:{label:"Vandalism",summary:"Only warning: Vandalism"}},"uw-disruptive":{level1:{label:"Disruptive editing",summary:"General note: Unconstructive editing"},level2:{label:"Disruptive editing",summary:"Caution: Unconstructive editing"},level3:{label:"Disruptive editing",summary:"Warning: Disruptive editing"}},"uw-test":{level1:{label:"Editing tests",summary:"General note: Editing tests"},level2:{label:"Editing tests",summary:"Caution: Editing tests"},level3:{label:"Editing tests",summary:"Warning: Editing tests"}},"uw-delete":{level1:{label:"Removal of content, blanking",summary:"General note: Removal of content, blanking"},level2:{label:"Removal of content, blanking",summary:"Caution: Removal of content, blanking"},level3:{label:"Removal of content, blanking",summary:"Warning: Removal of content, blanking"},level4:{label:"Removal of content, blanking",summary:"Final warning: Removal of content, blanking"},level4im:{label:"Removal of content, blanking",summary:"Only warning: Removal of content, blanking"}},"uw-generic":{level4:{label:"Generic warning (for template series missing level 4)",summary:"Final warning notice"}}},"Behavior in articles":{"uw-biog":{level1:{label:"Adding unreferenced controversial information about living persons",summary:"General note: Adding unreferenced controversial information about living persons"},level2:{label:"Adding unreferenced controversial information about living persons",summary:"Caution: Adding unreferenced controversial information about living persons"},level3:{label:"Adding unreferenced controversial/defamatory information about living persons",summary:"Warning: Adding unreferenced controversial information about living persons"},level4:{label:"Adding unreferenced defamatory information about living persons",summary:"Final warning: Adding unreferenced controversial information about living persons"},level4im:{label:"Adding unreferenced defamatory information about living persons",summary:"Only warning: Adding unreferenced controversial information about living persons"}},"uw-defamatory":{level1:{label:"Addition of defamatory content",summary:"General note: Addition of defamatory content"},level2:{label:"Addition of defamatory content",summary:"Caution: Addition of defamatory content"},level3:{label:"Addition of defamatory content",summary:"Warning: Addition of defamatory content"},level4:{label:"Addition of defamatory content",summary:"Final warning: Addition of defamatory content"},level4im:{label:"Addition of defamatory content",summary:"Only warning: Addition of defamatory content"}},"uw-error":{level1:{label:"Introducing deliberate factual errors",summary:"General note: Introducing factual errors"},level2:{label:"Introducing deliberate factual errors",summary:"Caution: Introducing factual errors"},level3:{label:"Introducing deliberate factual errors",summary:"Warning: Introducing deliberate factual errors"},level4:{label:"Introducing deliberate factual errors",summary:"Final warning: Introducing deliberate factual errors"}},"uw-genre":{level1:{label:"Frequent or mass changes to genres without consensus or references",summary:"General note: Frequent or mass changes to genres without consensus or references"},level2:{label:"Frequent or mass changes to genres without consensus or references",summary:"Caution: Frequent or mass changes to genres without consensus or references"},level3:{label:"Frequent or mass changes to genres without consensus or reference",summary:"Warning: Frequent or mass changes to genres without consensus or reference"},level4:{label:"Frequent or mass changes to genres without consensus or reference",summary:"Final warning: Frequent or mass changes to genres without consensus or reference"}},"uw-image":{level1:{label:"Image-related vandalism in articles",summary:"General note: Image-related vandalism in articles"},level2:{label:"Image-related vandalism in articles",summary:"Caution: Image-related vandalism in articles"},level3:{label:"Image-related vandalism in articles",summary:"Warning: Image-related vandalism in articles"},level4:{label:"Image-related vandalism in articles",summary:"Final warning: Image-related vandalism in articles"},level4im:{label:"Image-related vandalism",summary:"Only warning: Image-related vandalism"}},"uw-joke":{level1:{label:"Using improper humor in articles",summary:"General note: Using improper humor in articles"},level2:{label:"Using improper humor in articles",summary:"Caution: Using improper humor in articles"},level3:{label:"Using improper humor in articles",summary:"Warning: Using improper humor in articles"},level4:{label:"Using improper humor in articles",summary:"Final warning: Using improper humor in articles"},level4im:{label:"Using improper humor",summary:"Only warning: Using improper humor"}},"uw-nor":{level1:{label:"Adding original research, including unpublished syntheses of sources",summary:"General note: Adding original research, including unpublished syntheses of sources"},level2:{label:"Adding original research, including unpublished syntheses of sources",summary:"Caution: Adding original research, including unpublished syntheses of sources"},level3:{label:"Adding original research, including unpublished syntheses of sources",summary:"Warning: Adding original research, including unpublished syntheses of sources"},level4:{label:"Adding original research, including unpublished syntheses of sources",summary:"Final warning: Adding original research, including unpublished syntheses of sources"}},"uw-notcensored":{level1:{label:"Censorship of material",summary:"General note: Censorship of material"},level2:{label:"Censorship of material",summary:"Caution: Censorship of material"},level3:{label:"Censorship of material",summary:"Warning: Censorship of material"}},"uw-own":{level1:{label:"Ownership of articles",summary:"General note: Ownership of articles"},level2:{label:"Ownership of articles",summary:"Caution: Ownership of articles"},level3:{label:"Ownership of articles",summary:"Warning: Ownership of articles"},level4:{label:"Ownership of articles",summary:"Final warning: Ownership of articles"},level4im:{label:"Ownership of articles",summary:"Only warning: Ownership of articles"}},"uw-subtle":{level1:{label:"Subtle vandalism",summary:"General note: Possible unconstructive editing"},level2:{label:"Subtle vandalism",summary:"Caution: Likely unconstructive editing"},level3:{label:"Subtle vandalism",summary:"Warning: Subtle vandalism"},level4:{label:"Subtle vandalism",summary:"Final warning: Subtle vandalism"}},"uw-tdel":{level1:{label:"Removal of maintenance templates",summary:"General note: Removal of maintenance templates"},level2:{label:"Removal of maintenance templates",summary:"Caution: Removal of maintenance templates"},level3:{label:"Removal of maintenance templates",summary:"Warning: Removal of maintenance templates"},level4:{label:"Removal of maintenance templates",summary:"Final warning: Removal of maintenance templates"}},"uw-unsourced":{level1:{label:"Addition of unsourced or improperly cited material",summary:"General note: Addition of unsourced or improperly cited material"},level2:{label:"Addition of unsourced or improperly cited material",summary:"Caution: Addition of unsourced or improperly cited material"},level3:{label:"Addition of unsourced or improperly cited material",summary:"Warning: Addition of unsourced or improperly cited material"},level4:{label:"Addition of unsourced or improperly cited material",summary:"Final warning: Addition of unsourced or improperly cited material"}}},"Promotions and spam":{"uw-advert":{level1:{label:"Using Wikipedia for advertising or promotion",summary:"General note: Using Wikipedia for advertising or promotion"},level2:{label:"Using Wikipedia for advertising or promotion",summary:"Caution: Using Wikipedia for advertising or promotion"},level3:{label:"Using Wikipedia for advertising or promotion",summary:"Warning: Using Wikipedia for advertising or promotion"},level4:{label:"Using Wikipedia for advertising or promotion",summary:"Final warning: Using Wikipedia for advertising or promotion"},level4im:{label:"Using Wikipedia for advertising or promotion",summary:"Only warning: Using Wikipedia for advertising or promotion"}},"uw-npov":{level1:{label:"Not adhering to neutral point of view",summary:"General note: Not adhering to neutral point of view"},level2:{label:"Not adhering to neutral point of view",summary:"Caution: Not adhering to neutral point of view"},level3:{label:"Not adhering to neutral point of view",summary:"Warning: Not adhering to neutral point of view"},level4:{label:"Not adhering to neutral point of view",summary:"Final warning: Not adhering to neutral point of view"}},"uw-paid":{level1:{label:"Paid editing without disclosure under the Wikimedia Terms of Use",summary:"General note: Paid editing without disclosure under the Wikimedia Terms of Use"},level2:{label:"Paid editing without disclosure under the Wikimedia Terms of Use",summary:"Caution: Paid editing without disclosure under the Wikimedia Terms of Use"},level3:{label:"Paid editing without disclosure under the Wikimedia Terms of Use",summary:"Warning: Paid editing without disclosure under the Wikimedia Terms of Use"},level4:{label:"Paid editing without disclosure under the Wikimedia Terms of Use",summary:"Final warning: Paid editing without disclosure under the Wikimedia Terms of Use"}},"uw-spam":{level1:{label:"Adding inappropriate external links",summary:"General note: Adding inappropriate external links"},level2:{label:"Adding spam links",summary:"Caution: Adding spam links"},level3:{label:"Adding spam links",summary:"Warning: Adding spam links"},level4:{label:"Adding spam links",summary:"Final warning: Adding spam links"},level4im:{label:"Adding spam links",summary:"Only warning: Adding spam links"}}},"Behavior towards other editors":{"uw-agf":{level1:{label:"Not assuming good faith",summary:"General note: Not assuming good faith"},level2:{label:"Not assuming good faith",summary:"Caution: Not assuming good faith"},level3:{label:"Not assuming good faith",summary:"Warning: Not assuming good faith"}},"uw-harass":{level1:{label:"Harassment of other users",summary:"General note: Harassment of other users"},level2:{label:"Harassment of other users",summary:"Caution: Harassment of other users"},level3:{label:"Harassment of other users",summary:"Warning: Harassment of other users"},level4:{label:"Harassment of other users",summary:"Final warning: Harassment of other users"},level4im:{label:"Harassment of other users",summary:"Only warning: Harassment of other users"}},"uw-npa":{level1:{label:"Personal attack directed at a specific editor",summary:"General note: Personal attack directed at a specific editor"},level2:{label:"Personal attack directed at a specific editor",summary:"Caution: Personal attack directed at a specific editor"},level3:{label:"Personal attack directed at a specific editor",summary:"Warning: Personal attack directed at a specific editor"},level4:{label:"Personal attack directed at a specific editor",summary:"Final warning: Personal attack directed at a specific editor"},level4im:{label:"Personal attack directed at a specific editor",summary:"Only warning: Personal attack directed at a specific editor"}},"uw-tempabuse":{level1:{label:"Improper use of warning or blocking template",summary:"General note: Improper use of warning or blocking template"},level2:{label:"Improper use of warning or blocking template",summary:"Caution: Improper use of warning or blocking template"}}},"Removal of deletion tags":{"uw-afd":{level1:{label:"Removing {{afd}} templates",summary:"General note: Removing {{afd}} templates"},level2:{label:"Removing {{afd}} templates",summary:"Caution: Removing {{afd}} templates"},level3:{label:"Removing {{afd}} templates",summary:"Warning: Removing {{afd}} templates"},level4:{label:"Removing {{afd}} templates",summary:"Final warning: Removing {{afd}} templates"}},"uw-blpprod":{level1:{label:"Removing {{blp prod}} templates",summary:"General note: Removing {{blp prod}} templates"},level2:{label:"Removing {{blp prod}} templates",summary:"Caution: Removing {{blp prod}} templates"},level3:{label:"Removing {{blp prod}} templates",summary:"Warning: Removing {{blp prod}} templates"},level4:{label:"Removing {{blp prod}} templates",summary:"Final warning: Removing {{blp prod}} templates"}},"uw-idt":{level1:{label:"Removing file deletion tags",summary:"General note: Removing file deletion tags"},level2:{label:"Removing file deletion tags",summary:"Caution: Removing file deletion tags"},level3:{label:"Removing file deletion tags",summary:"Warning: Removing file deletion tags"},level4:{label:"Removing file deletion tags",summary:"Final warning: Removing file deletion tags"}},"uw-speedy":{level1:{label:"Removing speedy deletion tags",summary:"General note: Removing speedy deletion tags"},level2:{label:"Removing speedy deletion tags",summary:"Caution: Removing speedy deletion tags"},level3:{label:"Removing speedy deletion tags",summary:"Warning: Removing speedy deletion tags"},level4:{label:"Removing speedy deletion tags",summary:"Final warning: Removing speedy deletion tags"}}},Other:{"uw-attempt":{level1:{label:"Triggering the edit filter",summary:"General note: Triggering the edit filter"},level2:{label:"Triggering the edit filter",summary:"Caution: Triggering the edit filter"},level3:{label:"Triggering the edit filter",summary:"Warning: Triggering the edit filter"},level4:{label:"Triggering the edit filter",summary:"Final warning: Triggering the edit filter"}},"uw-chat":{level1:{label:"Using talk page as forum",summary:"General note: Using talk page as forum"},level2:{label:"Using talk page as forum",summary:"Caution: Using talk page as forum"},level3:{label:"Using talk page as forum",summary:"Warning: Using talk page as forum"},level4:{label:"Using talk page as forum",summary:"Final warning: Using talk page as forum"}},"uw-create":{level1:{label:"Creating inappropriate pages",summary:"General note: Creating inappropriate pages"},level2:{label:"Creating inappropriate pages",summary:"Caution: Creating inappropriate pages"},level3:{label:"Creating inappropriate pages",summary:"Warning: Creating inappropriate pages"},level4:{label:"Creating inappropriate pages",summary:"Final warning: Creating inappropriate pages"},level4im:{label:"Creating inappropriate pages",summary:"Only warning: Creating inappropriate pages"}},"uw-mos":{level1:{label:"Manual of style",summary:"General note: Formatting, date, language, etc (Manual of style)"},level2:{label:"Manual of style",summary:"Caution: Formatting, date, language, etc (Manual of style)"},level3:{label:"Manual of style",summary:"Warning: Formatting, date, language, etc (Manual of style)"},level4:{label:"Manual of style",summary:"Final warning: Formatting, date, language, etc (Manual of style)"}},"uw-move":{level1:{label:"Page moves against naming conventions or consensus",summary:"General note: Page moves against naming conventions or consensus"},level2:{label:"Page moves against naming conventions or consensus",summary:"Caution: Page moves against naming conventions or consensus"},level3:{label:"Page moves against naming conventions or consensus",summary:"Warning: Page moves against naming conventions or consensus"},level4:{label:"Page moves against naming conventions or consensus",summary:"Final warning: Page moves against naming conventions or consensus"},level4im:{label:"Page moves against naming conventions or consensus",summary:"Only warning: Page moves against naming conventions or consensus"}},"uw-tpv":{level1:{label:"Refactoring others' talk page comments",summary:"General note: Refactoring others' talk page comments"},level2:{label:"Refactoring others' talk page comments",summary:"Caution: Refactoring others' talk page comments"},level3:{label:"Refactoring others' talk page comments",summary:"Warning: Refactoring others' talk page comments"},level4:{label:"Refactoring others' talk page comments",summary:"Final warning: Refactoring others' talk page comments"},level4im:{label:"Refactoring others' talk page comments",summary:"Only warning: Refactoring others' talk page comments"}},"uw-upload":{level1:{label:"Uploading unencyclopedic images",summary:"General note: Uploading unencyclopedic images"},level2:{label:"Uploading unencyclopedic images",summary:"Caution: Uploading unencyclopedic images"},level3:{label:"Uploading unencyclopedic images",summary:"Warning: Uploading unencyclopedic images"},level4:{label:"Uploading unencyclopedic images",summary:"Final warning: Uploading unencyclopedic images"},level4im:{label:"Uploading unencyclopedic images",summary:"Only warning: Uploading unencyclopedic images"}}}},t={"uw-agf-sock":{label:"Use of multiple accounts (assuming good faith)",summary:"Notice: Using multiple accounts"},"uw-aiv":{label:"Bad AIV report",summary:"Notice: Bad AIV report"},"uw-autobiography":{label:"Creating autobiographies",summary:"Notice: Creating autobiographies"},"uw-badcat":{label:"Adding incorrect categories",summary:"Notice: Adding incorrect categories"},"uw-badlistentry":{label:"Adding inappropriate entries to lists",summary:"Notice: Adding inappropriate entries to lists"},"uw-bite":{label:'"Biting" newcomers',summary:'Notice: "Biting" newcomers',suppressArticleInSummary:!0},"uw-coi":{label:"Conflict of interest",summary:"Notice: Conflict of interest",heading:"Managing a conflict of interest"},"uw-controversial":{label:"Introducing controversial material",summary:"Notice: Introducing controversial material"},"uw-copying":{label:"Copying text to another page",summary:"Notice: Copying text to another page"},"uw-crystal":{label:"Adding speculative or unconfirmed information",summary:"Notice: Adding speculative or unconfirmed information"},"uw-c&pmove":{label:"Cut and paste moves",summary:"Notice: Cut and paste moves"},"uw-dab":{label:"Incorrect edit to a disambiguation page",summary:"Notice: Incorrect edit to a disambiguation page"},"uw-date":{label:"Unnecessarily changing date formats",summary:"Notice: Unnecessarily changing date formats"},"uw-deadlink":{label:"Removing proper sources containing dead links",summary:"Notice: Removing proper sources containing dead links"},"uw-displaytitle":{label:"Incorrect use of DISPLAYTITLE",summary:"Notice: Incorrect use of DISPLAYTITLE"},"uw-draftfirst":{label:"User should draft in userspace without the risk of speedy deletion",summary:"Notice: Consider drafting your article in [[Help:Userspace draft|userspace]]"},"uw-editsummary":{label:"New user not using edit summary",summary:"Notice: Not using edit summary"},"uw-editsummary2":{label:"Experienced user not using edit summary",summary:"Notice: Not using edit summary"},"uw-elinbody":{label:"Adding external links to the body of an article",summary:"Notice: Keep external links to External links sections at the bottom of an article"},"uw-english":{label:"Not communicating in English",summary:"Notice: Not communicating in English"},"uw-hasty":{label:"Hasty addition of speedy deletion tags",summary:"Notice: Allow creators time to improve their articles before tagging them for deletion"},"uw-italicize":{label:"Italicize books, films, albums, magazines, TV series, etc within articles",summary:"Notice: Italicize books, films, albums, magazines, TV series, etc within articles"},"uw-lang":{label:"Unnecessarily changing between British and American English",summary:"Notice: Unnecessarily changing between British and American English",heading:"National varieties of English"},"uw-linking":{label:"Excessive addition of redlinks or repeated blue links",summary:"Notice: Excessive addition of redlinks or repeated blue links"},"uw-minor":{label:"Incorrect use of minor edits check box",summary:"Notice: Incorrect use of minor edits check box"},"uw-notenglish":{label:"Creating non-English articles",summary:"Notice: Creating non-English articles"},"uw-notenglishedit":{label:"Adding non-English content to articles",summary:"Notice: Adding non-English content to articles"},"uw-notvote":{label:"We use consensus, not voting",summary:"Notice: We use consensus, not voting"},"uw-plagiarism":{label:"Copying from public domain sources without attribution",summary:"Notice: Copying from public domain sources without attribution"},"uw-preview":{label:"Use preview button to avoid mistakes",summary:"Notice: Use preview button to avoid mistakes"},"uw-redlink":{label:"Indiscriminate removal of redlinks",summary:"Notice: Be careful when removing redlinks"},"uw-selfrevert":{label:"Reverting self tests",summary:"Notice: Reverting self tests"},"uw-socialnetwork":{label:"Wikipedia is not a social network",summary:"Notice: Wikipedia is not a social network"},"uw-sofixit":{label:"Be bold and fix things yourself",summary:"Notice: You can be bold and fix things yourself"},"uw-spoiler":{label:"Adding spoiler alerts or removing spoilers from appropriate sections",summary:"Notice: Don't delete or flag potential 'spoilers' in Wikipedia articles"},"uw-talkinarticle":{label:"Talk in article",summary:"Notice: Talk in article"},"uw-tilde":{label:"Not signing posts",summary:"Notice: Not signing posts"},"uw-toppost":{label:"Posting at the top of talk pages",summary:"Notice: Posting at the top of talk pages"},"uw-unattribcc":{label:"Copying from compatibly-licensed sources without attribution",summary:"Notice: Copying from compatibly-licensed sources without attribution"},"uw-userspace draft finish":{label:"Stale userspace draft",summary:"Notice: Stale userspace draft"},"uw-vgscope":{label:"Adding video game walkthroughs, cheats or instructions",summary:"Notice: Adding video game walkthroughs, cheats or instructions"},"uw-warn":{label:"Place user warning templates when reverting vandalism",summary:"Notice: You can use user warning templates when reverting vandalism"},"uw-wrongsummary":{label:"Using inaccurate or inappropriate edit summaries",summary:"Warning: Using inaccurate or inappropriate edit summaries"}},a={"uw-3rr":{label:"Potential three-revert rule violation; see also uw-ew",summary:"Warning: Three-revert rule"},"uw-affiliate":{label:"Affiliate marketing",summary:"Warning: Affiliate marketing"},"uw-attack":{label:"Creating attack pages",summary:"Warning: Creating attack pages",suppressArticleInSummary:!0},"uw-botun":{label:"Bot username",summary:"Warning: Bot username"},"uw-canvass":{label:"Canvassing",summary:"Warning: Canvassing"},"uw-copyright":{label:"Copyright violation",summary:"Warning: Copyright violation"},"uw-copyright-link":{label:"Linking to copyrighted works violation",summary:"Warning: Linking to copyrighted works violation"},"uw-copyright-new":{label:"Copyright violation (with explanation for new users)",summary:"Notice: Avoiding copyright problems",heading:"Wikipedia and copyright"},"uw-copyright-remove":{label:"Removing {{copyvio}} template from articles",summary:"Warning: Removing {{copyvio}} templates"},"uw-efsummary":{label:"Edit summary triggering the edit filter",summary:"Warning: Edit summary triggering the edit filter"},"uw-ew":{label:"Edit warring (stronger wording)",summary:"Warning: Edit warring"},"uw-ewsoft":{label:"Edit warring (softer wording for newcomers)",summary:"Warning: Edit warring"},"uw-hijacking":{label:"Hijacking articles",summary:"Warning: Hijacking articles"},"uw-hoax":{label:"Creating hoaxes",summary:"Warning: Creating hoaxes"},"uw-legal":{label:"Making legal threats",summary:"Warning: Making legal threats"},"uw-login":{label:"Editing while logged out",summary:"Warning: Editing while logged out"},"uw-multipleIPs":{label:"Usage of multiple IPs",summary:"Warning: Vandalism using multiple IPs"},"uw-pinfo":{label:"Personal info (outing)",summary:"Warning: Personal info"},"uw-salt":{label:"Recreating salted articles under a different title",summary:"Notice: Recreating creation-protected articles under a different title"},"uw-socksuspect":{label:"Sockpuppetry",summary:"Warning: You are a suspected [[WP:SOCK|sockpuppet]]"},"uw-upv":{label:"Userpage vandalism",summary:"Warning: Userpage vandalism"},"uw-username":{label:"Username is against policy",summary:"Warning: Your username might be against policy",suppressArticleInSummary:!0},"uw-coi-username":{label:"Username is against policy, and conflict of interest",summary:"Warning: Username and conflict of interest policy",heading:"Your username"},"uw-userpage":{label:"Userpage or subpage is against policy",summary:"Warning: Userpage or subpage is against policy"}},i={"Common warnings":[],"Behavior in articles":[],"Promotions and spam":[],"Behavior towards other editors":[],"Removal of deletion tags":[],Other:[]},o={level1:{label:"1: General note",list:$.extend(!0,{},i)},level2:{label:"2: Caution",list:$.extend(!0,{},i)},level3:{label:"3: Warning",list:$.extend(!0,{},i)},level4:{label:"4: Final warning",list:$.extend(!0,{},i)},level4im:{label:"4im: Only warning",list:$.extend(!0,{},i)}};V("combinedSingletMenus")?o.singlecombined={label:"Single-issue messages",list:C(t).concat(C(a)).sort((function(e,t){return e.name<t.name?-1:1})).map((function(e){var t=e[0],a=e[1];return $.extend({template:t},a)}))}:(o.singlenotice={label:"Singe-issue notices",list:C(t).map((function(e){var t=e[0],a=e[1];return $.extend({template:t},a)}))},o.singlewarn={label:"Single-issue warnings",list:C(a).map((function(e){var t=e[0],a=e[1];return $.extend({template:t},a)}))});for(var n=0,r=C(e);n<r.length;n++)for(var s=r[n],l=s[0],c=0,d=C(s[1]);c<d.length;c++)for(var p=d[c],u=p[0],m=0,g=C(p[1]);m<g.length;m++){var f=g[m],h=f[0],b=f[1];o[h].list[l].push($.extend({template:u+h.slice("level".length)},b))}this.warnings=o},t.prototype.getWarningWikitext=function(e,t,a,i){var o="{{subst:"+e;return t&&(o+="uw-c&pmove"===e?"|to="+t:"|1="+t),a&&!i&&(o+="uw-csd"===e||"uw-probation"===e||"uw-userspacenoindex"===e||"uw-userpage"===e?"|3=''"+a+"''":"|2=''"+a+"''"),o+="}}",a&&i&&(o+=" ''"+a+"''"),o+" ~~~~"},t.prototype.validateInputs=function(e){if("uw-username"===e.sub_group&&!e.article)return"You must supply a reason for the {{uw-username}} template."},t.prototype.getHistoryRegex=function(){return/<!--\s?Template:([uU]w-.*?)\s?-->.*?(\d{1,2}:\d{1,2}, \d{1,2} \w+ \d{4} \(UTC\))/g},t.prototype.getInputConfig=function(t){var a=e.prototype.getInputConfig.call(this,t);switch(t){case"uw-agf-sock":a.label="Optional username of other account (without User:) ",a.className="userInput";break;case"uw-bite":a.label="Username of 'bitten' user (without User:) ",a.className="userInput";break;case"uw-socksuspect":a.label="Username of sock master, if known (without User:) ",a.className="userInput";break;case"uw-username":a.label="Username violates policy because... ";break;case"uw-aiv":a.label="Optional username that was reported (without User:) ",a.className="userInput"}return a},t.prototype.customiseSummaryWithInput=function(t,a,i){return["uw-agf-sock","uw-socksuspect","uw-aiv"].includes(i.template)?t+" of [[:User:"+a+"]]":e.prototype.customiseSummaryWithInput.call(this,t,a,i)},t.prototype.perWarningNotices=function(e){switch(e){case"uw-username":return $("<div style='color: red;' id='tw-warn-red-notice'>{{uw-username}} should <b>not</b> be used for <b>blatant</b> username policy violations. Blatant violations should be reported directly to UAA (via Twinkle's ARV tab). {{uw-username}} should only be used in edge cases in order to engage in discussion with the user.</div>");case"uw-coi-username":return $("<div style='color: red;' id='tw-warn-red-notice'>{{uw-coi-username}} should <b>not</b> be used for <b>blatant</b> username policy violations. Blatant violations should be reported directly to UAA (via Twinkle's ARV tab). {{uw-coi-username}} should only be used in edge cases in order to engage in discussion with the user.</div>");default:return $()}},t}(function(e){function t(){var t=e.call(this)||this;if(t.moduleName="Warn",t.portletName="Warn",t.portletId="twinkle-warn",t.portletTooltip="Warn/notify user",t.windowTitle="Warn/notify user",mw.config.exists("wgRelevantUserName")&&!Morebits.ip.isRange(mw.config.get("wgRelevantUserName"))&&t.addMenu(),V("autoMenuAfterRollback")&&mw.config.get("wgNamespaceNumber")===m&&mw.util.getParamValue("vanarticle")&&!mw.util.getParamValue("friendlywelcome")&&!mw.util.getParamValue("noautowarn")&&t.makeWindow(),"rollback"===mw.config.get("wgAction")){var a=$("#mw-rollback-success").find(".mw-usertoollinks a").first();if(a.length){a.css("font-weight","bold"),a.wrapInner($("<span/>").attr("title","If appropriate, you can use Twinkle to warn the user about their edits to this page."));var i="vanarticle="+mw.util.rawurlencode(Morebits.pageNameNorm),o=a.attr("href");-1===o.indexOf("?")?a.attr("href",o+"?"+i):a.attr("href",o+"&"+i)}}return t}return n(t,e),t.prototype.makeWindow=function(){var t=this;if(e.prototype.makeWindow.call(this),mw.config.get("wgRelevantUserName")!==mw.config.get("wgUserName")||confirm("You are about to warn yourself! Are you sure you want to proceed?")){var a=this.dialog=new ae(600,440);a.setTitle(this.windowTitle),a.setFooterLinks(this.footerlinks);var i=new Morebits.quickForm((function(e){return t.evaluate(e)})),o=i.append({type:"field",label:"Choose type of warning/notice to issue",tooltip:"First choose a main warning group, then the specific warning to issue."});o.append({type:"select",name:"main_group",tooltip:"You can customize the default selection in your Twinkle preferences",event:this.onCategoryChange.bind(this),list:this.getWarningGroups()});o.append({type:"select",name:"sub_group",event:this.changeSubcategory.bind(this)}),i.append({type:"div",id:"twinkle-warn-input"}),i.append({type:"div",label:"",style:"color: red",id:"twinkle-warn-warning-messages"});var n=i.append({type:"field",name:"reasonGroup",label:"Warning information"});n.append({type:"textarea",label:"Optional message:",name:"reason",tooltip:"Perhaps a reason, or that a more detailed notice must be appended"});var r=document.createElement("a");$(r).click((function(){t.preview(s)})),r.style.cursor="pointer",r.textContent="Preview",n.append({type:"div",id:"warningpreview",label:[r]}),n.append({type:"div",id:"twinklewarn-previewbox",style:"display: none"}),n.append({type:"submit",label:"Submit"});var s=i.render();a.setContent(s),a.display(),s.main_group.root=s,s.previewer=new Morebits.wiki.preview($(s).find("div#twinklewarn-previewbox").last()[0]),this.populateNotices(),this.processWarnings();var l=document.createEvent("Event");l.initEvent("change",!0,!0),s.main_group.dispatchEvent(l)}},t.prototype.populateNotices=function(){var e=mw.util.getParamValue("vanarticlerevid");if(e){var t="",a={};!mw.util.getParamValue("noautowarn")&&mw.util.getParamValue("vanarticle")&&(a={action:"query",titles:mw.util.getParamValue("vanarticle"),prop:"revisions",rvstartid:e,rvlimit:2,rvdir:"newer",rvprop:"user",format:"json"},new Morebits.wiki.api("Checking if you successfully reverted the page",a,(function(e){var a=e.getResponse().query.pages[0].revisions,i=a&&a[1].user;i&&i!==mw.config.get("wgUserName")&&(t+=" Someone else reverted the page and may have already warned the user.",$("#twinkle-warn-warning-messages").text("Note:"+t))})).post());var i=function(e){var a=new Morebits.date(e);e&&a.isValid()&&a.add(24,"hours").isBefore(new Date)&&(t+=" This edit was made more than 24 hours ago so a warning may be stale.",$("#twinkle-warn-warning-messages").text("Note:"+t))},o=mw.util.getParamValue("vantimestamp");o?i(o):(a={action:"query",prop:"revisions",rvprop:"timestamp",revids:e,format:"json"},new Morebits.wiki.api("Grabbing the revision timestamps",a,(function(e){var t=e.getResponse().query.pages[0].revisions;o=t&&t[0].timestamp,i(o)})).post())}},t.prototype.getWarningGroups=function(){var e=parseInt(V("defaultWarningGroup"),10);return C(this.warningLevels).filter((function(e){var t=e[1];return!t.visible||t.visible()})).map((function(t){var a=t[0],i=t[1];return{type:"option",value:a,label:i.label,selected:i.selected(e)}}))},t.prototype.getWarningsInLevel=function(e){var t;if("custom"===e)t=V("customWarningList").map((function(e){return{label:"{{"+e.value+"}}: "+e.label,value:e.value,$data:e}}));else if("kitchensink"===e){t=[];for(var a=function(e){Array.isArray(e.list)?t.push({label:e.label,list:e.list.map((function(e){return{label:"{{"+e.template+"}}: "+e.label,value:e.template,$data:e}}))}):t=t.concat(C(e.list).map((function(t){var a=t[0],i=t[1];return{label:e.label+F("colon-separator")+a,list:i.map((function(e){return{label:"{{"+e.template+"}}: "+e.label,value:e.template,$data:e}}))}})))},i=0,o=C(this.warnings);i<o.length;i++){a(n=o[i][1])}t.push({label:"Custom warnings",list:V("customWarningList").map((function(e){return{label:"{{"+e.value+"}}: "+e.label,value:e.value,$data:e}}))})}else{var n=this.warnings[e].list;t=Array.isArray(n)?n.map((function(e){return{label:"{{"+e.template+"}}: "+e.label,value:e.template,$data:e}})):C(n).map((function(e){return{label:e[0],list:e[1].map((function(e){return{label:"{{"+e.template+"}}: "+e.label,value:e.template,$data:e}}))}}))}return{type:"select",name:"sub_group",event:this.changeSubcategory.bind(this),list:t}},t.prototype.onCategoryChange=function(e){var t=e.target.value,a=e.target.form.sub_group,i=this.getTemplateMatchRegex(a.value,t),o=new Morebits.quickForm.element(this.getWarningsInLevel(t)).render();$(a).parent().replaceWith(o),i&&$(o).find("option").each((function(e,t){if(i.test(t.value))return t.selected=!0,!1})),$("#twinkle-warn-autolevel-message").remove(),this.postCategoryCleanup(e)},t.prototype.getTemplateMatchRegex=function(e,t){return"kitchensink"===t?new RegExp(mw.util.escapeRegExp(e)):N(t,"level")?new RegExp(mw.util.escapeRegExp(e.replace(/\d(im)?$/,""))+"(\\d(?:im)?)$"):void 0},t.prototype.postCategoryCleanup=function(e){this.changeSubcategory(e),V("oldSelect")||($(e.target.form.sub_group).select2({width:"100%",matcher:Morebits.select2.matchers.optgroupFull,templateResult:Morebits.select2.highlightSearchMatches,language:{searching:Morebits.select2.queryInterceptor}}).change(this.changeSubcategory.bind(this)),$(".select2-selection").on("keydown",Morebits.select2.autoStart).trigger("focus"),mw.util.addCSS(".select2-container .select2-dropdown .select2-results > .select2-results__options { max-height: 350px; }.select2-results .select2-results__option { padding-top: 1px; padding-bottom: 1px; }.select2-results .select2-results__group { padding-top: 1px; padding-bottom: 1px; } .select2-container .select2-dropdown .select2-results { font-size: 13px; }.select2-container .selection .select2-selection__rendered { font-size: 13px; }"))},t.prototype.getInputConfig=function(e){return{label:"Linked page",value:mw.util.getParamValue("vanarticle")||"",tooltip:"A page can be linked within the notice, perhaps because it was a revert to said page that dispatched this notice. Leave empty for no page to be linked.",className:"titleInput"}},t.prototype.changeSubcategory=function(e){var t=e.target.form.sub_group.value;$("#twinkle-warn-input").empty().append(new Morebits.quickForm.element($.extend(this.getInputConfig(t),{type:"input",name:"article"})).render()),$("#tw-warn-red-notice").remove(),$(this.perWarningNotices(t)).insertAfter(Morebits.quickForm.getElementLabelObject(e.target.form.reasonGroup))},t.prototype.perWarningNotices=function(e){return $()},t.prototype.getWarningWikitext=function(e,t,a,i){var o=P("subst:"+e,{1:t,2:a&&!i?a:null});return i&&a&&(o+=" ''"+a+"''"),o+" ~~~~"},t.prototype.showPreview=function(e,t){var a=Morebits.quickForm.getInputData(e);t=t||a.sub_group;var i=this.getWarningWikitext(t,a.article,a.reason,"custom"===a.main_group);e.previewer.beginRender(i,"User_talk:"+mw.config.get("wgRelevantUserName"))},t.prototype.preview=function(e){this.showPreview(e)},t.prototype.validateInputs=function(e){},t.prototype.evaluate=function(e){var t=this,a=new mw.Title(mw.config.get("wgRelevantUserName"),m),i=Morebits.quickForm.getInputData(e.target),o=this.validateInputs(i);if(o)return alert(o);var n=$(e.target.sub_group).find(":selected");i.messageData=n.data(),Morebits.simpleWindow.setButtonsEnabled(!1),Morebits.status.init(e.target);var r=new te(a.toText(),"User talk page modification");r.setFollowRedirect(!0,!1),r.load().then((function(){return t.main(r,i)})).then((function(){Morebits.status.actionCompleted("Warning complete, reloading talk page in a few seconds"),setTimeout((function(){location.href=mw.util.getUrl(a.toText())}),8e3)}))},t.prototype.dateProcessing=function(e){var t,a=this.getHistoryRegex(),i={},o={date:new Morebits.date(0),type:""};if(!a)return[o,i];for(;null!==(t=a.exec(e));){var n=t[1],r=new Morebits.date(t[2]);n in i&&!i[n].isBefore(r)||(i[n]=r),o.date.isAfter(r)||(o.date=r,o.type=n)}return[o,i]},t.prototype.getHistoryRegex=function(){},t.prototype.customTemplateEditSummaryPrefix=function(e,t){var a;switch((e=e.split("|")[0]).substr(-1)){case"1":a="General note";break;case"2":a="Caution";break;case"3":a="Warning";break;case"4":a="Final warning";break;case"m":if("4im"===e.substr(-3)){a="Only warning";break}default:a="Notice"}return a+": "+Morebits.string.toUpperCaseFirstChar(t.label)},t.prototype.customiseSummaryWithInput=function(e,t,a){return t&&!0===a.suppressArticleInSummary?e+" on [[:"+t+"]]":e},t.prototype.main=function(e,t){var a=e.getPageText(),i=e.getStatusElement(),o=t.messageData,n=this.dateProcessing(a),r=n[0],s=n[1],l=new Morebits.date(e.getLoadTime());if(t.sub_group in s&&new Morebits.date(s[t.sub_group]).add(1,"day").isAfter(l)&&!confirm("An identical "+t.sub_group+" has been issued in the last 24 hours. \nWould you still like to add this warning/notice?"))i.error("aborted per user request");else{if(r.date.add(1,"minute"),!r.date.isAfter(l)||confirm("A "+r.type+" has been issued in the last minute. \nWould you still like to add this warning/notice?")){var c;if("custom"===t.main_group)c=this.customTemplateEditSummaryPrefix(t.sub_group,o);else{if("kitchensink"===t.main_group&&!/^D+$/.test(t.sub_group)){var d=t.sub_group.substr(-1);"m"===d&&(d=t.sub_group.substr(-3)),/\d/.test(d)&&(t.main_group="level"+d)}(c=o.summary||o[t.main_group]&&o[t.main_group].summary)||(c=this.customTemplateEditSummaryPrefix(t.sub_group,o)),c=this.customiseSummaryWithInput(c,t.article,o)}e.setEditSummary(c+"."),e.setChangeTags(g.changeTags),e.setWatchlist(V("watchWarnings"));var p=this.getWarningWikitext(t.sub_group,t.article,t.reason,"custom"===t.main_group);V("showSharedIPNotice")&&mw.util.isIPAddress(mw.config.get("wgTitle"))&&(Morebits.status.info("Info","Adding a shared IP notice"),p+="\n{{subst:Shared IP advice}}");var u=!1,m=0;if(!o.heading&&a.length){var f=a.match(/^(==*).+\1/gm);if(f&&0!==f.length){var h=l.monthHeaderRegex();m=0,u=f.reverse().some((function(e,t){return/^(==)[^=].+\1/m.test(e)&&h.test(e)&&"number"==typeof(m=f.length-1-t)}))}}return u?(e.setPageSection(m+1),e.setAppendText("\n\n"+p),e.append()):(o.heading?e.setNewSectionTitle(o.heading):(Morebits.status.info("Info","Will create a new talk page section for this month, as none was found"),e.setNewSectionTitle(l.monthHeader())),e.setNewSectionText(p),e.newSection())}i.error("aborted per user request")}},t.moduleName="Warn",t}(K)),Se=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.trustedBots=["AnomieBOT","SineBot","MajavahBot"],t}return ee(t,e),t}(function(e){function t(){var t=e.call(this)||this;return t.moduleName="fluff",t.skipTalk=null,t.rollbackInPlace=null,t.flaggedRevsEnabled=!!mw.loader.moduleRegistry["ext.flaggedRevs.basic"],t.linkBuilder={spanTag:function(e,t){var a=document.createElement("span");return a.style.color=e,a.appendChild(document.createTextNode(t)),a},buildLink:function(e,a){var i=document.createElement("a");return i.appendChild(t.linkBuilder.spanTag("Black","[")),i.appendChild(t.linkBuilder.spanTag(e,a)),i.appendChild(t.linkBuilder.spanTag("Black","]")),i.href="#",i},rollbackLinks:function(e,a,i,o){void 0===a&&(a=!1),e=e||null;var n=a?"span":"div",r=document.createElement(n);(i=parseInt(i,10))?r.setAttribute("id","tw-revert"+i):r.setAttribute("id","tw-revert");var s=document.createElement("strong"),l=document.createElement("strong"),c=t.linkBuilder.buildLink("SteelBlue",F("link-rollback")),d=t.linkBuilder.buildLink("Red",F("link-vandalism"));$(c).click((function(){t.revert("norm",e,i,o),t.disableLinks(r)})),$(d).click((function(){t.revert("vand",e,i,o),t.disableLinks(r)})),l.appendChild(d),s.appendChild(c);var p=a?" ":" || ";if(!a){var u=document.createElement("strong"),m=t.linkBuilder.buildLink("DarkOliveGreen",F("link-goodfaith-rollback"));$(m).click((function(){t.revert("agf",e,i,o)})),u.appendChild(m),r.appendChild(u)}return r.appendChild(document.createTextNode(p)),r.appendChild(s),r.appendChild(document.createTextNode(p)),r.appendChild(l),r},restoreThisRevisionLink:function(e,a){void 0===a&&(a=!1),e="number"==typeof e?e:mw.config.get(e);var i=a?"span":"div",o=document.createElement(i);o.setAttribute("id","tw-revert-to-"+e),o.style.fontWeight="bold";var n=t.linkBuilder.buildLink("SaddleBrown",F("restore-revision"));return $(n).click((function(){t.revertToRevision(e)})),a&&o.appendChild(document.createTextNode(" ")),o.appendChild(n),o}},t.addLinks={contributions:function(){var e=!!$("#sp-contributions-footer-anon-range")[0];if(mw.config.exists("wgRelevantUserName")||e){var a=mw.config.get("wgRelevantUserName");if(-1!==V("showRollbackLinks").indexOf("contribs")||mw.config.get("wgUserName")!==a&&-1!==V("showRollbackLinks").indexOf("others")||mw.config.get("wgUserName")===a&&-1!==V("showRollbackLinks").indexOf("mine"))$("#mw-content-text").find("ul li:has(span.mw-uctop):has(.mw-changeslist-diff)").each((function(i,o){var n=$(o).find(".mw-contributions-title").text();e&&(a=$(o).find(".mw-userlink:not(.history-deleted)").text()),o.appendChild(t.linkBuilder.rollbackLinks(a,!0,o.dataset.mwRevid,n))}))}},recentchanges:function(){if(-1!==V("showRollbackLinks").indexOf("recent")){var e=$(".mw-changeslist .mw-changeslist-last.mw-changeslist-src-mw-edit");(e=e.not(".mw-rcfilters-ui-highlights-enhanced-toplevel").find(".mw-changeslist-line-inner, td.mw-enhanced-rc-nested")).each((function(e,a){var i=$(a).find(".mw-userlink:not(.history-deleted)").text(),o=$(a).find(".mw-changeslist-diff").attr("href"),n=mw.util.getParamValue("diff",o),r=a.dataset.targetPage;a.appendChild(t.linkBuilder.rollbackLinks(i,!0,n,r))}))}},history:function(){if(-1!==V("showRollbackLinks").indexOf("history")){var e=$("#pagehistory li").toArray();if(!$(".mw-firstlink").length)for(var a=e.shift(),i=$(a).find(".mw-userlink:not(.history-deleted)").text(),o=0;o<e.length;o++)if($(e[o]).find(".mw-userlink").text()!==i){a.appendChild(t.linkBuilder.rollbackLinks(i,!0));break}e.forEach((function(e){var a=e.querySelector(".mw-changeslist-date").href,i=parseInt(mw.util.getParamValue("oldid",a),10);isNaN(i)||e.appendChild(t.linkBuilder.restoreThisRevisionLink(i,!0))}))}},diff:function(){var e=function(e){var t=$("#mw-diff-"+e+"2 .mw-usertoollinks a").first();if(t.length){var a="vanarticle="+mw.util.rawurlencode(Morebits.pageNameNorm)+"&noautowarn=true";a+="&vanarticlerevid=",a+="otitle"===e?mw.config.get("wgDiffOldId"):mw.config.get("wgDiffNewId");var i=t.attr("href");-1===i.indexOf("?")?t.attr("href",i+"?"+a):t.attr("href",i+"&"+a)}};if(e("otitle"),mw.config.get("wgDiffOldId")&&mw.config.get("wgDiffOldId")!==mw.config.get("wgDiffNewId")){var a=document.getElementById("mw-diff-otitle1").parentNode;a.insertBefore(t.linkBuilder.restoreThisRevisionLink("wgDiffOldId"),a.firstChild)}if(e("ntitle"),document.getElementById("differences-nextlink")){var i=document.getElementById("mw-diff-ntitle1").parentNode;i.insertBefore(t.linkBuilder.restoreThisRevisionLink("wgDiffNewId"),i.firstChild)}else if(-1!==V("showRollbackLinks").indexOf("diff")&&mw.config.get("wgDiffOldId")&&(mw.config.get("wgDiffOldId")!==mw.config.get("wgDiffNewId")||document.getElementById("differences-prevlink"))){var o=$("#mw-diff-ntitle2").find(".mw-userlink")[0].textContent,n=document.getElementById("mw-diff-ntitle1").parentNode;n.insertBefore(t.linkBuilder.rollbackLinks(o),n.firstChild)}},oldid:function(){var e=document.getElementById("mw-revision-info").parentNode;e.insertBefore(t.linkBuilder.restoreThisRevisionLink("wgRevisionId"),e.firstChild)}},t.callbacks={toRevision:function(e){var a=prompt(F("prompt-reason-restore"),"");if(null!==a){var i=t.formatSummary(F("restore-summary",e.getRevisionID()),e.getRevisionUser(),a);e.setChangeTags(g.changeTags),e.setEditSummary(i),-1!==V("watchRevertedPages").indexOf("torev")&&e.setWatchlist(V("watchRevertedExpiry")),-1!==V("markRevertedPagesAsMinor").indexOf("torev")&&e.setMinorEdit(!0),Morebits.wiki.actionCompleted.redirect=e.getPageName(),Morebits.wiki.actionCompleted.notice=F("reversion-complete"),e.revert()}else e.getStatusElement().error(F("user-aborted"))},main:function(e){var a=e.getResponse().query.pages[0];if(a.actions.edit){var i=e.statelem,o=e.params,n=parseInt(a.lastrevid,10),r=a.revisions;if(r.length<1)i.error(F("no-revisions"));else{var s=r[0],l=s.user;if(n<o.revid)Morebits.status.error("Error",F("bad-revid",n));else{var c=o.user||F("hidden-user"),d=1;if(o.revid!==n)if(Morebits.status.warn("Warning",F("revid-mismatch",n,o.revid)),l===o.user||mw.util.isIPv6Address(o.user)&&Morebits.ip.get64(l)===Morebits.ip.get64(o.user))switch(o.type){case"vand":l!==o.user?Morebits.status.info("Info",F("latest-rev-same-64",c)):Morebits.status.info("Info",F("latest-rev-same-user",c));break;case"agf":return void Morebits.status.warn("Warning",F("latest-rev-other-user-goodfaith",c));default:return void Morebits.status.warn("Notice",F("latest-rev-other-user",c))}else{if(!("vand"===o.type&&-1!==t.trustedBots.indexOf(s.user)&&r.length>1&&r[1].revid===o.revid))return void Morebits.status.error("Error",F("latest-rev-reverted",l));Morebits.status.info("Info",F("latest-rev-bot",l)),d=2}else o.user=l,c=o.user||F("hidden-user");if(-1!==t.trustedBots.indexOf(o.user))switch(o.type){case"vand":Morebits.status.info("Info",F("bot-revert",c)),d=2,o.user=r[1].user,o.userHidden=!!r[1].userhidden;break;case"agf":return void Morebits.status.warn("Notice",F("bot-revert-goodfaith",c));default:confirm(F("bot-revert-prompt"))?(Morebits.status.info("Info",F("bot-revert-previous",c)),d=2,o.user=r[1].user,o.userHidden=!!r[1].userhidden,c=o.user||F("hidden-user")):Morebits.status.warn("Notice",F("bot-revert-selected",c))}for(var p=!1,u=0,m=!1,f=d;f<r.length;++f)if(++u,r[f].user!==o.user){if(mw.util.isIPv6Address(r[f].user)&&Morebits.ip.get64(r[f].user)===Morebits.ip.get64(o.user)){m||(new Morebits.status("Note",F("ipv6-same-user")),m=!0);continue}p=f;break}if(p)if(u){var h,b,v=r[p],y=!1;if("vand"!==o.type&&u>1){if(!confirm(F("revert-multiple-prompt",c,u)))return void Morebits.status.info("Notice",F("stopping"));y=!0}switch(o.count=u,o.goodid=v.revid,o.gooduser=v.user,o.gooduserHidden=!!v.userhidden,i.status(F("revision-age",o.goodid,u,o.gooduserHidden?F("hidden-user"):o.gooduser)),o.type){case"agf":if(null===(b=prompt(F("summary-prompt"),"")))return void i.error(F("user-aborted"));y=!0,h=t.formatSummary(F("goodfaith-summary"),o.userHidden?null:o.user,b);break;case"vand":h=t.formatSummary(F("vandalism-summary",o.count,o.gooduserHidden?F("hidden-user"):o.gooduser),o.userHidden?null:o.user);break;default:if(V("offerReasonOnNormalRevert")){if(null===(b=prompt(F("summary-prompt"),"")))return void i.error(F("user-aborted"));y=!0}h=t.formatSummary(F("normal-summary",o.count),o.userHidden?null:o.user,b)}if(!(V("confirmOnFluff")||V("confirmOnMobileFluff")&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|Mobile|Opera Mini/i.test(navigator.userAgent))||y||confirm(F("revert-confirm"))){t.skipTalk||-1===V("openTalkPage").indexOf(o.type)||o.userHidden||mw.config.get("wgUserName")===o.user||(o.notifyUser=!0,o.vantimestamp=s.timestamp),t.flaggedRevsEnabled&&(Morebits.userIsInGroup("reviewer")||Morebits.userIsSysop)&&a.flagged&&a.flagged.stable_revid>=o.goodid&&a.flagged.pending_since&&(o.reviewRevert=!0,o.csrftoken=e.getResponse().query.tokens.csrftoken);var w=new Morebits.wiki.page(o.pagename,F("saving-reverted"));w.setEditSummary(h),w.setChangeTags(g.changeTags),w.setOldID(o.goodid),w.setCallbackParameters(o),-1!==V("watchRevertedPages").indexOf(o.type)&&w.setWatchlist(V("watchRevertedExpiry")),-1!==V("markRevertedPagesAsMinor").indexOf(o.type)&&w.setMinorEdit(!0),t.rollbackInPlace||(Morebits.wiki.actionCompleted.redirect=o.pagename),Morebits.wiki.actionCompleted.notice=F("revert-complete"),w.revert(t.callbacks.complete)}else i.error(F("user-aborted"))}else Morebits.status.error("Error",F("no-edits-revert"));else i.error(F("no-previous-revision",c,V("revertMaxRevisions")))}}}else e.statelem.error(F("cant-edit-protected"))},complete:function(e){var t=e.getCallbackParameters();if(t.notifyUser&&!t.userHidden){Morebits.status.info("Info",F("opening-talk",t.user));var a={title:"User talk:"+t.user,action:"edit",preview:"yes",vanarticle:t.pagename.replace(/_/g," "),vanarticlerevid:t.revid,vantimestamp:t.vantimestamp,vanarticlegoodrevid:t.goodid,type:t.type,count:t.count};switch(V("userTalkPageMode")){case"tab":window.open(mw.util.getUrl("",a),"_blank");break;case"blank":window.open(mw.util.getUrl("",a),"_blank","location=no,toolbar=no,status=no,directories=no,scrollbars=yes,width=1200,height=800");break;default:window.open(mw.util.getUrl("",a),"twinklewarnwindow"===window.name?"_blank":"twinklewarnwindow","location=no,toolbar=no,status=no,directories=no,scrollbars=yes,width=1200,height=800")}}if(t.reviewRevert){var i={action:"review",revid:e.getSaveResponse().edit.newrevid,token:t.csrftoken,comment:F("pcreview-comment")+g.summaryAd};new Morebits.wiki.api(F("pcreview-accepting"),i).post()}}},mw.config.get("wgIsProbablyEditable")?mw.config.get("wgDiffNewId")||mw.config.get("wgDiffOldId")?mw.hook("wikipage.diff").add((function(){t.addLinks.diff()})):"view"===mw.config.get("wgAction")&&mw.config.get("wgRevisionId")&&mw.config.get("wgCurRevisionId")!==mw.config.get("wgRevisionId")?t.addLinks.oldid():"history"===mw.config.get("wgAction")&&mw.config.get("wgArticleId")&&t.addLinks.history():-1===mw.config.get("wgNamespaceNumber")&&(t.skipTalk=!V("openTalkPageOnAutoRevert"),t.rollbackInPlace=V("rollbackInPlace"),"Contributions"===mw.config.get("wgCanonicalSpecialPageName")?t.addLinks.contributions():"Recentchanges"!==mw.config.get("wgCanonicalSpecialPageName")&&"Recentchangeslinked"!==mw.config.get("wgCanonicalSpecialPageName")||mw.hook("wikipage.content").add((function(e){e.is("div")&&t.addLinks.recentchanges()}))),t}return n(t,e),t.prototype.disableLinks=function(e){$(e).children().each((function(e,t){t.innerHTML=t.textContent,$(t).css("font-weight","normal").css("color","darkgray")}))},t.prototype.revert=function(e,t,a,i){var o=this;mw.util.isIPv6Address(t)&&(t=Morebits.ip.sanitizeIPv6(t));var n=i||mw.config.get("wgPageName"),r=a||mw.config.get("wgCurRevisionId");if(this.rollbackInPlace){var s=document.createElement("span");mw.notify(s,{autoHide:!1,title:"Rollback on "+i,tag:"twinklefluff_"+a}),Morebits.status.init(s)}else Morebits.status.init(document.getElementById("mw-content-text")),$("#catlinks").remove();var l={type:e,user:t,userHidden:!t,pagename:n,revid:r},c={action:"query",prop:["info","revisions"].concat(this.flaggedRevsEnabled?"flagged":[]),titles:n,inprop:"watched",intestactions:"edit",rvlimit:V("revertMaxRevisions"),rvprop:["ids","timestamp","user"],curtimestamp:"",meta:"tokens",type:"csrf",format:"json"},d=new Morebits.wiki.api(F("fetching-data"),c);d.params=l,d.post().then((function(e){return o.callbacks.main(e)}))},t.prototype.revertToRevision=function(e){Morebits.status.init(document.getElementById("mw-content-text"));var t=new Morebits.wiki.page(mw.config.get("wgPageName"),F("saving-reverted"));t.setOldID(e),t.load(this.callbacks.toRevision)},t.prototype.formatSummary=function(e,t,a){var i=e;if(a&&(i+=": "+Morebits.string.toUpperCaseFirstChar(a)),/%USER%/.test(e))if(t){var o=unescape(encodeURIComponent(i.replace("%USER%",""))).length,n="[[Special:Contributions/"+t+"|"+t+"]]",r=unescape(encodeURIComponent(n)).length;if(o+r<=499){var s=" ([[User talk:"+t+"|talk]])";i=o+r+unescape(encodeURIComponent(s)).length<=499?Morebits.string.safeReplace(i,"%USER%",n+s):Morebits.string.safeReplace(i,"%USER%",n)}else i=Morebits.string.safeReplace(i,"%USER%",t)}else i=Morebits.string.safeReplace(i,"%USER%",F("hidden-user"));return i},t.moduleName="fluff",t}(K)),Ie=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.footerLinks={"Twinkle help":"WP:TW/DOC#batchdelete","Give feedback":"WT:TW"},t}return ee(t,e),t.prototype.beforeAddMenu=function(){this.portletName=F("getting-token")},t.prototype.getMetadata=function(e){var t=[];e.redirect&&t.push("redirect");var a=e.protection.filter((function(e){return"edit"===e.type&&"sysop"===e.level})).pop();return a&&t.push("fully protected"+("infinity"===a.expiry?" indefinitely":", expires "+new Morebits.date(a.expiry).calendar("utc")+" (UTC)")),6===e.ns?(t.push("uploader: "+e.imageinfo[0].user),t.push("last edit from: "+e.revisions[0].user)):t.push(mw.language.convertNumber(e.revisions[0].size)+" bytes"),t},t}(function(e){function t(){var t=e.call(this)||this;return t.moduleName="batchdelete",t.portletName="D-batch",t.portletId="twinkle-batchdelete",t.portletTooltip="Delete pages found in this category/on this page",t.windowTitle="Batch deletion",t.unlinkCache={},t.callbacks={doExtras:function(e){var a,i,o=e.parent?e.parent.getCallbackParameters():e.getCallbackParameters();if(o.pageDeleter.workerSuccess(e),o.unlink_page&&(t.unlinkCache={},a={action:"query",list:"backlinks",blfilterredir:"nonredirects",blnamespace:[0,100],bltitle:o.page,bllimit:"max",format:"json"},(i=new Morebits.wiki.api(F("fetching-backlinks"),a,t.callbacks.unlinkBacklinksMain)).params=o,i.post()),o.unlink_file&&(a={action:"query",list:"imageusage",iutitle:o.page,iulimit:"max",format:"json"},(i=new Morebits.wiki.api(F("fetching-filelinks"),a,t.callbacks.unlinkImageInstancesMain)).params=o,i.post()),o.delete_page&&(o.delete_redirects&&(a={action:"query",titles:o.page,prop:"redirects",rdlimit:"max",format:"json"},(i=new Morebits.wiki.api(F("fetching-redirects"),a,t.callbacks.deleteRedirectsMain)).params=o,i.post()),o.delete_talk)){var n=mw.Title.newFromText(o.page);n&&n.namespace%2==0&&2!==n.namespace&&(n.namespace++,a={action:"query",titles:n.toText(),format:"json"},(i=new Morebits.wiki.api(F("check-talk"),a,t.callbacks.deleteTalk)).params=o,i.params.talkPage=n.toText(),i.post())}},deleteRedirectsMain:function(e){var t=e.getResponse().query.pages[0].redirects||[];if((t=t.map((function(e){return e.title}))).length){var a=new Morebits.batchOperation(F("deleting-redirects",e.params.page));a.setOption("chunkSize",V("batchChunks")),a.setPageList(t),a.run((function(t){var i=new Morebits.wiki.page(t,"Deleting "+t);i.setEditSummary(F("delete-redirect-summary",e.params.page)),i.setChangeTags(g.changeTags),i.deletePage(a.workerSuccess,a.workerFailure)}))}},deleteTalk:function(e){if(!e.getResponse().query.pages[0].missing){var t=new Morebits.wiki.page(e.params.talkPage,F("deleting-talk",e.params.page));t.setEditSummary(F("delete-talk-summary",e.params.page)),t.setChangeTags(g.changeTags),t.deletePage()}},unlinkBacklinksMain:function(e){var a=e.getResponse().query.backlinks||[];if((a=a.map((function(e){return e.title}))).length){var i=new Morebits.batchOperation(F("unlink-page",e.params.page));i.setOption("chunkSize",V("batchChunks")),i.setPageList(a),i.run((function(a){var o=new Morebits.wiki.page(a,F("unlink-on",a)),n=$.extend({},e.params);n.title=a,n.unlinker=i,o.setCallbackParameters(n),o.load(t.callbacks.unlinkBacklinks)}))}},unlinkBacklinks:function(e){var a=e.getCallbackParameters();if(e.exists()){var i,o=i=a.title in t.unlinkCache?t.unlinkCache[a.title]:e.getPageText();i=new Morebits.wikitext.page(i).removeLink(a.page).getText(),t.unlinkCache[a.title]=i,i!==o?(e.setEditSummary(F("unlink-summary",a.page)),e.setChangeTags(g.changeTags),e.setPageText(i),e.setCreateOption("nocreate"),e.setMaxConflictRetries(10),e.save(a.unlinker.workerSuccess,a.unlinker.workerFailure)):a.unlinker.workerSuccess(e)}else a.unlinker.workerSuccess(e)},unlinkImageInstancesMain:function(e){var a=e.getResponse().query.imageusage||[];if((a=a.map((function(e){return e.title}))).length){var i=new Morebits.batchOperation(F("unlink-page",e.params.page));i.setOption("chunkSize",V("batchChunks")),i.setPageList(a),i.run((function(a){var o=new Morebits.wiki.page(a,F("unlink-img-on",a)),n=$.extend({},e.params);n.title=a,n.unlinker=i,o.setCallbackParameters(n),o.load(t.callbacks.unlinkImageInstances)}))}},unlinkImageInstances:function(e){var a=e.getCallbackParameters();if(e.exists()){var i,o=a.page.replace(new RegExp("^"+Morebits.namespaceRegex(6)+":"),""),n=i=a.title in t.unlinkCache?t.unlinkCache[a.title]:e.getPageText();if(i=new Morebits.wikitext.page(i).commentOutImage(o,F("img-comment")).getText(),t.unlinkCache[a.title]=i,i===n)return e.getStatusElement().error("failed to unlink image "+o+" from "+e.getPageName()),void a.unlinker.workerFailure(e);e.setEditSummary(F("unlink-img-summary",o,a.reason)),e.setChangeTags(g.changeTags),e.setPageText(i),e.setCreateOption("nocreate"),e.setMaxConflictRetries(10),e.save(a.unlinker.workerSuccess,a.unlinker.workerFailure)}else a.unlinker.workerSuccess(e)}},Morebits.userIsSysop&&(mw.config.get("wgCurRevisionId")&&mw.config.get("wgNamespaceNumber")>0||"Prefixindex"===mw.config.get("wgCanonicalSpecialPageName"))&&t.addMenu(),t}return n(t,e),t.prototype.makeWindow=function(){var e=this;this.subpagesLoaded=!1;var t=new ae(600,400);t.setTitle(this.windowTitle),t.setFooterLinks(this.footerLinks);var a=new Morebits.quickForm(this.evaluate.bind(this));a.append({type:"checkbox",list:[{label:F("option-delete"),name:"delete_page",value:"delete",checked:!0,subgroup:{type:"checkbox",list:[{label:F("option-talks"),name:"delete_talk",value:"delete_talk",checked:!0},{label:F("option-redirects"),name:"delete_redirects",value:"delete_redirects",checked:!0},{label:F("option-subpages"),name:"delete_subpages",value:"delete_subpages",checked:!1,event:this.toggleSubpages.bind(this),subgroup:{type:"checkbox",list:[{label:F("option-subpage-talks"),name:"delete_subpage_talks",value:"delete_subpage_talks"},{label:F("option-subpage-redirects"),name:"delete_subpage_redirects",value:"delete_subpage_redirects"},{label:F("option-subpage-unlink"),name:"unlink_subpages",value:"unlink_subpages"}]}}]}},{label:F("option-unlink"),name:"unlink_page",value:"unlink",checked:!1},{label:F("option-unlink-file"),name:"unlink_file",value:"unlink_file",checked:!0}]}),a.append({type:"input",name:"reason",label:F("reason"),size:60});var i={action:"query",prop:["revisions","info","imageinfo"],inprop:"protection",rvprop:["size","user"],format:"json"};if(14===mw.config.get("wgNamespaceNumber"))$.extend(i,{generator:"categorymembers",gcmtitle:mw.config.get("wgPageName"),gcmlimit:V("batchMax")});else if("Prefixindex"===mw.config.get("wgCanonicalSpecialPageName"))if($.extend(i,{generator:"allpages",gaplimit:V("batchMax")}),mw.util.getParamValue("prefix"))$.extend(i,{gapnamespace:mw.util.getParamValue("namespace"),gapprefix:mw.util.getParamValue("prefix")});else{var o=decodeURIComponent(location.pathname).split("/");if(o.length<3||"Special:PrefixIndex"!==o[2])return;var n=o[3].split(":");$.extend(i,{gapnamespace:mw.config.get("wgNamespaceIds")[n[0].toLowerCase()]}),n.length<2||void 0===i.gapnamespace?$.extend(i,{gapnamespace:0,gapprefix:o.splice(3).join("/")}):((o=o.splice(4)).splice(0,0,n.splice(1).join(":")),$.extend(i,{gapprefix:o.join("/")}))}else $.extend(i,{generator:"links",titles:mw.config.get("wgPageName"),gpllimit:V("batchMax")});var r=document.createElement("div");r.style.padding="15px",t.setContent(r),Morebits.status.init(r),t.display(),this.pages={};var s=new Morebits.status(F("fetching-list")),l=new Morebits.wiki.api(F("loading"),i,(function(t){var a=t.getResponse(),i=a.query&&a.query.pages||[];(i=i.filter((function(e){return!e.missing&&"shared"!==e.imagerepository}))).sort((function(e,t){return e.ns-t.ns||(e.title>t.title?1:-1)})),i.forEach((function(t){var a=e.getMetadata(t),i=t.protection.filter((function(e){return"edit"===e.type&&"sysop"===e.level})).length,o=t.title;e.pages[o]={label:o+(a.length?F("word-separator")+F("parentheses",a.join(F("semicolon-separator"))):""),value:o,checked:!0,style:i?"color: red":""}}));var o=t.params.form;o.append({type:"header",label:F("pages-label")}),o.append({type:"button",label:F("select-all"),event:function(){$(n).find("input[name=pages]:not(:checked)").each((function(e,t){t.click()})),$('input[name="pages.subpages"]').prop("checked",!0)}}),o.append({type:"button",label:F("deselect-all"),event:function(){$(n).find("input[name=pages]:checked").each((function(e,t){t.click()}))}}),o.append({type:"checkbox",name:"pages",id:"tw-dbatch-pages",shiftClickSupport:!0,list:$.map(e.pages,(function(e){return e}))}),o.append({type:"submit"});var n=o.render();t.params.Window.setContent(n),Morebits.quickForm.getElements(n,"pages").forEach(k)}),s);l.params={form:a,Window:t},l.post()},t.prototype.generateNewPageList=function(e){var t=e.elements.pages;if(t instanceof NodeList)for(var a=0;a<t.length;++a)this.pages[t[a].value].checked=t[a].checked;else t instanceof HTMLInputElement&&(this.pages[t.value].checked=t.checked);return new Morebits.quickForm.element({type:"checkbox",name:"pages",id:"tw-dbatch-pages",shiftClickSupport:!0,list:$.map(this.pages,(function(e){return e}))}).render()},t.prototype.toggleSubpages=function(e){var t,a=this,i=e.target.form;if(e.target.checked){if(i.delete_subpage_redirects.checked=i.delete_redirects.checked,i.delete_subpage_talks.checked=i.delete_talk.checked,i.unlink_subpages.checked=i.unlink_page.checked,this.subpagesLoaded)return $.each(this.pages,(function(e,t){null===t.subgroup&&t.subgroup_&&(t.subgroup=t.subgroup_)})),t=this.generateNewPageList(i),$("#tw-dbatch-pages").replaceWith(t),Morebits.quickForm.getElements(t,"pages").forEach(k),void Morebits.quickForm.getElements(t,"pages.subpages").forEach(k);var o='<strong id="dbatch-subpage-loading">'+F("loading")+"</strong>";$(e.target).after(o);var n=$(i.pages).map((function(e,t){return t.value})).get(),r=new Morebits.batchOperation;r.setOption("chunkSize",V("batchChunks")),r.setPageList(n),r.run((function(e){var t=mw.Title.newFromText(e);if([0,6,8].indexOf(t.namespace)>-1)r.workerSuccess();else{var i=new Morebits.wiki.api("Getting list of subpages of "+e,{action:"query",prop:"revisions|info|imageinfo",generator:"allpages",rvprop:"size",inprop:"protection",gapprefix:t.title+"/",gapnamespace:t.namespace,gaplimit:"max",format:"json"},(function(e){var t=e.getResponse(),i=t.query&&t.query.pages||[],o=[];if(i.sort((function(e,t){return e.ns-t.ns||(e.title>t.title?1:-1)})),i.forEach((function(e){var t=a.getMetadata(e),i=e.protection.filter((function(e){return"edit"===e.type&&"sysop"===e.level})).length,n=e.title;o.push({label:n+(t.length?F("word-separator")+F("parentheses",t.join(F("semicolon-separator"))):""),value:n,checked:!0,style:i?"color: red":""})})),o.length){var n=e.params.pageNameFull;a.pages[n].subgroup={type:"checkbox",name:"subpages",className:"dbatch-subpages",shiftClickSupport:!0,list:o}}r.workerSuccess()}),null,(function(){r.workerFailure()}));i.params={pageNameFull:e},i.post()}}),(function(){t=a.generateNewPageList(i),$("#tw-dbatch-pages").replaceWith(t),Morebits.quickForm.getElements(t,"pages").forEach(k),Morebits.quickForm.getElements(t,"pages.subpages").forEach(k),a.subpagesLoaded=!0,$("#dbatch-subpage-loading").remove()}))}else e.target.checked||($.each(this.pages,(function(e,t){t.subgroup&&(t.subgroup_=t.subgroup,t.subgroup=null)})),t=this.generateNewPageList(i),$("#tw-dbatch-pages").replaceWith(t),Morebits.quickForm.getElements(t,"pages").forEach(k))},t.prototype.getMetadata=function(e){return[]},t.prototype.evaluate=function(e){Morebits.wiki.actionCompleted.notice=F("complete");var t=e.target,a=$(Morebits.quickForm.getElements(t,"pages")).filter((function(e,t){return t.checked&&"red"===t.nextElementSibling.style.color})).length;if(!(a>0)||confirm(F("confirm-protected",a))){var i=Morebits.quickForm.getInputData(t);if(i.reason)if(Morebits.simpleWindow.setButtonsEnabled(!1),Morebits.status.init(t),0!==i.pages.length){var o=new Morebits.batchOperation(i.delete_page?F("deleting"):F("starting"));o.setOption("chunkSize",V("batchChunks")),o.setOption("preserveIndividualStatusLines",i.delete_page),o.setPageList(i.pages),o.run(function(e){var t={page:e,delete_page:i.delete_page,delete_talk:i.delete_talk,delete_redirects:i.delete_redirects,unlink_page:i.unlink_page,unlink_file:i.unlink_file&&new RegExp("^"+Morebits.namespaceRegex(6)+":","i").test(e),reason:i.reason,pageDeleter:o},a=new Morebits.wiki.page(e,F("deleting-page",e));a.setCallbackParameters(t),i.delete_page?(a.setEditSummary(i.reason),a.setChangeTags(g.changeTags),a.suppressProtectWarning(),a.deletePage(this.callbacks.doExtras,o.workerFailure)):this.callbacks.doExtras(a)}.bind(this),function(){var e=this;if(i.delete_subpages&&i.subpages){var t=new Morebits.batchOperation(F("deleting-subpages"));t.setOption("chunkSize",V("batchChunks")),t.setOption("preserveIndividualStatusLines",!0),t.setPageList(i.subpages),t.run((function(a){var n={page:a,delete_page:!0,delete_talk:i.delete_subpage_talks,delete_redirects:i.delete_subpage_redirects,unlink_page:i.unlink_subpages,unlink_file:!1,reason:i.reason,pageDeleter:t},r=new Morebits.wiki.page(a,F("deleting-subpage",a));r.setCallbackParameters(n),r.setEditSummary(i.reason),r.setChangeTags(g.changeTags),r.suppressProtectWarning(),r.deletePage(e.callbacks.doExtras,o.workerFailure)}))}}.bind(this))}else Morebits.status.error(F("error"),F("dbatch-no-pages"));else alert(F("dbatch-give-reason"))}},t.moduleName="batchdelete",t}(K)),$e=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.footerlinks={"Protection templates":"Template:Protection templates","Protection policy":"WP:PROT","Twinkle help":"WP:TW/DOC#protect","Give feedback":"WT:TW"},t.existingTagRegex=/\s*(?:<noinclude>)?\s*\{\{\s*(pp-[^{}]*?|protected|(?:t|v|s|p-|usertalk-v|usertalk-s|sb|move)protected(?:2)?|protected template|privacy protection)\s*?\}\}\s*(?:<\/noinclude>)?\s*/gi,t.disableTaggingOnRedirectTemplateRegex=/{{(?:redr|this is a redirect|r(?:edirect)?(?:.?cat.*)?[ _]?sh)/i,t.existingRequestRegex=new RegExp("===\\s*(\\[\\[)?\\s*:?\\s*"+Morebits.string.escapeRegExp(Morebits.pageNameNorm)+"\\s*(\\]\\])?\\s*===","m"),t.protectionPresetsInfo={"pp-protected":{edit:"sysop",move:"sysop",reason:null},"pp-dispute":{edit:"sysop",move:"sysop",reason:"[[WP:PP#Content disputes|Edit warring / content dispute]]"},"pp-vandalism":{edit:"sysop",move:"sysop",reason:"Persistent [[WP:Vandalism|vandalism]]"},"pp-usertalk":{edit:"sysop",move:"sysop",expiry:"infinity",reason:"[[WP:PP#Talk-page protection|Inappropriate use of user talk page while blocked]]"},"pp-template":{edit:"templateeditor",move:"templateeditor",expiry:"infinity",reason:"[[WP:High-risk templates|Highly visible template]]"},"pp-30-500-arb":{edit:"extendedconfirmed",move:"extendedconfirmed",expiry:"infinity",reason:"[[WP:30/500|Arbitration enforcement]]",template:"pp-30-500"},"pp-30-500-vandalism":{edit:"extendedconfirmed",move:"extendedconfirmed",reason:"Persistent [[WP:Vandalism|vandalism]] from (auto)confirmed accounts",template:"pp-30-500"},"pp-30-500-disruptive":{edit:"extendedconfirmed",move:"extendedconfirmed",reason:"Persistent [[WP:Disruptive editing|disruptive editing]] from (auto)confirmed accounts",template:"pp-30-500"},"pp-30-500-blp":{edit:"extendedconfirmed",move:"extendedconfirmed",reason:"Persistent violations of the [[WP:BLP|biographies of living persons policy]] from (auto)confirmed accounts",template:"pp-30-500"},"pp-30-500-sock":{edit:"extendedconfirmed",move:"extendedconfirmed",reason:"Persistent [[WP:Sock puppetry|sock puppetry]]",template:"pp-30-500"},"pp-semi-vandalism":{edit:"autoconfirmed",reason:"Persistent [[WP:Vandalism|vandalism]]",template:"pp-vandalism"},"pp-semi-disruptive":{edit:"autoconfirmed",reason:"Persistent [[WP:Disruptive editing|disruptive editing]]",template:"pp-protected"},"pp-semi-unsourced":{edit:"autoconfirmed",reason:"Persistent addition of [[WP:INTREF|unsourced or poorly sourced content]]",template:"pp-protected"},"pp-semi-blp":{edit:"autoconfirmed",reason:"Violations of the [[WP:BLP|biographies of living persons policy]]",template:"pp-blp"},"pp-semi-usertalk":{edit:"autoconfirmed",move:"autoconfirmed",expiry:"infinity",reason:"[[WP:PP#Talk-page protection|Inappropriate use of user talk page while blocked]]",template:"pp-usertalk"},"pp-semi-template":{edit:"autoconfirmed",move:"autoconfirmed",expiry:"infinity",reason:"[[WP:High-risk templates|Highly visible template]]",template:"pp-template"},"pp-semi-sock":{edit:"autoconfirmed",reason:"Persistent [[WP:Sock puppetry|sock puppetry]]",template:"pp-sock"},"pp-semi-protected":{edit:"autoconfirmed",reason:null,template:"pp-protected"},"pp-pc-vandalism":{stabilize:"autoconfirmed",reason:"Persistent [[WP:Vandalism|vandalism]]",template:"pp-pc"},"pp-pc-disruptive":{stabilize:"autoconfirmed",reason:"Persistent [[WP:Disruptive editing|disruptive editing]]",template:"pp-pc"},"pp-pc-unsourced":{stabilize:"autoconfirmed",reason:"Persistent addition of [[WP:INTREF|unsourced or poorly sourced content]]",template:"pp-pc"},"pp-pc-blp":{stabilize:"autoconfirmed",reason:"Violations of the [[WP:BLP|biographies of living persons policy]]",template:"pp-pc"},"pp-pc-protected":{stabilize:"autoconfirmed",reason:null,template:"pp-pc"},"pp-move":{move:"sysop",reason:null},"pp-move-dispute":{move:"sysop",reason:"[[WP:MOVP|Move warring]]"},"pp-move-vandalism":{move:"sysop",reason:"[[WP:MOVP|Page-move vandalism]]"},"pp-move-indef":{move:"sysop",expiry:"infinity",reason:"[[WP:MOVP|Highly visible page]]"},unprotect:{edit:"all",move:"all",stabilize:"none",create:"all",reason:null,template:"none"},"pp-create-offensive":{create:"sysop",reason:"[[WP:SALT|Offensive name]]"},"pp-create-salt":{create:"extendedconfirmed",reason:"[[WP:SALT|Repeatedly recreated]]"},"pp-create-blp":{create:"extendedconfirmed",reason:"[[WP:BLPDEL|Recently deleted BLP]]"},"pp-create":{create:"extendedconfirmed",reason:"{{pp-create}}"}},t.protectionTags=[{label:"None (remove existing protection templates)",value:"none"},{label:"None (do not remove existing protection templates)",value:"noop"},{label:"Edit protection templates",list:[{label:"{{pp-vandalism}}: vandalism",value:"pp-vandalism"},{label:"{{pp-dispute}}: dispute/edit war",value:"pp-dispute"},{label:"{{pp-blp}}: BLP violations",value:"pp-blp"},{label:"{{pp-sock}}: sockpuppetry",value:"pp-sock"},{label:"{{pp-template}}: high-risk template",value:"pp-template"},{label:"{{pp-usertalk}}: blocked user talk",value:"pp-usertalk"},{label:"{{pp-protected}}: general protection",value:"pp-protected"},{label:"{{pp-semi-indef}}: general long-term semi-protection",value:"pp-semi-indef"},{label:"{{pp-30-500}}: extended confirmed protection",value:"pp-30-500"}]},{label:"Pending changes templates",list:[{label:"{{pp-pc}}: pending changes",value:"pp-pc"}]},{label:"Move protection templates",list:[{label:"{{pp-move-dispute}}: dispute/move war",value:"pp-move-dispute"},{label:"{{pp-move-vandalism}}: page-move vandalism",value:"pp-move-vandalism"},{label:"{{pp-move-indef}}: general long-term",value:"pp-move-indef"},{label:"{{pp-move}}: other",value:"pp-move"}]}].filter((function(e){return t.hasFlaggedRevs||"Pending changes templates"!==e.label})),t}return ee(t,e),t.prototype.getProtectionLevels=function(){return $.extend(!0,e.prototype.getProtectionLevels.call(this),{extendedconfirmed:{label:"Extended confirmed users",weight:20,types:["edit","move","create"]},templateeditor:{label:"Template editors",weight:30,applicable:this.isTemplate,types:["edit","move"]},autoconfirmed:{applicable:function(e){return!("create"===e&&mw.config.get("wgNamespaceNumber")===c)}}})},t.prototype.insertTagIntoPage=function(e,t){return new Morebits.wikitext.page(e).insertAfterTemplates(t,re).getText()},t.prototype.getProtectionPresets=function(){var e=this;return[{label:"Unprotection",value:"unprotect"},{label:"Full protection",list:[{label:"Generic (full)",value:"pp-protected"},{label:"Content dispute/edit warring (full)",value:"pp-dispute",reason:"Content dispute/edit warring"},{label:"Persistent vandalism (full)",value:"pp-vandalism",reason:"Persistent [[WP:VAND|vandalism]]"},{label:"User talk of blocked user (full)",value:"pp-usertalk",reason:"Inappropriate use of user talk page while blocked"}]},{label:"Template protection",list:[{label:"Highly visible template (TE)",value:"pp-template",reason:"[[WP:HIGHRISK|High-risk template]]"}]},{label:"Extended confirmed protection",list:[{label:"Arbitration enforcement (ECP)",selected:!0,value:"pp-30-500-arb",reason:"[[WP:30/500|Arbitration enforcement]]"},{label:"Persistent vandalism (ECP)",value:"pp-30-500-vandalism",reason:"Persistent [[WP:VAND|vandalism]]"},{label:"Disruptive editing (ECP)",value:"pp-30-500-disruptive",reason:"Persistent [[Wikipedia:Disruptive editing|disruptive editing]]"},{label:"BLP policy violations (ECP)",value:"pp-30-500-blp",reason:"[[WP:BLP|BLP]] policy violations"},{label:"Sockpuppetry (ECP)",value:"pp-30-500-sock",reason:"Persistent [[WP:SOCK|sockpuppetry]]"}]},{label:"Semi-protection",list:[{label:"Generic (semi)",value:"pp-semi-protected"},{label:"Persistent vandalism (semi)",selected:!0,value:"pp-semi-vandalism",reason:"Persistent [[WP:VAND|vandalism]]"},{label:"Disruptive editing (semi)",value:"pp-semi-disruptive",reason:"Persistent [[Wikipedia:Disruptive editing|disruptive editing]]"},{label:"Adding unsourced content (semi)",value:"pp-semi-unsourced",reason:"Persistent addition of [[WP:INTREF|unsourced or poorly sourced content]]"},{label:"BLP policy violations (semi)",value:"pp-semi-blp",reason:"[[WP:BLP|BLP]] policy violations"},{label:"Sockpuppetry (semi)",value:"pp-semi-sock",reason:"Persistent [[WP:SOCK|sockpuppetry]]"},{label:"User talk of blocked user (semi)",value:"pp-semi-usertalk",reason:"Inappropriate use of user talk page while blocked"}]},{label:"Pending changes",list:[{label:"Generic (PC)",value:"pp-pc-protected"},{label:"Persistent vandalism (PC)",value:"pp-pc-vandalism",reason:"Persistent [[WP:VAND|vandalism]]"},{label:"Disruptive editing (PC)",value:"pp-pc-disruptive",reason:"Persistent [[Wikipedia:Disruptive editing|disruptive editing]]"},{label:"Adding unsourced content (PC)",value:"pp-pc-unsourced",reason:"Persistent addition of [[WP:INTREF|unsourced or poorly sourced content]]"},{label:"BLP policy violations (PC)",value:"pp-pc-blp",reason:"[[WP:BLP|BLP]] policy violations"}]},{label:"Move protection",list:[{label:"Generic (move)",value:"pp-move"},{label:"Dispute/move warring (move)",value:"pp-move-dispute",reason:"Page title dispute/move warring"},{label:"Page-move vandalism (move)",value:"pp-move-vandalism",reason:"Page-move vandalism"},{label:"Highly visible page (move)",value:"pp-move-indef",reason:"Highly visible page"}]}].filter((function(t){return(e.isTemplate||"Template protection"!==t.label)&&(e.hasFlaggedRevs||"Pending changes"!==t.label)}))},t.prototype.getCreateProtectionPresets=function(){return[{label:"Unprotection",value:"unprotect"},{label:"Create protection",list:[{label:"Generic ({{pp-create}})",value:"pp-create"},{label:"Offensive name",value:"pp-create-offensive",reason:"Offensive name"},{label:"Repeatedly recreated",selected:!0,value:"pp-create-salt",reason:"Repeatedly recreated"},{label:"Recently deleted BLP",value:"pp-create-blp",reason:"Recently deleted [[WP:BLP|BLP]]"}]}]},t}(function(e){function t(){var t=e.call(this)||this;return t.moduleName="protect",t.portletName=Morebits.userIsSysop?"PP":"RPP",t.portletId="twinkle-protect",t.portletTooltip=Morebits.userIsSysop?"Protect page":"Request page protection",t.windowTitle=Morebits.userIsSysop?"Apply, request or tag page protection":"Request or tag page protection",t.requestPageName="Wikipedia:Requests for page protection",t.requestPageAcronym="RfPP",t.hasFlaggedRevs=mw.loader.getState("ext.flaggedRevs.review")&&s.flaggedRevsNamespaces.includes(mw.config.get("wgNamespaceNumber")),t.isTemplate=10===mw.config.get("wgNamespaceNumber")||828===mw.config.get("wgNamespaceNumber"),t.currentProtectionLevels={},t.formevents={editmodify:function(e){e.target.form.editlevel.disabled=!e.target.checked,e.target.form.editexpiry.disabled=!e.target.checked||"all"===e.target.form.editlevel.value,e.target.form.editlevel.style.color=e.target.form.editexpiry.style.color=e.target.checked?"":"transparent"},editlevel:function(e){e.target.form.editexpiry.disabled="all"===e.target.value},movemodify:function(e){e.target.form.movelevel.disabled&&!e.target.form.editlevel.disabled?(e.target.form.movelevel.value=e.target.form.editlevel.value,e.target.form.moveexpiry.value=e.target.form.editexpiry.value):e.target.form.editlevel.disabled&&(e.target.form.movelevel.value="sysop",e.target.form.moveexpiry.value="infinity"),e.target.form.movelevel.disabled=!e.target.checked,e.target.form.moveexpiry.disabled=!e.target.checked||"all"===e.target.form.movelevel.value,e.target.form.movelevel.style.color=e.target.form.moveexpiry.style.color=e.target.checked?"":"transparent"},movelevel:function(e){e.target.form.moveexpiry.disabled="all"===e.target.value},pcmodify:function(e){e.target.form.pclevel.disabled=!e.target.checked,e.target.form.pcexpiry.disabled=!e.target.checked||"none"===e.target.form.pclevel.value,e.target.form.pclevel.style.color=e.target.form.pcexpiry.style.color=e.target.checked?"":"transparent"},pclevel:function(e){e.target.form.pcexpiry.disabled="none"===e.target.value},createlevel:function(e){e.target.form.createexpiry.disabled="all"===e.target.value},tagtype:function(e){e.target.form.small.disabled=e.target.form.noinclude.disabled="none"===e.target.value||"noop"===e.target.value}},t.protectionPresetsInfo={},t.protectionTags=[],t.protectReasonAnnotations=[],t.existingTagRegex=null,t.disableTaggingOnRedirectTemplateRegex=null,t.existingRequestRegex=null,mw.config.get("wgNamespaceNumber")<0||8===mw.config.get("wgNamespaceNumber")||t.addMenu(),t}return n(t,e),t.prototype.makeWindow=function(){var e=new ae(620,530);e.setTitle(this.windowTitle),e.setFooterLinks(this.footerlinks);var t=new Morebits.quickForm(this.evaluate.bind(this));t.append({type:"field",label:F("protect-action-type")}).append({type:"radio",name:"actiontype",event:this.changeAction.bind(this),list:[{label:F("protect-protect-label"),value:"protect",tooltip:F("protect-protect-tooltip"),checked:!0,adminonly:!0},{label:F("protect-request-label"),value:"request",tooltip:Morebits.userIsSysop?F("protect-request-sysop-tooltip"):F("protect-request-tooltip"),checked:!Morebits.userIsSysop},{label:F("protect-tag-label"),value:"tag",tooltip:F("protect-tag-tooltip"),disabled:!this.canTag()}]}),t.append({type:"field",label:F("preset"),name:"field_preset"}),t.append({type:"field",label:"1",name:"field1"}),t.append({type:"field",label:"2",name:"field2"}),t.append({type:"submit"});var a=t.render();e.setContent(a),e.display();var i=document.createEvent("Event");i.initEvent("change",!0,!0),a.actiontype[0].dispatchEvent(i),this.fetchProtectionLevel()},t.prototype.fetchProtectingAdmin=function(e,t,a,i){var o=this;return i=i||[],e.get({format:"json",action:"query",list:"logevents",letitle:t,letype:a}).then((function(t){var n=t.query?$.grep(t.query.logevents,(function(e){return $.inArray(e.logid,i)}))[0]:null;return n?"move_prot"===n.action||"move_stable"===n.action?o.fetchProtectingAdmin(e,"protect"===a?n.params.oldtitle_title:n.params.oldtitle,a,i.concat(n.logid)):n.user:null}))},t.prototype.fetchProtectionLevel=function(){var e=this,t=new mw.Api,a=[t.get({format:"json",indexpageids:!0,action:"query",list:"logevents",letype:"protect",letitle:mw.config.get("wgPageName"),prop:this.hasFlaggedRevs?"info|flagged":"info",inprop:"protection|watched",titles:mw.config.get("wgPageName")})];this.hasFlaggedRevs&&a.push(t.get({format:"json",action:"query",list:"logevents",letype:"stable",letitle:mw.config.get("wgPageName")})),$.when.apply($,a).done((function(a,i){var o,n=(a=$(a).toArray())[0].query.pageids[0],r=a[0].query.pages[n],s={};e.watched=r.watchlistexpiry||""===r.watched,$.each(r.protection,(function(a,i){i.source?s.cascading={expiry:i.expiry,source:i.source,level:i.level}:(s[i.type]={level:i.level,expiry:i.expiry,cascade:""===i.cascade},o||(o=e.fetchProtectingAdmin(t,mw.config.get("wgPageName"),"protect")))})),r.flagged&&r.flagged.protection_level&&(s.stabilize={level:r.flagged.protection_level,expiry:r.flagged.protection_expiry},o=e.fetchProtectingAdmin(t,mw.config.get("wgPageName"),"stable")),e.hasProtectLog=!!a[0].query.logevents.length,e.protectLog=e.hasProtectLog&&a[0].query.logevents,e.hasStableLog=!!e.hasFlaggedRevs&&!!i[0].query.logevents.length,e.stableLog=e.hasStableLog&&i[0].query.logevents,e.currentProtectionLevels=s,o?o.done((function(t){t&&$.each(["edit","move","create","stabilize","cascading"],(function(a,i){e.currentProtectionLevels[i]&&(e.currentProtectionLevels[i].admin=t)})),e.showLogAndCurrentProtectInfo()})):e.showLogAndCurrentProtectInfo()}))},t.prototype.showLogAndCurrentProtectInfo=function(){var e=!$.isEmptyObject(this.currentProtectionLevels);if(this.hasProtectLog||this.hasStableLog){var t=$("<span>");if(this.hasProtectLog){if(t.append($(y(F("protectlogpage"),"Special:Log",{action:"view",page:mw.config.get("wgPageName"),type:"protect"}))),!e||!this.currentProtectionLevels.edit&&!this.currentProtectionLevels.move){var a=this.protectLog[0];"unprotect"===a.action?t.append(F("word-separator"),F("parentheses",F("unprotected-time",a.timestamp))):t.append(F("word-separator"),F("parentheses",F("expired-time",a.params.details[0].expiry)))}t.append(this.hasStableLog?F("bullet-separator"):null)}if(this.hasStableLog&&(t.append($(y(F("stable-logpage"),"Special:Log",{action:"view",page:mw.config.get("wgPageName"),type:"stable"}))),!e||!this.currentProtectionLevels.stabilize)){var i=this.stableLog[0];"reset"===i.action?t.append(F("word-separator"),F("parentheses",F("reset-time",i.timestamp))):t.append(F("word-separator"),F("parentheses",F("expired-time",i.params.expiry)))}Morebits.status.init($('div[name="hasprotectlog"] span')[0]),Morebits.status.warn(F(e?"prev-protections":"past-protected"),t[0])}Morebits.status.init($('div[name="currentprot"] span')[0]);var o=[],n="info";e?($.each(this.currentProtectionLevels,(function(e,t){"cascading"===e?o.push(F("protect-cascade-from",t.source)):"stabilize"===e?o.push(F("protect-current-stable",F("group-"+t.level))):(t.cascade&&o.push(F("protect-current-cascading",F("restriction-"+e),F("restriction-level-"+t.level))),o.push(F("protect-current",F("restriction-"+e),F("restriction-level-"+t.level)))),"infinity"===t.expiry?o.push(F("word-separator"),F("protect-expiry-indefinite"),F("word-separator")):o.push(F("word-separator"),F("parentheses",F("expires-time",t.expiry)),F("word-separator")),t.admin&&o.push(F("by-sysop",t.admin)),o.push(F("bullet-separator"))})),o=o.slice(0,-1),n="warn"):o.push(F("protect-current-none")),Morebits.status[n](F("protect-current-label"),o)},t.prototype.changeAction=function(e){var t,a,i,o,n=this,r=this.getProtectionLevels(),s=this.getProtectionLengths(),l=this.getProtectionPresets(),c=this.getCreateProtectionPresets(),d=function(e,t){return C(e).filter((function(e){var a=e[1];return a.types.includes(t)&&(void 0===a.applicable||"boolean"==typeof a.applicable&&a.applicable||"function"==typeof a.applicable&&a.applicable(t))})).sort((function(e,t){return e[1].weight<t[1].weight?-1:1})).map((function(e){var t=e[0],a=e[1];return{label:a.label,value:t,selected:a.defaultSelected}}))};switch(e.target.values){case"protect":if((t=new Morebits.quickForm.element({type:"field",label:"Preset",name:"field_preset"})).append({type:"select",name:"category",label:F("choose-preset"),event:this.changePreset.bind(this),list:mw.config.get("wgArticleId")?l:c}),(i=new Morebits.quickForm.element({type:"field",label:F("protect-options"),name:"field2"})).append({type:"div",name:"currentprot",label:" "}),i.append({type:"div",name:"hasprotectlog",label:" "}),mw.config.get("wgArticleId")?(i.append({type:"checkbox",event:this.formevents.editmodify,list:[{label:F("protect-edit-modify"),name:"editmodify",tooltip:F("protect-edit-modify-tooltip"),checked:!0}]}),i.append({type:"select",name:"editlevel",label:F("protect-edit-label"),event:this.formevents.editlevel,list:d(r,"edit")}),i.append({type:"select",name:"editexpiry",label:F("protectexpiry"),event:function(e){"custom"===e.target.value&&n.doCustomExpiry(e.target)},list:s}),i.append({type:"checkbox",event:this.formevents.movemodify,list:[{label:F("protect-move-modify"),name:"movemodify",tooltip:F("protect-move-modify-tooltip"),checked:!0}]}),i.append({type:"select",name:"movelevel",label:F("protect-move-label"),event:this.formevents.movelevel,list:d(r,"move")}),i.append({type:"select",name:"moveexpiry",label:F("protectexpiry"),event:function(e){"custom"===e.target.value&&n.doCustomExpiry(e.target)},list:s}),this.hasFlaggedRevs&&(i.append({type:"checkbox",event:this.formevents.pcmodify,list:[{label:F("protect-stable-modify"),name:"pcmodify",tooltip:F("protect-stable-modify-tooltip"),checked:!0}]}),i.append({type:"select",name:"pclevel",label:F("protect-stable-label"),event:this.formevents.pclevel,list:d(r,"stable")}),i.append({type:"select",name:"pcexpiry",label:F("protectexpiry"),event:function(e){"custom"===e.target.value&&n.doCustomExpiry(e.target)},list:s}))):(i.append({type:"select",name:"createlevel",label:F("protect-create-label"),event:this.formevents.createlevel,list:d(r,"create")}),i.append({type:"select",name:"createexpiry",label:F("protectexpiry"),event:function(e){"custom"===e.target.value&&n.doCustomExpiry(e.target)},list:s})),i.append({type:"textarea",name:"protectReason",label:F("protect-reason")}),i.append({type:"div",name:"protectReason_notes",label:F("protect-notes-label"),style:"display:inline-block; margin-cd top:4px;",tooltip:F("note-requested-tooltip",this.requestPageAcronym)}),i.append({type:"checkbox",event:this.annotateProtectReason.bind(this),style:"display:inline-block; margin-top:4px;",list:[{label:F("note-requested-label",this.requestPageAcronym),name:"protectReason_notes_rfpp",checked:!1,value:F("note-requested",this.requestPageAcronym)}]}),i.append({type:"input",event:this.annotateProtectReason.bind(this),label:F("request-revid-label",this.requestPageAcronym),name:"protectReason_notes_rfppRevid",tooltip:F("request-revid-tooltip",this.requestPageAcronym)}),!this.canTag())break;case"tag":(a=new Morebits.quickForm.element({type:"field",label:"Tagging options",name:"field1"})).append({type:"div",name:"currentprot",label:" "}),a.append({type:"div",name:"hasprotectlog",label:" "}),a.append({type:"select",name:"tagtype",label:F("protect-select-tag"),list:this.protectionTags,event:this.formevents.tagtype}),a.append({type:"checkbox",list:[{name:"small",label:F("protect-tag-small-label"),tooltip:F("protect-tag-small-tooltip"),checked:!0},{name:"noinclude",label:F("protect-tag-noinclude-label"),tooltip:F("protect-tag-noinclude-tooltip"),checked:mw.config.get("wgNamespaceNumber")===p}]});break;case"request":(t=new Morebits.quickForm.element({type:"field",label:F("protect-request-preset-label"),name:"field_preset"})).append({type:"select",name:"category",label:F("protect-request-type-label"),event:this.changePreset.bind(this),list:mw.config.get("wgArticleId")?l:c}),(a=new Morebits.quickForm.element({type:"field",label:"Options",name:"field1"})).append({type:"div",name:"currentprot",label:" "}),a.append({type:"div",name:"hasprotectlog",label:" "}),a.append({type:"select",name:"expiry",label:F("duration-label"),list:[{label:"",selected:!0,value:""},{label:F("temporary"),value:"Temporary"},{label:F("protect-expiry-indefinite"),value:"Indefinite"}]}),a.append({type:"textarea",name:"reason",label:F("reason")});break;default:alert("Something's wrong in twinkleprotect")}if(t?(o=$(e.target.form).find('fieldset[name="field_preset"]')[0]).parentNode.replaceChild(t.render(),o):$(e.target.form).find('fieldset[name="field_preset"]').css("display","none"),a?(o=$(e.target.form).find('fieldset[name="field1"]')[0]).parentNode.replaceChild(a.render(),o):$(e.target.form).find('fieldset[name="field1"]').css("display","none"),i?(o=$(e.target.form).find('fieldset[name="field2"]')[0]).parentNode.replaceChild(i.render(),o):$(e.target.form).find('fieldset[name="field2"]').css("display","none"),"protect"===e.target.values){var u=document.createEvent("Event");u.initEvent("change",!0,!0),e.target.form.category.dispatchEvent(u),$(e.target.form).find('fieldset[name="field2"] select').parent().css({display:"inline-block",marginRight:"0.5em"}),$(e.target.form).find('fieldset[name="field2"] input[name="protectReason_notes_rfppRevid"]').parent().css({display:"inline-block",marginLeft:"15px"}).hide()}this.showLogAndCurrentProtectInfo()},t.prototype.doCustomExpiry=function(e){var t=prompt(F("custom-expiry-prompt"));if(t){var a=document.createElement("option");a.setAttribute("value",t),a.textContent=t,e.appendChild(a),e.value=t}else e.selectedIndex=0},t.prototype.getProtectionLevels=function(){return{all:{label:F("all-users"),weight:0,types:["edit","move","create","stable"]},autoconfirmed:{label:F("group-autoconfirmed"),weight:10,types:["edit","create","stable"]},sysop:{label:F("group-sysop"),defaultSelected:!0,weight:40,types:["edit","move","create","stable"]}}},t.prototype.getProtectionLengths=function(){return[{label:F("duration-hours",1),value:"1 hour"},{label:F("duration-hours",2),value:"2 hours"},{label:F("duration-hours",3),value:"3 hours"},{label:F("duration-hours",6),value:"6 hours"},{label:F("duration-hours",12),value:"12 hours"},{label:F("duration-days",1),value:"1 day"},{label:F("duration-days",2),value:"2 days"},{label:F("duration-days",3),value:"3 days"},{label:F("duration-days",4),value:"4 days"},{label:F("duration-weeks",1),value:"1 week"},{label:F("duration-weeks",2),value:"2 weeks"},{label:F("duration-months",1),value:"1 month"},{label:F("duration-months",2),value:"2 months"},{label:F("duration-months",3),value:"3 months"},{label:F("duration-years",1),value:"1 year"},{label:F("protect-expiry-indefinite"),value:"infinity"},{label:F("custom-expiry-label"),value:"custom"}]},t.prototype.changePreset=function(e){for(var t,a=e.target.form,i=a.actiontype,o=0;o<i.length;o++)if(i[o].checked){t=i[o].values;break}if("protect"===t){var n=this.protectionPresetsInfo[a.category.value];mw.config.get("wgArticleId")?(n.edit?(a.editmodify.checked=!0,this.formevents.editmodify({target:a.editmodify}),a.editlevel.value=n.edit,this.formevents.editlevel({target:a.editlevel})):(a.editmodify.checked=!1,this.formevents.editmodify({target:a.editmodify})),n.move?(a.movemodify.checked=!0,this.formevents.movemodify({target:a.movemodify}),a.movelevel.value=n.move,this.formevents.movelevel({target:a.movelevel})):(a.movemodify.checked=!1,this.formevents.movemodify({target:a.movemodify})),a.editexpiry.value=a.moveexpiry.value=n.expiry||"2 days",a.pcmodify&&(n.stabilize?(a.pcmodify.checked=!0,this.formevents.pcmodify({target:a.pcmodify}),a.pclevel.value=n.stabilize,this.formevents.pclevel({target:a.pclevel})):(a.pcmodify.checked=!1,this.formevents.pcmodify({target:a.pcmodify})),a.pcexpiry.value=n.expiry||"1 month")):(n.create&&(a.createlevel.value=n.create,this.formevents.createlevel({target:a.createlevel})),a.createexpiry.value=n.expiry||"infinity");var r="protect"===t?a.protectReason:a.reason;n.reason?r.value=n.reason:r.value="",this.annotateProtectReason(e),this.canTag()&&("unprotect"===a.category.value?a.tagtype.value="none":a.tagtype.value=n.template?n.template:a.category.value,this.formevents.tagtype({target:a.tagtype}),"pp-template"===a.category.value?a.noinclude.checked=!0:mw.config.get("wgNamespaceNumber")!==p&&(a.noinclude.checked=!1))}else"unprotect"===a.category.value?(a.expiry.value="",a.expiry.disabled=!0):(a.expiry.value="",a.expiry.disabled=!1)},t.prototype.annotateProtectReason=function(e){var t=e.target.form,a=e.target,i=t.protectReason.value.replace(new RegExp("(?:"+F("semicolon-separator")+")?"+mw.util.escapeRegExp(this.protectReasonAnnotations.join(F("colon-separator")))),"");if("protectReason_notes_rfpp"===a.name)a.checked?(this.protectReasonAnnotations.push(a.value),$(t.protectReason_notes_rfppRevid).parent().show()):(this.protectReasonAnnotations=[],t.protectReason_notes_rfppRevid.value="",$(t.protectReason_notes_rfppRevid).parent().hide());else if("protectReason_notes_rfppRevid"===a.name&&(this.protectReasonAnnotations=this.protectReasonAnnotations.filter((function(e){return!N(e,"[["+s.permalinkSpecialPageName)})),e.target.value.length)){var o="[["+s.permalinkSpecialPageName+"/"+e.target.value+"#"+Morebits.pageNameNorm+"]]";this.protectReasonAnnotations.push(o)}this.protectReasonAnnotations.length?t.protectReason.value=(i?i+F("semicolon-separator"):"")+this.protectReasonAnnotations.join(F("colon-separator")):t.protectReason.value=i},t.prototype.canTag=function(){return mw.config.get("wgArticleId")&&"Scribunto"!==mw.config.get("wgPageContentModel")},t.prototype.evaluate=function(e){var t,a=this,i=e.target,o=Morebits.quickForm.getInputData(i);switch(("tag"===o.actiontype||"protect"===o.actiontype&&this.canTag())&&(t={tag:o.tagtype,reason:("pp-protected"===o.tagtype||"pp-semi-protected"===o.tagtype||"pp-move"===o.tagtype)&&o.protectReason,small:o.small,noinclude:o.noinclude}),o.actiontype){case"protect":Morebits.wiki.actionCompleted.redirect=mw.config.get("wgPageName"),Morebits.wiki.actionCompleted.notice="Protection complete";var n,r=!1,l=function(){n&&n.getStatusElement().info("done"),t&&a.taggingPage(t)},c=function(e){if(n=new Morebits.wiki.page(mw.config.get("wgPageName"),"Protecting page"),mw.config.get("wgArticleId")){if(o.editmodify&&n.setEditProtection(o.editlevel,o.editexpiry),o.movemodify){if(!o.movelevel)return void alert("You must chose a move protection level!");n.setMoveProtection(o.movelevel,o.moveexpiry)}n.setWatchlist(V("watchProtectedPages"))}else n.setCreateProtection(o.createlevel,o.createexpiry),n.setWatchlist(!1);o.protectReason?(n.setEditSummary(o.protectReason),!o.protectReason_notes_rfppRevid||/^\d+$/.test(o.protectReason_notes_rfppRevid)?(r||(Morebits.simpleWindow.setButtonsEnabled(!1),Morebits.status.init(i),r=!0),n.setChangeTags(g.changeTags),n.protect(e)):alert('The provided revision ID is malformed. Please see https://en.wikipedia.org/wiki/Help:Permanent_link for information on how to find the correct ID (also called "oldid").')):alert("You must enter a protect reason, which will be inscribed into the protection log.")},d=function(){n&&n.getStatusElement().info("done"),(n=new Morebits.wiki.page(mw.config.get("wgPageName"),"Applying pending changes protection")).setFlaggedRevs(o.pclevel,o.pcexpiry),o.protectReason?(n.setEditSummary(o.protectReason+g.summaryAd),r||(Morebits.simpleWindow.setButtonsEnabled(!1),Morebits.status.init(i),r=!0),n.setWatchlist(V("watchProtectedPages")),n.stabilize(l,(function(e){"stabilize_denied"===e.errorCode&&n.getStatusElement().error("Failed trying to modify pending changes settings, likely due to a mediawiki bug. Other actions (tagging or regular protection) may have taken place. Please reload the page and try again.")}))):alert("You must enter a protect reason, which will be inscribed into the protection log.")};o.editmodify||o.movemodify||!mw.config.get("wgArticleId")?o.pcmodify?c(d):c(l):o.pcmodify?d():alert("Please give Twinkle something to do! \nIf you just want to tag the page, you can choose the 'Tag page with protection template' option at the top.");break;case"tag":Morebits.simpleWindow.setButtonsEnabled(!1),Morebits.status.init(i),Morebits.wiki.actionCompleted.redirect=mw.config.get("wgPageName"),Morebits.wiki.actionCompleted.followRedirect=!1,Morebits.wiki.actionCompleted.notice="Tagging complete",this.taggingPage(t);break;case"request":if("unprotect"===o.category){var p=$.map(this.currentProtectionLevels,(function(e){return!e.admin||s.botUsernameRegex.test(e.admin)?null:e.admin}));if(p.length&&!confirm(F("sysops-contacted",Morebits.array.uniq(p))))return!1}Morebits.simpleWindow.setButtonsEnabled(!1),Morebits.status.init(i),Morebits.wiki.actionCompleted.redirect=this.requestPageName,Morebits.wiki.actionCompleted.notice="Nomination completed, redirecting now to the discussion page";var u=new te(this.requestPageName,"Requesting protection of page");u.setFollowRedirect(!0),u.load().then((function(){return a.fileRequest(u,o)}));break;default:alert("twinkleprotect: unknown kind of action")}},t.prototype.getTypeNameAndReason=function(e,t,a){for(var i=0,o=e;i<o.length;i++){var n=o[i];if(n.list){var r=this.getTypeNameAndReason(n.list,t,n.label);if(r)return r}else if(n.value===t)return[a||n.label,n.reason]}},t.prototype.taggingPage=function(e){var t=this;if("noop"!==e.tag){var a=new te(mw.config.get("wgPageName"),F("protect-tag-adding"));return a.load().then((function(){var i,o=a.getPageText();if(t.existingTagRegex){var n=t.existingTagRegex.exec(o);n&&("none"===e.tag||confirm(F("protect-tag-exists-prompt",n[1])))&&(o=o.replace(t.existingTagRegex,""))}if("none"===e.tag)i=F("protect-tag-removing");else{var r=P(e.tag,{reason:e.reason,small:e.small?"yes":null});if(function(e){return s.redirectTagAliases.map((function(e){return new RegExp("^\\s*"+e,"i")})).some((function(t){return t.test(e)}))}(o)){if(t.disableTaggingOnRedirectTemplateRegex&&o.match(t.disableTaggingOnRedirectTemplateRegex))return Morebits.status.info(F("protect-tag-abort"),F("nothing-to-do")),$.Deferred().resolve();o=o.replace(/^\s*#(\w+) ?(\[\[.*?\]\])(.*)/i,"#$1 $2$3\n\n"+r)}else e.noinclude?r="<noinclude>"+r+"</noinclude>":r+="\n",o=t.insertTagIntoPage(o,r);i="Adding {{"+e.tag+"}}"}return a.setEditSummary(i),a.setWatchlist(V("watchPPTaggedPages")),a.setPageText(o),a.setCreateOption("nocreate"),a.suppressProtectWarning(),a.save()}))}Morebits.status.info(F("protect-tag-adding"),F("protect-tag-none-status"))},t.prototype.insertTagIntoPage=function(e,t){return t+"\n"+e},t.prototype.getRequestTextAndSummary=function(e){var t=this.getTypeNameAndReason(this.getProtectionPresets(),e.category),a=t[0],i=t[1],o=i;e.reason&&(i&&(o+="\xa0\u2013 "),o+=e.reason),o&&!function(e,t){if(String.prototype.endsWith)return e.endsWith(t);var a=e.lastIndexOf(t);return-1!==a&&a===e.length-t.length}(o,".")&&(o+=".");var n="=== [[:"+Morebits.pageNameNorm+"]] ===\n";n+="* {{pagelinks|1="+Morebits.pageNameNorm+"}}\n\n";var r=e.expiry?e.expiry+" ":""+a;return[n+="'''"+Morebits.string.toUpperCaseFirstChar(r)+(o?":''' "+Morebits.string.formatReasonText(o):".'''")+" ~~~~","/* "+Morebits.pageNameNorm+" */ Requesting "+a+("pending changes"===a?" on [[:":" of [[:")+Morebits.pageNameNorm+"]]."]},t.prototype.fileRequest=function(e,t){var a,i,o,n,r=this,s=e.getPageText(),l=e.getStatusElement();if(this.existingRequestRegex&&this.existingRequestRegex.exec(s))l.error(F("protect-request-exists",e.getPageName()));else{var c,d=this.getRequestTextAndSummary(t),p=d[0],u=d[1],m=!1,g=this.protectionPresetsInfo[t.category],f=this.getProtectionLevels(),h=function(e,t){var a=f[e||"all"].weight;return t&&(a?"autoconfirmed"===t.level&&(a+=2):a=f[t].weight/2),a},b=h(null===(a=this.currentProtectionLevels.edit)||void 0===a?void 0:a.level,null===(i=this.currentProtectionLevels.stabilize)||void 0===i?void 0:i.level);(h(g.edit,g.stabilize)>b||h(g.move)>h(null===(o=this.currentProtectionLevels.move)||void 0===o?void 0:o.level)||h(g.create)>h(null===(n=this.currentProtectionLevels.create)||void 0===n?void 0:n.level))&&(m=!0),c=m?/(\n==\s*Current requests for reduction in protection level\s*==)/:/(\n==\s*Current requests for edits to a protected page\s*==)/;var v=s.length;if((s=s.replace(c,"\n"+p+"\n$1")).length!==v)return l.status("Adding new request..."),e.setEditSummary(u),e.setPageText(s),e.setCreateOption("recreate"),e.save().then((function(){var e=V("watchRequestedPages");if("no"!==e&&("default"!==e||!!parseInt(mw.user.options.get("watchdefault"),10))){var t={action:"watch",titles:mw.config.get("wgPageName"),token:mw.user.tokens.get("watchToken"),expiry:!0!==r.watched&&"default"!==e&&"yes"!==e?e:void 0};return new E("Adding requested page to watchlist",t).post()}}));l.error("Could not find relevant heading on WP:RPP. To fix this problem, please see [[Wikipedia:Twinkle/Fixing RPP|How to fix RPP]].")}},t.moduleName="protect",t}(K)),De=function(e){function t(t,a){var i=e.call(this,t,a)||this;if(g.changeTags.length)i.setChangeTags(g.changeTags);else{var o=i.setReason.bind(i);i.setReason=function(e){o(e+g.summaryAd)}}return["load","block","notify"].forEach((function(e){var t=i[e].bind(i);i[e]=function(e,a){var i=this,o=$.Deferred();return t((function(t){e&&e.call(i,i),o.resolve(t instanceof Morebits.wiki.api?t:i)}),(function(e){if(a&&a.call(i,i),e instanceof Morebits.wiki.api){var t=new f(e.getErrorCode()+": "+e.getErrorText());t.code=e.getErrorCode(),t.info=e.getErrorText(),t.response=e.getResponse(),o.reject(t)}else o.reject(new Error(e))})),o}})),i}return n(t,e),t}(Morebits.wiki.user),Ue=Morebits.string.isInfinity,Le=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.footerlinks={"Block templates":"Template:Uw-block/doc/Block_templates","Block policy":"WP:BLOCK","Block prefs":"WP:TW/PREF#block","Twinkle help":"WP:TW/DOC#block","Give feedback":"WT:TW"},t.blockPresetsInfo={anonblock:{expiry:"31 hours",forAnonOnly:!0,nocreate:!0,nonstandard:!0,reason:"{{anonblock}}",sig:"~~~~"},"anonblock - school":{expiry:"36 hours",forAnonOnly:!0,nocreate:!0,nonstandard:!0,reason:"{{anonblock}} \x3c!-- Likely a school based on behavioral evidence --\x3e",templateName:"anonblock",sig:"~~~~"},"blocked proxy":{expiry:"1 year",forAnonOnly:!0,nocreate:!0,nonstandard:!0,hardblock:!0,reason:"{{blocked proxy}}",sig:null},"CheckUser block":{expiry:"1 week",forAnonOnly:!0,nocreate:!0,nonstandard:!0,reason:"{{CheckUser block}}",sig:"~~~~",requireGroup:"checkuser"},"checkuserblock-account":{autoblock:!0,expiry:"infinity",forRegisteredOnly:!0,nocreate:!0,nonstandard:!0,reason:"{{checkuserblock-account}}",sig:"~~~~",requireGroup:"checkuser"},"checkuserblock-wide":{forAnonOnly:!0,nocreate:!0,nonstandard:!0,reason:"{{checkuserblock-wide}}",sig:"~~~~",requireGroup:"checkuser"},colocationwebhost:{expiry:"1 year",forAnonOnly:!0,nonstandard:!0,reason:"{{colocationwebhost}}",sig:null},oversightblock:{autoblock:!0,expiry:"infinity",nocreate:!0,nonstandard:!0,reason:"{{OversightBlock}}",sig:"~~~~",requireGroup:"oversight"},"school block":{forAnonOnly:!0,nocreate:!0,nonstandard:!0,reason:"{{school block}}",sig:"~~~~"},spamblacklistblock:{forAnonOnly:!0,expiry:"1 month",disabletalk:!0,nocreate:!0,reason:"{{spamblacklistblock}} \x3c!-- editor only attempts to add blacklisted links, see [[Special:Log/spamblacklist]] --\x3e"},rangeblock:{reason:"{{rangeblock}}",nocreate:!0,nonstandard:!0,forAnonOnly:!0,forRangeOnly:!0,sig:"~~~~"},tor:{expiry:"1 year",forAnonOnly:!0,nonstandard:!0,reason:"{{Tor}}",sig:null},webhostblock:{expiry:"1 year",forAnonOnly:!0,nonstandard:!0,reason:"{{webhostblock}}",sig:null},"uw-3block":{autoblock:!0,expiry:"24 hours",nocreate:!0,pageParam:!0,reason:"Violation of the [[WP:Three-revert rule|three-revert rule]]",summary:"You have been blocked from editing for violation of the [[WP:3RR|three-revert rule]]"},"uw-ablock":{autoblock:!0,expiry:"31 hours",forAnonOnly:!0,nocreate:!0,pageParam:!0,reasonParam:!0,summary:"Your IP address has been blocked from editing",suppressArticleInSummary:!0},"uw-adblock":{autoblock:!0,nocreate:!0,pageParam:!0,reason:"Using Wikipedia for [[WP:Spam|spam]] or [[WP:NOTADVERTISING|advertising]] purposes",summary:"You have been blocked from editing for [[WP:SOAP|advertising or self-promotion]]"},"uw-aeblock":{autoblock:!0,nocreate:!0,pageParam:!0,reason:"[[WP:Arbitration enforcement|Arbitration enforcement]]",reasonParam:!0,summary:"You have been blocked from editing for violating an [[WP:Arbitration|arbitration decision]]"},"uw-bioblock":{autoblock:!0,nocreate:!0,pageParam:!0,reason:"Violations of the [[WP:Biographies of living persons|biographies of living persons]] policy",summary:"You have been blocked from editing for violations of Wikipedia's [[WP:BLP|biographies of living persons policy]]"},"uw-block":{autoblock:!0,expiry:"24 hours",forRegisteredOnly:!0,nocreate:!0,pageParam:!0,reasonParam:!0,summary:"You have been blocked from editing",suppressArticleInSummary:!0},"uw-blockindef":{autoblock:!0,expiry:"infinity",forRegisteredOnly:!0,nocreate:!0,pageParam:!0,reasonParam:!0,summary:"You have been indefinitely blocked from editing",suppressArticleInSummary:!0},"uw-blocknotalk":{disabletalk:!0,pageParam:!0,reasonParam:!0,summary:"You have been blocked from editing and your user talk page access has been disabled",suppressArticleInSummary:!0},"uw-botblock":{forRegisteredOnly:!0,pageParam:!0,reason:"Running a [[WP:BOT|bot script]] without [[WP:BRFA|approval]]",summary:"You have been blocked from editing because it appears you are running a [[WP:BOT|bot script]] without [[WP:BRFA|approval]]"},"uw-botublock":{expiry:"infinity",forRegisteredOnly:!0,reason:"{{uw-botublock}} \x3c!-- Username implies a bot, soft block --\x3e",summary:"You have been indefinitely blocked from editing because your [[WP:U|username]] indicates this is a [[WP:BOT|bot]] account, which is currently not approved"},"uw-botuhblock":{autoblock:!0,expiry:"infinity",forRegisteredOnly:!0,nocreate:!0,reason:"{{uw-botuhblock}} \x3c!-- Username implies a bot, hard block --\x3e",summary:"You have been indefinitely blocked from editing because your username is a blatant violation of the [[WP:U|username policy]]."},"uw-causeblock":{expiry:"infinity",forRegisteredOnly:!0,reason:"{{uw-causeblock}} \x3c!-- Username represents a non-profit, soft block --\x3e",summary:"You have been indefinitely blocked from editing because your [[WP:U|username]] gives the impression that the account represents a group, organization or website"},"uw-compblock":{autoblock:!0,expiry:"infinity",forRegisteredOnly:!0,nocreate:!0,reason:"Compromised account",summary:"You have been indefinitely blocked from editing because it is believed that your [[WP:SECURE|account has been compromised]]"},"uw-copyrightblock":{autoblock:!0,expiry:"infinity",nocreate:!0,pageParam:!0,reason:"[[WP:Copyright violations|Copyright violations]]",summary:"You have been blocked from editing for continued [[WP:COPYVIO|copyright infringement]]"},"uw-dblock":{autoblock:!0,nocreate:!0,reason:"Persistent removal of content",pageParam:!0,summary:"You have been blocked from editing for continued [[WP:VAND|removal of material]]"},"uw-disruptblock":{autoblock:!0,nocreate:!0,reason:"[[WP:Disruptive editing|Disruptive editing]]",summary:"You have been blocked from editing for [[WP:DE|disruptive editing]]"},"uw-efblock":{autoblock:!0,nocreate:!0,reason:"Repeatedly triggering the [[WP:Edit filter|Edit filter]]",summary:"You have been blocked from editing for disruptive edits that repeatedly triggered the [[WP:EF|edit filter]]"},"uw-ewblock":{autoblock:!0,expiry:"24 hours",nocreate:!0,pageParam:!0,reason:"[[WP:Edit warring|Edit warring]]",summary:"You have been blocked from editing to prevent further [[WP:DE|disruption]] caused by your engagement in an [[WP:EW|edit war]]"},"uw-hblock":{autoblock:!0,nocreate:!0,pageParam:!0,reason:"[[WP:No personal attacks|Personal attacks]] or [[WP:Harassment|harassment]]",summary:"You have been blocked from editing for attempting to [[WP:HARASS|harass]] other users"},"uw-ipevadeblock":{forAnonOnly:!0,nocreate:!0,reason:"[[WP:Blocking policy#Evasion of blocks|Block evasion]]",summary:"Your IP address has been blocked from editing because it has been used to [[WP:EVADE|evade a previous block]]"},"uw-lblock":{autoblock:!0,expiry:"infinity",nocreate:!0,reason:"Making [[WP:No legal threats|legal threats]]",summary:"You have been blocked from editing for making [[WP:NLT|legal threats or taking legal action]]"},"uw-nothereblock":{autoblock:!0,expiry:"infinity",nocreate:!0,reason:"Clearly [[WP:NOTHERE|not here to build an encyclopedia]]",forRegisteredOnly:!0,summary:"You have been indefinitely blocked from editing because it appears that you are not here to [[WP:NOTHERE|build an encyclopedia]]"},"uw-npblock":{autoblock:!0,nocreate:!0,pageParam:!0,reason:"Creating [[WP:Patent nonsense|patent nonsense]] or other inappropriate pages",summary:"You have been blocked from editing for creating [[WP:PN|nonsense pages]]"},"uw-pablock":{autoblock:!0,expiry:"31 hours",nocreate:!0,reason:"[[WP:No personal attacks|Personal attacks]] or [[WP:Harassment|harassment]]",summary:"You have been blocked from editing for making [[WP:NPA|personal attacks]] toward other users"},"uw-sblock":{autoblock:!0,nocreate:!0,reason:"Using Wikipedia for [[WP:SPAM|spam]] purposes",summary:"You have been blocked from editing for using Wikipedia for [[WP:SPAM|spam]] purposes"},"uw-soablock":{autoblock:!0,expiry:"infinity",forRegisteredOnly:!0,nocreate:!0,pageParam:!0,reason:"[[WP:Spam|Spam]] / [[WP:NOTADVERTISING|advertising]]-only account",summary:"You have been indefinitely blocked from editing because your account is being used only for [[WP:SPAM|spam, advertising, or promotion]]"},"uw-socialmediablock":{autoblock:!0,nocreate:!0,pageParam:!0,reason:"Using Wikipedia as a [[WP:NOTMYSPACE|blog, web host, social networking site or forum]]",summary:"You have been blocked from editing for using user and/or article pages as a [[WP:NOTMYSPACE|blog, web host, social networking site or forum]]"},"uw-sockblock":{autoblock:!0,forRegisteredOnly:!0,nocreate:!0,reason:"Abusing [[WP:Sock puppetry|multiple accounts]]",summary:"You have been blocked from editing for abusing [[WP:SOCK|multiple accounts]]"},"uw-softerblock":{expiry:"infinity",forRegisteredOnly:!0,reason:"{{uw-softerblock}} \x3c!-- Promotional username, soft block --\x3e",summary:"You have been indefinitely blocked from editing because your [[WP:U|username]] gives the impression that the account represents a group, organization or website"},"uw-spamublock":{autoblock:!0,expiry:"infinity",forRegisteredOnly:!0,nocreate:!0,reason:"{{uw-spamublock}} \x3c!-- Promotional username, promotional edits --\x3e",summary:"You have been indefinitely blocked from editing because your account is being used only for [[WP:SPAM|spam or advertising]] and your username is a violation of the [[WP:U|username policy]]"},"uw-spoablock":{autoblock:!0,expiry:"infinity",forRegisteredOnly:!0,nocreate:!0,reason:"[[WP:SOCK|Sock puppetry]]",summary:"This account has been blocked as a [[WP:SOCK|sock puppet]] created to violate Wikipedia policy"},"uw-talkrevoked":{disabletalk:!0,reason:"Revoking talk page access: inappropriate use of user talk page while blocked",prependReason:!0,summary:"Your user talk page access has been disabled",useInitialOptions:!0},"uw-ublock":{expiry:"infinity",forRegisteredOnly:!0,reason:"{{uw-ublock}} \x3c!-- Username violation, soft block --\x3e",reasonParam:!0,summary:"You have been indefinitely blocked from editing because your username is a violation of the [[WP:U|username policy]]"},"uw-ublock-double":{expiry:"infinity",forRegisteredOnly:!0,reason:"{{uw-ublock-double}} \x3c!-- Username closely resembles another user, soft block --\x3e",summary:"You have been indefinitely blocked from editing because your [[WP:U|username]] is too similar to the username of another Wikipedia user"},"uw-ucblock":{autoblock:!0,expiry:"31 hours",nocreate:!0,pageParam:!0,reason:"Persistent addition of [[WP:INTREF|unsourced content]]",summary:"You have been blocked from editing for persistent addition of [[WP:INTREF|unsourced content]]"},"uw-uhblock":{autoblock:!0,expiry:"infinity",forRegisteredOnly:!0,nocreate:!0,reason:"{{uw-uhblock}} \x3c!-- Username violation, hard block --\x3e",reasonParam:!0,summary:"You have been indefinitely blocked from editing because your username is a blatant violation of the [[WP:U|username policy]]"},"uw-ublock-wellknown":{expiry:"infinity",forRegisteredOnly:!0,reason:"{{uw-ublock-wellknown}} \x3c!-- Username represents a well-known person, soft block --\x3e",summary:"You have been indefinitely blocked from editing because your [[WP:U|username]] matches the name of a well-known living individual"},"uw-uhblock-double":{autoblock:!0,expiry:"infinity",forRegisteredOnly:!0,nocreate:!0,reason:"{{uw-uhblock-double}} \x3c!-- Attempted impersonation of another user, hard block --\x3e",summary:"You have been indefinitely blocked from editing because your [[WP:U|username]] appears to impersonate another established Wikipedia user"},"uw-upeblock":{autoblock:!0,expiry:"infinity",forRegisteredOnly:!0,nocreate:!0,pageParam:!0,reason:"[[WP:PAID|Undisclosed paid editing]] in violation of the WMF [[WP:TOU|Terms of Use]]",summary:"You have been indefinitely blocked from editing because your account is being used in violation of [[WP:PAID|Wikipedia policy on undisclosed paid advocacy]]"},"uw-vaublock":{autoblock:!0,expiry:"infinity",forRegisteredOnly:!0,nocreate:!0,pageParam:!0,reason:"{{uw-vaublock}} \x3c!-- Username violation, vandalism-only account --\x3e",summary:"You have been indefinitely blocked from editing because your account is being [[WP:VOA|used only for vandalism]] and your username is a blatant violation of the [[WP:U|username policy]]"},"uw-vblock":{autoblock:!0,expiry:"31 hours",nocreate:!0,pageParam:!0,reason:"[[WP:Vandalism|Vandalism]]",summary:"You have been blocked from editing to prevent further [[WP:VAND|vandalism]]"},"uw-voablock":{autoblock:!0,expiry:"infinity",forRegisteredOnly:!0,nocreate:!0,pageParam:!0,reason:"[[WP:Vandalism-only account|Vandalism-only account]]",summary:"You have been indefinitely blocked from editing because your account is being [[WP:VOA|used only for vandalism]]"},"zombie proxy":{expiry:"1 month",forAnonOnly:!0,nocreate:!0,nonstandard:!0,reason:"{{zombie proxy}}",sig:null},"uw-acpblock":{autoblock:!0,expiry:"48 hours",nocreate:!0,pageParam:!1,reasonParam:!0,reason:"Misusing [[WP:Sock puppetry|multiple accounts]]",summary:"You have been [[WP:PB|blocked from creating accounts]] for misusing [[WP:SOCK|multiple accounts]]"},"uw-acpblockindef":{autoblock:!0,expiry:"infinity",forRegisteredOnly:!0,nocreate:!0,pageParam:!1,reasonParam:!0,reason:"Misusing [[WP:Sock puppetry|multiple accounts]]",summary:"You have been indefinitely [[WP:PB|blocked from creating accounts]] for misusing [[WP:SOCK|multiple accounts]]"},"uw-aepblock":{autoblock:!0,nocreate:!1,pageParam:!1,reason:"[[WP:Arbitration enforcement|Arbitration enforcement]]",reasonParam:!0,summary:"You have been [[WP:PB|partially blocked]] from editing for violating an [[WP:Arbitration|arbitration decision]]"},"uw-epblock":{autoblock:!0,expiry:"infinity",forRegisteredOnly:!0,nocreate:!1,noemail:!0,pageParam:!1,reasonParam:!0,reason:"Email [[WP:Harassment|harassment]]",summary:"You have been [[WP:PB|blocked from emailing]] other editors for [[WP:Harassment|harassment]]"},"uw-ewpblock":{autoblock:!0,expiry:"24 hours",nocreate:!1,pageParam:!1,reasonParam:!0,reason:"[[WP:Edit warring|Edit warring]]",summary:"You have been [[WP:PB|partially blocked]] from editing certain areas of the encyclopedia to prevent further [[WP:DE|disruption]] due to [[WP:EW|edit warring]]"},"uw-pblock":{autoblock:!0,expiry:"24 hours",nocreate:!1,pageParam:!1,reasonParam:!0,summary:"You have been [[WP:PB|partially blocked]] from certain areas of the encyclopedia"},"uw-pblockindef":{autoblock:!0,expiry:"infinity",forRegisteredOnly:!0,nocreate:!1,pageParam:!1,reasonParam:!0,summary:"You have been indefinitely [[WP:PB|partially blocked]] from certain areas of the encyclopedia"}},t.blockGroups=[{label:"Common block reasons",list:[{label:"anonblock",value:"anonblock"},{label:"anonblock - likely a school",value:"anonblock - school"},{label:"school block",value:"school block"},{label:"Generic block (custom reason)",value:"uw-block"},{label:"Generic block (custom reason) - IP",value:"uw-ablock",selected:!0},{label:"Generic block (custom reason) - indefinite",value:"uw-blockindef"},{label:"Disruptive editing",value:"uw-disruptblock"},{label:"Inappropriate use of user talk page while blocked",value:"uw-talkrevoked"},{label:"Not here to build an encyclopedia",value:"uw-nothereblock"},{label:"Unsourced content",value:"uw-ucblock"},{label:"Vandalism",value:"uw-vblock"},{label:"Vandalism-only account",value:"uw-voablock"}]},{label:"Extended reasons",list:[{label:"Advertising",value:"uw-adblock"},{label:"Arbitration enforcement",value:"uw-aeblock"},{label:"Block evasion - IP",value:"uw-ipevadeblock"},{label:"BLP violations",value:"uw-bioblock"},{label:"Copyright violations",value:"uw-copyrightblock"},{label:"Creating nonsense pages",value:"uw-npblock"},{label:"Edit filter-related",value:"uw-efblock"},{label:"Edit warring",value:"uw-ewblock"},{label:"Generic block with talk page access revoked",value:"uw-blocknotalk"},{label:"Harassment",value:"uw-hblock"},{label:"Legal threats",value:"uw-lblock"},{label:"Personal attacks or harassment",value:"uw-pablock"},{label:"Possible compromised account",value:"uw-compblock"},{label:"Removal of content",value:"uw-dblock"},{label:"Sock puppetry (master)",value:"uw-sockblock"},{label:"Sock puppetry (puppet)",value:"uw-spoablock"},{label:"Social networking",value:"uw-socialmediablock"},{label:"Spam",value:"uw-sblock"},{label:"Spam/advertising-only account",value:"uw-soablock"},{label:"Unapproved bot",value:"uw-botblock"},{label:"Undisclosed paid editing",value:"uw-upeblock"},{label:"Violating the three-revert rule",value:"uw-3block"}]},{label:"Username violations",list:[{label:"Bot username, soft block",value:"uw-botublock"},{label:"Bot username, hard block",value:"uw-botuhblock"},{label:"Promotional username, hard block",value:"uw-spamublock"},{label:"Promotional username, soft block",value:"uw-softerblock"},{label:"Similar username, soft block",value:"uw-ublock-double"},{label:"Username violation, soft block",value:"uw-ublock"},{label:"Username violation, hard block",value:"uw-uhblock"},{label:"Username impersonation, hard block",value:"uw-uhblock-double"},{label:"Username represents a well-known person, soft block",value:"uw-ublock-wellknown"},{label:"Username represents a non-profit, soft block",value:"uw-causeblock"},{label:"Username violation, vandalism-only account",value:"uw-vaublock"}]},{label:"Templated reasons",list:[{label:"blocked proxy",value:"blocked proxy"},{label:"CheckUser block",value:"CheckUser block"},{label:"checkuserblock-account",value:"checkuserblock-account"},{label:"checkuserblock-wide",value:"checkuserblock-wide"},{label:"colocationwebhost",value:"colocationwebhost"},{label:"oversightblock",value:"oversightblock"},{label:"rangeblock",value:"rangeblock"},{label:"spamblacklistblock",value:"spamblacklistblock"},{label:"tor",value:"tor"},{label:"webhostblock",value:"webhostblock"},{label:"zombie proxy",value:"zombie proxy"}]}],t.blockGroupsPartial=[{label:"Common partial block reasons",list:[{label:"Generic partial block (custom reason)",value:"uw-pblock",selected:!0},{label:"Generic partial block (custom reason) - indefinite",value:"uw-pblockindef"},{label:"Edit warring",value:"uw-ewpblock"}]},{label:"Extended partial block reasons",list:[{label:"Arbitration enforcement",value:"uw-aepblock"},{label:"Email harassment",value:"uw-epblock"},{label:"Misusing multiple accounts",value:"uw-acpblock"},{label:"Misusing multiple accounts - indefinite",value:"uw-acpblockindef"}]}],t.disablePartialBlockNamespaces=[2300,2301,2302,2303],t.dsinfo={"":{code:""},Abortion:{code:"ab",page:"Wikipedia:Arbitration/Requests/Case/Abortion"},"American politics post-1992":{code:"ap",page:"Wikipedia:Arbitration/Requests/Case/American politics 2"},"Ancient Egyptian race controversy":{code:"aerc",page:"Wikipedia:Requests for arbitration/Ancient Egyptian race controversy"},"Arab-Israeli conflict":{code:"a-i",page:"Wikipedia:Arbitration/Index/Palestine-Israel articles"},"Armenia, Azerbaijan, or related conflicts":{code:"a-a",page:"Wikipedia:Requests for arbitration/Armenia-Azerbaijan 2"},"Biographies of Living Persons (BLPs)":{code:"blp",page:"Wikipedia:Requests for arbitration/Editing of Biographies of Living Persons"},"Climate change":{code:"cc",page:"Wikipedia:Arbitration/Requests/Case/Climate change"},"Complementary and alternative medicine":{code:"com",page:"Wikipedia:Arbitration/Requests/Case/Acupuncture"},"Eastern Europe or the Balkans":{code:"e-e",page:"Wikipedia:Requests for arbitration/Eastern Europe"},"Electronic cigarettes":{code:"ecig",page:"Wikipedia:Arbitration/Requests/Case/Editor conduct in e-cigs articles"},"Falun Gong":{code:"fg",page:"Wikipedia:Requests for arbitration/Falun Gong"},"Gender-related dispute or controversy and associated people (includes GamerGate)":{code:"gas",page:"Wikipedia:Arbitration/Requests/Case/Gender and sexuality"},"Genetically modified organisms (GMO)":{code:"gmo",page:"Wikipedia:Arbitration/Requests/Case/Genetically modified organisms"},"Gun control":{code:"gc",page:"Wikipedia:Arbitration/Requests/Case/Gun control"},"Horn of Africa (Ethiopia, Somalia, Eritrea, Djibouti)":{code:"horn",page:"Wikipedia:Arbitration/Requests/Case/Horn of Africa"},"India, Pakistan, and Afghanistan":{code:"ipa",page:"Wikipedia:Requests for arbitration/India-Pakistan"},Infoboxes:{code:"cid",page:"Wikipedia:Arbitration/Requests/Case/Civility in infobox discussions"},"Kurds and Kurdistan":{code:"kurd",page:"Wikipedia:Arbitration/Requests/Case/Kurds and Kurdistan"},"Landmark Worldwide":{code:"lw",page:"Wikipedia:Arbitration/Requests/Case/Landmark Worldwide"},"Liancourt Rocks":{code:"lr",page:"Wikipedia:Requests for arbitration/Liancourt Rocks"},"Manual of Style and article titles":{code:"mos",page:"Wikipedia:Arbitration/Requests/Case/Article titles and capitalisation"},Muhammad:{code:"muh-im",page:"Wikipedia:Arbitration/Requests/Case/Muhammad images"},"Pharmaceutical drug prices (medicine)":{code:"med",page:"Wikipedia:Arbitration/Requests/Case/Medicine"},"Prem Rawat":{code:"pr",page:"Wikipedia:Requests for arbitration/Prem Rawat"},"Pseudoscience and fringe science":{code:"ps",page:"Wikipedia:Requests for arbitration/Pseudoscience"},"Race/ethnicity and human abilities, behaviour, and intelligence":{code:"r-i",page:"Wikipedia:Arbitration/Requests/Case/Race and intelligence"},Scientology:{code:"sci",page:"Wikipedia:Requests for arbitration/Scientology"},"Senkaku Islands dispute":{code:"sen",page:"Wikipedia:Arbitration/Requests/Case/Senkaku Islands"},"September 11 attacks":{code:"9/11",page:"Wikipedia:Requests for arbitration/September 11 conspiracy theories"},"Shakespeare authorship question":{code:"saq",page:"Wikipedia:Arbitration/Requests/Case/Shakespeare authorship question"},"Transcendental Meditation movement":{code:"tm",page:"Wikipedia:Arbitration/Requests/Case/Transcendental Meditation movement"},"The Troubles":{code:"tt",page:"Wikipedia:Requests for arbitration/The Troubles"},"Waldorf education":{code:"we",page:"Wikipedia:Requests for arbitration/Waldorf education"}},t}return ee(t,e),t.prototype.toggle_see_alsos=function(e){var t=e.target,a=t.form.reason.value.replace(new RegExp("( \x3c!--|;) see also "+this.seeAlsos.join(" and ")+"( --\x3e)?"),"");this.seeAlsos=this.seeAlsos.filter((function(e){return e!==t.value})),t.checked&&this.seeAlsos.push(t.value);var i=this.seeAlsos.join(" and ");this.seeAlsos.length?-1!==a.indexOf("{{")?t.form.reason.value=a+" \x3c!-- see also "+i+" --\x3e":t.form.reason.value=a+"; see also "+i:t.form.reason.value=a},t.prototype.getBlockNoticeWikitextAndSummary=function(e){var t=this,a="{{",i=this.blockPresetsInfo[e.template];if(i.nonstandard)a+=e.template;else if(a+="subst:"+e.template,e.article&&i.pageParam&&(a+="|page="+e.article),e.dstopic&&(a+="|topic="+e.dstopic),/te?mp|^\s*$|min/.exec(e.expiry)||(e.indefinite?a+="|indef=yes":e.blank_duration||new Morebits.date(e.expiry).isValid()||(a+="|time="+e.expiry)),this.isRegistered||e.hardblock||(a+="|anon=yes"),e.reason&&(a+="|reason="+e.reason),e.disabletalk&&(a+="|notalk=yes"),e.partial)if(e.pagerestrictions.length||e.namespacerestrictions.length){if(a+="|area="+(e.indefinite?"certain ":"from certain "),e.pagerestrictions.length&&(a+="pages ("+mw.language.listToText(e.pagerestrictions.map((function(e){return"[[:"+e+"]]"}))),a+=e.namespacerestrictions.length?") and certain ":")"),e.namespacerestrictions.length){var o=e.namespacerestrictions.map((function(e){return t.menuFormattedNamespaces[e]}));a+="[[Wikipedia:Namespace|namespaces]] ("+mw.language.listToText(o)+")"}}else e.area?a+="|area="+e.area:(e.noemail&&(a+="|email=yes"),e.nocreate&&(a+="|accountcreate=yes"));i.sig&&(a+="|sig="+i.sig),a+="}}";var n=e.messageData.summary;return!0!==e.messageData.suppressArticleInSummary&&e.article&&(n+=" on [[:"+e.article+"]]"),[a,n+="."]},t}(function(e){function t(){var t=e.call(this)||this;return t.moduleName="block",t.portletId="twinkle-block",t.portletName="Block",t.portletTooltip="Block relevant user",t.menuFormattedNamespaces=$.extend({},mw.config.get("wgFormattedNamespaces")),t.fetchedData={},t.defaultBlockTemplate="uw-block",t.defaultAnonBlockTemplate="uw-ablock",t.defaultIndefBlockTemplate="uw-blockindef",t.defaultPartialBlockTemplate="uw-pblock",t.defaultIndefPartialBlockTemplate="uw-pblockindef",t.ipBlockExpiryDefault="31 hours",t.seeAlsos=[],t.prev_template_expiry=null,t.menuFormattedNamespaces[0]=F("blanknamespace"),t.relevantUserName=mw.config.get("wgRelevantUserName"),Morebits.userIsSysop&&t.relevantUserName&&(!Morebits.ip.isRange(t.relevantUserName)||Morebits.ip.validCIDR(t.relevantUserName))&&t.addMenu(),t}return n(t,e),t.prototype.makeWindow=function(){var e=this;if(this.relevantUserName!==mw.config.get("wgUserName")||confirm(F("block-self-warn"))){this.currentBlockInfo=void 0,this.field_block_options={},this.field_template_options={};var t=new ae(650,530);t.setTitle(F("block-window-title",this.relevantUserName)),t.setFooterLinks(this.footerlinks),t.addFooterLink(F("unblock-label"),"Special:Unblock/"+this.relevantUserName,!0);var a=new Morebits.quickForm((function(t){return e.evaluate(t)}));a.append({type:"field",label:"Type of action"}).append({type:"checkbox",event:this.change_action.bind(this),list:[{label:F("block-action"),value:"block",name:"block",tooltip:F("block-action-tooltip"),checked:!0},{label:F("block-partial"),value:"partial",name:"partial",tooltip:F("block-partial-tooltip"),checked:V("defaultToPartialBlocks")},{label:F("block-tag"),value:"tag",name:"tag",tooltip:F("block-tag-tooltip"),checked:!Morebits.ip.isRange(this.relevantUserName),disabled:Morebits.ip.isRange(this.relevantUserName)}]});var i=Morebits.ip.get64(mw.config.get("wgRelevantUserName"));if(i&&i!==mw.config.get("wgRelevantUserName")){var o=a.append({type:"field",label:F("block-64-field-label"),name:"field_64"});o.append({type:"div",style:"margin-bottom: 0.5em",label:F("block-64-help",i)}),o.append({type:"checkbox",name:"block64",event:this.change_block64.bind(this),list:[{checked:this.relevantUserName!==mw.config.get("wgRelevantUserName"),label:F("block-64-label"),value:"block64",tooltip:Morebits.ip.isRange(mw.config.get("wgRelevantUserName"))?"":F("block-64-template",mw.config.get("wgRelevantUserName"))}]})}a.append({type:"field",label:F("preset"),name:"field_preset"}),a.append({type:"field",label:F("block-tag-options"),name:"field_template_options"}),a.append({type:"field",label:F("block-block-options"),name:"field_block_options"}),a.append({type:"submit"});var n=a.render();t.setContent(n),t.display(),n.root=n;var r=new De(this.relevantUserName,F("fetching-userinfo"));r.load().then((function(){e.processUserInfo(r),e.blockedUserName===e.relevantUserName&&$(n.partial).prop("checked",e.currentBlockInfo.partial),e.transformBlockPresets();var t=document.createEvent("Event");t.initEvent("change",!0,!0),n.block.dispatchEvent(t)}),(function(){Morebits.status.init($('div[name="currentblock"] span').last()[0]),Morebits.status.warn(F("error"),F("fetching-userinfo-error"))}))}},t.prototype.processUserInfo=function(e){var t=e.getBlockInfo();this.fetchedData[e.getUserName()]=e,this.isRegistered=!e.isIP(),this.userIsBot=e.isBot(),t&&(t.disabletalk=!t.allowusertalk,t.hardblock=!t.anononly),this.currentBlockInfo=t,this.blockedUserName=this.currentBlockInfo&&this.currentBlockInfo.user,$(".morebits-dialog-footerlinks a").first().toggle(this.blockedUserName===this.relevantUserName).next().toggle(this.blockedUserName===this.relevantUserName),this.hasBlockLog=e.hasBlockLog(),this.lastBlockLogEntry=e.getLastBlockLogEntry(),this.lastBlockLogId=!!this.hasBlockLog&&this.lastBlockLogEntry.logid},t.prototype.saveFieldset=function(e){var t=this;return this[$(e).prop("name")]={},$(e).serializeArray().forEach((function(a){t[$(e).prop("name")][a.name]=a.value})),this[$(e).prop("name")]},t.prototype.change_block64=function(e){var t=this,a=e.target.form,i=$(e.target.form).find("[name=block64]"),o=this.relevantUserName;i.is(":checked")?this.relevantUserName=Morebits.ip.get64(mw.config.get("wgRelevantUserName")):this.relevantUserName=mw.config.get("wgRelevantUserName");var n=Morebits.ip.isRange(mw.config.get("wgRelevantUserName"));$(a.tag).prop("disabled",n).prop("checked",!n);var r=function(){var i=document.querySelector(".ui-dialog-title").firstChild.nextSibling;i.nodeValue=i.nodeValue.replace(o,t.relevantUserName);var n=document.querySelector(".morebits-dialog-footerlinks a");n.href=n.href.replace(o,t.relevantUserName),n.title=n.title.replace(o,t.relevantUserName),$(a.partial).prop("checked",V("defaultToPartialBlocks")),t.blockedUserName===t.relevantUserName&&$(a.partial).prop("checked",t.currentBlockInfo.partial),t.change_action(e)};this.fetchedData[this.relevantUserName]?(this.processUserInfo(this.fetchedData[this.relevantUserName]),r()):new Morebits.wiki.user(this.relevantUserName,F("fetching-userinfo")).load((function(e){t.processUserInfo(e),r()}),(function(){Morebits.status.init($('div[name="currentblock"] span').last()[0]),Morebits.status.warn(F("error"),F("fetching-userinfo-error"))}))},t.prototype.change_action=function(e){var t,a,i,o=this,n=e.target.form,r=$(e.target.form),s=Morebits.quickForm.getInputData(n),l=s.partial?this.blockGroupsPartial:this.blockGroups;$(n.partial).prop("disabled",!s.block&&!s.tag);var c,d={label:F("block-prior-label")};if(this.blockedUserName===this.relevantUserName?(this.blockPresetsInfo.prior=this.currentBlockInfo,d.list=[{label:F("block-prior-label"),value:"prior",selected:!0}],l.some((function(e){return e.label===d.label}))||l.push(d),s.partial?this.blockPresetsInfo.prior.templateName=Ue(this.currentBlockInfo.expiry)?this.defaultIndefPartialBlockTemplate:this.defaultPartialBlockTemplate:this.isRegistered?this.blockPresetsInfo.prior.templateName=Ue(this.currentBlockInfo.expiry)?this.defaultIndefBlockTemplate:this.defaultBlockTemplate:this.blockPresetsInfo.prior.templateName=this.defaultAnonBlockTemplate):l=l.filter((function(e){return e.label!==d.label})),this.saveFieldset($("[name=field_block_options]")),this.saveFieldset($("[name=field_template_options]")),s.block&&((t=new Morebits.quickForm.element({type:"field",label:"Preset",name:"field_preset"})).append({type:"select",name:"preset",label:F("choose-preset"),event:this.change_preset.bind(this),list:this.filtered_block_groups(l)}),(i=new Morebits.quickForm.element({type:"field",label:F("block-block-options"),name:"field_block_options"})).append({type:"div",name:"currentblock",label:" "}),i.append({type:"div",name:"hasblocklog",label:" "}),i.append({type:"select",name:"expiry_preset",label:F("block-expiry"),event:this.change_expiry.bind(this),list:[{label:F("block-custom-expiry"),value:"custom",selected:!0},{label:F("block-expiry-indefinite"),value:"infinity"},{label:F("duration-hours",3),value:"3 hours"},{label:F("duration-hours",12),value:"12 hours"},{label:F("duration-hours",24),value:"24 hours"},{label:F("duration-hours",31),value:"31 hours"},{label:F("duration-hours",36),value:"36 hours"},{label:F("duration-hours",48),value:"48 hours"},{label:F("duration-hours",60),value:"60 hours"},{label:F("duration-hours",72),value:"72 hours"},{label:F("duration-weeks",1),value:"1 week"},{label:F("duration-weeks",2),value:"2 weeks"},{label:F("duration-months",1),value:"1 month"},{label:F("duration-months",3),value:"3 months"},{label:F("duration-months",6),value:"6 months"},{label:F("duration-years",1),value:"1 year"},{label:F("duration-years",2),value:"2 years"},{label:F("duration-years",3),value:"3 years"}]}),i.append({type:"input",name:"expiry",label:F("block-custom-expiry"),tooltip:F("block-custom-expiry-tooltip"),value:this.field_block_options.expiry||this.field_template_options.template_expiry}),s.partial&&(i.append({type:"select",multiple:!0,name:"pagerestrictions",label:F("block-pages-label"),value:"",tooltip:F("block-pages-tooltip")}),i.append({type:"select",multiple:!0,name:"namespacerestrictions",label:F("block-namespaces-label"),value:"",tooltip:F("block-namespaces-tooltip"),list:C(this.menuFormattedNamespaces).filter((function(e){var t=e[0];return t>=0&&!o.disablePartialBlockNamespaces.includes(t)})).map((function(e){var t=e[0];return{type:"option",label:e[1],value:t}}))})),i.append({type:"checkbox",name:"blockoptions",list:[{checked:this.field_block_options.nocreate,label:F("block-nocreate-label"),name:"nocreate",value:"1"},{checked:this.field_block_options.noemail,label:F("block-noemail-label"),name:"noemail",value:"1"},{checked:this.field_block_options.disabletalk,label:F("block-disabletalk-label"),name:"disabletalk",value:"1",tooltip:s.partial?F("block-partial-disabletalk-tooltip"):""},this.isRegistered?{checked:this.field_block_options.autoblock,label:F("block-auto-label"),name:"autoblock",value:"1"}:{checked:this.field_block_options.hardblock,label:F("block-hard-label"),name:"hardblock",value:"1"},{checked:this.field_block_options.watchuser,label:F("block-watch-label"),name:"watchuser",value:"1"}]}),i.append({type:"textarea",label:F("block-reason-label"),name:"reason",tooltip:F("block-reason-tooltip"),value:this.field_block_options.reason}),i.append({type:"div",name:"filerlog_label",label:F("block-see-label"),style:"display:inline-block;font-style:normal !important",tooltip:F("block-see-tooltip")}),i.append({type:"checkbox",event:this.toggle_see_alsos.bind(this),style:"display:inline-block; margin-right:5px",list:[{label:F("block-see-filter"),name:"filter_see_also",value:"filter log"}]}),i.append({type:"checkbox",event:this.toggle_see_alsos.bind(this),style:"display:inline-block",list:[{label:F("block-see-deleted"),name:"deleted_see_also",value:"deleted contribs"}]}),this.blockedUserName===this.relevantUserName&&i.append({type:"hidden",name:"reblock",value:"1"})),s.tag){(a=new Morebits.quickForm.element({type:"field",label:F("block-tag-options"),name:"field_template_options"})).append({type:"select",name:"template",label:F("block-tag-template"),event:this.change_template.bind(this),list:this.filtered_block_groups(l,!0),value:this.field_template_options.template}),a.append({type:"input",name:"article",label:F("block-linked-label"),value:"",tooltip:F("block-linked-tooltip")}),a.append({type:"input",name:"area",label:F("block-partial-area-label"),value:"",tooltip:F("block-partial-area-tooltip")}),s.block||a.append({type:"input",name:"template_expiry",label:F("block-tag-expiry"),value:"",tooltip:F("block-tag-expiry-tooltip")}),a.append({type:"input",name:"block_reason",label:F("block-tag-reason-label"),tooltip:F("block-tag-reason-tooltip"),value:this.field_template_options.block_reason}),s.block?a.append({type:"checkbox",name:"blank_duration",list:[{label:F("block-tag-noexpiry-label"),checked:this.field_template_options.blank_duration,tooltip:F("block-tag-noexpiry-tooltip")}]}):a.append({type:"checkbox",list:[{label:F("block-tag-notalk-label"),name:"notalk",checked:this.field_template_options.notalk,tooltip:F("block-tag-notalk-tooltip")},{label:F("block-tag-noemail-label"),name:"noemail_template",checked:this.field_template_options.noemail_template,tooltip:F("block-tag-noemail-tooltip")},{label:F("block-tag-nocreate-label"),name:"nocreate_template",checked:this.field_template_options.nocreate_template,tooltip:F("block-tag-nocreate-tooltip")}]});var p=$('<a id="twinkleblock-preview-link">Preview</a>');p.off("click").on("click",(function(){o.preview(r[0])})),p.css({cursor:"pointer"}),a.append({type:"div",id:"blockpreview",label:[p[0]]}),a.append({type:"div",id:"twinkleblock-previewbox",style:"display: none"})}if(t?(c=r.find('fieldset[name="field_preset"]')[0]).parentNode.replaceChild(t.render(),c):r.find('fieldset[name="field_preset"]').hide(),i?((c=r.find('fieldset[name="field_block_options"]')[0]).parentNode.replaceChild(i.render(),c),r.find('fieldset[name="field_64"]').show(),r.find("[name=pagerestrictions]").select2({width:"100%",placeholder:F("block-pages-placeholder"),language:{errorLoading:function(){return F("select2-badsearch")}},maximumSelectionLength:10,minimumInputLength:1,ajax:{url:mw.util.wikiScript("api"),dataType:"json",delay:100,data:function(e){var t=mw.Title.newFromText(e.term);if(t)return{action:"query",format:"json",list:"allpages",apfrom:t.title,apnamespace:t.namespace,aplimit:"10"}},processResults:function(e){return{results:e.query.allpages.map((function(e){var t=mw.Title.newFromText(e.title,e.ns).toText();return{id:t,text:t}}))}}},templateSelection:function(e){return $("<a>").text(e.text).attr({href:mw.util.getUrl(e.text),target:"_blank"})}}),r.find("[name=namespacerestrictions]").select2({width:"100%",matcher:Morebits.select2.matchers.wordBeginning,language:{searching:Morebits.select2.queryInterceptor},templateResult:Morebits.select2.highlightSearchMatches,placeholder:F("block-namespaces-placeholder")}),mw.util.addCSS(".select2-results .select2-results__option { padding-top: 1px; padding-bottom: 1px; }.select2-container .select2-dropdown .select2-results { font-size: 13px; }.select2-container .selection .select2-selection__rendered { font-size: 13px; }.select2-container--default.select2-container--focus .select2-selection--multiple { border: 1px solid #aaa; }.select2-selection__choice__remove { font-size: 130%; }")):(r.find('fieldset[name="field_block_options"]').hide(),r.find('fieldset[name="field_64"]').hide(),r.find("[name=pagerestrictions]").val(null).trigger("change"),r.find("[name=namespacerestrictions]").val(null).trigger("change")),a?((c=r.find('fieldset[name="field_template_options"]')[0]).parentNode.replaceChild(a.render(),c),e.target.form.root.previewer=new Morebits.wiki.preview($(e.target.form.root).find("#twinkleblock-previewbox").last()[0])):r.find('fieldset[name="field_template_options"]').hide(),this.currentBlockInfo){var u=this.blockedUserName===this.relevantUserName;Morebits.status.init($('div[name="currentblock"] span').last()[0]);var m=this.currentBlockInfo.partial,g=this.currentBlockInfo.rangestart!==this.currentBlockInfo.rangeend,f="infinity"===this.currentBlockInfo.expiry,h=mw.util.getUrl("Special:Log",{page:this.blockedUserName,type:"block"}),b="";if(m)if(g)if(u)b=F("block-current-partial-range",this.relevantUserName);else{var v=this.blockedUserName.match(/\/(\d{1,3})$/)[1];b=F("block-current-partial-in-range",this.relevantUserName,v,'<a target="_blank" href="'+h+'">'+this.blockedUserName+"</a>")}else b=F("block-current-partial",this.relevantUserName);else if(b=F("block-current",this.relevantUserName),g)if(u)b=F("block-current-range",this.relevantUserName);else{v=this.blockedUserName.match(/\/(\d{1,3})$/)[1];b=F("block-current-in-range",this.relevantUserName,v,'<a target="_blank" href="'+h+'">'+this.blockedUserName+"</a>")}b+=F("word-separator")+F("parentheses",f?F("block-expiry-indefinite"):new Morebits.date(this.currentBlockInfo.expiry).isValid()?F("block-expiry-date",this.currentBlockInfo.expiry):"");var w="";w=F(u?"block-current-change":"block-current-add"),Morebits.status.warn(b,w),this.update_form(e,this.currentBlockInfo)}if(this.hasBlockLog){var k=[];k.push(y(F("blocklogpage"),"Special:Log",{page:this.relevantUserName,type:"block"})),this.currentBlockInfo||("unblock"===this.lastBlockLogEntry.action?k.push(F("word-separator"),F("parentheses",F("unblocked-ago",this.lastBlockLogEntry.timestamp))):k.push(F("word-separator"),F("parentheses",F("block-expired",this.lastBlockLogEntry.params.duration,this.lastBlockLogEntry.timestamp)))),Morebits.status.init($('div[name="hasblocklog"] span').last()[0]),Morebits.status.warn(this.currentBlockInfo?F("block-log-current"):F("block-log-past"),k)}s.block?this.change_preset(e):s.tag&&this.change_template(e)},t.prototype.transformBlockPresets=function(){var e=this;$.each(this.blockPresetsInfo,(function(t,a){a.summary=a.summary||a.reason,a.sig=void 0!==a.sig?a.sig:"yes",a.indefinite=a.indefinite||Ue(a.expiry),!e.isRegistered&&a.indefinite?a.expiry=e.ipBlockExpiryDefault:a.expiry=a.expiry||e.ipBlockExpiryDefault,e.blockPresetsInfo[t]=a}))},t.prototype.filtered_block_groups=function(e,t){var a=this;return $.map(e,(function(e){var i=$.map(e.list,(function(e){switch(e.value){case"uw-talkrevoked":if(a.blockedUserName!==a.relevantUserName)return;break;case"rangeblock":if(!Morebits.ip.isRange(a.relevantUserName))return;e.selected=!Morebits.ip.get64(a.relevantUserName)}var i=a.blockPresetsInfo[e.value];if(!(i.requireGroup&&!Morebits.userIsInGroup(i.requireGroup)||i.forRegisteredOnly&&!a.isRegistered||i.forAnonOnly&&a.isRegistered||t&&i.templateName)){var o=i.templateName||e.value;return{label:(t?"{{"+o+"}}: ":"")+e.label,value:e.value,data:[{name:"template-name",value:o}],selected:!!e.selected,disabled:!!e.disabled}}}));if(i.length)return{label:e.label,list:i}}))},t.prototype.change_preset=function(e){var t=e.target.form,a=t.preset.value;a&&(this.update_form(e,this.blockPresetsInfo[a]),t.template&&(t.template.value=this.blockPresetsInfo[a].templateName||a,this.change_template(e)))},t.prototype.change_expiry=function(e){var t=e.target.form.expiry;"custom"===e.target.value?Morebits.quickForm.setElementVisibility(t.parentNode,!0):(Morebits.quickForm.setElementVisibility(t.parentNode,!1),t.value=e.target.value)},t.prototype.toggle_see_alsos=function(e){},t.prototype.update_form=function(e,t){var a=e.target.form,i=t.expiry;if(t.useInitialOptions||(Date.parse(i)?(i=new Date(i).toUTCString(),a.expiry_preset.value="custom"):a.expiry_preset.value=t.expiry||"custom",a.expiry.value=i,"custom"===a.expiry_preset.value?Morebits.quickForm.setElementVisibility(a.expiry.parentNode,!0):Morebits.quickForm.setElementVisibility(a.expiry.parentNode,!1)),this.userIsBot&&(t.autoblock=!1),$(a).find("[name=field_block_options]").find(":checkbox").each((function(e,a){if(!t.useInitialOptions||void 0!==t[a.name]){var i=""===t[a.name]||!!t[a.name];$(a).prop("checked",i)}})),t.prependReason&&t.reason?a.reason.value=t.reason+"; "+a.reason.value:a.reason.value=t.reason||"",a.pagerestrictions){var o=$(a).find("[name=pagerestrictions]"),n=$(a).find("[name=namespacerestrictions]");if(t.useInitialOptions||(o.val(null).trigger("change"),n.val(null).trigger("change")),t.restrictions){if(t.restrictions.pages&&!o.val().length){var r=t.restrictions.pages.map((function(e){return e.title}));r.forEach((function(e){if(!o.find("option[value='"+$.escapeSelector(e)+"']").length){var t=new Option(e,e,!0,!0);o.append(t)}})),o.val(o.val().concat(r)).trigger("change")}t.restrictions.namespaces&&n.val(n.val().concat(t.restrictions.namespaces)).trigger("change")}}},t.prototype.change_template=function(e){var t=e.target.form,a=t.template.value,i=this.blockPresetsInfo[a],o=Morebits.quickForm.getInputData(t);o.block?o.tag&&Morebits.quickForm.setElementVisibility(t.blank_duration.parentNode,!i.indefinite&&!i.nonstandard):(i.indefinite||i.nonstandard?(null===this.prev_template_expiry&&(this.prev_template_expiry=t.template_expiry.value||""),t.template_expiry.parentNode.style.display="none",t.template_expiry.value="infinity"):"none"===t.template_expiry.parentNode.style.display&&(null!==this.prev_template_expiry&&(t.template_expiry.value=this.prev_template_expiry,this.prev_template_expiry=null),t.template_expiry.parentNode.style.display="block"),this.prev_template_expiry&&(t.expiry.value=this.prev_template_expiry),Morebits.quickForm.setElementVisibility(t.notalk.parentNode,!i.nonstandard),Morebits.quickForm.setElementVisibility(t.noemail_template.parentNode,o.partial),Morebits.quickForm.setElementVisibility(t.nocreate_template.parentNode,o.partial)),Morebits.quickForm.setElementVisibility(t.article.parentNode,i&&!!i.pageParam),Morebits.quickForm.setElementVisibility(t.block_reason.parentNode,i&&!!i.reasonParam),Morebits.quickForm.setElementVisibility(t.area.parentNode,o.partial&&!o.block),t.root.previewer.closePreview()},t.prototype.preview=function(e){var t=Morebits.quickForm.getInputData(e);t.disabletalk=t.disabletalk||t.notalk;var a=this.getBlockNoticeWikitextAndSummary(t)[0];e.previewer.beginRender(a,"User_talk:"+this.relevantUserName)},t.prototype.evaluate=function(e){var t=this,a=e.target,i=$(e.target),o=a.block.checked,n=a.tag.checked,r=$(a.partial).is(":checked"),s={},l={};if(this.saveFieldset(i.find("[name=field_block_options]")),this.saveFieldset(i.find("[name=field_template_options]")),s=this.field_block_options,(l=this.field_template_options).disabletalk=!(!l.disabletalk&&!s.disabletalk),l.hardblock=!!s.hardblock,delete s.expiry_preset,r&&(s.partial=l.partial=!0),l.pagerestrictions=i.find("[name=pagerestrictions]").val()||[],l.namespacerestrictions=i.find("[name=namespacerestrictions]").val()||[],s.pagerestrictions=l.pagerestrictions.join("|"),s.namespacerestrictions=l.namespacerestrictions.join("|"),l.summary=l.summary||s.reason,l.expiry=l.template_expiry||s.expiry,o){if(s.partial){if(s.disabletalk&&-1===s.namespacerestrictions.indexOf("3"))return alert(F("block-warn-partial-usertalk"));if(!s.namespacerestrictions&&!s.pagerestrictions){if(!s.noemail&&!s.nocreate)return alert(F("block-partial-blank"));if(("uw-epblock"!==l.template||"uw-epblock"!==i.find('select[name="preset"]').val())&&!confirm("You are about to block with no restrictions on page or namespace editing, are you sure you want to proceed?"))return}}if(!s.expiry)return alert(F("block-warn-noexpiry"));if(Ue(s.expiry)&&!this.isRegistered)return alert(F("block-warn-indef-ip"));if(!s.reason)return alert("block-warn-noreason");Morebits.simpleWindow.setButtonsEnabled(!1),Morebits.status.init(e.target);var c=new Morebits.wiki.user(this.relevantUserName,F("block-doing"));c.setChangeTags(g.changeTags),c.load((function(){s.anononly=!s.hardblock,s.allowusertalk=!s.disabletalk,c.setExpiry(s.expiry),c.setWatchuser(s.watchuser),c.setReason(s.reason),c.setPartial(s.partial),c.setAllowusertalk(s.allowusertalk),c.setAnononly(s.anononly),c.setAutoblock(s.autoblock),c.setNocreate(s.nocreate),c.setNoemail(s.noemail),c.setReblock(s.reblock),s.partial&&(s.pagerestrictions&&c.setPartialPages(s.pagerestrictions),s.namespacerestrictions&&c.setPartialNamespaces(s.namespacerestrictions));var e=c.getBlockInfo(),a=c.getLastBlockLogEntry();if((null==a?void 0:a.logid)!==t.lastBlockLogId||!!e!=!!t.currentBlockInfo){var i=F("block-conflict",c.getUserName());if("block"===a.action||"reblock"===a.action?i+=F("block-conflict-block",a.user,a.comment,a.params.expiry):"unblock"===a.action&&(i+=F("block-conflict-unblock",a.user,a.comment,a.params.expiry)),!confirm(i))return void Morebits.status.info(F("block-doing"),F("user-aborted"));c.setReblock(!0)}c.block((function(){n&&t.issue_template(l)}))}))}else{if(!n)return alert(F("block-noop"));Morebits.simpleWindow.setButtonsEnabled(!1),Morebits.status.init(e.target),this.issue_template(l)}},t.prototype.issue_template=function(e){var t=this,a="User_talk:"+mw.config.get("wgRelevantUserName"),i=$.extend(e,{messageData:this.blockPresetsInfo[e.template],reason:this.field_template_options.block_reason,disabletalk:this.field_template_options.notalk,noemail:this.field_template_options.noemail_template,nocreate:this.field_template_options.nocreate_template});Morebits.wiki.actionCompleted.redirect=a,Morebits.wiki.actionCompleted.notice=F("block-complete");var o=new Morebits.wiki.page(a,F("block-tagging-status"));o.setCallbackParameters(i),o.load((function(e){return t.main(e)}))},t.prototype.main=function(e){var t,a=e.getCallbackParameters(),i=new Morebits.date(e.getLoadTime());if(a.indefinite=Ue(a.expiry),a.indefinite&&V("blankTalkpageOnIndefBlock")&&"uw-lblock"!==a.template)Morebits.status.info(F("info"),F("block-blank-talk")),t=i.monthHeader()+"\n";else{t=e.getPageText();for(var o,n,r=i.monthHeaderRegex();null!==(o=r.exec(t));)n=o;var s=t.lastIndexOf("\n==")+1;t.length>0&&(t+="\n\n"),n&&n.index===s||(Morebits.status.info(F("info"),F("block-new-section")),t+=i.monthHeader()+"\n")}a.expiry=void 0!==a.template_expiry?a.template_expiry:a.expiry;var l=this.getBlockNoticeWikitextAndSummary(a),c=l[0],d=l[1];t+=c,e.setPageText(t),e.setEditSummary(d),e.setChangeTags(g.changeTags),e.setWatchlist(V("watchWarnings")),e.save()},t.moduleName="block",t}(K)),Fe=function(e){function t(){var t=e.call(this)||this;return t.moduleName="prod",t.portletName="PROD",t.portletId="twinkle-prod",t.portletTooltip="Propose deletion via WP:PROD",t.params={},t.defaultReason=V("prodReasonDefault"),-1===[0,6,108].indexOf(mw.config.get("wgNamespaceNumber"))&&(2!==mw.config.get("wgNamespaceNumber")||-1===mw.config.get("wgCategories").indexOf("Wikipedia books (user books)"))||!mw.config.get("wgCurRevisionId")||Morebits.isPageRedirect()||t.addMenu(),t}return ee(t,e),t.prototype.makeWindow=function(){switch(mw.config.get("wgNamespaceNumber")){case 0:this.namespace="article";break;case 6:this.namespace="file";break;case 2:case 108:this.namespace="book"}var e=new Morebits.simpleWindow(800,410);e.setTitle("Proposed deletion (PROD)"),e.setScriptName("Twinkle");var t=new Morebits.quickForm(this.evaluate.bind(this));"article"===this.namespace?(e.addFooterLink("Proposed deletion policy","WP:PROD"),e.addFooterLink("BLP PROD policy","WP:BLPPROD")):"file"===this.namespace?e.addFooterLink("Proposed deletion policy","WP:PROD"):e.addFooterLink("Proposed deletion (books) policy","WP:BOOKPROD");var a=t.append({type:"field",label:"PROD type",id:"prodtype_fieldset"});a.append({type:"div",label:"",id:"twinkle-prod-findsources",style:"margin-bottom: 5px; margin-top: -5px;"}),a.append({type:"radio",name:"prodtype",event:this.prodtypechanged.bind(this),list:[{label:"PROD (proposed deletion)",value:"prod",checked:!0,tooltip:"Normal proposed deletion, per [[WP:PROD]]"},{label:"BLP PROD (proposed deletion of unsourced BLPs)",value:"prodblp",tooltip:"Proposed deletion of new, completely unsourced biographies of living persons, per [[WP:BLPPROD]]"}]}),t.append({type:"field",name:"parameters"}),e.addFooterLink("PROD prefs","WP:TW/PREF#prod"),e.addFooterLink("Twinkle help","WP:TW/DOC#prod"),e.addFooterLink("Give feedback","WT:TW"),t.append({type:"submit",label:"Propose deletion"});var i=t.render();e.setContent(i),e.display(),"article"!==this.namespace&&$(i).find("#prodtype_fieldset").hide();var o=document.createEvent("Event");o.initEvent("change",!0,!0),i.prodtype[0].dispatchEvent(o)},t.prototype.prodtypechanged=function(e){var t=new Morebits.quickForm.element({type:"field",label:"Parameters",name:"parameters"});switch(e.target.values){case"prod":t.append({type:"checkbox",list:[{label:"Notify page creator if possible",value:"notify",name:"notify",tooltip:"A notification template will be placed on the creator's talk page if this is true.",checked:!0}]}),t.append({type:"textarea",name:"reason",label:"Reason for proposed deletion:",value:this.defaultReason});break;case"prodblp":e.target.form.reason&&(this.defaultReason=e.target.form.reason.value),t.append({type:"checkbox",list:[{label:"Notify page creator if possible",value:"notify",name:"notify",tooltip:"Creator of article has to be notified.",checked:!0,disabled:!0}]});var a=document.createElement("b");a.appendChild(document.createTextNode("Please note that only unsourced biographies of living persons are eligible for this tag, narrowly construed.")),t.append({type:"div",label:a})}se("#twinkle-prod-findsources"),e.target.form.replaceChild(t.render(),$(e.target.form).find('fieldset[name="parameters"]')[0])},t.prototype.checkPriors=function(){var e=this,t=new mw.Title(mw.config.get("wgPageName")).getTalkPage().getPrefixedText();return new E("Checking talk page for prior nominations",{action:"query",titles:t,prop:"templates",tltemplates:"Template:Old XfD multi|Template:Old MfD|Template:Oldffdfull|Template:Oldpuffull|Template:Olddelrev|Template:Old prod",format:"json"}).post().then((function(t){var a=t.getStatusElement(),i=t.getResponse().query.pages[0].templates,o=i&&i.length;if(o){var n=i[0].title;if(1!==o||"Template:Old prod"!==n)return a.warn("Previous XfD template found on talk page, aborting procedure"),$.Deferred().reject();e.params.oldProdPresent=!0}}))},t.prototype.fetchCreationInfo=function(){var e=this.params,t=new te(mw.config.get("wgPageName"),"Looking up page creator");return t.setFollowRedirect(!0),t.setLookupNonRedirectCreator(!0),t.lookupCreation().then((function(){e.initialContrib=t.getCreator(),e.creation=t.getCreationTimestamp(),t.getStatusElement().info("Done, found "+e.initialContrib)}))},t.prototype.taggingPage=function(){var e=this,t=$.Deferred(),a=this.params,i=new te(mw.config.get("wgPageName"),"Tagging page");return i.setFollowRedirect(!0),i.load().then((function(){var o=i.getStatusElement();if(!i.exists())return o.error("It seems that the page doesn't exist. Perhaps it has already been deleted."),t.reject();var n=i.getPageText();if(/{{(?:db-?|delete|article for deletion\/dated|AfDM|ffd\b)|#invoke:Redirect for discussion/i.test(n))return o.warn("Page already tagged with a deletion template, aborting procedure"),t.reject();n=n.replace(/{{\s*(userspace draft|mtc|(copy|move) to wikimedia commons|(copy |move )?to ?commons)\s*(\|(?:{{[^{}]*}}|[^{}])*)?}}\s*/gi,"");var r,s=/{{\s*(?:Prod blp|Proposed deletion|book-prod)\/dated(?: files)?\s*\|(?:{{[^{}]*}}|[^{}])*}}/i;if(s.test(n)){if(/{{(?:Proposed deletion endorsed|prod-?2).*?}}/i.test(n))return o.warn("Page already tagged with {{proposed deletion}} and {{proposed deletion endorsed}} templates, aborting procedure"),t.reject();var l="A {{proposed deletion}} tag was already found on this page. \nWould you like to add a {{proposed deletion endorsed}} tag with your explanation?";if(a.blp&&!/{{\s*Prod blp\/dated/.test(n)&&(l='A non-BLP {{proposed deletion}} tag was found on this article.\nWould you like to add a {{proposed deletion endorsed}} tag with explanation "article is a biography of a living person with no sources"?'),!confirm(l))return o.warn("Aborted per user request"),t.reject();r="Endorsing proposed deletion per [[WP:"+(a.blp?"BLP":a.book?"BOOK":"")+"PROD]].",n=n.replace(s,n.match(s)+"\n{{Proposed deletion endorsed|1="+(a.blp?"article is a [[WP:BLPPROD|biography of a living person with no sources]]":Morebits.string.formatReasonText(a.reason))+"}}\n"),a.logEndorsing=!0}else{if(a.oldProdPresent){if(!a.blp)return o.warn("Previous PROD found on talk page, aborting procedure"),t.reject();if(!confirm("Previous PROD nomination found on talk page. Do you still want to continue applying BLPPROD? "))return o.warn("Previous PROD found on talk page, aborted by user"),t.reject();o.info("Previous PROD found on talk page, continuing")}if(a.blp){var c=new Morebits.date(a.creation).add(3,"days").isAfter(new Date(i.getLoadTime()));if(!/\[\[Category:Living people\]\]/i.test(n)&&c&&!confirm("Please note that the article is not in Category:Living people and hence may be ineligible for BLPPROD. Are you sure you want to continue? \n\nYou may wish to add the category if you proceed, unless the article is about a recently deceased person."))return t.reject()}var d;a.blp?(r="Proposing article for deletion per [[WP:BLPPROD]].",d="{{subst:prod blp"+(a.usertalk?"|help=off":"")+"}}"):a.book?(r="Proposing book for deletion per [[WP:BOOKPROD]].",d="{{subst:book-prod|1="+Morebits.string.formatReasonText(a.reason)+(a.usertalk?"|help=off":"")+"}}"):(r="Proposing "+e.namespace+" for deletion per [[WP:PROD]].",d="{{subst:prod|1="+Morebits.string.formatReasonText(a.reason)+(a.usertalk?"|help=off":"")+"}}"),n=new Morebits.wikitext.page(n).insertAfterTemplates(d+"\n",re).getText()}return V("markProdPagesAsPatrolled")&&i.triage(),i.setPageText(n),i.setEditSummary(r),i.setWatchlist(V("watchProdPages")),i.setCreateOption("nocreate"),i.save()}))},t.prototype.addOldProd=function(){if(this.params.oldProdPresent)return $.Deferred().resolve();var e="{{Old prod|nom="+mw.config.get("wgUserName")+"|nomdate={{subst:#time: Y-m-d}}}}\n",t=new mw.Title(mw.config.get("wgPageName")).getTalkPage().getPrefixedText(),a=new te(t,"Placing {{Old prod}} on talk page");return a.setPrependText(e),a.setEditSummary("Adding {{Old prod}}"),a.setFollowRedirect(!0),a.setCreateOption("recreate"),a.prepend()},t.prototype.notifyAuthor=function(){var e=$.Deferred(),t=this.params;if(!t.blp&&!t.usertalk)return e.resolve();if(t.initialContrib===mw.config.get("wgUserName"))return Morebits.status.info("Notifying creator","You ("+t.initialContrib+") created this page; skipping user notification"),e.resolve();var a,i="\n{{subst:"+(t.blp?"prodwarningBLP":t.book?"bprodwarning":"proposed deletion notify")+"|1="+Morebits.pageNameNorm+"|concern="+t.reason+"}} ~~~~",o=new Morebits.wiki.user(t.initialContrib,"Notifying initial contributor ("+t.initialContrib+")");return o.setMessage(i),o.setReason("Notification: proposed deletion of [[:"+Morebits.pageNameNorm+"]]."),o.setChangeTags(g.changeTags),t.blp?(o.setNotifyBots(!0),o.setNotifyIndef(!0)):o.setNotifySkips((a="prod")?"notwinkle.test/?module="+a:"",le),o.notify((function(){t.logInitialContrib=t.initialContrib,e.resolve()}),e.resolve),e},t.prototype.addToLog=function(){if(!V("logProdPages"))return $.Deferred().resolve();var e=this.params,t=new Morebits.userspaceLogger(V("prodLogPageName"));t.initialText="This is a log of all [[WP:PROD|proposed deletion]] tags applied or endorsed by this user using [[WP:TW|Twinkle]]'s PROD module.\n\nIf you no longer wish to keep this log, you can turn it off using the [[Wikipedia:Twinkle/Preferences|preferences panel]], and nominate this page for speedy deletion under [[WP:CSD#U1|CSD U1]].\n";var a,i="# [[:"+Morebits.pageNameNorm+"]]";return i+="file"===this.namespace?" ([{{fullurl:Special:Log|page="+mw.util.wikiUrlencode(mw.config.get("wgPageName"))+"}} log]): ":": ",e.logEndorsing?(i+="endorsed "+(e.blp?"BLP ":e.book?"BOOK":"")+"PROD. ~~~~~",e.reason&&(i+="\n#* '''Reason''': "+e.reason+"\n"),a="Logging endorsement of PROD nomination of [[:"+Morebits.pageNameNorm+"]]."):(i+=(e.blp?"BLP ":e.book?"BOOK":"")+"PROD",e.logInitialContrib&&(i+="; notified {{user|"+e.logInitialContrib+"}}"),i+=" ~~~~~\n",!e.blp&&e.reason&&(i+="#* '''Reason''': "+Morebits.string.formatReasonForLog(e.reason)+"\n"),a="Logging PROD nomination of [[:"+Morebits.pageNameNorm+"]]."),t.changeTags=g.changeTags,t.log(i,a)},t.prototype.evaluate=function(e){var t=e.target,a=Morebits.quickForm.getInputData(t);if(this.params={usertalk:a.notify||"prodblp"===a.prodtype,blp:"prodblp"===a.prodtype,book:"book"===this.namespace,reason:a.reason||""},this.params.blp||this.params.reason||confirm("You left the reason blank, do you really want to continue without providing one?")){Morebits.simpleWindow.setButtonsEnabled(!1),Morebits.status.init(t);var i=new Morebits.taskManager(this);Morebits.wiki.numberOfActionsLeft=1e3,i.add(this.checkPriors,[]),i.add(this.fetchCreationInfo,[]),i.add(this.taggingPage,[this.checkPriors]),i.add(this.notifyAuthor,[this.fetchCreationInfo,this.taggingPage]),i.add(this.addOldProd,[this.taggingPage,this.checkPriors]),i.add(this.addToLog,[this.notifyAuthor,this.taggingPage]),i.execute().then((function(){Morebits.status.actionCompleted("Tagging complete"),setTimeout((function(){window.location.href=mw.util.getUrl(mw.config.get("wgPageName"))}),Morebits.wiki.actionCompleted.timeOut)}))}},t.moduleName="prod",t}(K),Oe=function(e){function t(){var t=e.call(this)||this;return t.moduleName="deprod",t.portletName="Deprod",t.portletTooltip="Delete prod pages found in this category",t.portletId="twinkle-deprod",t.concerns={},Morebits.userIsSysop&&14===mw.config.get("wgNamespaceNumber")&&/proposed_deletion/i.test(mw.config.get("wgPageName"))?(t.addMenu(),t):t}return ee(t,e),t.prototype.makeWindow=function(){var e=this,t=new Morebits.simpleWindow(800,400);t.setTitle("PROD cleaning"),t.setScriptName("Twinkle"),t.addFooterLink("Proposed deletion","WP:PROD"),t.addFooterLink("Twinkle help","WP:TW/DOC#deprod"),t.addFooterLink("Give feedback","WT:TW");var a=new Morebits.quickForm((function(t){return e.evaluate(t)})),i=document.createElement("div");i.style.padding="15px",t.setContent(i),Morebits.status.init(i),t.display();var o={action:"query",generator:"categorymembers",gcmtitle:mw.config.get("wgPageName"),gcmlimit:V("batchMax"),gcmnamespace:"0|108|2",prop:"info|revisions",rvprop:"content",inprop:"protection",format:"json"},n=new Morebits.status("Grabbing list of pages"),r=new Morebits.wiki.api("loading...",o,(function(t){var a=t.getResponse(),i=a.query&&a.query.pages||[],o=[],n=/\{\{Proposed deletion/;i.sort(w),i.forEach((function(t){var a=[],i=t.revisions[0].content,r=n.exec(i),s=t.title;if(r){var l=Morebits.wikitext.parseTemplate(i,r.index);e.concerns[s]=l.parameters.concern||"",a.push(e.concerns[s])}var c=t.protection.filter((function(e){return"edit"===e.type&&"sysop"===e.level})).pop();c&&a.push("fully protected"+("infinity"===c.expiry?" indefinitely":", expires "+c.expiry)),o.push({label:a.length?"("+a.join("; ")+")":"",value:s,checked:""!==e.concerns[s],style:c?"color:red":""})})),t.params.form.append({type:"header",label:"Pages to delete"}),t.params.form.append({type:"button",label:"Select All",event:function(e){$(Morebits.quickForm.getElements(e.target.form,"pages")).prop("checked",!0)}}),t.params.form.append({type:"button",label:"Deselect All",event:function(e){$(Morebits.quickForm.getElements(e.target.form,"pages")).prop("checked",!1)}}),t.params.form.append({type:"checkbox",name:"pages",list:o}),t.params.form.append({type:"submit"});var r=t.params.form.render();t.params.Window.setContent(r),Morebits.quickForm.getElements(r,"pages").forEach(x)}),n);r.params={form:a,Window:t},r.post()},t.prototype.deleteTalk=function(e){if(!e.getResponse().query.pages[0].missing){var t=new Morebits.wiki.page("Talk:"+e.params.page,"Deleting talk page of page "+e.params.page);t.setEditSummary('[[WP:CSD#G8|G8]]: [[Help:Talk page|Talk page]] of deleted page "'+e.params.page+'"'),t.setChangeTags(g.changeTags),t.deletePage()}},t.prototype.deleteRedirects=function(e){(e.getResponse().query.pages[0].redirects||[]).forEach((function(t){var a=t.title,i=new Morebits.wiki.page(a,"Deleting redirecting page "+a);i.setEditSummary('[[WP:CSD#G8|G8]]: Redirect to deleted page "'+e.params.page+'"'),i.setChangeTags(g.changeTags),i.deletePage()}))},t.prototype.evaluate=function(e){var t=this,a=Morebits.quickForm.getInputData(e.target).pages;Morebits.status.init(e.target);var i=new Morebits.batchOperation("Deleting pages");i.setOption("chunkSize",V("batchChunks")),i.setOption("preserveIndividualStatusLines",!0),i.setPageList(a),i.run((function(e){var a={page:e},o=new Morebits.wiki.api("Grabbing redirects",{action:"query",titles:e,prop:"redirects",rdlimit:"max",format:"json"},t.deleteRedirects);o.params=a,o.post();var n=mw.Title.newFromText(e);n&&n.namespace%2==0&&2!==n.namespace&&(n.namespace++,(o=new Morebits.wiki.api("Checking whether "+e+" has a talk page",{action:"query",titles:n.toText(),format:"json"},t.deleteTalk)).params=a,o.post());var r=new Morebits.wiki.page(e,"Deleting page "+e);r.setEditSummary("Expired [[WP:PROD|PROD]], concern was: "+t.concerns[e]),r.setChangeTags(g.changeTags),r.suppressProtectWarning(),r.deletePage(i.workerSuccess,i.workerFailure)}))},t.moduleName="deprod",t}(K),_e=function(e){function t(){var a=e.call(this)||this;return a.moduleName="welcome",mw.util.getParamValue("friendlywelcome")?"auto"===mw.util.getParamValue("friendlywelcome")?t.auto():t.semiauto():t.normal(),a}return ee(t,e),t.auto=function(){"edit"===mw.util.getParamValue("action")&&t.welcomeUser()},t.semiauto=function(){t.callback(mw.config.get("wgRelevantUserName"))},t.normal=function(){if(mw.util.getParamValue("diff")){var e=$("#mw-diff-otitle2").find("span.mw-usertoollinks a.new:contains(talk)").first(),a=$("#mw-diff-ntitle2").find("span.mw-usertoollinks a.new:contains(talk)").first();if(e.length>0||a.length>0){var i=function(e,t){var a=document.createElement("span");return a.style.color=e,a.appendChild(document.createTextNode(t)),a},o=document.createElement("strong"),n=document.createElement("a");if(n.appendChild(i("Black","[")),n.appendChild(i("Goldenrod","welcome")),n.appendChild(i("Black","]")),o.appendChild(n),e.length>0){var r=e.attr("href"),s=o.cloneNode(!0);s.firstChild.setAttribute("href",r+"&"+$.param({friendlywelcome:"auto"===V("quickWelcomeMode")?"auto":"norm",vanarticle:Morebits.pageNameNorm})),e[0].parentNode.parentNode.appendChild(document.createTextNode(" ")),e[0].parentNode.parentNode.appendChild(s)}if(a.length>0){var l=a.attr("href"),c=o.cloneNode(!0);c.firstChild.setAttribute("href",l+"&"+$.param({friendlywelcome:"auto"===V("quickWelcomeMode")?"auto":"norm",vanarticle:Morebits.pageNameNorm})),a[0].parentNode.parentNode.appendChild(document.createTextNode(" ")),a[0].parentNode.parentNode.appendChild(c)}}}mw.config.exists("wgRelevantUserName")&&!Morebits.ip.isRange(mw.config.get("wgRelevantUserName"))&&H((function(){t.callback(mw.config.get("wgRelevantUserName"))}),"Wel","twinkle-welcome","Welcome user")},t.welcomeUser=function(){Morebits.status.init(document.getElementById("mw-content-text")),$("#catlinks").remove();var e={template:V("quickWelcomeTemplate"),article:mw.util.getParamValue("vanarticle")||"",mode:"auto"},a=mw.config.get("wgFormattedNamespaces")[3]+":"+mw.config.get("wgRelevantUserName");Morebits.wiki.actionCompleted.redirect=a,Morebits.wiki.actionCompleted.notice="Welcoming complete, reloading talk page in a few seconds";var i=new Morebits.wiki.page(a,"User talk page modification");i.setFollowRedirect(!0),i.setCallbackParameters(e),i.load(t.callbacks.main)},t.callback=function(e){if(e!==mw.config.get("wgUserName")||confirm("Are you really sure you want to welcome yourself?...")){var a=new Morebits.simpleWindow(600,420);a.setTitle("Welcome user"),a.setScriptName("Twinkle"),a.addFooterLink("Welcoming Committee","WP:WC"),a.addFooterLink("Welcome prefs","WP:TW/PREF#welcome"),a.addFooterLink("Twinkle help","WP:TW/DOC#welcome"),a.addFooterLink("Give feedback","WT:TW");var i=new Morebits.quickForm(t.evaluate);i.append({type:"select",name:"type",label:"Type of welcome: ",event:t.populateWelcomeList,list:[{type:"option",value:"standard",label:"Standard welcomes",selected:!mw.util.isIPAddress(mw.config.get("wgRelevantUserName"))},{type:"option",value:"anonymous",label:"IP user welcomes",selected:mw.util.isIPAddress(mw.config.get("wgRelevantUserName"))},{type:"option",value:"wikiProject",label:"WikiProject welcomes"},{type:"option",value:"nonEnglish",label:"Non-English welcomes"}]}),i.append({type:"div",id:"welcomeWorkArea",className:"morebits-scrollbox"}),i.append({type:"input",name:"article",label:"* Linked article (if supported by template):",value:mw.util.getParamValue("vanarticle")||"",tooltip:"An article might be linked from within the welcome if the template supports it. Leave empty for no article to be linked. Templates that support a linked article are marked with an asterisk."});var o=document.createElement("a");$(o).click((function(){t.callbacks.preview(n)})),o.style.cursor="pointer",o.textContent="Preview",i.append({type:"div",name:"welcomepreview",label:[o]}),i.append({type:"submit"});var n=i.render();a.setContent(n),a.display();var r=document.createEvent("Event");r.initEvent("change",!0,!0),n.type.dispatchEvent(r)}},t.populateWelcomeList=function(e){var a=e.target.value,i=new Morebits.quickForm.element({type:"fragment"});"standard"!==a&&"anonymous"!==a||!V("customWelcomeList").length||(i.append({type:"header",label:"Custom welcome templates"}),i.append({type:"radio",name:"template",list:V("customWelcomeList"),event:function(){e.target.form.article.disabled=!1}}));var o=t.templates[a];$.each(o,(function(e,t){i.append({type:"header",label:e}),i.append({type:"radio",name:"template",list:$.map(t,(function(e,t){return{value:t,label:"{{"+t+"}}: "+e.description+(e.linkedArticle?"\xa0*":""),tooltip:e.tooltip}})),event:function(e){e.target.form.article.disabled=!t[e.target.value].linkedArticle}})}));var n=i.render();$(e.target.form).find("div#welcomeWorkArea").empty().append(n);var r=e.target.form.template[0];r.checked=!0;var s=o[Object.keys(o)[0]];e.target.form.article.disabled=!s[r.value]||!s[r.value].linkedArticle},t.getTemplateWikitext=function(e,a,i){var o;return $.each(t.templates[e],(function(e,t){if(o=t[a])return!1})),o?o.syntax.replace("$USERNAME$",V("insertUsername")?mw.config.get("wgUserName"):"").replace("$ARTICLE$",i||"").replace(/\$HEADER\$\s*/,"== Welcome ==\n\n").replace("$EXTRA$",""):"{{subst:"+a+(i?"|art="+i:"")+"}}"+(V("customWelcomeSignature")?" ~~~~":"")},t.evaluate=function(e){var a=e.target,i=Morebits.quickForm.getInputData(a);i.mode="manual",Morebits.simpleWindow.setButtonsEnabled(!1),Morebits.status.init(a);var o=mw.config.get("wgFormattedNamespaces")[3]+":"+mw.config.get("wgRelevantUserName");Morebits.wiki.actionCompleted.redirect=o,Morebits.wiki.actionCompleted.notice="Welcoming complete, reloading talk page in a few seconds";var n=new Morebits.wiki.page(o,"User talk page modification");n.setFollowRedirect(!0),n.setCallbackParameters(i),n.load(t.callbacks.main)},t.moduleName="welcome",t.templates={standard:{"General welcome templates":{welcome:{description:"standard welcome",linkedArticle:!0,syntax:"{{subst:welcome|$USERNAME$|art=$ARTICLE$}} ~~~~"},"welcome-retro":{description:"a welcome message with a small list of helpful links",linkedArticle:!0,syntax:"{{subst:welcome-retro|$USERNAME$|art=$ARTICLE$}} ~~~~"},"welcome-short":{description:"a shorter welcome message",syntax:"{{subst:w-short|heading=true|$EXTRA$}}"},"welcome-cookie":{description:"a welcome message with some helpful links and a plate of cookies",syntax:"{{subst:welcome cookie}} ~~~~"},"welcome-graphical":{description:"colorful welcome message with table of about 20 links",syntax:"$HEADER$ {{subst:welcome-graphical|$EXTRA$}}"},"welcome-menu":{description:"welcome message with large table of about 60 links",syntax:"{{subst:welcome-menu}}"},"welcome-screen":{description:"welcome message with clear, annotated table of 10 links",syntax:"$HEADER$ {{subst:welcome-screen}}"},"welcome-belated":{description:"welcome for users with more substantial contributions",syntax:"{{subst:welcome-belated|$USERNAME$}}"},"welcome student":{description:"welcome for students editing as part of an educational class project",syntax:"$HEADER$ {{subst:welcome student|$USERNAME$}} ~~~~"},"welcome teacher":{description:"welcome for course instructors involved in an educational class project",syntax:"$HEADER$ {{subst:welcome teacher|$USERNAME$}} ~~~~"},"welcome non-latin":{description:"welcome for users with a username containing non-Latin characters",syntax:"{{subst:welcome non-latin|$USERNAME$}} ~~~~"}},"Problem user welcome templates":{welcomelaws:{description:"welcome with information about copyrights, NPOV, the sandbox, and vandalism",syntax:"{{subst:welcomelaws|$USERNAME$}} ~~~~"},"first article":{description:"for someone whose first article did not meet page creation guidelines",linkedArticle:!0,syntax:"{{subst:first article|$ARTICLE$|$USERNAME$}}"},welcometest:{description:"for someone whose initial efforts appear to be tests",linkedArticle:!0,syntax:"{{subst:welcometest|$ARTICLE$|$USERNAME$}} ~~~~"},welcomevandal:{description:"for someone whose initial efforts appear to be vandalism",linkedArticle:!0,syntax:"{{subst:welcomevandal|$ARTICLE$|$USERNAME$}}"},welcomenpov:{description:"for someone whose initial efforts do not adhere to the neutral point of view policy",linkedArticle:!0,syntax:"{{subst:welcomenpov|$ARTICLE$|$USERNAME$}} ~~~~"},welcomespam:{description:"welcome with additional discussion of anti-spamming policies",linkedArticle:!0,syntax:"{{subst:welcomespam|$ARTICLE$|$USERNAME$}} ~~~~"},welcomeunsourced:{description:"for someone whose initial efforts are unsourced",linkedArticle:!0,syntax:"{{subst:welcomeunsourced|$ARTICLE$|$USERNAME$}} ~~~~"},welcomeauto:{description:"for someone who created an autobiographical article",linkedArticle:!0,syntax:"{{subst:welcomeauto|$USERNAME$|art=$ARTICLE$}} ~~~~"},"welcome-COI":{description:"for someone who has edited in areas where they may have a conflict of interest",linkedArticle:!0,syntax:"{{subst:welcome-COI|$USERNAME$|art=$ARTICLE$}} ~~~~"},"welcome-delete":{description:"for someone who has been removing information from articles",linkedArticle:!0,syntax:"{{subst:welcome-delete|$ARTICLE$|$USERNAME$}} ~~~~"},"welcome-image":{description:"welcome with additional information about images (policy and procedure)",linkedArticle:!0,syntax:"{{subst:welcome-image|$USERNAME$|art=$ARTICLE$}}"}}},anonymous:{"Anonymous user welcome templates":{"welcome-anon":{description:"for anonymous users; encourages creating an account",linkedArticle:!0,syntax:"{{subst:welcome-anon|art=$ARTICLE$}} ~~~~"},"welcome-anon-test":{description:"for anonymous users who have performed test edits",linkedArticle:!0,syntax:"{{subst:welcome-anon-test|$ARTICLE$|$USERNAME$}} ~~~~"},"welcome-anon-unconstructive":{description:"for anonymous users who have vandalized or made unhelpful edits",linkedArticle:!0,syntax:"{{subst:welcome-anon-unconstructive|$ARTICLE$|$USERNAME$}}"},"welcome-anon-constructive":{description:"for anonymous users who fight vandalism or edit constructively",linkedArticle:!0,syntax:"{{subst:welcome-anon-constructive|art=$ARTICLE$}}"},"welcome-anon-delete":{description:"for anonymous users who have removed content from pages",linkedArticle:!0,syntax:"{{subst:welcome-anon-delete|$ARTICLE$|$USERNAME$}} ~~~~"}}},wikiProject:{"WikiProject-specific welcome templates":{"welcome-anatomy":{description:"welcome for users with an apparent interest in anatomy topics",syntax:"{{subst:welcome-anatomy}} ~~~~"},"welcome-athletics":{description:"welcome for users with an apparent interest in athletics (track and field) topics",syntax:"{{subst:welcome-athletics}}"},"welcome-au":{description:"welcome for users with an apparent interest in Australia topics",syntax:"{{subst:welcome-au}} ~~~~"},"welcome-bd":{description:"welcome for users with an apparent interest in Bangladesh topics",linkedArticle:!0,syntax:"{{subst:welcome-bd|$USERNAME$||$EXTRA$|art=$ARTICLE$}} ~~~~"},"welcome-bio":{description:"welcome for users with an apparent interest in biographical topics",syntax:"{{subst:welcome-bio}} ~~~~"},"welcome-cal":{description:"welcome for users with an apparent interest in California topics",syntax:"{{subst:welcome-cal}} ~~~~"},"welcome-conserv":{description:"welcome for users with an apparent interest in conservatism topics",syntax:"{{subst:welcome-conserv}}"},"welcome-cycling":{description:"welcome for users with an apparent interest in cycling topics",syntax:"{{subst:welcome-cycling}} ~~~~"},"welcome-dbz":{description:"welcome for users with an apparent interest in Dragon Ball topics",syntax:"{{subst:welcome-dbz|$EXTRA$|sig=~~~~}}"},"welcome-et":{description:"welcome for users with an apparent interest in Estonia topics",syntax:"{{subst:welcome-et}}"},"welcome-de":{description:"welcome for users with an apparent interest in Germany topics",syntax:"{{subst:welcome-de}} ~~~~"},"welcome-in":{description:"welcome for users with an apparent interest in India topics",linkedArticle:!0,syntax:"{{subst:welcome-in|$USERNAME$|art=$ARTICLE$}} ~~~~"},"welcome-math":{description:"welcome for users with an apparent interest in mathematical topics",linkedArticle:!0,syntax:"{{subst:welcome-math|$USERNAME$|art=$ARTICLE$}} ~~~~"},"welcome-med":{description:"welcome for users with an apparent interest in medicine topics",linkedArticle:!0,syntax:"{{subst:welcome-med|$USERNAME$|art=$ARTICLE$}} ~~~~"},"welcome-no":{description:"welcome for users with an apparent interest in Norway topics",syntax:"{{subst:welcome-no}} ~~~~"},"welcome-pk":{description:"welcome for users with an apparent interest in Pakistan topics",linkedArticle:!0,syntax:"{{subst:welcome-pk|$USERNAME$|art=$ARTICLE$}} ~~~~"},"welcome-phys":{description:"welcome for users with an apparent interest in physics topics",linkedArticle:!0,syntax:"{{subst:welcome-phys|$USERNAME$|art=$ARTICLE$}} ~~~~"},"welcome-pl":{description:"welcome for users with an apparent interest in Poland topics",syntax:"{{subst:welcome-pl}} ~~~~"},"welcome-rugbyunion":{description:"welcome for users with an apparent interest in rugby union topics",syntax:"{{subst:welcome-rugbyunion}} ~~~~"},"welcome-ru":{description:"welcome for users with an apparent interest in Russia topics",syntax:"{{subst:welcome-ru}} ~~~~"},"welcome-starwars":{description:"welcome for users with an apparent interest in Star Wars topics",syntax:"{{subst:welcome-starwars}} ~~~~"},"welcome-ch":{description:"welcome for users with an apparent interest in Switzerland topics",linkedArticle:!0,syntax:"{{subst:welcome-ch|$USERNAME$|art=$ARTICLE$}} ~~~~"},"welcome-uk":{description:"welcome for users with an apparent interest in Ukraine topics",syntax:"{{subst:welcome-uk}} ~~~~"},"welcome-roads":{description:"welcome for users with an apparent interest in roads and highways topics",syntax:"{{subst:welcome-roads}}"},"welcome-videogames":{description:"welcome for users with an apparent interest in video game topics",syntax:"{{subst:welcome-videogames}}"},"TWA invite":{description:"invite the user to The Wikipedia Adventure (not a welcome template)",syntax:"{{WP:TWA/InviteTW|signature=~~~~}}"}}},nonEnglish:{"Non-English welcome templates":{welcomeen:{description:"welcome for users whose first language is not listed here",syntax:"{{subst:welcomeen}}"},"welcomeen-ar":{description:"welcome for users whose first language appears to be Arabic",syntax:"{{subst:welcomeen-ar}}"},"welcomeen-sq":{description:"welcome for users whose first language appears to be Albanian",syntax:"{{subst:welcomeen-sq}}"},"welcomeen-zh":{description:"welcome for users whose first language appears to be Chinese",syntax:"{{subst:welcomeen-zh}}"},"welcomeen-nl":{description:"welcome for users whose first language appears to be Dutch",syntax:"{{subst:welcomeen-nl}}"},"welcomeen-fi":{description:"welcome for users whose first language appears to be Finnish",syntax:"{{subst:welcomeen-fi}}"},"welcomeen-fr":{description:"welcome for users whose first language appears to be French",syntax:"{{subst:welcomeen-fr}}"},"welcomeen-de":{description:"welcome for users whose first language appears to be German",syntax:"{{subst:welcomeen-de}}"},"welcomeen-he":{description:"welcome for users whose first language appears to be Hebrew",syntax:"{{subst:welcomeen-he}}"},"welcomeen-ja":{description:"welcome for users whose first language appears to be Japanese",syntax:"{{subst:welcomeen-ja}}"},"welcomeen-ko":{description:"welcome for users whose first language appears to be Korean",syntax:"{{subst:welcomeen-ko}}"},"welcomeen-ml":{description:"welcome for users whose first language appears to be Malayalam",syntax:"{{subst:welcomeen-ml}}"},"welcomeen-mr":{description:"welcome for users whose first language appears to be Marathi",syntax:"{{subst:welcomeen-mr}}"},"welcomeen-or":{description:"welcome for users whose first language appears to be Oriya (Odia)",syntax:"{{subst:welcomeen-or}}"},"welcomeen-pt":{description:"welcome for users whose first language appears to be Portuguese",syntax:"{{subst:welcomeen-pt}}"},"welcomeen-ro":{description:"welcome for users whose first language appears to be Romanian",syntax:"{{subst:welcomeen-ro}}"},"welcomeen-ru":{description:"welcome for users whose first language appears to be Russian",syntax:"{{subst:welcomeen-ru}}"},"welcomeen-es":{description:"welcome for users whose first language appears to be Spanish",syntax:"{{subst:welcomeen-es}}"},"welcomeen-sv":{description:"welcome for users whose first language appears to be Swedish",syntax:"{{subst:welcomeen-sv}}"},"welcomeen-uk":{description:"welcome for users whose first language appears to be Ukrainian",syntax:"{{subst:welcomeen-uk}}"}}}},t.callbacks={preview:function(e){var a=new Morebits.simpleWindow(750,400);a.setTitle("Welcome template preview"),a.setScriptName("Welcome user"),a.setModality(!0);var i=document.createElement("div");i.style.marginLeft=i.style.marginRight="0.5em",i.style.fontSize="small",a.setContent(i);var o=new Morebits.wiki.preview(i),n=Morebits.quickForm.getInputData(e);o.beginRender(t.getTemplateWikitext(n.type,n.template,n.article),"User talk:"+mw.config.get("wgRelevantUserName"));var r=document.createElement("input");r.setAttribute("type","submit"),r.setAttribute("value","Close"),a.addContent(r),a.display(),$(r).click((function(){a.close()}))},main:function(e){var a=e.getCallbackParameters(),i=e.getPageText();if(e.exists()&&"auto"===a.mode)return Morebits.status.info("Warning","User talk page not empty; aborting automatic welcome"),void Morebits.wiki.actionCompleted.event();var o=t.getTemplateWikitext(a.type,a.template,a.article);V("topWelcomes")?i=o+"\n\n"+i:i+="\n"+o;e.setPageText(i),e.setEditSummary("Welcome to Wikipedia!"),e.setChangeTags(g.changeTags),e.setWatchlist(V("watchWelcomes")),e.setCreateOption("recreate"),e.save()}},t}(K),qe=function(e){function t(){var a=e.call(this)||this;return a.moduleName="shared",mw.config.get("wgNamespaceNumber")===m&&mw.util.isIPAddress(mw.config.get("wgTitle"))&&H((function(){t.callback()}),"Shared IP","twinkle-shared","Shared IP tagging"),a}return ee(t,e),t.callback=function(){var e=new Morebits.simpleWindow(600,450);e.setTitle("Shared IP address tagging"),e.setScriptName("Twinkle"),e.addFooterLink("Shared prefs","WP:TW/PREF#shared"),e.addFooterLink("Twinkle help","WP:TW/DOC#shared"),e.addFooterLink("Give feedback","WT:TW");var a=new Morebits.quickForm(t.evaluate),i=a.append({type:"div",id:"sharedip-templatelist",className:"morebits-scrollbox"});i.append({type:"header",label:"Shared IP address templates"}),i.append({type:"radio",name:"template",list:t.standardList,event:function(e){t.change_shared(e),e.stopPropagation()}});var o=a.append({type:"field",label:'Fill in other details (optional) and click "Submit"'});o.append({type:"input",name:"organization",label:"IP address owner/operator",disabled:!0,tooltip:"You can optionally enter the name of the organization that owns/operates the IP address. You can use wikimarkup if necessary."}),o.append({type:"input",name:"host",label:"Host name (optional)",disabled:!0,tooltip:"The host name (for example, proxy.example.com) can be optionally entered here and will be linked by the template."}),o.append({type:"input",name:"contact",label:"Contact information (only if requested)",disabled:!0,tooltip:"You can optionally enter some contact details for the organization. Use this parameter only if the organization has specifically requested that it be added. You can use wikimarkup if necessary."});var n=document.createElement("a");$(n).click((function(){t.preview(r)})),n.style.cursor="pointer",n.textContent="Preview",a.append({type:"div",id:"sharedpreview",label:[n]}),a.append({type:"submit"});var r=a.render();e.setContent(r),e.display()},t.change_shared=function(e){e.target.form.contact.disabled="Shared IP edu"!==e.target.value,e.target.form.organization.disabled=!1,e.target.form.host.disabled="Whois"===e.target.value},t.preview=function(e){var a=Morebits.quickForm.getInputData(e);if(a.template){var i=new Morebits.simpleWindow(700,500);i.setTitle("Shared IP template preview"),i.setScriptName("Add Shared IP template"),i.setModality(!0);var o=document.createElement("div");o.style.marginLeft=o.style.marginRight="0.5em",o.style.fontSize="small",i.setContent(o),new Morebits.wiki.preview(o).beginRender(t.getTemplateWikitext(a),mw.config.get("wgPageName"));var n=document.createElement("input");n.setAttribute("type","submit"),n.setAttribute("value","Close"),i.addContent(n),i.display(),$(n).click((function(){i.close()}))}},t.getTemplateWikitext=function(e){var t="{{"+e.template+"|"+e.organization;return e.contact&&(t+="|"+e.contact),e.host&&(t+="|host="+e.host),t+="}}\n\n"},t.evaluate=function(e){var a=Morebits.quickForm.getInputData(e.target);if(a.template)if(a.organization){Morebits.simpleWindow.setButtonsEnabled(!1),Morebits.status.init(e.target),Morebits.wiki.actionCompleted.redirect=mw.config.get("wgPageName"),Morebits.wiki.actionCompleted.notice="Tagging complete, reloading talk page in a few seconds";var i=new Morebits.wiki.page(mw.config.get("wgPageName"),"User talk page modification");i.setFollowRedirect(!0),i.setCallbackParameters(a),i.load(t.callbacks.main)}else alert("You must input an organization for the {{"+a.template+"}} template!");else alert("You must select a shared IP address template to use!")},t.moduleName="shared",t.standardList=[{label:"{{Shared IP}}: standard shared IP address template",value:"Shared IP",tooltip:"IP user talk page template that shows helpful information to IP users and those wishing to warn, block or ban them"},{label:"{{Shared IP edu}}: shared IP address template modified for educational institutions",value:"Shared IP edu"},{label:"{{Shared IP corp}}: shared IP address template modified for businesses",value:"Shared IP corp"},{label:"{{Shared IP public}}: shared IP address template modified for public terminals",value:"Shared IP public"},{label:"{{Shared IP gov}}: shared IP address template modified for government agencies or facilities",value:"Shared IP gov"},{label:"{{Dynamic IP}}: shared IP address template modified for organizations with dynamic addressing",value:"Dynamic IP"},{label:"{{Static IP}}: shared IP address template modified for static IP addresses",value:"Static IP"},{label:"{{ISP}}: shared IP address template modified for ISP organizations (specifically proxies)",value:"ISP"},{label:"{{Mobile IP}}: shared IP address template modified for mobile phone companies and their customers",value:"Mobile IP"},{label:"{{Whois}}: template for IP addresses in need of monitoring, but unknown whether static, dynamic or shared",value:"Whois"}],t.callbacks={main:function(e){for(var a=e.getCallbackParameters(),i=e.getPageText(),o=!1,n=0;n<t.standardList.length;n++){new RegExp("(\\{\\{"+t.standardList[n].value+"(\\||\\}\\}))","im").exec(i)&&(Morebits.status.warn("Info","Found {{"+t.standardList[n].value+"}} on the user's talk page already...aborting"),o=!0)}if(!o){Morebits.status.info("Info","Will add the shared IP address template to the top of the user's talk page.");var r=t.getTemplateWikitext(a),s="Added {{[[Template:"+a.template+"|"+a.template+"]]}} template.";e.setPageText(r+i),e.setEditSummary(s),e.setChangeTags(g.changeTags),e.setMinorEdit(V("markSharedIPAsMinor")),e.setCreateOption("recreate"),e.save()}}},t}(K),Ge=function(e){function t(){var a=e.call(this)||this;return a.moduleName="talkback",!mw.config.exists("wgRelevantUserName")||Morebits.ip.isRange(mw.config.get("wgRelevantUserName"))||H(t.callback,"TB","friendly-talkback","Easy talkback"),a}return ee(t,e),t.callback=function(){if(mw.config.get("wgRelevantUserName")!==mw.config.get("wgUserName")||confirm("Is it really so bad that you're talking back to yourself?")){var e=new Morebits.simpleWindow(600,350);e.setTitle("Talkback"),e.setScriptName("Twinkle"),e.addFooterLink("Talkback prefs","WP:TW/PREF#talkback"),e.addFooterLink("Twinkle help","WP:TW/DOC#talkback"),e.addFooterLink("Give feedback","WT:TW");var a=new Morebits.quickForm(t.evaluate);a.append({type:"radio",name:"tbtarget",list:[{label:"Talkback",value:"talkback",checked:!0},{label:"Please see",value:"see"},{label:"Noticeboard notification",value:"notice"},{label:"You've got mail",value:"mail"}],event:t.changeTarget}),a.append({type:"field",label:"Work area",name:"work_area"});var i=document.createElement("a");$(i).click((function(){t.callbacks.preview(o)})),i.style.cursor="pointer",i.textContent="Preview",a.append({type:"div",id:"talkbackpreview",label:[i]}),a.append({type:"div",id:"friendlytalkback-previewbox",style:"display: none"}),a.append({type:"submit"});var o=a.render();e.setContent(o),e.display(),o.previewer=new Morebits.wiki.preview($(o).find("div#friendlytalkback-previewbox").last()[0]);var n=document.createEvent("Event");n.initEvent("change",!0,!0),o.tbtarget[0].dispatchEvent(n);var r=new Morebits.wiki.user(mw.config.get("wgRelevantUserName"),"Fetching talkback opt-out status");r.setNotifySkips("userjs.invalid/noTalkback",le),r.load(t.optoutStatus)}},t.optoutStatus=function(e){var a=e.getTalkTemplates();if(a&&a.length)t.optout=mw.config.get("wgRelevantUserName")+" transcludes {{"+a[0]+"}}, so a talkack might not be helpful";else{var i=e.getTalkLinks();if(i&&i.length){t.optout=mw.config.get("wgRelevantUserName")+" prefers not to receive talkbacks";var o=i[0].url,n=mw.util.getParamValue("reason",o);t.optout+=n?": "+n:"."}}$("#twinkle-talkback-optout-message").text(t.optout)},t.changeTarget=function(e){var a=e.target.values,i=e.target.form,o=Morebits.quickForm.getElements(i,"work_area")[0];i.section&&(t.prev_section=i.section.value),i.message&&(t.prev_message=i.message.value),i.page&&(t.prev_page=i.page.value);var n=new Morebits.quickForm.element({type:"field",label:"Talkback information",name:"work_area"});switch(i.previewer.closePreview(),a){case"talkback":default:n.append({type:"div",label:"",style:"color: red",id:"twinkle-talkback-optout-message"}),n.append({type:"input",name:"page",label:"Page name of the discussion",tooltip:"The page name where the discussion is being held. For example: 'User talk:Jimbo Wales' or Wikipedia talk:Twinkle'. Limited to all talks, Wikipedia-space, and Template-space.",value:t.prev_page||"User talk:"+mw.config.get("wgUserName")}),n.append({type:"input",name:"section",label:"Linked section (optional)",tooltip:"The section heading where the discussion is being held. For example: 'Merge proposal'.",value:t.prev_section});break;case"notice":var r=n.append({type:"select",name:"noticeboard",label:"Noticeboard:",event:function(e){"afchd"===e.target.value?(Morebits.quickForm.overrideElementLabel(i.section,"Title of draft (excluding the prefix): "),Morebits.quickForm.setElementTooltipVisibility(i.section,!1)):(Morebits.quickForm.resetElementLabel(i.section),Morebits.quickForm.setElementTooltipVisibility(i.section,!0))}});$.each(t.noticeboards,(function(e,t){r.append({type:"option",label:t.label,value:e,selected:!!t.defaultSelected})})),n.append({type:"input",name:"section",label:"Linked thread",tooltip:"The heading of the relevant thread on the noticeboard page.",value:t.prev_section});break;case"mail":n.append({type:"input",name:"section",label:"Subject of email (optional)",tooltip:"The subject line of the email you sent."})}"notice"!==a&&n.append({type:"textarea",label:"Additional message (optional):",name:"message",tooltip:"An additional message that you would like to leave below the talkback template. Your signature will be added to the end of the message if you leave one."}),n=n.render(),i.replaceChild(n,o),i.message&&(i.message.value=t.prev_message),$("#twinkle-talkback-optout-message").text(t.optout)},t.evaluate=function(e){var a=Morebits.quickForm.getInputData(e.target),i=new mw.Title(mw.config.get("wgRelevantUserName"),3).toText(),o=new Morebits.wiki.page(i,"Adding talkback");switch(Morebits.simpleWindow.setButtonsEnabled(!1),Morebits.status.init(e.target),Morebits.wiki.actionCompleted.redirect=i,Morebits.wiki.actionCompleted.notice="Talkback complete; reloading talk page in a few seconds",a.tbtarget){case"notice":o.setEditSummary(t.noticeboards[a.noticeboard].editSummary);break;case"mail":o.setEditSummary("Notification: You've got mail");break;case"see":a.page=t.callbacks.normalizeTalkbackPage(a.page),o.setEditSummary("Please check the discussion at [[:"+a.page+(a.section?"#"+a.section:"")+"]]");break;default:a.page=t.callbacks.normalizeTalkbackPage(a.page),o.setEditSummary("Talkback ([[:"+a.page+(a.section?"#"+a.section:"")+"]])")}o.setAppendText("\n\n"+t.callbacks.getNoticeWikitext(a)),o.setChangeTags(g.changeTags),o.setCreateOption("recreate"),o.setMinorEdit(V("markTalkbackAsMinor")),o.setFollowRedirect(!0),o.append()},t.moduleName="talkback",t.optout="",t.prev_page="",t.prev_section="",t.prev_message="",t.noticeboards={an:{label:"WP:AN (Administrators' noticeboard)",text:"{{subst:AN-notice|thread=$SECTION}} ~~~~",editSummary:"Notice of discussion at [[Wikipedia:Administrators' noticeboard]]"},an3:{label:"WP:AN3 (Administrators' noticeboard/Edit warring)",text:"{{subst:An3-notice|$SECTION}} ~~~~",editSummary:"Notice of discussion at [[Wikipedia:Administrators' noticeboard/Edit warring]]"},ani:{label:"WP:ANI (Administrators' noticeboard/Incidents)",text:"== Notice of Administrators' noticeboard/Incidents discussion ==\n{{subst:ANI-notice|thread=$SECTION}} ~~~~",editSummary:"Notice of discussion at [[Wikipedia:Administrators' noticeboard/Incidents]]",defaultSelected:!0},afchd:{label:"WP:AFCHD (Articles for creation/Help desk)",text:"{{subst:AFCHD/u|$SECTION}} ~~~~",editSummary:"You have replies at the [[Wikipedia:AFCHD|Articles for Creation Help Desk]]"},blpn:{label:"WP:BLPN (Biographies of living persons noticeboard)",text:"{{subst:BLPN-notice|thread=$SECTION}} ~~~~",editSummary:"Notice of discussion at [[Wikipedia:Biographies of living persons/Noticeboard]]"},coin:{label:"WP:COIN (Conflict of interest noticeboard)",text:"{{subst:Coin-notice|thread=$SECTION}} ~~~~",editSummary:"Notice of discussion at [[Wikipedia:Conflict of interest/Noticeboard]]"},drn:{label:"WP:DRN (Dispute resolution noticeboard)",text:"{{subst:DRN-notice|thread=$SECTION}} ~~~~",editSummary:"Notice of discussion at [[Wikipedia:Dispute resolution noticeboard]]"},effp:{label:"WP:EFFP/R (Edit filter false positive report)",text:"{{EFFPReply|1=$SECTION|2=~~~~}}",editSummary:"You have replies to your [[Wikipedia:Edit filter/False positives/Reports|edit filter false positive report]]"},eln:{label:"WP:ELN (External links noticeboard)",text:"{{subst:ELN-notice|thread=$SECTION}} ~~~~",editSummary:"Notice of discussion at [[Wikipedia:External links/Noticeboard]]"},ftn:{label:"WP:FTN (Fringe theories noticeboard)",text:"{{subst:Ftn-notice|thread=$SECTION}} ~~~~",editSummary:"Notice of discussion at [[Wikipedia:Fringe theories/Noticeboard]]"},hd:{label:"WP:HD (Help desk)",text:"== Your question at the Help desk ==\n{{helpdeskreply|1=$SECTION|ts=~~~~~}}",editSummary:"You have replies at the [[Wikipedia:Help desk|Wikipedia help desk]]"},norn:{label:"WP:NORN (Reliable sources noticeboard)",text:"{{subst:Norn-notice|thread=$SECTION}} ~~~~",editSummary:"Notice of discussion at [[Wikipedia:Reliable sources/Noticeboard]]"},npovn:{label:"WP:NPOVN (Neutral point of view noticeboard)",text:"{{subst:NPOVN-notice|thread=$SECTION}} ~~~~",editSummary:"Notice of discussion at [[Wikipedia:Neutral point of view/Noticeboard]]"},rsn:{label:"WP:RSN (Reliable sources noticeboard)",text:"{{subst:RSN-notice|thread=$SECTION}} ~~~~",editSummary:"Notice of discussion at [[Wikipedia:Reliable sources/Noticeboard]]"},th:{label:"WP:THQ (Teahouse question forum)",text:"== Teahouse talkback: you've got messages! ==\n{{WP:Teahouse/Teahouse talkback|WP:Teahouse/Questions|$SECTION|ts=~~~~}}",editSummary:"You have replies at the [[Wikipedia:Teahouse/Questions|Teahouse question board]]"},otrs:{label:"WP:OTRS/N (OTRS noticeboard)",text:"{{OTRSreply|1=$SECTION|2=~~~~}}",editSummary:"You have replies at the [[Wikipedia:OTRS noticeboard|OTRS noticeboard]]"}},t.callbacks={normalizeTalkbackPage:function(e){e=e||mw.config.get("wgUserName");var t=mw.Title.newFromText(e,3);return t&&(4!==t.namespace&&10!==t.namespace&&(t=t.getTalkPage()),e=t.getPrefixedText()),e},preview:function(e){var a=Morebits.quickForm.getInputData(e);"talkback"!==a.tbtarget&&"see"!==a.tbtarget||(a.page=t.callbacks.normalizeTalkbackPage(a.page));var i=t.callbacks.getNoticeWikitext(a);e.previewer.beginRender(i,"User talk:"+mw.config.get("wgRelevantUserName"))},getNoticeWikitext:function(e){var a;switch(e.tbtarget){case"notice":a=Morebits.string.safeReplace(t.noticeboards[e.noticeboard].text,"$SECTION",e.section);break;case"mail":a="=="+V("mailHeading")+"==\n{{You've got mail|subject="+e.section+"|ts=~~~~~}}",e.message?a+="\n"+e.message+" ~~~~":V("insertTalkbackSignature")&&(a+="\n~~~~");break;case"see":var i=V("talkbackHeading").replace(/^\s*=+\s*(.*?)\s*=+$\s*/,"$1");a="{{subst:Please see|location="+e.page+(e.section?"#"+e.section:"")+"|more="+e.message+"|heading="+i+"}}";break;default:a="=="+V("talkbackHeading").replace(/^\s*=+\s*(.*?)\s*=+$\s*/,"$1")+"==\n{{talkback|"+e.page+(e.section?"|"+e.section:"")+"|ts=~~~~~}}",e.message?a+="\n"+e.message+" ~~~~":V("insertTalkbackSignature")&&(a+="\n~~~~")}return a}},t}(K),Be=function(e){function t(){var a=e.call(this)||this;a.moduleName="arv";var i=mw.config.get("wgRelevantUserName");if(!i||i===mw.config.get("wgUserName"))return a;var o=mw.util.isIPAddress(i,!0);return Morebits.ip.isRange(i)&&!Morebits.ip.validCIDR(i)||H((function(){t.callback(i,o)}),"ARV","tw-arv","Report "+(o?"IP"+(Morebits.ip.isRange(i)?" range":""):"user")+" to administrators"),a}return ee(t,e),t.callback=function(e,a){var i=new Morebits.simpleWindow(600,500);i.setTitle("Advance Reporting and Vetting"),i.setScriptName("Twinkle"),i.addFooterLink("AIV guide","WP:GAIV"),i.addFooterLink("UAA guide","WP:UAAI"),i.addFooterLink("SPI guide","Wikipedia:Sockpuppet investigations/SPI/Guide to filing cases"),i.addFooterLink("ARV prefs","WP:TW/PREF#arv"),i.addFooterLink("Twinkle help","WP:TW/DOC#arv"),i.addFooterLink("Give feedback","WT:TW");var o=new Morebits.quickForm(t.evaluate),n=o.append({type:"select",name:"category",label:"Select report type: ",event:t.changeCategory});n.append({type:"option",label:"Vandalism (WP:AIV)",value:"aiv"}),n.append({type:"option",label:"Username (WP:UAA)",value:"username",disabled:a}),n.append({type:"option",label:"Sockpuppeteer (WP:SPI)",value:"sock"}),n.append({type:"option",label:"Sockpuppet (WP:SPI)",value:"puppet"}),n.append({type:"option",label:"Edit warring (WP:AN3)",value:"an3",disabled:Morebits.ip.isRange(e)}),o.append({type:"div",label:"",style:"color: red",id:"twinkle-arv-blockwarning"}),o.append({type:"field",label:"Work area",name:"work_area"}),o.append({type:"submit"}),o.append({type:"hidden",name:"uid",value:e});var r=o.render();i.setContent(r),i.display(),new Morebits.wiki.user(e,"Checking the user's block status").load((function(e){if(e.isBlocked()){var t=(a?"This IP "+(e.isIPRange()?"range":"address"):"This account")+" is "+(e.getPartial()?"partially":"already")+" blocked";t+=e.isRangeBlocked()?" as part of a rangeblock.":".",e.getPartial()&&$("#twinkle-arv-blockwarning").css("color","black"),$("#twinkle-arv-blockwarning").text(t)}}));var s=document.createEvent("Event");s.initEvent("change",!0,!0),r.category.dispatchEvent(s)},t.changeCategory=function(e){var t=e.target.value,a=e.target.form,i=Morebits.quickForm.getElements(a,"work_area")[0],o=null;switch(t){case"aiv":default:(o=new Morebits.quickForm.element({type:"field",label:"Report user for vandalism",name:"work_area"})).append({type:"input",name:"page",label:"Primary linked page: ",tooltip:"Leave blank to not link to the page in the report",value:mw.util.getParamValue("vanarticle")||"",event:function(e){var t=e.target.value,a=e.target.form;""===t?a.badid.disabled=a.goodid.disabled=!0:(a.badid.disabled=!1,a.goodid.disabled=""===a.badid.value)}}),o.append({type:"input",name:"badid",label:"Revision ID for target page when vandalised: ",tooltip:"Leave blank for no diff link",value:mw.util.getParamValue("vanarticlerevid")||"",disabled:!mw.util.getParamValue("vanarticle"),event:function(e){var t=e.target.value;e.target.form.goodid.disabled=""===t}}),o.append({type:"input",name:"goodid",label:"Last good revision ID before vandalism of target page: ",tooltip:"Leave blank for diff link to previous revision",value:mw.util.getParamValue("vanarticlegoodrevid")||"",disabled:!mw.util.getParamValue("vanarticle")||mw.util.getParamValue("vanarticlerevid")}),o.append({type:"checkbox",name:"arvtype",list:[{label:"Vandalism after final (level 4 or 4im) warning given",value:"final"},{label:"Vandalism after recent (within 1 day) release of block",value:"postblock"},{label:"Evidently a vandalism-only account",value:"vandalonly",disabled:mw.util.isIPAddress(a.uid.value,!0)},{label:"Account is a promotion-only account",value:"promoonly",disabled:mw.util.isIPAddress(a.uid.value,!0)},{label:"Account is evidently a spambot or a compromised account",value:"spambot"}]}),o.append({type:"textarea",name:"reason",label:"Comment: "}),o=o.render(),i.parentNode.replaceChild(o,i);break;case"username":(o=new Morebits.quickForm.element({type:"field",label:"Report username violation",name:"work_area"})).append({type:"header",label:"Type(s) of inappropriate username",tooltip:"Wikipedia does not allow usernames that are misleading, promotional, offensive or disruptive. Domain names and email addresses are likewise prohibited. These criteria apply to both usernames and signatures. Usernames that are inappropriate in another language, or that represent an inappropriate name with misspellings and substitutions, or do so indirectly or by implication, are still considered inappropriate."}),o.append({type:"checkbox",name:"arvtype",list:[{label:"Misleading username",value:"misleading",tooltip:"Misleading usernames imply relevant, misleading things about the contributor. For example, misleading points of fact, an impression of undue authority, or usernames giving the impression of a bot account."},{label:"Promotional username",value:"promotional",tooltip:"Promotional usernames are advertisements for a company, website or group. Please do not report these names to UAA unless the user has also made promotional edits related to the name."},{label:"Username that implies shared use",value:"shared",tooltip:'Usernames that imply the likelihood of shared use (names of companies or groups, or the names of posts within organizations) are not permitted. Usernames are acceptable if they contain a company or group name but are clearly intended to denote an individual person, such as "Mark at WidgetsUSA", "Jack Smith at the XY Foundation", "WidgetFan87", etc.'},{label:"Offensive username",value:"offensive",tooltip:"Offensive usernames make harmonious editing difficult or impossible."},{label:"Disruptive username",value:"disruptive",tooltip:"Disruptive usernames include outright trolling or personal attacks, or otherwise show a clear intent to disrupt Wikipedia."}]}),o.append({type:"textarea",name:"reason",label:"Comment:"}),o=o.render(),i.parentNode.replaceChild(o,i);break;case"puppet":(o=new Morebits.quickForm.element({type:"field",label:"Report suspected sockpuppet",name:"work_area"})).append({type:"input",name:"sockmaster",label:"Sockpuppeteer",tooltip:'The username of the sockpuppeteer (sockmaster) without the "User:" prefix'}),o.append({type:"textarea",label:"Evidence:",name:"evidence",tooltip:"Your evidence should make it clear that each of these users is likely to be abusing multiple accounts. Usually this means diffs, page histories or other information that justifies why the users are a) the same and b) disruptive. This should be just evidence and information needed to judge the matter. Avoid all other discussion that is not evidence of sockpuppetry."}),o.append({type:"checkbox",list:[{label:"Request CheckUser",name:"checkuser",tooltip:"CheckUser is a tool used to obtain technical evidence related to a sockpuppetry allegation. It will not be used without good cause, which you must clearly demonstrate. Make sure your evidence explains why using the tool is appropriate. It will not be used to publicly connect user accounts and IP addresses."},{label:"Notify reported users",name:"notify",tooltip:"Notification is not mandatory. In many cases, especially of chronic sockpuppeteers, notification may be counterproductive. However, especially in less egregious cases involving users who have not been reported before, notification may make the cases fairer and also appear to be fairer in the eyes of the accused. Use your judgment."}]}),o=o.render(),i.parentNode.replaceChild(o,i);break;case"sock":(o=new Morebits.quickForm.element({type:"field",label:"Report suspected sockpuppeteer",name:"work_area"})).append({type:"dyninput",name:"sockpuppet",label:"Sockpuppets",sublabel:"Sock: ",tooltip:'The username of the sockpuppet without the "User:" prefix',min:2}),o.append({type:"textarea",label:"Evidence:",name:"evidence",tooltip:"Your evidence should make it clear that each of these users is likely to be abusing multiple accounts. Usually this means diffs, page histories or other information that justifies why the users are a) the same and b) disruptive. This should be just evidence and information needed to judge the matter. Avoid all other discussion that is not evidence of sockpuppetry."}),o.append({type:"checkbox",list:[{label:"Request CheckUser",name:"checkuser",tooltip:"CheckUser is a tool used to obtain technical evidence related to a sockpuppetry allegation. It will not be used without good cause, which you must clearly demonstrate. Make sure your evidence explains why using the tool is appropriate. It will not be used to publicly connect user accounts and IP addresses."},{label:"Notify reported users",name:"notify",tooltip:"Notification is not mandatory. In many cases, especially of chronic sockpuppeteers, notification may be counterproductive. However, especially in less egregious cases involving users who have not been reported before, notification may make the cases fairer and also appear to be fairer in the eyes of the accused. Use your judgment."}]}),o=o.render(),i.parentNode.replaceChild(o,i);break;case"an3":(o=new Morebits.quickForm.element({type:"field",label:"Report edit warring",name:"work_area"})).append({type:"input",name:"page",label:"Page",tooltip:"The page being reported"}),o.append({type:"button",name:"load",label:"Load",event:function(e){var t=e.target.form,a=(new Morebits.date).subtract(48,"hours"),i=function(e,i,o){var n=$(t).find("[name="+e+"]");n.find(".entry").remove(),(new mw.Api).get({action:"query",prop:"revisions",format:"json",rvprop:"sha1|ids|timestamp|parsedcomment|comment",rvlimit:500,rvend:a.toISOString(),rvuser:i,indexpageids:!0,titles:o}).done((function(t){var a=t.query.pageids[0],i=t.query.pages[a];if(i.revisions)for(var o=0;o<i.revisions.length;++o){var r=i.revisions[o],s=$("<div/>",{class:"entry"}),l=$("<input/>",{type:"checkbox",name:"s_"+e,value:r.revid});l.data("revinfo",r),l.appendTo(s);var c="<span>";"string"==typeof r.commenthidden?c+="(comment hidden)":c+='"'+r.parsedcomment+'"',c+=' at <a href="'+mw.config.get("wgScript")+"?diff="+r.revid+'">'+new Morebits.date(r.timestamp).calendar()+"</a></span>",s.append(c).appendTo(n)}else $('<span class="entry">None found</span>').appendTo(n);if("resolves"===e){var d=$("<div/>",{class:"entry"}),p=$("<input/>",{type:"text",name:"s_resolves_free"}),u=$("<label/>",{for:"s_resolves_free",html:"URL link of diff with additional discussions: "});d.append(u).append(p).appendTo(n)}})).fail((function(){$('<span class="entry">API failure, reload page and try again</span>').appendTo(n)}))},o=t.uid.value;i("warnings",mw.config.get("wgUserName"),"User talk:"+o);var n=t.page.value;if(n){i("diffs",o,n);var r=new mw.Title(n).getTalkPage().getPrefixedText();i("resolves",mw.config.get("wgUserName"),r)}else $(t).find("[name=diffs]").find(".entry").remove(),$(t).find("[name=resolves]").find(".entry").remove()}}),o.append({type:"field",name:"diffs",label:"User's reverts",tooltip:"Select the edits you believe are reverts"}),o.append({type:"field",name:"warnings",label:"Warnings given to subject",tooltip:"You must have warned the subject before reporting"}),o.append({type:"field",name:"resolves",label:"Resolution initiatives",tooltip:"You should have tried to resolve the issue on the talk page first"}),o.append({type:"textarea",label:"Comment:",name:"comment"}),o=o.render(),i.parentNode.replaceChild(o,i)}},t.evaluate=function(e){var a=e.target,i="",o="";a.reason&&(o=a.reason.value);var n,r=a.uid.value;switch(a.category.value){case"aiv":default:if(!(n=a.getChecked("arvtype")).length&&""===o)return void alert("You must specify some reason");n=n.map((function(e){switch(e){case"final":return"vandalism after final warning";case"postblock":return"vandalism after recent release of block";case"vandalonly":return"actions evidently indicate a vandalism-only account";case"promoonly":return"account is being used only for promotional purposes";case"spambot":return"account is evidently a spambot or a compromised account";default:return"unknown reason"}})).join("; "),""!==a.page.value&&(i="On {{No redirect|:"+a.page.value+"}}",""!==a.badid.value&&(i+=" ({{diff|"+a.page.value+"|"+a.badid.value+"|"+a.goodid.value+"|diff}})"),i+=":"),n&&(i+=" "+n),""!==o&&(i+=(""===i?"":". ")+o),i=i.trim(),/[.?!;]$/.test(i)||(i+="."),i=(i+=" ~~~~").replace(/\r?\n/g,"\n*:"),Morebits.simpleWindow.setButtonsEnabled(!1),Morebits.status.init(a),Morebits.wiki.actionCompleted.redirect="Wikipedia:Administrator intervention against vandalism",Morebits.wiki.actionCompleted.notice="Reporting complete";var s=new Morebits.wiki.page("Wikipedia:Administrator intervention against vandalism","Processing AIV request");s.setPageSection(1),s.setFollowRedirect(!0),s.load((function(){var e=s.getPageText(),t='<a target="_blank" href="/wiki/WP:AIV?lang=test">WP:AIV</a>';if(new RegExp("\\{\\{\\s*(?:(?:[Ii][Pp])?[Vv]andal|[Uu]serlinks)\\s*\\|\\s*(?:1=)?\\s*"+Morebits.string.escapeRegExp(r)+"\\s*\\}\\}").test(e))return s.getStatusElement().error("Report already present, will not add a new one"),void Morebits.status.printUserText(i,"The comments you typed are provided below, in case you wish to manually post them under the existing report for this user at "+t+":");var a=new Morebits.wiki.page("Wikipedia:Administrator intervention against vandalism/TB2","Checking bot reports");a.load((function(){var e=a.getPageText(),o=a.getStatusElement();if(new RegExp("\\{\\{\\s*(?:(?:[Ii][Pp])?[Vv]andal|[Uu]serlinks)\\s*\\|\\s*(?:1=)?\\s*"+Morebits.string.escapeRegExp(r)+"\\s*\\}\\}").test(e)){if(!confirm("The user "+r+" has already been reported by a bot. Do you wish to make the report anyway?"))return o.error("Report from a bot is already present, stopping"),void Morebits.status.printUserText(i,"The comments you typed are provided below, in case you wish to manually post them at "+t+":");o.info("Proceeded despite bot report")}else o.info("No conflicting bot reports");s.getStatusElement().status("Adding new report..."),s.setEditSummary("Reporting [[Special:Contributions/"+r+"|"+r+"]]."),s.setChangeTags(g.changeTags),s.setAppendText("\n*{{"+(mw.util.isIPAddress(r,!0)?"IPvandal":"vandal")+"|"+(/=/.test(r)?"1=":"")+r+"}} – "+i),s.append()}))}));break;case"username":var l=(n=a.getChecked("arvtype").map(Morebits.string.toLowerCaseFirstChar)).indexOf("shared")>-1;l&&n.splice(n.indexOf("shared"),1),n=n.length<=2?n.join(" and "):[n.slice(0,-1).join(", "),n.slice(-1)].join(" and ");var c="a";/[aeiouwyh]/.test(n[0]||"")&&(c="an"),i="*{{user-uaa|1="+r+"}} – ",(n.length||l)&&(i+="Violation of the username policy as "+c+" "+n+" username"+(l?" that implies shared use. ":". ")),""!==o&&(i+=Morebits.string.toUpperCaseFirstChar(o)+". "),i=(i+="~~~~").replace(/\r?\n/g,"\n*:"),Morebits.simpleWindow.setButtonsEnabled(!1),Morebits.status.init(a),Morebits.wiki.actionCompleted.redirect="Wikipedia:Usernames for administrator attention",Morebits.wiki.actionCompleted.notice="Reporting complete";var d=new Morebits.wiki.page("Wikipedia:Usernames for administrator attention","Processing UAA request");d.setFollowRedirect(!0),d.load((function(){var e=d.getPageText();if(new RegExp("\\{\\{\\s*user-uaa\\s*\\|\\s*(1\\s*=\\s*)?"+Morebits.string.escapeRegExp(r)+"\\s*(\\||\\})").test(e)){d.getStatusElement().error("User is already listed.");Morebits.status.printUserText(i,'The comments you typed are provided below, in case you wish to manually post them under the existing report for this user at <a target="_blank" href="/wiki/WP:UAA?lang=test">WP:UAA</a>:')}else d.getStatusElement().status("Adding new report..."),d.setEditSummary("Reporting [[Special:Contributions/"+r+"|"+r+"]]."),d.setChangeTags(g.changeTags),d.setPageText(e+"\n"+i+"\n*"),d.save()}));break;case"sock":case"puppet":var p={evidence:a.evidence.value.trim(),checkuser:a.checkuser.checked,notify:a.notify.checked},u="puppet"===a.category.value;if(u&&!a.sockmaster.value.trim())return void alert("You have not entered a sockmaster account for this puppet. Consider reporting this account as a sockpuppeteer instead.");if(!u&&!a.sockpuppet[0].value.trim())return void alert("You have not entered any sockpuppet account(s) for this sockmaster. Consider reporting this account as a sockpuppet instead.");p.uid=u?a.sockmaster.value.trim():r,p.sockpuppets=u?[r]:Morebits.array.uniq($.map($("input:text[name=sockpuppet]",a),(function(e){return $(e).val()||null}))),Morebits.simpleWindow.setButtonsEnabled(!1),Morebits.status.init(a),t.processSock(p);break;case"an3":var m=$.map($("input:checkbox[name=s_diffs]:checked",a),(function(e){return $(e).data("revinfo")}));if(m.length<3&&!confirm("You have selected fewer than three offending edits. Do you wish to make the report anyway?"))return;var f=$.map($("input:checkbox[name=s_warnings]:checked",a),(function(e){return $(e).data("revinfo")}));if(!f.length&&!confirm("You have not selected any edits where you warned the offender. Do you wish to make the report anyway?"))return;var h=$.map($("input:checkbox[name=s_resolves]:checked",a),(function(e){return $(e).data("revinfo")})),b=$("input[name=s_resolves_free]").val(),v=function(e){if(h.length||e||confirm("You have not selected any edits where you tried to resolve the issue. Do you wish to make the report anyway?")){var i={uid:r,page:a.page.value.trim(),comment:a.comment.value.trim(),diffs:m,warnings:f,resolves:h,free_resolves:e};Morebits.simpleWindow.setButtonsEnabled(!1),Morebits.status.init(a),t.processAN3(i)}};if(b){var y,w,k,x=/Special:Diff\/(\d+)(?:\/(\S+))?/i.exec(b);x?x[2]?(k=x[1],w=x[2]):w=x[1]:(w=mw.util.getParamValue("diff",b),k=mw.util.getParamValue("oldid",b));var P=mw.util.getParamValue("title",b),T=/^\d+$/.test(w);!k||"cur"!==w&&(P||"next"!==w&&!T)?(y={action:"query",prop:"revisions",rvprop:"ids|timestamp|comment",format:"json",indexpageids:!0},w&&k?"prev"===w?y.revids=k:(y.titles=P,y.rvdir="newer",y.rvstartid=k,"next"===w&&P?y.rvlimit=2:T&&(y.rvendid=w)):w&&/^\D+$/.test(w)?y.titles=P:y.revids=w||k):(y={action:"compare",fromrev:k,prop:"ids|title",format:"json"},T?y.torev=w:y.torelative=w),(new mw.Api).get(y).done((function(e){var t;if(e.compare&&e.compare.fromtitle===e.compare.totitle)t=e;else{if(!e.query)return;var a=e.query.pageids[0];t=e.query.pages[a]}v(t)})).fail((function(e){console.log("API failed :(",e)}))}else v()}},t.processSock=function(e){if(Morebits.wiki.addCheckpoint(),e.notify&&e.sockpuppets.length>0){var t="Notifying about suspicion of sockpuppeteering.",a="\n\n{{subst:socksuspectnotice|1="+e.uid+"}} ~~~~",i=new Morebits.wiki.user(e.uid,"Notifying suspected sockpuppeteer");i.setReason(t),i.setChangeTags(g.changeTags),i.setMessage(a),i.setNotifyBots(!0),i.notify();for(var o=new Morebits.status("Notifying suspected sockpuppets","0%"),n=e.sockpuppets.length,r=0,s=function(e){var t=parseInt(100*++r/n,10)+"%";o.update(t),e.getStatusElement().unlink(),r>=n&&o.info(t+" (completed)")},l=e.sockpuppets,c=0;c<l.length;++c){var d=new Morebits.wiki.user(l[c],"Notification for "+l[c]);d.setReason(t),d.setChangeTags(g.changeTags),d.setMessage(a),d.setNotifyBots(!0),d.notify(s)}}var p="\n\n{{subst:SPI report|socksraw="+e.sockpuppets.map((function(e){return"* {{"+(mw.util.isIPAddress(e,!0)?"checkip":"checkuser")+"|1="+e+"}}"})).join("\n")+"\n|evidence="+e.evidence+" \n";e.checkuser&&(p+="|checkuser=yes"),p+="}}";var u="Wikipedia:Sockpuppet investigations/"+e.uid;Morebits.wiki.actionCompleted.redirect=u,Morebits.wiki.actionCompleted.notice="Reporting complete";var m=new Morebits.wiki.page(u,"Retrieving discussion page");m.setFollowRedirect(!0),m.setEditSummary("Adding new report for [[Special:Contributions/"+e.uid+"|"+e.uid+"]]."),m.setChangeTags(g.changeTags),m.setAppendText(p),m.setWatchlist(V("spiWatchReport")),m.append(),Morebits.wiki.removeCheckpoint()},t.processAN3=function(e){for(var t,a=0;a<e.diffs.length;++a)e.diffs[a].parentid&&(!t||e.diffs[a].parentid<t)&&(t=e.diffs[a].parentid);(new mw.Api).get({action:"query",prop:"revisions",format:"json",rvprop:"sha1|ids|timestamp|comment",rvlimit:100,rvstartid:t,rvexcludeuser:e.uid,indexpageids:!0,titles:e.page}).done((function(t){Morebits.wiki.addCheckpoint();var a,i=function(e){return e.comment||"string"!=typeof e.commenthidden?'"'+e.comment+'"':"(comment hidden)"};if(t.length){for(var o=t[0].sha1,n=1;n<t.length;++n)if(t[n].sha1===o){a=t[n];break}a||(a=t[0])}var r="";a&&(r="{{diff2|"+a.revid+"|"+a.timestamp+"}} "+i(a));for(var s,l,c={},d=0;d<e.diffs.length;++d){var p=e.diffs[d];(p.revid&&p.revid!==s||null===l)&&(c[l=p.revid]=[]),s=p.parentid,c[l].push(p)}var u=$.map(c,(function(e){var t="";if(e.length>=2){var a=e[0],o=e.slice(-1)[0],n="Consecutive edits made from "+new Morebits.date(o.timestamp).format("HH:mm, D MMMM YYYY","utc")+" (UTC) to "+new Morebits.date(a.timestamp).format("HH:mm, D MMMM YYYY","utc")+" (UTC)";t="# {{diff|oldid="+o.parentid+"|diff="+a.revid+"|label="+n+"}}\n"}return t+=e.reverse().map((function(t){return(e.length>=2?"#":"")+"# {{diff2|"+t.revid+"|"+new Morebits.date(t.timestamp).format("HH:mm, D MMMM YYYY","utc")+" (UTC)}} "+i(t)})).join("\n")})).reverse().join("\n"),m=e.warnings.reverse().map((function(e){return"# {{diff2|"+e.revid+"|"+new Morebits.date(e.timestamp).format("HH:mm, D MMMM YYYY","utc")+" (UTC)}} "+i(e)})).join("\n"),f=e.resolves.reverse().map((function(e){return"# {{diff2|"+e.revid+"|"+new Morebits.date(e.timestamp).format("HH:mm, D MMMM YYYY","utc")+" (UTC)}} "+i(e)})).join("\n");if(e.free_resolves){var h=e.free_resolves;if(h.compare)f+="\n# {{diff|oldid="+h.compare.fromrevid+"|diff="+h.compare.torevid+"|label=Consecutive edits on "+h.compare.totitle+"}}";else if(h.revisions){var b,v=h.revisions.length;if(v<3)f+="\n# {{diff2|"+(b=1===v?h.revisions[0]:h.revisions[1]).revid+"|"+new Morebits.date(b.timestamp).format("HH:mm, D MMMM YYYY","utc")+" (UTC) on "+h.title+"}} "+i(b);else{b=h.revisions[0];var y=h.revisions[v-1],w="Consecutive edits made from "+new Morebits.date(b.timestamp).format("HH:mm, D MMMM YYYY","utc")+" (UTC) to "+new Morebits.date(y.timestamp).format("HH:mm, D MMMM YYYY","utc")+" (UTC) on "+h.title;f+="\n# {{diff|oldid="+b.revid+"|diff="+y.revid+"|label="+w+"}}\n"}}}var k=e.comment.replace(/~*$/g,"").trim();k&&(k+=" ~~~~");var x="\n\n{{subst:AN3 report|diffs="+u+"|warnings="+m+"|resolves="+f+"|pagename="+e.page+"|orig="+r+"|comment="+k+"|uid="+e.uid+"}}",P="Wikipedia:Administrators' noticeboard/Edit warring";Morebits.wiki.actionCompleted.redirect=P,Morebits.wiki.actionCompleted.notice="Reporting complete";var T=new Morebits.wiki.page(P,"Retrieving discussion page");T.setFollowRedirect(!0),T.setEditSummary("Adding new report for [[Special:Contributions/"+e.uid+"|"+e.uid+"]]."),T.setChangeTags(g.changeTags),T.setAppendText(x),T.append();var C="\n\n{{subst:an3-notice|1="+mw.util.wikiUrlencode(e.uid)+"|auto=1}} ~~~~",N=new Morebits.wiki.user(e.uid,"Notifying edit warrior");N.setReason("Notifying about edit warring noticeboard discussion."),N.setChangeTags(g.changeTags),N.setMessage(C),N.setNotifyBots(!0),N.notify(),Morebits.wiki.removeCheckpoint()})).fail((function(e){console.log("API failed :(",e)}))},t.moduleName="arv",t}(K),je=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.footerlinks={"Unlink prefs":"WP:TW/PREF#unlink","Twinkle help":"WP:TW/DOC#unlink","Give feedback":"WT:TW"},t}return ee(t,e),t}(function(e){function t(){var t=e.call(this)||this;return t.moduleName="unlink",t.portletId="twinkle-unlink",t.portletName="Unlink",t.portletTooltip="Unlink backlinks",t.isUsable()&&t.addMenu(),t}return n(t,e),t.prototype.isUsable=function(){return mw.config.get("wgNamespaceNumber")>=0&&"Wikipedia:Sandbox"!==mw.config.get("wgPageName")&&(Morebits.userIsInGroup("extendedconfirmed")||Morebits.userIsSysop)},t.prototype.makeWindow=function(e){var t=6===mw.config.get("wgNamespaceNumber"),a=new ae(600,440);a.setTitle(F(t?"unlink-title-file":"unlink-title")),a.setFooterLinks(this.footerlinks);var i=new Morebits.quickForm(this.evaluate.bind(this));i.append({type:"div",style:"margin-bottom: 0.5em;",label:F(t?"unlink-intro-file":"unlink-intro",Morebits.pageNameNorm)}),i.append({type:"input",name:"reason",label:F("reason"),value:e||"",size:60});var o={action:"query",list:["backlinks"],bltitle:mw.config.get("wgPageName"),bllimit:"max",blnamespace:V("unlinkNamespaces"),rawcontinue:!0,format:"json"};t?(o.list.push("imageusage"),$.extend(o,{iutitle:o.bltitle,iulimit:o.bllimit,iunamespace:o.blnamespace})):$.extend(o,{blfilterredir:"nonredirects"});var n=new E(F("fetching-backlinks"),o);n.params={form:i,Window:a,image:t},n.post().then(this.displayBacklinks);var r=document.createElement("div");r.style.padding="15px",Morebits.status.init(r),n.getStatusElement().status(F("loading")),a.setContent(r),a.display()},t.prototype.evaluate=function(e){var t=this,a=e.target,i=Morebits.quickForm.getInputData(a);if(!i.reason)return alert(F("unlink-give-reason"));i.backlinks=i.backlinks||[],i.imageusage=i.imageusage||[];var o=Morebits.array.uniq(i.backlinks.concat(i.imageusage));if(!o.length)return alert("unlink-select-one");Morebits.simpleWindow.setButtonsEnabled(!1),Morebits.status.init(a);var n=new Morebits.batchOperation(i.backlinks.length?i.imageusage.length?F("unlink-status-links-files"):F("unlink-status-links"):F("unlink-status-files"));n.setOption("preserveIndividualStatusLines",!0),n.setPageList(o);var r={reason:i.reason,unlinker:n};n.run((function(e){var a=new te(e,F("unlink-in",e));a.setBotEdit(!0),a.setCallbackParameters($.extend({doBacklinks:-1!==i.backlinks.indexOf(e),doImageusage:-1!==i.imageusage.indexOf(e)},r)),a.load().then((function(){return t.unlinkBacklinks(a)}))}))},t.prototype.displayBacklinks=function(e){var t,a,i,o=e.getResponse(),n=e.params,r=n.form,s=n.Window,l=!1;if(n.image){var c=o.query.imageusage.sort(w);for(t=[],i=0;i<c.length;++i)t.push({label:"",value:c[i].title,checked:!0});t.length?(r.append({type:"header",label:F("file-usage")}),a=[],$.each(V("unlinkNamespaces"),(function(e,t){a.push("0"===t?F("blanknamespace"):mw.config.get("wgFormattedNamespaces")[t])})),r.append({type:"div",label:F("selected-namespaces",a),tooltip:F("change-twpref")}),o["query-continue"]&&o["query-continue"].imageusage&&r.append({type:"div",label:F("first-n-files",t.length)}),r.append({type:"button",label:F("select-all"),event:function(e){$(Morebits.quickForm.getElements(e.target.form,"imageusage")).prop("checked",!0)}}),r.append({type:"button",label:F("deselect-all"),event:function(e){$(Morebits.quickForm.getElements(e.target.form,"imageusage")).prop("checked",!1)}}),r.append({type:"checkbox",name:"imageusage",shiftClickSupport:!0,list:t}),l=!0):r.append({type:"div",label:F("no-file-usage")})}var d=o.query.backlinks.sort(w);if(d.length>0){for(t=[],i=0;i<d.length;++i)t.push({label:"",value:d[i].title,checked:!0});r.append({type:"header",label:F("backlinks")}),a=[],$.each(V("unlinkNamespaces"),(function(e,t){a.push("0"===t?F("blanknamespace"):mw.config.get("wgFormattedNamespaces")[t])})),r.append({type:"div",label:F("selected-namespaces",a),tooltip:F("change-twpref")}),o["query-continue"]&&o["query-continue"].backlinks&&r.append({type:"div",label:F("first-n-links",t.length)}),r.append({type:"button",label:F("select-all"),event:function(e){return $(Morebits.quickForm.getElements(e.target.form,"backlinks")).prop("checked",!0)}}),r.append({type:"button",label:F("deselect-all"),event:function(e){return $(Morebits.quickForm.getElements(e.target.form,"backlinks")).prop("checked",!1)}}),r.append({type:"checkbox",name:"backlinks",shiftClickSupport:!0,list:t}),l=!0}else r.append({type:"div",label:F("no-backlinks")});l&&r.append({type:"submit"});var p=r.render();s.setContent(p),Morebits.quickForm.getElements(p,"backlinks").forEach(x),Morebits.quickForm.getElements(p,"imageusage").forEach(x)},t.prototype.unlinkBacklinks=function(e){var t,a=e.getPageText(),i=e.getCallbackParameters(),o=new Morebits.wikitext.page(a),n={backlink:!1,fileusage:!1};if(i.doImageusage&&((t=o.commentOutImage(mw.config.get("wgTitle"),F("commented-out")).getText())!==a?a=t:n.fileusage=!0),i.doBacklinks&&(t=o.removeLink(Morebits.pageNameNorm).getText())===a&&(n.backlink=!0),n.backlink||n.fileusage)return e.getStatusElement().error(n.backlink?n.fileusage?F("no-links-files-found"):F("no-links-found"):F("no-files-found")),void i.unlinker.workerFailure(e);e.setPageText(t),e.setEditSummary((i.doBacklinks?i.doImageusage?F("summary-links-files",Morebits.pageNameNorm):F("summary-links",Morebits.pageNameNorm):F("summary-files",Morebits.pageNameNorm))+F("colon-separator")+i.reason),e.setCreateOption("nocreate"),e.save().then(i.unlinker.workerSuccess,i.unlinker.workerFailure)},t.moduleName="unlink",t}(K)),Ve=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.footerlinks={"Twinkle help":"WP:TW/DOC#batchundelete","Give feedback":"WT:TW"},t}return ee(t,e),t}(function(e){function t(){var t=e.call(this)||this;return t.moduleName="batchundelete",t.portletName="Und-batch",t.portletId="twinkle-batchundelete",t.portletTooltip="Undelete 'em all",t.windowTitle="Batch undelete",!Morebits.userIsSysop||!mw.config.get("wgArticleId")||mw.config.get("wgNamespaceNumber")!==mw.config.get("wgNamespaceIds").user&&mw.config.get("wgNamespaceNumber")!==mw.config.get("wgNamespaceIds").project||t.addMenu(),t}return n(t,e),t.prototype.makeWindow=function(){var e=new ae(600,400);e.setTitle(this.windowTitle),e.setFooterLinks(this.footerlinks);var t=new Morebits.quickForm(this.evaluate.bind(this));t.append({type:"checkbox",list:[{label:F("undbatch-restore-talks"),name:"undel_talk",value:"undel_talk",checked:!0}]}),t.append({type:"input",name:"reason",label:"Reason: ",size:60});var a=document.createElement("div");a.style.padding="15px",e.setContent(a),Morebits.status.init(a),e.display();var i={action:"query",generator:"links",prop:"info",inprop:"protection",titles:mw.config.get("wgPageName"),gpllimit:V("batchMax"),format:"json"},o=new Morebits.status(F("fetching-list")),n=new E(F("loading"),i);n.setStatusElement(o),n.post().then((function(a){var i=a.getResponse(),o=i.query&&i.query.pages||[];o=o.filter((function(e){return e.missing}));var n=[];o.sort(w),o.forEach((function(e){var t=e.protection.filter((function(e){return"create"===e.type&&"sysop"===e.level})).pop(),a=e.title;n.push({label:a+(t?F("word-separator")+("infinity"===t.expiry?F("create-protected-indef"):F("create-protected",new Morebits.date(t.expiry).calendar("utc"))):""),value:a,checked:!0,style:t?"color:red":""})})),t.append({type:"header",label:F("undbatch-pages-label")}),t.append({type:"button",label:F("select-all"),event:function(e){$(Morebits.quickForm.getElements(e.target.form,"pages")).prop("checked",!0)}}),t.append({type:"button",label:F("deselect-all"),event:function(e){$(Morebits.quickForm.getElements(e.target.form,"pages")).prop("checked",!1)}}),t.append({type:"checkbox",name:"pages",shiftClickSupport:!0,list:n}),t.append({type:"submit"});var r=t.render();e.setContent(r),Morebits.quickForm.getElements(r,"pages").forEach(k)}))},t.prototype.evaluate=function(e){var t=this,a=e.target;Morebits.wiki.actionCompleted.notice=F("undbatch-complete");var i=Morebits.quickForm.getElements(a,"pages").filter((function(e){return e.checked&&"red"===e.nextElementSibling.style.color})).length;if(!(i>0)||confirm(F("undbatch-confirm-protected",i))){var o=Morebits.quickForm.getInputData(a);if(!o.reason)return alert(F("dbatch-give-reason"));if(Morebits.simpleWindow.setButtonsEnabled(!1),Morebits.status.init(a),o.pages&&o.pages.length){var n=new Morebits.batchOperation(F("undeleting"));n.setOption("chunkSize",V("batchChunks")),n.setOption("preserveIndividualStatusLines",!0),n.setPageList(o.pages),n.run((function(e){var a={page:e,undel_talk:o.undel_talk,reason:o.reason,pageUndeleter:n},i=new te(e,F("undeleting-page",e));i.setCallbackParameters(a),i.setEditSummary(o.reason),i.suppressProtectWarning(),i.setMaxRetries(3),i.undeletePage().then(t.doExtras.bind(t),n.workerFailure)}))}else Morebits.status.error(F("error"),F("undbatch-no-pages"))}},t.prototype.doExtras=function(e){var t,a,i=this,o=e.parent?e.parent.getCallbackParameters():e.getCallbackParameters();if(o.pageUndeleter.workerSuccess(e),o.undel_talk){var n=new mw.Title(o.page).getTalkPage().getPrefixedText();n!==o.page&&(t={action:"query",prop:"deletedrevisions",drvprop:"ids",drvlimit:1,titles:n,format:"json"},(a=new E(F("check-talk-deleted"),t)).params=o,a.params.talkPage=n,a.post().then((function(){return i.undeleteTalk(a)})))}},t.prototype.undeleteTalk=function(e){var t=e.getResponse().query.pages[0],a=!t.missing,i=t.deletedrevisions&&t.deletedrevisions[0].revid;if(!a&&i){var o=new te(e.params.talkPage,F("undeleting-talk",e.params.page));o.setEditSummary(F("undeleting-talk-summary",e.params.page)),o.undeletePage()}},t.moduleName="batchundelete",t}(K)),Ye=function(e){function t(){var t=e.call(this)||this;return mw.config.get("wgNamespaceNumber")<0||!mw.config.get("wgArticleId")?t:(H(mw.util.getUrl(mw.config.get("wgPageName"),{diff:"cur",oldid:"prev"}),F("diff-last"),"twinkle-lastdiff",F("diff-last-tooltip")),mw.util.getParamValue("diff")?(H((function(){return t.evaluate(!1)}),F("diff-since"),"tw-since",F("diff-since-tooltip")),H((function(){return t.evaluate(!0)}),F("diff-sincemine"),"tw-sincemine",F("diff-sincemine-tooltip")),H(mw.util.getUrl(mw.config.get("wgPageName"),{diff:"cur",oldid:/oldid=(.+)/.exec($("#mw-diff-ntitle1").find("strong a").first().attr("href"))[1]}),F("diff-current"),"tw-curdiff",F("diff-current-tooltip")),t):t)}return n(t,e),t.prototype.evaluate=function(e){var t;if(e)t=mw.config.get("wgUserName");else{var a=document.getElementById("mw-diff-ntitle2");if(!a)return;t=$(a).find("a").first().text()}Morebits.status.init(document.getElementById("mw-content-text"));var i=new E("Grabbing data of initial contributor",{prop:"revisions",action:"query",titles:mw.config.get("wgPageName"),rvlimit:1,rvprop:["ids","user"],rvstartid:mw.config.get("wgCurRevisionId")-1,rvuser:t,format:"json"});i.post().then((function(e){var a=e.getResponse().query.pages[0].revisions,i=a&&a[0].revid;i?window.location.href=mw.util.getUrl(mw.config.get("wgPageName"),{diff:mw.config.get("wgCurRevisionId"),oldid:i}):e.getStatusElement().error(F("diff-error",t))})),i.post()},t.moduleName="Diff",t}(K);if(!Morebits.userIsInGroup("autoconfirmed")&&!Morebits.userIsInGroup("confirmed"))throw new Error("Twinkle: forbidden!");g.userAgent="Twinkle ([[w:en:WP:TW]])",g.changeTags="twinkle",g.summaryAd=" ([[WP:TW|TW]])",g.messageOverrides=Q,g.extraMwMessages=["restriction-level-extendedconfirmed","restriction-level-templateeditor"],g.registeredModules=[be,Ae,Ee,Ye,We,Se,Ie,$e,Le,Fe,Oe,Be,_e,qe,Ge,je,Ve],s.permalinkSpecialPageName="Special:Permalink",(-1!==mw.config.get("wgNamespaceNumber")||g.activeSpecialPages.includes(mw.config.get("wgCanonicalSpecialPageName")))&&window.top===window.self&&(function(){switch(mw.config.get("skin")){case"vector":j([{name:"portletArea",value:"right-navigation"},{name:"portletId",value:"p-twinkle"},{name:"portletName",value:"TW"},{name:"portletType",value:"menu"},{name:"portletNext",value:"p-search"}]);break;case"timeless":j([{name:"portletArea",value:"#page-tools .sidebar-inner"},{name:"portletId",value:"p-twinkle"},{name:"portletName",value:"Twinkle"},{name:"portletType",value:null},{name:"portletNext",value:"p-userpagetools"}]);break;default:j([{name:"portletArea",value:null},{name:"portletId",value:"p-cactions"},{name:"portletName",value:null},{name:"portletType",value:null},{name:"portletNext",value:null}])}}(),Morebits.l10n.redirectTagAliases=s.redirectTagAliases,"function"==typeof s.signatureTimestampFormat&&(Morebits.l10n.signatureTimestampFormat=s.signatureTimestampFormat),R=new mw.Api({parameters:{action:"query",format:"json",formatversion:"2",uselang:g.language,errorlang:g.language,errorsuselocal:!0,tags:g.changeTags},ajax:{headers:{"Api-User-Agent":g.userAgent}}}),g.preModuleInitHooks.push((function(){return function(){if(W=new(A())(g.language),C(U).forEach((function(e){var t=e[0],a=e[1];W.registerParserPlugin(t,a)})),Morebits.i18n.setParser({get:F}),S="qqx"===g.language)return Promise.resolve();W.load(D,"en");var e=I.concat(g.extraMwMessages);return Promise.all([_(e,g.language),q(g.language)]).catch((function(e){mw.notify("Failed to load messages needed for Twinkle",{type:"error"})})).finally((function(){L(g.messageOverrides)}))}().then((function(){}))}),(function(){return(e=mw.util.wikiScript("index")+"?title=",$.ajax({url:e+"User:"+encodeURIComponent(mw.config.get("wgUserName"))+"/twinkleoptions.js&action=raw&ctype=text/javascript&happy=yes",dataType:"text"}).then((function(e){if(""!==e){0===(e=e.replace(/(?:^(?:\/\/[^\n]*\n)*\n*|(?:\/\/[^\n]*(?:\n|$))*$)/g,"")).lastIndexOf("window.Twinkle.prefs = ",0)&&(e=e.replace(/(?:^window.Twinkle.prefs = |;\n*$)/g,""));try{var t=JSON.parse(e);t&&((O=t.twinkle||t.friendly?$.extend(t.twinkle,t.friendly):t).optionsVersion=O.optionsVersion||1)}catch(e){mw.notify("Could not parse your Twinkle preferences",{type:"error"})}}})).catch((function(){mw.notify("Could not load your Twinkle preferences",{type:"error"})}))).then((function(){return V("dialogLargeFont")&&mw.util.addCSS(".morebits-dialog-content, .morebits-dialog-footerlinks { font-size: 100% !important; } .morebits-dialog input, .morebits-dialog select, .morebits-dialog-content button { font-size: inherit !important; }"),J=J.concat(V("disabledModules"),V("disabledSysopModules")),Promise.all(g.preModuleInitHooksWithConfig.map((function(e){return e()})))}));var e})),Promise.all(g.preModuleInitHooks.map((function(e){return e()}))).then((function(){mw.hook("twinkle.preModuleInit").fire();for(var e=0,t=g.registeredModules;e<t.length;e++)X(t[e]);"vector"===mw.config.get("skin")&&"menu"===V("portletType")&&0===$("#p-twinkle").length&&$("#p-cactions").css("margin-right","initial"),Y.init()})))}},t={};function a(i){var o=t[i];if(void 0!==o)return o.exports;var n=t[i]={exports:{}};return e[i].call(n.exports,n,n.exports,a),n.exports}a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,{a:t}),t},a.d=function(e,t){for(var i in t)a.o(t,i)&&!a.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};a(425)}();
/* </nowiki> */