User:Serhio Magpie/instantDiffs.js

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.
/**
 * Instant Diffs
 *
 * Version: 4.11.5
 * Author: Serhio Magpie
 * Licenses: (MIT OR CC-BY-SA-4.0)
 * Documentation: https://www.mediawiki.org/wiki/Instant_Diffs
 *
 * For license information please see: https://www.mediawiki.org/wiki/User:Serhio_Magpie/instantDiffs.js.LEGAL.txt
 */
 /* <nowiki> */
(()=>{var Xs=Object.create;var ze=Object.defineProperty;var Zs=Object.getOwnPropertyDescriptor;var en=Object.getOwnPropertyNames;var tn=Object.getPrototypeOf,sn=Object.prototype.hasOwnProperty;var _i=t=>e=>{var i=t[e];if(i)return i();throw new Error("Module not found in bundle: "+e)};var v=(t,e)=>()=>(t&&(e=t(t=0)),e);var le=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ie=(t,e)=>{for(var i in e)ze(t,i,{get:e[i],enumerable:!0})},Gi=(t,e,i,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of en(e))!sn.call(t,o)&&o!==i&&ze(t,o,{get:()=>e[o],enumerable:!(s=Zs(e,o))||s.enumerable});return t};var nn=(t,e,i)=>(i=t!=null?Xs(tn(t)):{},Gi(e||!t||!t.__esModule?ze(i,"default",{value:t,enumerable:!0}):i,t)),$t=t=>Gi(ze({},"__esModule",{value:!0}),t);var on,n,C=v(()=>{self.instantDiffs||={};on=self.instantDiffs,n=on});var Qi=le((uo,Ji)=>{Ji.exports=function(e){var i=String.prototype.split,s=/()??/.exec("")[1]===e,o;return o=function(r,u,g){if(Object.prototype.toString.call(u)!=="[object RegExp]")return i.call(r,u,g);var c=[],m=(u.ignoreCase?"i":"")+(u.multiline?"m":"")+(u.extended?"x":"")+(u.sticky?"y":""),y=0,u=new RegExp(u.source,m+"g"),w,b,te,Hi;for(r+="",s||(w=new RegExp("^"+u.source+"$(?!\\s)",m)),g=g===e?-1>>>0:g>>>0;(b=u.exec(r))&&(te=b.index+b[0].length,!(te>y&&(c.push(r.slice(y,b.index)),!s&&b.length>1&&b[0].replace(w,function(){for(var Ge=1;Ge<arguments.length-2;Ge++)arguments[Ge]===e&&(b[Ge]=e)}),b.length>1&&b.index<r.length&&Array.prototype.push.apply(c,b.slice(1)),Hi=b[0].length,y=te,c.length>=g)));)u.lastIndex===b.index&&u.lastIndex++;return y===r.length?(Hi||!u.test(""))&&c.push(""):c.push(r.slice(y)),c.length>g?c.slice(0,g):c},o}()});var Xi=le((ho,Yi)=>{var rn=[].indexOf;Yi.exports=function(t,e){if(rn)return t.indexOf(e);for(var i=0;i<t.length;++i)if(t[i]===e)return i;return-1}});var Et=le((go,Zi)=>{var St=Xi();Zi.exports=an;function an(t){var e=t.classList;if(e)return e;var i={add:s,remove:o,contains:r,toggle:d,toString:g,length:0,item:c};return i;function s(u){var w=m();St(w,u)>-1||(w.push(u),y(w))}function o(u){var w=m(),b=St(w,u);b!==-1&&(w.splice(b,1),y(w))}function r(u){return St(m(),u)>-1}function d(u){return r(u)?(o(u),!1):(s(u),!0)}function g(){return t.className}function c(u){var w=m();return w[u]||null}function m(){var u=t.className;return ln(u.split(" "),cn)}function y(u){var w=u.length;t.className=u.join(" "),i.length=w;for(var b=0;b<u.length;b++)i[b]=u[b];delete u[w]}}function ln(t,e){for(var i=[],s=0;s<t.length;s++)e(t[s])&&i.push(t[s]);return i}function cn(t){return!!t}});var ts=le((po,es)=>{var fn={className:"class",htmlFor:"for"},dn={accept:new Set(["form","input"]),"accept-charset":new Set(["form"]),accesskey:"GLOBAL",action:new Set(["form"]),align:new Set(["applet","caption","col","colgroup","hr","iframe","img","table","tbody","td","tfoot","th","thead","tr"]),alt:new Set(["applet","area","img","input"]),async:new Set(["script"]),autocomplete:new Set(["form","input"]),autofocus:new Set(["button","input","keygen","select","textarea"]),autoplay:new Set(["audio","video"]),autosave:new Set(["input"]),bgcolor:new Set(["body","col","colgroup","marquee","table","tbody","tfoot","td","th","tr"]),border:new Set(["img","object","table"]),buffered:new Set(["audio","video"]),challenge:new Set(["keygen"]),charset:new Set(["meta","script"]),checked:new Set(["command","input"]),cite:new Set(["blockquote","del","ins","q"]),class:"GLOBAL",code:new Set(["applet"]),codebase:new Set(["applet"]),color:new Set(["basefont","font","hr"]),cols:new Set(["textarea"]),colspan:new Set(["td","th"]),content:new Set(["meta"]),contenteditable:"GLOBAL",contextmenu:"GLOBAL",controls:new Set(["audio","video"]),coords:new Set(["area"]),data:new Set(["object"]),datetime:new Set(["del","ins","time"]),default:new Set(["track"]),defer:new Set(["script"]),dir:"GLOBAL",dirname:new Set(["input","textarea"]),disabled:new Set(["button","command","fieldset","input","keygen","optgroup","option","select","textarea"]),download:new Set(["a","area"]),draggable:"GLOBAL",dropzone:"GLOBAL",enctype:new Set(["form"]),for:new Set(["label","output"]),form:new Set(["button","fieldset","input","keygen","label","meter","object","output","progress","select","textarea"]),formaction:new Set(["input","button"]),headers:new Set(["td","th"]),height:new Set(["canvas","embed","iframe","img","input","object","video"]),hidden:"GLOBAL",high:new Set(["meter"]),href:new Set(["a","area","base","link"]),hreflang:new Set(["a","area","link"]),"http-equiv":new Set(["meta"]),icon:new Set(["command"]),id:"GLOBAL",ismap:new Set(["img"]),itemprop:"GLOBAL",keytype:new Set(["keygen"]),kind:new Set(["track"]),label:new Set(["track"]),lang:"GLOBAL",language:new Set(["script"]),list:new Set(["input"]),loop:new Set(["audio","bgsound","marquee","video"]),low:new Set(["meter"]),manifest:new Set(["html"]),max:new Set(["input","meter","progress"]),maxlength:new Set(["input","textarea"]),maxlength:new Set(["input","textarea"]),media:new Set(["a","area","link","source","style"]),method:new Set(["form"]),min:new Set(["input","meter"]),multiple:new Set(["input","select"]),muted:new Set(["video"]),name:new Set(["button","form","fieldset","iframe","input","keygen","object","output","select","textarea","map","meta","param"]),novalidate:new Set(["form"]),open:new Set(["details"]),optimum:new Set(["meter"]),pattern:new Set(["input"]),ping:new Set(["a","area"]),placeholder:new Set(["input","textarea"]),poster:new Set(["video"]),preload:new Set(["audio","video"]),radiogroup:new Set(["command"]),readonly:new Set(["input","textarea"]),rel:new Set(["a","area","link"]),required:new Set(["input","select","textarea"]),reversed:new Set(["ol"]),rows:new Set(["textarea"]),rowspan:new Set(["td","th"]),sandbox:new Set(["iframe"]),scope:new Set(["th"]),scoped:new Set(["style"]),seamless:new Set(["iframe"]),selected:new Set(["option"]),shape:new Set(["a","area"]),size:new Set(["input","select"]),sizes:new Set(["img","link","source"]),span:new Set(["col","colgroup"]),spellcheck:"GLOBAL",src:new Set(["audio","embed","iframe","img","input","script","source","track","video"]),srcdoc:new Set(["iframe"]),srclang:new Set(["track"]),srcset:new Set(["img"]),start:new Set(["ol"]),step:new Set(["input"]),style:"GLOBAL",summary:new Set(["table"]),tabindex:"GLOBAL",target:new Set(["a","area","base","form"]),title:"GLOBAL",type:new Set(["button","input","command","embed","object","script","source","style","menu"]),usemap:new Set(["img","input","object"]),value:new Set(["button","option","input","li","meter","progress","param"]),width:new Set(["canvas","embed","iframe","img","input","object","video"]),wrap:new Set(["textarea"])};function un(t,e){e=e.toLowerCase();var i=dn[t.toLowerCase()];return!!i&&(i==="GLOBAL"||i.has(e))}function hn(t){return fn[t]||t}es.exports={isStandardAttribute:un,propToAttr:hn}});var ls=le((mo,as)=>{var gn=Et(),is=ts();function Oe(t,e){this.type=t,this.target=null,Object.keys(e||{}).forEach(function(i){this[i]=e[i]},this)}Oe.prototype.preventDefault=function(){};Oe.prototype.stopPropagation=function(){};Oe.prototype.stopImmediatePropagation=function(){};function ns(t,e){this._eventListeners=this._eventListeners||{},this._eventListeners[t]=this._eventListeners[t]||[];var i=this._eventListeners[t];i.indexOf(e)===-1&&i.push(e)}function os(t,e){var i=this._eventListeners&&this._eventListeners[t];if(i){var s=i.indexOf(e);s!==-1&&i.splice(s,1)}}function rs(t){t.target=this;var e=this._eventListeners&&this._eventListeners[t.type];return e&&e.forEach(function(i){i(t)}),!0}function se(){}se.prototype.createTextNode=function(t){var e=new q;return e.textContent=t,e.nodeName="#text",e.nodeType=3,e};se.prototype.createElement=function(t){var e=new T;return e.nodeName=e.tagName=t,e};se.prototype.createComment=function(t){var e=new _;return e.data=t,e};se.prototype.addEventListener=ns;se.prototype.removeEventListener=os;se.prototype.dispatchEvent=rs;function Te(){}q.prototype=new Te;T.prototype=new Te;_.prototype=new Te;function Ae(t){this.el=t,this.styles=[]}Ae.prototype.setProperty=function(t,e){this.el._setProperty(this.styles,{name:t,value:e})};Ae.prototype.getProperty=function(t){return this.el._getProperty(this.styles,t)};Ae.prototype.__defineGetter__("cssText",function(){var t="";return this.styles.forEach(function(e){t+=e.name+":"+e.value+";"}),t});Ae.prototype.__defineSetter__("cssText",function(t){this.styles.length=0,t.split(";").forEach(function(e){var i=e.indexOf(":");if(i){var s=e.slice(0,i).trim(),o=e.slice(i+1).trim();this.setProperty(s,o)}},this)});function pn(t,e){t&&(this.name=t,this.value=e||"")}function T(){var t=this;this.style=new Ae(this),this.classList=gn(this),this.childNodes=[],this.attributes=[],this.dataset={},this.className="",this._setProperty=function(e,i,s,o){var r=t._getProperty(e,s);if(r){r.value=String(o);return}e.push(typeof i=="function"?new i(s.toLowerCase(),String(o)):i)},this._getProperty=function(e,i){if(i){i=i.toLowerCase();for(var s=0;s<e.length;s++)if(i===e[s].name)return e[s]}}}T.prototype.nodeType=1;T.prototype.appendChild=function(t){return t.parentElement=this,this.childNodes.push(t),t};T.prototype.setAttribute=function(t,e){t==="style"?this.style.cssText=e:this._setProperty(this.attributes,pn,t,e)};T.prototype.getAttribute=function(t){if(t==="style")return this.style.cssText;var e=this._getProperty(this.attributes,t);return typeof e<"u"?e.value:null};T.prototype.removeAttribute=function(t){if(t==="class")delete this.className;else for(var e=0,i=this.attributes.length;e<i;e++)if(this.attributes[e].name===t){this.attributes.splice(e,1);break}};T.prototype.replaceChild=function(t,e){var i=this,s=!1;if(this.childNodes.forEach(function(o,r){o===e&&(i.childNodes[r]=t,t.parentElement=this,s=!0)}),s)return e};T.prototype.removeChild=function(t){var e=this,i=!0;if(this.childNodes.forEach(function(s,o){s===t&&(e.childNodes.splice(o,1),t.parentElement=null,i=!0)}),i)return t};T.prototype.insertBefore=function(t,e){var i=this.childNodes;if(e===null)i.push(t);else for(var s=0,o=i.length;s<o;s++){var r=i[s];if(r===e){s===0?i.unshift(t):i.splice(s,0,t);break}}return t.parentElement=this,t};T.prototype.addEventListener=ns;T.prototype.removeEventListener=os;T.prototype.dispatchEvent=rs;T.prototype.insertAdjacentHTML=function(t,e){};T.prototype.__defineGetter__("innerHTML",function(){var t=this.childNodes.html||"";return this.childNodes.forEach(function(e){t+=e.outerHTML||e.textContent}),t});T.prototype.__defineSetter__("innerHTML",function(t){this.childNodes.length=0,this.childNodes.html=t});T.prototype.__defineGetter__("outerHTML",function(){var t=[],e=this,i={AREA:!0,BASE:!0,BR:!0,COL:!0,EMBED:!0,HR:!0,IMG:!0,INPUT:!0,KEYGEN:!0,LINK:!0,META:!0,PARAM:!0,SOURCE:!0,TRACK:!0,WBR:!0};function s(c){var m=[],y;return c.forEach(function(u){y=u.name!="style"?u.value:e.style.cssText,m.push(u.name+'="'+ss(y)+'"')}),m.length?" "+m.join(" "):""}function o(c){var m=[],y;return Object.keys(c).forEach(function(u){m.push("data-"+u+'="'+ss(c[u])+'"')}),m.length?" "+m.join(" "):""}function r(){var c=[];for(var m in e){var y=is.propToAttr(m);e.hasOwnProperty(m)&&["string","boolean","number"].indexOf(typeof e[m])!==-1&&is.isStandardAttribute(y,e.nodeName)&&d(m,y)&&c.push({name:y,value:e[m]})}return c?s(c):""}function d(c,m){return e.getAttribute(m)?!1:!(c==="className"&&!e[c])}var g=this.style.cssText?this.attributes.concat([{name:"style"}]):this.attributes;return t.push("<"+this.nodeName+r()+s(g)+o(this.dataset)+">"),i[this.nodeName.toUpperCase()]||(t.push(this.innerHTML),t.push("</"+this.nodeName+">")),t.join("")});T.prototype.__defineGetter__("textContent",function(){var t="";return this.childNodes.forEach(function(e){t+=e.textContent}),t});T.prototype.__defineSetter__("textContent",function(t){var e=new q;return e.textContent=t,this.childNodes=[e],t});function Ie(t){return String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function ss(t){return Ie(t).replace(/"/g,"&quot;")}T.prototype.nodeValue=null;function q(){}q.prototype.nodeType=3;q.prototype.nodeName="#text";q.prototype.__defineGetter__("textContent",function(){return Ie(this.value||"")});q.prototype.__defineSetter__("textContent",function(t){this.value=t});q.prototype.__defineGetter__("nodeValue",function(){return Ie(this.value||"")});q.prototype.__defineSetter__("nodeValue",function(t){this.value=t});q.prototype.__defineGetter__("length",function(){return(this.value||"").length});q.prototype.replaceData=function(t,e,i){this.value=this.value.slice(0,t)+i+this.value.slice(t+e)};function _(){}_.prototype.nodeType=8;_.prototype.nodeName="#comment";_.prototype.__defineGetter__("data",function(){return this.value});_.prototype.__defineSetter__("data",function(t){this.value=t});_.prototype.__defineGetter__("outerHTML",function(){return"<!--"+Ie(this.value||"")+"-->"});_.prototype.__defineGetter__("nodeValue",function(){return Ie(this.value||"")});_.prototype.__defineSetter__("nodeValue",function(t){this.value=t});function Ke(t){t.__defineGetter__("parentNode",function(){return this.parentElement})}Ke(T.prototype);Ke(_.prototype);Ke(q.prototype);Ke(Te.prototype);as.exports={Document:se,Node:Te,Element:T,Comment:_,Text:q,document:new se,Event:Oe,CustomEvent:Oe}});var hs=le((wo,us)=>{var mn=Qi(),wn=Et(),fs=typeof window>"u"?ls():window,Ce=fs.document,bn=fs.Text;function ds(){var t=[];function e(){var i=[].slice.call(arguments),s=null;function o(r){var d;function g(u){var w=mn(u,/([\.#]?[^\s#.]+)/);/^\.|#/.test(w[1])&&(s=Ce.createElement("div")),cs(w,function(b){var te=b.substring(1,b.length);b&&(s?b[0]==="."?wn(s).add(te):b[0]==="#"&&s.setAttribute("id",te):s=Ce.createElement(b))})}if(r!=null){if(typeof r=="string")s?s.appendChild(d=Ce.createTextNode(r)):g(r);else if(typeof r=="number"||typeof r=="boolean"||r instanceof Date||r instanceof RegExp)s.appendChild(d=Ce.createTextNode(r.toString()));else if(kn(r))cs(r,o);else if(Ot(r))s.appendChild(d=r);else if(r instanceof bn)s.appendChild(d=r);else if(typeof r=="object")for(var c in r)if(typeof r[c]=="function")/^on\w+/.test(c)?function(u,w){s.addEventListener?(s.addEventListener(u.substring(2),w[u],!1),t.push(function(){s.removeEventListener(u.substring(2),w[u],!1)})):(s.attachEvent(u,w[u]),t.push(function(){s.detachEvent(u,w[u])}))}(c,r):(s[c]=r[c](),t.push(r[c](function(u){s[c]=u})));else if(c==="style")if(typeof r[c]=="string")s.style.cssText=r[c];else for(var m in r[c])(function(u,w){if(typeof w=="function")s.style.setProperty(u,w()),t.push(w(function(te){s.style.setProperty(u,te)}));else var b=r[c][u].match(/(.*)\W+!important\W*$/);b?s.style.setProperty(u,b[1],"important"):s.style.setProperty(u,r[c][u])})(m,r[c][m]);else if(c==="attrs")for(var y in r[c])s.setAttribute(y,r[c][y]);else c.substr(0,5)==="data-"?s.setAttribute(c,r[c]):s[c]=r[c];else if(typeof r=="function"){var y=r();s.appendChild(d=Ot(y)?y:Ce.createTextNode(y)),t.push(r(function(w){Ot(w)&&d.parentElement?(d.parentElement.replaceChild(w,d),d=w):d.textContent=w}))}}return d}for(;i.length;)o(i.shift());return s}return e.cleanup=function(){for(var i=0;i<t.length;i++)t[i]();t.length=0},e}var vn=us.exports=ds();vn.context=ds;function Ot(t){return t&&t.nodeName&&t.nodeType}function cs(t,e){if(t.forEach)return t.forEach(e);for(var i=0;i<t.length;i++)e(t[i],i)}function kn(t){return Object.prototype.toString.call(t)=="[object Array]"}});var x={};ie(x,{addBaseToLinks:()=>G,addClick:()=>qt,addTargetToLinks:()=>Z,clipboardWrite:()=>Fe,defaults:()=>f,embed:()=>j,getBodyContentNode:()=>Pe,getCanonicalSpecialPage:()=>Ft,getCompareSection:()=>Le,getCompareTitle:()=>oe,getComponentFromUrl:()=>J,getDependencies:()=>ne,getErrorMessage:()=>X,getErrorStatusText:()=>Mt,getHref:()=>Ne,getLabel:()=>ge,getMissingDependencies:()=>Je,getMobileServer:()=>Nt,getMsgKey:()=>We,getMsgParams:()=>it,getParamFromUrl:()=>De,getPlaceholderClasses:()=>rt,getQueryDefaults:()=>It,getRevisionSection:()=>Wt,getSpecialPageAliases:()=>ot,getTarget:()=>R,getURL:()=>st,h:()=>M,hf:()=>Vt,hint:()=>Ct,hj:()=>Ln,hs:()=>Dn,ht:()=>vs,isActiveElement:()=>Tt,isAllowed:()=>de,isArray:()=>ye,isBoolean:()=>ps,isBreakpoint:()=>yn,isCompareHidden:()=>nt,isEmpty:()=>a,isEmptyObject:()=>A,isForeign:()=>Q,isFunction:()=>O,isMF:()=>ue,isMessageExists:()=>et,isNew:()=>Re,isObject:()=>ms,isRevisionHidden:()=>Rt,isString:()=>K,isToggleKey:()=>ws,isValidDir:()=>I,isValidID:()=>h,log:()=>ce,logTimer:()=>he,moduleRequire:()=>Me,msg:()=>l,msgDom:()=>Y,msgHint:()=>B,msgParse:()=>xn,notifyError:()=>E,onSchedule:()=>Qe,origin:()=>fe,parseQuery:()=>bs,processDefaults:()=>Xe,processMessages:()=>tt,renderLabel:()=>at,renderMessageBox:()=>Bt,renderPlaceholder:()=>Ve,renderSuccessBox:()=>Ut,semverCompare:()=>At,setDefaults:()=>xe,setHTML:()=>jt,settings:()=>k,spacesToUnderlines:()=>Ye,textDom:()=>Ze});function a(t){return!t||t.length===0}function A(t){return!t||!ms(t)||Object.keys(t).length===0}function K(t){return typeof t=="string"}function ps(t){return typeof t=="boolean"}function O(t){return typeof t=="function"}function ye(t){return Array.isArray(t)}function ms(t){return typeof t=="object"}function ws(t){return t.type==="click"||t.type==="keypress"&&["Enter","Space"].includes(t.code)}function Tt(){let t=["button","submit","reset","file","checkbox","radio","range","color","image","hidden"],e=document.activeElement;return!e||e.contentEditable==="true"||e.tagName==="TEXTAREA"||e.tagName==="INPUT"&&!t.includes(e.type)}function fe(t){return`${n.config.origin}${t}`}function ne(t){return t.filter(e=>{let i=mw.loader.getState(e);return i&&!["error","missing"].includes(i)})}function Je(t){return t.filter(e=>{let i=mw.loader.getState(e);return!["ready","registered"].includes(i)})}function Me(t){return n.local.require(t)}function Re(){return n.local.lastVesrion!==n.config.version}function de(){return!f("standalone")&&n.config.include.pageActions.includes(mw.config.get("wgAction"))&&!n.config.exclude.pages.includes(mw.config.get("wgCanonicalSpecialPageName"))}function Q(t){return!a(t)&&!n.local.mwServerNames.includes(t)}function ue(){return document.readyState==="complete"?document.body.classList.contains("mw-mf"):!a(mw.config.get("wgMFMode"))}function ce(t,e,i=[]){let s=console[t];s&&(/\.$/.test(e)||(e=`${e}.`),s(`${l("script-name")}: ${e}`,...i))}function he(t,e,i){let s=i-e;s<1e3?s=`${Math.round(s)}ms`:s=`${(s/1e3).toFixed(2)}s`,ce("info",`${t}: ${s}`)}function yn(t){return t=n.config.breakpoints[t],t?window.matchMedia(t):!1}function Qe(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}function Ye(t){return t.replace(/ /g,"_")}function At(t,e){return t=t.split("-").shift(),e=e.split("-").shift(),t.localeCompare(e,void 0,{numeric:!0,sensitivity:"case",caseFirst:"upper"})}function f(t){return t?n.local.defaults[t]:n.local.defaults}function xe(t,e){n.local.defaults={...n.local.defaults,...t};let i=Object.fromEntries(Object.entries(n.local.defaults).filter(([s])=>s in n.config.settings));if(mw.storage.setObject(`${n.config.prefix}-settings`,i),e&&(O(n.GM?.setValue)&&n.GM.setValue("settings",JSON.stringify(i)),!n.local.mwIsAnon))try{mw.user.options.set(n.config.settingsPrefix,JSON.stringify(i))}catch{}}async function Xe(){let t={};try{t={...t,...mw.storage.getObject(`${n.config.prefix}-settings`)}}catch{}if(O(n.GM?.getValue))try{t={...t,...JSON.parse(await n.GM.getValue("settings"))}}catch{}if(!n.local.mwIsAnon)try{t={...t,...JSON.parse(mw.user.options.get(`${n.config.settingsPrefix}-settings`))}}catch{}xe(t,!1)}function It(){let t=bs(document.currentScript?.src)?.instantdiffs||{};for(let[e,i]of Object.entries(t))t[e]=i==="true"?!0:i==="false"?!1:i;return t}function k(t){return t?n.local.settings[t]:n.local.settings}function l(){return mw.msg.apply(mw.msg,it(arguments))}function Ct(t){return t=`hint-${t}`,`[${l(t)}]`}function B(t,e,i=!0){return t=l(t),i&&(t=`${t} ${Ct(e)}`),t.trim()}function xn(){return mw.message.apply(mw.message,it(arguments)).parse()}function Y(){return mw.message.apply(mw.message,it(arguments)).parseDom()}function Ze(t){return mw.messages.set({[We("buffer")]:t}),Y("buffer")}function et(t){return a(t)?!1:mw.message(We(t)).exists()}function tt(){if(n.local.userLanguage=mw.config.get("wgUserLanguage"),n.local.userLanguage==="qqx"){n.local.language=n.local.userLanguage;return}n.local.language=n.i18n[n.local.userLanguage]?n.local.userLanguage:"en",n.local.messages=n.i18n[n.local.language],n.local.language!=="en"&&(n.local.messages={...n.i18n.en,...n.local.messages});let t={};for(let[e,i]of Object.entries(n.local.messages))t[We(e)]=i;mw.messages.set(t)}function We(t){return`${n.config.messagePrefix}-${t}`}function it(t){return a(t[0])||(t[0]=We(t[0])),t}function Mt(t){if(Number.isInteger(t)){if(t===0)return l("error-offline");if(t>=400&&t<500)return l("error-revision-missing");if(t>500)return l("error-server")}}function X(t,e,i){t=et(t)?t:"error-generic",e={...e},i={...i?.values};let s=l(t,i.oldid||i.curid||i.page1||i.rev1,i.diff||i.page2||i.rev2,i.titleText||i.title,e.message||l("error-wasted"));return/\.$/.test(s)||(s=`${s}.`),s}function E(t,e,i,s){if(s=ps(s)?s:!f("notifyErrors"),n.isUnloading)return;document.visibilityState==="hidden"&&(s=!0);let o=X(t,e,i);if(s){ce("warn",o,[i,e]);return}if(typeof mw<"u"&&mw.notify){let r=M("div.instantDiffs-notification",M("div.instantDiffs-notification-label",M("a",{href:fe(`/wiki/${n.config.link}`),target:"_blank"},l("script-name"))),vs(o));mw.notify(r,{type:"error",tag:`${n.config.prefix}-${e.type}`})}ce("error",o,[i,e])}function ge(t){let e=n.config.labels[t];if(e)return typeof e=="object"?e[document.dir]:e}function R(t){return f("openInNewTab")&&t?"_blank":"_self"}function Ne(t){return/^\/\//.test(t)&&(t=`https:${t}`),t}function st(t){try{return new URL(Ne(t))}catch{return null}}function De(t,e){let i=st(e);if(i)return i.searchParams.get(t)}function J(t,e){let i=st(e);if(i)return i[t]}function bs(t){let e=st(t);if(!e)return;let i={};for(let[s,o]of e.searchParams){let r=s.match(/^([^[]+)\[([^\]]+)\]$/);if(r){let[,d,g]=r;i[d]=i[d]||{},i[d][g]=o}else i[s]=o}return i}function h(t){return!a(t)&&!isNaN(t)}function I(t){return!a(t)&&["next","prev","cur"].includes(t)}function nt(t){return t&&(t.fromtexthidden||t.totexthidden)}function Rt(t){return t&&t.slots?.main?.texthidden}function oe(t){return t.torevid?t.totitle:t.fromrevid?t.fromtitle:null}function Le(t){let e;return t.torevid?(a(t.tocomment)||(e=t.tocomment.match(n.config.sectionRegExp)),e&&e[1]||null):t.fromrevid?(a(t.fromcomment)||(e=t.fromcomment.match(n.config.sectionRegExp)),e&&e[1]||null):null}function Wt(t){let e;return t&&!a(t.comment)&&(e=t.comment.match(n.config.sectionRegExp)),e&&e[1]||null}function Nt(){let t=mw.config.get("wgServer").replace(/^https?:/,""),e=new RegExp("^//www\\.").test(t)?"www.":"",i=mw.config.get("wgContentLanguage");if(!a(i)){let o=new RegExp(`^//${i}\\.`);if(o.test(t))return t.replace(o,`//${i}.m.`)}let s=mw.config.get("wgNoticeProject");if(!a(s)){let o=new RegExp(`^//${e}${s}\\.`);if(o.test(t))return t.replace(o,a(e)?`//${s}.m.`:`//m.${s}.`)}}function Pe(){let t=$(n.config.bodyContentSelector);return(!t||t.length===0)&&(t=$(document.body)),t}function ot(t,e){let i="Special",s=mw.config.get("wgFormattedNamespaces")[-1],o=e.split(":"),r=t[e],d=r.split(":");o[0]=s,d[0]=i;let g=[e,r,o.join(":"),d.join(":")];return[...new Set(g)]}function Ft(t){if(!a(t))try{let e=new mw.Title(t).getPrefixedDb();for(let[i,s]of Object.entries(n.local.specialPagesAliasesPrefixed))if(s.includes(e))return i}catch{}}function M(t,e={},...i){return Object.keys(e).forEach(s=>{let o=e[s];if(!a(o))switch(s){case"id":t=`${t}#${o.trim()}`,delete e[s];break;case"class":o=Array.isArray(o)?o.map(r=>r.trim()).join("."):o.trim().replace(/\s+/g,"."),t=`${t}.${o}`,delete e[s];break}}),(0,gs.default)(t,e,...i)}function vs(t){return document.createTextNode(t)}function Dn(...t){return t.reduce((e,i)=>e+i.outerHTML,"")}function Vt(...t){let e=new DocumentFragment;for(let i of t)e.append(i);return e}function Ln(t){return Vt(...t.toArray())}function Fe(t,e){let i=()=>{mw.notify(l("copy-link-copied"),{tag:`${n.config.prefix}-copyLink`}),O(e)&&e(!0)},s=()=>{mw.notify(l("copy-link-error"),{tag:`${n.config.prefix}-copyLink`,type:"error"}),O(e)&&e(!1)};if(a(t)||!K(t))return s();if(navigator.clipboard?.writeText)navigator.clipboard.writeText(t).then(i).catch(s);else{let o=M("textarea",{value:t});document.body.append(o),o.select();let r=document.execCommand("copy");o.remove(),r?i():s()}}function qt(t,e,i=!0){let s=o=>{if(o){if(!ws(o)||o.button||o.ctrlKey)return;if(o.preventDefault(),i&&o.altKey&&!a(t.href)){t.target==="_blank"?window.open(t.href,"_blank").focus():window.location.href=t.href;return}}e(o)};i&&!a(t.href)&&(a(t.dataset.altTitle)&&(t.dataset.altTitle=t.title),t.dataset.altTitle=`${t.dataset.altTitle} ${Ct("alt-click")}`.trim(),t.dataset.origTitle=t.title,t.addEventListener("mouseenter",()=>t.title=t.dataset.altTitle),t.addEventListener("mouseleave",()=>t.title=t.dataset.origTitle)),t.addEventListener("click",s),t.addEventListener("keypress",s)}function j(t,e,i="appendTo"){if(!e)return;if(e instanceof jQuery){(t instanceof jQuery?t:$(t))[i](e);return}let s=t instanceof jQuery?t.get(0):t;switch(i){case"insertBefore":e.before(s);break;case"insertAfter":e.after(s);break;case"prependTo":e.prepend(s);break;case"appendTo":default:e.append(s);break}}function jt(t,e){if(t){if(t instanceof jQuery){t.html(e);return}Element.prototype.setHTML instanceof Function||(Element.prototype.setHTML=function(i){this.innerHTML=i}),t.setHTML(e)}}function G(t,e,i=!1){let s;try{s=new URL(e,`https://${location.hostname}`)}catch{return}let o=(d,g)=>{$(g).attr("href","https://"+s.hostname+s.pathname+$(g).attr("href"))},r=(d,g)=>{$(g).attr("href","https://"+s.hostname+$(g).attr("href").replace(/special:mylanguage\//i,"")).attr("title",($(g).attr("title")||"").replace(/special:mylanguage\//i,""))};t.filter('a[href^="#"]').each(o),t.find('a[href^="#"]').each(o),i||(t.filter('a[href^="/"]:not([href^="//"])').each(r),t.find('a[href^="/"]:not([href^="//"])').each(r))}function Z(t){if(!f("openInNewTab"))return;let e=(i,s)=>{let o=s.getAttribute("href");a(o)||o==="#"||s.setAttribute("target","_blank")};t.filter("a:not(.mw-thanks-thank-link, .jquery-confirmable-element)").each(e),t.find("a:not(.mw-thanks-thank-link, .jquery-confirmable-element)").each(e)}function rt(t=[]){let e=["instantDiffs-panel-placeholder"];return t.forEach(i=>e.push(`instantDiffs-panel-placeholder--${i}`)),f("showLink")&&e.push("has-link"),e}function Ve(){return $("<span>").addClass(rt())}function at(t){t={short:null,long:null,iconBefore:null,iconAfter:null,...t},a(t.short)||(t.short=M("span",t.short)),a(t.long)||(t.long=M("span",t.long)),a(t.iconBefore)||(t.iconBefore=M("i",t.iconBefore)),a(t.iconAfter)||(t.iconAfter=M("i",t.iconAfter));let e=[t.iconBefore,t.short,t.iconAfter].filter(s=>!a(s)).map(s=>s.cloneNode(!0)),i=[t.iconBefore,t.long,t.iconAfter].filter(s=>!a(s)).map(s=>s.cloneNode(!0));return Vt(M("div.instantDiffs-label.instantDiffs-label--long",...i),M("div.instantDiffs-label.instantDiffs-label--short",...e))}function Bt(t){t={$content:null,type:"notice",...t};let e=t.$content.toArray();return M("div",{class:["cdx-message","cdx-message--block",`cdx-message--${t.type}`,"plainlinks"]},M("span.cdx-message__icon"),M("div.cdx-message__content",...e))}function Ut(t){return t={content:null,image:null,alt:null,...t},M("div.instantDiffs-success-box",M("img",{src:`${n.config.commonsAssetsPath}${t.image}`,alt:t.alt}),M("h5",t.content))}var gs,S=v(()=>{gs=nn(hs());C()});var Gt={};ie(Gt,{getMWLine:()=>Ht,getMWLineTitle:()=>_t,getSplitSpecialUrl:()=>lt,isMWLink:()=>pe});function lt(t){let e=t.split("/"),i={};return n.local.specialPagesAliasesPrefixed["Special:PermanentLink"].includes(e[0])?(i.oldid=e[1],i):n.local.specialPagesAliasesPrefixed["Special:Redirect"].includes(e[0])?(e[1]==="revision"&&(i.oldid=e[2]),i):(e.length>1&&(i.diff=e.pop()),e.length>1&&(i.oldid=e.pop()),i)}function pe(t,e){let i=!1;return e=e||n.config.mwLink,e.id&&(i=e.id.some(s=>t.id===s),i)||e.hasClass&&(i=e.hasClass.some(s=>t.classList.contains(s)),i)||e.hasChild&&(i=e.hasChild.some(s=>t.querySelector(s)),i)||e.closestTo&&(i=e.closestTo.some(s=>t.closest(s))),i}function Ht(t){return t.closest(n.config.mwLine.selector.join(","))}function _t(t){let e=t.dataset.title;if(!a(e))return decodeURIComponent(e);let i=n.config.mwLineTitle.selector.join(","),s=t.querySelector(i);if(s)return a(s.title)?s.innerText:s.title}var ks=v(()=>{C();S()});var Xt={};ie(Xt,{getEntitySchemaLabel:()=>Qt,getNamespaceConfig:()=>zt,getWikilambdaLabel:()=>Yt,isEditableContentModel:()=>Jt,isProbablyWbTitle:()=>Kt,isWbContentModel:()=>me});function zt(t){let e=p.siteInfoAliases[t];if(!A(e))return{wgFormattedNamespaces:Object.values(e.namespaces).reduce((i,s)=>(i[s.id]=s.canonical||"",i),{}),wgNamespaceIds:{...Object.values(e.namespaces).reduce((i,s)=>(i[Ye(s.name.toLowerCase())]=s.id,s.canonical&&(i[Ye(s.canonical.toLowerCase())]=s.id),i),{}),...e.namespacealiases.reduce((i,s)=>(i[s.alias.toLowerCase()]=s.id,i),{})},wgCaseSensitiveNamespaces:Object.values(e.namespaces).filter(i=>i.case==="case-sensitive").map(i=>i.id),wgContentNamespaces:Object.values(e.namespaces).filter(i=>i.content).map(i=>i.id)}}function Kt(t){return!a(t)&&/^[QPL][0-9]+$/.test(t)}function me(t){return!a(t)&&t.includes("wikibase")}function Jt(t){return!n.config.nonEditableContentModels.includes(t)}function Qt(t){return $(t).find(".entityschema-title-label").text()}function Yt(t){return!A(t)&&(t[`wikilambda-label-${n.local.userLanguage}`]||t["wikilambda-label-en"])}var $e=v(()=>{C();S();U()});var Zt,p,U=v(()=>{C();S();$e();Zt=class t{static utils=Xt;static api;static foreignApi={};static getApi(e){if(!Q(e))return this.api||(this.api=new mw.Api),this.api;if(!this.foreignApi[e]){let i=`https://${e}${mw.util.wikiScript("api")}`;this.foreignApi[e]=new mw.ForeignApi(i)}return this.foreignApi[e]}static get(e,i){return this.getApi(i).get(e)}static post(e,i){return this.getApi(i).post(e)}static watch(e,i,s){return this.getApi(s).watch(e,i)}static unwatch(e,i){return this.getApi(i).unwatch(e)}static notifyError(e){E("error-api-generic",{type:"api",message:e?.message||e},null,!0)}static getAuthToken(e){let i={action:"centralauthtoken",format:"json",formatversion:2,uselang:n.local.language};return this.get(i,e)}static loadMessage(e,i){return e=typeof e=="string"?[e]:e,e.filter(o=>!mw.message(o).exists()).length===0?$.Deferred().resolve().promise():this.getApi(i).loadMessagesIfMissing(e,{uselang:n.local.userLanguage})}static async parseWikitext(e,i){e={action:"parse",contentmodel:"wikitext",format:"json",formatversion:2,uselang:n.local.language,...e};try{let{parse:s}=await this.post(e,i);return s.text}catch(s){this.notifyError(s)}}static async getCompare(e,i,s){e={action:"compare",prop:["title","ids","timestamp","comment"],format:"json",formatversion:2,uselang:n.local.userLanguage,...e};let o=s||this;try{return(await o.get(e,i)).compare}catch(r){this.notifyError(r)}}static async getPageInfo(e,i,s){let o=n.local.userLanguage;e={action:"query",prop:["info","pageprops","entityterms"],inprop:["watched","notificationtimestamp"],wbetterms:["label"],wbetlanguage:o,intestactions:["edit"],format:"json",formatversion:2,uselang:o,...e};let r=s||this;try{return(await r.get(e,i)).query.pages[0]}catch(d){this.notifyError(d)}}static async markAsSeen(e,i){e={action:"setnotificationtimestamp",redirects:1,format:"json",formatversion:2,uselang:n.local.userLanguage,...e};try{return(await t.getApi(i).postWithEditToken(e)).setnotificationtimestamp.notificationtimestamp}catch(s){this.notifyError(s)}}static siteInfo={};static siteInfoAliases={};static async getSiteInfo(e=[],i,s){if(a(i)&&(i=mw.config.get("wgServerName")),!Re()&&A(this.siteInfo)&&(this.siteInfo=mw.storage.getObject(`${n.config.prefix}-siteInfo`)||{},this.processSiteInfo()),!A(this.siteInfoAliases[i])||!A(this.siteInfo[i]))return this.siteInfoAliases[i]||this.siteInfo[i];let o={action:"query",meta:"siteinfo",siprop:e,format:"json",formatversion:2,uselang:n.local.userLanguage},r=s||this;try{let{query:d}=await r.get(o,i);this.siteInfo[i]||(this.siteInfo[i]={});for(let[g,c]of Object.entries(d))this.siteInfo[i][g]=c;return mw.storage.setObject(`${n.config.prefix}-siteInfo`,this.siteInfo,f("storageExpiry")),this.processSiteInfoAliases(this.siteInfo[i]),this.siteInfo[i]}catch(d){this.notifyError(d)}}static processSiteInfo(){if(!A(this.siteInfo))for(let e of Object.values(this.siteInfo))this.processSiteInfoAliases(e)}static processSiteInfoAliases(e){A(e?.general)||(this.siteInfoAliases[e.general.servername]=e,a(e.general.mobileserver)||(e.general.mobileservername=J("hostname",e.general.mobileserver),this.siteInfoAliases[e.general.mobileservername]=e))}static specialPages={};static specialPagesLocal={};static async getSpecialPages(e){if(A(this.specialPages)&&n.config.specialPages.forEach(s=>{this.specialPages[s]=s}),!Re()&&A(this.specialPagesLocal)&&(this.specialPagesLocal=mw.storage.getObject(`${n.config.prefix}-specialPagesLocal`)||{}),!A(this.specialPagesLocal))return this.specialPagesLocal;for(let[s,o]of Object.entries(this.specialPages))this.specialPagesLocal[s]=o;let i={action:"query",titles:n.config.specialPages,format:"json",formatversion:2,uselang:mw.config.get("wgContentLanguage")};try{let{query:s}=await t.get(i,e);return s.normalized&&s.normalized.forEach(o=>{this.specialPagesLocal[o.from]=o.to}),mw.storage.setObject(`${n.config.prefix}-specialPagesLocal`,this.specialPagesLocal,f("storageExpiry")),this.specialPagesLocal}catch(s){this.notifyError(s)}}static interwikiMap=[];static async getInterwikiMap(e){if(!Re()&&a(this.interwikiMap)&&(this.interwikiMap=mw.storage.getObject(`${n.config.prefix}-interwikiMap`)||[]),!a(this.interwikiMap))return this.interwikiMap;let i={action:"query",meta:"siteinfo",siprop:"interwikimap",format:"json",formatversion:2,uselang:n.local.userLanguage};try{let{query:s}=await this.get(i,e);return this.interwikiMap=s.interwikimap,mw.storage.setObject(`${n.config.prefix}-interwikiMap`,this.interwikiMap,f("storageExpiry")),this.interwikiMap}catch(s){this.notifyError(s)}}static async getWBLabel(e,i,s){if(!Kt(e))return;let o=n.local.userLanguage,r={action:"wbgetentities",props:"labels",ids:e,languages:o,languagefallback:1,format:"json",formatversion:2,uselang:o},d=s||this;try{let{entities:g}=await d.get(r,i),c=g[e];return c.type==="lexeme"?Object.values(c.lemmas).map(m=>m.value).join("/"):c.labels[o].value}catch(g){this.notifyError(g)}}},p=Zt});var ct={};ie(ct,{addLinkTags:()=>oi,getDependencies:()=>ti,getForeignDependencies:()=>ii,getHref:()=>W,getHrefAbsolute:()=>N,getRevID:()=>ei,getWikilink:()=>ai,loadForeignDependencies:()=>si,loadForeignStylesDependencies:()=>ni,removeLinkTags:()=>ri});function ei(t){let e=t.getValues();if(h(e.revid))return e.revid;if(e.type==="revision"&&h(e.oldid)&&(!I(e.direction)||e.direction==="prev"))return e.oldid;if(e.type==="diff"){if(h(e.oldid)&&h(e.diff))return Math.max(e.oldid,e.diff);if(h(e.oldid)){if(!I(e.diff)||e.diff==="prev")return e.oldid}else if(h(e.diff)&&(!I(e.oldid)||e.oldid==="prev"))return e.diff}return!1}function ti(t){let e=[],i=n.config.dependencies.page;i&&(e=e.concat(qe(t,i)));let s=n.config.dependencies[t.get("type")];return s&&(e=e.concat(qe(t,s))),e}function qe(t,e){let i=[];if(a(e))return i;ye(e["*"])&&(i=i.concat(e["*"]));let s=t.getMW("title")?.getNamespaceId();return ye(e[s])&&(i=i.concat(e[s])),i}function ii(t){let e=[],i=[],s=[],o=n.config.foreignDependencies[t.get("type")];if(o){if(e=e.concat(qe(t,o)),i=i.concat(qe(t,o.styles)),me(mw.config.get("wgPageContentModel"))){let r=o.wikibase;r&&(e=e.concat(qe(t,r)),i=i.concat(r.styles.all,ue()?r.styles.mobile:r.styles.desktop))}s=s.concat(Pn(t,o.links))}return{modules:e,styles:i,links:s}}function Pn(t,e){let i=[];if(a(e))return i;ye(e["*"])&&(i=i.concat(e["*"].map(o=>ys(t,o))));let s=t.getMW("title")?.getNamespaceId();return ye(e[s])&&(i=i.concat(e[s].map(o=>ys(t,o)))),i}function si(t,e){let i=Je(e),s=t.get("hostname"),o=mw.util.wikiScript("load"),r=$.param({modules:i.join("|"),skin:mw.config.get("skin")});mw.loader.load(`https://${s}${o}?${r}`)}function ni(t,e){let i=Je(e),s=t.get("hostname"),o=mw.util.wikiScript("load"),r=$.param({modules:i.join("|"),only:"styles",skin:mw.config.get("skin")});mw.loader.load(`https://${s}${o}?${r}`,"text/css")}function oi(t){if(!a(t))return t.map(e=>mw.loader.addLinkTag?.(e))}function ri(t){a(t)||t.forEach(e=>e?.remove())}async function ai(t){let e={relative:!1,minify:f("linksFormat")==="minify",wikilink:!0,wikilinkPreset:f("wikilinksFormat")};if(t.isForeign){let i=await p.getInterwikiMap();i&&(e.interwiki=i.filter(s=>s.url.includes(t.getMW("serverName"))).reduce((s,o)=>!s||s.prefix.length>o.prefix.length?o:s))}return W(t,{},e)}function W(t,e,i){t instanceof F||(t=new F(t)),e={...e},i={type:null,...i};let s={...t.getValues()};return i.type||(s.type==="revision"&&s.typeVariant==="page"?i.type="page":i.type=s.type),i.type==="diff"&&(a(s.diff)&&I(s.direction)&&(s.diff=s.direction),h(s.oldid)&&h(s.diff)?(e.oldid=s.oldid,e.diff=s.diff):h(s.revid)?e.diff=s.revid:h(s.oldid)?I(s.diff)&&s.diff!=="prev"?(e.oldid=s.oldid,e.diff=s.diff):e.diff=s.oldid:h(s.diff)&&(I(s.oldid)&&s.oldid!=="prev"?(e.oldid=s.diff,e.diff=s.oldid):e.diff=s.diff)),i.type==="revision"&&(a(s.direction)&&I(s.diff)&&(s.direction=s.diff),h(s.revid)?e.oldid=s.revid:h(s.oldid)&&(e.oldid=s.oldid,I(s.direction)&&s.direction==="next"&&(e.direction=s.direction))),i.type==="page"&&(e.curid=s.curid),$n(t,e,i)}function N(t,e){let i=t?.mw.endPointUrl||n.local.mwEndPointUrl;try{return new URL(e,i.origin).toString()}catch{return e}}function $n(t,e,i){e={...e},i={type:"diff",relative:!0,hash:!1,minify:!1,interwiki:null,wikilink:!1,wikilinkPreset:null,...i},Q(t.get("hostname"))&&(i.relative=!1);let s=t.getMW("endPointUrl")||n.local.mwEndPointUrl,o;return a(t.get("title"))?(o=new URL(s),o.search=new URLSearchParams(e).toString()):o=new URL(mw.util.getUrl(t.get("title"),e),s.origin),i.hash&&!a(t.get("section"))&&(o.hash=`#${t.get("section")}`),i.minify&&(o.pathname="",o.hash="",o.searchParams.delete("title")),i.href=decodeURIComponent(i.relative?o.pathname+o.search+o.hash:o.toString()),i.wikilink?Sn(t,e,i):i.href}function Sn(t,e,i){e={...e},i={href:null,type:"diff",minify:!1,relative:!0,interwiki:null,wikilink:!0,wikilinkPreset:"special",...i};let s=null;!a(e.oldid)&&!a(e.diff)?s=`${e.oldid}/${e.diff}`:a(e.oldid)?a(e.diff)?a(e.curid)||(s=e.curid):s=e.diff:s=e.oldid;let r=(n.config.wikilinkPresets[i.wikilinkPreset]||n.config.wikilinkPresets.special)[i.type],d=i.interwiki?.prefix;return r.replace("$1",s).replace("$pref",d?`${d}:`:"").replace("$href",i.href).replace("$msg",l(`copy-wikilink-${i.type}`))}function ys(t,e){let i=mw.util.getUrl(e,{action:"raw",ctype:"text/css"});return t.isForeign?N(t,i):i}var re=v(()=>{C();S();$e();U();we()});var li,F,we=v(()=>{S();re();U();li=class{static utils=ct;values={type:null,typeVariant:null,hostname:location.hostname};options={};mw={serverName:mw.config.get("wgServerName"),mobileServerName:mw.config.get("wgMobileServerName")};isValid=!1;isForeign=!1;isHidden=!1;constructor(e,i){this.options={fixTenet:!0,...i},A(e)||this.set(e)}set(e){this.values={...this.values,...this.validateValues(e)},this.isValid=this.validate(),this.process()}setValue(e,i){this.values[e]=i}setValues(e){for(let[i,s]of Object.entries(e))this.setValue(i,s)}get(e){return this.values[e]}getValues(){return this.values}getMW(e){return this.mw[e]}validateValues(e){return!a(e.diff)&&K(e.diff)&&e.diff.indexOf("|")>-1&&(e.diff=e.diff.split("|").shift()),!a(e.oldid)&&K(e.oldid)&&e.oldid.indexOf("|")>-1&&(e.oldid=e.oldid.split("|").shift()),!a(e.curid)&&K(e.curid)&&e.curid.indexOf("|")>-1&&(e.curid=e.curid.split("|").shift()),[0,"0"].includes(e.oldid)&&delete e.oldid,[0,"0","current","latest"].includes(e.diff)&&(e.diff="cur"),I(e.direction)||(e.direction="prev"),a(e.section)||(e.section=e.section.replace(/^#/,"")),e}validate(){if(h(this.values.oldid)&&a(this.values.diff))return this.values.type="revision",!0;if(h(this.values.diff)||h(this.values.oldid)){if(this.values.type="diff",a(this.values.title)&&I(this.values.oldid)){let e=this.values.oldid;this.values.oldid=this.values.diff,this.values.diff=e}if(a(this.values.oldid)&&(this.values.oldid=this.values.diff,this.values.diff=this.values.direction),this.options.fixTenet&&h(this.values.oldid)&&h(this.values.diff)&&parseInt(this.values.oldid)>parseInt(this.values.diff)){let e=this.values.oldid;this.values.oldid=this.values.diff,this.values.diff=e}return!0}return!a(this.values.title)&&I(this.values.diff)?(this.values.type="diff",!0):h(this.values.curid)?(this.values.type="revision",this.values.typeVariant="page",!0):Ft(this.values.title)==="Special:ComparePages"&&(!a(this.values.page1)||h(this.values.rev1))&&(!a(this.values.page2)||h(this.values.rev2))?(this.options.fixTenet=!1,this.values.type="diff",this.values.typeVariant="comparePages",!0):!1}process(){this.values.revid=ei(this),a(this.values.hostname)||this.setHostname(),a(this.values.title)||this.setTitle(),(!a(this.values.page1)||!a(this.values.page2))&&this.setComparePages()}setHostname(){let{general:e}=p.siteInfoAliases[this.values.hostname]||{};A(e)?(this.mw.serverName=this.values.hostname,this.mw.mobileServerName=this.values.hostname):(this.values.hostname=ue()&&!a(e.mobileservername)?e.mobileservername:e.servername,this.mw.serverName=e.servername,this.mw.mobileServerName=e.mobileservername),this.mw.endPoint=`https://${this.values.hostname}${mw.util.wikiScript("index")}`,this.mw.endPointUrl=new URL(this.mw.endPoint),this.isForeign=Q(this.values.hostname)}setTitle(){a(this.values.origTitle)&&(this.values.origTitle=this.values.title);try{this.mw.title=new mw.Title(this.values.title),this.values.title=this.mw.title.getPrefixedDb(),this.values.titleText=this.mw.title.getPrefixedText()}catch{}a(this.values.section)||(this.values.titleSection=[this.values.title,this.values.section].join("#"),this.values.titleTextSection=[this.values.titleText,this.values.section].join("#")),this.values.href=mw.util.getUrl(this.values.titleSection||this.values.title),this.isForeign&&(this.values.href=N(this,this.values.href))}setComparePages(){try{this.mw.page1=new mw.Title(this.values.page1),this.values.page1=this.mw.page1.getPrefixedDb(),this.values.page1Text=this.mw.page1.getPrefixedText()}catch{}try{this.mw.page2=new mw.Title(this.values.page2),this.values.page2=this.mw.page2.getPrefixedDb(),this.values.page2Text=this.mw.page2.getPrefixedText()}catch{}}},F=li});var ci,V,je=v(()=>{S();ci=class{options={};node;constructor(e){this.options={node:null,tag:"button",classes:[],label:null,title:null,href:null,target:"_self",handler:null,container:null,insertMethod:"appendTo",ariaHaspopup:!1,altTitle:null,useAltKey:!1,...e},a(this.options.href)||(this.options.tag="a"),OO.EventEmitter.call(this),this.options.node?.nodeType===1?(this.node=this.options.node,this.process()):this.render()}render(){this.node=document.createElement(this.options.tag),this.node.innerText=this.options.label,this.node.classList.add(...this.options.classes),a(this.options.title)||(this.node.title=this.options.title),a(this.options.href)?(this.node.setAttribute("tabindex","0"),this.node.setAttribute("role","button")):(this.node.href=this.options.href,this.node.target=this.options.target),this.process(),this.embed(this.options.container,this.options.insertMethod)}process(){O(this.options.handler)&&(this.options.ariaHaspopup&&this.node.setAttribute("aria-haspopup","dialog"),a(this.options.altTitle)||(this.node.dataset.altTitle=this.options.altTitle),qt(this.node,this.options.handler.bind(this),this.options.useAltKey))}embed(e,i){j(this.node,e,i)}remove(){this.node.remove()}pending(e){this.node.classList.toggle("instantDiffs-link--pending",e)}getContainer(){return this.node}},V=ci});var xs=v(()=>{});var Ds,En,fi,P,Se=v(()=>{C();S();ks();U();we();je();ee();xs();({h:Ds,ht:En}=x),fi=class t{static utils=Gt;static stack=new Map;static findLinks(e){return typeof e>"u"&&(e=Pe()),e.find(n.local.linkSelector)}static addLink(e,i){this.stack.set(e,i.isValid?i:!1)}static getLink(e){return this.stack.get(e)}static hasLink(e){return this.stack.has(e)}static getLinks(){return this.stack.values()}node;options={};article;nodes={};mw={hasLink:!1,hasLine:!1};manual={behavior:"basic",options:{}};actions={};extensions={};isValid=!1;isForeign=!1;isLoading=!1;isLoaded=!1;isProcessed=!1;hasRequest=!1;constructor(e,i){this.node=e,this.options={behavior:"basic",insertMethod:"insertAfter",showLink:f("showLink"),showPageLink:f("showPageLink"),showAltTitle:!1,initiatorLink:null,initiatorPage:null,initiatorView:null,onRequest:()=>{},onLoad:()=>{},onOpen:()=>{},onClose:()=>{},...i},L.isContains(this.node)&&(this.options.initiatorView=L,this.options.initiatorPage=L.getPage()),this.process(),t.addLink(this.node,this),this.isValid&&this.render()}process(){if(this.href=this.node.href,a(this.href))return;let e={};try{this.url=new URL(this.href),e.title=this.url.searchParams.get("title"),e.pathname=decodeURIComponent(this.url.pathname),e.pathnameNormalized=e.pathname.replace(new RegExp(n.local.mwArticlePath),"")}catch{return}if(n.config.exclude.linkActions.includes(this.url.searchParams.get("action")))return;let i={hostname:this.url.hostname};n.local.specialPagesLinksSearchRegExp.test(e.title)?i={...i,...lt(e.title)}:n.local.specialPagesLinksPathRegExp.test(e.pathname)?i={...i,...lt(e.pathnameNormalized)}:(["title","curid","oldid","diff","direction","page1","rev1","page2","rev2"].forEach(s=>{i[s]=this.url.searchParams.get(s)}),a(i.title)&&n.local.articlePathRegExp.test(e.pathname)&&(i.title=e.pathnameNormalized)),this.article=new F(i),this.isValid=this.article.isValid,this.isForeign=this.article.isForeign}render(){switch(this.processMWOptions(),this.processManualOptions(),this.postValidateOptions(),a(this.article.get("title"))&&this.mw.hasLine&&this.article.set({title:this.mw.title}),this.options.behavior){case"event":this.renderEvent();break;case"basic":this.renderBasic();break;case"request":this.renderRequest();break}}processMWOptions(){this.mw.hasLink=pe(this.node,n.config.mwLink),this.mw.hasLink&&(this.mw.isDiffOnly=pe(this.node,n.config.mwLinkDiffOnly),this.mw.isPrepend=pe(this.node,n.config.mwLinkPrepend),this.mw.isPrepend&&(this.options.insertMethod="insertBefore"),this.mw.isAltTitle=pe(this.node,n.config.mwLinkAltTitle),this.mw.isAltTitle&&(this.options.showAltTitle=!0),this.mw.line=Ht(this.node),this.mw.line&&(this.mw.hasLine=!0,this.mw.title=_t(this.mw.line),this.mw.line.classList.add("instantDiffs-line"))),this.mw.isContent=pe(this.node,n.config.mwLinkContent),this.mw.isContent&&(this.options.behavior="request")}processManualOptions(){if(this.manual.options=this.node.dataset.instantdiffsOptions,!a(this.manual.options))try{this.manual.options=JSON.parse(this.manual.options),this.options={...this.options,...this.manual.options}}catch(e){let i={type:"link",message:e?.message||e};E("error-link-options",i,null,!0)}this.manual.behavior=this.node.dataset.instantdiffsLink,a(this.manual.behavior)||(this.options.behavior=this.manual.behavior)}postValidateOptions(){let e={link:"event",default:"request"};e[this.options.behavior]&&(this.options.behavior=e[this.options.behavior]),["request","basic","event","none"].includes(this.options.behavior)||(this.options.behavior="basic"),this.options.showPageLink&&=this.options.behavior==="request"}observe(){this.isObserved||(this.isObserved=!0,n.local.interactionObserver.observe(this.node))}unobserve(){this.isObserved&&(this.isObserved=!1,n.local.interactionObserver.unobserve(this.node))}onIntersect(){this.isLoading||this.isLoaded||!this.isObserved||(this.unobserve(),this.request())}renderRequest(){this.hasRequest=this.isValid,this.hasRequest?(this.toggleSpinner(!0),this.observe()):(this.toggleSpinner(!1),this.isLoaded=!0,this.isProcessed=!1,this.unobserve())}request(){let e=this.article.get("type"),i=this.article.get("typeVariant");if(e==="revision")return this.requestRevision();if(e==="diff")return i==="comparePages"?this.requestCompare():this.requestDiff()}requestRevision(){if(this.isLoading)return;this.isLoading=!0,this.error=null;let e={action:"query",prop:"revisions",rvprop:["ids","timestamp","comment","content"],rvslots:"main",rvsection:0,format:"json",formatversion:2,uselang:n.local.userLanguage};return a(this.article.get("oldid"))?a(this.article.get("curid"))||(e.pageids=this.article.get("curid")):e.revids=this.article.get("oldid"),p.get(e,this.article.get("hostname")).then(this.onRequestRevisionDone).fail(this.onRequestRevisionError)}onRequestRevisionError=(e,i)=>{this.isLoading=!1,this.error={type:"revision",code:a(this.article.get("curid"))?"generic":"curid"},i?.error?(this.error.code=i.error.code,this.error.message=i.error.info):(this.error.message=e,E(`error-revision-${this.error.code}`,this.error,this.article,!0)),this.renderError()};onRequestRevisionDone=e=>{this.isLoading=!1;let i=e?.query;if(!i||!i.badrevids&&!i.badpageids&&!i.pages)return this.onRequestRevisionError(null,e);let s=i.pages?.[0],o=s?.revisions?.[0],r={type:"revision"};if(i.badrevids?r.code="badrevids":i.badpageids?r.code="badpageids":!s||s.missing||!o?r.code="missing":s.invalid&&(r.code="invalid",r.info=s.invalidreason),r.code)return this.error=r,this.renderError();this.revision=o,this.article.set({title:s.title,section:Wt(this.revision)}),this.article.isHidden=Rt(this.revision),this.renderSuccess()};requestDiff(){if(this.isLoading)return;this.isLoading=!0,this.error=null;let e={action:"compare",prop:["title","ids","timestamp","comment"],fromrev:h(this.article.get("oldid"))?this.article.get("oldid"):void 0,fromtitle:a(this.article.get("title"))?void 0:this.article.get("title"),torev:h(this.article.get("diff"))?this.article.get("diff"):void 0,torelative:I(this.article.get("diff"))?this.article.get("diff"):void 0,format:"json",formatversion:2,uselang:n.local.userLanguage};return p.get(e,this.article.get("hostname")).then(this.onRequestDiffDone).fail(this.onRequestDiffError)}onRequestDiffError=(e,i)=>{this.isLoading=!1,this.error={type:"diff"},i?.error?(this.error.code=i.error.code,this.error.message=i.error.info):(this.error.message=e,E("error-diff-generic",this.error,this.article,!0)),this.renderError()};onRequestDiffDone=e=>{if(this.isLoading=!1,this.compare=e?.compare,!this.compare)return this.onRequestDiffError(null,e);this.article.set({title:oe(this.compare),section:Le(this.compare)}),this.article.isHidden=nt(this.compare),this.renderSuccess()};requestCompare(){if(this.isLoading)return;this.isLoading=!0,this.error=null;let e=this.article.getValues(),i={action:"compare",prop:["title","ids","timestamp","comment"],fromrev:h(e.rev1)?e.rev1:void 0,fromtitle:a(e.page1)?void 0:e.page1,torev:h(e.rev2)?e.rev2:void 0,totitle:a(e.page2)?void 0:e.page2,format:"json",formatversion:2,uselang:n.local.userLanguage};return p.get(i,this.article.get("hostname")).then(this.onRequestCompareDone).fail(this.onRequestCompareError)}onRequestCompareError=(e,i)=>{this.isLoading=!1,this.error={type:"diff"},i?.error?(this.error.code=i.error.code,this.error.message=i.error.info):(this.error.message=e,E("error-diff-generic",this.error,this.article,!0)),this.renderError()};onRequestCompareDone=e=>{if(this.isLoading=!1,this.compare=e?.compare,!this.compare)return this.onRequestCompareError(null,e);this.article.set({oldid:this.compare.fromrevid,diff:this.compare.torevid,page1:this.compare.fromtitle,page2:this.compare.totitle,title:oe(this.compare),section:Le(this.compare)}),this.article.isHidden=nt(this.compare),this.renderSuccess()};renderEvent(){this.isValid&&(this.actions.action=new V({node:this.node,handler:this.openDialog.bind(this),ariaHaspopup:!0}),this.renderSuccess())}renderBasic(){!this.isValid||this.mw.isDiffOnly&&this.article.get("type")!=="diff"||this.renderSuccess()}renderError(){if(this.isLoaded=!0,this.isProcessed=!1,this.toggleSpinner(!1),this.options.behavior!=="event"){this.renderWrapper();let e;this.error.type&&(e=`error-${this.error.type}-${this.error.code||"generic"}`,et(e)||(e=`error-${this.error.type}-generic`)),this.nodes.error=Ds("span",{class:["item","error","error-info"],title:X(e,this.error,this.article)},En(ge("error"))),this.nodes.inner.append(this.nodes.error),this.embed(this.node,this.options.insertMethod)}mw.hook(`${n.config.prefix}.link.renderError`).fire(this)}renderSuccess(){this.isLoaded=!0,this.isProcessed=!0,this.toggleSpinner(!1),this.options.behavior!=="event"&&(this.renderWrapper(),this.renderLinkAction(),this.options.showPageLink&&this.renderPageAction(),this.embed(this.node,this.options.insertMethod)),mw.hook(`${n.config.prefix}.link.renderSuccess`).fire(this)}renderWrapper(){this.nodes.container=this.nodes.inner=Ds("span",{class:["instantDiffs-panel","nowrap","noprint"]})}renderAction(e){return e={tag:"a",label:null,title:null,href:null,target:R(this.options.initiatorView),handler:null,classes:[],modifiers:[],container:this.nodes.inner,...e},e.classes=["item","text","instantDiffs-action",...e.classes],e.modifiers.forEach(i=>e.classes.push(`instantDiffs-action--${i}`)),new V(e)}getLinkTitle(e){return this.options.showAltTitle&&!a(this.node.title)?this.node.title:(this.article.isHidden&&(e=`${e}-hidden`),l(e))}renderLinkAction(){let e=this.article.get("typeVariant")==="comparePages"?"compare-pages":this.article.get("type"),i=this.getLinkTitle(`${e}-title`);if(!this.options.showLink)return this.mutateLinkAction(i);let s=[];this.article.isHidden&&s.push("error","error-admin"),this.actions.action=this.renderAction({label:ge(this.article.get("type")),title:i,classes:s,modifiers:[this.article.get("type")],handler:this.openDialog.bind(this),ariaHaspopup:!0})}mutateLinkAction(e){let i=["instantDiffs-link",`instantDiffs-link--${this.article.get("type")}`,`is-${this.options.insertMethod}`];this.article.isHidden&&i.push("instantDiffs-link--error"),this.node.classList.remove("external"),this.node.classList.add(...i),this.node.dataset.instantdiffsLink=this.options.behavior,this.actions.action=new V({node:this.node,handler:this.openDialog.bind(this),ariaHaspopup:!0,altTitle:e,useAltKey:!0})}renderPageAction(){this.actions.page=this.renderAction({label:ge("page"),title:this.article.get("titleTextSection")||this.article.get("titleText"),href:this.article.get("href"),modifiers:["page"]})}openDialog(){let e={initiatorPage:this.options.initiatorPage,onOpen:()=>this.onDialogOpen(),onClose:()=>this.onDialogClose()};if(L.setup(this,e))return this.onDialogRequest(),$.when(L.load()).always(()=>this.onDialogLoad())}onDialogRequest(){this.toggleLoader(!0),O(this.options.onRequest)&&this.options.onRequest(this)}onDialogLoad(){this.toggleLoader(!1),O(this.options.onLoad)&&this.options.onLoad(this)}onDialogOpen(){this.mw.hasLine&&f("highlightLine")&&this.mw.line.classList.add("instantDiffs-line--highlight"),O(this.options.onOpen)&&this.options.onOpen(this),this.options.initiatorLink instanceof t&&this.options.initiatorLink.onDialogOpen()}onDialogClose(){this.mw.hasLine&&(f("highlightLine")&&this.mw.line.classList.remove("instantDiffs-line--highlight"),f("markWatchedLine")&&n.config.changeLists.includes(mw.config.get("wgCanonicalSpecialPageName"))&&(this.mw.line.classList.remove(...n.config.mwLine.unseen),this.mw.line.classList.add(...n.config.mwLine.seen))),O(this.options.onClose)&&this.options.onClose(this),this.options.initiatorLink instanceof t&&this.options.initiatorLink.onDialogClose()}toggleLoader(e){this.actions.action?this.actions.action.pending(e):this.node.classList.toggle("instantDiffs-link--pending",e)}toggleSpinner(e){let i=rt(["loader",this.article.get("type")]);e?this.node.classList.add(...i):this.node.classList.remove(...i)}embed(e,i){j(this.nodes.container,e,i)}getContainer(){return this.nodes.container}getNode(){return this.node}getInitiatorLink(){return this.options.initiatorLink||this}getArticle(){return this.article}getMW(){return this.mw}},P=fi});var di,be,ui=v(()=>{S();Se();di=class t{static instance;static newInstance(e){this.instance=new t(e)}options={};link;links=[];constructor(e){this.options={filterType:null,filterMWLine:!1,...e},this.links=Array.from(P.findLinks())}setLink(e){this.link=e}hasLink(e){return e instanceof P&&this.links.includes(e.getNode())}isLinkValid(e){if(!(e instanceof P)||!(e.isValid&&(e.isProcessed||e.hasRequest&&!e.isLoaded)))return!1;let o=a(this.options.filterType)?!0:e.getArticle().get("type")===this.options.filterType,r=this.options.filterMWLine===!0?e.getMW()?.hasLine:!0;return o&&r}getLength(){return this.links.length}getIndex(){return this.link instanceof P?this.links.indexOf(this.link.getNode()):-1}getPreviousLink(e){if(typeof e>"u"&&(e=this.getIndex()),e<=0)return;let i=e-1,s=P.getLink(this.links[i]);return this.isLinkValid(s)?s:this.getPreviousLink(i)}getNextLink(e){if(typeof e>"u"&&(e=this.getIndex()),e<0||e+1>=this.getLength())return;let i=e+1,s=P.getLink(this.links[i]);return this.isLinkValid(s)?s:this.getNextLink(i)}},be=di});var He={};ie(He,{getUserDate:()=>Be,isVisualDiffsAvailable:()=>dt,processRevisionDiffTable:()=>Ue,renderDiffTable:()=>gi,renderDiffTableSide:()=>ft,renderUserLink:()=>Ps,restoreFileMediaInfo:()=>vi,restoreInlineFormatToggle:()=>pi,restoreRollbackLink:()=>wi,restoreVisualDiffs:()=>mi,restoreWikiLambda:()=>bi});function gi(t){let e={};return e.container=D("table",{class:["diff","diff-type-table",`diff-contentalign-${mw.config.get("wgContentLanguageDir")==="rtl"?"right":"left"}`,`diff-editfont-${mw.user.options.get("editfont")}`]},D("colgroup",D("col",{class:"diff-marker"}),D("col",{class:"diff-content"}),D("col",{class:"diff-marker"}),D("col",{class:"diff-content"})),e.head=D("tbody",D("tr",{class:"diff-title",lang:n.local.userLanguage},e.deleted=D("td",{class:["diff-otitle","diff-side-deleted"],colSpan:2}),e.added=D("td",{class:["diff-ntitle","diff-side-added"],colSpan:2}))),e.body=D("tbody")),a(t)?t===""&&(e.notice=D("tr",D("td",{class:"diff-notice",colSpan:4},D("div",{class:"mw-diff-empty"},mw.msg("diff-empty")))),e.body.append(e.notice)):jt(e.body,t),e}function ft(t){t={prefix:"n",title:null,revid:null,curRevid:null,hostname:null,timestamp:null,texthidden:!1,user:null,userhidden:!1,comment:null,commenthidden:!1,...t};let e=`mw-diff-${t.prefix}title`,i=t.revid===t.curRevid?"currentrev-asof":"revisionasof",s=new F({type:"revision",title:t.title,oldid:t.revid,hostname:t.hostname});return hi(D("div",{id:`${e}1`},D("strong",t.texthidden?D("span",{class:"history-deleted"},mw.msg(i,Be(t.timestamp))):D("a",{href:W(s)},mw.msg(i,Be(t.timestamp))))),D("div",{id:`${e}2`},t.userhidden?D("span",{class:["mw-userlink","history-deleted"]},mw.msg("rev-deleted-user")):Ps(s,t.user)),D("div",{id:`${e}3`},t.commenthidden?D("span",{class:["comment","history-deleted"]},mw.msg("rev-deleted-comment")):a(t.comment)?D("span",{class:["comment","mw-comment-none"]},mw.msg("changeslist-nocomment")):D("span",{class:["comment","comment--without-parentheses"],innerHTML:t.comment})))}function Ue(t){f("showRevisionInfo")?(t.find("td:is(.diff-otitle, .diff-side-deleted)").addClass("instantDiffs-hidden"),t.find("td:is(.diff-ntitle, .diff-side-added)").attr("colspan","4"),t.find("tr:not([class])").addClass("instantDiffs-hidden")):t.addClass("instantDiffs-hidden")}function Ps(t,e){let i=new mw.Title(e,2).getPrefixedText(),s=new mw.Title(e,3).getPrefixedText(),o=new mw.Title(`Contributions/${e}`,-1).getPrefixedText(),r=hi(D("a",{class:["mw-redirect","mw-usertoollinks-talk"],title:s,href:N(t,mw.util.getUrl(s))},mw.msg("talkpagelinktext")),Ls(mw.msg("pipe-separator")),D("a",{class:["mw-redirect","mw-usertoollinks-talk"],title:o,href:N(t,mw.util.getUrl(o))},mw.msg("contribslink")));return hi(D("a",{class:"mw-userlink",title:i,href:N(t,mw.util.getUrl(i))},D("bdi",e)),Ls(mw.msg("word-separator")),D("span",{class:"mw-usertoollinks"},On(mw.message("parentheses",r).parseDom())))}function Be(t){if(K(t)&&(t=new Date(t)),!(t instanceof Date))return;let e=Me("mediawiki.DateFormatter");return e?e.forUser().formatTimeAndDate(t):t.toLocaleString()}function pi(t){if(!t||t.length===0||mw.loader.getState("mediawiki.diff")!=="ready")return!1;let e=t.find("#mw-diffPage-inline-toggle-switch-layout"),i=ht("mediawiki.diff","./inlineFormatToggle.js");try{return i(e),!0}catch{}return!1}function mi(t){if(!t||t.length===0||!h(mw.config.get("wgDiffOldId"))||!h(mw.config.get("wgDiffNewId"))||!dt(mw.config.get("wgPageContentModel"))||mw.loader.getState("ext.visualEditor.diffPage.init")!=="ready")return!1;let e=t.find(".ve-init-mw-diffPage-diffMode");if(e.length>0)return!0;e=$("<div>").addClass("ve-init-mw-diffPage-diffMode");let i=t.find(".mw-diffPage-inlineToggle-container");return i.length>0?i.before(e):t.append(e),!0}function dt(t){let e=mw.config.get("wgVisualEditorConfig");return e&&Object.prototype.hasOwnProperty.call(e.contentModels,t)}function wi(t){return!t||t.length===0?!1:(t.confirmable({i18n:{confirm:mw.msg("rollback-confirmation-confirm"),yes:mw.msg("rollback-confirmation-yes"),no:mw.msg("rollback-confirmation-no")},delegate:'.mw-rollback-link a[data-mw="interface"]',handler:e=>{e.preventDefault(),Tn(e.target)}}),!0)}function Tn(t){let e=$.createSpinner({size:"small",type:"inline"});$(t).css("display","none").after(e);let i={action:"rollback",title:mw.util.getParamValue("title",t.href),user:mw.util.getParamValue("from",t.href),token:mw.util.getParamValue("token",t.href),formatversion:2,uselang:n.local.userLanguage};p.post(i).then(s=>{let o=$(Ze(s?.rollback?.summary));Z(o),mw.notify(o,{tag:"rollback"}),$(t).closest(".mw-rollback-link").remove(),L.refresh()}).catch((s,o)=>{let r=$(Ze(o?.error?.info));Z(r),mw.notify(r,{type:"error",tag:"rollback"}),e.remove(),$(t).css("display","")})}function bi(t){return!t||t.length===0?!1:(mw.loader.using(["@wikimedia/codex","ext.wikilambda.app"]).then(e=>{let{createMwApp:i}=e("vue"),{createPinia:s}=e("pinia"),{useMainStore:o,App:r}=e("ext.wikilambda.app");if(mw.config.get("wgWikiLambda")){let d=s(),g=o(d);window.vueInstance=i(Object.assign({provide:()=>({viewmode:g.getViewMode})},r)).use(d).mount(t.get(0))}}),!0)}async function vi(t){if(!t||t.length===0)return;let e=["wikibasemediainfo-filepage-fileinfo-heading","wikibasemediainfo-filepage-structured-data-heading"];return await p.loadMessage(e),An(t)}function An(t){let e=new OO.ui.TabPanelLayout("captions",{expanded:!1,label:mw.msg("wikibasemediainfo-filepage-fileinfo-heading"),$content:t.find("mediainfoviewcaptions")}),i=new OO.ui.TabPanelLayout("statements",{expanded:!1,label:mw.msg("wikibasemediainfo-filepage-structured-data-heading"),$content:t.find("mediainfoviewstatements")}),s=new OO.ui.IndexLayout({expanded:!1,framed:!1});s.addTabPanels([e,i],0);let o=new OO.ui.PanelLayout({expanded:!1,framed:!1,content:[s]});return D("div",{class:"instantDiffs-page-mediaInfo"},o.$element.get(0))}var D,hi,Ls,On,ut=v(()=>{C();S();H();re();U();we();ee();({h:D,hf:hi,ht:Ls,hj:On}=x)});var ki,yi,$s=v(()=>{S();ki=class{config=mw.config;values={};backup={};constructor(e,i){i&&(this.config=i),this.setValues(e)}set(e,i){Object.hasOwn(this.backup,e)||(this.backup[e]=this.config.get(e)),this.values[e]=i}setValues(e){for(let[i,s]of Object.entries(e))this.set(i,s)}setTitle(e){a(e)||(K(e)&&(e=new mw.Title(e)),this.setValues({wgTitle:e.getMainText(),wgPageName:e.getPrefixedDb(),wgNamespaceNumber:e.getNamespaceId(),wgRelevantPageName:e.getPrefixedDb()}))}get(e){return this.values[e]}getValues(){return this.values}apply(){for(let[e,i]of Object.entries(this.values))i!==void 0&&this.config.set(e,i)}restore(){for(let[e,i]of Object.entries(this.backup))i!==void 0&&this.config.set(e,i)}},yi=ki});var xi,Ss,Es=v(()=>{U();xi=class{items=new Map;get(e,i){let s=p.get(e,i);return this.add(s),s}ajax(e){let i=$.ajax(e);return this.add(i),i}when(...e){return $.when(...e)}abort(){this.items.forEach((e,i)=>i.abort())}add(e){let i=e.always(()=>this.delete(e));return this.items.set(e,i),i}delete(e){this.items.delete(e)}},Ss=xi});var $i={};ie($i,{getDaysLeftExpiry:()=>Di,updateGlobalWatchlistStatus:()=>Pi,updateWatchButtonStatus:()=>_e,updateWatchlistStatus:()=>Li});function Di(t){if(!t||mw.util.isInfinity(t))return null;let e=new Date(t);return Math.ceil((e-new Date)/(1e3*60*60*24))}function _e(t,e){let i=t.get("watched"),s=i?"unwatch":"watch",o=t.get("expiry")||"infinity",r=Di(o),d=`action-${s}`,g=mw.util.getUrl(t.get("title"),{action:s}),c,m;i?mw.util.isInfinity(o)?(c="unwatch",m="unStar"):(c=r>0?"unwatch-expiring":"unwatch-expiring-hours",m="halfStar"):(c="watch",m="star"),e.setLabel(l(d)),e.setTitle(mw.msg(`tooltip-ca-${c}`,r)),e.setHref(N(t,g)),f("showMenuIcons")&&e.setIcon(m)}function Li(t,e,i){e?Os(t.get("titleText"),(s,o,r)=>{r.text(mw.msg("watchlist-unwatch")).attr("title",mw.msg("tooltip-ca-unwatch")).attr("href",mw.util.getUrl(s,{action:"unwatch"})).removeClass("mw-watch-link loading").addClass("mw-unwatch-link"),o.find(".mw-changelist-line-inner-unwatched").addBack(".mw-enhanced-rc-nested").removeClass("mw-changelist-line-inner-unwatched"),In(o,e,i)}):Os(t.get("titleText"),(s,o,r)=>{r.text(mw.msg("watchlist-unwatch-undo")).attr("title",mw.msg("tooltip-ca-watch")).attr("href",mw.util.getUrl(s,{action:"watch"})).removeClass("mw-unwatch-link loading").addClass("mw-watch-link"),o.find(".mw-changeslist-line-inner, .mw-enhanced-rc-nested").addBack(".mw-enhanced-rc-nested").addClass("mw-changelist-line-inner-unwatched")})}function In(t,e,i){if(!e)return;let s=t.find(".mw-changesList-watchlistExpiry");if(mw.util.isInfinity(i))return Cn(t,s);let o=Di(i),r=o>0?"days-full-text":"hours-full-text",d=mw.msg(`watchlist-expiring-${r}`,o);s.length>0?s.each((g,c)=>{c.title=d}):Mn(t,d)}function Cn(t,e){e.each((i,s)=>{let o=$(s);o.next(".mw-changeslist-separator").addClass("mw-changeslist-separator--semicolon").removeClass("mw-changeslist-separator"),s.previousSibling.nodeValue=s.previousSibling.nodeValue.trimEnd(),s.nextSibling.nodeValue=s.nextSibling.nodeValue.trimStart(),o.next(".mw-changeslist-links").before(" "),e.remove()}),t.find(".mw-changeslist-line-inner-historyLink").prepend(" ")}function Mn(t,e){t.find(".mw-title").each((i,s)=>{let o=$(s),r=o.next(".mw-fr-reviewlink"),d=new OO.ui.IconWidget({icon:"clock",title:e,classes:["mw-changesList-watchlistExpiry"]});(r.length>0?r:o).after(" ").after(d.$element).after(" "),d.$element.next(".mw-changeslist-separator--semicolon").addClass("mw-changeslist-separator").removeClass("mw-changeslist-separator--semicolon")})}function Os(t,e){let i=mw.Title.newFromText(t),o=(i.isTalkPage()?i.getSubjectPage():i.getTalkPage()).getPrefixedText();$(".mw-changeslist-line").each((r,d)=>{$(d).find("[data-target-page]").each((c,m)=>{let y=$(m),u=String(y.data("targetPage"));if(u===t||u===o){let w=y.closest("li, .mw-enhancedchanges-checkbox + table.mw-changeslist-log td[data-target-page], table"),b=w.find(".mw-unwatch-link, .mw-watch-link");e(u,w,b)}})})}function Pi(t,e,i){if(mw.globalwatchlist)try{let s=mw.globalwatchlist.watchedSites.siteList.find(o=>o.site===t.get("hostname"));if(!s)return;s.processUpdateWatched(t.get("origTitle"),!e)}catch(s){E("error-global-watchlist",{type:"watchstar",message:s?.message||s},t,!0)}}var Si=v(()=>{S();re()});var Ei,gt,Oi=v(()=>{C();S();Si();H();U();Ei=class{static utils=$i;static notificationId="mw-watchlink-notification";article;button;hostname;preferredExpiry;isExpiryEnabled=!1;isWatched=!1;constructor(e,i){this.article=e,this.button=i,this.hostname=this.article.get("hostname");let{WatchlistExpiry:s}=ht("mediawiki.page.watch.ajax","config.json")||{};this.isExpiryEnabled=!this.article.isForeign&&(s||!1);let o=["mediawiki.notification"];this.isExpiryEnabled&&o.push("mediawiki.watchstar.widgets"),mw.loader.load(o)}async request(){await this.preloadMessages(),this.preferredExpiry=mw.user.options.get("watchstar-expiry","infinity"),this.isWatched=this.article.get("watched");let e=this.article.getMW("title").getPrefixedDb();return(this.isWatched?p.unwatch(e,this.hostname):p.watch(e,this.preferredExpiry,this.hostname)).then(this.showNotice).fail(this.showError)}async preloadMessages(){await p.loadMessage(["watchlist-expiring-days-full-text","watchlist-expiring-hours-full-text","tooltip-ca-watch","tooltip-ca-unwatch","tooltip-ca-unwatch-expiring","tooltip-ca-unwatch-expiring-hours"])}showError=(e,i)=>{let s=p.getApi().getErrorMessage(i);mw.notify(s,{tag:"watch-self",type:"error",id:this.constructor.notificationId})};showNotice=e=>{this.isWatched=e.watched===!0;let i=this.article.getMW("title"),s=e.expiry||"infinity",o=$("<a>"),r=this.isWatched?"addedwatchtext":"removedwatchtext";i.isTalkPage()&&(r+="-talk");let d,g;if(this.isExpiryEnabled)this.isWatched&&(mw.util.isInfinity(this.preferredExpiry)?r=i.isTalkPage()?"addedwatchindefinitelytext-talk":"addedwatchindefinitelytext":r=i.isTalkPage()?"addedwatchexpirytext-talk":"addedwatchexpirytext"),d=mw.loader.using("mediawiki.watchstar.widgets").then(c=>{let m=c("mediawiki.watchstar.widgets");if(!g){let y=mw.message(r,i.getPrefixedText(),this.preferredExpiry).parseDom();G(y,`https://${this.hostname}`),Z(y);let u=[this.isWatched?"watch":"unwatch",i.getPrefixedDb(),s,this.updateStatus,{$link:o,message:y}];At(mw.config.get("wgVersion"),"1.45.0")<0&&u.splice(2,1),g=new m(...u)}mw.notify(g.$element,{tag:"watch-self",id:this.constructor.notificationId,autoHideSeconds:"short"})});else{let c=mw.message(r,i.getPrefixedText()).parseDom();G(c,`https://${this.hostname}`),Z(c),d=mw.notify(c,{tag:"watch-self",id:this.constructor.notificationId})}d.always(()=>{let c=this.isWatched?"unwatch":"watch";this.updateStatus(o,c,"idle",s,"infinity")})};updateStatus=(e,i,s,o,r)=>{let d=i==="unwatch";if(o||="infinity",r||="infinity",this.isWatched=d,this.article.setValues({watched:d,expiry:o,expirySelected:r}),this.button.helper?.pending(s==="loading"),_e(this.article,this.button),!this.article.isForeign&&n.local.mwTitleText===this.article.get("titleText")){let{updatePageWatchStatus:g}=Me("mediawiki.page.watch.ajax")||{};g?.(d,o,r)}s!=="loading"&&(!this.article.isForeign&&mw.user.options.get("watchlistunwatchlinks")&&n.local.mwCanonicalSpecialPageName==="Watchlist"&&Li(this.article,d,o),n.local.mwCanonicalSpecialPageName==="GlobalWatchlist"&&Pi(this.article,d,o))}},gt=Ei});var Ts=v(()=>{});var As={};ie(As,{default:()=>Rn});var ve,pt,Rn,Is=v(()=>{C();S();H();re();mt();ee();({h:ve}=x),pt=class extends OO.ui.ProcessDialog{static name="Instant Diffs Settings";static title=l("settings-title");static actions=[{action:"save",modes:"edit",label:l("action-save"),flags:["primary","progressive"]},{action:"reload",modes:"finish",label:l("action-reload"),flags:["primary","progressive"]},{modes:["edit","finish"],label:l("action-close"),title:l("action-close"),invisibleLabel:!0,icon:"close",flags:["safe","close"]}];inputs={};inputOptions={};fields={};layouts={};constructor(){super({classes:["instantDiffs-settings"]})}initialize(...e){super.initialize(...e),this.panelEdit=this.renderEditPanel(),this.panelFinish=this.renderFinishPanel(),this.stackLayout=new OO.ui.StackLayout({items:[this.panelEdit,this.panelFinish]}),this.processLinksAttr(this.stackLayout.$element),this.$body.append(this.stackLayout.$element)}renderEditPanel(){return this.renderLinksFieldset(),this.renderDialogFieldset(),this.renderGeneralFieldset(),new OO.ui.PanelLayout({classes:["instantDiffs-settings-panel","instantDiffs-settings-panel--edit"],padded:!0,expanded:!1,$content:[this.layouts.links.$element,this.layouts.dialog.$element,this.layouts.general.$element]})}renderFinishPanel(){let i=Ut({image:"/6/6f/Eo_circle_light-green_checkmark.svg",content:l("settings-saved"),alt:l("settings-saved-icon")});return new OO.ui.PanelLayout({classes:["instantDiffs-settings-panel","instantDiffs-settings-panel--finish"],padded:!0,expanded:!1,$content:i})}renderLinksFieldset(){this.inputs.showLink=new OO.ui.CheckboxInputWidget({selected:f("showLink")}),this.fields.showLink=new OO.ui.FieldLayout(this.inputs.showLink,{label:l("settings-show-link"),align:"inline",help:l("settings-show-link-help"),helpInline:!0}),this.fields.showLink.toggle(k("showLink")),this.inputs.showPageLink=new OO.ui.CheckboxInputWidget({selected:f("showPageLink")}),this.fields.showPageLink=new OO.ui.FieldLayout(this.inputs.showPageLink,{label:l("settings-show-page-link"),align:"inline",help:Y("settings-show-page-link-help"),helpInline:!0}),this.fields.showPageLink.toggle(k("showPageLink")),this.inputs.highlightLine=new OO.ui.CheckboxInputWidget({selected:f("highlightLine")}),this.fields.highlightLine=new OO.ui.FieldLayout(this.inputs.highlightLine,{label:l("settings-highlight-line"),align:"inline"}),this.fields.highlightLine.toggle(k("highlightLine")),this.inputs.markWatchedLine=new OO.ui.CheckboxInputWidget({selected:f("markWatchedLine")}),this.fields.markWatchedLine=new OO.ui.FieldLayout(this.inputs.markWatchedLine,{label:l("settings-mark-watched-line"),align:"inline"}),this.fields.markWatchedLine.toggle(k("markWatchedLine")),this.layouts.links=new OO.ui.FieldsetLayout({label:l("settings-fieldset-links")}),this.layouts.links.addItems([this.fields.showLink,this.fields.showPageLink,this.fields.highlightLine,this.fields.markWatchedLine]),this.layouts.links.toggle(k("showLink")||k("showPageLink")||k("highlightLine")||k("markWatchedLine"))}renderDialogFieldset(){this.inputOptions.viewWidth={},this.inputOptions.viewWidth.compact=new OO.ui.ButtonOptionWidget({data:"compact",label:l("settings-view-width-compact"),title:l("settings-view-width-option-title",L.constructor.getSize("compact").width)}),this.inputOptions.viewWidth.standard=new OO.ui.ButtonOptionWidget({data:"standard",label:l("settings-view-width-standard"),title:l("settings-view-width-option-title",L.constructor.getSize("standard").width)}),this.inputOptions.viewWidth.wide=new OO.ui.ButtonOptionWidget({data:"wide",label:l("settings-view-width-wide"),title:l("settings-view-width-option-title",L.constructor.getSize("wide").width)}),this.inputOptions.viewWidth.full=new OO.ui.ButtonOptionWidget({data:"full",label:l("settings-view-width-full"),title:l("settings-view-width-full-title")}),this.inputs.viewWidth=new OO.ui.ButtonSelectWidget({items:Object.values(this.inputOptions.viewWidth)}),this.fields.viewWidth=new OO.ui.FieldLayout(this.inputs.viewWidth,{label:l("settings-view-width"),align:"inline",help:l("settings-view-width-help"),helpInline:!0}),this.fields.viewWidth.toggle(k("viewWidth")),this.inputs.showDiffTools=new OO.ui.CheckboxInputWidget({selected:f("showDiffTools")}),this.fields.showDiffTools=new OO.ui.FieldLayout(this.inputs.showDiffTools,{label:l("settings-show-diff-tools"),align:"inline"}),this.fields.showDiffTools.toggle(k("showDiffTools")),this.inputs.showRevisionInfo=new OO.ui.CheckboxInputWidget({selected:f("showRevisionInfo")}),this.fields.showRevisionInfo=new OO.ui.FieldLayout(this.inputs.showRevisionInfo,{label:l("settings-show-revision-info"),align:"inline"}),this.fields.showRevisionInfo.toggle(k("showRevisionInfo")),this.inputs.unHideDiffs=new OO.ui.CheckboxInputWidget({selected:f("unHideDiffs")}),this.fields.unHideDiffs=new OO.ui.FieldLayout(this.inputs.unHideDiffs,{label:l("settings-unhide-diffs"),align:"inline",help:Y("settings-unhide-diffs-help","suppressrevision"),helpInline:!0}),this.fields.unHideDiffs.toggle(k("unHideDiffs")),this.inputs.openInNewTab=new OO.ui.CheckboxInputWidget({selected:f("openInNewTab")}),this.fields.openInNewTab=new OO.ui.FieldLayout(this.inputs.openInNewTab,{label:l("settings-open-in-new-tab"),align:"inline"}),this.fields.openInNewTab.toggle(k("openInNewTab")),this.inputOptions.linksFormat={},this.inputOptions.linksFormat.full=new OO.ui.RadioOptionWidget({data:"full",label:l("settings-links-format-full")}),this.inputOptions.linksFormat.minify=new OO.ui.RadioOptionWidget({data:"minify",label:l("settings-links-format-minify")}),this.inputs.linksFormat=new OO.ui.RadioSelectWidget({items:Object.values(this.inputOptions.linksFormat)}),this.inputs.linksFormat.on("select",this.onLinksFormatChoose),this.fields.linksFormat=new OO.ui.FieldLayout(this.inputs.linksFormat,{label:l("settings-links-format"),align:"inline",help:"placeholder",helpInline:!0}),this.fields.linksFormat.toggle(k("linksFormat")),this.inputOptions.wikilinksFormat={},this.inputOptions.wikilinksFormat.link=new OO.ui.RadioOptionWidget({data:"link",label:l("settings-wikilinks-format-link")}),this.inputOptions.wikilinksFormat.spacial=new OO.ui.RadioOptionWidget({data:"special",label:l("settings-wikilinks-format-special")}),this.inputs.wikilinksFormat=new OO.ui.RadioSelectWidget({items:Object.values(this.inputOptions.wikilinksFormat)}),this.inputs.wikilinksFormat.on("select",this.onWikilinksFormatChoose),this.fields.wikilinksFormat=new OO.ui.FieldLayout(this.inputs.wikilinksFormat,{label:l("settings-wikilinks-format"),align:"inline",help:"placeholder",helpInline:!0}),this.fields.wikilinksFormat.toggle(k("wikilinksFormat")),this.layouts.dialog=new OO.ui.FieldsetLayout({label:l("settings-fieldset-dialog")}),this.layouts.dialog.addItems([this.fields.viewWidth,this.fields.showDiffTools,this.fields.showRevisionInfo,this.fields.unHideDiffs,this.fields.openInNewTab,this.fields.linksFormat,this.fields.wikilinksFormat]),this.layouts.dialog.toggle(k("viewWidth")||k("showDiffTools")||k("showRevisionInfo")||k("unHideDiffs")||k("openInNewTab")||k("linksFormat")||k("wikilinksFormat")),this.inputs.viewWidth.selectItemByData(f("viewWidth")),this.inputs.linksFormat.selectItemByData(f("linksFormat")),this.inputs.wikilinksFormat.selectItemByData(f("wikilinksFormat"))}renderGeneralFieldset(){this.inputs.enableMobile=new OO.ui.CheckboxInputWidget({selected:f("enableMobile")}),this.fields.enableMobile=new OO.ui.FieldLayout(this.inputs.enableMobile,{label:l("settings-enable-mobile"),align:"inline",help:l("settings-enable-mobile-help"),helpInline:!0}),this.fields.enableMobile.toggle(k("enableMobile")),this.inputs.enableHotkeys=new OO.ui.CheckboxInputWidget({selected:f("enableHotkeys")}),this.fields.enableHotkeys=new OO.ui.FieldLayout(this.inputs.enableHotkeys,{label:l("settings-enable-hotkeys"),align:"inline"}),this.fields.enableHotkeys.toggle(k("enableHotkeys")),this.inputs.showMenuIcons=new OO.ui.CheckboxInputWidget({selected:f("showMenuIcons")}),this.fields.showMenuIcons=new OO.ui.FieldLayout(this.inputs.showMenuIcons,{label:l("settings-show-menu-icons"),align:"inline"}),this.fields.showMenuIcons.toggle(k("showMenuIcons")),this.inputs.notifyErrors=new OO.ui.CheckboxInputWidget({selected:f("notifyErrors")}),this.fields.notifyErrors=new OO.ui.FieldLayout(this.inputs.notifyErrors,{label:l("settings-notify-errors"),align:"inline"}),this.fields.notifyErrors.toggle(k("notifyErrors")),this.layouts.general=new OO.ui.FieldsetLayout({label:l("settings-fieldset-general")}),this.layouts.general.addItems([this.fields.enableMobile,this.fields.enableHotkeys,this.fields.showMenuIcons,this.fields.notifyErrors]),this.layouts.general.toggle(k("enableMobile")||k("enableHotkeys")||k("showMenuIcons")||k("notifyErrors"))}onLinksFormatChoose=()=>{let i={relative:!1,minify:this.inputs.linksFormat.findFirstSelectedItem()?.getData()==="minify"},s=this.getLinksFormatExample(i);this.fields.linksFormat.$help.empty().append(s),this.onWikilinksFormatChoose()};onWikilinksFormatChoose=()=>{let e=this.inputs.linksFormat.findFirstSelectedItem()?.getData(),i=this.inputs.wikilinksFormat.findFirstSelectedItem()?.getData(),s={relative:!1,minify:e==="minify",wikilink:!0,wikilinkPreset:i},o=this.getLinksFormatExample(s);this.fields.wikilinksFormat.$help.empty().append(o)};getLinksFormatExample(e){let i=l("copy-wikilink-example-title"),s=W({title:i,diff:"12345",type:"diff"},{},e),o=W({title:i,oldid:"12345",type:"revision"},{},e),r=W({title:i,curid:"12345",type:"revision",typeVariant:"page"},{},e);return ve("ul.instantDiffs-list--settings",ve("li",ve("i",s)),ve("li",ve("i",o)),ve("li",ve("i",r)))}getSetupProcess(e){return super.getSetupProcess(e).next(()=>{this.actions.setMode("edit"),this.stackLayout.setItem(this.panelEdit),this.$body.scrollTop(0),this.processActionRequest()})}getActionProcess(e){return e==="save"?new OO.ui.Process(()=>this.processActionSave()):e==="reload"?new OO.ui.Process(()=>this.processActionReload()):super.getActionProcess(e)}processLinksAttr(e){e.find("a:not(.jquery-confirmable-element)").each((s,o)=>o.setAttribute("target","_blank")),G(e,n.config.origin)}getBodyHeight(){return 555}processActionRequest(){this.pushPending();for(let e of Object.values(this.inputs))e.setDisabled(!0);z.request().then(this.onActionRequestSuccess.bind(this)).fail(this.onActionRequestError.bind(this)).always(()=>this.popPending())}onActionRequestError(e,i){let s={type:"settings",message:e};i?.error&&(s.code=i.error.code,s.message=i.error.info);let o=new OO.ui.Error(X("error-setting-request",s),{recoverable:!0});this.showErrors(o)}onActionRequestSuccess(e){if(n.local.mwIsAnon)return this.update();let i=e?.query?.userinfo?.options;if(!i)return this.onActionRequestError(null,e);try{let s=JSON.parse(i[`${n.config.settingsPrefix}-settings`]);xe(s,!0)}catch{}this.update()}update(){return this.getUpdateProcess().execute()}getUpdateProcess(){return new OO.ui.Process(()=>{this.actions.setMode("edit"),this.stackLayout.setItem(this.panelEdit),this.processActionUpdate(f())})}processActionUpdate(e){this.popPending();for(let[i,s]of Object.entries(this.inputs)){s.setDisabled(!1);let o=e[i];if(typeof o>"u")return;s instanceof OO.ui.CheckboxInputWidget&&s.setSelected(o),s instanceof OO.ui.RadioSelectWidget&&s.selectItemByData(o),s instanceof OO.ui.ButtonSelectWidget&&s.selectItemByData(o)}}processActionSave(){this.pushPending();let e={};for(let[i,s]of Object.entries(this.inputs))s instanceof OO.ui.CheckboxInputWidget&&(e[i]=s.isSelected()),s instanceof OO.ui.RadioSelectWidget&&(e[i]=s.findFirstSelectedItem()?.getData()),s instanceof OO.ui.ButtonSelectWidget&&(e[i]=s.findFirstSelectedItem()?.getData());z.save(e).then(this.onActionSaveSuccess.bind(this)).fail(this.onActionSaveError.bind(this)).always(()=>this.popPending())}onActionSaveError(e,i){let s={type:"settings",message:e};i?.error&&(s.code=i.error.code,s.message=i.error.info);let o=new OO.ui.Error(X("error-setting-save",s),{recoverable:!0});this.showErrors(o)}onActionSaveSuccess(){this.actions.setMode("finish"),this.stackLayout.setItem(this.panelFinish)}processActionReload(){this.pushPending(),window.location.reload()}};ae(pt);Rn=pt});var Ti,z,mt=v(()=>{C();S();H();U();Ts();Ti=class{loadPromise;isDependenciesLoaded=!1;isConstructed=!1;isOpen=!1;isLoading=!1;isRequesting=!1;isSaving=!1;mixin(){OO.EventEmitter.call(this)}load(){return this.isLoading?this.loadPromise:this.isDependenciesLoaded?(this.open(),!0):(this.isLoading=!0,this.error=null,this.loadPromise=$.when(mw.loader.using(ne(n.config.dependencies.settings))).then(this.onLoadSuccess.bind(this)).fail(this.onLoadError.bind(this)),this.loadPromise)}onLoadError(e){this.isLoading=!1,this.isDependenciesLoaded=!1,this.error={type:"dependencies",message:e?.message},E("error-dependencies-generic",this.error)}onLoadSuccess(){this.isLoading=!1,this.isDependenciesLoaded=!0,wt(),this.open()}construct(){this.isConstructed=!0;let e=(Is(),$t(As)).default;this.dialog=new e,this.manager=bt(),this.manager.addWindows([this.dialog])}open(){this.isOpen||(this.isConstructed||this.construct(),this.windowInstance=this.manager.openWindow(this.dialog),this.windowInstance.opening.then(this.onOpening.bind(this)),this.windowInstance.opened.then(this.onOpen.bind(this)),this.windowInstance.closing.then(this.onClosing.bind(this)),this.windowInstance.closed.then(this.onClose.bind(this)))}onOpening(){this.emit("opening")}onOpen(){this.isOpen=!0,this.emit("opened")}onClosing(){this.emit("closing")}onClose(){this.isOpen=!1,this.emit("closed")}request(){if(n.local.mwIsAnon)return $.Deferred().resolve().promise();this.isRequesting=!0;let e={action:"query",meta:"userinfo",uiprop:"options",format:"json",formatversion:2,uselang:n.local.userLanguage};return p.post(e).always(this.onRequestResponse.bind(this))}onRequestResponse(){this.isRequesting=!1}save(e){return xe(e,!0),n.local.mwIsAnon?$.Deferred().resolve().promise():(this.isSaving=!0,ne(["ext.GlobalPreferences.global"]).length>0?this.saveGlobal(e):this.saveLocal(e))}saveLocal(e){let i=[`${n.config.settingsPrefix}-settings`,JSON.stringify(e)],s=p.getApi();return s.saveOption.apply(s,i).always(this.onSaveResponse.bind(this))}saveGlobal(e){let i={action:"globalpreferences",optionname:`${n.config.settingsPrefix}-settings`,optionvalue:JSON.stringify(e)};return p.getApi().postWithEditToken(i).always(this.onSaveResponse.bind(this))}onSaveResponse(){this.isSaving=!1}},z=new Ti});var Cs=v(()=>{});var Ms,Wn,Nn,Ai,Rs,Ws=v(()=>{C();S();H();$e();re();Si();je();Se();we();ui();Oi();mt();ee();Cs();({h:Ms,hf:Wn,ht:Nn}=x),Ai=class{page;article;articleParams={};options={};nodes={};buttons={};actionRegister;watch;isDetached=!1;constructor(e,i,s,o){this.page=e,this.article=i,this.articleParams={...s},this.options={initiatorAction:null,links:{},...o},L.connect(this,{hotkey:"onHotkey"}),this.render()}render(){this.nodes.$container=$("<div>").addClass("instantDiffs-navigation"),this.nodes.$left=$("<div>").addClass(["instantDiffs-navigation-group","instantDiffs-navigation-group--left"]).appendTo(this.nodes.$container),this.nodes.$center=$("<div>").addClass(["instantDiffs-navigation-group","instantDiffs-navigation-group--center"]).appendTo(this.nodes.$container),this.nodes.$right=$("<div>").addClass(["instantDiffs-navigation-group","instantDiffs-navigation-group--right"]).appendTo(this.nodes.$container),this.renderSnapshotLinks(),this.renderNavigationLinks(),this.renderMenuLinks()}renderSnapshotLinks(){let e=[];this.buttons.snapshotPrev=this.renderSnapshotPrevLink(),e.push(this.buttons.snapshotPrev),this.buttons.snapshotNext=this.renderSnapshotNextLink(),e.push(this.buttons.snapshotNext),this.buttons.snapshotGroup=new OO.ui.ButtonGroupWidget({items:e}),this.nodes.$left.append(this.buttons.snapshotGroup.$element)}renderNavigationLinks(){let e=[],i={icon:null};this.buttons.prev=this.renderPrevLink(),e.push(this.buttons.prev),["page"].includes(this.article.get("typeVariant"))||(this.buttons.switch=this.renderSwitchLink({name:"switch",...i}),e.push(this.buttons.switch)),this.buttons.next=this.renderNextLink(),e.push(this.buttons.next),this.buttons.navigationGroup=new OO.ui.ButtonGroupWidget({items:e}),this.nodes.$center.append(this.buttons.navigationGroup.$element)}renderMenuLinks(){let e=[],i={invisibleLabel:!0};this.page.getInitiatorPage()&&(this.buttons.back=this.renderBackLink({name:"back",...i}),e.push(this.buttons.back)),a(this.options.links.unpatrolled)||(this.buttons.unpatrolled=this.renderUnpatrolledLink({name:"unpatrolled",...i}),e.push(this.buttons.unpatrolled)),this.buttons.menu=this.renderMenu(),e.push(this.buttons.menu),this.buttons.menuGroup=new OO.ui.ButtonGroupWidget({items:e}),this.nodes.$right.append(this.buttons.menuGroup.$element)}renderMenu(){let e={framed:!1,classes:["instantDiffs-button--link"]};f("showMenuIcons")||(e.icon=null),this.buttons.menuMobile=this.renderMenuMobileGroup(e),this.buttons.menuGroup=this.renderMenuGroup(e);let i=[this.buttons.menuMobile.$element.get(0),this.buttons.menuGroup.$element.get(0)];return new OO.ui.PopupButtonWidget({icon:"menu",label:l("goto-menu"),title:B("goto-menu","menu",f("enableHotkeys")),invisibleLabel:!0,popup:{$content:$(i),classes:["instantDiffs-buttons-popup",f("showMenuIcons")?"has-icons":null],width:"auto",padded:!1,anchor:!1,align:"backwards",autoClose:!0}})}renderMenuGroup(e){let i=[];return this.buttons.copy=this.renderCopyLink(e),i.push(this.buttons.copy),this.buttons.copyWiki=this.renderCopyWikiLink(e),i.push(this.buttons.copyWiki),this.buttons.type=this.renderTypeLink(e),i.push(this.buttons.type),a(this.article.get("title"))||(this.buttons.page=this.renderPageLink(e),i.push(this.buttons.page),this.article.getMW("title").canHaveTalkPage()&&(this.buttons.talkPage=this.renderTalkPageLink(e),i.push(this.buttons.talkPage)),Jt(mw.config.get("wgPageContentModel"))&&(this.buttons.edit=this.renderEditLink(e),i.push(this.buttons.edit)),this.buttons.history=this.renderHistoryLink(e),i.push(this.buttons.history),n.local.mwIsAnon||(this.buttons.watch=this.renderWatchLink(e),i.push(this.buttons.watch))),this.buttons.settings=this.renderSettingsLink(e),i.push(this.buttons.settings),i.push(Ii($("<hr>"))),this.buttons.id=this.renderIDLink(e),i.push(this.buttons.id),new OO.ui.ButtonGroupWidget({items:i,classes:["instantDiffs-buttons-group--vertical",f("showMenuIcons")?"has-icons":null]})}renderMenuMobileGroup(e){let i=[];return this.page.getInitiatorPage()&&(this.buttons.mobileBack=this.renderBackLink({name:"mobileBack",...e}),i.push(this.buttons.mobileBack)),a(this.options.links.unpatrolled)||(this.buttons.mobileUnpatrolled=this.renderUnpatrolledLink({name:"mobileUnpatrolled",...e}),i.push(this.buttons.mobileUnpatrolled)),["page"].includes(this.article.get("typeVariant"))||(this.buttons.mobileSwitch=this.renderSwitchLink({name:"mobileSwitch",...e}),i.push(this.buttons.mobileSwitch)),i.length>0&&i.push(Ii($("<hr>"))),new OO.ui.ButtonGroupWidget({items:i,classes:["instantDiffs-buttons-group--vertical","instantDiffs-buttons-group--mobile",f("showMenuIcons")?"has-icons":null]})}renderSnapshotPrevLink(){let e=be.instance.getPreviousLink(),i=new OO.ui.ButtonWidget({label:l("goto-snapshot-prev"),title:B("goto-snapshot-prev","snapshot-prev",f("enableHotkeys")),href:e?e.href:null,target:R(!0),invisibleLabel:!0,icon:"doubleChevronStart",disabled:!e});return e&&new P(i.$button.get(0),{behavior:"event",initiatorLink:e,onRequest:()=>this.setActionRegister("snapshotPrev")}),i}renderSnapshotNextLink(){let e=be.instance.getNextLink(),i=new OO.ui.ButtonWidget({label:l("goto-snapshot-next"),title:B("goto-snapshot-next","snapshot-next",f("enableHotkeys")),href:e?e.href:null,target:R(!0),invisibleLabel:!0,icon:"doubleChevronEnd",disabled:!e});return e&&new P(i.$button.get(0),{behavior:"event",initiatorLink:e,onRequest:()=>this.setActionRegister("snapshotNext")}),i}renderPrevLink(){let e;if(this.options.links.prev){let o=new F({title:this.article.get("title"),hostname:this.article.get("hostname"),oldid:mw.config.get("wgDiffOldId"),diff:this.article.get("type")==="diff"?"prev":null,direction:this.article.get("type")==="revision"?"prev":null});e=W(o)}let i=at({short:l("goto-prev"),long:l(`goto-prev-${this.article.get("type")}`),iconBefore:document.dir==="ltr"?"\u2190":"\u2192"}),s=new OO.ui.ButtonWidget({label:$(i),title:B(`goto-prev-${this.article.get("type")}`,"prev",f("enableHotkeys")),href:e,target:R(!0),disabled:!e});return e&&new P(s.$button.get(0),{behavior:"event",onRequest:()=>this.setActionRegister("prev")}),s}renderNextLink(){let e;if(this.options.links.next){let o=new F({title:this.article.get("title"),hostname:this.article.get("hostname"),oldid:mw.config.get("wgDiffNewId"),diff:this.article.get("type")==="diff"?"next":null,direction:this.article.get("type")==="revision"?"next":null});e=W(o)}let i=at({short:l("goto-next"),long:l(`goto-next-${this.article.get("type")}`),iconAfter:document.dir==="ltr"?"\u2192":"\u2190"}),s=new OO.ui.ButtonWidget({label:$(i),title:B(`goto-next-${this.article.get("type")}`,"next",f("enableHotkeys")),href:e,target:R(!0),disabled:!e});return e&&new P(s.$button.get(0),{behavior:"event",onRequest:()=>this.setActionRegister("next")}),s}renderSwitchLink(e){let i=this.article.get("type")==="diff"?"revision":"diff",s={type:i},o=new OO.ui.ButtonWidget({label:l(`goto-view-${i}`),title:B(`goto-view-${i}`,"switch",f("enableHotkeys")),href:W(this.article,{},s),target:R(!0),icon:"specialPages",classes:["instantDiffs-button--switch"],...e});return new P(o.$button.get(0),{behavior:"event",onRequest:()=>this.setActionRegister(e.name)}),o}renderUnpatrolledLink(e){let i=new OO.ui.ButtonWidget({label:l("goto-view-unpatrolled"),title:B("goto-view-unpatrolled","unpatrolled",f("enableHotkeys")),href:this.options.links.unpatrolled,target:R(!0),icon:"info",classes:["instantDiffs-button--pending"],...e});return new P(i.$button.get(0),{behavior:"event",initiatorPage:this.page,onRequest:()=>this.setActionRegister(e.name)}),i}renderBackLink(e){let i=this.page.getInitiatorPage(),s=i.getArticle(),o=new OO.ui.ButtonWidget({label:l(`goto-back-${s.get("type")}`),title:B(`goto-back-${s.get("type")}`,"back",f("enableHotkeys")),href:W(s,i.getArticleParams()),target:R(!0),icon:"newline",classes:["instantDiffs-button--back"],...e}),r=i.getNavigation()?.getActionRegister(),d=a(r)?e.name:`${r}-${e.name}`;return new P(o.$button.get(0),{behavior:"event",onRequest:()=>this.setActionRegister(d)}),o}renderCopyLink(e){let i=new OO.ui.ButtonWidget({label:l("copy-link"),icon:"link",...e});return i.helper=new V({node:i.$button.get(0),handler:this.actionCopyLink.bind(this)}),i}renderCopyWikiLink(e){let i=new OO.ui.ButtonWidget({label:l("copy-wikilink"),icon:"wikiText",...e});return i.helper=new V({node:i.$button.get(0),handler:this.actionCopyWikilink.bind(this)}),i}renderTypeLink(e){return new OO.ui.ButtonWidget({label:l(`goto-${this.article.get("type")}`),href:W(this.article),target:R(!0),icon:"articleRedirect",...e})}renderPageLink(e){let i=this.article.getMW("title").isTalkPage()?this.article.getMW("title").getSubjectPage().getUrl():this.article.get("href"),s={2:"userAvatar",3:"userAvatar",default:"article"};return new OO.ui.ButtonWidget({label:l("goto-page"),href:N(this.article,i),target:R(!0),icon:s[this.article.getMW("title").getNamespaceId()]||s.default,...e})}renderTalkPageLink(e){let i=this.article.getMW("title").isTalkPage()?this.article.get("href"):this.article.getMW("title").getTalkPage().getUrl(),s={2:"userTalk",3:"userTalk",default:"speechBubbles"};return new OO.ui.ButtonWidget({label:l("goto-talkpage"),href:N(this.article,i),target:R(!0),icon:s[this.article.getMW("title").getNamespaceId()]||s.default,...e})}renderEditLink(e){let i=mw.config.get("wgIsProbablyEditable"),s=mw.util.getUrl(this.article.get("title"),{action:"edit"});return new OO.ui.ButtonWidget({label:l(i?"goto-edit":"goto-source"),href:N(this.article,s),target:R(!0),icon:i?"edit":"editLock",...e})}renderHistoryLink(e){let i=mw.util.getUrl(this.article.get("title"),{action:"history"});return new OO.ui.ButtonWidget({label:l("goto-history"),href:N(this.article,i),target:R(!0),icon:"history",...e})}renderWatchLink(e){let i=new OO.ui.ButtonWidget({...e});return i.helper=new V({node:i.$button.get(0),handler:this.actionWatchPage.bind(this)}),_e(this.article,i),i}renderSettingsLink(e){let i=new OO.ui.ButtonWidget({label:l("goto-settings"),icon:"settings",...e});return i.helper=new V({node:i.$button.get(0),handler:this.actionOpenSettings.bind(this)}),i}renderIDLink(e){let i=Wn(Ms("span.name",l("script-name")),Nn(" "),Ms("span.version",`v.${n.config.version}`));return e={label:$(i),href:fe(`/wiki/${n.config.link}`),target:R(!0),classes:[],...e},e.classes.push("instantDiffs-button--link-id"),new OO.ui.ButtonWidget(e)}actionCopyLink(){let e={relative:!1,minify:f("linksFormat")==="minify"},i=W(this.article,{},e);Fe(i),this.toggleMenu(!1),this.focusButton("menu")}actionCopyWikilink(){this.buttons.copyWiki.helper.pending(!0),$.when(ai(this.article)).done(e=>{Fe(e)}).fail(()=>{Fe(!1)}).always(()=>{this.buttons.copyWiki.helper.pending(!1),this.toggleMenu(!1),this.focusButton("menu")})}actionWatchPage(){this.watch||(this.watch=new gt(this.article,this.buttons.watch)),this.buttons.watch.helper.pending(!0),$.when(this.watch.request()).always(()=>{this.buttons.watch.helper.pending(!1),this.toggleMenu(!1),this.focusButton("menu")})}actionOpenSettings(){z.once("opening",()=>this.toggleMenu(!1)),z.once("closed",()=>this.focusButton("menu")),this.buttons.settings.helper.pending(!0),$.when(z.load()).always(()=>this.buttons.settings.helper.pending(!1))}setActionRegister(e){this.actionRegister=e}getActionRegister(){return this.actionRegister}onHotkey(e){if(!f("enableHotkeys"))return;let i=e.ctrlKey,s=e.shiftKey,o=e.altKey,g={ctrl:{ArrowLeft:"snapshotPrev",ArrowRight:"snapshotNext",ArrowUp:"switch",ArrowDown:"menu",KeyZ:"back",KeyP:"unpatrolled"},none:{ArrowLeft:"prev",ArrowRight:"next"},alt:{},shift:{}}[o?"alt":i?"ctrl":s?"shift":"none"]?.[e.code];g&&(e.preventDefault(),e.stopPropagation(),this.clickButton(g))}toggleMenu(e){this.buttons.menu.getPopup().toggle(e)}focusButton(e){let i={unpatrolled:"back",mobileUnpatrolled:"backMobile","unpatrolled-back":"unpatrolled","mobileUnpatrolled-backMobile":"mobileUnpatrolled"},s={next:"prev",prev:"next",snapshotNext:"snapshotPrev",snapshotPrev:"snapshotNext"};e=i[e]||e;let o=this.buttons[e];o&&o.isDisabled()&&(e=s[e],o=this.buttons[e]),o&&o.focus()}clickButton(e){e!=="menu"&&this.toggleMenu(!1);let i=this.buttons[e];i&&!i.isDisabled()&&(i.focus(),i.$button.get(0).click())}fire(){this.focusButton(this.options.initiatorAction)}embed(e,i){j(this.nodes.$container,e,i)}detach(){this.toggleMenu(!1),L.disconnect(this,{hotkey:"onHotkey"}),this.nodes.$container.detach(),this.isDetached=!0}},Rs=Ai});var Ns=v(()=>{});var Ci,ke,vt=v(()=>{C();S();ut();re();$e();U();$s();Es();Ws();Ns();Ci=class{static utils=He;type="abstract";article;options={};articleParams={};error;errorData;nodes={};links={};configManager;userOptionsManager;requestManager;loadPromise;navigation;isLoading=!1;isLoaded=!1;isConfigsChanged=!1;isDetached=!1;constructor(e,i){this.article=e,this.options={initiatorAction:null,initiatorPage:null,fireDiffHook:!0,fireContentHook:!0,...i},this.articleParams={action:"render",diffonly:this.article.get("type")==="diff"?1:0,unhide:f("unHideDiffs")?1:0,uselang:n.local.userLanguage},this.configManager=new yi({wgTitle:!1,wgPageName:!1,wgRelevantPageName:!1,wgPageContentModel:"wikitext",wgNamespaceNumber:!1,wgArticleId:!1,wgRelevantArticleId:!1,wgCurRevisionId:!1,wgRevisionId:!1,wgDiffOldId:!1,wgDiffNewId:!1,wgCanonicalSpecialPageName:!1,wgIsProbablyEditable:!1,wgRelevantPageIsProbablyEditable:!1,wbEntityId:!1,"thanks-confirmation-required":!0}),this.userOptionsManager=new yi({},mw.user.options),this.requestManager=new Ss,OO.EventEmitter.call(this)}load(){return this.isLoading?this.loadPromise:(this.isLoading=!0,this.isLoaded=!1,this.error=null,this.errorData=null,this.loadPromise=this.preloadProcess())}preloadProcess(){let e=this.getPreloadPromises();return Promise.allSettled(e).then(this.loadProcess.bind(this))}loadProcess(){let e=this.getLoadPromises();return Promise.allSettled(e).then(this.onLoadResponse).then(this.loadProcessSecondary)}loadProcessSecondary=()=>{let e=this.getLoadSecondaryPromises();return Promise.allSettled(e)};getPreloadPromises(){return[this.requestCompare()]}getLoadPromises(){return[this.requestPageInfo(),this.request()]}getLoadSecondaryPromises(){return[this.requestWBLabel()]}onLoadResponse=async()=>{this.isLoading=!1,this.isLoaded=!0,!this.isDetached&&this.error?.statusText!=="abort"&&(a(this.data)?await this.renderError():await this.renderSuccess())};request(){return this.requestProcess().done(this.onRequestDone.bind(this)).fail(this.onRequestError.bind(this))}requestProcess(){return this.requestManager.when()}onRequestError(e,i){this.error=e,this.errorData=i?.error}onRequestDone(e){this.data=e}requestCompare(){let e=this.article.getValues();if(this.error||e.typeVariant!=="comparePages"||h(e.oldid)&&h(e.diff))return $.Deferred().resolve().promise();let i={action:"compare",prop:["title","ids","timestamp","comment"],fromrev:h(e.rev1)?e.rev1:void 0,fromtitle:a(e.page1)?void 0:e.page1,torev:h(e.rev2)?e.rev2:void 0,totitle:a(e.page2)?void 0:e.page2,format:"json",formatversion:2,uselang:n.local.userLanguage};return this.requestManager.get(i,e.hostname).then(this.onRequestCompareDone).fail(this.onRequestCompareError)}onRequestCompareError=(e,i)=>{this.onRequestError(e,i)};onRequestCompareDone=e=>{let i=e?.compare;if(!i)return this.onRequestCompareError(null,e);this.article.set({oldid:i.fromrevid,diff:i.torevid,page1:i.fromtitle,page2:i.totitle,title:oe(i),section:Le(i)})};async requestPageInfo(){let e=Math.max(this.article.get("revid"),this.article.get("oldid")),i=this.article.get("curid"),s=this.article.get("title"),o={};h(e)?o.revids=e:h(i)?o.pageids=i:a(s)||(o.titles=s);let r=await p.getPageInfo(o,this.article.get("hostname"),this.requestManager);if(r){let d=r.pageprops||{},g=r.entityterms||{};this.configManager.setValues({wgArticleId:r.pageid,wgRelevantArticleId:r.pageid,wgCurRevisionId:r.lastrevid,wgContentLanguage:r.pagelanguage,wgContentLanguageDir:r.pagelanguagedir,wgPageContentModel:r.contentmodel,wgIsProbablyEditable:r.actions?.edit,wgRelevantPageIsProbablyEditable:r.actions?.edit,wbEntityId:d.wikibase_item||me(r.contentmodel)&&r.title||this.configManager.get("wbEntityId")}),this.article.setValues({title:r.title,curid:r.pageid,curRevid:r.lastrevid,watched:r.watched,expiry:r.watchlistexpiry,notificationtimestamp:r.notificationtimestamp,new:r.new,label:me(r.contentmodel)&&g.label?.[0]||r.contentmodel==="EntitySchema"&&Qt(d.displaytitle)||r.contentmodel==="zobject"&&Yt(d)||this.article.get("label")}),this.setConfigs()}}async requestWBLabel(){if(this.error||!a(this.article.get("label"))||!me(this.configManager.get("wgPageContentModel")))return $.Deferred().resolve().promise();let e=this.article.getMW("title")?.getMain(),i=await p.getWBLabel(e,this.article.get("hostname"),this.requestManager);a(i)||(this.configManager.set("wbEntityId",e),this.article.setValue("label",i),this.setConfigs())}markAsSeen(){if(this.error||!f("markWatchedLine")||!this.article.isForeign||a(this.article.get("timestamp"))||a(this.article.get("notificationtimestamp")))return;let e=new Date(this.article.get("notificationtimestamp")).getTime();if(new Date(this.article.get("timestamp")).getTime()<e)return;let s={titles:this.article.get("titleText"),newerthanrevid:this.article.get("revid")};p.markAsSeen(s,this.article.get("hostname"))}abort(){this.isLoading&&this.requestManager.abort()}async renderSuccess(){await this.render(),this.markAsSeen(),mw.hook(`${n.config.prefix}.page.renderSuccess`).fire(this),mw.hook(`${n.config.prefix}.page.renderComplete`).fire(this)}async renderError(){let e=this.article.get("type"),i=this.article.get("typeVariant"),s=i==="page"?"curid":i==="comparePages"?"compare-pages":"generic";this.error={type:e,code:s,status:this.error?.status,statusText:this.error?.statusText,message:this.errorData?.info||Mt(this.error?.status)},E(`error-${this.error.type}-${this.error.code}`,this.error,this.article),await this.render(),mw.hook(`${n.config.prefix}.page.renderError`).fire(this),mw.hook(`${n.config.prefix}.page.renderComplete`).fire(this)}async render(){let e=["instantDiffs-page",`instantDiffs-page--${this.type}`,`instantDiffs-page--${this.article.get("type")}`,"mw-body-content"],i=["instantDiffs-page-body",`instantDiffs-page-body--${this.type}`,`instantDiffs-page-body--${this.article.get("type")}`],s=n.config.skinBodyClasses[mw.config.get("skin")];s&&e.push(...s),this.nodes.$container=$("<div>").attr("dir",document.dir).addClass(e),this.nodes.$tools=$("<div>").addClass("instantDiffs-page-tools").appendTo(this.nodes.$container),this.nodes.$body=$("<div>").addClass(i).appendTo(this.nodes.$container),this.error?await this.renderErrorContent():await this.renderContent(),this.renderNavigation()}async renderContent(){await this.restoreFunctionality(),this.requestDependencies()}async renderErrorContent(){let e=X(`error-${this.error.type}-${this.error.code}`,this.error,this.article),i=$(`<p>${e}</p>`);this.renderWarning({$content:i})}renderWarning({$content:e,type:i="warning",container:s=this.nodes.$body,insertMethod:o="prependTo"}){let r=Bt({$content:e,type:i});return j(r,s,o),r}renderNavigation(){this.navigation=new Rs(this,this.article,this.articleParams,{initiatorAction:this.options.initiatorAction,links:this.links}),this.navigation.embed(this.nodes.$container,"prependTo")}requestDependencies(e={}){let{modulestyles:i=[],modulescripts:s=[],modules:o=[]}=e,r=[...ti(this.article),...i,...s,...o];return mw.loader.using(ne(r))}async restoreFunctionality(){if(!this.error&&(this.nodes.$mediaInfoView=this.nodes.$body.find("mediainfoview"),this.article.get("type")==="revision"&&this.nodes.$mediaInfoView.length>0)){let e=await vi(this.nodes.$mediaInfoView);e&&j(e,this.nodes.$diffTitle,"insertAfter")}}async fire(){if(mw.hook(`${n.config.prefix}.page.ready`).fire(this),this.getNavigation()?.fire(),this.options.fireDiffHook){let e=this.getDiffTable();this.article.get("type")==="diff"&&e?.length>0&&mw.hook("wikipage.diff").fire(e)}if(this.options.fireContentHook){let e=this.getContainer();e?.length>0&&mw.hook("wikipage.content").fire(e)}Z(this.nodes.$container),mw.hook(`${n.config.prefix}.page.complete`).fire(this)}focus(){this.emit("focus")}setConfigs(){this.isConfigsChanged=!0,this.configManager.apply(),this.userOptionsManager.apply()}restoreConfigs(){this.isConfigsChanged&&(this.isConfigsChanged=!1,this.configManager.restore(),this.userOptionsManager.restore())}getArticle(){return this.article}getArticleTitleText(){let e=this.article.getValues(),i;return!a(e.page1Text)&&!a(e.page2Text)?i=`${e.page1Text} \u2192 ${e.page2Text}`:a(e.titleText)?i=l(this.error?"dialog-title-not-found":"dialog-title-empty"):i=e.titleText,a(e.label)?i:`${e.label} (${i})`}getArticleParams(){return this.articleParams}getContainer(){return this.nodes.$container}getDiffTable(){return this.nodes.$table}getInitiatorPage(){return this.options.initiatorPage}getNavigation(){return this.navigation}close(){this.emit("close")}detach(){this.isDetached||(mw.hook(`${n.config.prefix}.page.beforeDetach`).fire(this),this.abort(),this.restoreConfigs(),this.getNavigation()?.detach(),this.getContainer()?.detach(),this.isDetached=!0)}},ke=Ci});var Mi,kt,Ri=v(()=>{C();S();ut();H();vt();Mi=class extends ke{type="local";isDependenciesLoaded=!1;getLoadPromises(){let e=super.getLoadPromises();return this.article.get("type")==="revision"&&(this.article.get("typeVariant")!=="page"&&h(this.article.get("revid"))||this.article.get("typeVariant")==="page"&&h(this.article.get("curid")))&&e.push(this.requestPage()),e}requestPage(){if(this.error)return $.Deferred().resolve().promise();let e={action:"parse",prop:["revid","modules","jsconfigvars"],disablelimitreport:1,redirects:1,format:"json",formatversion:2,uselang:n.local.userLanguage},i=this.configManager.get("wgDiffNewId")||Math.max(this.article.get("revid"),this.article.get("oldid")),s=this.configManager.get("wgArticleId")||this.article.get("curid");return h(i)?e.oldid=i:h(s)&&(e.pageid=s),this.requestManager.get(e).then(o=>this.onRequestPageDone(o,e)).fail((o,r)=>this.onRequestPageError(o,r,e))}onRequestPageError(e,i,s){this.isDependenciesLoaded=!0;let o={message:e,type:"dependencies"};i?.error&&(o.code=i.error.code,o.message=i.error.info);let r=s.oldid?"revid":"curid";E(`error-dependencies-${r}`,o,this.article,!0)}onRequestPageDone(e,i){this.isDependenciesLoaded=!0;let s=e?.parse;if(!s)return this.onRequestPageError(null,e,i);this.configManager.setValues({wgArticleId:s.pageid,wgRevisionId:Math.max(this.article.get("revid"),s.revid),...s.jsconfigvars}),this.article.setValues({curid:this.configManager.get("wgArticleId"),revid:this.configManager.get("wgRevisionId")}),this.setConfigs(),this.requestDependencies(s)}requestProcess(){if(this.error)return $.Deferred().resolve().promise();let e=this.article.getValues(),i={title:a(e.title)?void 0:e.title,diff:a(e.diff)?e.direction:e.diff,oldid:a(e.oldid)?void 0:e.oldid,curid:a(e.curid)?void 0:e.curid},s={url:n.local.mwEndPoint,dataType:"html",data:$.extend(i,this.articleParams)};return this.requestManager.ajax(s)}async renderContent(){this.nodes.data=$.parseHTML(this.data),this.nodes.$data=$(this.nodes.data).appendTo(this.nodes.$body),this.collectData(),this.setConfigs(),this.nodes.$data.filter(".cdx-message").prependTo(this.nodes.$body),this.nodes.$data.find(".cdx-message ").prependTo(this.nodes.$body);let e=this.nodes.$data.filter("p");e.length>0&&this.renderWarning({$content:e}),this.processDiffTable(),this.processFlaggedRevs(),this.article.get("type")==="revision"&&this.processRevision(),await super.renderContent()}collectData(){let e={},i=this.nodes.$data.find("#mw-diff-otitle1 strong > a, #differences-prevlink"),s=this.nodes.$data.find("#mw-diff-ntitle1 strong > a, #differences-nextlink");if(i.length>0){let g=Number(De("oldid",i.prop("href")));h(g)&&this.configManager.set("wgDiffOldId",g);let c=De("title",i.prop("href"))||i.prop("title");a(c)||(e.page1=c,e.title=c)}if(s.length>0){let g=Number(De("oldid",s.prop("href")));h(g)&&(this.configManager.setValues({wgDiffNewId:g,wgRevisionId:g}),e.revid=g,this.article.get("diff")==="cur"&&(e.diff=g));let c=De("title",s.prop("href"))||s.prop("title");a(c)||(e.page2=c,e.title=c)}e.page1===e.page2&&(delete e.page1,delete e.page2);let o=this.nodes.$data.find("#mw-diff-ntitle1 .mw-diff-timestamp");o.length>0&&(e.timestamp=o.attr("data-timestamp"));let r=this.nodes.$data.find("#mw-diff-ntitle3 .autocomment a");a(this.article.get("section"))&&r.length>0&&(e.section=J("hash",r.prop("href"))),this.nodes.$data.find(".mw-diff-undo a, .mw-rollback-link a").length>0&&this.configManager.set("wgIsProbablyEditable",!0),this.article.set(e),this.configManager.setTitle(this.article.getMW("title")),this.article.get("type")!=="diff"&&!dt(this.configManager.get("wgPageContentModel"))&&this.userOptionsManager.set("visualeditor-diffmode-historical","source")}processDiffTable(){this.nodes.$diffTablePrefix=this.nodes.$data.filter(".mw-diff-table-prefix"),(this.article.get("type")!=="diff"||!f("showDiffTools"))&&this.nodes.$diffTablePrefix.addClass("instantDiffs-hidden"),this.nodes.$table=this.nodes.$data.filter("table.diff"),this.nodes.$prev=this.nodes.$table.find("#differences-prevlink").attr("data-instantdiffs-link","none").addClass("instantDiffs-hidden"),this.nodes.$next=this.nodes.$table.find("#differences-nextlink").attr("data-instantdiffs-link","none").addClass("instantDiffs-hidden");let e=this.nodes.$table.find("#mw-diff-otitle4");e.length>0&&e.contents().each((s,o)=>{o.nodeType===3&&o.remove()});let i=this.nodes.$table.find("#mw-diff-ntitle4");i.length>0&&i.contents().each((s,o)=>{o.nodeType===3&&o.remove()}),this.nodes.$data.filter(".mw-revslider-container, .mw-diff-revision-history-links,  #mw-oldid").addClass("instantDiffs-hidden"),this.links.prev=this.article.get("type")==="revision"?h(this.configManager.get("wgDiffOldId")):this.nodes.$prev.attr("href"),this.links.next=this.nodes.$next.attr("href")}processRevision(){this.nodes.$diffTitle=this.nodes.$data.filter(".diff-currentversion-title"),Ue(this.nodes.$table),this.nodes.$data.find(".mw-diff-slot-header, .mw-slot-header").addClass("instantDiffs-hidden")}processFlaggedRevs(){this.nodes.$frDiffHeader=this.nodes.$data.filter("#mw-fr-diff-headeritems").insertBefore(this.nodes.$table),this.nodes.$unpatrolled=this.nodes.$frDiffHeader.find(".fr-diff-to-stable a").attr("data-instantdiffs-link","none").addClass("instantDiffs-hidden"),this.article.get("type")==="diff"&&(this.links.unpatrolled=this.nodes.$unpatrolled.attr("href")),this.article.get("type")==="revision"&&(f("showRevisionInfo")?this.nodes.$frDiffHeader.find(".fr-diff-ratings td:nth-child(2n-1)").addClass("instantDiffs-hidden"):this.nodes.$frDiffHeader.addClass("instantDiffs-hidden")),this.nodes.$data.find(".fr-diff-to-stable, #mw-fr-diff-dataform").addClass("instantDiffs-hidden")}restoreFunctionalityEmbed(){if(this.error)return;Fs("mediawiki.misc-authed-curate"),wi(this.nodes.$body);let e=[];if(this.article.get("type")==="diff"&&f("showDiffTools")){let i=pi(this.nodes.$diffTablePrefix);i&&e.push(i);let s=mi(this.nodes.$diffTablePrefix);s&&e.push(s)}if(this.nodes.$diffTablePrefix?.length>0){let i=this.nodes.$diffTablePrefix.children(":visible").length>0;this.nodes.$diffTablePrefix.toggleClass("instantDiffs-hidden",!i||e.length===0)}if(this.nodes.$wikiLambdaApp=this.nodes.$body.find("#ext-wikilambda-app"),this.nodes.$wikiLambdaApp.length>0){let i=$(Y("dialog-notice-wikilambda"));this.renderWarning({$content:i,type:"notice",container:this.nodes.$wikiLambdaApp,insertMethod:"insertBefore"})}}restoreFunctionalityWithDependencies(){this.error||this.nodes.$wikiLambdaApp.length>0&&bi(this.nodes.$wikiLambdaApp)}async fire(){this.restoreFunctionalityEmbed(),this.article.get("type")==="revision"&&!this.isDependenciesLoaded&&await this.requestPage(),this.restoreFunctionalityWithDependencies(),await super.fire()}},kt=Mi});var Fn,Wi,yt,Ni=v(()=>{C();S();ut();re();$e();U();vt();ee();({h:Fn}=x),Wi=class extends ke{type="foreign";compare;parse;linkTags=[];constructor(e,i){super(e,{...i,fireDiffHook:!1})}getLoadPromises(){return[this.requestMessages(),this.requestSiteInfo(),...super.getLoadPromises()]}getLoadSecondaryPromises(){let e=super.getLoadSecondaryPromises();return this.article.get("type")==="revision"&&e.push(this.requestRevision()),e}requestProcess(){let e=this.article.getValues(),i={action:"compare",prop:["title","ids","rel","timestamp","user","diff","parsedcomment"],fromrev:h(e.oldid)?e.oldid:void 0,fromrelative:I(e.oldid)?e.oldid:void 0,torev:h(e.diff)?e.diff:void 0,difftype:ue()?"inline":"table",format:"json",formatversion:2,uselang:n.local.userLanguage};return e.type==="diff"&&!h(e.diff)&&(i.torelative=I(e.diff)?e.diff:"prev"),e.type==="revision"&&!h(e.diff)&&(i.torelative=I(e.direction)?e.direction:"prev"),e.typeVariant==="page"&&h(e.curid)&&(i.fromid=e.curid,i.torelative="cur"),this.requestManager.get(i,this.article.get("hostname"))}onRequestDone(e){this.data=e?.compare}async requestSiteInfo(){let e=["general","namespaces","namespacealiases"],i=await p.getSiteInfo(e,this.article.get("hostname"),this.requestManager)||{};if(!A(i)){let s=i.general;A(s)||(this.article.set({hostname:s.servername}),this.configManager.setValues({wgServer:s.server,wgServerName:s.servername,wgMobileServer:s.mobileserver,wgMobileServerName:s.mobileservername}));let o=zt(this.article.get("hostname"));this.configManager.setValues(o),this.setConfigs()}}async requestMessages(){let e=["revisionasof","currentrev-asof","word-separator","pipe-separator","parentheses","talkpagelinktext","contribslink","changeslist-nocomment","rev-deleted-no-diff","rev-deleted-user","rev-deleted-comment","diff-empty"];await p.loadMessage(e)}async render(){await super.render(),this.renderForeignWarning()}async renderContent(){this.collectData(),this.setConfigs(),await this.renderDiffTable(),this.requestDependencies()}collectData(){this.configManager.setValues({wgArticleId:this.data.toid,wgRevisionId:this.data.torevid,wgDiffOldId:this.data.fromrevid,wgDiffNewId:this.data.torevid});let e=$("<span>").html(this.data.fromparsedcomment).find(".autocomment a");e.length>0&&(this.data.fromsection=J("hash",e.prop("href")));let i=$("<span>").html(this.data.toparsedcomment).find(".autocomment a");i.length>0&&(this.data.tosection=J("hash",i.prop("href")));let s={previd:this.data.prev,nextid:this.data.next,curid:this.configManager.get("wgArticleId"),revid:this.configManager.get("wgRevisionId"),title:oe(this.data),section:this.data.tosection,timestamp:this.data.totimestamp};this.data.fromid!==this.data.toid&&(s.page1=this.data.fromtitle,s.page2=this.data.totitle),this.article.set(s),this.configManager.setTitle(this.article.getMW("title")),this.links.prev=this.article.get("type")==="revision"?h(this.data.fromrevid):this.data.prev&&this.data.prev!==this.data.fromrevid,this.links.next=this.data.next&&this.data.next!==this.data.torevid}async renderDiffTable(){if(this.nodes.table=gi(this.data.body),(this.data.fromtexthidden||this.data.totexthidden)&&await this.renderDeletedWarning(),this.data.fromid){let e=ft({prefix:"o",title:this.data.fromtitle,revid:this.data.fromrevid,curRevid:this.article.get("curRevid"),hostname:this.article.get("hostname"),timestamp:this.data.fromtimestamp,texthidden:this.data.fromtexthidden,user:this.data.fromuser,userhidden:this.data.fromuserhidden,comment:this.data.fromparsedcomment,commenthidden:this.data.fromcommenthidden});j(e,this.nodes.table.deleted)}else this.nodes.table.added.colSpan=4,this.nodes.table.deleted.classList.add("instantDiffs-hidden");if(this.data.toid){let e=ft({prefix:"n",title:this.data.totitle,revid:this.data.torevid,curRevid:this.article.get("curRevid"),hostname:this.article.get("hostname"),timestamp:this.data.totimestamp,texthidden:this.data.totexthidden,user:this.data.touser,userhidden:this.data.touserhidden,comment:this.data.toparsedcomment,commenthidden:this.data.tocommenthidden});j(e,this.nodes.table.added)}else this.nodes.table.deleted.colSpan=4,this.nodes.table.added.classList.add("instantDiffs-hidden");this.nodes.$table=$(this.nodes.table.container).appendTo(this.nodes.$body),G(this.nodes.$table,`https://${this.article.get("hostname")}`),this.article.get("type")==="revision"&&Ue(this.nodes.$table)}async renderErrorContent(){this.errorData?.code==="missingcontent"?await this.renderDeletedWarning():await super.renderErrorContent();let e=this.article.getValues(),i=this.errorData?.code==="missingcontent"?this.errorData.info.replace(/\D/g,""):null,s=[e.oldid,e.diff,i].filter(o=>!isNaN(o)&&o>0);this.configManager.setValues({wgDiffOldId:Math.min(...s),wgDiffNewId:Math.max(...s)}),this.setConfigs(),this.configManager.get("wgDiffOldId")!==this.configManager.get("wgDiffNewId")&&(this.links.prev=h(this.configManager.get("wgDiffOldId")),this.links.next=h(this.configManager.get("wgDiffNewId"))),this.options.initiatorPage=L.getPreviousPage()}renderForeignWarning(){let e=$(Y(`dialog-notice-foreign-${this.article.get("type")}`,`https://${this.article.get("hostname")}`,this.article.get("hostname")));this.nodes.$foreignWarning=this.renderWarning({$content:e,type:"notice"})}async renderDeletedWarning(){let e=await p.parseWikitext({title:this.article.get("title"),text:mw.msg("rev-deleted-no-diff")},this.article.get("hostname")),i=$(e).find("p");this.nodes.$deleteWarning=this.renderWarning({$content:i,type:"warning",container:this.nodes.$foreignWarning,insertMethod:"insertAfter"})}requestRevision(){if(this.error)return $.Deferred().resolve().promise();let e={action:"parse",prop:["text","revid","modules","jsconfigvars"],disablelimitreport:1,redirects:1,format:"json",formatversion:2,uselang:n.local.userLanguage},i=Math.max(this.article.get("revid"),this.article.get("oldid")),s=this.article.get("curid");return h(i)?e.oldid=i:h(s)&&(e.pageid=s),this.requestManager.get(e,this.article.get("hostname")).then(o=>this.onRequestRevisionDone(o,e)).fail((o,r)=>this.onRequestRevisionError(o,r,e))}onRequestRevisionError(e,i,s){let o={message:e,type:"dependencies"};i?.error&&(o.code=i.error.code,o.message=i.error.info);let r=s.oldid?"revid":"curid";E(`error-dependencies-${r}`,o,this.article)}async onRequestRevisionDone(e,i){if(this.parse=e?.parse,!this.parse)return this.onRequestRevisionError(null,e,i);await this.renderRevision()}async renderRevision(){this.configManager.setValues({wgArticleId:this.parse.pageid,wgRevisionId:Math.max(this.article.get("revid"),this.parse.revid),...this.parse.jsconfigvars}),this.article.setValues({curid:this.configManager.get("wgArticleId"),revid:this.configManager.get("wgRevisionId")}),this.setConfigs();let e=this.article.get("revid")===this.article.get("curRevid")?"currentrev-asof":"revisionasof";this.nodes.diffTitle=Fn("h2",{class:"diff-currentversion-title"},mw.msg(e,Be(this.data.totimestamp))),this.nodes.$diffTitle=$(this.nodes.diffTitle).appendTo(this.nodes.$body),this.nodes.$revision=$(this.parse.text).appendTo(this.nodes.$body),await this.processRevision(),G(this.nodes.$revision,this.article.get("href")),this.requestDependencies(this.parse),this.requestForeignDependencies()}async processRevision(){if(this.nodes.$body.find("#ext-wikilambda-app, .ext-wikilambda-view-nojsfallback, .mw-diff-slot-header, .mw-slot-header").addClass("instantDiffs-hidden"),this.nodes.$wikiLambdaApp=this.nodes.$body.find("#ext-wikilambda-app"),this.nodes.$wikiLambdaApp.length>0){let e=$(`<p>${l("dialog-notice-foreign-wikilambda")}</p>`);this.renderWarning({$content:e,type:"notice",container:this.nodes.$wikiLambdaApp,insertMethod:"insertBefore"})}await this.restoreFunctionality()}requestForeignDependencies(){let e=ii(this.article);si(this.article,e.modules),ni(this.article,e.styles),this.linkTags=oi(e.links)}detach(){this.isDetached||(super.detach(),ri(this.linkTags))}},yt=Wi});var Vs=v(()=>{});var xt,qs,js=v(()=>{H();xt=class extends OO.ui.LabelWidget{static tagName="div";constructor(){super({classes:["oo-ui-messageDialog-message","is-transparent"]})}toggleVisibility(e){this.$element.toggleClass("is-transparent",!e)}};ae(xt);qs=xt});var Dt,Bs,Us=v(()=>{S();H();Dt=class extends OO.ui.ProgressBarWidget{toggleDelay;toggleTime;constructor(e){super({classes:["instantDiffs-view-loader","is-transparent"],progress:!1,inline:!0,...e})}toggleVisibility(e,i){if(this.toggleDelay&&clearTimeout(this.toggleDelay),i&&(this.toggle(e),Qe(()=>this.$element.toggleClass("is-transparent",!e))),e===!0&&(this.toggleTime=Date.now(),this.toggle(!0),Qe(()=>this.$element.removeClass("is-transparent"))),e===!1){if(!this.isVisible())return;let s=this.calculateRemainingTime(this.toggleTime,1e3),o=Math.max(s-150,0);this.toggleDelay=setTimeout(()=>{this.$element.addClass("is-transparent"),this.toggleDelay=setTimeout(()=>this.toggle(!1),150)},o)}}calculateRemainingTime(e,i=1e3){let o=(Date.now()-e)%i;return i-o}};ae(Dt);Bs=Dt});var Hs={};ie(Hs,{default:()=>Vn});var Lt,Vn,_s=v(()=>{S();H();js();Us();Lt=class extends OO.ui.MessageDialog{static name="Instant Diffs Window";static size="instantDiffs";static actions=[{action:"close",label:l("action-close"),title:B("action-close","close")}];constructor(){super({classes:["instantDiffs-view"]})}initialize(){return super.initialize(),this.message.$element.remove(),this.message=new qs,this.text.$element.append(this.message.$element),this.$content.removeAttr("tabindex"),this.container.$element.attr("tabindex","-1"),this.$clickOverlay=$("<div>").on("click",()=>this.close()).addClass("instantDiffs-view-overlay").appendTo(this.$element),this.progressBar=new Bs,this.$content.prepend(this.progressBar.$element),this}getSetupProcess(e){return super.getSetupProcess(e).next(()=>{Gs(),this.container.$element.scrollTop(0),this.focus()})}onDialogKeyDown(e){super.onDialogKeyDown(e),!Tt()&&this.emit("hotkey",e)}getBodyHeight(){return"auto"}update(e){return this.getUpdateProcess(e).execute()}getUpdateProcess(e){return new OO.ui.Process().next(()=>{this.toggleProgress(!1),this.title.setLabel(e.title!==void 0?e.title:this.constructor.static.title),this.message.setLabel(e.message!==void 0?e.message:this.constructor.static.message),this.container.$element.scrollTop(0),this.toggleVisibility(!0),this.focus()})}getTeardownProcess(e){return super.getTeardownProcess(e).next(()=>{this.toggleProgress(!1),this.toggleVisibility(!1)})}focus(e){return e?super.focus(e):this.container.$element.trigger("focus"),this}toggleVisibility(e){this.message.toggleVisibility(e)}toggleProgress(...e){this.progressBar.toggleVisibility(...e)}};ae(Lt);Vn=Lt});var Fi,L,ee=v(()=>{C();S();H();Se();ui();Ri();Ni();Vs();Fi=class{static sizes={compact:{width:800,height:"auto"},standard:{width:1200,height:"auto"},wide:{width:1600,height:"auto"}};static getSize(e){return this.sizes[e]}link;page;options={};opener={link:null,options:{}};initiator={link:null,options:{}};previousInitiator={link:null,options:{}};document={};loadPromise;isDependenciesLoaded=!1;isConstructed=!1;isOpen=!1;isLoading=!1;isRequesting=!1;isProcessing=!1;mixin(){OO.EventEmitter.call(this)}setup(e,i){if(this.isRequesting||this.isProcessing)return!1;if(n.timers.dialogProcesStart=mw.now(),this.link=e,this.options={initiatorPage:null,onOpen:()=>{},onClose:()=>{},...i},!this.isOpen){this.opener.link=this.link,this.opener.options={...this.options};let s={};this.opener.link.getMW?.().hasLine&&(s.filterType=this.opener.link.getArticle().get("type"),s.filterMWLine=!0),be.newInstance(s)}if(this.link instanceof P){let s=this.link.getInitiatorLink();be.instance.hasLink(s)&&(this.previousInitiator={...this.initiator},this.initiator.link=s,this.initiator.options={...this.options},be.instance.setLink(this.initiator.link))}return!0}load(){return this.isLoading?this.loadPromise:this.isDependenciesLoaded?(this.open(),!0):(this.isLoading=!0,this.error=null,this.loadPromise=$.when(mw.loader.using(this.getDependencies())).then(this.onLoadSuccess.bind(this)).fail(this.onLoadError.bind(this)),this.loadPromise)}getDependencies(){return ne([...n.config.dependencies.window,...n.config.dependencies.content])}onLoadError(e){this.isLoading=!1,this.isDependenciesLoaded=!1,this.error={type:"dependencies",message:e&&e.message?e.message:null},E("error-dependencies-generic",this.error)}onLoadSuccess(){this.isLoading=!1,this.isDependenciesLoaded=!0,wt(),this.open()}construct(){this.isConstructed=!0;let e=(_s(),$t(Hs)).default;this.dialog=new e,this.dialog.connect(this,{hotkey:i=>this.emit("hotkey",i)}),this.manager=bt(),this.manager.addWindows([this.dialog])}open(){if(this.isConstructed||this.construct(),!this.isOpen){this.document.scrollableRoot=OO.ui.Element.static.getRootScrollableElement(document.body),this.document.scrollTop=this.document.scrollableRoot.scrollTop;let e=this.link.getArticle(),i={title:e.get("titleText")||e.get("title"),size:Vi()};this.windowInstance=this.manager.openWindow(this.dialog,i),this.windowInstance.opening.then(this.onOpening.bind(this)),this.windowInstance.opened.then(this.onOpen.bind(this)),this.windowInstance.closing.then(this.onClosing.bind(this)),this.windowInstance.closed.then(this.onClose.bind(this))}this.request()}onOpening(){this.emit("opening")}onOpen(){this.isOpen=!0,O(this.options.onOpen)&&this.options.onOpen(this),this.emit("opened")}onClosing(){this.emit("closing")}onClose(){this.isOpen=!1,this.isRequesting=!1,this.isProcessing=!1,this.previousPage&&(this.previousPage.detach(),this.previousPage=null),this.page&&(this.page.detach(),this.page=null),O(this.options.onClose)&&this.options.onClose(this),O(this.opener.options.onClose)&&this.opener.link!==this.link&&this.opener.options.onClose(this),O(this.initiator.options.onClose)&&this.initiator.options.onClose(this),this.document.scrollableRoot.scrollTop=this.document.scrollTop,this.emit("closed")}onUpdate(){this.fire(),this.previousInitiator.link instanceof P&&this.opener.link!==this.previousInitiator.link&&O(this.previousInitiator.options.onClose)&&this.previousInitiator.options.onClose(this),this.initiator.link instanceof P&&this.opener.link!==this.initiator.link&&O(this.initiator.options.onOpen)&&this.initiator.options.onOpen(this),this.emit("updated")}request(){this.isRequesting=!0,this.isProcessing=!0,this.error=null,this.previousPage=this.page,this.dialog.toggleProgress(!0),this.previousPage&&this.previousPage.restoreConfigs();let e=this.link.getArticle(),i={initiatorAction:this.previousPage?.getNavigation()?.getActionRegister(),initiatorPage:this.options.initiatorPage},s=e.get("hostname"),o=Q(s)?yt:kt;this.page=new o(e,i),this.page.connect(this,{focus:"focus",close:"close"}),$.when(this.page.load()).always(this.onRequestResponse.bind(this))}onRequestResponse(){if(this.isRequesting=!1,!this.page||this.page.isDetached)return;let e={title:this.page.getArticleTitleText(),message:this.page.getContainer()};this.dialog.update(e).then(this.onUpdate.bind(this))}refresh(){return this.isRequesting||this.isProcessing?!1:(n.timers.dialogProcesStart=mw.now(),this.load())}fire(){this.previousPage&&this.previousPage.detach(),$.when(this.page.fire()).always(()=>{n.timers.dialogProcesEnd=mw.now(),f("logTimers")&&he("dialog process time",n.timers.dialogProcesStart,n.timers.dialogProcesEnd),this.isProcessing=!1})}focus(){this.dialog.focus()}close(){this.dialog.close()}getLink(){return this.link}getPage(){return this.page}getPreviousPage(){return this.previousPage}getDialog(){return this.dialog}isContains(e){return this.dialog?.$content.get(0).contains(e)}},L=new Fi});function ae(t){let e=Object.getPrototypeOf(t);return OO.initClass(e),t.static=Object.create(e.static),Object.keys(t).filter(i=>i!=="static").forEach(i=>{t.static[i]=t[i]}),t.parent=t.super=e,t}function qi(t){let e={prototype:{}};OO.mixinClass(e,OO.EventEmitter),Object.assign(t,e.prototype),OO.EventEmitter.call(t)}function wt(){O(OO.ui.RadioSelectWidget.prototype.findFirstSelectedItem)||(OO.ui.RadioSelectWidget.prototype.findFirstSelectedItem=function(){let t=this.findSelectedItems();return Array.isArray(t)?t[0]||null:t}),O(OO.ui.ButtonSelectWidget.prototype.findFirstSelectedItem)||(OO.ui.ButtonSelectWidget.prototype.findFirstSelectedItem=function(){let t=this.findSelectedItems();return Array.isArray(t)?t[0]||null:t}),O(OO.ui.getTeleportTarget)||(OO.ui.getTeleportTarget=function(){return document.body})}function Gs(){$(["#mw-notification-area",".mw-notification-area-overlay",".ext-checkuser-userinfocard-popover"]).each((t,e)=>{$(e).removeAttr("aria-hidden").removeAttr("inert")})}function Ii(t){return new OO.ui.Element({$element:t})}function bt(){qn();let t=new OO.ui.WindowManager;return $(OO.ui.getTeleportTarget()).append(t.$element),t}function qn(t){t=t||f("viewWidth")||"standard",t!=="full"&&(OO.ui.WindowManager.static.sizes.instantDiffs=L.constructor.sizes[t]||L.constructor.sizes.standard),L.isOpen&&L.dialog.setSize(Vi(t))}function Vi(t){return t=t||f("viewWidth")||"standard",t==="full"?"full":"instantDiffs"}function ht(t,e){let i=mw.loader.moduleRegistry[t],s=e.match(/^((?:\.\.?\/)+)(.*)$/);return s&&(e=`resources/src/${t}/${s[2]}`),i?.packageExports[e]}function Fs(t){return mw.loader.moduleRegistry[t]?.script($,jQuery,null,null)}var H=v(()=>{S();ee()});var zs=le(()=>{window.instantDiffs||={};instantDiffs.i18n||={};instantDiffs.i18n.en={"@metadata":{authors:["Serhio Magpie"]},"script-name":"Instant Diffs","script-name-short":"ID","diff-title":"Difference between revisions","diff-title-hidden":"Difference between revisions is hidden","revision-title":"Revision content","revision-title-hidden":"Revision content is hidden","compare-label":"$1","compare-title":"Compare selected revisions ($1)","compare-pages-title":"Difference between pages","compare-pages-title-hidden":"Difference between pages is hidden","page-title":"Go to page","comment-title":"Go to message","action-save":"Save","action-cancel":"Cancel","action-close":"Close","action-reload":"Reload","action-watch":"Watch","action-unwatch":"Unwatch","goto-snapshot-prev":"Previous link on a page","goto-snapshot-next":"Next link on a page","goto-view-diff":"Show changes","goto-view-revision":"Show revision","goto-view-unpatrolled":"Pending changes","goto-prev":"Older","goto-next":"Newer","goto-prev-diff":"Older edit","goto-next-diff":"Newer edit","goto-back-diff":"Back","goto-prev-revision":"Older revision","goto-next-revision":"Newer revision","goto-back-revision":"Back","goto-diff":"Go to edit","goto-revision":"Go to revision","goto-page":"Go to page","goto-comment":"Go to message","goto-edit":"Edit","goto-source":"View source","goto-history":"View history","goto-talkpage":"Discussion","goto-settings":"Settings","goto-menu":"Actions","hint-close":"Esc","hint-alt-click":"Alt+Click: open the link","hint-snapshot-prev":"Ctrl+Arrow Left","hint-snapshot-next":"Ctrl+Arrow Right","hint-prev":"Arrow Left","hint-next":"Arrow Right","hint-switch":"Ctrl+Arrow Up","hint-unpatrolled":"Ctrl+P","hint-back":"Ctrl+Z","hint-menu":"Ctrl+Arrow Down","copy-link":"Copy link","copy-link-copied":"The link has been copied to the clipboard.","copy-link-error":"Couldn't copy the link.","copy-wikilink":"Copy wikilink","copy-wikilink-page":"page","copy-wikilink-diff":"diff","copy-wikilink-revision":"revision","copy-wikilink-example-title":"Main Page","dialog-title-empty":"[No title]","dialog-title-not-found":"[Not found]","dialog-notice-wikilambda":"WikiLambda app currently only shows the latest revision. See a [[phab:T397902|ticket]] on Phabricator.","dialog-notice-foreign-diff":"You are viewing a foreign diff from [$1 $2]. Some features can be limited.","dialog-notice-foreign-revision":"You are viewing a foreign revision from [$1 $2]. Some features can be limited.","dialog-notice-foreign-wikilambda":"WikiLambda app is not currently supported in the foreign revisions.","settings-title":"Instant Diffs Settings","settings-saved":`The settings have been saved successfully.
Reload the page to apply them.`,"settings-saved-icon":"Checkmark icon","settings-fieldset-links":"Links","settings-show-link":"Show action link","settings-show-link-help":"Displays an action button (\u2756) after the link to open the Instant Diffs dialog. Otherwise, the click action is added directly to the link. You can still open the link in the current tab by pressing Alt+Click.","settings-show-page-link":"Show page link","settings-show-page-link-help":"Displays an action button (\u2794) after the link to navigate to the page and section where the edit was made. If the [[mw:Special:MyLanguage/Convenient Discussions|Convenient Discussions]] script is installed, the button will also try to navigate to the corresponding comment.","settings-highlight-line":"Highlight lines in Watchlists and similar lists when the Instant Diffs dialog opens from the related link.","settings-mark-watched-line":"Mark changes as visited in Watchlists when the Instant Diffs dialog opens from the related link.","settings-fieldset-dialog":"Dialog","settings-view-width":"Set window dimensions:","settings-view-width-help":"Dimensions apply only to desktop view. Mobile view always uses full screen dimensions.","settings-view-width-option-title":"$1 pixels wide","settings-view-width-compact":"Compact","settings-view-width-standard":"Standard","settings-view-width-wide":"Wide","settings-view-width-full":"Full","settings-view-width-full-title":"All available screen space","settings-show-diff-tools":"Show additional diff tools, such as the Inline format toggle.","settings-show-revision-info":"Show change information when viewing a revision.","settings-unhide-diffs":"Display hidden revision content and diff info without additional steps.","settings-unhide-diffs-help":'The "$1" [[mw:Special:MyLanguage/Help:RevisionDelete|user right]] is required to view revision content.',"settings-open-in-new-tab":"Open links inside the Instant Diffs dialog in a new tab.","settings-links-format":"Link format for the copy action:","settings-links-format-full":"Full url with a page title","settings-links-format-minify":"Minified url","settings-wikilinks-format":"Wikilink format for the copy action:","settings-wikilinks-format-link":"Simple link in brackets","settings-wikilinks-format-special":"Internal wiki link","settings-fieldset-general":"General","settings-enable-mobile":"Enable Instant Diffs on the mobile skin (Minerva).","settings-enable-mobile-help":"To re-enable Instant Diffs, you will need to switch to a different skin.","settings-enable-hotkeys":"Enable keyboard shortcuts in the Instant Diffs dialog.","settings-show-menu-icons":"Show icons in the Instant Diffs dialog dropdown menu.","settings-notify-errors":"Show popup alerts for critical errors.","error-generic":"Something went wrong: $4","error-server":"Server error, please try again later","error-offline":"Please check your internet connection","error-wasted":"Unexpected error","error-prepare-generic":"Failed to prepare configuration: $4","error-prepare-version":"Another instance is already running: $4","error-prepare-replaced":"Standalone instance replaced successfully: $4","error-prepare-mobile":"The script is disabled in the settings for the mobile skin (Minerva)","error-link-options":'Failed to parse the "data-instantdiffs-options" link attribute: $4',"error-revision-generic":'Failed to load revision data "oldid=$1": $4',"error-revision-curid":'Failed to load revision data "curid=$1": $4',"error-revision-badrevids":"Revision not found","error-revision-badpageids":"Page not found","error-revision-missing":"Page not found","error-revision-invalid":"Page not found: $4","error-diff-generic":'Failed to load revision compare data "oldid=$1", "diff=$2": $4',"error-diff-compare-pages":'Failed to load page compare data "page1=$1", "page2=$2": $4',"error-diff-missingcontent":"Revision is hidden","error-diff-nosuchrevid":"Revision not found","error-diff-missingtitle":"Page not found","error-api-generic":"Failed to request api: $4","error-dependencies-generic":"Failed to load dependencies: $4","error-dependencies-revid":'Failed to load page dependencies "oldid=$1": $4',"error-dependencies-curid":'Failed to load page dependencies "curid=$1": $4',"error-global-watchlist":"Failed to execute Global Watchlist API: $4","error-setting-request":"Failed to load user options: $4","error-setting-save":"Failed to save user options: $4"}});var jn={};var Ks=v(()=>{C();S();Se();mw.hook("mw.translate.editor.showTranslationHelpers").add((t,e)=>{!e||!de()||mw.hook(`${n.config.prefix}.process`).fire(e)});mw.hook("convenientDiscussions.preprocessed").add(t=>{if(!t)return;let e=s=>{!s||!s.isValid||!s.isProcessed||s.isForeign||!s.options.showPageLink||s.actions.cd||(s.extensions.cd={},s.extensions.cd.href=i(s),!a(s.extensions.cd.href)&&(s.actions.page&&s.actions.page.remove(),s.actions.cd=s.renderAction({label:ge("page"),title:l("comment-title"),href:s.extensions.cd.href,modifiers:["page","comment"]})))},i=s=>{if(!s.compare&&!s.revision)return;let o=s.getArticle().get("titleText"),r=t.api.pageRegistry.get(o);if(!r||!r.isProbablyTalkPage())return;if(s.revision?s.revision.revid&&(s.extensions.cd.date=new Date(s.revision.timestamp),s.extensions.cd.user=s.revision.user):s.compare&&(s.compare.torevid?(s.extensions.cd.date=new Date(s.compare.totimestamp),s.extensions.cd.user=s.compare.touser):s.compare.fromrevid&&(s.extensions.cd.date=new Date(s.compare.fromtimestamp),s.extensions.cd.user=s.compare.fromuser)),s.extensions.cd.date&&s.extensions.cd.user)try{s.extensions.cd.anchor=t.api.generateCommentId(s.extensions.cd.date,s.extensions.cd.user)}catch{}if(!s.extensions.cd.anchor)return;let d=`#${s.extensions.cd.anchor}`;return o!==n.local.mwTitleText&&(d=mw.util.getUrl(`${o}${d}`)),d};if(n.isRunCompleted)for(let s of P.getLinks())e(s);mw.hook(`${n.config.prefix}.link.renderSuccess`).add(s=>{s&&e(s)})});mw.hook(`${n.config.prefix}.page.beforeDetach`).add(t=>{if(!t)return;let e=t.getDiffTable();typeof wikEd<"u"&&wikEd.diffTableLinkified&&e?.length>0&&wikEd.diffTable===e.get(0)&&(wikEd.diffTableLinkified=!1)});mw.hook(`${n.config.prefix}.page.complete`).add(t=>{if(!t)return;(t.getContainer()?.find('[id^="tw-revert"] a')).each((i,s)=>{s.addEventListener("click",()=>t.close())})});mw.hook("wikipage.content").add(()=>{if(!de()||mw.config.get("skin")!=="citizen")return;let t=(s,o)=>{try{let r=new URL(s.href);a(r.searchParams.get("diff"))&&(r.searchParams.set("diff","cur"),s.href=r.href),s.dataset.instantdiffsLink="basic",s.dataset.instantdiffsOptions=JSON.stringify({showLink:!1,showPageLink:!1,showAltTitle:!0}),mw.hook(`${n.config.prefix}.process`).fire($(o))}catch{}},e=document.querySelector("#citizen-lastmod-relative"),i=document.querySelector("#citizen-sidebar-lastmod");e&&i&&t(e,i)})});C();var Ee={version:"4.11.5",link:"Instant_Diffs",discussion:"Talk:Instant_Diffs",outname:"instantDiffs",outdir:"dist",origin:"https://www.mediawiki.org",prefix:"instantDiffs",messagePrefix:"instant-diffs",settingsPrefix:"userjs-instantDiffs",dependencies:{styles:"/w/index.php?title=User:Serhio_Magpie/instantDiffs.css&action=raw&ctype=text/css",messages:"/w/index.php?title=User:Serhio_Magpie/instantDiffs-i18n/$lang.js&action=raw&ctype=text/javascript",main:["oojs","mediawiki.api","mediawiki.util","mediawiki.user","mediawiki.storage","mediawiki.notification","mediawiki.ForeignApi","mediawiki.Title"],settings:["oojs","oojs-ui-core","oojs-ui-widgets","oojs-ui-windows","oojs-ui.styles.icons-interactions"],window:["oojs","oojs-ui-core","oojs-ui-widgets","oojs-ui-windows","oojs-ui.styles.icons-movement","oojs-ui.styles.icons-content","oojs-ui.styles.icons-alerts","oojs-ui.styles.icons-interactions","oojs-ui.styles.icons-moderation","oojs-ui.styles.icons-editing-core","oojs-ui.styles.icons-editing-advanced","oojs-ui.styles.icons-user","oojs-ui.styles.icons-layout"],content:["jquery.confirmable","mediawiki.DateFormatter","mediawiki.codex.messagebox.styles","mediawiki.interface.helpers.styles","mediawiki.diff","mediawiki.diff.styles","mediawiki.misc-authed-curate","mediawiki.page.watch.ajax","ext.flaggedRevs.basic","ext.visualEditor.diffPage.init"],page:{"*":["ext.thanks.corethank","ext.checkUser.userInfoCard","ext.checkUser.styles"]},revision:{6:["filepage","wikibase.mediainfo.filepage.styles","wikibase.mediainfo.statements","wikibase.mediainfo.statements.styles"],14:["mediawiki.page.gallery.styles"],146:["wikibase.lexeme.styles"]}},foreignDependencies:{revision:{styles:{6:["wikibase.mediainfo.filepage.styles","wikibase.mediainfo.statements","wikibase.mediainfo.statements.styles"],146:["wikibase.lexeme.styles"]},links:{6:["MediaWiki:Filepage.css"]},wikibase:{styles:{all:["jquery.wikibase.toolbar.styles","wikibase.view.ControllerViewFactory","wikibase.alltargets"],desktop:["wikibase.desktop"],mobile:["wikibase.mobile"]}}}},settings:{showLink:!0,showPageLink:!0,highlightLine:!0,markWatchedLine:!0,viewWidth:!0,showDiffTools:!0,showRevisionInfo:!0,unHideDiffs:!0,openInNewTab:!0,linksFormat:!0,wikilinksFormat:!0,enableMobile:!0,enableHotkeys:!0,showMenuIcons:!0,notifyErrors:!0},defaults:{debug:!1,GM:!1,standalone:!1,storageExpiry:86400,logTimers:!0,showLink:!1,showPageLink:!0,highlightLine:!0,markWatchedLine:!0,viewWidth:"standard",showDiffTools:!0,showRevisionInfo:!0,unHideDiffs:!0,openInNewTab:!0,linksFormat:"full",wikilinksFormat:"special",enableMobile:!0,enableHotkeys:!0,showMenuIcons:!0,notifyErrors:!0},include:{pageActions:["view","history"]},exclude:{pages:[],linkActions:["edit","history"]},labels:{page:{ltr:"\u2794",rtl:"\u{1F870}"},diff:"\u2756",revision:"\u272A",error:"\u{1D4D4}"},breakpoints:{mobileUp:"(min-width: 640px)",mobileDown:"(max-width: 639px)"},wikilinkPresets:{link:{page:"[$href $msg]",diff:"[$href $msg]",revision:"[$href $msg]"},special:{page:"[[$prefSpecial:Redirect/page/$1|$msg]]",diff:"[[$prefSpecial:Diff/$1|$msg]]",revision:"[[$prefSpecial:PermanentLink/$1|$msg]]"}},commonsAssetsPath:"https://upload.wikimedia.org/wikipedia/commons",changeLists:["Watchlist","Recentchanges","Recentchangeslinked"],contributionLists:["Contributions","GlobalContributions"],otherLists:["Newpages","PendingChanges","GlobalWatchlist"],specialPages:["Special:Diff","Special:PermanentLink","Special:MobileDiff","Special:Redirect","Special:ComparePages"],nonEditableContentModels:["wikibase-item","wikibase-property","wikibase-lexeme"],skinBodyClasses:{"vector-2022":["mw-body","vector-body"],vector:["vector-body"],monobook:["monobook-body"],minerva:["content"],timeless:["mw-body"]},bodyContentSelector:"#bodyContent",contentSelector:"#mw-content-text",specialPagesLinks:["Special:Diff","Special:PermanentLink","Special:MobileDiff","Special:Redirect"],specialPagesLinksSearchRegExp:"^($1)",specialPagesLinksPathRegExp:"$1($2)",specialPagesLinksSelector:'a[title^="$1"]',articlePathRegExp:"^($1)",sectionRegExp:/^\/\*\s*(.*?)\s*\*\/.*$/,linkSelector:["a[data-instantdiffs-link]",'a.external[href^="$1"]',"a.mw-changeslist-date","a.mw-changeslist-diff","a.mw-changeslist-diff-cur","a.mw-changeslist-groupdiff",".mw-changeslist-line a.extiw",".mw-fr-reviewlink a",".mw-enhanced-rc-time a",".mw-history-histlinks a",".mw-diff-bytes + a",".mw-contributions-list .comment a",".mw-fr-pending-changes-table a.cdx-docs-link","#mw-revision-nav a",".diff-type-table #differences-prevlink",".diff-type-table #differences-nextlink","li[data-afl-log-id] a",'li[class^="mw-tag"] a',"li.mw-logline-tag a","a.ext-globalwatchlist-diff",".wikibase-statementview-references a","a.edit-summary-time"],mwLine:{selector:[".mw-changeslist-line",".mw-contributions-list li",".mw-fr-pending-changes-table tr",".mw-special-AbuseLog li[data-afl-log-id]",'.mw-special-EditTags li[class^="mw-tag"]',".mw-special-EditTags li.mw-logline-tag",".ext-globalwatchlist-site li"],seen:["mw-changeslist-line-not-watched","mw-enhanced-not-watched","mw-changeslist-watchedseen"],unseen:["mw-changeslist-line-watched","mw-enhanced-watched","mw-changeslist-watchedunseen"]},mwLineTitle:{selector:[".mw-changeslist-title",".mw-contributions-title",".mw-newpages-pagename",".mw-fr-pending-changes-page-title"]},mwLink:{id:["differences-prevlink","differences-nextlink"],hasClass:["mw-changeslist-date","mw-changeslist-diff","mw-changeslist-diff-cur","mw-changeslist-groupdiff","mw-newpages-time"],closestTo:[".mw-changeslist-line",".mw-contributions-list",".mw-history-histlinks",".mw-pager-navigation-bar + ul",".mw-fr-hist-difflink","#mw-fr-reviewnotice","#mw-fr-revisiontag","#mw-fr-revisiontag-edit","#mw-fr-revision-tag-edit","#mw-fr-revision-messages",".mw-specialpage-summary","#mw-revision-nav",".mw-fr-pending-changes-table",".mw-special-AbuseLog li[data-afl-log-id]",'.mw-special-EditTags li[class^="mw-tag"]',".mw-special-EditTags li.mw-logline-tag",".wikibase-statementview-references",".ext-globalwatchlist-site",".tux-message-editor",".mw-pt-translate-header"]},mwLinkDiffOnly:{id:["differences-prevlink","differences-nextlink"],closestTo:["#mw-revision-nav"]},mwLinkPrepend:{id:["differences-nextlink"]},mwLinkAltTitle:{closestTo:[".mw-fr-reviewlink",".mw-history-histlinks"]},mwLinkContent:{closestTo:[".mw-parser-output",".comment"]}},zi={messages:{},settings:{},defaults:{},require:null,language:null,linkSelector:null,mwIsAnon:!0,mwEndPoint:null,mwEndPointUrl:null,mwAction:null,mwArticlePath:null,mwCanonicalSpecialPageName:null,mwTitle:null,mwTitleText:null,mwServers:[],mwServerNames:[],specialPagesLocalPrefixed:{},specialPagesAliases:{},specialPagesAliasesFlat:[],specialPagesAliasesPrefixed:{},specialPagesAliasesPrefixedFlat:[],specialPagesLinksAliases:{},specialPagesLinksAliasesFlat:[],specialPagesLinksAliasesPrefixed:{},specialPagesLinksAliasesPrefixedFlat:[],specialPagesLinksPathRegExp:null,specialPagesLinksSearchRegExp:null,articlePathRegExp:null,mutationObserver:null,interactionObserver:null},Ki={};S();H();U();we();je();Se();vt();Ri();Ni();we();je();ee();var ji=class extends V{article;constructor(e){super({article:{},...e,ariaHaspopup:!0,handler:()=>this.openDialog()}),this.article=new F(this.options.article)}openDialog(){let e={onOpen:()=>this.onDialogOpen(),onClose:()=>this.onDialogClose()};if(L.setup(this,e))return this.onDialogRequest(),$.when(L.load()).always(()=>this.onDialogLoad())}onDialogRequest(){this.pending(!0),this.emit("loading")}onDialogLoad(){this.pending(!1),this.emit("loaded")}onDialogOpen(){this.emit("opened")}onDialogClose(){this.emit("closed")}getArticle(){return this.article}},Pt=ji;C();S();var Bi=class extends Pt{nodes={};openDialog(){this.nodes.$oldid=$('#mw-history-compare input[name="oldid"]:checked'),this.nodes.$oldidLine=this.nodes.$oldid.closest("li"),this.nodes.$diff=$('#mw-history-compare input[name="diff"]:checked'),this.nodes.$diffLine=this.nodes.$diff.closest("li"),this.article.set({type:"diff",title:n.local.mwTitleText,oldid:this.nodes.$oldid.val(),diff:this.nodes.$diff.val()}),super.openDialog()}onDialogOpen(){f("highlightLine")&&(this.nodes.$oldidLine.addClass("instantDiffs-line--highlight"),this.nodes.$diffLine.addClass("instantDiffs-line--highlight")),super.onDialogOpen()}onDialogClose(){f("highlightLine")&&(this.nodes.$oldidLine.removeClass("instantDiffs-line--highlight"),this.nodes.$diffLine.removeClass("instantDiffs-line--highlight")),super.onDialogClose()}},Ui=Bi;Oi();ee();mt();var Bn=_i({"../dist/instantDiffs-i18n/en.js":()=>zs()});function Js(){if(!(n.isPageAdjustmentsApplied||!de())){if(n.isPageAdjustmentsApplied=!0,document.body.classList.add("instantDiffs-enabled"),n.config.changeLists.includes(n.local.mwCanonicalSpecialPageName))return Un();if(n.config.contributionLists.includes(n.local.mwCanonicalSpecialPageName))return Hn();if(n.local.mwCanonicalSpecialPageName==="GlobalWatchlist")return Gn();if(n.local.mwAction==="history")return zn()}}function Un(){$(".mw-changeslist-line").addClass("instantDiffs-line")}function Hn(){$(".mw-contributions-list .mw-changeslist-links:not(.mw-pager-tools) > span:first-child").each((e,i)=>{let s=$(i);s.find("a").length===0&&s.wrapInner(Ve())}),n.local.mwCanonicalSpecialPageName==="GlobalContributions"&&_n()}function _n(){$(".mw-contributions-list li").each((e,i)=>{let s=$(i),o=s.find("a.mw-changeslist-date, a.mw-changeslist-history");if(o.length!==0)try{let r=new URL(o.prop("href"));G(s,r.origin)}catch{}})}function Gn(){let t=document.getElementById("ext-globalwatchlist-watchlistsfeed");n.local.mutationObserver.observe(t,{childList:!0})}function zn(){let t=$("#pagehistory > li, #pagehistory .mw-contributions-list > li").addClass("instantDiffs-line--history");if(t.length<=1)return;t.each((i,s)=>{let o=$(s),r=o.find(".mw-history-histlinks > span:first-child"),d=o.find(".mw-history-histlinks > span:last-child");r.find("a").length===0&&r.wrapInner(Ve()),d.find("a").length===0&&d.wrapInner(Ve())}),$(".mw-history-compareselectedversions").each((i,s)=>{let r=$(s).find(".mw-history-compareselectedversions-button");new Ui({label:l("compare-label",n.config.labels.diff),title:l("compare-title",l("script-name")),classes:["mw-ui-button","cdx-button","instantDiffs-button--compare"],insertMethod:"insertAfter",container:r}),$("<span>").text(" ").addClass("instantDiffs-spacer").insertAfter(r)})}function Kn(t){n.local.require=t,mw.util.addCSS(".instantDiffs-panel { display:none; }"),L.mixin(),z.mixin(),qi(L),qi(z),OO.mixinClass(V,OO.EventEmitter),OO.mixinClass(ke,OO.EventEmitter),n.local.mwIsAnon=mw.user?.isAnon?.()??!0,n.local.mwEndPoint=`${location.origin}${mw.config.get("wgScript")}`,n.local.mwEndPointUrl=new URL(n.local.mwEndPoint),n.local.mwAction=mw.config.get("wgAction"),n.local.mwArticlePath=mw.config.get("wgArticlePath").replace("$1",""),n.local.mwCanonicalSpecialPageName=mw.config.get("wgCanonicalSpecialPageName"),n.local.mwTitle=new mw.Title(mw.config.get("wgRelevantPageName")),n.local.mwTitleText=n.local.mwTitle.getPrefixedText();let e=Nt();return mw.config.set("wgMobileServer",e),mw.config.set("wgMobileServerName",J("hostname",e)),n.local.mwServers=[mw.config.get("wgServer"),mw.config.get("wgMobileServer")].filter(i=>!a(i)).map(Ne),n.local.mwServerNames=[mw.config.get("wgServerName"),mw.config.get("wgMobileServerName")].filter(i=>!a(i)),n.local.lastVesrion=mw.storage.get(`${n.config.prefix}-version`),mw.storage.set(`${n.config.prefix}-version`,n.config.version),n.local.mutationObserver=new MutationObserver(oo),n.local.interactionObserver=new IntersectionObserver(no,{threshold:0,rootMargin:f("debug")?"0px 0px 0px 0px":"33% 0px 33% 0px"}),window.addEventListener("pageshow",ro),window.addEventListener("beforeunload",ao),Promise.allSettled([p.getSpecialPages(),Jn(),...Qn()])}async function Jn(){let{general:t}=await p.getSiteInfo(["general"])||{};A(t)||(a(t.mobileserver)||(mw.config.set("wgMobileServer",t.mobileserver),mw.config.set("wgMobileServerName",t.mobileservername)),n.local.mwServers=[t.server,t.mobileserver].filter(e=>!a(e)).map(Ne),n.local.mwServerNames=[t.servername,t.mobileservername].filter(e=>!a(e)))}function Qn(){return["en",mw.config.get("wgUserLanguage")].filter((e,i,s)=>s.indexOf(e)===i&&!n.i18n[e]).map(e=>{let i=n.config.dependencies.messages.replace("$lang",e);return mw.loader.getScript(fe(i))})}function Yn(){for(let[t,e]of Object.entries(p.specialPagesLocal))n.local.specialPagesLocalPrefixed[t]=new mw.Title(e).getPrefixedDb(),n.local.specialPagesAliases[t]=ot(p.specialPagesLocal,t),n.local.specialPagesAliasesPrefixed[t]=ot(n.local.specialPagesLocalPrefixed,t),n.config.specialPagesLinks.includes(t)&&(n.local.specialPagesLinksAliases[t]=n.local.specialPagesAliases[t],n.local.specialPagesLinksAliasesPrefixed[t]=n.local.specialPagesAliasesPrefixed[t]);n.local.specialPagesAliasesFlat=Object.values(n.local.specialPagesAliases).flat(),n.local.specialPagesAliasesPrefixedFlat=Object.values(n.local.specialPagesAliasesPrefixed).flat(),n.local.specialPagesLinksAliasesFlat=Object.values(n.local.specialPagesLinksAliases).flat(),n.local.specialPagesLinksAliasesPrefixedFlat=Object.values(n.local.specialPagesLinksAliasesPrefixed).flat()}function Xn(){n.local.articlePathRegExp=new RegExp(n.config.articlePathRegExp.replaceAll("$1",n.local.mwArticlePath));let t=[];n.config.linkSelector.forEach(i=>{/\$1/.test(i)?n.local.mwServers.forEach(s=>{t.push(i.replaceAll("$1",s))}):t.push(i)}),n.local.specialPagesLinksAliasesFlat.forEach(i=>{t.push(n.config.specialPagesLinksSelector.replaceAll("$1",i))});let e=n.local.specialPagesLinksAliasesPrefixedFlat.join("|");n.local.specialPagesLinksPathRegExp=new RegExp(n.config.specialPagesLinksPathRegExp.replaceAll("$1",n.local.mwArticlePath).replaceAll("$2",e)),n.local.specialPagesLinksSearchRegExp=new RegExp(n.config.specialPagesLinksSearchRegExp.replaceAll("$1",e)),n.local.linkSelector=t.join(",")}function Zn(){let t={...Ee.settings,...n.settings},e={...Ee.defaults,...n.defaults,...It()};if(n.isRunning){n.isReplaced=io(t,e),E(n.isReplaced?"error-prepare-replaced":"error-prepare-version",{type:"version",message:`loaded: ${n.config.version}, concurrent: ${Ee.version}`},null,!0);return}n.isRunning=!0,n.config=Ee,n.local=zi,n.local.settings=t,n.local.defaults=e,n.timers=Ki,n.utils=x,n.modules={Api:p,Article:F,Link:P,Button:V,ViewButton:Pt,HistoryCompareButton:Ui,Page:ke,LocalPage:kt,GlobalPage:yt,Watch:gt,view:L,settings:z},n.timers.run=mw.now(),Bn(`../${n.config.outdir}/${n.config.outname}-i18n/en.js`),tt(),Ks(),eo()}function eo(){mw.loader.load(fe(n.config.dependencies.styles),"text/css"),mw.loader.using(n.config.dependencies.main).then(Kn).then(()=>$(to)).fail(t=>{E("error-prepare-generic",{type:"prepare",message:t?.message})})}async function to(){if(await Xe(),tt(),mw.config.get("skin")==="minerva"&&!f("enableMobile")){E("error-prepare-mobile",{type:"mobile"},null,!0);return}n.isReady=!0,Yn(),Xn(),Js(),n.timers.ready=mw.now(),mw.hook(`${n.config.prefix}.ready`).fire(n),mw.hook("wikipage.content").add(Qs),mw.hook(`${n.config.prefix}.process`).add(Ys),mw.hook(`${n.config.prefix}.replace`).add(so)}function Qs(t){!t||!de()||(n.isFirstRun=!n.isRunCompleted,n.isFirstRun&&(n.isRunCompleted=!0,t=Pe()),Ys(t),f("logTimers")&&n.isFirstRun&&(he("ready time",n.timers.run,n.timers.ready),he("total time",n.timers.run,n.timers.processEnd)))}function Ys(t){if(!t)return;n.timers.processStart=mw.now();let e=Array.from(P.findLinks(t)).filter(s=>!P.hasLink(s)).map(s=>new P(s)),i=e.filter(s=>s.isValid);n.timers.processEnd=mw.now(),f("logTimers")&&e.length>0&&(ce("info",`links found: ${e.length}`),ce("info",`links processed: ${i.length}`),he("process time",n.timers.processStart,n.timers.processEnd)),mw.hook(`${n.config.prefix}.processed`).fire(i)}function io(t,e){return n.utils.defaults("standalone")&&!e.standalone?(mw.hook(`${n.config.prefix}.replace`).fire(t,e),!0):!1}async function so(t,e){!t||!e||(n.local.settings=t,n.local.defaults=e,n.isReady&&(await Xe(),n.timers.run=mw.now(),n.timers.ready=mw.now(),Js(),Qs(Pe())))}function no(t){n.isUnloading||t.forEach(e=>{if(!e.isIntersecting)return;let i=P.getLink(e.target);i&&i.onIntersect()})}function oo(t){n.isUnloading||t.forEach(e=>{e.addedNodes.length>0&&mw.hook(`${n.config.prefix}.process`).fire($(e.target))})}function ro(t){t.persisted&&(n.isUnloading=!1)}function ao(){n.isUnloading=!0}Zn();})();
/* </nowiki> */