Jump to content

User:DB/common.js: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
No edit summary
No edit summary
Tag: Reverted
Line 1: Line 1:
function isCompatible(ua){return!!((function(){'use strict';return!this&&Function.prototype.bind;}())&&'querySelector'in document&&'localStorage'in window&&!ua.match(/MSIE 10|NetFront|Opera Mini|S40OviBrowser|MeeGo|Android.+Glass|^Mozilla\/5\.0 .+ Gecko\/$|googleweblight|PLAYSTATION|PlayStation/));}if(!isCompatible(navigator.userAgent)){document.documentElement.className=document.documentElement.className.replace(/(^|\s)client-js(\s|$)/,'$1client-nojs$2');while(window.NORLQ&&NORLQ[0]){NORLQ.shift()();}NORLQ={push:function(fn){fn();}};RLQ={push:function(){}};}else{if(window.performance&&performance.mark){performance.mark('mwStartup');}(function(){'use strict';var mw,log,con=window.console;function logError(topic,data){var msg,e=data.exception;if(con.log){msg=(e?'Exception':'Error')+' in '+data.source+(data.module?' in module '+data.module:'')+(e?':':'.');con.log(msg);if(e&&con.warn){con.warn(e);}}}function Map(){this.values=Object.create(null);}Map.prototype={constructor:Map,get:
// <pre>
function(selection,fallback){var results,i;fallback=arguments.length>1?fallback:null;if(Array.isArray(selection)){results={};for(i=0;i<selection.length;i++){if(typeof selection[i]==='string'){results[selection[i]]=selection[i]in this.values?this.values[selection[i]]:fallback;}}return results;}if(typeof selection==='string'){return selection in this.values?this.values[selection]:fallback;}if(selection===undefined){results={};for(i in this.values){results[i]=this.values[i];}return results;}return fallback;},set:function(selection,value){if(arguments.length>1){if(typeof selection==='string'){this.values[selection]=value;return true;}}else if(typeof selection==='object'){for(var s in selection){this.values[s]=selection[s];}return true;}return false;},exists:function(selection){return typeof selection==='string'&&selection in this.values;}};log=function(){};log.warn=con.warn?Function.prototype.bind.call(con.warn,con):function(){};mw={now:function(){var perf=window.performance,navStart=perf
&&perf.timing&&perf.timing.navigationStart;mw.now=navStart&&perf.now?function(){return navStart+perf.now();}:Date.now;return mw.now();},trackQueue:[],track:function(topic,data){mw.trackQueue.push({topic:topic,data:data});},trackError:function(topic,data){mw.track(topic,data);logError(topic,data);},Map:Map,config:new Map(),messages:new Map(),templates:new Map(),log:log};window.mw=window.mediaWiki=mw;}());(function(){'use strict';var StringSet,store,hasOwn=Object.hasOwnProperty;function defineFallbacks(){StringSet=window.Set||function(){var set=Object.create(null);return{add:function(value){set[value]=true;},has:function(value){return value in set;}};};}defineFallbacks();function fnv132(str){var hash=0x811C9DC5;for(var i=0;i<str.length;i++){hash+=(hash<<1)+(hash<<4)+(hash<<7)+(hash<<8)+(hash<<24);hash^=str.charCodeAt(i);}hash=(hash>>>0).toString(36).slice(0,5);while(hash.length<5){hash='0'+hash;}return hash;}var isES6Supported=typeof Promise==='function'&&Promise.prototype.finally&&/./g.
flags==='g'&&(function(){try{new Function('(a = 0) => a');return true;}catch(e){return false;}}());var registry=Object.create(null),sources=Object.create(null),handlingPendingRequests=false,pendingRequests=[],queue=[],jobs=[],willPropagate=false,errorModules=[],baseModules=["jquery","mediawiki.base"],marker=document.querySelector('meta[name="ResourceLoaderDynamicStyles"]'),lastCssBuffer,rAF=window.requestAnimationFrame||setTimeout;function newStyleTag(text,nextNode){var el=document.createElement('style');el.appendChild(document.createTextNode(text));if(nextNode&&nextNode.parentNode){nextNode.parentNode.insertBefore(el,nextNode);}else{document.head.appendChild(el);}return el;}function flushCssBuffer(cssBuffer){if(cssBuffer===lastCssBuffer){lastCssBuffer=null;}newStyleTag(cssBuffer.cssText,marker);for(var i=0;i<cssBuffer.callbacks.length;i++){cssBuffer.callbacks[i]();}}function addEmbeddedCSS(cssText,callback){if(!lastCssBuffer||cssText.slice(0,7)==='@import'){lastCssBuffer={cssText:'',
callbacks:[]};rAF(flushCssBuffer.bind(null,lastCssBuffer));}lastCssBuffer.cssText+='\n'+cssText;lastCssBuffer.callbacks.push(callback);}function getCombinedVersion(modules){var hashes=modules.reduce(function(result,module){return result+registry[module].version;},'');return fnv132(hashes);}function allReady(modules){for(var i=0;i<modules.length;i++){if(mw.loader.getState(modules[i])!=='ready'){return false;}}return true;}function allWithImplicitReady(module){return allReady(registry[module].dependencies)&&(baseModules.indexOf(module)!==-1||allReady(baseModules));}function anyFailed(modules){for(var i=0;i<modules.length;i++){var state=mw.loader.getState(modules[i]);if(state==='error'||state==='missing'){return modules[i];}}return false;}function doPropagation(){var didPropagate=true;var module;while(didPropagate){didPropagate=false;while(errorModules.length){var errorModule=errorModules.shift(),baseModuleError=baseModules.indexOf(errorModule)!==-1;for(module in registry){if(registry[
module].state!=='error'&&registry[module].state!=='missing'){if(baseModuleError&&baseModules.indexOf(module)===-1){registry[module].state='error';didPropagate=true;}else if(registry[module].dependencies.indexOf(errorModule)!==-1){registry[module].state='error';errorModules.push(module);didPropagate=true;}}}}for(module in registry){if(registry[module].state==='loaded'&&allWithImplicitReady(module)){execute(module);didPropagate=true;}}for(var i=0;i<jobs.length;i++){var job=jobs[i];var failed=anyFailed(job.dependencies);if(failed!==false||allReady(job.dependencies)){jobs.splice(i,1);i-=1;try{if(failed!==false&&job.error){job.error(new Error('Failed dependency: '+failed),job.dependencies);}else if(failed===false&&job.ready){job.ready();}}catch(e){mw.trackError('resourceloader.exception',{exception:e,source:'load-callback'});}didPropagate=true;}}}willPropagate=false;}function setAndPropagate(module,state){registry[module].state=state;if(state==='ready'){store.add(module);}else if(state===
'error'||state==='missing'){errorModules.push(module);}else if(state!=='loaded'){return;}if(willPropagate){return;}willPropagate=true;mw.requestIdleCallback(doPropagation,{timeout:1});}function sortDependencies(module,resolved,unresolved){if(!(module in registry)){throw new Error('Unknown module: '+module);}if(typeof registry[module].skip==='string'){var skip=(new Function(registry[module].skip)());registry[module].skip=!!skip;if(skip){registry[module].dependencies=[];setAndPropagate(module,'ready');return;}}if(!unresolved){unresolved=new StringSet();}var deps=registry[module].dependencies;unresolved.add(module);for(var i=0;i<deps.length;i++){if(resolved.indexOf(deps[i])===-1){if(unresolved.has(deps[i])){throw new Error('Circular reference detected: '+module+' -> '+deps[i]);}sortDependencies(deps[i],resolved,unresolved);}}resolved.push(module);}function resolve(modules){var resolved=baseModules.slice();for(var i=0;i<modules.length;i++){sortDependencies(modules[i],resolved);}return resolved
;}function resolveStubbornly(modules){var resolved=baseModules.slice();for(var i=0;i<modules.length;i++){var saved=resolved.slice();try{sortDependencies(modules[i],resolved);}catch(err){resolved=saved;mw.log.warn('Skipped unavailable module '+modules[i]);if(modules[i]in registry){mw.trackError('resourceloader.exception',{exception:err,source:'resolve'});}}}return resolved;}function resolveRelativePath(relativePath,basePath){var relParts=relativePath.match(/^((?:\.\.?\/)+)(.*)$/);if(!relParts){return null;}var baseDirParts=basePath.split('/');baseDirParts.pop();var prefixes=relParts[1].split('/');prefixes.pop();var prefix;while((prefix=prefixes.pop())!==undefined){if(prefix==='..'){baseDirParts.pop();}}return(baseDirParts.length?baseDirParts.join('/')+'/':'')+relParts[2];}function makeRequireFunction(moduleObj,basePath){return function require(moduleName){var fileName=resolveRelativePath(moduleName,basePath);if(fileName===null){return mw.loader.require(moduleName);}if(hasOwn.call(
moduleObj.packageExports,fileName)){return moduleObj.packageExports[fileName];}var scriptFiles=moduleObj.script.files;if(!hasOwn.call(scriptFiles,fileName)){throw new Error('Cannot require undefined file '+fileName);}var result,fileContent=scriptFiles[fileName];if(typeof fileContent==='function'){var moduleParam={exports:{}};fileContent(makeRequireFunction(moduleObj,fileName),moduleParam,moduleParam.exports);result=moduleParam.exports;}else{result=fileContent;}moduleObj.packageExports[fileName]=result;return result;};}function addScript(src,callback){var script=document.createElement('script');script.src=src;script.onload=script.onerror=function(){if(script.parentNode){script.parentNode.removeChild(script);}if(callback){callback();callback=null;}};document.head.appendChild(script);}function queueModuleScript(src,moduleName,callback){pendingRequests.push(function(){if(moduleName!=='jquery'){window.require=mw.loader.require;window.module=registry[moduleName].module;}addScript(src,
function(){delete window.module;callback();if(pendingRequests[0]){pendingRequests.shift()();}else{handlingPendingRequests=false;}});});if(!handlingPendingRequests&&pendingRequests[0]){handlingPendingRequests=true;pendingRequests.shift()();}}function addLink(url,media,nextNode){var el=document.createElement('link');el.rel='stylesheet';if(media){el.media=media;}el.href=url;if(nextNode&&nextNode.parentNode){nextNode.parentNode.insertBefore(el,nextNode);}else{document.head.appendChild(el);}}function domEval(code){var script=document.createElement('script');if(mw.config.get('wgCSPNonce')!==false){script.nonce=mw.config.get('wgCSPNonce');}script.text=code;document.head.appendChild(script);script.parentNode.removeChild(script);}function enqueue(dependencies,ready,error){if(allReady(dependencies)){if(ready){ready();}return;}var failed=anyFailed(dependencies);if(failed!==false){if(error){error(new Error('Dependency '+failed+' failed to load'),dependencies);}return;}if(ready||error){jobs.push({
dependencies:dependencies.filter(function(module){var state=registry[module].state;return state==='registered'||state==='loaded'||state==='loading'||state==='executing';}),ready:ready,error:error});}dependencies.forEach(function(module){if(registry[module].state==='registered'&&queue.indexOf(module)===-1){queue.push(module);}});mw.loader.work();}function execute(module){if(registry[module].state!=='loaded'){throw new Error('Module in state "'+registry[module].state+'" may not execute: '+module);}registry[module].state='executing';var runScript=function(){var script=registry[module].script;var markModuleReady=function(){setAndPropagate(module,'ready');};var nestedAddScript=function(arr,offset){if(offset>=arr.length){markModuleReady();return;}queueModuleScript(arr[offset],module,function(){nestedAddScript(arr,offset+1);});};try{if(Array.isArray(script)){nestedAddScript(script,0);}else if(typeof script==='function'){if(module==='jquery'){script();}else{script(window.$,window.$,mw.loader.
require,registry[module].module);}markModuleReady();}else if(typeof script==='object'&&script!==null){var mainScript=script.files[script.main];if(typeof mainScript!=='function'){throw new Error('Main file in module '+module+' must be a function');}mainScript(makeRequireFunction(registry[module],script.main),registry[module].module,registry[module].module.exports);markModuleReady();}else if(typeof script==='string'){domEval(script);markModuleReady();}else{markModuleReady();}}catch(e){setAndPropagate(module,'error');mw.trackError('resourceloader.exception',{exception:e,module:module,source:'module-execute'});}};if(registry[module].messages){mw.messages.set(registry[module].messages);}if(registry[module].templates){mw.templates.set(module,registry[module].templates);}var cssPending=0;var cssHandle=function(){cssPending++;return function(){cssPending--;if(cssPending===0){var runScriptCopy=runScript;runScript=undefined;runScriptCopy();}};};if(registry[module].style){for(var key in registry[
module].style){var value=registry[module].style[key];if(key==='css'){for(var i=0;i<value.length;i++){addEmbeddedCSS(value[i],cssHandle());}}else if(key==='url'){for(var media in value){var urls=value[media];for(var j=0;j<urls.length;j++){addLink(urls[j],media,marker);}}}}}if(module==='user'){var siteDeps;var siteDepErr;try{siteDeps=resolve(['site']);}catch(e){siteDepErr=e;runScript();}if(!siteDepErr){enqueue(siteDeps,runScript,runScript);}}else if(cssPending===0){runScript();}}function sortQuery(o){var sorted={};var list=[];for(var key in o){list.push(key);}list.sort();for(var i=0;i<list.length;i++){sorted[list[i]]=o[list[i]];}return sorted;}function buildModulesString(moduleMap){var str=[];var list=[];var p;function restore(suffix){return p+suffix;}for(var prefix in moduleMap){p=prefix===''?'':prefix+'.';str.push(p+moduleMap[prefix].join(','));list.push.apply(list,moduleMap[prefix].map(restore));}return{str:str.join('|'),list:list};}function makeQueryString(params){var chunks=[];for(
var key in params){chunks.push(encodeURIComponent(key)+'='+encodeURIComponent(params[key]));}return chunks.join('&');}function batchRequest(batch){if(!batch.length){return;}var sourceLoadScript,currReqBase,moduleMap;function doRequest(){var query=Object.create(currReqBase),packed=buildModulesString(moduleMap);query.modules=packed.str;query.version=getCombinedVersion(packed.list);query=sortQuery(query);addScript(sourceLoadScript+'?'+makeQueryString(query));}batch.sort();var reqBase={"lang":"en","skin":"cologneblue"};var splits=Object.create(null);for(var b=0;b<batch.length;b++){var bSource=registry[batch[b]].source;var bGroup=registry[batch[b]].group;if(!splits[bSource]){splits[bSource]=Object.create(null);}if(!splits[bSource][bGroup]){splits[bSource][bGroup]=[];}splits[bSource][bGroup].push(batch[b]);}for(var source in splits){sourceLoadScript=sources[source];for(var group in splits[source]){var modules=splits[source][group];currReqBase=Object.create(reqBase);if(group===0&&mw.config.
get('wgUserName')!==null){currReqBase.user=mw.config.get('wgUserName');}var currReqBaseLength=makeQueryString(currReqBase).length+23;var length=currReqBaseLength;var currReqModules=[];moduleMap=Object.create(null);for(var i=0;i<modules.length;i++){var lastDotIndex=modules[i].lastIndexOf('.'),prefix=modules[i].slice(0,Math.max(0,lastDotIndex)),suffix=modules[i].slice(lastDotIndex+1),bytesAdded=moduleMap[prefix]?suffix.length+3:modules[i].length+3;if(currReqModules.length&&length+bytesAdded>mw.loader.maxQueryLength){doRequest();length=currReqBaseLength;moduleMap=Object.create(null);currReqModules=[];}if(!moduleMap[prefix]){moduleMap[prefix]=[];}length+=bytesAdded;moduleMap[prefix].push(suffix);currReqModules.push(modules[i]);}if(currReqModules.length){doRequest();}}}}function asyncEval(implementations,cb){if(!implementations.length){return;}mw.requestIdleCallback(function(){try{domEval(implementations.join(';'));}catch(err){cb(err);}});}function getModuleKey(module){return module in
registry?(module+'@'+registry[module].version):null;}function splitModuleKey(key){var index=key.lastIndexOf('@');if(index===-1||index===0){return{name:key,version:''};}return{name:key.slice(0,index),version:key.slice(index+1)};}function registerOne(module,version,dependencies,group,source,skip){if(module in registry){throw new Error('module already registered: '+module);}version=String(version||'');if(version.slice(-1)==='!'){if(!isES6Supported){return;}version=version.slice(0,-1);}registry[module]={module:{exports:{}},packageExports:{},version:version,dependencies:dependencies||[],group:typeof group==='undefined'?null:group,source:typeof source==='string'?source:'local',state:'registered',skip:typeof skip==='string'?skip:null};}mw.loader={moduleRegistry:registry,maxQueryLength:5000,addStyleTag:newStyleTag,enqueue:enqueue,resolve:resolve,work:function(){store.init();var q=queue.length,storedImplementations=[],storedNames=[],requestNames=[],batch=new StringSet();while(q--){var module=
queue[q];if(mw.loader.getState(module)==='registered'&&!batch.has(module)){registry[module].state='loading';batch.add(module);var implementation=store.get(module);if(implementation){storedImplementations.push(implementation);storedNames.push(module);}else{requestNames.push(module);}}}queue=[];asyncEval(storedImplementations,function(err){store.stats.failed++;store.clear();mw.trackError('resourceloader.exception',{exception:err,source:'store-eval'});var failed=storedNames.filter(function(name){return registry[name].state==='loading';});batchRequest(failed);});batchRequest(requestNames);},addSource:function(ids){for(var id in ids){if(id in sources){throw new Error('source already registered: '+id);}sources[id]=ids[id];}},register:function(modules){if(typeof modules!=='object'){registerOne.apply(null,arguments);return;}function resolveIndex(dep){return typeof dep==='number'?modules[dep][0]:dep;}for(var i=0;i<modules.length;i++){var deps=modules[i][2];if(deps){for(var j=0;j<deps.length;j++
){deps[j]=resolveIndex(deps[j]);}}registerOne.apply(null,modules[i]);}},implement:function(module,script,style,messages,templates){var split=splitModuleKey(module),name=split.name,version=split.version;if(!(name in registry)){mw.loader.register(name);}if(registry[name].script!==undefined){throw new Error('module already implemented: '+name);}if(version){registry[name].version=version;}registry[name].script=script||null;registry[name].style=style||null;registry[name].messages=messages||null;registry[name].templates=templates||null;if(registry[name].state!=='error'&&registry[name].state!=='missing'){setAndPropagate(name,'loaded');}},load:function(modules,type){if(typeof modules==='string'&&/^(https?:)?\/?\//.test(modules)){if(type==='text/css'){addLink(modules);}else if(type==='text/javascript'||type===undefined){addScript(modules);}else{throw new Error('Invalid type '+type);}}else{modules=typeof modules==='string'?[modules]:modules;enqueue(resolveStubbornly(modules));}},state:function(
states){for(var module in states){if(!(module in registry)){mw.loader.register(module);}setAndPropagate(module,states[module]);}},getState:function(module){return module in registry?registry[module].state:null;},require:function(moduleName){if(mw.loader.getState(moduleName)!=='ready'){throw new Error('Module "'+moduleName+'" is not loaded');}return registry[moduleName].module.exports;}};var hasPendingWrites=false;function flushWrites(){store.prune();while(store.queue.length){store.set(store.queue.shift());}try{localStorage.removeItem(store.key);var data=JSON.stringify(store);localStorage.setItem(store.key,data);}catch(e){mw.trackError('resourceloader.exception',{exception:e,source:'store-localstorage-update'});}hasPendingWrites=false;}mw.loader.store=store={enabled:null,items:{},queue:[],stats:{hits:0,misses:0,expired:0,failed:0},toJSON:function(){return{items:store.items,vary:store.vary,asOf:Math.ceil(Date.now()/1e7)};},key:"MediaWikiModuleStore:commonswiki",vary:"cologneblue:1-3:en",
init:function(){if(this.enabled===null){this.enabled=false;if(false||/Firefox/.test(navigator.userAgent)){this.clear();}else{this.load();}}},load:function(){try{var raw=localStorage.getItem(this.key);this.enabled=true;var data=JSON.parse(raw);if(data&&data.vary===this.vary&&data.items&&Date.now()<(data.asOf*1e7)+259e7){this.items=data.items;}}catch(e){}},get:function(module){if(this.enabled){var key=getModuleKey(module);if(key in this.items){this.stats.hits++;return this.items[key];}this.stats.misses++;}return false;},add:function(module){if(this.enabled){this.queue.push(module);this.requestUpdate();}},set:function(module){var args,encodedScript,descriptor=registry[module],key=getModuleKey(module);if(key in this.items||!descriptor||descriptor.state!=='ready'||!descriptor.version||descriptor.group===1||descriptor.group===0||[descriptor.script,descriptor.style,descriptor.messages,descriptor.templates].indexOf(undefined)!==-1){return;}try{if(typeof descriptor.script==='function'){
encodedScript=String(descriptor.script);}else if(typeof descriptor.script==='object'&&descriptor.script&&!Array.isArray(descriptor.script)){encodedScript='{'+'main:'+JSON.stringify(descriptor.script.main)+','+'files:{'+Object.keys(descriptor.script.files).map(function(file){var value=descriptor.script.files[file];return JSON.stringify(file)+':'+(typeof value==='function'?value:JSON.stringify(value));}).join(',')+'}}';}else{encodedScript=JSON.stringify(descriptor.script);}args=[JSON.stringify(key),encodedScript,JSON.stringify(descriptor.style),JSON.stringify(descriptor.messages),JSON.stringify(descriptor.templates)];}catch(e){mw.trackError('resourceloader.exception',{exception:e,source:'store-localstorage-json'});return;}var src='mw.loader.implement('+args.join(',')+');';if(src.length>1e5){return;}this.items[key]=src;},prune:function(){for(var key in this.items){if(getModuleKey(splitModuleKey(key).name)!==key){this.stats.expired++;delete this.items[key];}}},clear:function(){this.items={
};try{localStorage.removeItem(this.key);}catch(e){}},requestUpdate:function(){if(!hasPendingWrites){hasPendingWrites=true;setTimeout(function(){mw.requestIdleCallback(flushWrites);},2000);}}};}());mw.requestIdleCallbackInternal=function(callback){setTimeout(function(){var start=mw.now();callback({didTimeout:false,timeRemaining:function(){return Math.max(0,50-(mw.now()-start));}});},1);};mw.requestIdleCallback=window.requestIdleCallback?window.requestIdleCallback.bind(window):mw.requestIdleCallbackInternal;(function(){var queue;mw.loader.addSource({"local":"/w/load.php","metawiki":"//meta.wikimedia.org/w/load.php"});mw.loader.register([["site","190bc",[1]],["site.styles","f0uto",[],2],["filepage","2rscn"],["user","s1wiu",[],0],["user.styles","smrj4",[],0],["user.options","1i9g4",[],1],["mediawiki.skinning.elements","1sarl"],["mediawiki.skinning.content","181dn"],["mediawiki.skinning.interface","mu8k8"],["jquery.makeCollapsible.styles","ljtp5"],["mediawiki.skinning.content.parsoid",
"1yx5v"],["mediawiki.skinning.content.externallinks","15suo"],["jquery","1vnvf"],["es6-polyfills","u287e",[],null,null,"return Array.prototype.find\u0026\u0026Array.prototype.findIndex\u0026\u0026Array.prototype.includes\u0026\u0026typeof Promise==='function'\u0026\u0026Promise.prototype.finally;"],["fetch-polyfill","1gvrd",[15]],["web2017-polyfills","k0rck",[13],null,null,"return'IntersectionObserver'in window\u0026\u0026typeof fetch==='function'\u0026\u0026typeof URL==='function'\u0026\u0026'toJSON'in URL.prototype;"],["mediawiki.base","1a5aj",[12]],["jquery.chosen","bppd4"],["jquery.client","1tje2"],["jquery.color","qs4nu"],["jquery.confirmable","1en9n",[115]],["jquery.cookie","1u41n"],["jquery.form","186tg"],["jquery.fullscreen","18ttp"],["jquery.highlightText","t130m",[88]],["jquery.hoverIntent","pqqa9"],["jquery.i18n","31t4a",[114]],["jquery.lengthLimit","qrnp1",[70]],["jquery.makeCollapsible","3zx6r",[9]],["jquery.spinner","yoa8f",[30]],["jquery.spinner.styles","pfek7"],[
"jquery.suggestions","1ykxl",[24]],["jquery.tablesorter","ex6te",[33,116,88]],["jquery.tablesorter.styles","jjsfw"],["jquery.textSelection","em3yw",[18]],["jquery.throttle-debounce","1bymo"],["jquery.tipsy","75pn7"],["jquery.ui","12ffh"],["moment","r6trt",[112,88]],["vue","3awne!"],["@vue/composition-api","1s4l3",[39]],["vuex","ironm!",[39]],["wvui","1ryei",[40]],["wvui-search","w257l",[39]],["@wikimedia/codex","1emtp!",[39]],["mediawiki.template","6nkqm"],["mediawiki.template.mustache","gy30q",[45]],["mediawiki.apipretty","qjpf2"],["mediawiki.api","1sdt6",[76,115]],["mediawiki.content.json","1n6wr"],["mediawiki.confirmCloseWindow","1m54f"],["mediawiki.debug","a5lwb",[203]],["mediawiki.diff","oztjs"],["mediawiki.diff.styles","1jzsw"],["mediawiki.feedback","nllne",[978,211]],["mediawiki.feedlink","5bck4"],["mediawiki.filewarning","1aaoe",[203,215]],["mediawiki.ForeignApi","17f2l",[319]],["mediawiki.ForeignApi.core","15s0r",[85,48,199]],["mediawiki.helplink","5fs9z"],["mediawiki.hlist",
"85ir9"],["mediawiki.htmlform","18f2c",[27,88]],["mediawiki.htmlform.ooui","moc8u",[203]],["mediawiki.htmlform.styles","1x8zm"],["mediawiki.htmlform.ooui.styles","ge3zz"],["mediawiki.icon","17xlm"],["mediawiki.inspect","1w7zb",[70,88]],["mediawiki.notification","i9scp",[88,95]],["mediawiki.notification.convertmessagebox","zb0xo",[67]],["mediawiki.notification.convertmessagebox.styles","dro1f"],["mediawiki.String","1ck84"],["mediawiki.pager.styles","2txmq"],["mediawiki.pager.tablePager","ykcx2"],["mediawiki.pulsatingdot","svyap"],["mediawiki.searchSuggest","16shg",[31,48]],["mediawiki.storage","1sj4u"],["mediawiki.Title","1bqh8",[70,88]],["mediawiki.Upload","3i9e4",[48]],["mediawiki.ForeignUpload","pxkp9",[57,77]],["mediawiki.ForeignStructuredUpload","1s325",[78]],["mediawiki.Upload.Dialog","k8qbo",[81]],["mediawiki.Upload.BookletLayout","y4ry3",[77,86,38,206,211,216,217]],["mediawiki.ForeignStructuredUpload.BookletLayout","gss1b",[79,81,119,182,176]],["mediawiki.toc","5oex3",[92]],[
"mediawiki.toc.styles","1vzj1"],["mediawiki.Uri","1n2iu",[88]],["mediawiki.user","1ab6a",[48,92]],["mediawiki.userSuggest","1tzu5",[31,48]],["mediawiki.util","ucm4f",[18]],["mediawiki.viewport","j19gc"],["mediawiki.checkboxtoggle","nzeg7"],["mediawiki.checkboxtoggle.styles","1esmp"],["mediawiki.cookie","3bl6x",[21]],["mediawiki.experiments","8e8ao"],["mediawiki.editfont.styles","76g2r"],["mediawiki.visibleTimeout","1bmk6"],["mediawiki.action.delete","zjbix",[27,203]],["mediawiki.action.edit","165e7",[34,98,48,94,178]],["mediawiki.action.edit.styles","17fjz"],["mediawiki.action.edit.collapsibleFooter","1jlz7",[28,65,75]],["mediawiki.action.edit.preview","9ldbn",[29,125,86]],["mediawiki.action.history","1j8pz",[28]],["mediawiki.action.history.styles","10vu6"],["mediawiki.action.protect","nuj27",[27,203]],["mediawiki.action.view.metadata","104m6",[110]],["mediawiki.action.view.categoryPage.styles","18sxm"],["mediawiki.action.view.postEdit","11sol",[115,67,203,222]],[
"mediawiki.action.view.redirect","1a3n8",[18]],["mediawiki.action.view.redirectPage","1tcmo"],["mediawiki.action.edit.editWarning","192id",[34,50,115]],["mediawiki.action.view.filepage","zhum4"],["mediawiki.action.styles","xz1f2"],["mediawiki.language","1h2x6",[113]],["mediawiki.cldr","1630p",[114]],["mediawiki.libs.pluralruleparser","8vy0u"],["mediawiki.jqueryMsg","11iw3",[70,112,88,5]],["mediawiki.language.months","1tymc",[112]],["mediawiki.language.names","xubm8",[112]],["mediawiki.language.specialCharacters","cv42u",[112]],["mediawiki.libs.jpegmeta","16fc5"],["mediawiki.page.gallery","7tgpe",[121,88]],["mediawiki.page.gallery.styles","1p8qp"],["mediawiki.page.gallery.slideshow","1j8et",[48,206,225,227]],["mediawiki.page.ready","1m3as",[48]],["mediawiki.page.watch.ajax","1rflu",[48]],["mediawiki.page.preview","1mxad",[28,34,48,53,203]],["mediawiki.page.image.pagination","18sxf",[29,88]],["mediawiki.rcfilters.filters.base.styles","1b228"],[
"mediawiki.rcfilters.highlightCircles.seenunseen.styles","gwlmv"],["mediawiki.rcfilters.filters.ui","ncui8",[28,85,86,173,212,219,221,222,223,225,226]],["mediawiki.interface.helpers.styles","1436n"],["mediawiki.special","1r76y"],["mediawiki.special.apisandbox","o0vbb",[28,85,193,179,202,217]],["mediawiki.special.block","3z6jo",[61,176,192,183,193,190,217,219]],["mediawiki.misc-authed-ooui","4897z",[62,173,178]],["mediawiki.misc-authed-pref","1b18i",[5]],["mediawiki.misc-authed-curate","1auv8",[20,29,48]],["mediawiki.special.changeslist","1cy7m"],["mediawiki.special.changeslist.watchlistexpiry","dgsac",[131]],["mediawiki.special.changeslist.enhanced","1xll3"],["mediawiki.special.changeslist.legend","174an"],["mediawiki.special.changeslist.legend.js","fa4m4",[28,92]],["mediawiki.special.contributions","ua2dg",[28,115,176,202]],["mediawiki.special.edittags","1di11",[17,27]],["mediawiki.special.import","5dvpi",[173]],["mediawiki.special.import.styles.ooui","1owcj"],[
"mediawiki.special.preferences.ooui","kr0k3",[50,94,68,75,183,178]],["mediawiki.special.preferences.styles.ooui","1rcr5"],["mediawiki.special.recentchanges","1b2m9",[173]],["mediawiki.special.revisionDelete","e8jxp",[27]],["mediawiki.special.search","1sevh",[195]],["mediawiki.special.search.commonsInterwikiWidget","5zvgb",[85,48]],["mediawiki.special.search.interwikiwidget.styles","17wtq"],["mediawiki.special.search.styles","qgber"],["mediawiki.special.unwatchedPages","ygz13",[48]],["mediawiki.special.upload","s2u79",[29,48,50,119,131,45]],["mediawiki.special.userlogin.common.styles","b44v9"],["mediawiki.special.userlogin.login.styles","1bqrv"],["mediawiki.special.createaccount","104qy",[48]],["mediawiki.special.userlogin.signup.styles","1abpp"],["mediawiki.special.userrights","faiav",[27,68]],["mediawiki.special.watchlist","du6lj",[48,203,222]],["mediawiki.special.version","5yx4s"],["mediawiki.legacy.config","odz9c"],["mediawiki.legacy.commonPrint","1hzmi"],["mediawiki.legacy.shared",
"c35jl"],["mediawiki.ui","1pvn3"],["mediawiki.ui.checkbox","11acr"],["mediawiki.ui.radio","1ixij"],["mediawiki.ui.anchor","mw0v4"],["mediawiki.ui.button","1kidx"],["mediawiki.ui.input","1pxwt"],["mediawiki.ui.icon","d4fyb"],["mediawiki.widgets","1jppb",[48,174,206,216]],["mediawiki.widgets.styles","1kqtv"],["mediawiki.widgets.AbandonEditDialog","1qv1d",[211]],["mediawiki.widgets.DateInputWidget","17wo9",[177,38,206,227]],["mediawiki.widgets.DateInputWidget.styles","v2g8d"],["mediawiki.widgets.visibleLengthLimit","uj2nl",[27,203]],["mediawiki.widgets.datetime","1mxgx",[88,203,222,226,227]],["mediawiki.widgets.expiry","1xp7z",[179,38,206]],["mediawiki.widgets.CheckMatrixWidget","bbszi",[203]],["mediawiki.widgets.CategoryMultiselectWidget","fr599",[57,206]],["mediawiki.widgets.SelectWithInputWidget","yjlkr",[184,206]],["mediawiki.widgets.SelectWithInputWidget.styles","4wtw6"],["mediawiki.widgets.SizeFilterWidget","1ht3s",[186,206]],["mediawiki.widgets.SizeFilterWidget.styles","b3yqn"],[
"mediawiki.widgets.MediaSearch","18dlo",[57,206]],["mediawiki.widgets.Table","1vxru",[206]],["mediawiki.widgets.TagMultiselectWidget","1mwuq",[206]],["mediawiki.widgets.UserInputWidget","1555z",[48,206]],["mediawiki.widgets.UsersMultiselectWidget","1h6xp",[48,206]],["mediawiki.widgets.NamespacesMultiselectWidget","jiviu",[206]],["mediawiki.widgets.TitlesMultiselectWidget","593ki",[173]],["mediawiki.widgets.TagMultiselectWidget.styles","1hdc9"],["mediawiki.widgets.SearchInputWidget","haq07",[74,173,222]],["mediawiki.widgets.SearchInputWidget.styles","176ja"],["mediawiki.watchstar.widgets","12mms",[202]],["mediawiki.deflate","glf6m"],["oojs","1ch6v"],["mediawiki.router","ajk4o",[201]],["oojs-router","3j2x4",[199]],["oojs-ui","1gvrd",[209,206,211]],["oojs-ui-core","y3pnc",[112,199,205,204,213]],["oojs-ui-core.styles","ijoc2"],["oojs-ui-core.icons","s3euz"],["oojs-ui-widgets","r4cj7",[203,208]],["oojs-ui-widgets.styles","7tf34"],["oojs-ui-widgets.icons","1qv5j"],["oojs-ui-toolbars","hleq3"
,[203,210]],["oojs-ui-toolbars.icons","vjnbt"],["oojs-ui-windows","va15m",[203,212]],["oojs-ui-windows.icons","jdo4c"],["oojs-ui.styles.indicators","dx7t6"],["oojs-ui.styles.icons-accessibility","aymn6"],["oojs-ui.styles.icons-alerts","mh1i3"],["oojs-ui.styles.icons-content","1e3rd"],["oojs-ui.styles.icons-editing-advanced","1fisb"],["oojs-ui.styles.icons-editing-citation","1kwa3"],["oojs-ui.styles.icons-editing-core","d7p5d"],["oojs-ui.styles.icons-editing-list","u1nbk"],["oojs-ui.styles.icons-editing-styling","cq71p"],["oojs-ui.styles.icons-interactions","1byl9"],["oojs-ui.styles.icons-layout","13ato"],["oojs-ui.styles.icons-location","w3uik"],["oojs-ui.styles.icons-media","17wz9"],["oojs-ui.styles.icons-moderation","11alw"],["oojs-ui.styles.icons-movement","6due7"],["oojs-ui.styles.icons-user","12u19"],["oojs-ui.styles.icons-wikimedia","hwe5s"],["skins.vector.user","1xvcb",[],0],["skins.vector.user.styles","1gxes",[],0],["skins.vector.search","1tkv8!",[85,43]],[
"skins.vector.styles.legacy","19veb"],["skins.vector.styles","1kz7n"],["skins.vector.icons.js","1f1is"],["skins.vector.icons","1x573"],["skins.vector.es6","9he0d!",[93,123,124,86,235]],["skins.vector.js","r9gz2",[123,235]],["skins.vector.legacy.js","1li6r",[123]],["skins.monobook.styles","zpxzv"],["skins.monobook.scripts","glb5a",[86,215]],["skins.modern","10ioi"],["skins.cologneblue","eaifj"],["skins.timeless","rsgv2"],["skins.timeless.js","poasm"],["ext.timeline.styles","poumc"],["ext.wikihiero","129wi"],["ext.wikihiero.special","djmbz",[247,29,203]],["ext.wikihiero.visualEditor","d1kzb",[441]],["ext.charinsert","4sxcx",[34]],["ext.charinsert.styles","ou48j"],["ext.cite.styles","1lb4h"],["ext.cite.style","yx4l1"],["ext.cite.visualEditor.core","1aq9b",[449]],["ext.cite.visualEditor","9ja3e",[253,252,254,215,218,222]],["ext.cite.ux-enhancements","11f2g"],["ext.citeThisPage","1rb6k"],["ext.inputBox.styles","14cr4"],["ext.pygments","1u9pi"],["ext.pygments.linenumbers","zyy6j"],[
"ext.geshi.visualEditor","16uth",[441]],["ext.categoryTree","12fll",[48]],["ext.categoryTree.styles","1ho9u"],["ext.spamBlacklist.visualEditor","ovffn"],["mediawiki.api.titleblacklist","6nhct",[48]],["ext.titleblacklist.visualEditor","1taqb"],["mw.PopUpMediaTransform","340aa",[281,76,284]],["mw.TMHGalleryHook.js","11rpk"],["ext.tmh.embedPlayerIframe","1ybhf",[286,284]],["mw.MediaWikiPlayerSupport","1p0go",[284]],["mw.MediaWikiPlayer.loader","scrqo",[286]],["ext.tmh.video-js","1xn38"],["ext.tmh.videojs-ogvjs","r5nu3",[282,272]],["ext.tmh.player","1eaze",[281,277,76]],["ext.tmh.player.dialog","bt0x9",[276,211]],["ext.tmh.player.inline","1ql9o",[272,76]],["ext.tmh.player.styles","jqwum"],["ext.tmh.thumbnail.styles","hrhb9"],["ext.tmh.transcodetable","qysvh",[48,202]],["ext.tmh.timedtextpage.styles","8t06n"],["ext.tmh.OgvJsSupport","1rgvj"],["ext.tmh.OgvJs","1tz99",[281]],["embedPlayerIframeStyle","2hl6r"],["mw.MwEmbedSupport","432l5",[88]],["mediawiki.UtilitiesTime","sobvx"],[
"jquery.embedPlayer","3n73h"],["mw.EmbedPlayer","1dnws",[281,21,25,37,85,285,115,289,284]],["mw.EmbedPlayerKplayer","9brbg"],["mw.EmbedPlayerNative","fkawj"],["mw.EmbedPlayerVLCApp","iihbe",[85]],["mw.EmbedPlayerIEWebMPrompt","k2n9t"],["mw.EmbedPlayerOgvJs","183ok",[281,29]],["mw.EmbedPlayerImageOverlay","1ihz4"],["mw.TimedText","147im",[117,287]],["ext.urlShortener.special","cyon8",[85,62,173,202]],["ext.urlShortener.toolbar","1wlu3",[48]],["ext.securepoll.htmlform","9l7jw",[29,190]],["ext.securepoll","7ece9"],["ext.securepoll.special","lvyc3"],["ext.score.visualEditor","1tpzs",[301,441]],["ext.score.visualEditor.icons","y5pvy"],["ext.score.popup","cebyg",[48]],["ext.score.errors","s56a4"],["ext.cirrus.serp","6fxwx",[85,200]],["ext.cirrus.explore-similar","1ij99",[48,46]],["ext.nuke.confirm","1itba",[115]],["ext.confirmEdit.editPreview.ipwhitelist.styles","1hytm"],["ext.confirmEdit.visualEditor","dqe95",[969]],["ext.confirmEdit.simpleCaptcha","13qx3"],[
"ext.confirmEdit.fancyCaptcha.styles","kxycq"],["ext.confirmEdit.fancyCaptcha","1dz3b",[48]],["ext.confirmEdit.fancyCaptchaMobile","1dz3b",[500]],["ext.centralauth","1bgnl",[29,88]],["ext.centralauth.centralautologin","eb423",[115]],["ext.centralauth.centralautologin.clearcookie","1kb7x"],["ext.centralauth.misc.styles","157rq"],["ext.centralauth.globaluserautocomplete","1ik8f",[31,48]],["ext.centralauth.globalrenameuser","1maty",[88]],["ext.centralauth.ForeignApi","1tkmh",[58]],["ext.widgets.GlobalUserInputWidget","1bs9f",[48,206]],["ext.GlobalUserPage","ibfm1"],["ext.apifeatureusage","ohwd2"],["ext.dismissableSiteNotice","1tqui",[21,88]],["ext.dismissableSiteNotice.styles","1psm7"],["ext.centralNotice.startUp","1ptwd",[327]],["ext.centralNotice.geoIP","spv2q",[21]],["ext.centralNotice.choiceData","q64bi",[331]],["ext.centralNotice.display","up6v4",[326,329,642,85,75]],["ext.centralNotice.kvStore","yqh2i"],["ext.centralNotice.bannerHistoryLogger","qedmi",[328]],[
"ext.centralNotice.impressionDiet","n5zrg",[328]],["ext.centralNotice.largeBannerLimit","p2grr",[328]],["ext.centralNotice.legacySupport","1kh3o",[328]],["ext.centralNotice.bannerSequence","q58r6",[328]],["ext.centralNotice.freegeoipLookup","1ab6b",[326]],["ext.centralNotice.impressionEventsSampleRate","1kg37",[328]],["ext.centralNotice.cspViolationAlert","1arm3"],["ext.wikimediamessages.contactpage.affcomchapthorg","1ukrj"],["ext.wikimediamessages.contactpage.affcomusergroup","168yb"],["mediawiki.special.block.feedback.request","yglzq"],["ext.collection","1l010",[343,37,112]],["ext.collection.bookcreator.styles","1tk4t"],["ext.collection.bookcreator","macvf",[342,75,88]],["ext.collection.checkLoadFromLocalStorage","4crv1",[341]],["ext.collection.suggest","1wfr5",[343]],["ext.collection.offline","1bnwx"],["ext.collection.bookcreator.messageBox","1gvrd",[349,348,60]],["ext.collection.bookcreator.messageBox.styles","utfnk"],["ext.collection.bookcreator.messageBox.icons","4yd6p"],[
"ext.ElectronPdfService.print.styles","13dj6"],["ext.ElectronPdfService.special.styles","1q6mi"],["ext.ElectronPdfService.special.selectionImages","qem34"],["ext.advancedSearch.initialstyles","1mr14"],["ext.advancedSearch.styles","15jsx"],["ext.advancedSearch.searchtoken","1vhat",[],1],["ext.advancedSearch.elements","1km28",[354,85,86,206,222,223]],["ext.advancedSearch.init","170rl",[356,355]],["ext.advancedSearch.SearchFieldUI","1h395",[76,206]],["ext.abuseFilter","6lhiu"],["ext.abuseFilter.edit","13rna",[29,34,48,50,206]],["ext.abuseFilter.tools","1yw3k",[29,48]],["ext.abuseFilter.examine","1az7d",[29,48]],["ext.abuseFilter.ace","67phm",[625]],["ext.abuseFilter.visualEditor","148wm"],["pdfhandler.messages","1n82m"],["ext.wikiEditor","sfzfp",[34,37,118,86,173,217,218,219,220,221,225,45],3],["ext.wikiEditor.styles","3kdjm",[],3],["ext.wikiEditor.realtimepreview","1yass",[366,125]],["ext.CodeMirror","lf2hh",[370,34,37,86,221]],["ext.CodeMirror.data","1r8p9"],["ext.CodeMirror.lib",
"12rli"],["ext.CodeMirror.addons","18r8x",[371]],["ext.CodeMirror.mode.mediawiki","vl3og",[371]],["ext.CodeMirror.lib.mode.css","12rkf",[371]],["ext.CodeMirror.lib.mode.javascript","kv1z9",[371]],["ext.CodeMirror.lib.mode.xml","1n718",[371]],["ext.CodeMirror.lib.mode.htmlmixed","12m9d",[374,375,376]],["ext.CodeMirror.lib.mode.clike","1eahy",[371]],["ext.CodeMirror.lib.mode.php","19ek6",[378,377]],["ext.CodeMirror.visualEditor.init","1pesf"],["ext.CodeMirror.visualEditor","1fqt4",[441]],["ext.MassMessage.styles","yqa78"],["ext.MassMessage.special.js","gysrf",[27,35,37,115]],["ext.MassMessage.content.js","gn56m",[20,37,48]],["ext.MassMessage.create","igvel",[37,62,115]],["ext.MassMessage.edit","1k1lh",[178,202]],["ext.uploadWizard.page","dmxs3",[391],4],["ext.uploadWizard.page.styles","hi1gv"],["ext.uploadWizard.uploadCampaign.display","jogv3"],["uw.EventFlowLogger","me1f9",[199],5],["ext.uploadWizard","9l46c",[28,29,50,94,54,65,119,86,173,182,176,215,217,219,222,224,226,390],4],[
"mediasearch.styles","1dty8"],["mediasearch","19tdf",[40,392,57,75,86,41,15]],["ext.betaFeatures","1dfn3",[18,203]],["ext.betaFeatures.styles","8xj2r"],["ext.GWToolset","7lqo7",[29,37]],["mmv","19wk1",[19,23,36,85,402]],["mmv.ui.ondemandshareddependencies","qzh6b",[397,202]],["mmv.ui.download.pane","1wqlm",[166,173,398]],["mmv.ui.reuse.shareembed","1la1k",[173,398]],["mmv.ui.tipsyDialog","tk9ym",[397]],["mmv.bootstrap","htny5",[170,172,404,201]],["mmv.bootstrap.autostart","1bp9m",[402]],["mmv.head","f0dls",[75,86]],["ext.linter.edit","h2pbf",[34]],["socket.io","fcmug"],["dompurify","cw5fe"],["color-picker","1hxf4"],["unicodejs","alrva"],["papaparse","5tm70"],["rangefix","ekvqx"],["spark-md5","1uk2w"],["ext.visualEditor.supportCheck","hzrm9",[],6],["ext.visualEditor.sanitize","1snr7",[407,430],6],["ext.visualEditor.progressBarWidget","1ns9r",[],6],["ext.visualEditor.tempWikitextEditorWidget","151cl",[94,86],6],["ext.visualEditor.desktopArticleTarget.init","18nor",[415,413,416,427,34,85,
123,75],6],["ext.visualEditor.desktopArticleTarget.noscript","wmadm"],["ext.visualEditor.targetLoader","1s3bz",[429,427,34,85,75,86],6],["ext.visualEditor.desktopTarget","1lk2x",[],6],["ext.visualEditor.desktopArticleTarget","oictp",[433,438,420,443],6],["ext.visualEditor.collabTarget","1paqc",[431,437,94,173,222,223],6],["ext.visualEditor.collabTarget.desktop","1fvqe",[422,438,420,443],6],["ext.visualEditor.collabTarget.init","1sgot",[413,173,202],6],["ext.visualEditor.collabTarget.init.styles","18e9s"],["ext.visualEditor.ve","1mbx1",[],6],["ext.visualEditor.track","1lfjv",[426],6],["ext.visualEditor.core.utils","fkgtc",[427,202],6],["ext.visualEditor.core.utils.parsing","1584k",[426],6],["ext.visualEditor.base","51brd",[428,429,409],6],["ext.visualEditor.mediawiki","1ytcn",[430,419,32,669],6],["ext.visualEditor.mwsave","1r7le",[441,27,29,53,222],6],["ext.visualEditor.articleTarget","1ioq4",[442,432,175],6],["ext.visualEditor.data","djggw",[431]],["ext.visualEditor.core","74kgf",[414,
413,18,410,411,412],6],["ext.visualEditor.commentAnnotation","vvma3",[435],6],["ext.visualEditor.rebase","7l1o6",[408,452,436,228,406],6],["ext.visualEditor.core.desktop","127qa",[435],6],["ext.visualEditor.welcome","k180i",[202],6],["ext.visualEditor.switching","136a5",[48,202,214,217,219],6],["ext.visualEditor.mwcore","1jk4k",[453,431,440,439,130,73,10,173],6],["ext.visualEditor.mwextensions","1gvrd",[434,464,457,459,444,461,446,458,447,449],6],["ext.visualEditor.mwextensions.desktop","1gvrd",[442,448,82],6],["ext.visualEditor.mwformatting","139um",[441],6],["ext.visualEditor.mwimage.core","1xo1s",[441],6],["ext.visualEditor.mwimage","1ch6a",[445,187,38,225,229],6],["ext.visualEditor.mwlink","1aui8",[441],6],["ext.visualEditor.mwmeta","4nqx1",[447,108],6],["ext.visualEditor.mwtransclusion","1oal4",[441,190],6],["treeDiffer","ylkzm"],["diffMatchPatch","1f0tq"],["ext.visualEditor.checkList","17b0s",[435],6],["ext.visualEditor.diffing","1qcbz",[451,435,450],6],[
"ext.visualEditor.diffPage.init.styles","11pe4"],["ext.visualEditor.diffLoader","1un0a",[419],6],["ext.visualEditor.diffPage.init","1adaq",[455,202,214,217],6],["ext.visualEditor.language","5blra",[435,669,117],6],["ext.visualEditor.mwlanguage","1ucrg",[435],6],["ext.visualEditor.mwalienextension","1i211",[441],6],["ext.visualEditor.mwwikitext","s0yaf",[447,94],6],["ext.visualEditor.mwgallery","9vuvx",[441,121,187,225],6],["ext.visualEditor.mwsignature","18e03",[449],6],["ext.visualEditor.experimental","1gvrd",[],6],["ext.visualEditor.icons","1gvrd",[465,466,215,216,217,219,220,221,222,223,226,227,228,213],6],["ext.visualEditor.moduleIcons","6ft35"],["ext.visualEditor.moduleIndicators","1vxt1"],["ext.citoid.visualEditor","eol1g",[255,468]],["ext.citoid.visualEditor.data","zugge",[431]],["ext.citoid.wikibase.init","8dvhj"],["ext.citoid.wikibase","1fcrm",[469,37,202]],["ext.templateData","1t2ui"],["ext.templateDataGenerator.editPage","1mtwk"],["ext.templateDataGenerator.data","196in",[
199]],["ext.templateDataGenerator.editTemplatePage","8fvwg",[471,475,473,34,669,48,206,211,222,223,226]],["ext.templateData.images","k0ymw"],["ext.TemplateWizard","1jxpj",[34,173,176,190,209,211,222]],["ext.wikiLove.icon","1c1zm"],["ext.wikiLove.startup","by1r0",[37,48,170]],["ext.wikiLove.local","psm3n"],["ext.wikiLove.init","1y0df",[478]],["mediawiki.libs.guiders","1l1fg"],["ext.guidedTour.styles","d0h2x",[481,170]],["ext.guidedTour.lib.internal","1uwi4",[88]],["ext.guidedTour.lib","sbcuo",[642,483,482]],["ext.guidedTour.launcher","6pn6x"],["ext.guidedTour","13bf4",[484]],["ext.guidedTour.tour.firstedit","1fgpr",[486]],["ext.guidedTour.tour.test","1jpds",[486]],["ext.guidedTour.tour.onshow","1md6f",[486]],["ext.guidedTour.tour.uprightdownleft","p83px",[486]],["mobile.pagelist.styles","191j1"],["mobile.pagesummary.styles","1kwqc"],["mobile.placeholder.images","d6esn"],["mobile.userpage.styles","jz4wg"],["mobile.startup.images","1983o"],["mobile.init.styles","x1mvo"],["mobile.init",
"1vmw8",[85,500]],["mobile.ooui.icons","1pzgm"],["mobile.user.icons","1gfit"],["mobile.startup","mp8ig",[35,124,200,75,46,170,172,86,498,491,492,493,495]],["mobile.editor.overlay","1smeh",[50,94,67,171,175,502,500,499,202,219]],["mobile.editor.images","wfxsa"],["mobile.talk.overlays","oxhfl",[169,501]],["mobile.mediaViewer","149jl",[500]],["mobile.languages.structured","hftdv",[500]],["mobile.special.mobileoptions.styles","1g0pj"],["mobile.special.mobileoptions.scripts","wh13m",[500]],["mobile.special.nearby.styles","pt0l6"],["mobile.special.userlogin.scripts","1rm8n"],["mobile.special.nearby.scripts","4rqmw",[85,508,500]],["mobile.special.mobilediff.images","1sw4x"],["skins.minerva.base.styles","5fl1j"],["skins.minerva.content.styles.images","1oojh"],["skins.minerva.icons.loggedin","1nypb"],["skins.minerva.amc.styles","8zh2z"],["skins.minerva.overflow.icons","15f9y"],["skins.minerva.icons.wikimedia","37d33"],["skins.minerva.icons.images.scripts.misc","1uiku"],[
"skins.minerva.icons.page.issues.uncolored","1rea5"],["skins.minerva.icons.page.issues.default.color","1fdjj"],["skins.minerva.icons.page.issues.medium.color","l4bw4"],["skins.minerva.mainPage.styles","rawid"],["skins.minerva.userpage.styles","juhd4"],["skins.minerva.talk.styles","18sa5"],["skins.minerva.personalMenu.icons","1brfr"],["skins.minerva.mainMenu.advanced.icons","lfbh9"],["skins.minerva.mainMenu.icons","19pyg"],["skins.minerva.mainMenu.styles","crld4"],["skins.minerva.loggedin.styles","5kzqc"],["skins.minerva.scripts","16n0n",[85,93,169,500,518,520,521,519,527,528,531]],["skins.minerva.messageBox.styles","czo5c"],["skins.minerva.categories.styles","1plbi"],["ext.math.styles","1v9c1"],["ext.math.scripts","16fem"],["mw.widgets.MathWbEntitySelector","amyw4",[57,173,759,211]],["ext.math.visualEditor","12uvp",[533,441]],["ext.math.visualEditor.mathSymbolsData","ltjso",[536]],["ext.math.visualEditor.mathSymbols","1tj2q",[537]],["ext.math.visualEditor.chemSymbolsData","ar9ku",[536]
],["ext.math.visualEditor.chemSymbols","r7qo8",[539]],["ext.babel","16oqx"],["ext.translate","l9w3r"],["ext.translate.base","1g7m5",[48]],["ext.translate.dropdownmenu","1iyql"],["ext.translate.specialpages.styles","11yms"],["ext.translate.loader","99tf1"],["ext.translate.messagetable","b9v49",[543,546,551,85]],["ext.translate.pagetranslation.uls","53l29",[659]],["ext.translate.edit.documentation","8jmkw",[206,211]],["ext.translate.edit.documentation.styles","o89na"],["ext.translate.parsers","r5h25",[88]],["ext.translate.quickedit","wz3du"],["ext.translate.selecttoinput","194te"],["ext.translate.special.languagestats","1iujn",[32,48,206]],["ext.translate.messagerenamedialog","1h859",[206,211]],["ext.translate.groupselector","1as75",[543,546,568,37]],["ext.translate.editor","k90v0",[543,544,28,34,85,94,86]],["ext.translate.special.managetranslatorsandbox.styles","g4vp0"],["ext.translate.special.pagemigration","24p6q",[48,166,170]],["ext.translate.special.pagepreparation","rpyyw",[48,53,
166]],["ext.translate.special.searchtranslations","180vt",[557,556,659]],["ext.translate.special.translate","x80qo",[557,556,547,669,75]],["ext.translate.special.translate.styles","18sw5"],["ext.translate.specialTranslationStash","1bubs",[557,547,659]],["ext.translate.special.translationstats","12ghs",[567,179]],["ext.translate.translationstats.embedded","3bcgj",[567]],["ext.translate.translationstats.graphbuilder.js","1jj2d",[48]],["ext.translate.statsbar","1hpik"],["ext.translate.statstable","1obok"],["ext.translate.tag.languages","1adwu"],["ext.translate.special.aggregategroups","1o87z",[37,48]],["ext.translate.special.importtranslations","us1ru",[37]],["ext.translate.special.managetranslatorsandbox","1g37o",[546,659,37]],["ext.translate.special.searchtranslations.operatorsuggest","1qc0g",[37]],["ext.translate.special.pagetranslation","emxjj",[85,170,173]],["ext.translate.special.managegroups","qaduc",[555]],["ext.translate.ve","1fald",[441]],[
"ext.translationnotifications.notifytranslators","1ttvz",[37,85,86]],["ext.translationnotifications.translatorsignup","ll3h2"],["ext.vipsscaler","5smlp",[581]],["jquery.ucompare","1w08f"],["ext.interwiki.specialpage","pge0w"],["ext.echo.logger","18jip",[86,199]],["ext.echo.ui.desktop","1gssv",[590,585]],["ext.echo.ui","85m0d",[586,583,964,206,215,216,222,226,227,228]],["ext.echo.dm","1bfmy",[589,38]],["ext.echo.api","wqab8",[57]],["ext.echo.mobile","g25f4",[585,200,46]],["ext.echo.init","1u3o0",[587]],["ext.echo.styles.badge","19gi8"],["ext.echo.styles.notifications","16fds"],["ext.echo.styles.alert","dce45"],["ext.echo.special","12b13",[594,585]],["ext.echo.styles.special","1djtg"],["ext.thanks.images","103j4"],["ext.thanks","mqgir",[48,92]],["ext.thanks.corethank","152tn",[596,20,211]],["ext.thanks.mobilediff","15xmd",[595,500]],["ext.thanks.flowthank","hptio",[596,211]],["ext.flow.contributions","1cyi3"],["ext.flow.contributions.styles","rx8lo"],["ext.flow.templating","1irde",[605,
86,38]],["ext.flow.mediawiki.ui.form","a0n6w"],["ext.flow.styles.base","1s3zc"],["mediawiki.template.handlebars","1uj4u",[45]],["ext.flow.components","1ez0r",[613,602,35,85,199]],["ext.flow.dm","q0zhg",[48,199]],["ext.flow.ui","gtwpg",[607,611,413,94,75,86,202,217,220,228]],["ext.flow","1ha9n",[606,612,608]],["ext.flow.visualEditor","1aqlt",[611,438,420,443,460]],["ext.flow.visualEditor.icons","1mo93"],["ext.flow.jquery.conditionalScroll","15yer"],["ext.flow.jquery.findWithParent","ihgvx"],["ext.disambiguator","1ltfs!",[48,67]],["ext.disambiguator.visualEditor","aqsjf",[448]],["ext.discussionTools.init.styles","1du29"],["ext.discussionTools.init","1bzz9",[616,429,85,75,86,38,211,411]],["ext.discussionTools.debug","1utlc",[617]],["ext.discussionTools.ReplyWidget","48pik",[969,617,175,178,206]],["ext.discussionTools.ReplyWidgetPlain","bal4k",[619,440,94]],["ext.discussionTools.ReplyWidgetVisual","rfxv9",[619,433,462,460]],["ext.codeEditor","v0khv",[623],3],["jquery.codeEditor","byuo7",[
625,624,366,211],3],["ext.codeEditor.icons","mpdks"],["ext.codeEditor.ace","1nct8",[],7],["ext.codeEditor.ace.modes","5rdce",[625],7],["ext.scribunto.errors","1k506",[37]],["ext.scribunto.logs","kr527"],["ext.scribunto.edit","1lvk4",[29,48]],["ext.RevisionSlider.lazyCss","hjlz2"],["ext.RevisionSlider.lazyJs","cqh11",[634,227]],["ext.RevisionSlider.init","fvevk",[634,635,226]],["ext.RevisionSlider.noscript","1fgu3"],["ext.RevisionSlider.Settings","7m4kh",[75,86]],["ext.RevisionSlider.Slider","1patb",[636,37,85,38,202,222,227]],["ext.RevisionSlider.dialogImages","5uj3c"],["ext.TwoColConflict.SplitJs","bndc5",[639,640,73,75,86,202,222]],["ext.TwoColConflict.SplitCss","1yrn4"],["ext.TwoColConflict.Split.TourImages","5h5fk"],["ext.TwoColConflict.Util","17tmk"],["ext.TwoColConflict.JSCheck","1kalq"],["ext.eventLogging","g514l",[86]],["ext.eventLogging.debug","aryjb"],["ext.eventLogging.jsonSchema","uo1an"],["ext.eventLogging.jsonSchema.styles","125zq"],["ext.wikimediaEvents","ydlq5",[642,85,
93,75,95]],["ext.wikimediaEvents.wikibase","8bkyv",[642,93]],["ext.navigationTiming","1a7ql",[642]],["ext.uls.common","1ukz5",[669,75,86]],["ext.uls.compactlinks","vq2j4",[649,170]],["ext.uls.ime","1xepw",[659,667]],["ext.uls.displaysettings","jwiel",[651,658,167,168]],["ext.uls.geoclient","ijzbu",[92]],["ext.uls.i18n","37yzm",[26,88]],["ext.uls.interface","he130",[665]],["ext.uls.interlanguage","1ylyh"],["ext.uls.languagenames","juked"],["ext.uls.languagesettings","7ifid",[660,661,670,170]],["ext.uls.mediawiki","joiy0",[649,657,660,665,668]],["ext.uls.messages","15kzc",[654]],["ext.uls.preferences","w4ber",[75,86]],["ext.uls.preferencespage","39jcv"],["ext.uls.pt","oavu8"],["ext.uls.setlang","1pv59",[85,48,170]],["ext.uls.webfonts","yefw5",[661]],["ext.uls.webfonts.repository","llohn"],["jquery.ime","1wgdk"],["jquery.uls","1v3z2",[26,669,670]],["jquery.uls.data","p81me"],["jquery.uls.grid","cnek2"],["rangy.core","1sbtu"],["ext.FileImporter.SpecialJs","1djml",[48,202]],[
"ext.FileImporter.SpecialCss","6grg3"],["ext.FileImporter.Images","qluje"],["wikibase.client.init","16uxb"],["wikibase.client.miscStyles","6yl1g"],["wikibase.client.linkitem.init","geh0s",[29]],["jquery.wikibase.linkitem","kw70o",[29,36,37,57,759,758,975]],["wikibase.client.action.edit.collapsibleFooter","znjul",[28,65,75]],["SpecialConstraintReportPage","6tazx",[204]],["wikibase.quality.constraints.icon","cb8hb"],["wikibase.quality.constraints.ui","1q41z",[28,206,760]],["wikibase.quality.constraints.gadget","pxyun",[48,215,681,682],null,null,"return!mw.config.exists('wbEntityId')||mw.config.get('wgMFMode')||!mw.config.get('wbIsEditView');"],["wikibase.quality.constraints.suggestions","1o0sm",[761]],["mediawiki.template.mustache+dom","1d1xi",[46]],["wikibase.mediainfo.base","1a4dz",[203]],["wikibase.mediainfo.readme","1vwhc",[686,685]],["wikibase.mediainfo.uls","157xe",[659,206]],["wikibase.mediainfo.getDeserializer","2cvv2",[690]],[
"wikibase.mediainfo.serialization.MediaInfoDeserializer","19xt6",[791]],["wikibase.mediainfo.filePageDisplay","1rpx7",[109,219,227,692,693]],["wikibase.mediainfo.filepage.styles","v0kuv"],["wikibase.mediainfo.statements","pakhm",[685,817,211,222,224,810,686,694,688,791,766]],["wikibase.mediainfo.statements.styles","165bx"],["ext.wikimediaBadges","xxzpt"],["ext.TemplateSandbox.top","1lfwo"],["ext.TemplateSandbox","16kj6",[696]],["ext.TemplateSandbox.visualeditor","sf8j7",[173,202]],["ext.jsonConfig","ung4s"],["ext.jsonConfig.edit","t0qa8",[34,188,211]],["ext.graph.styles","ghik1"],["ext.graph.data","lnpu6"],["ext.graph.loader","1rnlv",[48]],["ext.graph.vega1","8dzub",[702,85]],["ext.graph.vega2","a8el9",[702,85]],["ext.graph.sandbox","e2bnd",[622,705,50]],["ext.graph.visualEditor","1072e",[702,445,188]],["ext.MWOAuth.styles","mma12"],["ext.MWOAuth.AuthorizeDialog","5xi0x",[37]],["ext.oath.totp.showqrcode","b22bu"],["ext.oath.totp.showqrcode.styles","5iqin"],["ext.webauthn.ui.base",
"aquki",[115,202]],["ext.webauthn.register","cvoxt",[712,48]],["ext.webauthn.login","9wo3z",[712]],["ext.webauthn.manage","16wxd",[712,48]],["ext.webauthn.disable","1rdca",[712]],["ext.checkUser","12tki",[32,85,71,75,173,217,219,222,224,226,228]],["ext.checkUser.styles","1s9ge"],["ext.guidedTour.tour.checkuserinvestigateform","15adu",[486]],["ext.guidedTour.tour.checkuserinvestigate","12w9i",[717,486]],["ext.quicksurveys.lib","15bza",[642,29,85,93,75]],["ext.quicksurveys.lib.vue","b35l0",[721,42]],["ext.quicksurveys.init","7d3rt"],["ext.kartographer","5d704"],["ext.kartographer.style","12fvq"],["ext.kartographer.site","1n5nk"],["mapbox","1spcu"],["leaflet.draw","rqbqy",[727]],["ext.kartographer.link","wd8as",[731,200]],["ext.kartographer.box","3vmjx",[732,743,726,725,735,85,48,225]],["ext.kartographer.linkbox","1ijfh",[735]],["ext.kartographer.data","1jj2n"],["ext.kartographer.dialog","gscu7",[727,200,206,211,222]],["ext.kartographer.dialog.sidebar","14t0l",[75,222,227]],[
"ext.kartographer.util","1d9jl",[724]],["ext.kartographer.frame","zg7jg",[730,200]],["ext.kartographer.staticframe","1n23r",[731,200,225]],["ext.kartographer.preview","y6o47"],["ext.kartographer.editing","1oqrk",[48]],["ext.kartographer.editor","1gvrd",[730,728]],["ext.kartographer.visualEditor","75vxo",[735,441,224]],["ext.kartographer.lib.prunecluster","1mdne",[727]],["ext.kartographer.lib.topojson","1em2u",[727]],["ext.kartographer.wv","14ibw",[742,219]],["ext.kartographer.specialMap","19ibl"],["ext.pageviewinfo","9mu3h",[705,202]],["ext.3d","1qcqu",[29]],["ext.3d.styles","1p924"],["mmv.3d","14hp3",[747,397]],["mmv.3d.head","y7cpb",[747,203,214,216]],["ext.3d.special.upload","b1fz9",[752,155]],["ext.3d.special.upload.styles","u2y0d"],["ext.GlobalPreferences.global","95i41",[173,181,191]],["ext.GlobalPreferences.global-nojs","f4960"],["ext.GlobalPreferences.local-nojs","lra5j"],["ext.MachineVision.init","1iohe"],["ext.MachineVision","1lo7k",[642,685,206,211,41,810,791,766]],[
"mw.config.values.wbSiteDetails","dfozq"],["mw.config.values.wbRepo","18lj4"],["wikibase","medaf"],["jquery.wikibase.entityselector","41jsy",[783,782]],["jquery.wikibase.toolbar.styles","14gpd"],["wikibase.common","onmxf"],["wikibase.templates","1xito"],["wikibase.entityChangers.EntityChangersFactory","9qec7",[760,810,791]],["wikibase.utilities.ClaimGuidGenerator","1txib",[792,760]],["wikibase.view.__namespace","v05s8",[760]],["wikibase.view.ReadModeViewFactory","15wvm",[769]],["wikibase.view.ControllerViewFactory","1iq0y",[772,773,29,976,793,761,818,759,202,781,809,977,791,827,764,766,767]],["wikibase.datamodel","bg6il",[784]],["dataValues","1x9qh"],["jquery.animateWithEvent","m5zes"],["jquery.inputautoexpand","qjpzz",[783]],["jquery.ui.commonssuggester","c5ffu",[782,781]],["jquery.ui.languagesuggester","9idpd",[782]],["util.ContentLanguages","8cpdw",[792]],["util.Extendable","1t66e"],["util.MessageProvider","1t74e"],["util.MessageProviders","1wgjx"],["util.Notifier","1yswp"],[
"util.highlightSubstring","7zp51"],["jquery.ui.suggester","44kwp",[37,792]],["jquery.event.special.eachchange","1htxs"],["dataValues.DataValue","1flhc",[771,792]],["dataValues.values","yrpso",[786]],["dataValues.TimeValue","ublw8",[784]],["valueFormatters","175oc",[792]],["valueParsers","1vv43"],["valueParsers.ValueParserStore","19cy7",[788]],["valueParsers.parsers","anxub",[785,788]],["wikibase.serialization","xeln2",[785,770]],["util.inherit","z0abd"],["jquery.valueview","1mukq",[784,37,805,798,787,789]],["jquery.valueview.Expert","1wczi",[777,779,780,792]],["jquery.valueview.experts.CommonsMediaType","19l88",[774,802]],["jquery.valueview.experts.GeoShape","1m184",[774,802]],["jquery.valueview.experts.TabularData","1dxue",[774,802]],["jquery.valueview.experts.EmptyValue","1y5dn",[794]],["jquery.valueview.experts.GlobeCoordinateInput","bwpsm",[806,802,778]],["jquery.valueview.experts.MonolingualText","4zdme",[775,806,802]],["jquery.valueview.experts.QuantityInput","lmd4h",[782,806,802
]],["jquery.valueview.experts.StringValue","9qiet",[773,794]],["jquery.valueview.experts.TimeInput","1cemv",[786,806,778]],["jquery.valueview.experts.UnDeserializableValue","1utrk",[794]],["jquery.valueview.ExpertStore","1hxut",[794]],["jquery.valueview.ExpertExtender","hyq4v",[772,783,793]],["wikibase.tainted-ref","1ssos",[39]],["jquery.wikibase.wbtooltip","1lygh",[36,37,809]],["wikibase.buildErrorOutput","jvpsi",[760]],["wikibase.api.RepoApi","1xgrf",[57,86]],["wikibase.api.ValueCaller","1tx95",[784,810]],["wikibase.formatters.ApiValueFormatter","7zbiv",[787,760]],["wikibase.experts.__namespace","evopy",[760]],["wikibase.experts.Entity","1b6oz",[802,761,759,813]],["wikibase.experts.Item","3lh2e",[814]],["wikibase.experts.Property","6esqn",[814]],["mw.config.values.wbDataTypes","1m4gi"],["mw.config.values.wbRefTabsEnabled","mru1o"],["wikibase.entityPage.entityLoaded","1ygqx",[85,760]],["wikibase.EntityInitializer","196yu",[760,791]],["wikibase.getUserLanguages","ffn5j",[760]],[
"wikibase.ui.entityViewInit","2inbf",[804,762,808,124,817,790,820,967,811,765,826,812,821,768]],["wikibase.ui.entitysearch","bpdte",[29,761]],["wikibase.special.newEntity","18c5g"],["wikibase.special.mergeItems","1bvxk"],["wikibase.experts.modules","1yney",[795,796,797,815,816,799,800,801,803]],["wikibase.sites","hwcm0",[758,760,975]],["wikibase.federatedPropertiesLeavingSiteNotice","1qwmx",[202]],["wikibase.federatedPropertiesEditRequestFailureNotice","vgllt",[202]],["ext.centralauth.globalrenamequeue","18igp"],["ext.centralauth.globalrenamequeue.styles","z2t5w"],["ext.gadget.Gallerypreview","qyj4y",[88],2],["ext.gadget.Slideshow","1xjr7",[21,88],2],["ext.gadget.ZoomViewer","froaz",[88],2],["ext.gadget.CollapsibleTemplates","1240v",[88],2],["ext.gadget.popups","1gepn",[86],2],["ext.gadget.fastcci","1q3fq",[76],2],["ext.gadget.edittop","cxotd",[88],2],["ext.gadget.addsection-plus","125r9",[],2],["ext.gadget.OldEdittools","dz1ds",[],2],["ext.gadget.NoUploadWizard","1xq8p",[88],2],[
"ext.gadget.ImprovedUploadForm","19jbk",[86,0,3],2],["ext.gadget.Watchlist-wo-uploads","72mpr",[],2],["ext.gadget.VIAFDataImporter","n5z4t",[88],2],["ext.gadget.HidePostEdit","1iv1e",[],2],["ext.gadget.CropTool","nll5e",[85],2],["ext.gadget.VideoCutTool","1s5ct",[85],2],["ext.gadget.ImageMapEdit","vmcxk",[],2],["ext.gadget.Favorites","16jci",[86],2],["ext.gadget.RotateLink","n9va4",[86],2],["ext.gadget.RenameLink","1h9ow",[896],2],["ext.gadget.CategoryAboveAll","xg5ea",[],2],["ext.gadget.CategoryAboveBelowImage","o6zjx",[],2],["ext.gadget.Long-Image-Names-in-Categories","120kz",[],2],["ext.gadget.GlobalUsageUI","l2nsb",[938,932,36],2],["ext.gadget.DisableImageAnnotator","7e5kp",[],2],["ext.gadget.GalleryFilterExtension","fl3ot",[123],2],["ext.gadget.LargerGallery","68itd",[3],2],["ext.gadget.Hide-Captions","1yia5",[],2],["ext.gadget.Compact-Captions","3dk47",[],2],["ext.gadget.Collapse-Captions","1s4bc",[28],2],["ext.gadget.HideStructuredDataTab","bu2tk",[],2],["ext.gadget.ACDC",
"1pxif",[13],2],["ext.gadget.Stockphoto","1q545",[86],2],["ext.gadget.UTCLiveClock","qnw76",[48],2],["ext.gadget.UTCLiveClock-pagestyles","k5ik9",[],2],["ext.gadget.LocalLiveClock","dj67l",[],2],["ext.gadget.search-new-tab","1klen",[],2],["ext.gadget.diffGreenBlue","1avrp",[],2],["ext.gadget.DiffOldStyle","173ov",[],2],["ext.gadget.PrettyLog","199dj",[88],2],["ext.gadget.ExtraTabs2","19jae",[88],2],["ext.gadget.rightsfilter","19mhb",[88],2],["ext.gadget.contribsrange","1i2cm",[88,29],2],["ext.gadget.WatchlistNotice","s850y",[],2],["ext.gadget.historyNumbered","hlnan",[],2],["ext.gadget.ThreadedDiscussions","jnfj3",[],2],["ext.gadget.typographyrefreshoverride","1n3sd",[],2],["ext.gadget.markAdmins","1n2w4",[88],2],["ext.gadget.Wdsearch","109qr",[],2],["ext.gadget.advanced-search","ex68f",[],2],["ext.gadget.MyGallery","1oe88",[938],2],["ext.gadget.linkscount","1exdw",[],2],["ext.gadget.scrollUpButton","1hjxj",[],2],["ext.gadget.externalsearch","1pc0p",[112],2],[
"ext.gadget.TabularImportExport","1ilb4",[202,48,34],2],["ext.gadget.Infobox","2oqh0",[],2],["ext.gadget.MoreMenu-local","66fx4",[48],2],["ext.gadget.fuzzyeverywhere","bxn4a",[48],2],["ext.gadget.uploadWizardMobile","jv4yx",[],2],["ext.gadget.ThumbnailPurger","y9p7q",[872],2],["ext.gadget.purgetab","1at7y",[48],2],["ext.gadget.GalleryDetails","axx4h",[88],2],["ext.gadget.AddInformation","7pu70",[],2],["ext.gadget.WhatIsThat","sgodk",[88],2],["ext.gadget.AjaxQuickDelete","16mu7",[86,939,940,938],2],["ext.gadget.QuickDelete","1j5t2",[896],2],["ext.gadget.UserMessages","12zqg",[],2],["ext.gadget.GoogleImagesTineye","17v1f",[88],2],["ext.gadget.RegexMenuFramework","1y32k",[88],2],["ext.gadget.VisualFileChange","sxmuo",[86,3],2],["ext.gadget.Cat-a-lot","1i3ub",[88],2],["ext.gadget.HotCat","7c3ax",[],2],["ext.gadget.Glamorous","1bsll",[88],2],["ext.gadget.Searchnotincat","1mxsq",[88],2],["ext.gadget.CatScan2-link","tti4s",[88],2],["ext.gadget.Geocodecattodo","zp99r",[88],2],[
"ext.gadget.WikiMiniAtlas","8njxm",[],2],["ext.gadget.LocatorTool","2bazw",[88],2],["ext.gadget.BiDiEditing","1qz36",[],2],["ext.gadget.ShortLink","1c32g",[88],2],["ext.gadget.EoMagicalConversion","yt85q",[],2],["ext.gadget.MyLangNotify","cf17m",[],2],["ext.gadget.LanguageSelect","1lf6y",[86,0,3],2],["ext.gadget.DeferredDisplay","ptqey",[],2],["ext.gadget.QInominator","17m5f",[],2],["ext.gadget.QICvote","1c70o",[48,202],2],["ext.gadget.DelReqHandler","bxdgx",[946,88],2],["ext.gadget.instantDelete","1dxld",[88],2],["ext.gadget.autodel","drjy0",[946,896,947],2],["ext.gadget.CleanDeleteReasons","1ketz",[],2],["ext.gadget.LicenseReview","19035",[],2],["ext.gadget.PermissionOTRS","1e8hu",[88],2],["ext.gadget.RTRC","1itgq",[88],2],["ext.gadget.modrollback","jvar3",[88],2],["ext.gadget.botRollback","16kgf",[88],2],["ext.gadget.UdelReqHandler","xsgjz",[88],2],["ext.gadget.EditRequest","j7ddp",[939],2],["ext.gadget.Restore-a-lot","h2aqw",[88,37],2],["ext.gadget.userRightsManager","aml8i",[],2],
["ext.gadget.ProveIt","jn8px",[48,21,34,37],2],["ext.gadget.GlobalUsage","10tfq",[48,945],2],["ext.gadget.SettingsUI","14fcn",[37,86,940],2],["ext.gadget.SettingsManager","1u3iv",[86],2],["ext.gadget.editDropdown","yu6r1",[86],2],["ext.gadget.JStack","1nfyx",[],2],["ext.gadget.libAPI","111as",[86],2],["ext.gadget.libUtil","36a3h",[88],2],["ext.gadget.libCommons","jq08p",[],2],["ext.gadget.libJQuery","1ib1w",[],2],["ext.gadget.libWikiDOM","8n0jl",[88],2],["ext.gadget.libGlobalReplace","15f4r",[941,938],2],["ext.gadget.libCat","85o2f",[941,937],2],["ext.gadget.progressDialog","10zu4",[],2],["ext.gadget.jquery.badge","zgb5x",[],2],["ext.gadget.jquery.blockUI","1h7i5",[],2],["ext.gadget.jquery.in-view","183s5",[],2],["ext.gadget.jquery.fullscreen","b0ipk",[],2],["ext.gadget.jquery.mousewheel","1mppu",[],2],["ext.gadget.jquery.rotate","2h4s4",[],2],["ext.gadget.ImageStack","1xobw",[949],2],["ext.gadget.CommonsDashboard","snz5w",[],2],["ext.gadget.WatchlistNotice.core","vd8sv",[75,934],2],[
"ext.gadget.jquery.jqplot","1v88i",[],2],["ext.gadget.math.seedrandom","10u93",[],2],["ext.gadget.POTYEnhancements.core","alob6",[88,0,37],2],["ext.gadget.VisualFileChange.core","7ks4j",[],2],["ext.gadget.VisualFileChange.ui","14dgq",[],2],["ext.gadget.VisualFileChange.exec","gw4dk",[],2],["ext.gadget.VisualFileChange.cfg","ug2d4",[],2],["ext.gadget.AnonymousI18N","k4tg9",[],2],["ext.guidedTour.tour.firsteditve","muzw7",[486]],["ext.echo.emailicons","1ut1u"],["ext.echo.secondaryicons","1ru3m"],["ext.guidedTour.tour.flowOptIn","naw7r",[486]],["ext.wikimediaEvents.visualEditor","7jlvn",[419]],["wikibase.WikibaseContentLanguages","1dccb",[657,776,760]],["wikibase.special.languageLabelDescriptionAliases","djnut",[202,977]],["ext.confirmEdit.CaptchaInputWidget","1qawk",[203]],["ext.globalCssJs.user","1son6",[],0,"metawiki"],["ext.globalCssJs.user.styles","1son6",[],0,"metawiki"],["ext.guidedTour.tour.RcFiltersIntro","d8lrr",[486]],["ext.guidedTour.tour.WlFiltersIntro","y3nea",[486]],[
"ext.guidedTour.tour.RcFiltersHighlight","1xgce",[486]],["wikibase.Site","78xgv",[659]],["jquery.util.getDirectionality","1bdtc",[659]],["wikibase.getLanguageNameByCode","1xcsw",[659,760]],["mediawiki.messagePoster","fp4uv",[57]]]);mw.config.set(window.RLCONF||{});mw.loader.state(window.RLSTATE||{});mw.loader.load(window.RLPAGEMODULES||[]);queue=window.RLQ||[];RLQ=[];RLQ.push=function(fn){if(typeof fn==='function'){fn();}else{RLQ[RLQ.length]=fn;}};while(queue[0]){RLQ.push(queue.shift());}NORLQ={push:function(){}};}());}
mw.loader.implement("jquery.spinner@yoa8f",function($,jQuery,require,module){(function(){var defaults={id:undefined,size:'small',type:'inline'};$.extend({createSpinner:function(opts){var i,$spinner,$container;if(typeof opts==='string'){opts={id:opts};}opts=$.extend({},defaults,opts);$spinner=$('<div>').addClass('mw-spinner').attr('title','...');if(opts.id!==undefined){$spinner.attr('id','mw-spinner-'+opts.id);}$spinner.addClass(opts.size==='large'?'mw-spinner-large':'mw-spinner-small').addClass(opts.type==='block'?'mw-spinner-block':'mw-spinner-inline');$container=$('<div>').addClass('mw-spinner-container').appendTo($spinner);for(i=0;i<12;i++){$container.append($('<div>'));}return $spinner;},removeSpinner:function(id){return $('#mw-spinner-'+id).remove();}});$.fn.injectSpinner=function(opts){return this.after($.createSpinner(opts));};}());});mw.loader.implement("jquery.spinner.styles@pfek7",null,{"css":[
".mw-spinner{position:relative}.mw-spinner \u003E .mw-spinner-container{transform-origin:0 0}.mw-spinner-small{width:20px;height:20px}.mw-spinner-small \u003E .mw-spinner-container{transform:scale(0.3125)}.mw-spinner-large{width:32px;height:32px}.mw-spinner-large \u003E .mw-spinner-container{transform:scale(0.5)}.mw-spinner-block{display:block;width:100%;text-align:center}.mw-spinner-block \u003E .mw-spinner-container{display:inline-block;vertical-align:top}.mw-spinner-block.mw-spinner-small \u003E .mw-spinner-container{min-width:20px}.mw-spinner-block.mw-spinner-large \u003E .mw-spinner-container{min-width:32px}.mw-spinner-inline{display:inline-block;vertical-align:middle} .mw-spinner-container \u003E div{transform-origin:32px 32px;animation:mw-spinner 1.2s linear infinite}.mw-spinner-container \u003E div:after{content:' ';display:block;position:absolute;top:3px; left:29px;width:5px;height:14px;border-radius:20%;background:#000}.mw-spinner-container \u003E div:nth-child(1){transform:rotate(0deg);animation-delay:-1.1s}.mw-spinner-container \u003E div:nth-child(2){transform:rotate(30deg);animation-delay:-1s}.mw-spinner-container \u003E div:nth-child(3){transform:rotate(60deg);animation-delay:-0.9s}.mw-spinner-container \u003E div:nth-child(4){transform:rotate(90deg);animation-delay:-0.8s}.mw-spinner-container \u003E div:nth-child(5){transform:rotate(120deg);animation-delay:-0.7s}.mw-spinner-container \u003E div:nth-child(6){transform:rotate(150deg);animation-delay:-0.6s}.mw-spinner-container \u003E div:nth-child(7){transform:rotate(180deg);animation-delay:-0.5s}.mw-spinner-container \u003E div:nth-child(8){transform:rotate(210deg);animation-delay:-0.4s}.mw-spinner-container \u003E div:nth-child(9){transform:rotate(240deg);animation-delay:-0.3s}.mw-spinner-container \u003E div:nth-child(10){transform:rotate(270deg);animation-delay:-0.2s}.mw-spinner-container \u003E div:nth-child(11){transform:rotate(300deg);animation-delay:-0.1s}.mw-spinner-container \u003E div:nth-child(12){transform:rotate(330deg);animation-delay:0s}@keyframes mw-spinner{0%{opacity:1}100%{opacity:0}}"
]});


mw.loader.implement("ext.gadget.AjaxQuickDelete@16mu7",function($,jQuery,require,module){(function(){'use strict';if(window.AjaxQuickDelete){return;}var AQD,conf=mw.config.get(['wgArticleId','wgCanonicalNamespace','wgCanonicalSpecialPageName','wgCategories','wgFormattedNamespaces','wgNamespaceNumber','wgPageName','wgRestrictionEdit','wgUserGroups','wgUserLanguage','wgUserName','wgIsRedirect']),nsNr=conf.wgNamespaceNumber,pageName=conf.wgPageName;function _firstItem(o){for(var i in o){if(Object.prototype.hasOwnProperty.call(o,i)){return o[i];}}}$.ucFirst=function(s){return s[0].toUpperCase()+s.slice(1);};AQD=window.AjaxQuickDelete={version:'1.1.3',preinstall:function(){if(conf.wgCanonicalSpecialPageName==='Movepage'&&Number($('select[name="wpNewTitleNs"]').val())===6){$('#mw-movepage-table').before('<div class="warningbox">Consider using <i>Move & Replace</i> from the menu on file pages (open with a single click) when moving files to care for global usage and redirects.</div>');}this.
function addOnloadHook(func)
doNothing=(!conf.wgArticleId||nsNr<0||/^Commons:Deletion/.test(pageName));if(this.doNothing){return;}if(conf.wgUserGroups.indexOf('sysop')!==-1){this.userRights='sysop';}else if(conf.wgUserGroups.indexOf('filemover')!==-1){this.userRights='filemover';}else{this.userRights=['autopatrolled','patroller','image-reviewer'].filter(function(g){return conf.wgUserGroups.indexOf(g)!==-1;})[0];}if(['filemover','sysop'].indexOf(this.userRights)!==-1&&nsNr===6){var $moveLink=$('#ca-move'),$moveLanchor=$moveLink.find('a');this.$moveLink=$moveLink=$moveLanchor.length?$moveLanchor:$moveLink;$moveLink.text($moveLink.text()+' & Replace').attr('title','Click in order to '+$moveLink.attr('title')+' and replace usage. Default form though new tab.').on('click',function(e){e.preventDefault();AQD.moveFile();});}},install:function(){if(this.doNothing){return;}if(conf.wgRestrictionEdit&&conf.wgRestrictionEdit.length&&conf.wgUserGroups.indexOf(conf.wgRestrictionEdit[0])===-1){return;}$(document).triggerHandler(
{
'scriptLoaded',['AjaxQuickDelete']);var link;if(nsNr===14){link=mw.util.addPortletLink('p-tb','#',this.i18n.toolboxLinkDiscuss,'t-ajaxquickdiscusscat');if(link){link.addEventListener('click',function(e){e.preventDefault();mw.loader.using('jquery.ui').then(function(){AQD.discussCategory();});});}}else{link=mw.util.addPortletLink('p-tb','#',this.i18n.toolboxLinkDelete,'t-ajaxquickdelete');if(link){link.addEventListener('click',function(e){e.preventDefault();AQD.nominateForDeletion();});}}if(this.$moveLink){this.$moveLink.html($('<span>').text(this.i18n.dropdownMove));$('#AjaxRenameLink').append('<a href="javascript:AjaxQuickDelete.moveFile();">'+this.i18n.moveAndReplace+'</a>').append('<a href="javascript:AjaxQuickDelete.loadAndDeclineRequest(\'move\');" class="ajaxDeleteDeclineMove"><sup> '+this.i18n.anyDecline+'</sup></a>');$('#mw-imagepage-content .convert-to-dr').find('.ctdr-btn-convert').on('click',this._convertToDR).show().end().find('.ctdr-btn-remove').on('click',this.
if (window.addEventListener)
_removeAnyTag).show();}else if(this.userRights){$('#mw-imagepage-content .convert-to-dr .ctdr-btn-convert').on('click',this._convertToDR).show();}if(this.userRights==='sysop'&&nsNr===6){var dupeSection=$('#AjaxDupeProcess');if(dupeSection.length){dupeSection.append($('<a>',{href:'#',text:this.i18n.processDupes,style:'font-weight:bold',click:function(e){e.preventDefault();AQD.processDupes();}})).show();}else{dupeSection=$('#mw-imagepage-section-duplicates .mw-imagepage-duplicates');if(dupeSection.length){dupeSection.find('li:first').append($('<span>',{style:'display:none',id:'AjaxDupeDestination',text:dupeSection.find('a').attr('title')})).append(' ',$('<sup>').append($('<a>',{href:'#',text:'['+this.i18n.processDupes+']',style:'background:#CEB',click:function(e){e.preventDefault();AQD.processDupes();}})));}}}mw.loader.using('user',function(){if(mw.user.options.get('gadget-QuickDelete')){mw.loader.using('ext.gadget.QuickDelete').always(function(){AQD.doInsertTagButtons();});}});},
window.addEventListener("load", func, false);
initialize:function(){pageName=conf.wgPageName;this.tasks=[];this.destination=undefined;this.details=undefined;this.declineReason=undefined;this.notifyUser=true;this.watchlist='preferences';},fileExists:function(){this.i18n.moveDestination=this.i18n.moveOtherDestination;this.moveFile();},moveFile:function(){var o=this;o.initialize();mw.loader.using(['jquery.ui']).then(function(){o.showProgress();if($('#AjaxRenameLink').length){o.possibleDestination=$('#AjaxRenameDestination').text();o.possibleReason=o.cleanReason($('#AjaxRenameReason').text());}o.addTask('getMoveToken');var linkstoimage=$('#mw-imagepage-section-linkstoimage');if($('#globalusage').length||(linkstoimage.length&&linkstoimage.find('a').not('.mw-redirect').length-linkstoimage.find('.mw-imagepage-linkstoimage-ns2 a[href^="/wiki/User:OgreBot/Uploads"]').length)){o.inUse=true;o.addTask('chkPreMoveDecline');}o.addTask('promptForMoveTarget');o.addTask('doesFileExist');o.fileNameExistsCB='fileExists';o.addTask('movePage');o.
else if (window.attachEvent)
addTask('removeTemplate');o.addTask('queryRedirects');o.addTask('replaceUsage');o.addTask('reloadPage');o.nextTask();});},promptForMoveTargetCB:function(AQD){if(AQD.inUse){$('#AjaxQuestion2').prop('disabled',true);}},promptForMoveTarget:function(){var toAppend;this.showProgress();if(mw.user.options.get('gadget-RenameLink')){toAppend=[$('<a>').text(this.i18n.moreInformation).on('click',function(){if(!AQD.rGetPolicy){importScript('MediaWiki:RenameRequest.js');mw.hook('aqd.renamerequest.i18n').fire();}mw.hook('aqd.renamerequest.run').fire({exec:this});}).button({icons:{primary:'ui-icon-script'},showLabel:true,text:false}).css({fontSize:'.6em',margin:'0',width:'2.5em','float':'right'}),'<br>'];}mw.hook('aqd.prompt').remove(this.promptForMoveTargetCB).add(this.promptForMoveTargetCB);this.prompt([{message:this.i18n.moveDestination,prefill:this.cleanFileName(this.possibleDestination||pageName),returnvalue:'destination',appendNode:toAppend,cleanUp:true,noEmpty:true},{message:this.i18n.
window.attachEvent("onload", func);
reasonForMove,prefill:((this.reason||this.possibleReason||'').trim().replace(/'{2,}/g,'').replace(/\s{2,}/g,' ')),returnvalue:'reason',cleanUp:true,noEmpty:false},{message:this.i18n.leaveRedirect,prefill:true,returnvalue:'wpLeaveRedirect',noEmpty:false,type:'checkbox'},{message:this.i18n.useCORSForReplace,prefill:!window.aqdCORSOptOut,returnvalue:'replaceUsingCORS',noEmpty:false,type:'checkbox'}],this.i18n.movingFile);},chkPreMoveDecline:function(){$('#mw-imagepage-section-linkstoimage').find('a').each(function(){if($(this).text()==='Commons:File renaming/Recently declined rename requests'){alert(AQD.i18n.warnRename);return false;}});this.nextTask();},loadAndDeclineRequest:function(reason){var that=this;mw.loader.using('jquery.ui').then(function(){that.declineRequest.call(that,reason);});},declineRequest:function(reason){reason=reason||this.declineReason;this.initialize();this.addTask('getMoveToken');this.addTask('removeTemplate');this.addTask('reloadPage');switch(reason){case'move':
}
reason='rename request declined: does not comply with [[COM:FR|renaming guidelines]]';if(window.AjaxDeclineMoveWatchFile){this.watchlist='watch';}break;}this.prompt([{message:'',prefill:reason||'',returnvalue:'declineReason',cleanUp:false,noEmpty:true,byteLimit:250}],this.i18n.declineRequest);},insertTagOnPage:function(tag,img_summary,talk_tag,talk_summary,prompt_text,page,optin_notify){var o=this;this.initialize();mw.loader.using(['jquery.ui'],function(){o.pageName=(page||pageName).replace(/_/g,' ');o.tag=tag.replace('%USER%',conf.wgUserName)+'\n';o.img_summary=img_summary;o.addTask('findCreator');o.addTask('prependTemplate');if(o.isMobile()&&/(?:copyvio|nsd|npd|nld)/.test(tag)){o.addTask('listMobileUploadSpeedy');}var prompt=[];if(talk_tag&&talk_tag!=='undefined'){o.talk_tag=talk_tag.replace('%FILE%',o.pageName);o.talk_summary=talk_summary.replace('%FILE%','[[:'+o.pageName+']]');o.usersNeeded=true;prompt.push({message:o.i18n.notifyUser,prefill:true,returnvalue:'notifyUser',type:

'checkbox'});o.addTask('notifyUploaders');}o.addTask('reloadPage');if(tag.indexOf('%PARAMETER%')!==-1){prompt.push({message:'',prefill:'',returnvalue:'reason',cleanUp:true,noEmpty:true,minLength:1});o.prompt(prompt,prompt_text||o.i18n.reasonForDeletion);}else if(optin_notify&&prompt.length&&o.talk_summary){o.prompt(prompt,o.talk_summary);}else{o.nextTask();}});},discussCategory:function(){this.initialize();this.pageName=pageName.replace(/_/g,' ');this.startDate=new Date();this.tag='<!-- BEGIN CFD TEMPLATE -->
/* add menu for selecting subsets of secial characters */
<!-- Please do not remove or change this [[Template:Cfd]] message until the survey and discussion at [[WP:Cfd]] is closed -->
/***** must match MediaWiki:Edittools *****/
{{Cfd full|day=20|month=March|year=2022|startmonth=March|startyear=2022|1=|type=deletion }}<!-- End of Cfd message, feel free to edit beyond this point. -->
function addCharSubsetMenu() {
<!-- END CFD TEMPLATE -->\n';this.img_summary='This category needs discussion';this.talk_tag='{{subst:cdw|1='+pageName+'}}';this.talk_summary='[[:'+pageName+']] needs discussion';this.subpage_summary='Starting category discussion';this.requestPage='Commons:Categories for discussion/'+this.formatDate('YYYY/MM/')+pageName;this.dailyLogPage='Commons:Categories for discussion/'+this.formatDate('YYYY/MM');this.addTask('findCreator');this.addTask('prependTemplate');this.addTask('createRequestSubpage');this.addTask(
var specialchars = document.getElementById('specialchars');
'listRequestSubpage');this.addTask('notifyUploaders');this.addTask('reloadPage');var lazyLoadNode=this.createLazyLoadNode(this.i18n.moreInformation,'MediaWiki:Gadget-AjaxQuickDelete.js/DiscussCategoryInfo','#AjaxQuickDeleteCatInfo');this.prompt([{message:'',prefill:'',returnvalue:'reason',cleanUp:true,appendNode:lazyLoadNode,noEmpty:true,parseReason:true}],this.i18n.reasonForDiscussion);},nominateForDeletion:function(page){var o=this;this.initialize();mw.loader.using(['mediawiki.String','jquery.ui'],function(){o.pageName=(page||pageName).replace(/_/g,' ');o.startDate=new Date();var requestPage=o.pageName,mwString=require('mediawiki.String');while(mwString.byteLength(requestPage)+mwString.byteLength(o.requestPagePrefix.replace(/^.+?:/,''))>=255){requestPage=requestPage.slice(0,requestPage.length-1).trim();}o.requestPage=o.requestPagePrefix+requestPage;o.dailyLogPage=o.requestPagePrefix+o.formatDate('YYYY/MM/DD');o.tag='{{delete|reason=%PARAMETER%|subpage='+requestPage+o.formatDate(

'|year=YYYY|month=MON|day=DAY}}\n');switch(nsNr){case 8:o.tag='/*'+o.tag+'*/';break;case 10:case 100:case 106:o.tag='<noinclude>'+o.tag+'</noinclude>';break;case 828:o.tag='\n--[=[ '+o.tag+' ]=]\n';}if(o.templateReplace){o.declineReason=o.img_summary;}o.img_summary='Nominating for deletion';o.talk_tag='== File:&#39;+requestPage+&#39; listed for discussion ==
if (specialchars) {
[[File:Information.svg|30px|left]] A file that you uploaded or altered, [[:File:&#39;+requestPage+&#39;]], has been listed at [[Wikipedia:Files for discussion]]. Please see the [[Wikipedia:Files for discussion/2022 March 20#File:&#39;+requestPage+&#39;|'''discussion''']] to see why it has been listed (you may have to search for the title of the image to find its entry). Feel free to add your opinion on the matter below the nomination. Thank you. <!-- Template:Fdw -->';o.talk_summary='[[:'+o.pageName+']] has been nominated for deletion';o.subpage_summary='Starting deletion request';if(conf.wgIsRedirect){o.tag+='\n';}o.addTask('findCreator');o.addTask(o.templateReplace?'replaceTemplate':'prependTemplate');o.addTask('createRequestSubpage');o.addTask('listRequestSubpage');o.addTask('purge');o.addTask('notifyUploaders');if(o.isMobile()){o.addTask('listMobileUpload');}o.addTask('reloadPage');var lazyLoadNode=o.createLazyLoadNode(o.i18n.moreInformation,'MediaWiki:Gadget-AjaxQuickDelete.js/DeleteInfo','#AjaxQuickDeleteDeleteInfo');o.prevDRNode=$('<ul>').attr('id','AjaxDeletePrevRequests');o.secureCall('checkForFormerDR');var
var menu = "<select id=\"charsetBox\" style=\"display:inline\" onkeyup=\"chooseCharSubset(selectedIndex)\" onChange=\"chooseCharSubset(selectedIndex)\">";
toAppend=$('<div>').append($('<div>').attr('class','ajaxDeleteLazyLoad').css({'max-height':Math.max(Math.round($(window).height()/2)-250,100),'min-height':0,overflow:'auto'}).append(o.prevDRNode),'<br>',lazyLoadNode);o.prompt([{message:'',prefill:o.reason||'',returnvalue:'reason',cleanUp:true,noEmpty:true,appendNode:toAppend,parseReason:true}],o.i18n.reasonForDeletion);});},checkForFormerDR:function(){if(nsNr%2===0){this.talkPage=conf.wgFormattedNamespaces[nsNr+1]+':'+this.pageName.replace(conf.wgCanonicalNamespace+':','');this.queryAPI({prop:'templates',titles:this.talkPage,tltemplates:'Template:Kept',tllimit:1},'formerDRTalk');}this.queryAPI({list:'backlinks',bltitle:this.pageName,blnamespace:4,blfilterredir:'nonredirects',bllimit:500},'formerDRRequestpage');},formerDRTalk:function(r){var pgs=r.query.pages;$.each(pgs,function(id,pg){if(Array.isArray(pg.templates)){$('<li>').append($('<a>',{text:AQD.i18n.keptAfterDR,href:mw.util.getUrl(AQD.talkPage)})).prependTo(AQD.prevDRNode);}else
menu += "<option>Wiki</option>";
if(pg.missing===undefined){$('<li>').append($('<a>',{text:AQD.i18n.hasTalkpage,href:mw.util.getUrl(AQD.talkPage)})).appendTo(AQD.prevDRNode);}});},formerDRRequestpage:function(r){var bls=r.query.backlinks,_addItem=function(t,m,bl){$('<li>').append($('<a>',{text:t.replace('%PAGE%',bl.title),href:mw.util.getUrl(bl.title)}))[m](AQD.prevDRNode);};$.each(bls,function(i,bl){if(this.requestPage===bl.title){_addItem(AQD.i18n.mentionedInDR,'prependTo',bl);}else if(/^Commons:Deletion requests\/\D/.test(bl.title)){_addItem(AQD.i18n.mentionedInDR,'appendTo',bl);}else if(/^Commons:Village pump\//.test(bl.title)){_addItem(AQD.i18n.mentionedInForum,'appendTo',bl);}});},renderNode:function($node,remotecontent,selector){if(selector){selector=' '+selector;}$node.load(mw.util.wikiScript()+'?'+$.param({action:'render',title:remotecontent,uselang:conf.wgUserLanguage})+(selector||''),function(){$node.find('a').attr('href',function(i,v){return v.replace('MediaWiki:Anoneditwarning',conf.wgPageName);});});
menu += "<option>Latin/Roman</option>";
return $node;},createLazyLoadNode:function(label,page,selector){return $('<div>',{style:'min-height:40px;'}).append($('<a>',{href:'#',text:label}).on('click',function(e){e.preventDefault();var $content=$(this).parent().find('.ajaxDeleteLazyLoad'),$contentInner=$content.find('.ajax-quick-delete-loading');if($contentInner.length){AQD.renderNode($content,$contentInner.data('aqdPage'),selector);}$content.toggle('fast');}),$('<div>',{'class':'ajaxDeleteLazyLoad',style:'display:none;'}).append($('<span>',{'class':'ajax-quick-delete-loading',text:this.i18n.loading}).data('aqdPage',page)));},extractFromHTML:function($el){$el=$($el).parent();this.templateRegExp=$el.find('.ctdr-regex').text();var m=this.templateRegExp.match(/^\/(.+)\/(i)?$/);if(!m||!m[1]){m=new Error(this.i18n.templateRegExp);this.fail(m);throw m;}this.templateRegExp=new RegExp(m[1],m[2]);this.declineReason=$el.find('.ctdr-template-decline-reason').text();m=$el.find('.ctdr-template-name').text();this.reason=
menu += "<option>Greek</option>";
'This file was initially tagged by %USER%'+(m?(' as \'\'\''+m+'\'\'\''):'');},removeProgress:function(){this.showProgress();return this.nextTask();},_removeAnyTag:function(e){AQD.extractFromHTML(e.currentTarget||this);AQD.removeAnyTag();return false;},removeAnyTag:function(){this.addTask('declineRequest');this.nextTask();},_convertToDR:function(e){e=e.currentTarget||this;AQD.extractFromHTML(e);AQD.convertToDR(e);return false;},convertToDR:function(el){this.initialize();this.declineReason='This file does not qualify for [[COM:SPEEDY|speedy-deletion]] and a regular deletion request will be started.';this.templateReplace=true;this.addTask('findTemplateAdder');this.addTask('getMoveToken');this.addTask('removeTemplate');this.addTask('removeProgress');this.addTask('nominateForDeletion');$(el).closest('.convert-to-dr').hide();this.nextTask();},findTemplateAdder:function(){var query={prop:'revisions',rvprop:'content|user',titles:pageName.replace(/_/g,' '),rvlimit:50};this.queryAPI(query,
menu += "<option>Cyrillic</option>";
'findTemplateAdderCB');},findTemplateAdderCB:function(result){var reason,user,pgRevs,template;$.each(result.query.pages,function(id,pg){pgRevs=pg.revisions;pgRevs.forEach(function(rv){var m=rv['*'].match(AQD.templateRegExp);if(m){user=rv.user;if(m.length>1&&!template){template=m[1];}if(m.length>2&&!reason){reason=m[2];}}else{return false;}});});if(!user){mw.log.warn(pgRevs);throw new Error(this.i18n.findTemplateAdderErr);}this.reason=this.reason.replace('%USER%','[[User:'+user+'|'+user+']]');if(template){this.reason+=' ('+template+')';}if(reason){this.reason+=' and the most recent rationale was: <tt>'+reason+'</tt>';}this.nextTask();},processDupes:function(){this.initialize();if($('#globalusage').length||!$('#mw-imagepage-nolinkstoimage').length){this.inUse=true;}this.addTask('getDupeDetails');this.addTask('compareDetails');this.addTask('mergeDescriptions');this.addTask('saveDescription');this.addTask('replaceUsage');this.addTask('queryRedirects');this.addTask('deletePage');this.
menu += "<option>Arabic</option>";
addTask('redirectPage');this.addTask('reloadPage');this.destination=$('#AjaxDupeDestination').text();this.nextTask();},getDupeDetails:function(){this.queryAPI({curtimestamp:1,meta:'tokens',prop:'imageinfo|revisions|info',rvprop:'content|timestamp',inprop:'watched',iiprop:'sha1|size|url',iiurlwidth:365,redirects:1,titles:pageName.replace(/_/g,' ')+'|'+this.destination},'getDupeDetailsCB');this.showProgress('Fetching details');},getDupeDetailsCB:function(result){this.details=[];if(result){var q=result.query,id,pg,ii,n,pages=q.pages;for(id in pages){if(Object.prototype.hasOwnProperty.call(pages,id)){pg=pages[id];if(!pg.imageinfo){this.disableReport=true;throw new Error(((pg.title.trim()==='{{{1}}}')?this.i18n.dupeParaErr:this.i18n.dupeExistErr.replace('%TITLE%',pg.title))+' (pg.imageinfo is undefined)');}ii=pg.imageinfo[0];n={title:pg.title,size:ii.size,width:ii.width,height:ii.height,thumburl:ii.thumburl,thumbwidth:ii.thumbwidth,thumbheight:ii.thumbheight,descriptionurl:ii.descriptionurl
menu += "<option>Catalan</option>";
,sha1:ii.sha1,content:pg.revisions[0]['*'],starttimestamp:result.curtimestamp};this.details.push(n);this.csrftoken=q.tokens.csrftoken;if(pg.watched!==undefined){this.pageWasWatched=true;}}}}if(this.details.length<2){this.disableReport=true;throw new Error(this.i18n.noPageFound);}if(this.details[0].title!==pageName.replace(/_/g,' ')){this.details.reverse();}this.nextTask();},prependTemplate:function(){var page={title:this.pageName,text:this.tag,editType:'prependtext',watchlist:window.AjaxDeleteWatchFile?'watch':this.watchlist,minor:false};this.showProgress(this.i18n.addingAnyTemplate);this.savePage(page,this.img_summary,'nextTask');},replaceTemplate:function(text){var page={title:this.destination||pageName,text:text||this.tag+this.pageContent,editType:'text',starttimestamp:this.starttimestamp,timestamp:this.timestamp,watchlist:window.AjaxDeleteWatchFile?'watch':this.watchlist,minor:false};this.templateReplace=false;this.showProgress(this.i18n.addingAnyTemplate);this.savePage(page,(this.
menu += "<option>Croatian</option>";
declineReason||this.img_summary),'nextTask');},createRequestSubpage:function(){this.templateAdded=true;var page={title:this.requestPage,text:'\n=== [[:'+this.pageName+']] ===\n'+this.reason+' [[User:DB|DB]] ([[User talk:DB|talk]]) 04:57, 20 March 2022 (UTC)\n',watchlist:'watch',editType:'appendtext'};if(this.isMobile()){page.text+='\n<noinclude>[[Category:MobileUpload-related deletion requests]]</noinclude>';}this.showProgress(this.i18n.creatingNomination);this.savePage(page,this.subpage_summary,'nextTask');},listRequestSubpage:function(){var page={};page.title=this.dailyLogPage;page.text='\n{{'+this.requestPage+'}}\n';page.watchlist='preferences';page.editType='appendtext';this.showProgress(this.i18n.listingNomination);this.savePage(page,'Listing [['+this.requestPage+']]','nextTask');},isMobile:function(){var isMobile=false,cats=conf.wgCategories;for(var i=0,len=cats.length;i<len;i++){isMobile=isMobile||/^Uploaded with Mobile/.test(cats[i]);}return isMobile;},listMobileUpload:function(){var page={title:
menu += "<option>Czech & Slovak</option>";
'Commons:Deletion requests/mobile tracking',text:'\n{{'+this.requestPage+'}}\n',watchlist:'preferences',editType:'appendtext'};this.showProgress(this.i18n.listingMobile);this.savePage(page,'Listing [['+this.requestPage+']]','nextTask');},listMobileUploadSpeedy:function(){var page={title:'Commons:Mobile app/deletion request tracking',text:'\n# [[:'+this.pageName+']]',watchlist:'preferences',editType:'appendtext'};this.showProgress(this.i18n.listingMobile);this.savePage(page,'Listing [['+this.pageName+']]','nextTask');},verifyUserNotify:function(user){this.queryAPI({prop:'info',titles:this.userTalkPrefix+user,redirects:1,inprop:'protection'},'verifyUserNotifyCB');},verifyUserNotifyCB:function(result){var page;this.notifyUser=true;if(!result||!result.query||!result.query.pages){mw.log.warn('Verify user: result.query.pages is undefined. ',result);return this.uploaderNotified();}result=result.query.pages;for(var pg in result){pg=result[pg];page=pg.title;pg=pg.protection;if(pg){for(var p=0;p
menu += "<option>Dutch/Frisian</option>";
<pg.length;p++){var pt=pg[p];if(pt&&pt.type==='edit'&&pt.level==='sysop'){this.disableReport=true;if(pt.expiry==='infinity'){this.notifyUser=false;}}}}}if(this.notifyUser&&page){page={title:page,text:'\n'+this.talk_tag+' [[User:DB|DB]] ([[User talk:DB|talk]]) 04:57, 20 March 2022 (UTC)\n',editType:'appendtext',redirect:true,minor:false};if(window.AjaxDeleteWatchUserTalk){page.watchlist='watch';}this.savePage(page,this.talk_summary,'uploaderNotified');}else{this.uploaderNotified();}},notifyUploaders:function(){this.uploadersToNotify=0;if(this.notifyUser){for(var user in this.uploaders){if(Object.prototype.hasOwnProperty.call(this.uploaders,user)){if(user===conf.wgUserName){continue;}this.verifyUserNotify(user);this.showProgress(this.i18n.notifyingUploader.replace('%USER%',user));this.uploadersToNotify++;}}}if(!this.uploadersToNotify){this.nextTask();}},uploaderNotified:function(){this.uploadersToNotify--;if(!this.uploadersToNotify){this.nextTask();}},findCreator:function(){var q={curtimestamp:1,meta:'tokens',prop:'revisions',titles:this.pageName,
menu += "<option>Esperanto</option>";
rvprop:'timestamp|user',rvdir:'newer',rvslots:'main',rvlimit:1};if(nsNr===6){$.extend(q,{prop:q.prop+'|imageinfo',rvprop:q.rvprop+'|content',iiprop:'user|comment|sha1',iilimit:'50',list:'logevents',letype:'import',leprop:'user',letitle:this.pageName});}this.showProgress(this.i18n.preparingToEdit);this.queryAPI(q,'findCreatorCB');},findCreatorCB:function(r){this.uploaders={};if(!r||!r.query||!r.query.pages){this.disableReport=true;throw new Error(this.i18n.noPageFound);}var q=r.query,pg=_firstItem(q.pages),rv;if(!pg||!pg.revisions){throw new Error(this.i18n.noCreatorFound);}this.csrftoken=q.tokens.csrftoken;rv=pg.revisions[0];if(nsNr!==6||!pg.imageinfo){this.starttimestamp=r.curtimestamp;this.timestamp=rv.timestamp;if((this.pageCreator=rv.user)){this.uploaders[this.pageCreator]=true;}}else{var info=pg.imageinfo,i=info.length,content=rv.slots.main['*'],seenHashes={};for(--i;i>=0;i--){var iii=info[i],rev=seenHashes[iii.sha1];if(iii.sha1&&rev){for(rev;rev>i;rev--){var u=info[rev-1].user;if
menu += "<option>Estonian</option>";
(this.uploaders[u]<rev){delete this.uploaders[u];}}continue;}seenHashes[iii.sha1]=i+1;if(this.uploaders[iii.user]){continue;}if(mw.libs.commons.isSmallChangesBot(iii.user)){continue;}iii=mw.libs.commons.getUploadBotUser(iii.user,content,iii.comment,rv.user);if(iii){this.uploaders[iii]=i+1;}}if((info=q.logevents)&&(i=info.length)){for(--i;i>=0;i--){if(info[i].user){this.uploaders[info[i].user]=true;}}}}this.nextTask();},getMoveToken:function(){this.showProgress(this.i18n.preparingToEdit);var query={curtimestamp:1,prop:'info|revisions',meta:'tokens',rvprop:'content|timestamp',inprop:'watched',titles:this.pageName||pageName.replace(/_/g,' ')};if(!this.declineReason){query.prop+='|imageinfo';query.iiprop='mediatype|mime|timestamp';}this.queryAPI(query,'getMoveTokenCB');},getMoveTokenCB:function(result){var q=result.query||{},pg=_firstItem(q.pages);if(!pg||!pg.revisions){this.disableReport=true;throw new Error(this.i18n.noPageFound);}$.extend(this,{csrftoken:q.tokens.csrftoken,pageContent:
menu += "<option>French</option>";
pg.revisions[0]['*'],starttimestamp:result.curtimestamp,timestamp:pg.revisions[0].timestamp});if(pg.watched!==undefined){this.pageWasWatched=true;}var ii=pg.imageinfo;if(ii&&ii.length&&ii[0].mime){ii=ii[0];this.imagetimestamp=ii.timestamp;this.mimeFileExtension=ii.mime.toLowerCase().replace('image/jpeg','jpg').replace(/image\/(?:x-|vnd\.)?(png|gif|xcf|djvu|svg|tiff)(?:\+xml)?/,'$1').replace(/application\/(ogg|pdf)/,'$1').replace(/video\/(webm)/,'$1').replace('audio/midi','mid').replace(/audio\/(?:x-|vnd\.)?wave?/,'wav').replace(/audio\/(?:x-)?flac/,'flac');if(this.mimeFileExtension.length>5){this.mimeFileExtension='';}else if(this.mimeFileExtension==='ogg'){switch(ii.mediatype){case'AUDIO':this.mimeFileExtension='oga';break;case'VIDEO':this.mimeFileExtension='ogv';break;}}}this.nextTask();},doesFileExist:function(){if(!this.destination){return alert(this.i18n.moveDestination);}this.destination=this.cleanFileName(this.destination);var query={prop:'info|revisions',titles:this.destination
menu += "<option>German</option>";
,rvprop:'content',rvlimit:2};this.showProgress(this.i18n.checkFileExists);this.queryAPI(query,'doesFileExistCB');},doesFileExistCB:function(result){if(!result||!result.query||!result.query.pages){throw new Error('Checking filename: result.query.pages is undefined. '+this.destination);}var exists=true,pg=_firstItem(result.query.pages),getRedirRegExp=function(title){title=title.replace(/^(File|Image):/,'').replace(/_/g,' ');return new RegExp('^\\s*#REDIRECT\\s*\\[\\[File\\:['+mw.util.escapeRegExp(title[0].toUpperCase())+mw.util.escapeRegExp(title[0].toLowerCase())+']'+mw.util.escapeRegExp(title.slice(1)).replace(/ /g,'[ _]')+'\\s*\\]\\]','');};if(pg.missing!==undefined){exists=false;}else if(!pg.revisions||pg.revisions.length===1&&getRedirRegExp(pageName).test(pg.revisions[0]['*'].replace('Image:','File:'))){exists=false;}if(exists){if(this.fileNameExistsCB){this[this.fileNameExistsCB](pg.title.replace(/^File:/,''));}return;}this.nextTask();},removeTemplate:function(){this.replaceWith=(
menu += "<option>Hawaiian</option>";
this.replaceWith||(this.templateRegExp?'':'$1$2'));var newText=this.pageContent.replace((this.templateRegExp||/(?:([^=])\n)?\{\{(?:rename|rename media|move)\s*\|.*?\}\}(?:\n([^=]))?/i),this.replaceWith);if(newText===this.pageContent){return this.nextTask();}this.showProgress(this.i18n.removingTemplate);newText=this.pageContent=newText.trim();if(this.templateReplace){this.img_summary=this.declineReason;return this.nextTask();}if(!this.declineReason){this.img_summary='Removing template; rename done';}this.replaceTemplate(newText||'{{Di-no license|date=20 March 2022}}');},replaceUsage:function(){if(!this.inUse){return this.nextTask();}this.showProgress(this.i18n.replacingUsage);var reasonShort='[[COM:Duplicate|Duplicate]]:';if(!this.details){AQD.reason=AQD.reason.replace(/\[\[Commons:File[_ ]renaming[^[\]]*\]\]:? ?/i,'');reasonShort='[[COM:FR|File renamed]]:';}mw.loader.using('ext.gadget.libGlobalReplace',function(){if(AQD.replaceUsingCORS){mw.libs.globalReplace(pageName,AQD.destination,reasonShort,AQD.reason).
menu += "<option>Hebrew</option>";
fail(function(err){throw new Error(err);}).done(function(){AQD.nextTask();}).progress(function(r){AQD.showProgress(r);mw.log(r);});}else{mw.libs.globalReplaceDelinker(pageName,AQD.destination,reasonShort+' '+AQD.reason,function(){AQD.nextTask();},function(err){throw new Error(err);});}});},redirectPage:function(){var page={title:pageName,text:'#REDIRECT [['+this.destination+']]',editType:'text',watchlist:AQD.pageWasWatched?'watch':'preferences'};this.showProgress(this.i18n.redirectingFile);this.savePage(page,'Redirecting to duplicate file','nextTask');},saveDescription:function(){var page={title:this.destination,text:this.newPageText,editType:'text',watchlist:AQD.pageWasWatched?'watch':'preferences'};this.showProgress(this.i18n.savingDescription);this.savePage(page,'Merging details from duplicate ([['+pageName+']])','nextTask');},queryRedirects:function(){mw.loader.using('mediawiki.api').then(function(){return new mw.Api().loadMessagesIfMissing(['Whatlinkshere']);}).then(function(){AQD
menu += "<option>Hieroglyph</option>";
.showProgress(mw.msg('Whatlinkshere'));AQD.queryAPI({generator:'backlinks',gblfilterredir:'redirects',prop:'revisions',rvprop:'content',gbltitle:AQD.pageName||pageName.replace(/_/g,' ')},AQD.queryRedirectsCB?AQD.queryRedirectsCB:'updateRedirects');});},updateRedirects:function(result){AQD.redirectsToUpdate=0;if(result.query&&result.query.pages){this.showProgress(this.i18n.updRedir);$.each(result.query.pages,function(id,pg){var rv=pg.revisions[0];if(!rv||!rv['*']){return;}if(AQD.checkFileExt(pg.title,AQD.destination,true)){return mw.log('Redirect skipped, not same mimetype.',pg.title);}var page={title:pg.title,text:rv['*'].replace(/#\s*REDIRECT\s*\[\[.+/,'#REDIRECT [['+AQD.destination+']]'),editType:'text',watchlist:'preferences'};AQD.savePage(page,'Updating redirect while processing [['+pageName.replace(/_/g,' ')+']]','updateRedirectsCB');AQD.redirectsToUpdate++;});}if(!AQD.redirectsToUpdate){AQD.nextTask();}},updateRedirectsCB:function(){AQD.redirectsToUpdate--;if(!AQD.
menu += "<option>Hungarian</option>";
redirectsToUpdate){AQD.nextTask();}},prompt:function(questions,title,width){var o=this,dlgButtons={};dlgButtons[this.i18n.submitButtonLabel]=function(){questions.forEach(function(v,i){var response=document.getElementById('AjaxQuestion'+i);response=(v.type==='checkbox')?response.checked:response.value;if(v.cleanUp){if(v.returnvalue==='reason'){response=AQD.cleanReason(response);}if(v.returnvalue==='destination'){response=AQD.cleanFileName(response);}}AQD[v.returnvalue]=response;if(v.returnvalue==='reason'&&AQD.tag){AQD.tag=AQD.tag.replace('%PARAMETER%',response);if(AQD.talk_tag){AQD.talk_tag=AQD.talk_tag.replace('%PARAMETER%',response);}AQD.img_summary=AQD.img_summary.replace('%PARAMETER%',response).replace('%PARAMETER-LINKED%','[[:'+response+']]');}});$(this).dialog('close');AQD.nextTask();};dlgButtons[this.i18n.cancelButtonLabel]=function(){$(this).dialog('close');};var $submitButton,$AjaxDeleteContainer=$('<div>',{id:'AjaxDeleteContainer'}),_parseReason=function(){var $el=$(this),
menu += "<option>Icelandic</option>";
$parserResultNode=$el.data('parserResultNode');if(!$parserResultNode){return;}$parserResultNode.css('color','#877');var _gotParsedText=function(r){try{$parserResultNode.html(r);$parserResultNode.css('color','#000');}catch(ex){}};mw.loader.using(['ext.gadget.libAPI'],function(){mw.libs.commons.api.parse($el.val(),conf.wgUserLanguage,pageName,_gotParsedText);});},_validateInput=function(event){var $el=$(this),v=$el.data('v');if(v.noEmpty){$submitButton.button('option','disabled',$el.val().trim().length<(v.minLength||8));}if(($el.prop('nodeName')!=='TEXTAREA')&&(event.which===13)&&(v.enterToSubmit!==false)&&!$submitButton.button('option','disabled')){$submitButton.trigger('click');}},_convertToTextarea=function(){var $el=$(this),$input=$el.data('toConvert'),$tarea=$('<textarea>',{id:$input.attr('id'),style:'height:10em; width:98%; display:none;'});$el.off().fadeOut();$input.parent().prepend($tarea.data('v',$input.data('v')).data('parserResultNode',$input.data('parserResultNode')).val(
menu += "<option>Indo-European</option>";
$input.val()).on('keyup',_parseReason).on('keyup input',_validateInput));$tarea.slideDown();$input.remove();};questions.forEach(function(v,i){v.type=(v.type||'text');if(v.type==='textarea'){$AjaxDeleteContainer.append('<label for="AjaxQuestion'+i+'">'+v.message+'</label>').append('<textarea rows=20 id="AjaxQuestion'+i+'">');}else{$AjaxDeleteContainer.append('<label for="AjaxQuestion'+i+'">'+v.message+'</label>').append('<input type="'+v.type+'" id="AjaxQuestion'+i+'" style="width:97%;">');}var curQuestion=$AjaxDeleteContainer.find('#AjaxQuestion'+i);if(v.parseReason){var $parserResultNode=$('<div>',{id:'AjaxQuestionParse'+i,html:'&nbsp;'});$AjaxDeleteContainer.append('<br><label for="AjaxQuestionParse'+i+'">'+o.i18n.previewLabel+'</label>').append($parserResultNode);curQuestion.data('parserResultNode',$parserResultNode).keyup(_parseReason);}if(v.type!=='textarea'){$AjaxDeleteContainer.append('<br>');}$AjaxDeleteContainer.append(v.appendNode?v.appendNode:'<br>');if(typeof v.byteLimit===
menu += "<option>Irish</option>";
'number'){mw.loader.using('jquery.lengthLimit',function(){curQuestion.byteLimit(v.byteLimit);});}curQuestion.data('v',v);curQuestion.on('keyup input',_validateInput);curQuestion.val(v.prefill);if(v.type==='checkbox'){curQuestion.prop('checked',v.prefill).attr('style','margin-left: 5px');}});if(mw.user.isAnon()){AQD.renderNode($('<div>',{id:'ajaxDeleteAnonwarning'}),'MediaWiki:Anoneditwarning').appendTo($AjaxDeleteContainer);}$('<div>').append($AjaxDeleteContainer).dialog({width:(width||600),modal:true,title:title,dialogClass:'wikiEditor-toolbar-dialog',close:function(){$(this).dialog('destroy').remove();if(AQD.currentTask==='formerDRRequestpage'){mw.util.$content.find('.convert-to-dr').show();}},buttons:dlgButtons,open:function(){var $buttons=$(this).parent().find('.ui-dialog-buttonpane button');$submitButton=$buttons.eq(0).specialButton('proceed');$buttons.eq(1).specialButton('cancel');}});questions.forEach(function(v,i){var curQuestion=$AjaxDeleteContainer.find('#AjaxQuestion'+i);
menu += "<option>Italian</option>";
curQuestion.trigger('keyup');if(v.type==='text'){var $q=curQuestion.wrap('<div style="position:relative;">').parent(),$i=$.createIcon('ui-icon-arrow-4-diag').attr('title',AQD.i18n.expandToTextarea);$('<span>',{'class':'ajaxTextareaConverter'}).append($i).appendTo($q).data('toConvert',curQuestion).on('click',_convertToTextarea);}});$('#AjaxQuestion0').trigger('focus').trigger('select');mw.hook('aqd.prompt').fire(o);},compareDetails:function(){var d=this.details[0],f=this.details[1],$swapButton,$overlayButton;if(d.sha1===f.sha1){this.exactDupes=true;this.nextTask();return;}var $imgD=$('<div>').append($('<img>',{src:d.thumburl,height:d.thumbheight,width:d.thumbwidth}),$('<div>',{id:'AjaxDeleteImgDel',html:Math.round(d.size/1000)+' KiB <br>'+d.width+'×'+d.height+'<br>'}).append($('<a>',{href:d.descriptionurl,text:d.title,target:'_blank'}))),$imgF=$('<div>').append($('<img>',{src:f.thumburl,height:f.thumbheight,width:f.thumbwidth}),$('<div>',{id:'AjaxDeleteImgKeep',html:Math.round(f.size/
menu += "<option>Korean</option>";
1000)+' KiB <br>'+f.width+'×'+f.height+'<br>'}).append($('<a>',{href:f.descriptionurl,text:f.title,target:'_blank'}))),dlgButtons={};dlgButtons[this.i18n.submitButtonLabel]=function(){$(this).dialog('close');AQD.nextTask();};dlgButtons[this.i18n.inverseButtonLabel]=function(){$(this).dialog('close');AQD.destination=pageName.replace(/_/g,' ');pageName=f.title;AQD.details.reverse();AQD.inUse=true;setTimeout(function(){AQD.compareDetails();},20);};dlgButtons[this.i18n.swapImagesButtonLabel]=function(){if($imgD[0].nextSibling===$imgF[0]){$imgD.before($imgF);}else{$imgF.before($imgD);}};var $fClone;dlgButtons[this.i18n.overlayButtonLabel]=function(){if($fClone){$fClone.remove();$fClone=0;}else{$fClone=$imgF.clone().appendTo($imgF.parent());$fClone.css('position','absolute');var pos=$imgD.position();$fClone.css({top:pos.top-1,left:pos.left-1}).fadeTo(0,0.65);mw.loader.using(['jquery.ui'],function(){$fClone.css({background:'rgba(200, 200, 200, 0.5)',width:'auto',border:'1px solid #0c9'}).
menu += "<option>Latvian</option>";
draggable();$fClone.find('img').resizable();$fClone.children('div').fadeTo(0,0.7);});}};this.showProgress();var $AjaxDupeContainer=$('<div>',{id:'AjaxDupeContainer'}).append($imgD,$imgF);$('<div>').append($AjaxDupeContainer).dialog({width:800,modal:true,title:this.i18n.compareDetails,draggable:false,dialogClass:'wikiEditor-toolbar-dialog',close:function(){$(this).dialog('destroy').remove();},buttons:dlgButtons,open:function(){var $buttons=$(this).parent().find('.ui-dialog-buttonpane button');$buttons.eq(0).specialButton('proceed');$buttons.eq(1).button({icons:{primary:'ui-icon-refresh'}});$swapButton=$buttons.eq(2).button({icons:{primary:'ui-icon-transfer-e-w'}});$overlayButton=$buttons.eq(3).button({icons:{primary:'ui-icon-newwin'}});$swapButton.css('float',(($swapButton.css('float')==='left')?'right':'left'));$overlayButton.css('float',(($overlayButton.css('float')==='left')?'right':'left'));}});mw.loader.load(['ext.gadget.libGlobalReplace','ext.gadget.libWikiDOM']);},
menu += "<option>Lithuanian</option>";
mergeDescriptions:function(){var newPageText=this.details[1].content;mw.loader.using(['ext.gadget.libGlobalReplace','ext.gadget.libWikiDOM'],function(){newPageText=mw.libs.wikiDOM.nowikiEscaper(newPageText).doCleanUp();AQD.showProgress();AQD.prompt([{message:'',prefill:AQD.details[0].content,returnvalue:'discard',cleanUp:false,noEmpty:false,type:'textarea',enterToSubmit:false},{message:'',prefill:newPageText,returnvalue:'newPageText',cleanUp:false,noEmpty:false,type:'textarea',enterToSubmit:false},{message:AQD.i18n.useCORSForReplace,prefill:!window.aqdCORSOptOut,returnvalue:'replaceUsingCORS',noEmpty:false,type:'checkbox'}],AQD.i18n.mergeDescription,800);AQD.destination=AQD.details[1].title;AQD.reason='Exact or scaled-down duplicate: [[:'+AQD.destination+']]';});},correctMIME:function(fn){var f=fn||this.destination;if(this.mimeFileExtension){f=f.replace(/\.\w{2,5}$/,'.'+this.mimeFileExtension);}if(!fn){this.destination=f;return this.nextTask();}else{return f;}},cleanFileName:function(
menu += "<option>Maltese</option>";
fn,ignoreMIME){fn=fn.replace(/^(?:Image|File):/i,'').replace(/(\.\w{2,5})+$/,function($e){return $e.toLowerCase();}).replace(/\.jpe*g$/,'.jpg').replace(/~{3,}/g,'').replace(/[\u00A0\u1680\u180E\u2000-\u200B\u2028\u2029\u202F\u205F\u3000]/,' ').replace(/\s+|_/g,' ').replace(/[\x00-\x1f\x7f]/g,'').replace(/%([0-9A-Fa-f]{2})/g,'% $1').replace(/&(([A-Za-z0-9\x80-\xff]+|#[0-9]+|#x[0-9A-Fa-f]+);)/g,'& $1').replace(/''/g,'"').replace(/[:/|#]/g,'-').replace(/[\]}>]/g,')').replace(/[[{<]/g,'(');fn=this.checkFileExt(pageName,fn,ignoreMIME)||fn;return'File:'+$.ucFirst(fn);},checkFileExt:function(of,fn,ignoreMIME){var currentExt=(!ignoreMIME&&this.mimeFileExtension)?this.mimeFileExtension:of.replace(/.*?\.(\w{2,5})$/,'$1').toLowerCase().replace('jpeg','jpg'),reCurrentExt=new RegExp('\\.'+mw.util.escapeRegExp(currentExt)+'$','i'),reDestExt=new RegExp('\\.'+mw.util.escapeRegExp(fn.replace(/.*?\.(\w{2,5})$/,'$1'))+'$','i');if(!reCurrentExt.test(fn)){fn=fn.replace(reDestExt,'.'+currentExt);if(!
menu += "<option>Navajo & Apache</option>";
reCurrentExt.test(fn)){fn+='.'+currentExt;}}else{fn=false;}return fn;},cleanReason:function(uncleanReason){return uncleanReason.trim().replace(/(?:--|–|—)? ?~{3,5} ?/,'').replace(/\|\s/g,'&#124; ');},showProgress:function(message){if(!message){if(this.progressDialog){this.progressDialog.remove();}this.progressDialog=0;document.body.style.cursor='default';return;}if($('#feedbackContainer').length){$('#feedbackContainer').html(message);}else{document.body.style.cursor='wait';this.progressDialog=$('<div>').html('<div id="feedbackContainer">'+(message||this.i18n.preparingToEdit)+'</div>').dialog({width:450,height:'auto',minHeight:90,modal:true,resizable:false,draggable:false,closeOnEscape:false,dialogClass:'ajaxDeleteFeedback',open:function(){$(this).parent().find('.ui-dialog-titlebar').hide();},close:function(){$(this).dialog('destroy').remove();}});}},savePage:function(page,summary,callback){if(AQD.csrftoken){mw.user.tokens.set('csrfToken',AQD.csrftoken);}$.extend(true,page,{cb:
menu += "<option>Old English</option>";
function(r){AQD.secureCall(callback,r);},errCb:function(t,r){if(AQD.uploadersToNotify){AQD.secureCall(callback,r);}AQD.fail(t,r);},summary:summary});mw.loader.using(['ext.gadget.libAPI'],function(){mw.libs.commons.api.editPage(page);});},movePage:function(){mw.user.tokens.set('csrfToken',AQD.csrftoken);if(pageName.replace(/_/g,' ')===AQD.destination){return AQD.nextTask();}mw.loader.using(['ext.gadget.libAPI'],function(){var moveArgs={cb:function(){AQD.nextTask();},errCb:function(t,r){if(r&&r.error&&/articleexists/.test(r.error.code)){AQD.disableReport=true;}AQD.fail(t,r);},from:pageName,to:AQD.destination,reason:AQD.reason,movetalk:true,watchlist:AQD.pageWasWatched?'watch':'preferences'};if(AQD.wpLeaveRedirect===false){moveArgs.noredirect=true;}AQD.showProgress(AQD.i18n.movingFile);mw.libs.commons.api.movePage(moveArgs);});},deletePage:function(){mw.user.tokens.set('csrfToken',AQD.csrftoken);mw.loader.using(['ext.gadget.libAPI'],function(){AQD.showProgress(AQD.i18n.deletingFile);mw.
menu += "<option>Pinyin</option>";
libs.commons.api.deletePage({cb:function(){AQD.nextTask();},errCb:function(t,r){AQD.fail(t,r);},title:pageName,reason:AQD.reason});});},purge:function(){this.nextTask();$.post(this.apiURL,{format:'json',action:'purge',forcelinkupdate:1,titles:pageName});},queryAPI:function(params,callback){mw.loader.using(['ext.gadget.libAPI'],function(){params.action=params.action||'query';mw.libs.commons.api.query(params,{method:'GET',cache:false,cb:function(r){AQD.secureCall(callback,r);},errCb:function(t,r){AQD.fail(t,r);}});});},secureCall:function(fn,r){var o=AQD;try{o.currentTask=arguments[0];if(typeof fn==='function'){return fn.apply(o,Array.prototype.slice.call(arguments,1));}else if(typeof fn==='string'){return o[fn].apply(o,Array.prototype.slice.call(arguments,1));}else{mw.log.warn(fn,this.tasks);o.fail('This is not a function!');}}catch(ex){o.fail(ex,r);}},tasks:[],currentTask:'',addTask:function(task){this.tasks.push(task);},nextTask:function(){this.secureCall(this.tasks.shift());},
menu += "<option>Polish</option>";
retryTask:function(){this.secureCall(this.currentTask);},reloadPage:function(){this.showProgress();if(this.pageName&&this.pageName.replace(/ /g,'_')!==pageName){return;}location.href=mw.util.getUrl(this.destination||pageName);},fail:function(err,r){var o=this,msg,dlgButtons={};if(typeof err==='object'){msg=err.message+' \n\n '+err.name;if(err.lineNumber){msg+=' @line'+err.lineNumber;}err=msg;}if(typeof r==='object'){if(r.error&&/tpt-target-page|readonly/.test(r.error.code)){this.disableReport=true;}}msg=this.i18n.taskFailure[this.currentTask]||this.i18n.genericFailure;if(this.img_summary==='Nominating for deletion'){msg+=' '+(this.templateAdded?this.i18n.completeRequestByHand:this.i18n.addTemplateByHand);}dlgButtons[this.i18n.retryButtonLabel]=function(){$(this).remove();o.retryTask();};if(['movePage','deletePage','notifyUploaders'].indexOf(o.currentTask)!==-1&&(/code 50\d|missingtitle/.test(err))){dlgButtons[this.i18n.ignoreButtonLabel]=function(){$(this).remove();o.nextTask();};}if(!
menu += "<option>Portuguese</option>";
this.disableReport){dlgButtons[this.i18n.reportButtonLabel]=function(){var randomId=Math.round(Math.random()*1099511627776),toSend='\n== Autoreport by AjaxQuickDelete '+randomId+' ==\n'+err+'\nAQD version: '+o.version+'\n++++\n:Task: '+o.currentTask+'\n:NextTask: '+o.tasks[0]+'\n:LastTask: '+o.tasks[o.tasks.length-1]+'\n:Page: {{Page|1='+(o.pageName||pageName)+'}}\n:Skin: '+mw.user.options.get('skin')+'\n:[{{fullurl:Special:Contributions|target=DB&offset=20220320045730}} Contribs] '+'[{{fullurl:Special:Log|user=DB&offset=20220320045730}} Log] '+'before error [[User:DB|DB]] 04:57, 20 March 2022 (UTC)\n\n';$('#feedbackContainer').contents().remove().end().append($('<img>',{src:'//upload.wikimedia.org/wikipedia/commons/d/de/Ajax-loader.gif'})).css('text-align','center');$.post(o.apiURL,{action:'edit',format:'json',title:'MediaWiki talk:Gadget-AjaxQuickDelete.js/auto-errors',summary:
menu += "<option>Rōmaji</option>";
'/*Autoreport by AjaxQuickDelete '+randomId+'*/ error with random id',appendtext:toSend,token:(o.csrftoken||mw.user.tokens.get('csrfToken'))},function(){o.reloadPage();});};}dlgButtons[this.i18n.abortButtonLabel]=function(){$(this).remove();};this.disableReport=false;this.showProgress();this.progressDialog=$('<div>').append($('<div>',{id:'feedbackContainer',html:(msg+'<br>'+this.i18n.errorDetails+'<br>'+mw.html.escape(err)+'<br>'+(this.tag?(this.i18n.tagWas+this.tag):'')+'<br><a href="'+mw.util.getUrl('MediaWiki talk:AjaxQuickDelete.js')+'" >'+this.i18n.errorReport.replace(/%BUTTON%/,'<tt>'+this.i18n.reportButtonLabel+'</tt>')+'</a>')})).dialog({width:550,modal:true,closeOnEscape:false,title:this.i18n.errorDlgTitle,dialogClass:'ajaxDeleteError',buttons:dlgButtons,close:function(){$(this).dialog('destroy').remove();}});if(mw.log.warn){mw.log.warn(err);}},formatDate:function(fmt,date){return mw.libs.commons.formatDate(fmt,date,(mw.libs.commons.api&&mw.libs.commons.api.getCurrentDate()||
menu += "<option>Romanian</option>";
new Date()));},requestPagePrefix:'Commons:Deletion requests/',userTalkPrefix:conf.wgFormattedNamespaces[3]+':',apiURL:mw.util.wikiScript('api'),apiErrorThreshold:10,i18n:{toolboxLinkDelete:'Nominate for deletion',toolboxLinkDiscuss:'Nominate category for discussion',reasonForDeletion:'Why should this file be deleted?',reasonForDiscussion:'Why does this category need discussion?',moreInformation:'More information',loading:'Loading…',keptAfterDR:'This page was kept after a deletion request. Please contact the administrator who kept it before re-nominating.',hasTalkpage:'There is a talk page. Consider reading it or adding your remarks.',mentionedInDR:'Consider reading the deletion debate –%PAGE%– that links to this page.',mentionedInForum:'On %PAGE%, this page is part of a discussion.',previewLabel:'Preview:',submitButtonLabel:'Proceed',cancelButtonLabel:'Cancel',abortButtonLabel:'Abort',reportButtonLabel:'Report automatically',retryButtonLabel:'Retry',ignoreButtonLabel:
menu += "<option>Scandinavian</option>";
'Ignore and continue',inverseButtonLabel:'Inverse. Keep this delete other',swapImagesButtonLabel:'Swap to compare',overlayButtonLabel:'Overlay to compare',expandToTextarea:'Expand to textarea',notifyUser:'Notify users',preparingToEdit:'Preparing to edit pages… ',creatingNomination:'Creating nomination page… ',listingNomination:'Adding nomination page to daily list… ',addingAnyTemplate:'Adding template to '+conf.wgCanonicalNamespace.toLowerCase()+' page… ',notifyingUploader:'Notifying %USER%… ',listingMobile:'Listing mobile upload',updRedir:'Updating redirects',toolboxLinkSource:'No source',toolboxLinkLicense:'No license',toolboxLinkPermission:'No permission',toolboxLinkCopyvio:'Report copyright violation',reasonForCopyvio:'Why is this file a copyright violation?',notAllowed:'You do not have the neccessary rights to move files',reasonForMove:'Why do you want to move this file?',moveDestination:'What should be the new filename?',moveOtherDestination:
menu += "<option>Sorbian</option>";
'The name you have specified exists. Choose a new name, please.',checkFileExists:'Checking whether file exists',movingFile:'Moving file',replacingUsage:'Ordering CommonsDelinker to replace all usage',dropdownMove:'Move & Replace',leaveRedirect:'Leave a redirect behind:',moveAndReplace:'Move file and replace all usage',warnRename:'File renaming was recently declined, be prudent!',removingTemplate:'Removing template',declineRequest:'Why do you want to decline the request?',anyDecline:'Decline request',useCORSForReplace:'Try to replace usage immediately using your user account:',deletingFile:'Deleting file',compareDetails:'Please compare the images before merging the descriptions. The image with the bold text will be deleted.',mergeDescription:'Please now merge the file descriptions',redirectingFile:'Redirecting file',savingDescription:'Saving new details',processDupes:'Process Duplicates',errorDlgTitle:'Error',genericFailure:'An error occurred while trying to do the requested action. ',
menu += "<option>Spanish</option>";
taskFailure:{listUploaders:'An error occurred while determining the '+(nsNr===6?' uploader(s) of this file':'creator of this page')+'.',loadPages:'An error occurred while preparing to nominate this '+conf.wgCanonicalNamespace.toLowerCase()+' for deletion.',prependDeletionTemplate:'An error occurred while adding the {{delete}} template to this '+conf.wgCanonicalNamespace.toLowerCase()+'.',createRequestSubpage:'An error occurred while creating the request subpage.',listRequestSubpage:'An error occurred while adding the deletion request to today’s log.',notifyUploaders:'An error occurred while notifying the '+(nsNr===6?' uploader(s) of this file':'creator of this page')+'.',movePage:'Error while moving the page.',deletePage:'Error deleting the page.'},addTemplateByHand:'To nominate this '+conf.wgCanonicalNamespace.toLowerCase()+' for deletion, please edit the page to add the {{delete}} template and follow the instructions shown on it.',completeRequestByHand:
menu += "<option>Thai</option>";
'Please follow the instructions on the deletion notice to complete the request.',errorDetails:'A detailed description of the error is shown below:',errorReport:'Manually report the error here or click on %BUTTON% to send an automatic error-report.',tagWas:'The tag to be inserted into this page was ',templateRegExp:'The template does not expose a valid regular expression for {{X-To-DR}}. Go the the template and fix it there.',findTemplateAdderErr:'Unable to find the person who added the template. This can occur if the template was already removed, the page is deleted or a redirect to the template is used. In this case you must add the redirect to the RegExp of the target template.',dupeParaErr:'Error in the duplicate-template, check your language version!',dupeExistErr:'Retrieving information about %TITLE% failed. It is possible that it is deleted, the last revision is corrupt or the file is a redirect.',noCreatorFound:
menu += "<option>Turkic</option>";
'The page you are attempting to add a tag to was deleted or moved. Unable to retrieve the content.',noPageFound:'The page you are attempting to modify or move is corrupted, was deleted or moved: Unable to retrieve history and contents.'}};AQD.preinstall();if(conf.wgUserLanguage!=='en'){$.when(mw.loader.getScript(mw.util.wikiScript()+'?title=MediaWiki:Gadget-AjaxQuickDelete.js/'+conf.wgUserLanguage+'.js&action=raw&ctype=text/javascript'),$.ready).always(function(){AQD.install();});}else{$(function(){AQD.install();});}}());},{"css":[
menu += "<option>Vietnamese</option>";
".ajaxDeleteFeedback{border:1px #A9DE16 solid !important;background:#EAF2CB url(//upload.wikimedia.org/wikipedia/commons/d/de/Ajax-loader.gif) no-repeat 8px 14px !important;padding-left:2.85em !important;padding-top:10px !important;font-size:1.1em !important;word-wrap:break-word}.ajaxDeleteError{border:1px #DE1616 solid!important;background:#F2CBCB!important;padding-left:0em}.ajaxDeleteDeclineMove{float:right;background:#F2CBCB;padding:0.3em}.ajaxDeleteLazyLoad{min-height:100px;max-height:450px;border:#ddd solid 1px;overflow:auto}#AjaxDupeContainer{position:relative}#AjaxDupeContainer \u003E div{margin:5px;display:inline-block;vertical-align:top;width:365px}#AjaxDeleteContainer textarea{margin:10px;display:inline-block;width:365px;font-size:0.9em}#AjaxDeleteImgDel{color:red;font-weight:bold}#AjaxDeleteImgKeep{color:green} #AjaxQuestionParse,#AjaxQuestionParse0,div[id^=\"AjaxQuestionParse\"]{min-height:50px;max-height:300px;overflow:auto;color:#000;background:#DDD;border:1px solid #EEE} #AjaxQuestion0,#AjaxQuestion1,div[id^=\"AjaxQuestion\"]{direction:ltr} #AjaxQuestionParse a.new,#AjaxQuestionParse0 a.new,div[id^=\"AjaxQuestionParse\"] a.new{color:#BA0000 !important}.ajaxTextareaConverter{position:absolute;right:0px;top:1px;cursor:pointer}"
menu += "<option>Welsh</option>";
]});mw.loader.implement("ext.gadget.CollapsibleTemplates@1240v",function($,jQuery,require,module){(function($,mw){'use strict';function toggleTemplate($element){if($element.is('tr')){$element.parent().parent().toggleClass('collapsed');$element.nextAll('tr').toggleClass('hidden');}else{$element.parent().toggleClass('expanded').toggleClass('collapsed').find('div.body').slideToggle((mw.config.get('skin')==='vector')?150:0);}}function launch($content){var $tableTmp=$content.find('table.collapsible');$content=$content.find('div.collapsibletemplate').each(function(i,el){el=$(el).attr('dir',document.documentElement.getAttribute('dir')).find('.body');if(el[0]){if($(this).hasClass('collapsed'))el.hide();el.removeClass('show-on-commons');}});$tableTmp=$tableTmp.map(function(i,el){el=$(el).find('> tbody > tr');if(el[0]){if($(this).hasClass('collapsed'))el.not(':first-child').toggleClass('hidden');return el[0];}});$($content.find('div.collapsibleheader').show().add($tableTmp)).on('mousedown',function(
menu += "<option>Yiddish</option>";
e){var $t=$(e.target);if($t.is('a')||$t.parents('a').length)return true;toggleTemplate($(e.currentTarget));return false;});}mw.hook('wikipage.content').add(launch);}(jQuery,mediaWiki));},{"css":[
menu += "<option>IPA</option>";
"div.collapsibletemplate .headertext{padding-left:18px;background-image:url(//upload.wikimedia.org/wikipedia/commons/1/10/MediaWiki_Vector_skin_action_arrow.png);background-position:left 50%;background-repeat:no-repeat}div.collapsibletemplate.collapsed .headertext{background-image:url(//upload.wikimedia.org/wikipedia/commons/4/41/MediaWiki_Vector_skin_right_arrow.png)}div.collapsibletemplate.collapsed[dir=\"rtl\"] .headertext{background-image:url(//upload.wikimedia.org/wikipedia/commons/1/1e/MediaWiki_Vector_skin_left_arrow.png)}div.collapsibletemplate .header{padding:3px;cursor:pointer} table.collapsible \u003E tbody \u003E tr:first-child th,.collapsibleTH{padding-right:18px;background-image:url(//upload.wikimedia.org/wikipedia/commons/1/10/MediaWiki_Vector_skin_action_arrow.png);background-position:99% 50%;background-repeat:no-repeat}table.collapsible.collapsed \u003E tbody \u003E tr:first-child th,.collapsibleCollapsedTH{background-image:url(//upload.wikimedia.org/wikipedia/commons/4/41/MediaWiki_Vector_skin_right_arrow.png);cursor:pointer}table.collapsible.collapsed[dir=\"rtl\"] \u003E tbody \u003E tr:first-child th{background-image:url(//upload.wikimedia.org/wikipedia/commons/1/1e/MediaWiki_Vector_skin_left_arrow.png)}.hidden{display:none}"
menu += "<option>Math/TeX</option>";
]});mw.loader.implement("ext.gadget.HotCat@7c3ax",function($,jQuery,require,module){(function($,mw){var conf=$.extend({},mw.config.values,{wgServer:window.location.host.indexOf('.m.')>-1?'//'+window.location.host:mw.config.get('wgServer')});if((window.HotCat&&!window.HotCat.nodeName)||conf.wgAction==='edit')return;var HC=window.HotCat={messages:{cat_removed:'removed [[Category:$1]]',template_removed:'removed {{[[Category:$1]]}}',cat_added:'added [[Category:$1]]',cat_keychange:'new key for [[Category:$1]]: "$2"',cat_notFound:'Category "$1" not found',cat_exists:'Category "$1" already exists; not added.',cat_resolved:' (redirect [[Category:$1]] resolved)',uncat_removed:'removed {{uncategorized}}',separator:'; ',prefix:'',using:' using [[Help:Gadget-HotCat|HotCat]]',multi_change:'$1 categories',commit:'Save',ok:'OK',cancel:'Cancel',multi_error:'Could not retrieve the page text from the server. Therefore, your category changes '+'cannot be saved. We apologize for the inconvenience.',
menu += "</select>";
short_catchange:null},categories:'Categories',disambig_category:'Disambiguation',redir_category:'Category redirects',links:{change:'(±)',remove:'(\u2212)',add:'(+)',restore:'(×)',undo:'(×)',down:'(\u2193)',up:'(\u2191)'},changeTag:conf.wgUserName?'HotCat':'',tooltips:{change:'Modify',remove:'Remove',add:'Add a new category',restore:'Undo changes',undo:'Undo changes',down:'Open for modifying and display subcategories',up:'Open for modifying and display parent categories'},addmulti:'<span>+<sup>+</sup></span>',multi_tooltip:'Modify several categories',disable:function(){var ns=conf.wgNamespaceNumber;var nsIds=conf.wgNamespaceIds;return(ns<0||ns===10||ns===828||ns===8||ns===6&&!conf.wgArticleId||ns===2&&/\.(js|css)$/.test(conf.wgTitle)||nsIds&&(ns===nsIds.creator||ns===nsIds.timedtext||ns===nsIds.institution));},uncat_regexp:/\{\{\s*[Uu]ncategorized\s*[^}]*\}\}\s*(<!--.*?-->\s*)?/g,existsYes:'//upload.wikimedia.org/wikipedia/commons/thumb/b/be/P_yes.svg/20px-P_yes.svg.png',existsNo:
specialchars.innerHTML = menu + specialchars.innerHTML;
'//upload.wikimedia.org/wikipedia/commons/thumb/4/42/P_no.svg/20px-P_no.svg.png',template_categories:{},engine_names:{searchindex:'Search index',pagelist:'Page list',combined:'Combined search',subcat:'Subcategories',parentcat:'Parent categories'},capitalizePageNames:null,upload_disabled:false,blacklist:null,bg_changed:'#FCA',no_autocommit:false,del_needs_diff:false,suggest_delay:100,editbox_width:40,suggestions:'combined',fixed_search:false,use_up_down:true,listSize:10,single_minor:true,dont_add_to_watchlist:false,shortcuts:null,addShortcuts:function(map){if(!map)return;window.HotCat.shortcuts=window.HotCat.shortcuts||{};for(var k in map){if(!map.hasOwnProperty(k)||typeof k!=='string')continue;var v=map[k];if(typeof v!=='string')continue;k=k.replace(/^\s+|\s+$/g,'');v=v.replace(/^\s+|\s+$/g,'');if(!k.length||!v.length)continue;window.HotCat.shortcuts[k]=v;}}};var ua=navigator.userAgent.toLowerCase();var is_webkit=/applewebkit\/\d+/.test(ua)&&ua.indexOf('spoofer')<0;var cat_prefix=null;

var noSuggestions=false;function LoadTrigger(needed){var self=this;self.queue=[];self.needed=needed;self.register=function(callback){if(self.needed<=0)callback();else self.queue.push(callback);};self.loaded=function(){self.needed--;if(self.needed===0){for(var i=0;i<self.queue.length;i++)self.queue[i]();self.queue=[];}};}var loadTrigger=new LoadTrigger(2);function load(uri,callback){var s=document.createElement('script');s.src=uri;var called=false;s.onload=s.onerror=function(){if(!called&&callback){called=true;callback();}if(s.parentNode){s.parentNode.removeChild(s);}};document.head.appendChild(s);}function loadJS(page,callback){load(conf.wgServer+conf.wgScript+'?title='+encodeURIComponent(page)+'&action=raw&ctype=text/javascript',callback);}function loadURI(href,callback){var url=href;if(url.substring(0,2)==='//')url=window.location.protocol+url;else if(url.substring(0,1)==='/')url=conf.wgServer+url;load(url,callback);}loadJS('MediaWiki:Gadget-HotCat.js/local_defaults',loadTrigger.
/* default subset - try to use a cookie some day */
loaded);if(conf.wgUserLanguage!=='en'){if(window.hotcat_translations_from_commons===undefined)window.hotcat_translations_from_commons=true;if(window.hotcat_translations_from_commons&&conf.wgServer.indexOf('//commons')<0){loadURI('//commons.wikimedia.org/w/index.php?title='+'MediaWiki:Gadget-HotCat.js/'+conf.wgUserLanguage+'&action=raw&ctype=text/javascript',loadTrigger.loaded);}else{loadJS('MediaWiki:Gadget-HotCat.js/'+conf.wgUserLanguage,loadTrigger.loaded);}}else{loadTrigger.loaded();}var wikiTextBlank='[\\t _\\xA0\\u1680\\u180E\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]+';var wikiTextBlankRE=new RegExp(wikiTextBlank,'g');var wikiTextBlankOrBidi='[\\t _\\xA0\\u1680\\u180E\\u2000-\\u200B\\u200E\\u200F\\u2028-\\u202F\\u205F\\u3000]*';var formattedNamespaces=conf.wgFormattedNamespaces;var namespaceIds=conf.wgNamespaceIds;function autoLocalize(namespaceNumber,fallback){function createRegexpStr(name){if(!name||!name.length)return'';var regex_name='';for(var i=0;i<name.length;i++){
chooseCharSubset(0);
var initial=name.charAt(i),ll=initial.toLowerCase(),ul=initial.toUpperCase();if(ll===ul)regex_name+=initial;else regex_name+='['+ll+ul+']';}return regex_name.replace(/([\\^$.?*+()])/g,'\\$1').replace(wikiTextBlankRE,wikiTextBlank);}fallback=fallback.toLowerCase();var canonical=formattedNamespaces[String(namespaceNumber)].toLowerCase();var regexp=createRegexpStr(canonical);if(fallback&&canonical!==fallback)regexp+='|'+createRegexpStr(fallback);if(namespaceIds){for(var cat_name in namespaceIds){if(typeof cat_name==='string'&&cat_name.toLowerCase()!==canonical&&cat_name.toLowerCase()!==fallback&&namespaceIds[cat_name]===namespaceNumber){regexp+='|'+createRegexpStr(cat_name);}}}return regexp;}HC.category_canonical=formattedNamespaces['14'];HC.category_regexp=autoLocalize(14,'category');if(formattedNamespaces['10'])HC.template_regexp=autoLocalize(10,'template');function make(arg,literal){if(!arg)return null;return literal?document.createTextNode(arg):document.createElement(arg);}function
}
param(name,uri){uri=uri||document.location.href;var re=new RegExp('[&?]'+name+'=([^&#]*)');var m=re.exec(uri);if(m&&m.length>1)return decodeURIComponent(m[1]);return null;}function title(href){if(!href)return null;var script=conf.wgScript+'?';if(href.indexOf(script)===0||href.indexOf(conf.wgServer+script)===0||conf.wgServer.substring(0,2)==='//'&&href.indexOf(document.location.protocol+conf.wgServer+script)===0){return param('title',href);}else{var prefix=conf.wgArticlePath.replace('$1','');if(href.indexOf(prefix))prefix=conf.wgServer+prefix;if(href.indexOf(prefix)&&prefix.substring(0,2)==='//')prefix=document.location.protocol+prefix;if(href.indexOf(prefix)===0)return decodeURIComponent(href.substring(prefix.length));}return null;}function hasClass(elem,name){return(' '+elem.className+' ').indexOf(' '+name+' ')>=0;}function capitalize(str){if(!str||!str.length)return str;return str.substr(0,1).toUpperCase()+str.substr(1);}function wikiPagePath(pageName){return conf.wgArticlePath.
}
replace('$1',encodeURIComponent(pageName).replace(/%3A/g,':').replace(/%2F/g,'/'));}function escapeRE(str){return str.replace(/([\\^$.?*+()[\]])/g,'\\$1');}function substituteFactory(options){options=options||{};var lead=options.indicator||'$';var indicator=escapeRE(lead);var lbrace=escapeRE(options.lbrace||'{');var rbrace=escapeRE(options.rbrace||'}');var re;re=new RegExp('(?:'+indicator+'('+indicator+'))|'+'(?:'+indicator+'(\\d+))|'+'(?:'+indicator+'(?:'+lbrace+'([^'+lbrace+rbrace+']+)'+rbrace+'))|'+'(?:'+indicator+'(?!(?:['+indicator+lbrace+']|\\d))(\\S+?)\\b)','g');return function(str,map){if(!map)return str;return str.replace(re,function(match,prefix,idx,key,alpha){if(prefix===lead)return lead;var k=alpha||key||idx;var replacement=typeof map[k]==='function'?map[k](match,k):map[k];return typeof replacement==='string'?replacement:(replacement||match);});};}var substitute=substituteFactory();var replaceShortcuts=(function(){var replaceHash=substituteFactory({indicator:'#',lbrace:'[',

rbrace:']'});return function(str,map){var s=replaceHash(str,map);return HC.capitalizePageNames?capitalize(s):s;};}());var findCatsRE=new RegExp('\\[\\['+wikiTextBlankOrBidi+'(?:'+HC.category_regexp+')'+wikiTextBlankOrBidi+':[^\\]]+\\]\\]','g');function replaceByBlanks(match){return match.replace(/(\s|\S)/g,' ');}function find_category(wikitext,category,once){var cat_regex=null;if(HC.template_categories[category]){cat_regex=new RegExp('\\{\\{'+wikiTextBlankOrBidi+'('+HC.template_regexp+'(?='+wikiTextBlankOrBidi+':))?'+wikiTextBlankOrBidi+'(?:'+HC.template_categories[category]+')'+wikiTextBlankOrBidi+'(\\|.*?)?\\}\\}','g');}else{var cat_name=escapeRE(category);var initial=cat_name.substr(0,1);cat_regex=new RegExp('\\[\\['+wikiTextBlankOrBidi+'('+HC.category_regexp+')'+wikiTextBlankOrBidi+':'+wikiTextBlankOrBidi+(initial==='\\'||!HC.capitalizePageNames?initial:'['+initial.toUpperCase()+initial.toLowerCase()+']')+cat_name.substring(1).replace(wikiTextBlankRE,wikiTextBlank)+
/* select subsection of special characters */
wikiTextBlankOrBidi+'(\\|.*?)?\\]\\]','g');}if(once)return cat_regex.exec(wikitext);var copiedtext=wikitext.replace(/<!--(\s|\S)*?-->/g,replaceByBlanks).replace(/<nowiki>(\s|\S)*?<\/nowiki>/g,replaceByBlanks);var result=[];var curr_match=null;while((curr_match=cat_regex.exec(copiedtext))!==null){result.push({match:curr_match});}result.re=cat_regex;return result;}var interlanguageRE=null;function change_category(wikitext,toRemove,toAdd,key,is_hidden){function find_insertionpoint(wikitext){var copiedtext=wikitext.replace(/<!--(\s|\S)*?-->/g,replaceByBlanks).replace(/<nowiki>(\s|\S)*?<\/nowiki>/g,replaceByBlanks);var index=-1;findCatsRE.lastIndex=0;while(findCatsRE.exec(copiedtext)!==null)index=findCatsRE.lastIndex;if(index<0){var match=null;if(!interlanguageRE){match=/((^|\n\r?)(\[\[\s*(([a-z]{2,3}(-[a-z]+)*)|simple|tokipona)\s*:[^\]]+\]\]\s*))+$/.exec(copiedtext);}else{match=interlanguageRE.exec(copiedtext);}if(match)index=match.index;return{idx:index,onCat:false};}return{idx:index,
function chooseCharSubset(s) {
onCat:index>=0};}var summary=[],nameSpace=HC.category_canonical,cat_point=-1,keyChange=(toRemove&&toAdd&&toRemove===toAdd&&toAdd.length),matches;if(key)key='|'+key;if(toRemove&&toRemove.length){matches=find_category(wikitext,toRemove);if(!matches||!matches.length){return{text:wikitext,summary:summary,error:HC.messages.cat_notFound.replace(/\$1/g,toRemove)};}else{var before=wikitext.substring(0,matches[0].match.index),after=wikitext.substring(matches[0].match.index+matches[0].match[0].length);if(matches.length>1){matches.re.lastIndex=0;after=after.replace(matches.re,'');}if(toAdd){if(key===null)key=matches[0].match[2];}var i=before.length-1;while(i>=0&&before.charAt(i)!=='\n'&&before.substr(i,1).search(/\s/)>=0)i--;var j=0;while(j<after.length&&after.charAt(j)!=='\n'&&after.substr(j,1).search(/\s/)>=0)j++;if(i>=0&&before.charAt(i)==='\n'&&(!after.length||j<after.length&&after.charAt(j)==='\n'))i--;if(i>=0)before=before.substring(0,i+1);else before='';if(j<after.length)after=after.
var l = document.getElementById('specialchars').getElementsByTagName('p');
substring(j);else after='';if(before.length&&before.substring(before.length-1).search(/\S/)>=0&&after.length&&after.substr(0,1).search(/\S/)>=0){before+=' ';}cat_point=before.length;if(cat_point===0&&after.length&&after.substr(0,1)==='\n')after=after.substr(1);wikitext=before+after;if(!keyChange){if(HC.template_categories[toRemove]){summary.push(HC.messages.template_removed.replace(/\$1/g,toRemove));}else{summary.push(HC.messages.cat_removed.replace(/\$1/g,toRemove));}}}}if(toAdd&&toAdd.length){matches=find_category(wikitext,toAdd);if(matches&&matches.length){return{text:wikitext,summary:summary,error:HC.messages.cat_exists.replace(/\$1/g,toAdd)};}else{var onCat=false;if(cat_point<0){var point=find_insertionpoint(wikitext);cat_point=point.idx;onCat=point.onCat;}else{onCat=true;}var newcatstring='[['+nameSpace+':'+toAdd+(key||'')+']]';if(cat_point>=0){var suffix=wikitext.substring(cat_point);wikitext=wikitext.substring(0,cat_point)+(cat_point>0?'\n':'')+newcatstring+(!onCat?'\n':'');if(
for (var i = 0; i < l.length ; i++) {
suffix.length&&suffix.substr(0,1)!=='\n')wikitext+='\n'+suffix;else wikitext+=suffix;}else{if(wikitext.length&&wikitext.substr(wikitext.length-1,1)!=='\n')wikitext+='\n';wikitext+=(wikitext.length?'\n':'')+newcatstring;}if(keyChange){var k=key||'';if(k.length)k=k.substr(1);summary.push(substitute(HC.messages.cat_keychange,[null,toAdd,k]));}else{summary.push(HC.messages.cat_added.replace(/\$1/g,toAdd));}if(HC.uncat_regexp&&!is_hidden){var txt=wikitext.replace(HC.uncat_regexp,'');if(txt.length!==wikitext.length){wikitext=txt;summary.push(HC.messages.uncat_removed);}}}}return{text:wikitext,summary:summary,error:null};}function evtKeys(e){var code=0;if(e.ctrlKey){if(e.ctrlKey||e.metaKey)code|=1;if(e.shiftKey)code|=2;}return code;}function evtKill(e){if(e.preventDefault){e.preventDefault();e.stopPropagation();}else{e.cancelBubble=true;}return false;}var catLine=null,onUpload=false,editors=[],commitButton=null,commitForm=null,multiSpan=null,pageText=null,pageTime=null,pageWatched=false,
l[i].style.display = i == s ? 'inline' : 'none';
watchCreate=false,watchEdit=false,minorEdits=false,editToken=null,is_rtl=false,serverTime=null,lastRevId=null,pageTextRevId=null,conflictingUser=null,newDOM=false;function CategoryEditor(){this.initialize.apply(this,arguments);}function setPage(json){var startTime=null;if(json&&json.query){if(json.query.pages){var page=json.query.pages[!conf.wgArticleId?'-1':String(conf.wgArticleId)];if(page){if(page.revisions&&page.revisions.length){pageText=page.revisions[0]['*'];if(page.revisions[0].timestamp)pageTime=page.revisions[0].timestamp.replace(/\D/g,'');if(page.revisions[0].revid)pageTextRevId=page.revisions[0].revid;if(page.revisions.length>1)conflictingUser=page.revisions[1].user;}if(page.lastrevid)lastRevId=page.lastrevid;if(page.starttimestamp)startTime=page.starttimestamp.replace(/\D/g,'');pageWatched=typeof page.watched==='string';if(json.query.tokens)editToken=json.query.tokens.csrftoken;if(page.langlinks&&(!json['query-continue']||!json['query-continue'].langlinks)){var re='';for(
l[i].style.visibility = i == s ? 'visible' : 'hidden';
var i=0;i<page.langlinks.length;i++)re+=(i>0?'|':'')+page.langlinks[i].lang.replace(/([\\^$.?*+()])/g,'\\$1');if(re.length)interlanguageRE=new RegExp('((^|\\n\\r?)(\\[\\[\\s*('+re+')\\s*:[^\\]]+\\]\\]\\s*))+$');}}}if(json.query.general){if(json.query.general.time&&!startTime)startTime=json.query.general.time.replace(/\D/g,'');if(HC.capitalizePageNames===null){HC.capitalizePageNames=(json.query.general['case']==='first-letter');}}serverTime=startTime;if(json.query.userinfo&&json.query.userinfo.options){watchCreate=!HC.dont_add_to_watchlist&&json.query.userinfo.options.watchcreations==='1';watchEdit=!HC.dont_add_to_watchlist&&json.query.userinfo.options.watchdefault==='1';minorEdits=json.query.userinfo.options.minordefault===1;if(minorEdits)HC.single_minor=true;}}}var saveInProgress=false;function initiateEdit(doEdit,failure){if(saveInProgress)return;saveInProgress=true;var oldButtonState;if(commitButton){oldButtonState=commitButton.disabled;commitButton.disabled=true;}function fail(){
}
saveInProgress=false;if(commitButton)commitButton.disabled=oldButtonState;failure.apply(this,arguments);}$.getJSON(conf.wgServer+conf.wgScriptPath+'/api.php?'+'format=json&action=query&rawcontinue=&titles='+encodeURIComponent(conf.wgPageName)+'&prop=info%7Crevisions%7Clanglinks&inprop=watched&rvprop=content%7Ctimestamp%7Cids%7Cuser&lllimit=500'+'&rvlimit=2&rvdir=newer&rvstartid='+conf.wgCurRevisionId+'&meta=siteinfo%7Cuserinfo%7Ctokens&type=csrf&uiprop=options',function(json){setPage(json);doEdit(fail);}).fail(function(req){fail(req.status+' '+req.statusText);});}function multiChangeMsg(count){var msg=HC.messages.multi_change;if(typeof msg!=='string'&&msg.length)if(mw.language&&mw.language.convertPlural){msg=mw.language.convertPlural(count,msg);}else{msg=msg[msg.length-1];}return substitute(msg,[null,String(count)]);}function currentTimestamp(){var now=new Date();var ts=String(now.getUTCFullYear());function two(s){return s.substr(s.length-2);}ts+=two('0'+(now.getUTCMonth()+1))+two('0'+
}
now.getUTCDate())+two('00'+now.getUTCHours())+two('00'+now.getUTCMinutes())+two('00'+now.getUTCSeconds());return ts;}function performChanges(failure,singleEditor){if(pageText===null){failure(HC.messages.multi_error);return;}if(HC.messages.cat_keychange.indexOf('$2')<0)HC.messages.cat_keychange+='"$2"';if(!HC.messages.short_catchange)HC.messages.short_catchange='[['+HC.category_canonical+':$1]]';var action;var selfEditConflict=(lastRevId!==null&&lastRevId!==conf.wgCurRevisionId||pageTextRevId!==null&&pageTextRevId!==conf.wgCurRevisionId)&&conflictingUser&&conflictingUser===conf.wgUserName;if(singleEditor&&!singleEditor.noCommit&&!HC.no_autocommit&&editToken&&!selfEditConflict){commitForm.wpEditToken.value=editToken;action=commitForm.wpDiff;if(action)action.name=action.value='wpSave';}else{action=commitForm.wpSave;if(action)action.name=action.value='wpDiff';}var result={text:pageText},changed=[],added=[],deleted=[],changes=0,toEdit=singleEditor?[singleEditor]:editors,error=null,edit,i;

for(i=0;i<toEdit.length;i++){edit=toEdit[i];if(edit.state===CategoryEditor.CHANGED){result=change_category(result.text,edit.originalCategory,edit.currentCategory,edit.currentKey,edit.currentHidden);if(!result.error){changes++;if(!edit.originalCategory||!edit.originalCategory.length){added.push(edit.currentCategory);}else{changed.push({from:edit.originalCategory,to:edit.currentCategory});}}else if(error===null){error=result.error;}}else if(edit.state===CategoryEditor.DELETED&&edit.originalCategory&&edit.originalCategory.length){result=change_category(result.text,edit.originalCategory,null,null,false);if(!result.error){changes++;deleted.push(edit.originalCategory);}else if(error===null){error=result.error;}}}if(error!==null){action=commitForm.wpSave;if(action)action.name=action.value='wpDiff';}commitForm.wpMinoredit.checked=minorEdits;commitForm.wpWatchthis.checked=!conf.wgArticleId&&watchCreate||watchEdit||pageWatched;if(conf.wgArticleId||!!singleEditor){if(action&&action.value===
addOnloadHook(addCharSubsetMenu);
'wpSave'){if(HC.changeTag){commitForm.wpChangeTags.value=HC.changeTag;HC.messages.using='';HC.messages.prefix='';}}else{commitForm.wpAutoSummary.value=HC.changeTag;}if(changes===1){if(result.summary&&result.summary.length)commitForm.wpSummary.value=HC.messages.prefix+result.summary.join(HC.messages.separator)+HC.messages.using;commitForm.wpMinoredit.checked=HC.single_minor||minorEdits;}else if(changes){var summary=[];var shortSummary=[];for(i=0;i<deleted.length;i++)summary.push('−'+substitute(HC.messages.short_catchange,[null,deleted[i]]));if(deleted.length===1)shortSummary.push('−'+substitute(HC.messages.short_catchange,[null,deleted[0]]));else if(deleted.length)shortSummary.push('− '+multiChangeMsg(deleted.length));for(i=0;i<added.length;i++)summary.push('+'+substitute(HC.messages.short_catchange,[null,added[i]]));if(added.length===1)shortSummary.push('+'+substitute(HC.messages.short_catchange,[null,added[0]]));else if(added.length)shortSummary.push('+ '+multiChangeMsg(added.

length));var arrow=is_rtl?'\u2190':'\u2192';for(i=0;i<changed.length;i++){if(changed[i].from!==changed[i].to){summary.push('±'+substitute(HC.messages.short_catchange,[null,changed[i].from])+arrow+substitute(HC.messages.short_catchange,[null,changed[i].to]));}else{summary.push('±'+substitute(HC.messages.short_catchange,[null,changed[i].from]));}}if(changed.length===1){if(changed[0].from!==changed[0].to){shortSummary.push('±'+substitute(HC.messages.short_catchange,[null,changed[0].from])+arrow+substitute(HC.messages.short_catchange,[null,changed[0].to]));}else{shortSummary.push('±'+substitute(HC.messages.short_catchange,[null,changed[0].from]));}}else if(changed.length){shortSummary.push('± '+multiChangeMsg(changed.length));}if(summary.length){summary=summary.join(HC.messages.separator);if(summary.length>200-HC.messages.prefix.length-HC.messages.using.length)summary=shortSummary.join(HC.messages.separator);commitForm.wpSummary.value=HC.messages.prefix+summary+HC.messages.using;}}}
// popups
commitForm.wpTextbox1.value=result.text;commitForm.wpStarttime.value=serverTime||currentTimestamp();commitForm.wpEdittime.value=pageTime||commitForm.wpStarttime.value;if(selfEditConflict)commitForm.oldid.value=String(pageTextRevId||conf.wgCurRevisionId);commitForm.hcCommit.click();}function resolveOne(page,toResolve){var cats=page.categories,lks=page.links,is_dab=false,is_redir=typeof page.redirect==='string',is_hidden=page.categoryinfo&&typeof page.categoryinfo.hidden==='string',is_missing=typeof page.missing==='string',i;for(i=0;i<toResolve.length;i++){if(i&&toResolve[i].dabInputCleaned!==page.title.substring(page.title.indexOf(':')+1))continue;toResolve[i].currentHidden=is_hidden;toResolve[i].inputExists=!is_missing;toResolve[i].icon.src=(is_missing?HC.existsNo:HC.existsYes);}if(is_missing)return;if(!is_redir&&cats&&(HC.disambig_category||HC.redir_category)){for(var c=0;c<cats.length;c++){var cat=cats[c].title;if(cat){cat=cat.substring(cat.indexOf(':')+1).replace(/_/g,' ');if(cat===
var popupVersion="Fri Jul 28 11:40:49 EDT 2006 bugfix(2)";
HC.disambig_category){is_dab=true;break;}else if(cat===HC.redir_category){is_redir=true;break;}}}}if(!is_redir&&!is_dab)return;if(!lks||!lks.length)return;var titles=[];for(i=0;i<lks.length;i++){if(lks[i].ns===14&&lks[i].title&&lks[i].title.length){var match=lks[i].title;match=match.substring(match.indexOf(':')+1);if(!HC.blacklist||!HC.blacklist.test(match))titles.push(match);}}if(!titles.length)return;for(i=0;i<toResolve.length;i++){if(i&&toResolve[i].dabInputCleaned!==page.title.substring(page.title.indexOf(':')+1))continue;toResolve[i].inputExists=true;toResolve[i].icon.src=HC.existsYes;if(titles.length>1){toResolve[i].dab=titles;}else{toResolve[i].text.value=titles[0]+(toResolve[i].currentKey!==null?'|'+toResolve[i].currentKey:'');}}}function resolveRedirects(toResolve,params){if(!params||!params.query||!params.query.pages)return;for(var p in params.query.pages)resolveOne(params.query.pages[p],toResolve);}function resolveMulti(toResolve,callback){var i;for(i=0;i<toResolve.length;i++
// STARTFILE: main.js
){toResolve[i].dab=null;toResolve[i].dabInput=toResolve[i].lastInput;}if(noSuggestions){callback(toResolve);return;}var args='action=query&prop=info%7Clinks%7Ccategories%7Ccategoryinfo&plnamespace=14'+'&pllimit='+(toResolve.length*10)+'&cllimit='+(toResolve.length*10)+'&format=json&titles=';for(i=0;i<toResolve.length;i++){var v=toResolve[i].dabInput;v=replaceShortcuts(v,HC.shortcuts);toResolve[i].dabInputCleaned=v;args+=encodeURIComponent('Category:'+v);if(i+1<toResolve.length)args+='%7C';}$.getJSON(conf.wgServer+conf.wgScriptPath+'/api.php?'+args,function(json){resolveRedirects(toResolve,json);callback(toResolve);}).fail(function(req){if(!req)noSuggestions=true;callback(toResolve);});}function makeActive(which){if(which.is_active)return;for(var i=0;i<editors.length;i++)if(editors[i]!==which)editors[i].inactivate();which.is_active=true;if(which.dab){showDab(which);}else{var expectedInput=which.lastRealInput||which.lastInput||'';var actualValue=which.text.value||'';if(!expectedInput.
// **********************************************************************
length&&actualValue.length||expectedInput.length&&actualValue.indexOf(expectedInput)){which.showsList=false;var v=actualValue.split('|');which.lastRealInput=which.lastInput=v[0];if(v.length>1)which.currentKey=v[1];if(which.lastSelection){which.lastSelection={start:v[0].length,end:v[0].length};}}if(which.showsList)which.displayList();if(which.lastSelection){if(is_webkit){window.setTimeout(function(){which.setSelection(which.lastSelection.start,which.lastSelection.end);},1);}else{which.setSelection(which.lastSelection.start,which.lastSelection.end);}}}}function showDab(which){if(!which.is_active){makeActive(which);}else{which.showSuggestions(which.dab,false,null,null);which.dab=null;}}function multiSubmit(){var toResolve=[];for(var i=0;i<editors.length;i++)if(editors[i].state===CategoryEditor.CHANGE_PENDING||editors[i].state===CategoryEditor.OPEN)toResolve.push(editors[i]);if(!toResolve.length){initiateEdit(function(failure){performChanges(failure);},function(msg){alert(msg);});return;}
// ** **
resolveMulti(toResolve,function(resolved){var firstDab=null;var dontChange=false;for(var i=0;i<resolved.length;i++){if(resolved[i].lastInput!==resolved[i].dabInput){dontChange=true;}else{if(resolved[i].dab){if(!firstDab)firstDab=resolved[i];}else{if(resolved[i].acceptCheck(true))resolved[i].commit();}}}if(firstDab){showDab(firstDab);}else if(!dontChange){initiateEdit(function(failure){performChanges(failure);},function(msg){alert(msg);});}});}function setMultiInput(){if(commitButton||onUpload)return;commitButton=make('input');commitButton.type='button';commitButton.value=HC.messages.commit;commitButton.onclick=multiSubmit;if(multiSpan)multiSpan.parentNode.replaceChild(commitButton,multiSpan);else catLine.appendChild(commitButton);}function checkMultiInput(){if(!commitButton)return;var hasChanges=false;for(var i=0;i<editors.length;i++){if(editors[i].state!==CategoryEditor.UNCHANGED){hasChanges=true;break;}}commitButton.disabled=!hasChanges;}var suggestionEngines={opensearch:{uri:
// ** changes to this file affect many users. **
'/api.php?format=json&action=opensearch&namespace=14&limit=30&search=Category:$1',handler:function(queryResult,queryKey){if(queryResult&&queryResult.length>=2){var key=queryResult[0].substring(queryResult[0].indexOf(':')+1);var titles=queryResult[1];var exists=false;if(!cat_prefix)cat_prefix=new RegExp('^('+HC.category_regexp+'):');for(var i=0;i<titles.length;i++){cat_prefix.lastIndex=0;var m=cat_prefix.exec(titles[i]);if(m&&m.length>1){titles[i]=titles[i].substring(titles[i].indexOf(':')+1);if(key===titles[i])exists=true;}else{titles.splice(i,1);i--;}}titles.exists=exists;if(queryKey!==key)titles.normalized=key;return titles;}return null;}},internalsearch:{uri:'/api.php?format=json&action=query&list=allpages&apnamespace=14&aplimit=30&apfrom=$1&apprefix=$1',handler:function(queryResult){if(queryResult&&queryResult.query&&queryResult.query.allpages){var titles=queryResult.query.allpages;for(var i=0;i<titles.length;i++)titles[i]=titles[i].title.substring(titles[i].title.indexOf(':')+1);
// ** please discuss on the talk page before editing **
return titles;}return null;}},exists:{uri:'/api.php?format=json&action=query&prop=info&titles=Category:$1',handler:function(queryResult,queryKey){if(queryResult&&queryResult.query&&queryResult.query.pages&&!queryResult.query.pages[-1]){for(var p in queryResult.query.pages){var title=queryResult.query.pages[p].title;title=title.substring(title.indexOf(':')+1);var titles=[title];titles.exists=true;if(queryKey!==title)titles.normalized=title;return titles;}}return null;}},subcategories:{uri:'/api.php?format=json&action=query&list=categorymembers&cmtype=subcat&cmlimit=max&cmtitle=Category:$1',handler:function(queryResult){if(queryResult&&queryResult.query&&queryResult.query.categorymembers){var titles=queryResult.query.categorymembers;for(var i=0;i<titles.length;i++)titles[i]=titles[i].title.substring(titles[i].title.indexOf(':')+1);return titles;}return null;}},parentcategories:{uri:'/api.php?format=json&action=query&prop=categories&titles=Category:$1&cllimit=max',handler:function(
// ** **
queryResult){if(queryResult&&queryResult.query&&queryResult.query.pages){for(var p in queryResult.query.pages){if(queryResult.query.pages[p].categories){var titles=queryResult.query.pages[p].categories;for(var i=0;i<titles.length;i++)titles[i]=titles[i].title.substring(titles[i].title.indexOf(':')+1);return titles;}}}return null;}}};var suggestionConfigs={searchindex:{name:'Search index',engines:['opensearch'],cache:{},show:true,temp:false,noCompletion:false},pagelist:{name:'Page list',engines:['internalsearch','exists'],cache:{},show:true,temp:false,noCompletion:false},combined:{name:'Combined search',engines:['opensearch','internalsearch'],cache:{},show:true,temp:false,noCompletion:false},subcat:{name:'Subcategories',engines:['subcategories'],cache:{},show:true,temp:true,noCompletion:true},parentcat:{name:'Parent categories',engines:['parentcategories'],cache:{},show:true,temp:true,noCompletion:true}};CategoryEditor.UNCHANGED=0;CategoryEditor.OPEN=1;CategoryEditor.CHANGE_PENDING=2;
// **********************************************************************
CategoryEditor.CHANGED=3;CategoryEditor.DELETED=4;var dummyElement=make('\xa0',true);function forceRedraw(){if(dummyElement.parentNode)document.body.removeChild(dummyElement);else document.body.appendChild(dummyElement);}var BS=8,TAB=9,RET=13,ESC=27,SPACE=32,PGUP=33,PGDOWN=34,UP=38,DOWN=40,DEL=46,IME=229;CategoryEditor.prototype={initialize:function(line,span,after,key,is_hidden){if(!span){this.isAddCategory=true;this.originalCategory='';this.originalKey=null;this.originalExists=false;if(!newDOM){span=make('span');span.className='noprint';if(key){span.appendChild(make(' | ',true));if(after){after.parentNode.insertBefore(span,after.nextSibling);after=after.nextSibling;}else if(line){line.appendChild(span);}}else if(line&&line.firstChild){span.appendChild(make(' ',true));line.appendChild(span);}}this.linkSpan=make('span');this.linkSpan.className='noprint nopopups hotcatlink';var lk=make('a');lk.href='#catlinks';lk.onclick=this.open.bind(this);lk.appendChild(make(HC.links.add,true));lk.
// ** **
title=HC.tooltips.add;this.linkSpan.appendChild(lk);span=make(newDOM?'li':'span');span.className='noprint';if(is_rtl)span.dir='rtl';span.appendChild(this.linkSpan);if(after){after.parentNode.insertBefore(span,after.nextSibling);}else if(line){line.appendChild(span);}this.normalLinks=null;this.undelLink=null;this.catLink=null;}else{if(is_rtl)span.dir='rtl';this.isAddCategory=false;this.catLink=span.firstChild;this.originalCategory=after;this.originalKey=(key&&key.length>1)?key.substr(1):null;this.originalExists=!hasClass(this.catLink,'new');this.makeLinkSpan();if(!this.originalExists&&this.upDownLinks)this.upDownLinks.style.display='none';span.appendChild(this.linkSpan);}this.originalHidden=is_hidden;this.line=line;this.engine=HC.suggestions;this.span=span;this.currentCategory=this.originalCategory;this.currentExists=this.originalExists;this.currentHidden=this.originalHidden;this.currentKey=this.originalKey;this.state=CategoryEditor.UNCHANGED;this.lastSavedState=CategoryEditor.UNCHANGED
// ** if you do edit this file, be sure that your editor recognizes it **
;this.lastSavedCategory=this.originalCategory;this.lastSavedKey=this.originalKey;this.lastSavedExists=this.originalExists;this.lastSavedHidden=this.originalHidden;if(this.catLink&&this.currentKey)this.catLink.title=this.currentKey;editors[editors.length]=this;},makeLinkSpan:function(){this.normalLinks=make('span');var lk=null;if(this.originalCategory&&this.originalCategory.length){lk=make('a');lk.href='#catlinks';lk.onclick=this.remove.bind(this);lk.appendChild(make(HC.links.remove,true));lk.title=HC.tooltips.remove;this.normalLinks.appendChild(make(' ',true));this.normalLinks.appendChild(lk);}if(!HC.template_categories[this.originalCategory]){lk=make('a');lk.href='#catlinks';lk.onclick=this.open.bind(this);lk.appendChild(make(HC.links.change,true));lk.title=HC.tooltips.change;this.normalLinks.appendChild(make(' ',true));this.normalLinks.appendChild(lk);if(!noSuggestions&&HC.use_up_down){this.upDownLinks=make('span');lk=make('a');lk.href='#catlinks';lk.onclick=this.down.bind(this);lk.
// ** as utf8, or the weird and wonderful characters in the namespaces **
appendChild(make(HC.links.down,true));lk.title=HC.tooltips.down;this.upDownLinks.appendChild(make(' ',true));this.upDownLinks.appendChild(lk);lk=make('a');lk.href='#catlinks';lk.onclick=this.up.bind(this);lk.appendChild(make(HC.links.up,true));lk.title=HC.tooltips.up;this.upDownLinks.appendChild(make(' ',true));this.upDownLinks.appendChild(lk);this.normalLinks.appendChild(this.upDownLinks);}}this.linkSpan=make('span');this.linkSpan.className='noprint nopopups hotcatlink';this.linkSpan.appendChild(this.normalLinks);this.undelLink=make('span');this.undelLink.className='nopopups hotcatlink';this.undelLink.style.display='none';lk=make('a');lk.href='#catlinks';lk.onclick=this.restore.bind(this);lk.appendChild(make(HC.links.restore,true));lk.title=HC.tooltips.restore;this.undelLink.appendChild(make(' ',true));this.undelLink.appendChild(lk);this.linkSpan.appendChild(this.undelLink);},invokeSuggestions:function(dont_autocomplete){if(this.engine&&suggestionConfigs[this.engine]&&
// ** below will be completely broken. You can check with the show **
suggestionConfigs[this.engine].temp&&!dont_autocomplete)this.engine=HC.suggestions;this.state=CategoryEditor.CHANGE_PENDING;var self=this;window.setTimeout(function(){self.textchange(dont_autocomplete);},HC.suggest_delay);},makeForm:function(){var form=make('form');form.method='POST';form.onsubmit=this.accept.bind(this);this.form=form;var self=this;var text=make('input');text.type='text';text.size=HC.editbox_width;if(!noSuggestions){text.onkeyup=function(evt){var key=evt.keyCode||0;if(self.ime&&self.lastKey===IME&&!self.usesComposition&&(key===TAB||key===RET||key===ESC||key===SPACE))self.ime=false;if(self.ime)return true;if(key===UP||key===DOWN||key===PGUP||key===PGDOWN){if(self.keyCount===0)return self.processKey(evt);}else{if(key===ESC&&self.lastKey!==IME){if(!self.resetKeySelection()){self.cancel();return;}}self.invokeSuggestions(key===BS||key===DEL||key===ESC);}return true;};text.onkeydown=function(evt){var key=evt.keyCode||0;self.lastKey=key;self.keyCount=0;if(!self.ime&&key===IME
// ** changes button before submitting the edit. **
&&!self.usesComposition){self.ime=true;}else if(self.ime&&key!==IME&&!(key>=16&&key<=20||key>=91&&key<=93||key===144)){self.ime=false;}if(self.ime)return true;if(key===RET)return self.accept(evt);return(key===ESC)?evtKill(evt):true;};text.onkeypress=function(evt){self.keyCount++;return self.processKey(evt);};$(text).on('focus',function(){makeActive(self);});$(text).on((text.onbeforedeactivate!==undefined&&text.createTextRange)?'beforedeactivate':'blur',this.saveView.bind(this));try{$(text).on('compositionstart',function(){self.lastKey=IME;self.usesComposition=true;self.ime=true;});$(text).on('compositionend',function(){self.lastKey=IME;self.usesComposition=true;self.ime=false;});$(text).on('textInput',function(){self.ime=false;self.invokeSuggestions(false);});}catch(any){}$(text).on('blur',function(){self.usesComposition=false;self.ime=false;});}this.text=text;this.icon=make('img');var list=null;if(!noSuggestions){list=make('select');list.onclick=function(){if(self.highlightSuggestion(
// ** test: مدیا מיוחד Мэдыя **
0))self.textchange(false,true);};list.ondblclick=function(e){if(self.highlightSuggestion(0))self.accept(e);};list.onchange=function(){self.highlightSuggestion(0);self.text.focus();};list.onkeyup=function(evt){if(evt.keyCode===ESC){self.resetKeySelection();self.text.focus();window.setTimeout(function(){self.textchange(true);},HC.suggest_delay);}else if(evt.keyCode===RET){self.accept(evt);}};if(!HC.fixed_search){var engineSelector=make('select');for(var key in suggestionConfigs){if(suggestionConfigs[key].show){var opt=make('option');opt.value=key;if(key===this.engine)opt.selected=true;opt.appendChild(make(suggestionConfigs[key].name,true));engineSelector.appendChild(opt);}}engineSelector.onchange=function(){self.engine=self.engineSelector.options[self.engineSelector.selectedIndex].value;self.text.focus();self.textchange(true,true);};this.engineSelector=engineSelector;}}this.list=list;function button_label(id,defaultText){var label=null;if(onUpload&&window.UFUI!==undefined&&window.
// ** **
UIElements!==undefined&&UFUI.getLabel instanceof Function){try{label=UFUI.getLabel(id,true);while(label&&label.nodeType!==3)label=label.firstChild;}catch(ex){label=null;}}if(!label||!label.data)return defaultText;return label.data;}var OK=make('input');OK.type='button';OK.value=button_label('wpOkUploadLbl',HC.messages.ok);OK.onclick=this.accept.bind(this);this.ok=OK;var cancel=make('input');cancel.type='button';cancel.value=button_label('wpCancelUploadLbl',HC.messages.cancel);cancel.onclick=this.cancel.bind(this);this.cancelButton=cancel;var span=make('span');span.className='hotcatinput';span.style.position='relative';span.appendChild(text);span.appendChild(make('\xa0',true));span.style.whiteSpace='nowrap';if(list)span.appendChild(list);if(this.engineSelector)span.appendChild(this.engineSelector);if(!noSuggestions)span.appendChild(this.icon);span.appendChild(OK);span.appendChild(cancel);form.appendChild(span);form.style.display='none';this.span.appendChild(form);},display:function(evt)
// **********************************************************************
{if(this.isAddCategory&&!onUpload&&this.line){new CategoryEditor(this.line,null,this.span,true);}if(!commitButton&&!onUpload){for(var i=0;i<editors.length;i++){if(editors[i].state!==CategoryEditor.UNCHANGED){setMultiInput();break;}}}if(!this.form)this.makeForm();if(this.list)this.list.style.display='none';if(this.engineSelector)this.engineSelector.style.display='none';this.currentCategory=this.lastSavedCategory;this.currentExists=this.lastSavedExists;this.currentHidden=this.lastSavedHidden;this.currentKey=this.lastSavedKey;this.icon.src=(this.currentExists?HC.existsYes:HC.existsNo);this.text.value=this.currentCategory+(this.currentKey!==null?'|'+this.currentKey:'');this.originalState=this.state;this.lastInput=this.currentCategory;this.inputExists=this.currentExists;this.state=this.state===CategoryEditor.UNCHANGED?CategoryEditor.OPEN:CategoryEditor.CHANGE_PENDING;this.lastSelection={start:this.currentCategory.length,end:this.currentCategory.length};this.showsList=false;if(this.catLink)

this.catLink.style.display='none';this.linkSpan.style.display='none';this.form.style.display='inline';this.ok.disabled=false;var result=evtKill(evt);this.text.focus();this.text.readOnly=false;checkMultiInput();return result;},show:function(evt,engine,readOnly){var result=this.display(evt);var v=this.lastSavedCategory;if(!v.length)return result;this.text.readOnly=!!readOnly;this.engine=engine;this.textchange(false,true);forceRedraw();return result;},open:function(evt){return this.show(evt,(this.engine&&suggestionConfigs[this.engine].temp)?HC.suggestions:this.engine);},down:function(evt){return this.show(evt,'subcat',true);},up:function(evt){return this.show(evt,'parentcat');},cancel:function(){if(this.isAddCategory&&!onUpload){this.removeEditor();return;}this.inactivate();this.form.style.display='none';if(this.catLink)this.catLink.style.display='';this.linkSpan.style.display='';this.state=this.originalState;this.currentCategory=this.lastSavedCategory;this.currentKey=this.lastSavedKey;
////////////////////////////////////////////////////////////////////
this.currentExists=this.lastSavedExists;this.currentHidden=this.lastSavedHidden;if(this.catLink)if(this.currentKey&&this.currentKey.length){this.catLink.title=this.currentKey;}else{this.catLink.title='';}if(this.state===CategoryEditor.UNCHANGED){if(this.catLink)this.catLink.style.backgroundColor='transparent';}else{if(!onUpload){try{this.catLink.style.backgroundColor=HC.bg_changed;}catch(ex){}}}checkMultiInput();forceRedraw();},removeEditor:function(){if(!newDOM){var next=this.span.nextSibling;if(next)next.parentNode.removeChild(next);}if(this.span&&this.span.parentNode){this.span.parentNode.removeChild(this.span);}for(var i=0;i<editors.length;i++){if(editors[i]===this){editors.splice(i,1);break;}}checkMultiInput();},rollback:function(evt){this.undoLink.parentNode.removeChild(this.undoLink);this.undoLink=null;this.currentCategory=this.originalCategory;this.currentKey=this.originalKey;this.currentExists=this.originalExists;this.currentHidden=this.originalHidden;this.lastSavedCategory=
// Import stylesheet(s)
this.originalCategory;this.lastSavedKey=this.originalKey;this.lastSavedExists=this.originalExists;this.lastSavedHidden=this.originalHidden;this.state=CategoryEditor.UNCHANGED;if(!this.currentCategory||!this.currentCategory.length){this.removeEditor();}else{this.catLink.removeChild(this.catLink.firstChild);this.catLink.appendChild(make(this.currentCategory,true));this.catLink.href=wikiPagePath(HC.category_canonical+':'+this.currentCategory);this.catLink.title=this.currentKey||'';this.catLink.className=this.currentExists?'':'new';this.catLink.style.backgroundColor='transparent';if(this.upDownLinks)this.upDownLinks.style.display=this.currentExists?'':'none';checkMultiInput();}return evtKill(evt);},inactivate:function(){if(this.list)this.list.style.display='none';if(this.engineSelector)this.engineSelector.style.display='none';this.is_active=false;},acceptCheck:function(dontCheck){this.sanitizeInput();var value=this.text.value.split('|');var key=null;if(value.length>1)key=value[1];var v=
//
value[0].replace(/_/g,' ').replace(/^\s+|\s+$/g,'');if(HC.capitalizePageNames)v=capitalize(v);this.lastInput=v;v=replaceShortcuts(v,HC.shortcuts);if(!v.length){this.cancel();return false;}if(!dontCheck&&(conf.wgNamespaceNumber===14&&v===conf.wgTitle||HC.blacklist&&HC.blacklist.test(v))){this.cancel();return false;}this.currentCategory=v;this.currentKey=key;this.currentExists=this.inputExists;return true;},accept:function(evt){this.noCommit=(evtKeys(evt)&1)!==0;var result=evtKill(evt);if(this.acceptCheck()){var toResolve=[this];var original=this.currentCategory;resolveMulti(toResolve,function(resolved){if(resolved[0].dab){showDab(resolved[0]);}else{if(resolved[0].acceptCheck(true)){resolved[0].commit((resolved[0].currentCategory!==original)?HC.messages.cat_resolved.replace(/\$1/g,original):null);}}});}return result;},close:function(){if(!this.catLink){this.catLink=make('a');this.catLink.appendChild(make('foo',true));this.catLink.style.display='none';this.span.insertBefore(this.catLink,

this.span.firstChild.nextSibling);}this.catLink.removeChild(this.catLink.firstChild);this.catLink.appendChild(make(this.currentCategory,true));this.catLink.href=wikiPagePath(HC.category_canonical+':'+this.currentCategory);this.catLink.className=this.currentExists?'':'new';this.lastSavedCategory=this.currentCategory;this.lastSavedKey=this.currentKey;this.lastSavedExists=this.currentExists;this.lastSavedHidden=this.currentHidden;this.inactivate();this.form.style.display='none';this.catLink.title=this.currentKey||'';this.catLink.style.display='';if(this.isAddCategory){if(onUpload&&this.line){new CategoryEditor(this.line,null,this.span,true);}this.isAddCategory=false;this.linkSpan.parentNode.removeChild(this.linkSpan);this.makeLinkSpan();this.span.appendChild(this.linkSpan);}if(!this.undoLink){var span=make('span');var lk=make('a');lk.href='#catlinks';lk.onclick=this.rollback.bind(this);lk.appendChild(make(HC.links.undo,true));lk.title=HC.tooltips.undo;span.appendChild(make(' ',true));span

.appendChild(lk);this.normalLinks.appendChild(span);this.undoLink=span;if(!onUpload){try{this.catLink.style.backgroundColor=HC.bg_changed;}catch(ex){}}}if(this.upDownLinks)this.upDownLinks.style.display=this.lastSavedExists?'':'none';this.linkSpan.style.display='';this.state=CategoryEditor.CHANGED;checkMultiInput();forceRedraw();},commit:function(){if((this.currentCategory===this.originalCategory&&(this.currentKey===this.originalKey||this.currentKey===null&&!this.originalKey.length))||conf.wgNamespaceNumber===14&&this.currentCategory===conf.wgTitle||HC.blacklist&&HC.blacklist.test(this.currentCategory)){this.cancel();return;}this.close();if(!commitButton&&!onUpload){var self=this;initiateEdit(function(failure){performChanges(failure,self);},function(msg){alert(msg);});}},remove:function(evt){this.doRemove(evtKeys(evt)&1);return evtKill(evt);},doRemove:function(noCommit){if(this.isAddCategory){this.cancel();return;}if(!commitButton&&!onUpload){for(var i=0;i<editors.length;i++){if(
if ( window.localCSS ) {
editors[i].state!==CategoryEditor.UNCHANGED){setMultiInput();break;}}}if(commitButton){this.catLink.title='';this.catLink.style.cssText+='; text-decoration : line-through !important;';try{this.catLink.style.backgroundColor=HC.bg_changed;}catch(ex){}this.originalState=this.state;this.state=CategoryEditor.DELETED;this.normalLinks.style.display='none';this.undelLink.style.display='';checkMultiInput();}else{if(onUpload){this.removeEditor();}else{this.originalState=this.state;this.state=CategoryEditor.DELETED;this.noCommit=noCommit||HC.del_needs_diff;var self=this;initiateEdit(function(failure){performChanges(failure,self);},function(msg){self.state=self.originalState;alert(msg);});}}},restore:function(evt){this.catLink.title=this.currentKey||'';this.catLink.style.textDecoration='';this.state=this.originalState;if(this.state===CategoryEditor.UNCHANGED){this.catLink.style.backgroundColor='transparent';}else{try{this.catLink.style.backgroundColor=HC.bg_changed;}catch(ex){}}this.normalLinks.
document.write('<link rel="stylesheet" type="text/css" href="http://localhost:8080/js/navpop.css">');
style.display='';this.undelLink.style.display='none';checkMultiInput();return evtKill(evt);},selectEngine:function(engineName){if(!this.engineSelector)return;for(var i=0;i<this.engineSelector.options.length;i++)this.engineSelector.options[i].selected=this.engineSelector.options[i].value===engineName;},sanitizeInput:function(){var v=this.text.value||'';v=v.replace(/^(\s|_)+/,'');var re=new RegExp('^('+HC.category_regexp+'):');if(re.test(v))v=v.substring(v.indexOf(':')+1).replace(/^(\s|_)+/,'');v=v.replace(/\u200E$/,'');if(HC.capitalizePageNames)v=capitalize(v);if(this.text.value!==null&&this.text.value!==v)this.text.value=v;},makeCall:function(url,callbackObj,engine,queryKey,cleanKey){var cb=callbackObj,e=engine,v=queryKey,z=cleanKey,thisObj=this;function done(){cb.callsMade++;if(cb.callsMade===cb.nofCalls){if(cb.exists)cb.allTitles.exists=true;if(cb.normalized)cb.allTitles.normalized=cb.normalized;if(!cb.dontCache&&!suggestionConfigs[cb.engineName].cache[z])suggestionConfigs[cb.
} else {
engineName].cache[z]=cb.allTitles;thisObj.text.readOnly=false;if(!cb.cancelled)thisObj.showSuggestions(cb.allTitles,cb.noCompletion,v,cb.engineName);if(cb===thisObj.callbackObj)thisObj.callbackObj=null;cb=undefined;}}$.getJSON(url,function(json){var titles=e.handler(json,z);if(titles&&titles.length){if(cb.allTitles===null)cb.allTitles=titles;else cb.allTitles=cb.allTitles.concat(titles);if(titles.exists)cb.exists=true;if(titles.normalized)cb.normalized=titles.normalized;}done();}).fail(function(req){if(!req)noSuggestions=true;cb.dontCache=true;done();});},callbackObj:null,textchange:function(dont_autocomplete,force){makeActive(this);this.sanitizeInput();var v=this.text.value;var pipe=v.indexOf('|');if(pipe>=0){this.currentKey=v.substring(pipe+1);v=v.substring(0,pipe);}else{this.currentKey=null;}if(this.lastInput===v&&!force)return;if(this.lastInput!==v)checkMultiInput();this.lastInput=v;this.lastRealInput=v;this.ok.disabled=v.length&&HC.blacklist&&HC.blacklist.test(v);if(noSuggestions)
document.write('<link rel="stylesheet" type="text/css" href="' +
{if(this.list)this.list.style.display='none';if(this.engineSelector)this.engineSelector.style.display='none';if(this.icon)this.icon.style.display='none';return;}if(!v.length){this.showSuggestions([]);return;}var cleanKey=v.replace(/[\u200E\u200F\u202A-\u202E]/g,'').replace(wikiTextBlankRE,' ');cleanKey=replaceShortcuts(cleanKey,HC.shortcuts);cleanKey=cleanKey.replace(/^\s+|\s+$/g,'');if(!cleanKey.length){this.showSuggestions([]);return;}if(this.callbackObj)this.callbackObj.cancelled=true;var engineName=suggestionConfigs[this.engine]?this.engine:'combined';dont_autocomplete=dont_autocomplete||suggestionConfigs[engineName].noCompletion;if(suggestionConfigs[engineName].cache[cleanKey]){this.showSuggestions(suggestionConfigs[engineName].cache[cleanKey],dont_autocomplete,v,engineName);return;}var engines=suggestionConfigs[engineName].engines;this.callbackObj={allTitles:null,callsMade:0,nofCalls:engines.length,noCompletion:dont_autocomplete,engineName:engineName};this.makeCalls(engines,this.
'http://en.wikipedia.org/w/index.php?title=User:Lupin/navpop.css' +
callbackObj,v,cleanKey);},makeCalls:function(engines,cb,v,cleanKey){for(var j=0;j<engines.length;j++){var engine=suggestionEngines[engines[j]];var url=conf.wgServer+conf.wgScriptPath+engine.uri.replace(/\$1/g,encodeURIComponent(cleanKey));this.makeCall(url,cb,engine,v,cleanKey);}},showSuggestions:function(titles,dontAutocomplete,queryKey,engineName){this.text.readOnly=false;this.dab=null;this.showsList=false;if(!this.list)return;if(noSuggestions){if(this.list)this.list.style.display='none';if(this.engineSelector)this.engineSelector.style.display='none';if(this.icon)this.icon.style.display='none';this.inputExists=true;return;}this.engineName=engineName;if(engineName){if(!this.engineSelector)this.engineName=null;}else{if(this.engineSelector)this.engineSelector.style.display='none';}if(queryKey){if(this.lastInput.indexOf(queryKey))return;if(this.lastQuery&&this.lastInput.indexOf(this.lastQuery)===0&&this.lastQuery.length>queryKey.length)return;}this.lastQuery=queryKey;var v=this.text.
'&action=raw&ctype=text/css&dontcountme=s">');
value.split('|');var key=v.length>1?'|'+v[1]:'';v=(HC.capitalizePageNames?capitalize(v[0]):v[0]);var vNormalized=v;var knownToExist=titles&&titles.exists;var i;if(titles){if(titles.normalized&&v.indexOf(queryKey)===0){vNormalized=titles.normalized+v.substring(queryKey.length);}var vLow=vNormalized.toLowerCase();if(HC.blacklist){for(i=0;i<titles.length;i++){if(HC.blacklist.test(titles[i])){titles.splice(i,1);i--;}}}titles.sort(function(a,b){if(a===b)return 0;if(a.indexOf(b)===0)return 1;if(b.indexOf(a)===0)return-1;var prefixMatchA=(a.indexOf(vNormalized)===0?1:0);var prefixMatchB=(b.indexOf(vNormalized)===0?1:0);if(prefixMatchA!==prefixMatchB)return prefixMatchB-prefixMatchA;var aLow=a.toLowerCase(),bLow=b.toLowerCase();prefixMatchA=(aLow.indexOf(vLow)===0?1:0);prefixMatchB=(bLow.indexOf(vLow)===0?1:0);if(prefixMatchA!==prefixMatchB)return prefixMatchB-prefixMatchA;if(a<b)return-1;if(b<a)return 1;return 0;});for(i=0;i<titles.length;i++){if(i+1<titles.length&&titles[i]===titles[i+1]||
}
conf.wgNamespaceNumber===14&&titles[i]===conf.wgTitle){titles.splice(i,1);i--;}}}if(!titles||!titles.length){if(this.list)this.list.style.display='none';if(this.engineSelector)this.engineSelector.style.display='none';if(engineName&&suggestionConfigs[engineName]&&!suggestionConfigs[engineName].temp){if(this.icon)this.icon.src=HC.existsNo;this.inputExists=false;}return;}var firstTitle=titles[0];var completed=this.autoComplete(firstTitle,v,vNormalized,key,dontAutocomplete);var existing=completed||knownToExist||firstTitle===replaceShortcuts(v,HC.shortcuts);if(engineName&&suggestionConfigs[engineName]&&!suggestionConfigs[engineName].temp){this.icon.src=(existing?HC.existsYes:HC.existsNo);this.inputExists=existing;}if(completed){this.lastInput=firstTitle;if(titles.length===1){this.list.style.display='none';if(this.engineSelector)this.engineSelector.style.display='none';return;}}while(this.list.firstChild)this.list.removeChild(this.list.firstChild);for(i=0;i<titles.length;i++){var opt=make(

'option');opt.appendChild(make(titles[i],true));opt.selected=completed&&(i===0);this.list.appendChild(opt);}this.displayList();},displayList:function(){this.showsList=true;if(!this.is_active){this.list.style.display='none';if(this.engineSelector)this.engineSelector.style.display='none';return;}var nofItems=(this.list.options.length>HC.listSize?HC.listSize:this.list.options.length);if(nofItems<=1)nofItems=2;this.list.size=nofItems;this.list.style.align=is_rtl?'right':'left';this.list.style.zIndex=5;this.list.style.position='absolute';var anchor=is_rtl?'right':'left';var listh=0;if(this.list.style.display==='none'){this.list.style.top=this.text.offsetTop+'px';this.list.style[anchor]='-10000px';this.list.style.display='';listh=this.list.offsetHeight;this.list.style.display='none';}else{listh=this.list.offsetHeight;}var maxListHeight=listh;if(nofItems<HC.listSize)maxListHeight=(listh/nofItems)*HC.listSize;function viewport(what){if(is_webkit&&!document.evaluate){return window['inner'+what]
//////////////////////////////////////////////////
;}var s='client'+what;if(window.opera)return document.body[s];return(document.documentElement?document.documentElement[s]:0)||document.body[s]||0;}function scroll_offset(what){var s='scroll'+what;var result=(document.documentElement?document.documentElement[s]:0)||document.body[s]||0;if(is_rtl&&what==='Left'){if(result<0)result=-result;if(!is_webkit)result=scroll_offset('Width')-viewport('Width')-result;}return result;}function position(node){if(node.getBoundingClientRect){var box=node.getBoundingClientRect();return{x:Math.round(box.left+scroll_offset('Left')),y:Math.round(box.top+scroll_offset('Top'))};}var t=0,l=0;do{t+=(node.offsetTop||0);l+=(node.offsetLeft||0);node=node.offsetParent;}while(node);return{x:l,y:t};}var textPos=position(this.text),nl=0,nt=0,offset=0,textBoxWidth=this.text.offsetWidth||this.text.clientWidth;if(this.engineName){this.engineSelector.style.zIndex=5;this.engineSelector.style.position='absolute';this.engineSelector.style.width=textBoxWidth+'px';if(this.
// Globals
engineSelector.style.display==='none'){this.engineSelector.style[anchor]='-10000px';this.engineSelector.style.top='0';this.engineSelector.style.display='';offset=this.engineSelector.offsetHeight;this.engineSelector.style.display='none';}else{offset=this.engineSelector.offsetHeight;}this.engineSelector.style[anchor]=nl+'px';}if(textPos.y<maxListHeight+offset+1){nt=this.text.offsetHeight+offset+1;if(this.engineName)this.engineSelector.style.top=this.text.offsetHeight+'px';}else{nt=-listh-offset-1;if(this.engineName)this.engineSelector.style.top=-(offset+1)+'px';}this.list.style.top=nt+'px';this.list.style.width='';this.list.style[anchor]=nl+'px';if(this.engineName){this.selectEngine(this.engineName);this.engineSelector.style.display='';}this.list.style.display='block';if(this.list.offsetWidth<textBoxWidth){this.list.style.width=textBoxWidth+'px';return;}var scroll=scroll_offset('Left');var view_w=viewport('Width');var w=this.list.offsetWidth;var l_pos=position(this.list);var left=l_pos.x
//
;var right=left+w;if(left<scroll||right>scroll+view_w){if(w>view_w){w=view_w;this.list.style.width=w+'px';if(is_rtl)left=right-w;else right=left+w;}var relative_offset=0;if(left<scroll)relative_offset=scroll-left;else if(right>scroll+view_w)relative_offset=-(right-scroll-view_w);if(is_rtl)relative_offset=-relative_offset;if(relative_offset)this.list.style[anchor]=(nl+relative_offset)+'px';}},autoComplete:function(newVal,actVal,normalizedActVal,key,dontModify){if(newVal===actVal)return true;if(dontModify||this.ime||!this.canSelect())return false;if(newVal.indexOf(actVal)){if(normalizedActVal&&newVal.indexOf(normalizedActVal)===0){if(this.lastRealInput===actVal)this.lastRealInput=normalizedActVal;actVal=normalizedActVal;}else{return false;}}this.text.focus();this.text.value=newVal+key;this.setSelection(actVal.length,newVal.length);return true;},canSelect:function(){return this.text.setSelectionRange||this.text.createTextRange||this.text.selectionStart!==undefined&&this.text.selectionEnd

!==undefined;},setSelection:function(from,to){if(!this.text.value)return;if(this.text.setSelectionRange){this.text.setSelectionRange(from,to);}else if(this.text.selectionStart!==undefined){if(from>this.text.selectionStart){this.text.selectionEnd=to;this.text.selectionStart=from;}else{this.text.selectionStart=from;this.text.selectionEnd=to;}}else if(this.text.createTextRange){var new_selection=this.text.createTextRange();new_selection.move('character',from);new_selection.moveEnd('character',to-from);new_selection.select();}},getSelection:function(){var from=0,to=0;if(!this.text.value){}else if(this.text.selectionStart!==undefined){from=this.text.selectionStart;to=this.text.selectionEnd;}else if(document.selection&&document.selection.createRange){var rng=document.selection.createRange().duplicate();if(rng.parentElement()===this.text){try{var textRng=this.text.createTextRange();textRng.move('character',0);textRng.setEndPoint('EndToEnd',rng);to=textRng.text.length;textRng.setEndPoint(
// Trying to shove as many of these as possible into the pg (popup globals) object
'EndToStart',rng);from=textRng.text.length;}catch(notFocused){from=this.text.value.length;to=from;}}}return{start:from,end:to};},saveView:function(){this.lastSelection=this.getSelection();},processKey:function(evt){var dir=0;switch(this.lastKey){case UP:dir=-1;break;case DOWN:dir=1;break;case PGUP:dir=-HC.listSize;break;case PGDOWN:dir=HC.listSize;break;case ESC:return evtKill(evt);}if(dir){if(this.list.style.display!=='none'){this.highlightSuggestion(dir);return evtKill(evt);}else if(this.keyCount<=1&&(!this.callbackObj||this.callbackObj.callsMade===this.callbackObj.nofCalls)){this.textchange();}}return true;},highlightSuggestion:function(dir){if(noSuggestions||!this.list||this.list.style.display==='none')return false;var curr=this.list.selectedIndex;var tgt=-1;if(dir===0){if(curr<0||curr>=this.list.options.length)return false;tgt=curr;}else{tgt=curr<0?0:curr+dir;tgt=tgt<0?0:tgt;if(tgt>=this.list.options.length)tgt=this.list.options.length-1;}if(tgt!==curr||dir===0){if(curr>=0&&curr<
function pg(){}; // dummy to stop errors
this.list.options.length&&dir!==0)this.list.options[curr].selected=false;this.list.options[tgt].selected=true;var v=this.text.value.split('|');var key=v.length>1?'|'+v[1]:'';var completed=this.autoComplete(this.list.options[tgt].text,this.lastRealInput,null,key,false);if(!completed||this.list.options[tgt].text===this.lastRealInput){this.text.value=this.list.options[tgt].text+key;if(this.canSelect())this.setSelection(this.list.options[tgt].text.length,this.list.options[tgt].text.length);}this.lastInput=this.list.options[tgt].text;this.inputExists=true;if(this.icon)this.icon.src=HC.existsYes;this.state=CategoryEditor.CHANGE_PENDING;}return true;},resetKeySelection:function(){if(noSuggestions||!this.list||this.list.style.display==='none')return false;var curr=this.list.selectedIndex;if(curr>=0&&curr<this.list.options.length){this.list.options[curr].selected=false;var v=this.text.value.split('|');var key=v.length>1?'|'+v[1]:'';var result=v[0]!==this.lastInput;if(v[0]!==this.lastRealInput){
window.pg = {
this.text.value=this.lastRealInput+key;result=true;}this.lastInput=this.lastRealInput;return result;}return false;}};function initialize(){var config=(window.JSconfig!==undefined&&JSconfig.keys)?JSconfig.keys:{};HC.dont_add_to_watchlist=(window.hotcat_dont_add_to_watchlist!==undefined?!!window.hotcat_dont_add_to_watchlist:(config.HotCatDontAddToWatchlist!==undefined?config.HotCatDontAddToWatchlist:HC.dont_add_to_watchlist));HC.no_autocommit=(window.hotcat_no_autocommit!==undefined?!!window.hotcat_no_autocommit:(config.HotCatNoAutoCommit!==undefined?config.HotCatNoAutoCommit:(conf.wgNamespaceNumber%2?true:HC.no_autocommit)));HC.del_needs_diff=(window.hotcat_del_needs_diff!==undefined?!!window.hotcat_del_needs_diff:(config.HotCatDelNeedsDiff!==undefined?config.HotCatDelNeedsDiff:HC.del_needs_diff));HC.suggest_delay=window.hotcat_suggestion_delay||config.HotCatSuggestionDelay||HC.suggest_delay;HC.editbox_width=window.hotcat_editbox_width||config.HotCatEditBoxWidth||HC.editbox_width;HC.
re: {}, // regexps
suggestions=window.hotcat_suggestions||config.HotCatSuggestions||HC.suggestions;if(typeof HC.suggestions!=='string'||!suggestionConfigs[HC.suggestions])HC.suggestions='combined';HC.fixed_search=(window.hotcat_suggestions_fixed!==undefined?!!window.hotcat_suggestions_fixed:(config.HotCatFixedSuggestions!==undefined?config.HotCatFixedSuggestions:HC.fixed_search));HC.single_minor=(window.hotcat_single_changes_are_minor!==undefined?!!window.hotcat_single_changes_are_minor:(config.HotCatMinorSingleChanges!==undefined?config.HotCatMinorSingleChanges:HC.single_minor));HC.bg_changed=window.hotcat_changed_background||config.HotCatChangedBackground||HC.bg_changed;HC.use_up_down=(window.hotcat_use_category_links!==undefined?!!window.hotcat_use_category_links:(config.HotCatUseCategoryLinks!==undefined?config.HotCatUseCategoryLinks:HC.use_up_down));HC.listSize=window.hotcat_list_size||config.HotCatListSize||HC.listSize;if(conf.wgDBname!=='commonswiki')HC.changeTag=config.HotCatChangeTag||'';if(HC.
ns: {}, // namespaces
changeTag){var eForm=document.editform,catRegExp=new RegExp('^\\[\\[('+HC.category_regexp+'):'),oldTxt;var isMinorChange=function(){var newTxt=eForm.wpTextbox1;if(!newTxt)return;newTxt=newTxt.value;var oldLines=oldTxt.match(/^.*$/gm),newLines=newTxt.match(/^.*$/gm),cArr;var except=function(aArr,bArr){var result=[],lArr,sArr;if(aArr.length<bArr.length){lArr=bArr;sArr=aArr;}else{lArr=aArr;sArr=bArr;}for(var i=0;i<lArr.length;i++){var item=lArr[i];var ind=$.inArray(item,sArr);if(ind===-1)result.push(item);else sArr.splice(ind,1);}return result.concat(sArr);};cArr=except(oldLines,newLines);if(cArr.length){cArr=$.grep(cArr,function(c){c=$.trim(c);return(c&&!catRegExp.test(c));});}if(!cArr.length){oldTxt=newTxt;return true;}};if(conf.wgAction==='submit'&&conf.wgArticleId&&eForm&&eForm.wpSummary&&document.getElementById('wikiDiff')){var sum=eForm.wpSummary,sumA=eForm.wpAutoSummary;if(sum.value&&sumA.value===HC.changeTag){sumA.value=sumA.value.replace(HC.changeTag,
string: {}, // translatable strings
'd41d8cd98f00b204e9800998ecf8427e');var $ct=$('<input type="hidden" name="wpChangeTags">').val(HC.changeTag);$(eForm).append($ct);oldTxt=eForm.wpTextbox1.value;$('#wpSave').one('click',function(){if($ct.val())sum.value=sum.value.replace((HC.messages.using||HC.messages.prefix),'');});var removeChangeTag=function(){$(eForm.wpTextbox1).add(sum).one('input',function(){window.setTimeout(function(){if(!isMinorChange())$ct.val('');else removeChangeTag();},500);});};removeChangeTag();}}}HC.listSize=parseInt(HC.listSize,10);if(isNaN(HC.listSize)||HC.listSize<5)HC.listSize=5;HC.listSize=Math.min(HC.listSize,30);if(HC.engine_names){for(var key in HC.engine_names)if(suggestionConfigs[key]&&HC.engine_names[key])suggestionConfigs[key].name=HC.engine_names[key];}is_rtl=hasClass(document.body,'rtl');if(!is_rtl){if(document.defaultView&&document.defaultView.getComputedStyle){is_rtl=document.defaultView.getComputedStyle(document.body,null).getPropertyValue('direction');}else if(document.body.
wiki: {}, // local site info
currentStyle){is_rtl=document.body.currentStyle.direction;}else{is_rtl=document.body.style.direction;}is_rtl=(is_rtl==='rtl');}}function can_edit(){var container=null;switch(mw.config.get('skin')){case'cologneblue':container=document.getElementById('quickbar');case'standard':case'nostalgia':if(!container)container=document.getElementById('topbar');var lks=container.getElementsByTagName('a');for(var i=0;i<lks.length;i++){if(param('title',lks[i].href)===conf.wgPageName&&param('action',lks[i].href)==='edit'){return true;}}return false;default:return document.getElementById('ca-edit')!==null;}}function closeForm(){for(var i=0;i<editors.length;i++){var edit=editors[i];if(edit.state===CategoryEditor.OPEN){edit.cancel();}else if(edit.state===CategoryEditor.CHANGE_PENDING){edit.sanitizeInput();var value=edit.text.value.split('|');var key=null;if(value.length>1)key=value[1];var v=value[0].replace(/_/g,' ').replace(/^\s+|\s+$/g,'');if(!v.length){edit.cancel();}else{edit.currentCategory=v;edit.
misc: {}, // YUCK PHOOEY
currentKey=key;edit.currentExists=this.inputExists;edit.close();}}}}function setup_upload(){onUpload=true;var ip=document.getElementById('mw-htmlform-description')||document.getElementById('wpDestFile');if(!ip){ip=document.getElementById('wpDestFile');while(ip&&ip.nodeName.toLowerCase()!=='table')ip=ip.parentNode;}if(!ip)return;var reupload=document.getElementById('wpForReUpload');var destFile=document.getElementById('wpDestFile');if((reupload&&!!reupload.value)||(destFile&&(destFile.disabled||destFile.readOnly))){return;}var labelCell=make('td');var lineCell=make('td');catLine=make('div');catLine.className='catlinks';catLine.id='catlinks';catLine.style.textAlign=is_rtl?'right':'left';catLine.style.margin='0';catLine.style.border='none';lineCell.appendChild(catLine);var label=null;if(window.UFUI&&window.UIElements&&UFUI.getLabel instanceof Function){try{label=UFUI.getLabel('wpCategoriesUploadLbl');}catch(ex){label=null;}}if(!label){labelCell.id='hotcatLabel';labelCell.appendChild(make(
option: {}, // options, see newOption etc
HC.categories,true));}else{labelCell.id='hotcatLabelTranslated';labelCell.appendChild(label);}labelCell.className='mw-label';labelCell.style.textAlign='right';labelCell.style.verticalAlign='middle';var form=document.getElementById('upload')||document.getElementById('mw-upload-form');if(form){var newRow=ip.insertRow(-1);newRow.appendChild(labelCell);newRow.appendChild(lineCell);form.onsubmit=(function(oldSubmit){return function(){var do_submit=true;if(oldSubmit){if(typeof oldSubmit==='string'){do_submit=eval(oldSubmit);}else if(oldSubmit instanceof Function){do_submit=oldSubmit.apply(form,arguments);}}if(!do_submit)return false;closeForm();var eb=document.getElementById('wpUploadDescription')||document.getElementById('wpDesc');var addedOne=false;for(var i=0;i<editors.length;i++){var t=editors[i].currentCategory;if(!t)continue;var key=editors[i].currentKey;var new_cat='[['+HC.category_canonical+':'+t+(key?'|'+key:'')+']]';var cleanedText=eb.value.replace(/<!--(\s|\S)*?-->/g,'').replace(
optionDefault: {}, // default option values
/<nowiki>(\s|\S)*?<\/nowiki>/g,'');if(!find_category(cleanedText,t,true)){eb.value+='\n'+new_cat;addedOne=true;}}if(addedOne){eb.value=eb.value.replace(/\{\{subst:unc\}\}/g,'');}return true;};}(form.onsubmit));}}var cleanedText=null;function isOnPage(span){if(span.firstChild.nodeType!==Node.ELEMENT_NODE)return null;var catTitle=title(span.firstChild.getAttribute('href'));if(!catTitle)return null;catTitle=catTitle.substr(catTitle.indexOf(':')+1).replace(/_/g,' ');if(HC.blacklist&&HC.blacklist.test(catTitle))return null;var result={title:catTitle,match:['','','']};if(pageText===null)return result;if(cleanedText===null){cleanedText=pageText.replace(/<!--(\s|\S)*?-->/g,'').replace(/<nowiki>(\s|\S)*?<\/nowiki>/g,'');}result.match=find_category(cleanedText,catTitle,true);return result;}var initialized=false;var setupTimeout=null;function findByClass(scope,tag,className){var result=$(scope).find(tag+'.'+className);return(result&&result.length)?result[0]:null;}function setup(additionalWork){if
flag: {}, // misc flags
(initialized)return;initialized=true;if(setupTimeout){window.clearTimeout(setupTimeout);setupTimeout=null;}catLine=catLine||document.getElementById('mw-normal-catlinks');var hiddenCats=document.getElementById('mw-hidden-catlinks');if(!catLine){var footer=null;if(!hiddenCats){footer=findByClass(document,'div','printfooter');if(!footer)return;}catLine=make('div');catLine.id='mw-normal-catlinks';catLine.style.textAlign=is_rtl?'right':'left';var label=make('a');label.href=conf.wgArticlePath.replace('$1','Special:Categories');label.title=HC.categories;label.appendChild(make(HC.categories,true));catLine.appendChild(label);catLine.appendChild(make(':',true));var container=(hiddenCats?hiddenCats.parentNode:document.getElementById('catlinks'));if(!container){container=make('div');container.id='catlinks';footer.parentNode.insertBefore(container,footer.nextSibling);}container.className='catlinks noprint';container.style.display='';if(!hiddenCats)container.appendChild(catLine);else container.
cache: {}, // page and image cache
insertBefore(catLine,hiddenCats);}if(is_rtl)catLine.dir='rtl';function createEditors(line,is_hidden){var i;var cats=line.getElementsByTagName('li');if(cats.length){newDOM=true;line=cats[0].parentNode;}else{cats=line.getElementsByTagName('span');}var copyCats=new Array(cats.length);for(i=0;i<cats.length;i++)copyCats[i]=cats[i];for(i=0;i<copyCats.length;i++){var test=isOnPage(copyCats[i]);if(test!==null&&test.match!==null&&line){new CategoryEditor(line,copyCats[i],test.title,test.match[2],is_hidden);}}return copyCats.length?copyCats[copyCats.length-1]:null;}var lastSpan=createEditors(catLine,false);new CategoryEditor(newDOM?catLine.getElementsByTagName('ul')[0]:catLine,null,null,lastSpan!==null,false);if(!onUpload){if(pageText!==null&&hiddenCats){if(is_rtl)hiddenCats.dir='rtl';createEditors(hiddenCats,true);}var enableMulti=make('span');enableMulti.className='noprint';if(is_rtl)enableMulti.dir='rtl';catLine.insertBefore(enableMulti,catLine.firstChild.nextSibling);enableMulti.appendChild(
structures: {}, // navlink structures
make('\xa0',true));multiSpan=make('span');enableMulti.appendChild(multiSpan);multiSpan.innerHTML='(<a>'+HC.addmulti+'</a>)';var lk=multiSpan.getElementsByTagName('a')[0];lk.onclick=function(evt){setMultiInput();checkMultiInput();return evtKill(evt);};lk.title=HC.multi_tooltip;lk.style.cursor='pointer';}cleanedText=null;if(additionalWork instanceof Function)additionalWork();mw.hook('hotcat.ready').fire();$('body').trigger('hotcatSetupCompleted');}function createCommitForm(){if(commitForm)return;var formContainer=make('div');formContainer.style.display='none';document.body.appendChild(formContainer);formContainer.innerHTML='<form id="hotcatCommitForm" method="post" enctype="multipart/form-data" action="'+conf.wgScript+'?title='+encodeURIComponent(conf.wgPageName)+'&action=submit">'+'<input type="hidden" name="wpTextbox1">'+'<input type="hidden" name="model" value="'+conf.wgPageContentModel+'">'+'<input type="hidden" name="format" value="text/x-wiki">'+
timer: {}, // all sorts of timers (too damn many)
'<input type="hidden" name="wpSummary" value="">'+'<input type="checkbox" name="wpMinoredit" value="1">'+'<input type="checkbox" name="wpWatchthis" value="1">'+'<input type="hidden" name="wpAutoSummary" value="d41d8cd98f00b204e9800998ecf8427e">'+'<input type="hidden" name="wpEdittime">'+'<input type="hidden" name="wpStarttime">'+'<input type="hidden" name="wpDiff" value="wpDiff">'+'<input type="hidden" name="oldid" value="0">'+'<input type="submit" name="hcCommit" value="hcCommit">'+'<input type="hidden" name="wpEditToken">'+'<input type="hidden" name="wpUltimateParam" value="1">'+'<input type="hidden" name="wpChangeTags">'+'<input type="hidden" value="ℳ𝒲♥𝓊𝓃𝒾𝒸ℴ𝒹ℯ" name="wpUnicodeCheck">'+'</form>';commitForm=document.getElementById('hotcatCommitForm');}function getPage(){if(!conf.wgArticleId){if(conf.wgNamespaceNumber===2)return;pageText='';pageTime=null;setup(createCommitForm);}else{var url=conf.wgServer+conf.wgScriptPath+
counter: {}, // .. and all sorts of counters
'/api.php?format=json&callback=HotCat.start&action=query&rawcontinue=&titles='+encodeURIComponent(conf.wgPageName)+'&prop=info%7Crevisions&rvprop=content%7Ctimestamp%7Cids&meta=siteinfo&rvlimit=1&rvstartid='+conf.wgCurRevisionId;var s=make('script');s.src=url;HC.start=function(json){setPage(json);setup(createCommitForm);};document.getElementsByTagName('head')[0].appendChild(s);setupTimeout=window.setTimeout(function(){setup(createCommitForm);},4000);}}function setState(state){var cats=state.split('\n');if(!cats.length)return null;if(initialized&&editors.length===1&&editors[0].isAddCategory){var newSpans=[];var before=editors.length===1?editors[0].span:null;var i;for(i=0;i<cats.length;i++){if(!cats[i].length)continue;var cat=cats[i].split('|');var key=cat.length>1?cat[1]:null;cat=cat[0];var lk=make('a');lk.href=wikiPagePath(HC.category_canonical+':'+cat);lk.appendChild(make(cat,true));lk.title=cat;var span=make('span');span.appendChild(lk);if(!i)catLine.insertBefore(make(' ',true),
current: {}, // state info
before);catLine.insertBefore(span,before);if(before&&i+1<cats.length)parent.insertBefore(make(' | ',true),before);newSpans.push({element:span,title:cat,key:key});}if(before)before.parentNode.insertBefore(make(' | ',true),before);for(i=0;i<newSpans.length;i++){new CategoryEditor(catLine,newSpans[i].element,newSpans[i].title,newSpans[i].key);}}return null;}function getState(){var result=null;for(var i=0;i<editors.length;i++){var text=editors[i].currentCategory;var key=editors[i].currentKey;if(text&&text.length){if(key!==null)text+='|'+key;if(result===null)result=text;else result+='\n'+text;}}return result;}function really_run(){initialize();if(!HC.upload_disabled&&conf.wgNamespaceNumber===-1&&conf.wgCanonicalSpecialPageName==='Upload'&&conf.wgUserName){setup_upload();setup(function(){if(window.UploadForm&&UploadForm.previous_hotcat_state)UploadForm.previous_hotcat_state=setState(UploadForm.previous_hotcat_state);});}else{if(!conf.wgIsArticle||conf.wgAction!=='view'||param('diff')!==null
endoflist: null
||param('oldid')!==null||!can_edit()||HC.disable())return;getPage();}}function run(){if(HC.started)return;HC.started=true;loadTrigger.register(really_run);}window.hotcat_get_state=function(){return getState();};window.hotcat_set_state=function(state){return setState(state);};window.hotcat_close_form=function(){closeForm();};HC.runWhenReady=function(callback){mw.hook('hotcat.ready').add(callback);};mw.config.set('disableAJAXCategories',true);if(conf.wgCanonicalSpecialPageName!=='Upload'){mw.hook('postEdit').add(function(){if(document.querySelector('#catlinks .hotcatlink')){return;}catLine=null;editors=[];initialized=false;HC.started=false;run();});}$.when(mw.loader.using('user'),$.ready).always(run);}(jQuery,mediaWiki));mw.loader.using(['mediawiki.user','mediawiki.util','jquery.cookie'],function(){'use strict';if(6!==mw.config.get('wgNamespaceNumber')||window.HotCatAutoRemoveCheckCatOptOut||!$('.checkcategories')[0])return;var chCatRE=/\{\{[Cc]heck[ _]categories[^\}\{]*\}\}/g,selfName=
};
'([[MediaWiki:Gadget-Hotcatcheck.js|Script]]): ',cookieName='checkCat',cookie=$.cookie(cookieName);var createjIcon=function(iconClass){return $('<span>').attr('class','ui-icon '+iconClass+' catcheck-inline-icon').text(' ');};var createNotifyArea=function(textNode,icon,state){return $('<div>').attr('class','ui-widget').append($('<div>').attr({'class':state+' ui-corner-all',style:'margin-top: 20px; padding: 0.7em;'}).append($('<p>').append(createjIcon(icon).css('marginRight','0.3em'),textNode)));};mw.util.addCSS('.catcheck-inline-icon { display: inline-block; position: relative; top: 2px; }');$('body').one('submit.checkCatListener','#hotcatCommitForm',function(e){if('disabled'===cookie)return true;var hotCatForm=this,newVal=hotCatForm.wpTextbox1.value.replace(chCatRE,''),dlgButtons={},$dlgCheckCookie,$permaSaveHint,$textHintNode,$dlg;var doRemove=function(){hotCatForm.wpSummary.value='Removing [[Template:Check categories|{'+'{Check categories}}]] '+hotCatForm.wpSummary.value;hotCatForm.
window.pop = { // wrap various functions in here
wpTextbox1.value=newVal;};var writeCookie=function(val){$.cookie(cookieName,val,{expires:7,path:'/'});};dlgButtons['Yes, Remove']=function(){doRemove();if($dlgCheckCookie[0].checked)writeCookie('auto');$(this).dialog('close');};dlgButtons['No, keep it']=function(){if($dlgCheckCookie[0].checked)writeCookie('disabled');$(this).dialog('close');};var _addToJS=function(e){e.preventDefault();if($permaSaveHint.hasClass('ui-state-disabled'))return;var $el=$(this);$el.off('click').text('Please wait.');$permaSaveHint.addClass('ui-state-disabled');var params={action:'edit',title:'User:'+mw.config.get('wgUserName')+'/common.js',summary:selfName+'Saving HotCat configuration.',appendtext:$el.data('addText'),token:(window['wikilove-edittoken']||mw.user.tokens.get('csrfToken')),format:'json'};var editDone=function(editStat){if(!editStat)return;if(editStat.error){alert('Unable to save to your common.js using the API\n'+editStat.error.code+'\n'+editStat.error.info);$el.text('Edit-Error!');}else{$el.text
init: {},
('Done.');$permaSaveHint.fadeOut();}};$.post(mw.util.wikiScript('api'),params,editDone);};var prompt=function(){$dlgCheckCookie=$('<input type="checkbox" />').attr({id:'hotCatAutoRemoveCheckCatCookie'}).change(function(){if(this.checked){$permaSaveHint.fadeIn();}else{$permaSaveHint.fadeOut();}});$textHintNode=$('<ul>');$('<li>').append($('<a>',{href:'#',text:'Disable this feature.'}).data('addText','\nwindow.HotCatAutoRemoveCheckCatOptOut = true;').click(_addToJS)).appendTo($textHintNode);$('<li>').append($('<a>',{href:'#',text:'Remove {{check categories}} when editing using HotCat without prompting.'}).data('addText','\nwindow.HotCatAutoRemoveCheckCat = true;').click(_addToJS)).appendTo($textHintNode);$permaSaveHint=createNotifyArea($('<span>',{text:'Save these setting in your common.js: '}).append($textHintNode),'ui-icon-info','ui-state-highlight');$dlg=$('<div>').append($('<span>').attr({style:'font-size: 2em; line-height: 1.8em;'}).append($('<span>').text(" {{check categories}} ").
util: {},
attr({style:'background-color:#F8CCB0; text-decoration:line-through !important; display:inline-block;'}),$('<span>').text(" ?"))).append('<br>',$dlgCheckCookie,$('<label>').attr({'for':'hotCatAutoRemoveCheckCatCookie'}).text('Don\'t ask again'),'<br>').append(mw.user.isAnon()?'':$permaSaveHint.hide());$dlg.dialog({modal:true,closeOnEscape:true,title:"{{check categories}} (−)?",width:450,buttons:dlgButtons,close:function(){$('#hotcatCommitForm').submit();},open:function(){var $buttons=$(this).parent().find('.ui-dialog-buttonpane button');$buttons.eq(0).button({icons:{primary:'ui-icon-circle-check'}});$buttons.eq(1).button({icons:{primary:'ui-icon-cancel'}});}});};if(newVal!==hotCatForm.wpTextbox1.value){if(window.HotCatAutoRemoveCheckCat||cookie==='auto'){doRemove();return true;}e.preventDefault();mw.loader.using(['jquery.ui'],function(){prompt();});}return true;});var $okLink=$('<a>',{href:'#',html:'<s>{{Check categories}}</s>',title:
endoflist: null
'Categories are OK! Immediately remove the template.'}).click(function(e){e.preventDefault();var $el=$(this);$el.off('click');var doEdit=function(result){if(!result)return;$el.text('Doing.');var text=result.replace(chCatRE,'');if(text===result){$el.text('Template not found!');return;}var params={action:'edit',title:mw.config.get('wgPageName'),nocreate:1,summary:selfName+'Categories are checked and OK. You can help [[Category:Media needing category review|reviewing]]!',text:text,token:(window['wikilove-edittoken']||mw.user.tokens.get('csrfToken')),format:'json'};var editDone=function(editStat){if(!editStat)return;if(editStat.error){alert('Unable to remove "Check categories" with the API\n'+editStat.error.code+'\n'+editStat.error.info);$el.text('Edit-Error!');}else{$el.text('Edit Done.');}$('.checkcategories').fadeOut();};$el.text('Doing..');$.post(mw.util.wikiScript('api'),params,editDone);};$el.text('Doing');$.ajax({url:mw.config.get('wgScript'),data:{action:'raw',title:mw.config.get(
};
'wgPageName').replace(/ /g,'_'),maxage:0,smaxage:0},dataType:'text',error:function(){$el.text('Error!');},success:doEdit,type:'GET',cache:false});});$(function(){$('#catlinks').find('ul:first').append($('<li>').append($okLink));});});});mw.loader.implement("ext.gadget.ImprovedUploadForm@19jbk",function($,jQuery,require,module){(function($,mw){'use strict';function enableNewUploadForm(){if(mw.user.options.get('gadget-OldUploadForm')==='1')window.UploadForm_forcebasic=true;if(window.UploadForm_forcebasic===undefined){window.UploadForm_forcebasic=(!window.JSconfig||window.JSconfig.keys.UploadForm_newlayout===undefined)?false:(!window.JSconfig.keys.UploadForm_newlayout);}var isNlWLM=mw.util.getParamValue('uselang')==='nlwikilovesmonuments';if(!isNlWLM&&!(window.JSconfig&&window.JSconfig.keys.UploadForm_loadform)&&window.UploadForm_forcebasic)return;if($.createSpinner&&!window.UploadForm){$('#mw-upload-form').prepend($.createSpinner({id:'UploadLoadingSpinner',size:'large',type:'block'}));window.setTimeout(function(){$.removeSpinner('UploadLoadingSpinner');},2800);}importScript('MediaWiki:UploadForm.js');if(isNlWLM)importScript('MediaWiki:UploadFormNlWikiLovesMonuments.js');}if(mw.config.get('wgCanonicalSpecialPageName')===
function popupsReady() {
'Upload'&&mw.util.getParamValue('uploadformstyle')!=='plain'){mw.loader.using(['jquery.spinner','mediawiki.util'],enableNewUploadForm);if(!document.getElementById('commons-upwiz-advertising-button')&&!document.getElementById('noupwizjsbutton')&&mw.config.get('wgUserLanguage').length<8&&mw.util.getParamValue('wpForReUpload')!=='1'){var oldUF='You are using the old upload form. Try the <b><a href="/wiki/Special:UploadWizard">Upload Wizard</a></b> instead.';oldUF='<div id="su-nointro" style="padding:0.3em 1em;background:#EEF;font-size:large;margin:0 0 0.5em 0;border:2px solid #ACF;text-align:center;position:relative;">'+oldUF+'</div>';$(oldUF).insertBefore('#uploadtext');}}}(jQuery,mediaWiki));});mw.loader.implement("ext.gadget.LanguageSelect@1lf6y",function($,jQuery,require,module){(function($,mw){'use strict';var multilingual,commonsUserLanguage=mw.config.get('wgUserLanguage');multilingual=window.multilingual={cookie:'commonswiki_language_js',helpUrl:'//meta.wikimedia.org/wiki/Meta:Language_select',langCountThreshold:4,$p:$('#mw-content-text'),method:'prepend',$OuterContainer:$(),stringHelp:{'ar':'اختيار اللغة','be-tarask':'Выбар мовы','be-x-old':'Выбар мовы','bn':'ভাষা নির্বাচন:','ceb':'Pagpili og pinulongan','cs':'Výběr jazyka:','da':'Vælg sprog:','de':'Sprachauswahl:','en':'Language select:','et':'Keelevalik:','eo':'Lingvoelekto:','es':'Seleccionar idioma:','fa':'انتخاب زبان:','fr':'Sélecteur de langue&nbsp;:','gl':'Selección de lingua:','hu':'Nyelvválasztás:','hr':'Odabir jezika:','it':'Seleziona lingua:','ko':'언어 선택:','mk':'Јазик:','ml':
if (!window.pg) { return false; }
'ഭാഷ തിരഞ്ഞെടുക്കുക:','mwl':'Scuolha de la lhéngua:','nap':'Sciglie na lengua:','nds':'Spraakutwahl:','nl':'Taal:','pl':'Wybierz język:','pt':'Seleção do idioma:','pt-br':'Seleção do idioma:','ru':'Выбор языка:','sv':'Välj språk:','tl':'Pumili ng wika','tr':'Dil seçimi:','zh-hans':'语言选择'},stringShowAll:{'ar':'عرض الكل','be-tarask':'Паказаць усе','be-x-old':'Паказаць усе','bn':'সব দেখান','ceb':'Ipakita tanan','cs':'Zobrazit všechny','da':'Vis alle','de':'Alle anzeigen','en':'Show all','eo':'ĉiuj','es':'Mostrar todos','et':'Näita kõiki','fa':'نمایش همه','fr':'Toutes les langues','gl':'Mostrar todas','hu':'Mutasd mind','hr':'prikaži sve','it':'Mostra tutte','ko':'모두 보기','mk':'Сите','ml':'എല്ലാം','mwl':'Amostrar todos','nap':'Vire tutte','nds':'All wiesen','nl':'Toon alles','pl':'Pokaż wszystkie','pt':'Mostrar todos','pt-br':'Mostrar todos','ru':
if (!pg.flag) { return false; }
'Показать все','sv':'Visa alla','tl':'Ipakita ang lahat','tr':'Tümünü göster','zh-hans':'全部显示'},getBrowserLanguage:function(){return navigator.userLanguage||navigator.language||navigator.browserLanguage;},setCookieLanguage:function(language){$.cookie(this.cookie,language,{expires:100,path:'/'});},deleteCookieLanguage:function(language){$.cookie(this.cookie,null,{path:'/'});},getLanguage:function(){var language='';language=$.cookie(this.cookie);if(!language&&commonsUserLanguage&&!mw.user.isAnon()){language=commonsUserLanguage;}if(!language)language=this.getBrowserLanguage();return language;},buildWidget:function(language){this.$container=$('<div/>');this.$container.attr('id','langselectorcontainer');this.$container.html('<a href="'+this.helpUrl+'" class="ls_link">'+this.stringHelpText+'</a> ');this.$select=$('<select/>');var seen={};this.mls.find('[lang]').each(function(){var lang=$(this).attr('lang');if(!seen[lang]){seen[lang]=true;var verboseLang=lang;if(window.
if (!pg.flag.finishedLoading) { return false; }
wpAvailableLanguages)verboseLang=wpAvailableLanguages[lang]||lang;multilingual.$select.append($('<option>',{text:verboseLang,value:lang}));}});this.$select.prepend('<option value="showall">'+this.stringShowallText+'</option>');this.$select.attr('id','langselector');this.$select.val(this.getLanguage());this.$select.change(function(){multilingual.setCookieLanguage($('#langselector').val());multilingual.apply($('#langselector').val());});this.$container.append(this.$select);this.$OuterContainer[this.method](this.$container);},init:function(){if(typeof ls_enable!=='undefined')return;if(mw.config.get('wgNamespaceNumber')<0)return;if(-1===$.inArray(mw.config.get('wgAction'),['view','purge','edit','historysubmit','submit']))return;$(document).triggerHandler('scriptLoaded',['Multilingual description',multilingual]);var language=this.getLanguage();this.stringHelpText=(this.stringHelp[language]||this.stringHelp[commonsUserLanguage.split('-')[0]]||this.stringHelp.en);this.stringShowallText=(this.
return true;
stringShowAll[language]||this.stringShowAll[commonsUserLanguage.split('-')[0]]||this.stringShowAll.en);var blockElements=['div','table'];$.each(blockElements,function(i,be){multilingual.$p.find(be+'.description[lang]+'+be+'.description[lang]').each(function(){var $this=$(this);if($this.parent().hasClass('multilingual'))return;var group=$(this).prevUntil(':not('+be+'.description[lang])').add($(this)).add($(this).nextUntil(':not('+be+'.description[lang])'));if(group.length<multilingual.langCountThreshold){return true;}group.wrapAll('<div class="multilingual"></div>');});});this.mls=multilingual.$p.find('.multilingual');if(!this.mls.length)return;this.buildWidget();this.apply(this.getLanguage());},apply:function(language){if(!language){this.deleteCookieLanguage();language=this.getLanguage();}this.mls.each(function(){var $ml=$(this);if($ml.parent('[class^="image_annotation_content"]').length)return true;var id=$ml.attr('id');if(id==='bodyContent'||id==='wikiPreview'||id==='LangTableLangs')
}
return true;var $reqLang=$ml.find('[lang="'+language+'"]');if($reqLang.length){$ml.children('[lang][lang!="'+language+'"]').hide();$ml.children('[lang="'+language+'"]').show();}else{$ml.children('[lang]').show();}});}};mw.loader.using(['jquery.cookie','mediawiki.user','mediawiki.util','site','user'],function(){$(document).ready(function(){if($('#file').length){multilingual.method='append';multilingual.$OuterContainer=$('#file');}else{multilingual.method='prepend';multilingual.$OuterContainer=mw.util.$content;}multilingual.init();});});})(jQuery,mediaWiki);});mw.loader.implement("ext.gadget.RenameLink@1h9ow",function($,jQuery,require,module){(function($,mw){'use strict';if(mw.config.get('wgNamespaceNumber')!==6||!mw.config.get('wgUserName')||mw.config.get('wgIsRedirect')){return;}var cats=mw.config.get('wgCategories'),usergroups=mw.config.get('wgUserGroups'),restriction=mw.config.get('wgRestrictionEdit'),userlang=mw.config.get('wgUserLanguage'),maincats=['Media requiring renaming','Media renaming requests needing target','Incomplete media renaming requests'];if(restriction&&restriction.length&&usergroups.indexOf(restriction[0])===-1){return;}var i18n={ar:'نقل',az:'Adını dəyiş','be-tarask':'Перайменаваць',bn:'স্থানান্তর',ca:'Canvia el nom',cs:'Přesunout',de:'Verschieben',en:'Move',es:'Trasladar',fa:'انتقال',fr:'Renommer',gl:'Mover',hr:'Premjesti',it:'Rinomina',ja:'移動',kk:'Атауын өзгерту',ko:'이동',ml:'തലക്കെട്ട് മാറ്റുക',nl:'Hernoemen',pl:
////////////////////////////////////////////////////////////////////
'Przenieś',pt:'Mover',ro:'Redenumire',ru:'Переименовать',sk:'Premenovať',sv:'Flytta',th:'เปลี่ยนชื่อ (ย้าย)',tr:'Taşı',uk:'Перейменувати',yue:'搬','zh-hant':'移動'},i18nP={ar:'جارٍ تحميل السكريبت',az:'Skript yüklənir','be-tarask':'Загрузка скрыпта',bn:'স্ক্রিপ্ট লোড হচ্ছে',ca:'S’està carregant l’script',cs:'Nahrávám skript',de:'Programmcode laden',en:'Loading script',es:'Cargando la secuencia de órdenes',fa:'بارگیری اسکریپت',fr:'Chargement',gl:'Cargando o script',hr:'Učitavanje skripte',id:'Memuat skrip',it:'Caricamento script in corso',kk:'Скрипт жүктелуде',ko:'스크립트 로딩 중',ml:'സ്ക്രിപ്റ്റ് തയ്യാറാക്കുന്നു.',nl:'Script laden',pl:'Ładowanie skryptu',pt:'Carregando script',ro:'Se încarcă scriptul',ru:'Загрузка скрипта',sk:
// Run things
'Skript sa načítava',sv:'Laddar skript',th:'กำลังโหลดสคริปต์',tr:'Betik yükleniyor',uk:'Завантаження скрипта',yue:'喺度搞緊代碼……唔該等陣……','zh-hant':'載入腳本'};function onClickToStart(e){e.preventDefault();mw.loader.using(['jquery.ui']).then(function(){AjaxQuickDelete.showProgress(i18nP[userlang]||i18nP[userlang.split('-')[0]]||i18nP.en);});if(!window.rRename){mw.loader.load('/w/index.php?title=MediaWiki:RenameRequest.js&action=raw&ctype=text/javascript');}mw.hook('aqd.renamerequest.run').fire('start');}$(function(){mw.hook('aqd.renamerequest.i18n').fire(i18n);for(var i=0;i<maincats.length;i++){if(cats.indexOf(maincats[i])!==-1){$('#renameChange').show().find('a').on('click',onClickToStart);return;}}if(usergroups.indexOf('sysop')+usergroups.indexOf('filemover')===-2){$(mw.util.addPortletLink('p-cactions','#',i18n[userlang]||i18n[userlang.split('-')[0]]||i18n.en,'ca-rename','Request renaming this file.','m'))
////////////////////////////////////////////////////////////////////
.on('click',onClickToStart);}});}(jQuery,mediaWiki));});mw.loader.implement("ext.gadget.RotateLink@n9va4",function($,jQuery,require,module){$(function(){'use strict';var ext,$fileinfo,i18n,title=new mw.Title(mw.config.get('wgPageName'));if(!title||mw.user.isAnon()||title.getNamespaceId()!==mw.config.get('wgNamespaceIds').file||['ogg','oga','ogv','opus','webm','mid','svg','pdf','djvu','stl'].indexOf(ext=title.getExtension()&&title.getExtension().toLowerCase())!==-1||(Array.isArray(title=window.rotateFileTypes)&&title.indexOf(ext)===-1)||((ext=mw.config.get('wgRestrictionEdit'))&&ext.length&&mw.config.get('wgUserGroups').indexOf(ext[0])===-1)||(mw.config.get('wgUserEditCount')<16&&$('#mw-imagepage-section-filehistory tr:last > td:last').prev('td').find('a').eq(0).text()!==mw.config.get('wgUserName'))){return;}function loadAndStart(e){e.preventDefault();if(window.rRot){$(document).triggerHandler('rotaterequest',['start']);}else{$(document).on('scriptLoaded',function(evt,d){if(d&&d==='rotaterequest'){$(this).triggerHandler(d,['start']);}});mw.

loader.load('/w/index.php?title=MediaWiki:RotateRequest.js&action=raw&ctype=text/javascript');}}if((ext=mw.config.get('wgCategories')).indexOf('Images requiring rotation')!==-1||ext.indexOf('Images requiring rotation by bot')!==-1){$('#rotateChangeAngle').show().on('click','a',loadAndStart);return;}$fileinfo=$('#mw-content-text .fileInfo');if(!$fileinfo.length){return;}i18n={ar:'طلب تدوير',ca:'demana girar-la',cs:'vyžádat otočení',da:'Anmod om rotation',de:'Bild drehen',el:'θέλει περιστροφή;',en:'request rotation',es:'solicitar la rotación',fa:'درخواست چرخش',fr:'demander la rotation',gl:'solicitar a rotación',hr:'zahtjev za okretanjem slike',it:'richiedi rotazione',ja:'画像の回転を依頼',mk:'побарај свртување',ml:'തിരിക്കാൻ നിർദ്ദേശിക്കുക',nl:'Rotatie aanvragen',pl:'Obróć grafikę',pt:'Solicitar rotação',ro:'Cerere de rotaţie',ru:'запросить поворот',sl:
addOnloadHook(setupPopups);
'zahteva za zasuk',sr:'захтевање ротације',sv:'Begär rotation',uk:'запит на обертання',zh:'请求旋转','zh-hant':'請求旋轉','zh-hk':'請求旋轉','zh-mo':'請求旋轉','zh-tw':'請求旋轉'};ext=mw.config.get('wgUserLanguage');$fileinfo.append('; ',$('<a>').attr({href:'#',style:'white-space:nowrap; display:inline-block;',title:'Request a (permanent) correction of the rotation if the thumbnails display in the wrong orientation. Please try to purge the server’s and client’s cache before if this file is an upload before middle of October 2011.'}).on('click',loadAndStart).append('(',$('<img>').prop('src','//upload.wikimedia.org/wikipedia/commons/7/70/Silk_arrow_rotate_clockwise.png'),i18n[ext]||i18n[ext.split('-')[0]]||i18n.en,')'));});});mw.loader.implement("ext.gadget.Slideshow@1xjr7",function($,jQuery,require,module){var launch=function(){'use strict';if(!mw.util.$content){return;}var getMessage,$c=mw.util.$content.parent();if(mw.libs.GallerySlideshowLoader){mw.log('Duplicate slideshow inclusion detected.');return;}mw.libs.GallerySlideshowLoader=launch;if($('.gallery',$c).find('li').length<2||mw.config.get('wgNamespaceNumber')===-1||mw.util.getParamValue('printable'))return;var msgs=(function(){var translations={en:{"gs-label-start":"Slideshow (all images)","gs-label-gallery":"Gallery Slideshow","gs-label-started":"Show Slideshow","gs-label-category":"Category Slideshow","gs-label-continue":"Resume","gs-title-start":"Start a slideshow of all images (alphabetical by file name)","gs-title-gallery":"Start a slideshow made from the images in the gallery of this page","gs-title-started":"Reopen slideshow pane","gs-title-category":

"Start a category slideshow (alphabetical by sortkey, starting with the first file of the category)","gs-title-continue":"Continue Slideshow where you had left it last time you visited this page."},cs:{"gs-label-start":"Prezentace (všechny obrázky)","gs-label-gallery":"Prezentace galerie","gs-label-started":"Zobrazit prezentaci","gs-label-category":"Prezentace kategorie","gs-label-continue":"Pokračovat","gs-title-start":"Spustit prezentaci všech obrázků (abecedně podle jména souboru)","gs-title-gallery":"Spustit prezentaci všech obrázků v galerii na této stránce","gs-title-started":"Znovuotevřít panel s prezentací","gs-title-category":"Spustit prezentaci kategorie (abecedně podle řadicího klíče počínaje prvním souborem v kategorii)","gs-title-continue":"Pokračovat v prezentaci od místa, kde jste skončili při poslední návštěvě této stránky."},fa:{"gs-label-start":"اسلایدشو (همه تصاویر)","gs-label-gallery":
/// Local Variables: ///
"اسلایدشو برای نگارخانه","gs-label-started":"نمایش اسلایدشو","gs-label-category":"اسلایدشوی رده","gs-label-continue":"ادامه","gs-title-start":"شروع یک اسلایدشوی برای همهٔ تصاویر (الفبایی بنا به نام پرونده)","gs-title-gallery":"شروع یک اسلایدشوی ساخته\u200cشده از تصاویر نگارخانهٔ این صفحه","gs-title-started":"بازکردن مجدد قاب اسلایدشو","gs-title-category":"شروع یک اسلایدشوی رده (الفبایی مرتب\u200cشده، شروع با اولین پرونده)","gs-title-continue":"ادامهٔ اسلایدشو از آنجایی که دفعهٔ قبلی که این صفحه را بازدید کردید رها کرده\u200cاید."},hr:{"gs-label-start":"Prezentacija (sve slike)","gs-label-gallery":"Prezentacija galerije","gs-label-started":"Započni prezentaciju","gs-label-category":"Prezentacija kategorije"
/// mode:c ///
,"gs-label-continue":"Nastavi","gs-title-start":"Započni prezentaciju svih slika (abecedno prema imenu)","gs-title-gallery":"Započni prezentaciju slika u galeriji na ovoj stranici","gs-title-started":"Ponovno otvori prezentaciju","gs-title-category":"Započni prezentaciju kategorije (abecedno prema ključu za sortiranje počevši s prvom datotekom u kategoriji)","gs-title-continue":"Nastavi prezentaciju prekinutu prilikom zadnjeg posjeta ovoj stranici."},it:{"gs-label-start":"Presentazione (tutte le immagini)","gs-label-gallery":"Presentazione della galleria","gs-label-started":"Mostra la presentazione","gs-label-category":"Presentazione della categoria","gs-label-continue":"Ricomincia","gs-title-start":"Inizia una presentazione di tutte le immagini (in ordine alfabetico)","gs-title-gallery":"Inizia un presentazione composta dalle immagini della galleria di questa pagina","gs-title-started":"Riapri il pannello di presentazione","gs-title-category":
/// End: ///
"Inizia una presentazione della galleria (in ordine alfabetico, partendo dal primo file della categoria)","gs-title-continue":"Continua la presentazione da dove l'hai lasciata l'ultima volta che hai visitato questa pagina."},ml:{"gs-label-start":"സ്ലൈഡ്ഷോ (എല്ലാ ചിത്രങ്ങളും)","gs-label-gallery":"ചിത്രശാല സ്ലൈഡ്\u200cഷോ","gs-label-started":"സ്ലൈഡ്\u200cഷോ പ്രദർശിപ്പിക്കുക","gs-label-category":"വർഗ്ഗത്തിന്റെ സ്ലൈഡ്\u200cഷോ","gs-label-continue":"പുനരാരംഭിക്കുക","gs-title-start":"എല്ലാ ചിത്രങ്ങളുടേയും സ്ലൈഡ്\u200cഷോ തുടങ്ങുക (ചിത്രങ്ങളുടെ പേരുകളുടെ അക്ഷരമാലാക്രമത്തിൽ)","gs-title-gallery":
// ENDFILE: main.js
"ഈ താളിലെ ചിത്രശാലയിലെ ചിത്രങ്ങളുടെ സ്ലൈഡ്\u200cഷോ തുടങ്ങുക","gs-title-started":"സ്ലൈഡ്\u200cഷോ കളം വീണ്ടും തുറക്കുക","gs-title-category":"വർഗ്ഗത്തിന്റെ സ്ലൈഡ്\u200cഷോ തുടങ്ങുക (സോർട്ട്\u200cകീ ഉപയോഗിച്ചുള്ള അക്ഷരമാലാക്രമത്തിൽ, വർഗ്ഗത്തിലെ ആദ്യപ്രമാണം മുതൽ)","gs-title-continue":"ഈ താളിൽ താങ്കൾ കഴിഞ്ഞ പ്രാവശ്യം നിർത്തിയിടത്ത് നിന്ന് സ്ലൈഡ്\u200cഷോ തുടരുക."},pt:{"gs-label-start":"Slideshow (todas as imagens)","gs-label-gallery":"Slideshow da Galeria","gs-label-started":"Mostrar Slideshow","gs-label-category":"Slideshow da Categoria",
// STARTFILE: actions.js
"gs-label-continue":"Reiniciar","gs-title-start":"Iniciar uma apresentação de todas as imagens (por ordem alfabética)","gs-title-gallery":"Iniciar uma apresentação a partir das imagens da galeria desta página","gs-title-started":"Reabrir painel de apresentação","gs-title-category":"Iniciar uma apresentação da galeria (por ordem alfabética, iniciando com o primeiro ficheiro da categoria)","gs-title-continue":"Continue a apresentação de onde parou na última vez que visitou esta página."}},languageNameParts=mw.config.get('wgUserLanguage').split('-'),lang;translations.no=translations.nb;if(languageNameParts[1]==='hans'||languageNameParts[1]==='cn'||languageNameParts[1]==='sg'||languageNameParts[1]==='my'){lang='zh-hans';}else if(languageNameParts[1]==='hant'||languageNameParts[1]==='hk'||languageNameParts[1]==='tw'||languageNameParts[1]==='mo'){lang='zh-hant';}else if(translations[languageNameParts[0]]){lang=languageNameParts[0];}else{lang='en';}return $.extend(true,
function setupTooltips(container, remove) {
translations.en,translations[lang]);}());mw.messages.set(msgs);getMessage=function(msg){msg=mw.message('gs-'+msg);return(msg.exists()?msg.toString():msg);};mw.loader.using(['jquery.cookie','mediawiki.util','jquery.ui','jquery.hoverIntent'],function(){var isCategory=mw.config.get('wgNamespaceNumber')===14,$gButtons=$('<div>',{id:'GallerySlideStartButtons'}),$gButtonsInner=$('<div>',{id:'GallerySlideStartButtonsInner'}).appendTo($gButtons);if(isCategory){$('#mw-category-media',$c).prepend($gButtons);}else{$(mw.util.$content,$c).find('#firstHeading').before($gButtons);}var startSlideshow=function(o,cont,screenread){if(!o)return;if(cont)o.cont=cont;if(screenread){o.readFromScreen=true;o.remoteUse=true;}o.start();};var loadSlideshowAndStart=function(cont,screenread){$startButton.button({label:getMessage('label-started')}).attr('title',getMessage('title-started'));if('object'===typeof window.GallerySlide){startSlideshow(window.GallerySlide,cont,screenread);}else{$(document).on('slideshow',
log('setupTooltips, container='+container+', remove='+remove);
function(e,st,o){if('codeLoaded'===st&&o){startSlideshow(o,cont,screenread);}});window.importScriptURI(mw.config.get('wgServer')+mw.config.get('wgScript')+'?'+$.param({title:'MediaWiki:GallerySlideshow.js',action:'raw',ctype:'text/javascript',dummy:9}));}};var createButton=function(type,msg){return $('<button>',{role:'button',id:'GallerySlide'+type,title:getMessage('title-'+(msg||type)),text:getMessage('label-'+(msg||type))});},$startButton=createButton('start',isCategory?'category':'gallery').button({icons:{secondary:'ui-icon-slideshow'}}).addClass('ui-button-green').click(function(){if(isCategory){loadSlideshowAndStart();}else{loadSlideshowAndStart(0,true);}});if($('#mw-category-media .gallery',$c).prevAll('a').length){$gButtonsInner.append(createButton('gallery').button({icons:{primary:'ui-icon-image'}}).click(function(){loadSlideshowAndStart(0,true);}));}var lastQuery=$.cookie('gs'+mw.config.get('wgPageName').replace('Category:','1:').replace('Commons:','2:'));if(lastQuery){
if (!container) {
$gButtonsInner.append(createButton('continue').button({icons:{primary:'ui-icon-seek-next'}}).click(function(){loadSlideshowAndStart(lastQuery);}));}$startButton.appendTo($gButtonsInner);$gButtons.buttonset();$(document).triggerHandler('slideshow',['loadedInstaller',$gButtons]);var autoStart=mw.util.getParamValue('gsAutoStart');if(({'1':1,'true':1,'yes':1,'-1':1}[autoStart])){loadSlideshowAndStart();}var $buttons=$gButtons.find('button'),_switchToIcon=function($b){$b.removeClass('ui-button-text-icon-secondary').removeClass('ui-button-text-icon-primary').addClass('ui-button-icon-only');};$buttons.each(function(i,b){var $b=$(b),oldClass=$b.attr('class'),$t=$b.find('span.ui-button-text'),tw=$t.width();$b.hoverIntent(function(){var hasOldClass=false;$t.stop(true).delay(200).animate({width:tw,opacity:1},{duration:'fast',easing:'linear',step:function(){if(hasOldClass)return;$b.attr('class',oldClass);hasOldClass=true;}});},function(){$t.delay(800).animate({width:0,opacity:0},function(){
//<NOLITE>
_switchToIcon($b);});});_switchToIcon($b);$t.width(0).fadeTo(0,0);});});};$(function(){mw.hook('wikipage.content').add(launch);});},{"css":[
// the main initial call
"#content \u003E #GallerySlideStartButtons{font-size:80%}#GallerySlideStartButtons{float:right;white-space:nowrap;position:relative}#GallerySlideStartButtons span.ui-button-text{overflow:hidden}#GallerySlideStartButtonsInner{position:relative;left:-4px} @media print{#GallerySlideStartButtons{display:none !important}} .ui-button .ui-icon-slideshow{background-repeat:no-repeat;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHAAAAAQCAYAAADOFPsRAAAACXBIWXMAAA7DAAAOwwHHb6hkAAADQklEQVRYhe2Y32tSYRjHTyyCGLE7r7oq8lgkCwTvdhX+BeI/oOeo3WweNrZpo2LdzLYgrNVFdOFU1o6xii67CPJCugghGcwpmbalCdVya7Ef55y+53jOcJtsbus9wvCBD+/zvox9X/lwXl8PRbXr5JbL7UowHmamVfmSJCVAy/IpXyQBWpZPB/gE7Y8fPZ9xMwVZ4n/c06EK8gqyxFblQ15Bkdiiov18QZbY1B+73e4uCJOagcRmIapLarJI5FNDfBdkSU1BoC4gH8KkZmj4DzSBY8Gx1fGJ8RWZ4L2gEBwPbmnz0buja6QF5vP5z7lcLitTKBQ2wZo2X1pa+kpa4JuFkvS++KMhTz7kiAt8lfsuvV382ZCnH/MHCww9DP2efDy5LINeCD0KbWrzifsTK6yHXSPxATSBc6hPamUymY35+flVbZ7NZhdEUfxDIl8TuPh3Q6piH41IfvslnemPEfn8msA55H9BViPelZalqyMvGue3BbYFHqvaAtsCj1cnRSAEbYF1BS8rYhS1uR63UAjaAn9lBEHAIAraXI9b6On+mNA5NL1e47nYOTgtanM9bqFXRuJC9+3ZdYU7L8XuW7OiNt/3FupwODoYhrHUg9+AJYZlUvVrLMteI/EB4KUDWHZRAqlda0TyKQffQfXGLDvoi5QoXzS1Y80XI5ZvGuYt9UBWCaTq1y4F+ObylSeSZcoujyvNcdxZIpvep9QnsgzSQPf82hMZLYM0xfG658tPpNHPl01+Pn3+KPmQF8ZxWcVYgcQHBPa4b0FaWP3qqQDd83FUhikuUsVYAbrnm4ZnwrQ/XoXECj3MHy4fx6Qd8jKgyHiYpDxC4nVCe91TEGYHGVCU7w7qqFs+jk47pGUo31SR6osmlbE3qls+5NlxdGboAF80BWaS6IvGQLy5fK/Xa4CwssvrsmrvQiHRJvdOp/Mc4b3L8gzq0WmV1HehwKb2xPOpgSkD5JUpLmbdfhfaF7Ep/eAz4vkXB2YN8tFpvMlbtXehlwO8TekHXx+cr15meuQe34Nm5w0nLffq2imy29++zPSovRnQat8DiOcrlxkuouRTXNQMeXStl9f0yTf640q+aYg30yO8kl9b25v/D7228kP7LK3bAAAAAElFTkSuQmCC) !important}.ui-state-default .ui-icon-slideshow{background-position:-96px 0;width:16px;height:16px}.ui-state-hover .ui-icon-slideshow{background-position:-64px 0;width:16px;height:16px}.ui-state-active .ui-icon-slideshow{background-position:0 0;width:16px;height:16px}.skin-vector .ui-state-error .ui-icon-slideshow,.skin-vector .ui-button-red .ui-icon-slideshow,.skin-vector .ui-button-green .ui-icon-slideshow,.skin-vector .ui-button-blue .ui-icon-slideshow,.skin-vector .ui-button-orange .ui-icon-slideshow{background-position:-32px 0;width:16px;height:16px}#SlideContainer{width:100%;height:0px;background:#3B3B3B;position:fixed;top:0px;left:0px;z-index:1002;line-height:2em;font:small sans-serif}#GallerySlideHelpSplash{display:block;position:fixed;border:1px solid #000;background:#DDD;max-width:350px;z-index:1005}.cat-label,.license-label{border:#AAA solid 1px;padding:2px;white-space:nowrap}.cat-label{background:#000;color:#EEE;border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px;-o-border-radius:4px;-ms-border-radius:4px}.cat-label:visited{color:#5695FD}.license-label{color:gray;display:inline-block}.gs-author-label,.gs-date-label,.gs-uploader-label{font-weight:bold;display:inline-block;min-width:75px}.cat-wrap,.license-wrap{font-size:0.5em;margin-left:2px;margin-top:10px;line-height:2em}.digit-separator{font-size:70%;font-weight:100} .gs-play{background:url(//upload.wikimedia.org/wikipedia/commons/0/07/Gnome-media-playback-sprite.png) no-repeat top left} .gs-play-bwd{background-position:5px 5px;width:35px;height:35px} .gs-play-fwd{background-position:-40px 5px;width:35px;height:35px} .gs-play-pause{background-position:-85px 5px;width:35px;height:35px} .gs-play-play{background-position:-130px 5px;width:35px;height:35px} body.rtl .gs-play-fwd{background-position:5px 5px;width:35px;height:35px} body.rtl .gs-play-bwd{background-position:-40px 5px;width:35px;height:35px} .gs-icon{display:inline-block;background:url(//upload.wikimedia.org/wikipedia/commons/1/11/Slideshow_menu_icon_sprite.png) no-repeat top left} .gs-icon-clock{background-position:0 0} .gs-icon-help{background-position:-32px 0} .gs-icon-keyGo{background-position:-64px 0} .gs-icon-zkey{background-position:-96px 0}.gs-icon-clock,.gs-icon-help,.gs-icon-keyGo,.gs-icon-zkey{height:16px;width:16px}.continue-key-insert,.gs-help-link,.delay-insert{float:right;margin-left:3px;margin-right:3px;display:block}.cont-key-container{word-wrap:break-word;padding:7px 7px 7px 12px;background-color:#EEE;background-position:-93px 50%;font-size:6px;margin-top:10px;display:block}.cont-key-container \u003E a{color:#CCD}.cont-key-container \u003E a:hover{color:#55A}.gs-img-description-desc{background-color:#EEE;margin:10px 0}.gs-img-metrics{color:green}.gs-img-uploader,.gs-img-description,.gs-img-metrics{font-size:0.7em;margin-top:10px}.bar-fwd{right:0;border-radius:2px 0 0 2px ;-webkit-border-radius:2px 0 0 2px ;-moz-border-radius:2px 0 0 2px ;-o-border-radius:2px 0 0 2px }.bar-bwd{left:0;border-radius:0 2px 2px 0;-webkit-border-radius:0 2px 2px 0;-moz-border-radius:0 2px 2px 0;-o-border-radius:0 2px 2px 0}.bar-fwd,.bar-bwd{width:15px;background:#888;overflow:visible;opacity:0.8;-ms-filter:\"progid:DXImageTransform.Microsoft.Alpha(Opacity=80)\";height:100%;position:absolute;top:0;cursor:pointer}.bar-btn-fwd,.bar-btn-bwd{position:relative;display:none;font-size:30px;text-align:center;padding-top:20px;border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px;-o-border-radius:2px;background:#888;z-index:1006;width:40px;height:56px;cursor:pointer;top:45%}.bar-btn-fwd{left:-30px }.slideshow-close-button{border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px;-o-border-radius:2px;text-align:center;background:#888;z-index:1019;width:50px;height:40px;position:relative;top:0;left:-30px;font-size:30px}ul.com-gs-thumbs a.com-gs-thumb{overflow:hidden;width:75px;height:75px}div.slideshow-container,div.slideshow{height:100%}div.slideshow{position:relative;display:block;vertical-align:top}div.loader,div.slideshow a.advance-link,.caption-container{width:100%}div.loader,div.slideshow a.advance-link{display:none}div.content{clear:both}div.content a:hover,div.content a:active{text-decoration:underline}div.controls{margin-top:5px;height:50px}div.controls a{padding:5px;display:inline-block}div.ss-controls{display:inline-block}div.nav-controls{margin:0 auto;width:136px;border:1px solid #2B2B2B;padding:0 15px;border-radius:80px;-webkit-border-radius:80px;-moz-border-radius:80px;-o-border-radius:80px;margin-top:6px;opacity:0.4;-ms-filter:\"progid:DXImageTransform.Microsoft.Alpha(Opacity=40)\";box-shadow:3px 2px 7px rgba(0,0,0,0.3);-moz-box-shadow:3px 2px 7px rgba(0,0,0,0.3);-webkit-box-shadow:3px 2px 7px rgba(0,0,0,0.3);-o-box-shadow:3px 2px 7px rgba(0,0,0,0.3);background:#666;background-image:-o-linear-gradient(bottom,rgb(77,77,77) 0%,rgb(171,171,171) 100%);background-image:-moz-linear-gradient(bottom,rgb(77,77,77) 0%,rgb(171,171,171) 100%);background-image:-webkit-gradient(linear,left bottom,left top,from(rgb(77,77,77)),to(rgb(171,171,171)));background-image:-webkit-linear-gradient(bottom,rgb(77,77,77) 0%,rgb(171,171,171) 100%);background-image:-ms-linear-gradient(bottom,rgb(77,77,77) 0%,rgb(171,171,171) 100%);background-image:linear-gradient(bottom,rgb(77,77,77) 0%,rgb(171,171,171) 100%)}span.image-wrapper img{width:100%}div.other-controls{float:right;margin-top:-25px;-ms-filter:\"progid:DXImageTransform.Microsoft.Alpha(Opacity=60)\";opacity:0.6} div.loader{position:absolute;top:0;left:0;background-repeat:no-repeat;background-position:center;height:100%;background-image:url(//upload.wikimedia.org/wikipedia/commons/1/1b/Ajax-loader-dark.gif)}div.slideshow span.image-wrapper{display:block;position:absolute;top:0;left:0}div.slideshow a.advance-link{display:block;text-align:center}div.slideshow a.advance-link:hover,div.slideshow a.advance-link:active,div.slideshow a.advance-link:visited,div.content a,div.navigation a{text-decoration:none}div.caption-container{font-size:1.5em;width:20%;min-width:180px;max-width:320px;position:relative;display:inline-block;vertical-align:top}span.image-caption{display:block;z-index:1003;overflow:auto;position:absolute;width:100%;background:#DDD;padding:10px}.slideshow-container div.caption{padding:0 12px}div.image-title{font-weight:700;font-size:1.4em}div.image-desc{line-height:1.3em;padding-top:12px}div.download{margin-top:8px}#com-gs-thumbs.navigation,.slideshow-container,div.controls{overflow:hidden;margin:0 25px}ul.com-gs-thumbs{position:relative;margin:0;padding:0;left:0;height:80px;width:10000px;overflow:hidden}ul.com-gs-thumbs li,ul.com-gs-thumbs{display:inline-block;zoom:1;display:inline!ie}ul.com-gs-thumbs li{padding:0;margin:2px;list-style:none}a.com-gs-thumb{padding:1px;display:block}a.com-gs-thumb:focus,div.slideshow a.advance-link:focus{outline:none}ul.com-gs-thumbs img{border:none;display:block}"
if (getValueOf('popupOnEditSelection') && window.doSelectionPopup ) {
]});mw.loader.implement("ext.gadget.Stockphoto@1q545",function($,jQuery,require,module){(function(){'use strict';var stockPhoto,modalLoad;if(window.stockPhoto||!/^(?:vector|monobook|timeless)$/.test(mw.config.get('skin'))||mw.config.get('wgCanonicalNamespace')!=='File'||mw.config.get('wgAction')!=='view'){return;}function File(opt){var re,file=this;file.title=opt.pageName.replace(/^[^:]+:|\.[^.]+$/g,'').replace(/_+/g,' ');file.url=opt.originalUrl;file.backlink='https://commons.wikimedia.org/wiki/'+mw.util.wikiUrlencode(opt.pageName);re=new RegExp('\\.(?:'+stockPhoto.audio_only.map(mw.RegExp.escape).join('|')+')$','i');file.audio=re.test(opt.pageName);this.gfdlNote=false;this.attrRequired=true;this.computeMetadata(opt.dom,opt.$licenses);}File.prototype.getLicenseLabel=function(short){if(/^cc[- ]/i.test(short)){return short.toUpperCase().replace(/^(CC)-/,'$1 ').replace(/[- ]([\d.]+)$/,' $1');}return short;};File.prototype.getLicensePrio=function(short){return/^(public domain|cc0)/i.test(
try {
short)?1:/^cc[- ]by(-sa)?[- ]\d/i.test(short)?2:3;};File.prototype.computeMetadata=function(dom,$licenses){var credit,creditHtml,attribution,licenses,via=stockPhoto.i18n.via_wikimedia_commons,file=this,author=dom.$aut.text().trim(),source=dom.$src.text().trim();if(dom.$aut.find('.boilerplate').length){author='';}if(author.match(/^[Uu]nknown$/)){author='';}author=author.replace(/\s*\(talk\)$/i,'');if(author.indexOf('Original uploader was')!==-1){author=author.replace(/\s*Original uploader was\s*/g,'');}if(author.slice(0,3)==='[&#9660;]'){author=author.slice(3);author=author.split('Description')[0].trim();}if(dom.$src.find('.boilerplate').length){source='';}if(dom.$src.find('.int-own-work').length){source='';}if(!author&&source.length<50){author=source;}licenses=[];$licenses.each(function(){var $tpl=$(this),short=$tpl.find('.licensetpl_short').text().trim();if(!short){return;}licenses.push({link:$tpl.find('.licensetpl_link').text().trim(),short:short,label:file.getLicenseLabel(short),
document.editform.wpTextbox1.onmouseup=function() { doSelectionPopup(); };
prio:file.getLicensePrio(short),link_req:$tpl.find('.licensetpl_link_req').text().trim(),attr_req:$tpl.find('.licensetpl_attr_req').text().trim()});});licenses.sort(function(a,b){return a.prio-b.prio;});if(licenses[0]&&licenses[0].prio<3){licenses.splice(1);}file.licenses=licenses.map(function(v){if(v.attr_req==='false'){file.attrRequired=false;}if(v.short.indexOf('GFDL')!==-1){file.gfdlNote=true;}if(v.link_req==='true'&&v.link){return{html:'<a href="'+v.link+'">'+mw.html.escape(v.label)+'</a>',txt:v.label+' <'+v.link+'>'};}else{return{html:mw.html.escape(v.label),txt:v.label};}});if(dom.$credit.length){credit=dom.$credit.text();creditHtml=dom.$credit.html();}if(!credit){if(dom.$attr.length){attribution=dom.$attr.text();}else if(dom.$licenseAut.length){attribution=dom.$licenseAut.text();}else if(dom.$creator.length){attribution=dom.$creator.text();}if(!attribution){attribution=(author||stockPhoto.i18n.see_page_for_author);}credit=attribution+file.getLicense()+', '+via;creditHtml=mw.
} catch (neverMind) {}
html.element('a',{href:file.backlink},attribution)+file.getLicense(true)+', '+mw.html.escape(via);}file.credit=credit;file.creditHtml=creditHtml;};File.prototype.getLicense=function(useHtml){var l1,l2,licenses=this.licenses.map(function(l){return useHtml?l.html:l.txt;});if(!licenses.length){return', '+stockPhoto.i18n.see_page_for_license;}if(licenses.length===1){return', '+licenses[0];}if(licenses.length>=2){l2=licenses.pop();l1=licenses.pop();licenses.push(l1+' '+stockPhoto.i18n.or+' '+l2);}return' ('+licenses.join(', ')+')';};stockPhoto={ui_icon_download:'https://upload.wikimedia.org/wikipedia/commons/thumb/9/92/Gnome-document-save.svg/50px-Gnome-document-save.svg.png',ui_icon_web:'https://upload.wikimedia.org/wikipedia/commons/thumb/c/c0/Gnome-emblem-web.svg/50px-Gnome-emblem-web.svg.png',ui_icon_wiki:'https://upload.wikimedia.org/wikipedia/commons/thumb/2/2c/Tango_style_Wikipedia_Icon.svg/50px-Tango_style_Wikipedia_Icon.svg.png',ui_icon_email:
}
'https://upload.wikimedia.org/wikipedia/commons/thumb/e/ee/Gnome-mail-send.svg/50px-Gnome-mail-send.svg.png',ui_icon_help:'https://upload.wikimedia.org/wikipedia/commons/thumb/e/e7/Dialog-information_on.svg/50px-Dialog-information_on.svg.png',ui_icon_remove:'https://upload.wikimedia.org/wikipedia/commons/thumb/9/9d/Emblem-unreadable.svg/20px-Emblem-unreadable.svg.png',information_template_hints:['fileinfotpl_desc','fileinfotpl_src'],audio_only:['midi','ogg','flac'],horizontal_ui:['midi','ogg','flac','pdf','djvu'],ogg_icon:'/w/resources/assets/file-type-icons/fileicon-ogg.png',init:function(){var $enable,$orgItems,has_information,$imgBox,xoff,yoff,horizontal,html,$base,re;$orgItems=$('#filetoc').find('a[href="#file"], a[href="#filehistory"], a[href="#filelinks"], a[href="#metadata"], a[href="#globalusage"]').parent();if($.cookie('StockPhotoDisabled')){$enable=$('<li>').append($('<a href="#"></a>').text(stockPhoto.i18n.reuse)).click(function(e){e.preventDefault();$(this).remove();$.
//</NOLITE>
cookie('StockPhotoDisabled',null,{path:'/'});stockPhoto.init();});$('#filetoc').append($enable);$orgItems=$orgItems.add($enable);return;}if(!$('#file').length){return;}has_information=stockPhoto.information_template_hints.some(function(v){return document.querySelector('#'+v);});if(!has_information){return;}if(document.querySelector('.nuke')){return;}$imgBox=$('.multipageimage, #file img,#file .mediaContainer');xoff=$imgBox.width()+40;yoff=$('#file').position().top+5;stockPhoto.small_horizontal_layout=(!mw.user.isAnon()||($imgBox.height()<300));re=new RegExp('\\.(?:'+stockPhoto.horizontal_ui.map(mw.RegExp.escape).join('|')+')$','i');horizontal=(stockPhoto.small_horizontal_layout||re.test(mw.config.get('wgTitle'))||(document.documentElement.clientWidth<1030));stockPhoto.share_this(-1);html='<div class="';html+=(horizontal?'stockphoto-layout-horizontal':'stockphoto-layout-vertical');html+=(stockPhoto.small_horizontal_layout?' stockphoto-layout-horizontal-small':'');html+='"';if(!
// article/content is a structure-dependent thing
horizontal){if(document.querySelector('body.rtl')){html+=' style="right: '+xoff+'px; top:'+yoff+'px;"';}else{html+=' style="left: '+xoff+'px; top:'+yoff+'px;"';}}html+='></div>';$base=$(html).append(stockPhoto.add_button_row(stockPhoto.ui_icon_download,stockPhoto.call_download,stockPhoto.i18n.download,stockPhoto.i18n.all_sizes),stockPhoto.add_button_row(stockPhoto.ui_icon_web,stockPhoto.call_web,stockPhoto.i18n.use_this_file_web_short,stockPhoto.i18n.on_a_website),stockPhoto.add_button_row(stockPhoto.ui_icon_wiki,stockPhoto.call_wiki,stockPhoto.i18n.use_this_file_wiki_short,stockPhoto.i18n.on_a_wiki),stockPhoto.add_button_row(stockPhoto.ui_icon_email,'mailto:?subject='+encodeURIComponent(stockPhoto.file.title)+'&body='+encodeURIComponent(stockPhoto.file.backlink+'\n\n'+stockPhoto.file.credit),stockPhoto.i18n.email_link_short,stockPhoto.i18n.to_this_file),stockPhoto.add_button_row(stockPhoto.ui_icon_help,mw.util.getUrl('Special:MyLanguage/Commons:Reusing_content_outside_Wikimedia'),
container = defaultPopupsContainer();
stockPhoto.i18n.information,stockPhoto.i18n.about_reusing),$('<span class="stockphoto_buttonrow"><a title="'+stockPhoto.i18n.remove_icons+'" class="stockphoto_buttonrow_icon"><img src="'+stockPhoto.ui_icon_remove+'"></a></span>').click(function(){$.cookie('StockPhotoDisabled',true,{expires:60,path:'/'});$base.remove();$orgItems.show();}));if(stockPhoto.small_horizontal_layout){$orgItems.hide();$('#filetoc').append($base);}else{$('#filetoc').after($base);}},add_button_row:function(icon_url,fn,txt,html){var ret,size=50;if(stockPhoto.small_horizontal_layout){size=20;}var realSize=size;if(window.devicePixelRatio>1.0){realSize*=2;}icon_url=icon_url.replace('/50px-','/'+realSize+'px-');ret=document.createElement(typeof fn==='string'?'a':'span');ret.className='stockphoto_buttonrow';ret.title=txt+' '+html;if(typeof fn==='string'){ret.href=fn;}else{ret.role='button';ret.tabIndex=0;ret.onclick=fn;}ret.innerHTML='<span class="stockphoto_buttonrow_icon"><img width="'+size+'" height="'+size+
}
'" src="'+icon_url+'"></span>'+'<span class="stockphoto_buttonrow_text"><a>'+txt+'</a><small>'+html+'</small></span>';return ret;},stockphoto_get_thumbnail_url:function(width){var thumb_url,alt_title,last;if(stockPhoto.file.audio){return stockPhoto.ogg_icon;}alt_title=mw.config.get('wgCanonicalNamespace')+':'+mw.config.get('wgTitle');$('#file img').each(function(){var i=this.alt;if(i&&i!==alt_title){return;}thumb_url=this.src.split('/');});if(!thumb_url&&$('.mwEmbedPlayer img').length){return $('.mwEmbedPlayer img').attr('src');}if(!thumb_url||!thumb_url.length)return;last=thumb_url.pop().replace(/^\d+px-/,width+'px-').split('?')[0];thumb_url.push(last);thumb_url=thumb_url.join('/');return thumb_url;},is_audio_video_asset:function(url){return/(ogv|ogg|oga|ebm|wav)$/.test(url.slice(-3));},make_html_textarea:function(){var width,type,height,thumb_url,t;width=$('#stockphoto_html_select').val();type=$('input[name="stockphoto_code_type"]:checked').val();if(stockPhoto.is_audio_video_asset(

stockPhoto.file.backlink)&&type==='html'){height=$('.mwEmbedPlayer').length?width*$('.mwEmbedPlayer').height()/$('.mwEmbedPlayer').width():width*$('#file img,#file video').height()/$('#file img,#file video').width();if(height===0){height=20;}$('#stockphoto_html').text('<iframe src="'+stockPhoto.file.backlink+'?embedplayer=yes" width="'+width+'" height="'+height+'" frameborder="0" ></iframe>');return;}thumb_url=stockPhoto.stockphoto_get_thumbnail_url(width);if(type==='html'){t='<a title="'+mw.html.escape(stockPhoto.file.credit)+'" href="'+stockPhoto.file.backlink+'"><img width="'+width+'" alt="'+mw.html.escape(stockPhoto.file.title)+'" src="'+thumb_url+'"></a>';}else if(type==='bbcode'){t='[url='+stockPhoto.file.backlink+'][img]'+thumb_url+'[/img][/url]\n[url='+stockPhoto.file.backlink+']'+stockPhoto.file.title+'[/url]\n'+stockPhoto.file.credit;}$('#stockphoto_html').text(t);},refresh_attribution:function(){$('#stockphoto_attribution').val(stockPhoto.file[this.checked?'creditHtml':
if (!remove && container.ranSetupTooltipsAlready) { return; }
'credit']);},createDialogRow:function(label,prefill,id,prepend,append){var idtext=id?('id="'+id+'"'):'';return'<div class="stockphoto_dialog_row"><b>'+label+':</b><br>'+(prepend||'')+'<input type="text" readonly '+idtext+' onclick="select()" value="'+mw.html.escape(prefill)+'">'+(append||'')+'</div>';},share_this:function(ui_mode){var widths,html,dtitle,dl_links,best_fit,pixelStr,widthSearchMatch,imageWidth,power,i;stockPhoto.file=new File({pageName:mw.config.get('wgPageName'),originalUrl:$('div.fullMedia a').prop('href')||'',dom:{$src:$('#fileinfotpl_src + td'),$aut:$('#fileinfotpl_aut + td'),$attr:$('.licensetpl_attr').eq(0),$credit:$('#fileinfotpl_credit + td'),$creator:$('#creator'),$licenseAut:$('.licensetpl_aut').eq(0)},$licenses:$('.licensetpl')});widths=[];try{pixelStr=$('.fileInfo').contents().get(0).data;widthSearchMatch=/([0-9 ,.\u00a0]+)\s*×/.exec(pixelStr);imageWidth=parseInt(widthSearchMatch[1].replace(/[ ,.\u00a0]/g,''),10);if(isNaN(imageWidth)){throw new Error(
container.ranSetupTooltipsAlready = !remove;
'Cannot parse');}power=Math.floor(Math.log(imageWidth)/Math.log(2));for(i=0;i<5;i++){widths.push(Math.pow(2,power-i));}widths=widths.reverse();}catch(e){widths=[640,800,1024];}if(ui_mode===-1){return;}modalLoad=modalLoad||mw.loader.using('jquery.ui');html='';html+=stockPhoto.createDialogRow(stockPhoto.i18n.page_url,stockPhoto.file.backlink);html+=stockPhoto.createDialogRow(stockPhoto.i18n.file_url,stockPhoto.file.url);html+=stockPhoto.createDialogRow(stockPhoto.i18n.attribution,stockPhoto.file.credit,'stockphoto_attribution','<blockquote class="stockphoto_attribution_preview" onclick="nextSibling.select();return false;">'+stockPhoto.file.creditHtml+'</blockquote>',' <input id="stockphoto_attribution_html" type="checkbox">&nbsp;<label for="stockphoto_attribution_html">'+stockPhoto.i18n.html+'</label>');if(stockPhoto.file.gfdlNote){html+='<span class="stockphoto_note">'+stockPhoto.i18n.gfdl_warning+'</span>';}if(!stockPhoto.file.attrRequired){html+='<br><span class="stockphoto_note">'+

stockPhoto.i18n.no_attr+'</span>';}switch(ui_mode){case 1:dtitle=stockPhoto.i18n.download_this_file;if(stockPhoto.file.url){html+='<div><b>'+stockPhoto.i18n.download_image_file+':</b><br>';dl_links=[];widths.forEach(function(v){if(stockPhoto.file.audio){return;}dl_links.push('<a href="'+stockPhoto.stockphoto_get_thumbnail_url(v)+'" download>'+v+'px</a>');});dl_links.push('<a href="'+stockPhoto.file.url+'" download>'+stockPhoto.i18n.full_resolution+'</a>');if(dl_links.length){html+=dl_links.join(' | ');}else{html+='<i>'+stockPhoto.i18n.not_available+'</i>';}html+='</div>';}break;case 2:dtitle=stockPhoto.i18n.use_this_file_web;html+='<div class="stockphoto_dialog_row"><div style="float: right;">';html+='<input type="radio" name="stockphoto_code_type" value="html" id="stockphoto_code_type_html" onchange="stockPhoto.make_html_textarea();" checked><label for="stockphoto_code_type_html">'+stockPhoto.i18n.html+'</label> ';html+=
var anchors;
'<input type="radio" name="stockphoto_code_type" value="bbcode" id="stockphoto_code_type_bbcode" onchange="stockPhoto.make_html_textarea();"><label for="stockphoto_code_type_bbcode">'+stockPhoto.i18n.bbcode+'</label> ';html+='<select id="stockphoto_html_select" onchange="stockPhoto.make_html_textarea();">';best_fit=75;if(stockPhoto.file.audio){best_fit=120;html+='<option value="120">120'+stockPhoto.i18n.px_wide_icon+'</option>';}else{widths.forEach(function(v){if(v<=$('#file img').width()){best_fit=v;}html+='<option value="'+v+'">'+v+stockPhoto.i18n.px_wide+'</option>';});}html+='</select></div>';html+='<b>'+stockPhoto.i18n.embed_this_file+'</b><textarea onclick="select()" id="stockphoto_html" readonly>';html+='</textarea></div>';break;case 3:dtitle=stockPhoto.i18n.use_this_file_wiki;html=stockPhoto.createDialogRow(stockPhoto.i18n.thumbnail,'[[File:'+mw.config.get('wgTitle')+'|thumb|'+stockPhoto.file.title+']]');html+=stockPhoto.createDialogRow(stockPhoto.i18n.image,'[[File:'+mw.config
anchors=container.getElementsByTagName('A');
.get('wgTitle')+'|'+stockPhoto.file.title+']]');break;}modalLoad.done(function(){$('<div style="display: none;"></div>').html(html).dialog({modal:true,width:610,height:'auto',title:dtitle,close:function(){$(this).remove();}});$('#stockphoto_html_select').val(best_fit);stockPhoto.make_html_textarea();$('#stockphoto_attribution_html').on('change',stockPhoto.refresh_attribution);});},call_download:function(){stockPhoto.share_this(1);},call_web:function(){stockPhoto.share_this(2);},call_wiki:function(){stockPhoto.share_this(3);},i18n:{download:'Download',all_sizes:'all sizes',download_this_file:'Download this file',use_this_file_web_short:'Use this file',on_a_website:'on the web',use_this_file_web:'Use this file on the web',use_this_file_wiki_short:'Use this file',on_a_wiki:'on a wiki',use_this_file_wiki:'Use this file on a wiki',thumbnail:'Thumbnail',image:'Image',email_link_short:'Email a link',to_this_file:'to this file',information:'Information',about_reusing:'about reusing',
setupTooltipsLoop(anchors, 0, 250, 100, remove);
remove_icons:'Remove these icons',reuse:'Reuse this file',via_wikimedia_commons:'via Wikimedia Commons',see_page_for_author:'See page for author',see_page_for_license:'see page for license',page_url:'Page URL',file_url:'File URL',attribution:'Attribution',no_attr:'Attribution not legally required',or:'or',gfdl_warning:'Using this file might require attaching a full copy of the <a href="//en.wikipedia.org/wiki/GNU_Free_Documentation_License">GFDL</a>',download_image_file:'Download image file',full_resolution:'Full resolution',not_available:'not available',share_this_file:'Share this file',embed_this_file:'Embed this file',html:'HTML',bbcode:'BBCode',px_wide_icon:'px wide (icon)',px_wide:'px wide'}};window.stockPhoto=stockPhoto;if(mw.config.get('wgUserLanguage')==='en'){$(stockPhoto.init);}else{$.ajax({url:mw.config.get('wgScript')+'?title='+mw.util.wikiUrlencode('MediaWiki:Gadget-Stockphoto.js/'+mw.config.get('wgUserLanguage'))+'&action=raw&ctype=text/javascript',dataType:'script',
}
crossDomain:true,cache:true}).then(stockPhoto.init);}}());},{"css":[

".stockphoto-layout-vertical{position:absolute;min-width:160px}.stockphoto_buttonrow{cursor:pointer;display:inline-block}a.stockphoto_buttonrow{color:inherit}.stockphoto-layout-vertical .stockphoto_buttonrow{display:flex}.stockphoto-layout-horizontal .stockphoto_buttonrow{margin-left:10px}.stockphoto_buttonrow_icon{opacity:0.7;transform:opacity 0.3 ease}.stockphoto-layout-vertical .stockphoto_buttonrow_icon{display:inline-block;flex:0;margin:0 10px 10px}.stockphoto-layout-horizontal .stockphoto_buttonrow_icon{padding-right:.2em}.stockphoto_buttonrow:hover .stockphoto_buttonrow_icon{opacity:1}.stockphoto_buttonrow_text{display:inline-block;flex:1;vertical-align:middle;text-align:center}.stockphoto-layout-vertical .stockphoto_buttonrow_text a{font-weight:bold}.stockphoto_buttonrow_text small{display:block; font-size:inherit; }.stockphoto-layout-horizontal-small .stockphoto_buttonrow_text small{display:none}.stockphoto_dialog_row{display:block;margin-bottom:15px}.stockphoto_dialog_row input[type=\"text\"],.stockphoto_dialog_row textarea{width:99%}.stockphoto_attribution_preview{margin:0 1em 1em 0;text-align:center;font-size:0.8em}input#stockphoto_attribution{width:88%}.stockphoto_dialog_row textarea{min-height:80px}textarea#stockphoto_html{font-size:90%}.stockphoto_note{display:block;margin-top:-5px;margin-bottom:15px;font-style:italic;font-size:smaller}"
function defaultPopupsContainer() {
]});mw.loader.implement("ext.gadget.WatchlistNotice@s850y",function($,jQuery,require,module){if($.inArray(mw.config.get('wgCanonicalSpecialPageName'),['Watchlist','Userlogin'])>-1||/^Commons:Community_portal/.test(mw.config.get('wgPageName'))){mw.loader.load('ext.gadget.WatchlistNotice.core');}},{"css":["#watchlist-message{display:block !important} #watchlist-message-inner{resize:vertical}"]});mw.loader.implement("ext.gadget.WikiMiniAtlas@8njxm",function($,jQuery,require,module){mw.loader.load('//meta.wikimedia.org/w/index.php?title=MediaWiki:Wikiminiatlas.js&action=raw&ctype=text/javascript&smaxage=21600&maxage=86400');});mw.loader.implement("ext.gadget.ZoomViewer@froaz",function($,jQuery,require,module){if(mw.config.get('wgNamespaceNumber')===6&&mw.config.get('wgAction')==='view'&&!mw.util.getParamValue('diff')){$(document).ready(function(){'use strict';var name=mw.config.get('wgPageName').replace(/_/g,' '),id=$('#file img[alt=\''+name.replace(/'/g,'\\\'')+'\']').data();if(!id){return;}var p=id.fileHeight*id.fileWidth;if(p<2*1024*1024)return;var links=$("<span>",{id:"ZoomViewerLinks",style:"white-space:nowrap; display:inline-block;"}),fileName=name.match(/File:(.+\.jpe?g)/i);if(!fileName){return;}var url="https://zoomviewer.toolforge.org/index.php?f="+encodeURIComponent(fileName[1]),link=$("<a>",{href:url+"&flash=no",text:"ZoomViewer"});links.append("; ",link);$('.fileInfo').after(links);});}});mw.loader.implement("ext.gadget.fastcci@1q3fq",function($,jQuery,require,module){$(function(){var $slider,$link,$controls,depthThreshold,request,modal,serverList=['//fastcci1.wmflabs.org/','//fastcci2.wmflabs.org/'],url=serverList[Math.floor(Math.random()*serverList.length)],base='//upload.wikimedia.org/wikipedia/commons/thumb/',badge=['e/e7/Cscr-featured.svg/24px-Cscr-featured.svg.png','a/a5/FV_invert_logo.png/24px-FV_invert_logo.png','8/8c/Quality_images_logo.svg/24px-Quality_images_logo.svg.png','d/d7/Valued_image_seal.svg/24px-Valued_image_seal.svg.png'],helpUrl='//commons.wikimedia.org/wiki/Special:MyLanguage/Help:FastCCI',helpIcon='4/44/Help-browser.svg/24px-Help-browser.svg.png',$e=$('<div>').addClass('fastcci-results').on('click','.fastcci-close',function(){$e.empty();tagLine('');}),maxDepth=0,minDepth=Infinity,ns=mw.config.get('wgNamespaceNumber'),namespaceIds=mw.config.get('wgNamespaceIds'),action=mw.config.get('wgAction'),thisPageId=mw.config.get('wgArticleId'),uiLang=mw.
if (getValueOf('popupOnlyArticleLinks')) {
config.get('wgUserLanguage'),$content=$('#bodyContent, #mw-content-text').eq(0),$tagline=null,i18nData={'Strong match':{ar:'تطابق قوی',bn:'জোরালো মিল',ce:'Къовламе цхьаьнадогӀуш',cs:'Bližší shoda',de:'Starke Übereinstimmung',fa:'تطابق قوی',fr:'Correspondance forte',hr:'Strogo podudaranje',it:'Corrispondenza forte',mk:'Строго совпаѓање',ml:'നന്നായി ചേർച്ചയുള്ളവ',pt:'Forte correspondência',ru:'Строгое соответствие',sv:'Stark överensstämmelse',zh:'强匹配'},'Weak match':{ar:'تطابق ضعيف',bn:'দুর্বল মিল',ce:'Ледара цхьаьнадогӀуш',cs:'Vzdálenější shoda',de:'Schwache Übereinstimmung',fa:'تطابق ضعیف',fr:'Correspondance faible',hr:'Približno podudaranje',it:'Corrispondenza debole',mk:'Благо совпаѓање',ml:'ചെറുതായി ചേർച്ചയുള്ളവ',pt:
return document.getElementById('article') ||
'Fraca correspondência',ru:'Слабое соответствие',sv:'Svag överensstämmelse',zh:'弱匹配'},'No results.':{ar:'لا نتائج',bn:'কোন ফলাফল নেই',ce:'Хиламаш бац',cs:'Žádné výsledky.',de:'Keine Ergebnisse.',es:'Sin resultados.',fa:'هیچ نتیجه\u200cای.',fr:'Pas de résultats.',hr:'Nema rezultata.',it:'Nessun risultato.',mk:'Нема резултати.',ml:'ഫലങ്ങളൊന്നുമില്ല',pt:'Sem resultados.',ru:'Нет результатов.',sv:'Inga resultat.',tr:'Sonuç yok.',zh:'无结果。'},'Connecting...':{ar:'اتصال...',bn:'সংযোগ হচ্ছে...',ce:'Тасаялар...',cs:'Připojuji se...',de:'Verbinde ...',es:'Estableciendo conexión...',fa:'اتصال...',fr:'Connexion...',hr:'Povezujem se...',it:'Connessione...',mk:'Се поврзувам...',ml:'എടുക്കുന്നു...',pt:'A conectar...',ru:'Соединение...',sv:'Ansluter...',tr:'Bağlanıyor...',
document.getElementById('content') || document;
zh:'连接中...'},'Computing...':{ar:'حساب...',bn:'গণনা চলছে...',ce:'Таллам...',cs:'Pracuji...',de:'Arbeite ...',es:'Calculando...',fa:'محاسبه...',fr:'Calcul...',hr:'Računam...',it:'Calcolo...',mk:'Пресметувам...',ml:'കണക്കാക്കുന്നു...',pt:'A calcular...',ru:'Анализ...',sv:'Beräknar...',tr:'Hesaplanıyor...',zh:'计算中...'},'Digging through NUM files...':{ar:'جارِ البحث عن طريق ملفات NUM...',bn:'NUM ফাইলের মাধ্যমে সন্ধান...',ce:'Файлийн таллам, NUM терахьца ...',cs:'Prohledávám NUM souborů...',de:'Durchsuche NUM Dateien ...',fa:'استخراج از بین NUM پرونده...',fr:'Fouille dans NUM fichiers...',hr:'Pretražujem datoteke (NUM)...',it:'Ricerca nei file NUM...',mk:'Пребарувам по NUM податотеки...',ml:'NUM പ്രമാണങ്ങൾ പരിശോധിക്കുന്നു...',pt:
}
'Procurando por ficheiros NUM...',ru:'Анализ файлов, числом NUM ...',sv:'Gräver genom NUM filer',zh:'已查找了NUM个文件...'},'Waiting in line. NUM ahead of us.':{ar:'انتظار في الطابور. NUM تعمل حالياً.',bn:'লাইনে অপেক্ষারত। আমাদের NUM এগিয়ে',ce:'РогӀехь хьежар. Тхуна хьалхахь — NUM.',cs:'Čekáme na řadu, jsme NUM.',de:'Warte darauf an die Reihe zu kommen. NUM Anfragen vor uns.',fa:'ایستادن در خط. NUM جلوی ما.',fr:'En attente. NUM requêtes devant nous.',hr:'Pričekajte u redu. Broj zahtjeva na čekanju: NUM.',it:'Attendi il tuo turno. Richieste NUM prima di noi.',mk:'Чекам во редица. Пред нас има NUM.',ml:'കാത്തിരിക്കുന്നു. NUM കൂടുതലാണ്.',pt:'Aguarde na fila. NUM à nossa frente.',ru:'Ожидание в очереди. Перед нами — NUM.',sv:
return document;
'Väntar i kö. NUM framför oss.',zh:'队列中,前边有NUM个文件。'},'Advanced...':{ar:'متقدم...',bn:'উন্নত...',ce:'Хьалхадолу...',cs:'Pokročilé...',de:'Erweitert ...',es:'Avanzado...',fa:'پیشرفته...',fr:'Avancé...',hr:'Napredno...',it:'Avanzate...',ml:'വിപുലം...',pt:'Avançado...',ru:'Продвигаемся...',sv:'Avancerat...',tr:'İlerliyor...',zh:'高级...'},'Good pictures':{ar:'صور جيدة',bn:'ভালো চিত্রসমূহ',ce:'Дика суьрташ',cs:'Dobré obrázky',de:'Gute Bilder',es:'Imágenes buenas',fa:'تصاویر خوب',fr:'Bonnes images',hr:'Dobre slike',it:'Immagini belle',mk:'Добри слики',ml:'മികച്ച ചിത്രങ്ങൾ',pt:'Imagens boas',ru:'Хорошие изображения',sv:'Bra bilder',tr:'İyi resimler',zh:'优秀图片'},'All images':{ar:'جميع الصور',bn:'সব চিত্রসমূহ',ce:'Массо суьрташ',cs:
}
'Všechny obrázky',de:'Alle Bilder',es:'Todas las imágenes',fa:'همهٔ تصاویر',fr:'Toutes les images',hr:'Sve slike',it:'Tutte le immagini',mk:'Сите слики',ml:'എല്ലാ ചിത്രങ്ങളും',pt:'Todas as imagens',ru:'Все изображения',sv:'Alla bilder',tr:'Tüm görseller',zh:'全部图像'},'Featured pictures':{ar:'صور مختارة',bn:'নির্বাচিত চিত্রসমূহ',ce:'Хаьржина суьрташ',cs:'Nejlepší obrázky',de:'Exzellente Bilder',es:'Imágenes destacadas',fa:'تصاویر برگزیده',fr:'Images remarquables',hr:'Izabrane slike',it:'Immagini in vetrina',mk:'Избрани слики',ml:'തിരഞ്ഞെടുത്ത ചിത്രങ്ങൾ',pt:'Imagens em destaque',ru:'Избранные изображения',sv:'Utvalda bilder',tr:'Seçkin resimler',zh:'特色图片'},'Featured videos':{ar:'مقاطع الفيديو المميزة',bn:

'বৈশিষ্ট্যমূলক ভিডিওগুলি',ce:'истакнути видео снимци',cs:'Nejlepší videa',de:'Exzellente Videos',es:'Vídeos destacados',fa:'ویدئوهای برگزیده',fr:'Vidéo remarquables',hi:'विशेष रुप से प्रदर्शित वीडियो',hr:'istaknuti videozapisi',it:'Video in vetrina',ja:'最高級の動画',mk:'најдобрите видеа',ml:'തിരഞ്ഞെടുത്ത വീഡിയോകൾ',nds:'Grootoordige Videos',pl:'Promowane filmy',pt:'Vídeos em Destaque',ru:'Избранные видео',sv:'Utvalda videoklipp',tr:'Seçkin videolar',vi:'video hay nhất',zh:'精選視頻'},'Quality images':{ar:'صور الجودة',bn:'মানসম্মত চিত্রসমূহ',ce:'ЦӀена суьрташ',cs:'Kvalitní obrázky',de:'Qualitätsbilder',es:'Imágenes de calidad',fa:'تصاویر باکیفیت',fr:'Images de qualité',hr:'Kvalitetne slike',it:
function setupTooltipsLoop(anchors,begin,howmany,sleep, remove) {
'Immagini di qualità',mk:'Квалитетни слики',ml:'മേന്മയേറിയ ചിത്രങ്ങൾ',pt:'Imagens de qualidade',ru:'Качественные изображения',sv:'Kvalitetsbilder',tr:'Kaliteli görseller',zh:'优质图像'},'Valued images':{ar:'صور قيمة',bn:'মূল্যবান চিত্রসমূহ',ce:'Мехала суьрташ',cs:'Hodnotné obrázky',de:'Wertvolle Bilder',fa:'تصاویر ارزشمند',fr:'Images de valeur',hr:'Cijenjene slike',it:'Immagini di valore',mk:'Ценети слики',ml:'മൂല്യമേറിയ ചിത്രങ്ങൾ',pt:'Imagens de valor',ru:'Ценные иллюстрации',sv:'Värdefulla bilder',tr:'Değerli görseller',zh:'最有价值图像'},'Find images':{ar:'البحث عن صور',bn:'চিত্রসমূহ খুঁজুন',ce:'Лаха сурт',cs:'Najít obrázky',de:'Finde Bilder',es:'Encontrar imágenes',fa:'یافتن تصاویر',fr:
log(simplePrintf('setupTooltipsLoop(%s,%s,%s,%s,%s)', arguments));
'Trouver les images',hr:'Pronađi slike',it:'Trova le immagini',mk:'Пронајди слики',ml:'ചിത്രങ്ങൾ എടുക്കുക:',pt:'Procurar imagens',ru:'Поиск изображений',sv:'Hitta bilder',tr:'Görsel bul',zh:'搜索图像'},'in this category':{ar:'في هذا التصنيف',bn:'এই বিষয়শ্রেণীতে',ce:'хӀокху категореш',cs:'v této kategorii',de:'aus dieser Kategorie',es:'en esta categoría',fa:'در این رده',fr:'dans cette catégorie',hr:'u ovoj kategoriji',it:'in questa categoria',mk:'во категоријава',ml:'ഈ വർഗ്ഗത്തിലെ',pt:'nesta categoria',ru:'в этой категории',sv:'i denna kategori',tr:'bu kategoride',zh:'在本分类'},'and in':{ar:'أضف إلى',bn:'এবং এতে',ce:'кхин чохь',cs:'a zároveň v',de:'die auch sind in',es:'y en',mk:'и во',fa:'و در',fr:'et dans',hr:'kao i u',it:'e in',ml:
var finish=begin+howmany;
'ഒപ്പം ഇതിലേയും',pt:'e em',ru:'и в',sv:'och i',tr:'ve burada',zh:'且在'},'but not in':{ar:'لا تضع في',bn:'কিন্তু এতে নয়',ce:'амма чохь хӀума яц',cs:'ale ne v',fa:'ولی نه در',de:'die nicht sind in',es:'pero no en',fr:'mais pas dans',hr:'ali ne u',it:'ma non in',mk:'но не во',ml:'ഇതിൽ ഉള്ളത് വേണ്ട',pt:'mas não em',ru:'но не в',sv:'men inte i',tr:'burada olmayan',zh:'但不在'},category:{ar:'تصنيف',bn:'বিষয়শ্রেণী',ce:'категори',cs:'kategorie',de:'Kategorie',es:'categoría',fa:'رده',fr:'catégorie',hr:'kategorija',it:'categoria',mk:'категорија',ml:'വർഗ്ഗം',pt:'categoria',ru:'категория',sv:'kategori',tr:'kategori',zh:'分类'},'In this category <b>and</b> in...':{ar:'في هذا التصنيف <b>و</b> في...',bn:'এই বিষয়শ্রেণীতে <b>এবং</b> এতে...',ce:
var loopend = min(finish, anchors.length);
'ХӀокху категореш чохь <b>кхин</b> чохь...',cs:'V této kategorii <b>a zároveň</b> v…',de:'In dieser Kategorie <b>und</b> in ...',es:'En esta categoría <b>y</b> en...',fa:'در این رده <b>و</b> در...',fr:'Dans cette catégorie <b>et</b> dans...',hr:'U ovoj kategoriji <b>i</b> u...',it:'In questa categoria <b>e</b> in...',mk:'во категоријава <b>и</b> во...',ml:'ഈ വർഗ്ഗത്തിലേയും <b>ഒപ്പം</b> ഇതിലേയും...',pt:'Nesta categoria <b>e</b> em...',ru:'В этой категории <b>и</b> в...',sv:'I denna kategori <b>och</b> i...',tr:'Bu kategoride <b>ve</b> şurada olanlar...',zh:'在本分类<b>且</b>在...'},'In this category <b>but not</b> in...':{ar:'في هذا التصنيف <b>وليس</b> في...',bn:'এই বিষয়শ্রেণীতে <b>কিন্তু</b> এতে নয়...',cs:'V této kategorii, <b>ale ne</b> v…',de:
var j=loopend - begin;
'In dieser Kategorie, <b>aber nicht</b> in ...',es:'En esta categoría <b>pero no</b> en...',fa:'در این رده <b>ولی نه</b> در...',fr:'Dans cette catégorie <b>mais pas</b> dans...',hr:'U ovoj kategoriji <b>ali ne</b> u...',it:'In questa categoria <b>ma non</b> in...',mk:'во категоријава <b>но не</b> во...',ml:'ഈ വർഗ്ഗത്തിലേയും <b>പക്ഷേ</b> ഇതിലില്ലാത്തവയും...',pt:'Nesta categoria <b>mas não</b> em...',ru:'В этой категории, <b>но не</b> в...',sv:'I denna kategori <b>men inte</b> i...',tr:'Bu kategoride olan <b>ancak</b> şurada olmayanlar...',zh:'在本分类<b>但不</b>在...'},'More...':{ar:'المزيد...',bn:'আরও...',ce:'Кхин...',cs:'Další…',de:'Weitere ...',es:'Más...',fa:'بیشتر...',fr:'Plus...',hr:'Više...',it:'Altro...',mk:'Повеќе...',ml:'കൂടുതൽ...',pt:'Mais...',ru:'Ещё...',sv:'Mer...',tr:'Daha fazla...',zh:
log ('setupTooltips: anchors.length=' + anchors.length + ', begin=' + begin +
'更多...'},'About FastCCI...':{ar:'حول FastCCI...',bn:'FastCCI সম্পর্কে...',cs:'O FastCCI…',ce:'Цунах лаьцна FastCCI...',de:'Über FastCCI ...',es:'Acerca de FastCCI...',fa:'دربارهٔ FastCCI...',hr:'O FastCCIju',it:'A proposito di FastCCI...',ml:'FastCCI വിവരണം...',pt:'Acerca de FastCCI...',ru:'Описание FastCCI...',sv:'Om FastCCI...',tr:'FastCCI hakkında...',zh:'关于FastCCI...'},Ok:{ar:'موافق',de:'OK',es:'Aceptar',hr:'U redu',it:'Va bene',pt:'OK',sv:'OK',tr:'Tamam',zh:'OK'},Cancel:{ar:'إلغاء',de:'Abbrechen',es:'Cancelar',hr:'Odustani',it:'Annulla',pt:'Cancelar',sv:'Avbryt',tr:'İptal',zh:'取消'}};function i18n(key){if(!(key in i18nData)||!(uiLang in i18nData[key])){return key;}return i18nData[key][uiLang];}function requestXHR(params,callback){$.get('https:'+url,params).then(function(data){var i,res=data.split('\n');for(i=0;i<res.length;++i){callback(res[i]);}});}function requestJS(params,callback){window.
', howmany=' + howmany + ', loopend=' + loopend + ', remove=' + remove);
fastcciCallback=function(res){var i;for(i=0;i<res.length;++i){callback(res[i]);}};$.getScript('https:'+url+'?t=js&'+$.param(params));}function requestSocket(params,callback){var ws=new WebSocket('wss:'+url+'?'+$.param(params));ws.onmessage=function(event){callback(event.data);};ws.onerror=function(){};}request=('WebSocket'in window)?requestSocket:(('withCredentials'in new XMLHttpRequest())?requestXHR:requestJS);function processResult(res,ctx,callback,append){var r=res.split('|'),t,l=r.length,i,pageids,ids=Array(l),depths=Array(l),tags=Array(l),ret=append||[];for(i=0;i<l;++i){t=r[i].split(',');ids[i]=t[0];depths[i]=parseInt(t[1],10);tags[i]=parseInt(t[2]||'0',10);}pageids=ids.join('|');$.get(mw.util.wikiScript('api'),{action:'query',pageids:pageids,format:'json',utf8:true,prop:'imageinfo|info',iiprop:'size|user|sha1',inprop:'url'}).done(function(data){var j,l=ids.length,p=data.query.pages;for(j=0;j<l;++j){if(ids[j]in p){p[ids[j]].fastcciDepth=depths[j];p[ids[j]].fastcciTag=tags[j];ret.
var doTooltip= remove ? removeTooltip : addTooltip;
push(p[ids[j]]);}else{ret.push(null);}}callback(ret,ctx);});}function breadCrumbs(txt){var token=txt.split(' ');if(token.length!==2||token[0]!=='RESULT'){return;}processResult(token[1],null,function(trail){var l=trail.length,i,bc=[];for(i=0;i<l;++i){if('fullurl'in trail[i]&&'title'in trail[i]){bc.push('<a href="'+trail[i].fullurl+'">'+trail[i].title.replace(/^Category:/,'')+'</a>');}else{bc.push('???');}}$content.prepend($('<div>').addClass('fastcci-breadcrumbs').html(bc.join(' &rarr; ')));});}function fetchGallery(params){var numResult=0,dbAge=0;maxDepth=0;minDepth=Infinity;function slideMove(event,ui){var i;if(ui.value===depthThreshold){return;}depthThreshold=ui.value;for(i=minDepth;i<=maxDepth;++i){if(i>depthThreshold){$('.fastcci-depth'+i).hide();}else{$('.fastcci-depth'+i).show();}}}function addToGallery(txt){var age,token=txt.split(' '),d=300;if(numResult===0){switch(token[0]){case'DONE':$e.text(i18n('No results.'));return;case'QUEUED':$e.text(i18n(
// try a faster (?) loop construct
'Waiting in line. NUM ahead of us.').replace('NUM',token[1]));return;case'COMPUTE_START':$e.text(i18n('Computing...'));return;case'WORKING':$e.text(i18n('Digging through NUM files...').replace('NUM',parseInt(token[1],10)+parseInt(token[2],10)));return;}}switch(token[0]){case'DONE':if(dbAge<60){age=dbAge+'s';}else if(dbAge<3600){age=Math.round(dbAge/60)+'m';}else if(dbAge<86400){age=Math.round(dbAge/3600)+'h';}else{age=Math.round(dbAge/86400)+'d';}$e.append($('<div>').addClass('fastcci-resultstatus').text(age));if(numResult===params.s){$e.append($('<button>').text(i18n('More...')).button().on('click',function(){var s=params.s||200,o=params.o||0;params.o=o+s;window.scrollTo(0,0);fetchGallery(params);}));}return;case'DBAGE':dbAge=parseInt(token[1]||'0',10);return;}if(token.length<2||token[0]!=='RESULT'){return;}if(numResult===0){$e.empty().append($controls);$link.attr('href',location.pathname+'?fastcci='+encodeURIComponent(JSON.stringify(params)));depthThreshold=1000;$slider.slider({
if (j > 0) {
change:slideMove,slide:slideMove,stop:slideMove,value:depthThreshold});}numResult+=token[1].split('|').length;processResult(token[1],$('<span>').appendTo($e),function(ids){var j,ow,oh,w,h,p,i,t,depth,$div,path,l=ids.length;for(j=0;j<l;++j){p=ids[j];if(p===null||!('imageinfo'in p)){continue;}depth=p.fastcciDepth;if(depth>maxDepth){maxDepth=depth;}if(depth<minDepth){minDepth=depth;}i=p.imageinfo[0];ow=i.width;oh=i.height;if(ow>oh){w=Math.round(ow*d/oh);h=d;}else{h=Math.round(oh*d/ow);w=d;}t=encodeURIComponent(new mw.Title(p.title).getMain());if(Math.ceil(w)>=ow){w=ow;h=oh;path='/wiki/Special:Redirect/file/'+t;}else{path='/w/index.php?title=Special:Redirect/file/'+t+'&width='+Math.ceil(w);}$div=$('<div>').addClass('fastcci-image').addClass('fastcci-depth'+depth).css({width:d+'px',height:d+'px'}).append($('<a>').attr('href',p.fullurl+'?fastcci_from='+thisPageId+'&'+$.param(params)).append($('<img>').attr('src',path).css({position:'absolute',left:Math.round(-(w-d)/2)+'px',top:Math.round(-(h
do {
-d)/2)+'px'})));if(p.fastcciTag>0&&p.fastcciTag<=4){$('<img>').addClass('fastcci-badge').attr('src',base+badge[p.fastcciTag-1]).appendTo($div);}$e.append($div);}$slider.slider({min:minDepth,max:maxDepth,value:Math.max(maxDepth,depthThreshold)});});}$e.empty().prependTo($content).text(i18n('Connecting...'));request(params,addToGallery);}function tagLine(html){if($tagline===null){$tagline=$('<span>').addClass('fastcci-tagline').appendTo($('#firstHeading>span').eq(0));}$tagline.html(html);}function showDialog(operation){var text;function resolveRedirect(t){modal.isRedirect[t]=true;$.get(mw.util.wikiScript('index'),{action:'raw',title:'Category:'+t},undefined,'text').done(function(data){var m=/\{\{[Cc]ategory[_ ]redirect\|([Cc]ategory:|)([^}]+)\}\}/.exec(data);if(m!==null){$.getJSON(mw.util.wikiScript('api'),{action:'query',format:'json',titles:'Category:'+m[2],indexpageids:true}).done(function(data){var i=parseInt(data.query.pageids[0],10);if(i>=0){modal.isRedirect[t]=i;validate();}});}})
var a=anchors[loopend - j];
;}function getTagLine(){var v=modal.$input.val();switch(modal.operation){case'and':return i18n('and in')+' <i>'+v+'</i>';case'not':return i18n('but not in')+' <i>'+v+'</i>';}return'';}function pageId(){var v=modal.$input.val();if(v in modal.isRedirect){if(modal.isRedirect[v]===true){return undefined;}else{return modal.isRedirect[v];}}if(v in modal.pageIds){return modal.pageIds[v];}else{return undefined;}}function validate(){if(pageId()!==undefined){modal.$ok.button('enable');}else{modal.$ok.button('disable');}}function performOperation(){var id=pageId();if(id!==undefined){fetchGallery({c1:thisPageId,c2:id,d1:15,d2:15,s:200,a:modal.operation});tagLine(getTagLine());}else{mw.notify('Error.');}modal.$div.dialog('close');}if(!modal){modal={cache:{},pageIds:{},isRedirect:{},operation:null};modal.$div=$('<div>');modal.$input=$('<input>').attr('placeholder',i18n('category')).appendTo(modal.$div).autocomplete({minLength:2,source:function(request,response){var term=request.term.replace(/ /g,'_'
if (!a || !a.href) {
);if(term in modal.cache){response(modal.cache[term]);return;}$.getJSON(mw.util.wikiScript('api'),{action:'query',format:'json',generator:'allpages',gapprefix:term,gapnamespace:14,prop:'templates',tltemplates:'Template:Category_redirect'},function(data){var list=[],a,i,t;if(('query'in data)&&('pages'in data.query)){a=data.query.pages;for(i in a){if(Object.prototype.hasOwnProperty.call(a,i)){t=a[i].title.replace(/^Category:/,'');modal.pageIds[t]=i;if('templates'in a[i]&&!(t in modal.isRedirect)){resolveRedirect(t);}list.push(t);}}modal.cache[term]=list;}validate();response(list.sort());});},change:validate,select:function(e,ui){modal.$input.val(ui.item.value);validate();e.preventDefault();}}).on('keyup',validate).on('keypress',function(e){if(e.keyCode===$.ui.keyCode.ENTER&&pageId()){performOperation();}});modal.$div.dialog({autoOpen:false,modal:true,buttons:[{text:i18n('Ok'),click:performOperation},{text:i18n('Cancel'),click:function(){modal.$div.dialog('close');}}]});modal.$ok=$(
log('got null anchor at index ' + loopend - j);
'button',modal.$div.parent()).eq(0);validate();}text={and:['In this category <b>and</b> in...','and in'],not:['In this category <b>but not</b> in...','but not in']};modal.$div.dialog('option','title',i18n(text[operation][0]));modal.operation=operation;modal.$div.dialog('open');}function addCatUI(){var $box=$('#firstHeading'),$buttonset,$menu=$('<ul>').addClass('fastcci-menu'),$advanced=$('<button>').text(i18n('Advanced...')).button({text:false,icons:{primary:'ui-icon-triangle-1-s'}}).on('click',function(e){$menu.toggle();e.stopPropagation();}),width;$buttonset=$('<div>').addClass('fastcci-buttonset').attr('lang',uiLang).append($('<button>').attr('title',i18n('Featured pictures')+', '+i18n('Featured videos')+', '+i18n('Quality images')+', '+i18n('Valued images')).append($('<img>').attr({id:'fastcci-fqv1',src:base+badge[3]}),$('<img>').attr({id:'fastcci-fqv2',src:base+badge[2]}),$('<img>').attr({id:'fastcci-fqv3',src:base+badge[1]}),$('<img>').attr({id:'fastcci-fqv4',src:base+badge[0]}),
continue;
$('<span>').attr('id','fastcci-buttontextwrapper').append($('<span>').attr('id','fastcci-buttontext').text(i18n('Good pictures')))).on('click',function(){fetchGallery({c1:thisPageId,d1:15,s:200,a:'fqv'});tagLine(i18n('Good pictures'));}),$advanced).buttonset().append($menu).appendTo($box);width=$buttonset.outerWidth(true);$menu.append($('<li>').append($('<a>').attr('href','#').append($('<span>').attr('id','fastcci-allimages').text(i18n('All images'))).on('click',function(){fetchGallery({c1:thisPageId,d1:15,s:200,a:'list'});tagLine(i18n('All images'));})).css('margin-bottom','0.5em'),$('<li>').append($('<a>').attr('href','#').append($('<img>').addClass('fastcci-badges').attr('src',base+badge[0]),i18n('Featured pictures')).on('click',function(){fetchGallery({c1:thisPageId,c2:3943817,d1:15,d2:0,s:200});tagLine(i18n('Featured pictures'));})),$('<li>').append($('<a>').attr('href','#').append($('<img>').addClass('fastcci-badges').attr('src',base+badge[1]),i18n('Featured videos')).on('click',
}
function(){fetchGallery({c1:thisPageId,c2:8460057,d1:15,d2:0,s:200});tagLine(i18n('Featured videos'));})),$('<li>').append($('<a>').attr('href','#').append($('<img>').addClass('fastcci-badges').attr('src',base+badge[2]),i18n('Quality images')).on('click',function(){fetchGallery({c1:thisPageId,c2:3618826,d1:15,d2:0,s:200});tagLine(i18n('Quality images'));})),$('<li>').append($('<a>').attr('href','#').append($('<img>').addClass('fastcci-badges').attr('src',base+badge[3]),i18n('Valued images')).on('click',function(){fetchGallery({c1:thisPageId,c2:4143367,d1:15,d2:0,s:200});tagLine(i18n('Valued images'));})).css('margin-bottom','0.5em'),$('<li>').append($('<a>').attr('href','#').append($('<img>').addClass('fastcci-badges').attr('src',base+'4/45/Fastcci_intersect.svg/24px-Fastcci_intersect.svg.png'),i18n('In this category <b>and</b> in...')).on('click',function(){showDialog('and');$menu.hide();})),$('<li>').append($('<a>').attr('href','#').append($('<img>').addClass('fastcci-badges').attr(
doTooltip(a);
'src',base+'d/d5/Fastcci_notin.svg/24px-Fastcci_notin.svg.png'),i18n('In this category <b>but not</b> in...')).on('click',function(){showDialog('not');$menu.hide();})).css('margin-bottom','0.5em'),$('<li>').append($('<a>').attr('href',helpUrl).attr('target','_blank').append($('<img>').addClass('fastcci-badges').attr('src',base+helpIcon),i18n('About FastCCI...')).on('click',function(e){e.stopImmediatePropagation();$menu.hide();}))).menu().position({my:'top',at:'bottom',of:$advanced,within:$buttonset,collide:'none'}).hide();$slider=$('<div>').addClass('fastcci-slider');$link=$('<a>').addClass('fastcci-help').append($('<img>').attr('src','//upload.wikimedia.org/wikipedia/commons/f/fd/Link.png'));$controls=$('<div>').addClass('fastcci-controls').append(i18n('Strong match')).append($slider).append(i18n('Weak match')).append($('<a>').addClass('fastcci-help').attr('href',helpUrl).append($('<img>').attr('src',base+helpIcon))).append($link).append($('<img>').attr('src',
} while (--j);
'//upload.wikimedia.org/wikipedia/commons/thumb/4/4c/Grey_close_x.svg/22px-Grey_close_x.svg.png').addClass('fastcci-close'));function resize(){var space=$('#firstHeading').width()-$('#firstHeading>span').width()-10;if(space<width){$('#fastcci-buttontext').hide();}else{$('#fastcci-buttontext').show();}}resize();$(window).on('resize',resize);$(document).on('click',function(){$menu.hide();});}if(ns===namespaceIds.category&&action==='view'){mw.loader.using(['jquery.ui'],addCatUI);var param,urlarg=mw.util.getParamValue('fastcci');if(urlarg){try{param=JSON.parse(urlarg);param.c1=thisPageId;param.s=param.s||200;if(param.s>1000){param.s=1000;}mw.loader.using('jquery.ui',function(){fetchGallery(param);});}catch(e){mw.notify('FastCCI URL parameters invalid.');}}}var from=mw.util.getParamValue('fastcci_from');if(ns===namespaceIds.file&&from){request({c1:parseInt(from,10),c2:thisPageId,a:'path'},breadCrumbs);}var and_from=mw.util.getParamValue('c2');if(ns===namespaceIds.file&&from){request({c1:
}
parseInt(and_from,10),c2:thisPageId,a:'path'},breadCrumbs);}});},{"css":[
if (finish < anchors.length) {
".sitedir-ltr .mw-indicators{margin-left:1em}.sitedir-rtl .mw-indicators{margin-right:1em} #firstHeading .fastcci-button{color:black;border:1px solid lightgray;margin:0 0.2em 0 0;padding:2px 2px 2px 2px;text-decoration:none; font-size:0.5em;height:28px}#firstHeading\u003E.fastcci-button{float:right;margin:0 0 0.2em 1em; }#firstHeading .fastcci-button\u003Espan{padding:0 0.4em 0 0.4em;position:relative;top:1px}#firstHeading .fastcci-button\u003Eimg{position:relative;top:-2px;vertical-align:middle}#firstHeading .fastcci-tagline{font-size:70%;margin-left:1em}.fastcci-breadcrumbs{border:1px solid lightgray;padding:0.5em;margin-bottom:1px}.fastcci-results input[type=\"range\"]{width:40%}.fastcci-results .fastcci-image{overflow:hidden;display:inline-block;position:relative;margin:5px;box-shadow:3px 3px 15px rgba(0,0,0,0.3)}.fastcci-results .fastcci-slider{display:inline-block;margin:0 1em 0 1em;width:40%}.fastcci-help,.fastcci-close{margin-left:2em;cursor:pointer}.fastcci-results .fastcci-badge{position:absolute;top:5px;left:5px}#firstHeading,#mw_header h1{overflow:visible}div.fastcci-buttonset{float:right;position:relative;display:inline-block;font-size:15px;margin:-5px 0 0 0}#firstHeading div.fastcci-buttonset{margin-top:0}div.fastcci-buttonset\u003Ebutton{height:31px;margin:0 -1px 0 0 !important} #firstHeading div.fastcci-buttonset\u003E.ui-button{background:#f8f9fa !important;box-shadow:none !important;color:#36c !important;border-radius:2px !important}#firstHeading div.fastcci-buttonset\u003E.ui-button:hover{background:#fff !important}#fastcci-fqv1,#fastcci-fqv2,#fastcci-fqv3,#fastcci-fqv4{position:absolute;margin-top:-1px}#fastcci-fqv1{left:32px}#fastcci-fqv2{left:25px;margin-top:0}#fastcci-fqv3{left:19px}#fastcci-fqv4{left:4px}#fastcci-buttontextwrapper{margin-left:25px}#fastcci-buttontext{margin-left:15px}.fastcci-menu{position:absolute;font-size:15px;z-index:10;white-space:nowrap;left:initial !important;right:0 !important}.fastcci-menu label{display:block}.fastcci-menu label\u003Eimg{margin:0 0.2em 0 0.2em}.fastcci-menu label\u003Einput{margin-left:0.7em}.fastcci-badges{margin-right:10px}#fastcci-allimages{margin-left:34px}"
setTimeout(function() {setupTooltipsLoop(anchors,finish,howmany,sleep,remove);}, sleep);
]});mw.loader.implement("ext.gadget.libCommons@jq08p",function($,jQuery,require,module){(function($,mw){"use strict";if(!mw.libs.commons)mw.libs.commons={};var lc=mw.libs.commons;$.extend(mw.libs.commons,{fixDoubleEncoding:function(s){if(!s)return s;var utf8=/[u00C2-u00F4][u0080-u00BF][u0080-u00BF]?[u0080-u00BF]?/g;if(!utf8.test(s))return s;var temp="",curr=0,m,hex_digit="0123456789ABCDEF";var str=s.replace(/%/g,'%25');utf8.lastIndex=0;try{while((m=utf8.exec(str))!==null){temp+=str.substring(curr,m.index);m=m[0];for(var i=0;i<m.length;i++){temp+='%'+hex_digit.charAt(m.charCodeAt(i)/16)+hex_digit.charAt(m.charCodeAt(i)%16);}curr=utf8.lastIndex;}if(curr<str.length)temp+=str.substring(curr);temp=decodeURIComponent(temp);return temp;}catch(e){}return s;},smallChangesBots:['FlickreviewR','Rotatebot','Cropbot','Picasa Review Bot','Reedy RotateBot','OgreBot','Panoramio Review Bot','Picasa Review Bot 2','FlickreviewR 2','SteinsplitterBot','Embedded Data Bot',],isSmallChangesBot:function(name){
} else {
return($.inArray(name,lc.smallChangesBots)>-1);},getUploadBotUser:function(bot,content,comment,firstTextRevisionUser){var match;switch(bot){case'Upload Bot (Rich Smith)':case'File Upload Bot (Magnus Manske)':match=/^[Tt]ransferr?e?d from .+? by \[\[User:([^\]\|]*)(\|([^\]]*))?\]\] using/.exec(comment);var reOldCH=/[Tt]ransferred to Commons by \[\[User:([^\]\|]+)(?:\|(?:[^\]]*))?\]\] using/;if(!match)match=reOldCH.exec(comment);if(!match)match=reOldCH.exec(content);if(!match)match=/\{\{transferred from\|[^\}\|]+\|([^\}\|]+)\|[^\}\|]+\}\}/.exec(content);var oldGeograph=/geograph.org.uk\]; transferr?e?d by \[\[User:([^\]\|]+)(?:\|(?:[^\]]*))?\]\] using/;if(!match)match=oldGeograph.exec(comment);if(!match)match=oldGeograph.exec(content);if(!match)match=/\* Uploaded by \[\[User:([^\]\|]+)\|(?:(?:[^\]]*))?/.exec(comment);if(!match)match=/\* Uploaded by \[\[User:([^\]\|]+)(?:\|(?:[^\]]*))?\]\]/.exec(content);if(match)match=match[1];match=lc.fixDoubleEncoding(match);break;case'FlickrLickr':
if ( !remove && ! getValueOf('popupTocLinks')) { rmTocTooltips(); }
match=/\n\|reviewer=\s*(.+)\n/.exec(content);if(match)match=match[1];break;case'Flickr upload bot':match=/\{\{User:Flickr upload bot\/upload(?:-pd)?(?:\|[^\|\}]*)?\|reviewer=([^\}]+)\}\}/.exec(content);if(match)match=match[1];if(!match)match=firstTextRevisionUser;break;default:return bot;}if(match){match=match.replace(/^[\s_]+/,'').replace(/[\s_]+$/,'').replace(/[\s_]+/g,' ');match=match.substr(0,1).toUpperCase()+match.substr(1);bot=match;}return bot;}});}(jQuery,mediaWiki));});mw.loader.implement("ext.gadget.libJQuery@1ib1w",function($,jQuery,require,module){(function($,mw){"use strict";$.extend({createIcon:function(iconClass){return $('<span>',{'class':'ui-icon '+iconClass+' jquery-inline-icon',text:' '});},createNotifyArea:function(textNode,icon,state){return $('<div>',{'class':'ui-widget'}).append($('<div>',{'class':state+' ui-corner-all',style:'margin-top:20px; padding:0.7em;'}).append($('<p>').append($.createIcon(icon).css('margin-right','.3em'),textNode)));},ucFirst:function(str){return str.charAt(0).toUpperCase()+str.slice(1);}});mw.messages.set({'libjq-cancel-title':"Close this dialog [Esc]",'libjq-proceed-title':"Proceed [Enter] in single-line text fields",'libjq-report-title':"Reporting errors helps improving the application"});var buttonConfig={proceed:{'icon':'ui-icon-circle-check','class':'ui-button-green','title':'libjq-proceed-title'},cancel:{'icon':'ui-icon-circle-close','class':'ui-button-red','title':'libjq-cancel-title'},report:{'icon':
pg.flag.finishedLoading=true;
'ui-icon-circle-check','class':'','title':'libjq-report-title'}};$.extend($.fn,{specialButton:function(which){return(function($btn,cfg){return $btn.button({icons:{primary:cfg.icon}}).addClass(cfg['class']).attr('title',mw.msg(cfg.title));}(this,buttonConfig[which]));},_jqInteraction:function(){var $el=this;return $el.hover(function(){$el.addClass('ui-state-hover');},function(){$el.removeClass('ui-state-hover').removeClass('ui-state-active');}).focusin(function(){$el.addClass('ui-state-focus');}).focusout(function(){$el.removeClass('ui-state-focus');}).mousedown(function(e){if(1===e.which)$el.addClass('ui-state-active');}).mouseup(function(){$el.removeClass('ui-state-active');});}});}(jQuery,mediaWiki));},{"css":[".jquery-inline-icon{display:inline-block !important;position:relative;top:2px}"]});mw.loader.implement("ext.gadget.libUtil@36a3h",function($,jQuery,require,module){(function(){"use strict";if(!mw.libs.commons)mw.libs.commons={};var lc=mw.libs.commons;$.extend(mw.libs.commons,{guessUser:function(){var title,target,user;user=mw.config.get('wgRelevantUserName');if(user){return user;}switch(mw.config.get('wgNamespaceNumber')){case 3:case 2:return mw.config.get('wgPageName').match(/.*?\:(.*?)(\/.*)*$/)[1];case-1:try{switch(mw.config.get('wgCanonicalSpecialPageName')){case'CentralAuth':target=mw.util.getParamValue('target');if(target){return target;}title=mw.util.getParamValue('title');if(title){title=title.match(/Special\:(?:CentralAuth)\/(.*)$/);if(title){return title[1];}}if(/Special\:(?:CentralAuth)\//.test(location.href)){return decodeURIComponent(location.href.match(/Special\:(?:CentralAuth)\/(.*?)(?:[\?&].*)?$/)[1]);}break;case'Log':if(mw.util.getParamValue('page')&&/User:+./.test(mw.util.getParamValue('page'))){return mw.util.getParamValue('page').replace('User:',
}
'');}break;}}catch(ex){}break;}},monthNamesInSiteLang:['','January','February','March','April','May','June','July','August','September','October','November','December'],formatDate:function(fmt,date,fallbackDate){var pad0=function(s){return(s>9?s:"0"+s);};date=date||fallbackDate||new Date();var month=date.getUTCMonth()+1;fmt=fmt.replace(/YYYY/g,date.getUTCFullYear());fmt=fmt.replace(/MM/g,pad0(month));date=date.getUTCDate();fmt=fmt.replace(/DD/g,pad0(date));fmt=fmt.replace(/MON/g,lc.monthNamesInSiteLang[month]);fmt=fmt.replace(/DAY/g,date);return fmt;},getTalkPageFromTitle:function(title){var rens=/^(.+)\:/,pref=title.match(rens),nsid=-1,newPref;if(pref){pref=pref[1].toLowerCase().replace(/ /g,'_');}else{pref='';}nsid=mw.config.get('wgNamespaceIds')[pref];if(0===nsid%2)nsid++;newPref=mw.config.get('wgFormattedNamespaces')[nsid]+':';if(pref){title=title.replace(/^.+\:/,newPref);}else{title=newPref+title;}return title;},titleFromImgSrc:function(src){mw.log.warn(
}
".titleFromImgSrc() is deprecated. Use mw.Title.newFromImg() instead.");try{return decodeURIComponent(src).match(/\/[a-f0-9]\/[a-f0-9]{2}\/(\S+\.\S{2,5})\//)[1].replace(/_/g,' ');}catch(ex){try{return decodeURIComponent(src).match(/thumb\.php.*(?:\?|\&)f=(\S+\.\S{2,5})(?:\&.+)?$/)[1].replace(/_/g,' ');}catch(ex2){try{return decodeURIComponent(src).match(/\/[a-f0-9]\/[a-f0-9]{2}\/(\S+\.\S{2,5})$/)[1].replace(/_/g,' ');}catch(ex3){}}}}});}());});

// eliminate popups from the TOC
// This also kills any onclick stuff that used to be going on in the toc
function rmTocTooltips() {
//console.log('rmTocTooltips');
var toc=document.getElementById('toc');
if (toc) {
var tocLinks=toc.getElementsByTagName('A');
var tocLen = tocLinks.length;
for (j=0; j<tocLen; ++j) {
//console.log ('killing popup for toclinks[' + j + ']');
removeTooltip(tocLinks[j], true);
}
}
}

function addTooltip(a) {
if ( !isPopupLink(a) ) { return; }
a.onmouseover=mouseOverWikiLink;
a.onmouseout= mouseOutWikiLink;
a.onclick= killPopup;
a.hasPopup = true;
if (getValueOf('removeTitles') && typeof a.originalTitle=='undefined') {
a.originalTitle=a.title;
a.title='';
}
}

function removeTooltip(a) {
if ( !a.hasPopup ) { return; }
a.onmouseover = null;
a.onmouseout = null;
if (a.originalTitle) { a.title = a.originalTitle; }
a.hasPopup=false;
}

function registerHooks(np) {
var popupMaxWidth=getValueOf('popupMaxWidth');

if (typeof popupMaxWidth == 'number') {
var setMaxWidth = function () {
np.mainDiv.style.maxWidth = popupMaxWidth + 'px';
np.maxWidth = popupMaxWidth;

// hack for IE
// see http://www.svendtofte.com/code/max_width_in_ie/
// use setExpression as documented here on msdn: http://tinyurl dot com/dqljn

if (np.mainDiv.style.setExpression) {
np.mainDiv.style.setExpression(
'width', 'document.body.clientWidth > ' +
popupMaxWidth + ' ? "' +popupMaxWidth + 'px": "auto"');
}
};
np.addHook(setMaxWidth, 'unhide', 'before');
}
//<NOLITE>
if (window.addPopupShortcuts && window.rmPopupShortcuts) {
np.addHook(addPopupShortcuts, 'unhide', 'after');
np.addHook(rmPopupShortcuts, 'hide', 'before');
}
//</NOLITE>
}


function mouseOverWikiLink() {
if (!window.popupsReady || !window.popupsReady()) { return; }
return mouseOverWikiLink2(this);
}

function footnoteTarget(a) {
var aTitle=Title.fromAnchor(a);
// We want ".3A" rather than "%3A" or "?" here, so use the anchor property directly
var anch = aTitle.anchor;
if ( ! /^(_note-|endnote)/.test(anch) ) { return false; }

var lTitle=Title.fromURL(location.href);
if ( lTitle.toString(true) != aTitle.toString(true) ) { return false; }

var el=document.getElementById(anch);
while ( el && typeof el.nodeName == 'string') {
var nt = el.nodeName.toLowerCase();
if ( nt == 'li' ) { return el; }
else if ( nt == 'body' ) { return false; }
else if ( el.parentNode ) { el=el.parentNode; }
else { return false; }
}
return false;
}

function footnotePreview(x, navpop) {
setPopupHTML('<hr>' + x.innerHTML, 'popupPreview', navpop.idNumber,
getValueOf('popupSubpopups') ? function() {
setupTooltips(document.getElementById('popupPreview' + navpop.idNumber));
} : null);
}

function mouseOverWikiLink2(a) {
// try not to duplicate effort
if ( a==pg.current.link && a.navpopup && a.navpopup.isVisible() ) { return; }
pg.current.link=a;

if (getValueOf('simplePopups') && pg.option.popupStructure===null) {
// reset *default value* of popupStructure
setDefault('popupStructure', 'original');
}

var article=(new Title()).fromAnchor(a);
// set global variable (ugh) to hold article (wikipage)
pg.current.article = article;
if (pg.timer.image !== null) {
clearInterval(pg.timer.image);
pg.timer.image=null;
pg.counter.checkImages=0;
}

if (!a.navpopup) {
// FIXME: this doesn't behave well if you mouse out of a popup
// directly into a link with the same href
if (pg.current.linksHash[a.href] && false) {
a.navpopup = pg.current.linksHash[a.href];
}
else {
a.navpopup=newNavpopup(a, article);
pg.current.linksHash[a.href] = a.navpopup;
pg.current.links.push(a);
}
}
if (a.navpopup.pending===null || a.navpopup.pending!==0) {
// either fresh popups or those with unfinshed business are redone from scratch
simplePopupContent(a, article);
}
a.navpopup.showSoonIfStable(a.navpopup.delay);

getValueOf('popupInitialWidth');

clearInterval(pg.timer.checkPopupPosition);
pg.timer.checkPopupPosition=setInterval(checkPopupPosition, 600);

if(getValueOf('simplePopups')) { return; }

if (a.navpopup.pending!==0 ) {
//console.log('a.navpopup.pending='+a.navpopup.pending);
nonsimplePopupContent(a, article);
}
}

// simplePopupContent: the content that is shown even when simplePopups is true
function simplePopupContent(a, article) {
a.navpopup.setInnerHTML(popupHTML(a));
fillEmptySpans({navpopup:a.navpopup});

var dragHandle = getValueOf('popupDragHandle') || null;
if (dragHandle && dragHandle != 'all') {
dragHandle += a.navpopup.idNumber;
}
setTimeout(function(){a.navpopup.makeDraggable(dragHandle);}, 150);
//<NOLITE>
/* FIXME hack */ a.navpopup.hasPopupMenu=false;
if (getValueOf('popupRedlinkRemoval') && a.className=='new') {
setPopupHTML('<br>'+popupRedlinkHTML(article), 'popupRedlink', a.navpopup.idNumber);
}
//</NOLITE>
}

function debugData(navpopup) {
if(getValueOf('popupDebugging') && navpopup.idNumber) {
setPopupHTML('idNumber='+navpopup.idNumber + ', pending=' + navpopup.pending,
'popupError', navpopup.idNumber);
}
}

function newNavpopup(a, article) {
var navpopup = new Navpopup();
navpopup.fuzz=5;
navpopup.delay=getValueOf('popupDelay')*1000;
// increment global counter now
navpopup.idNumber = ++pg.idNumber;
navpopup.parentAnchor = a;
navpopup.article = article;
registerHooks(navpopup);
return navpopup;
}


function nonsimplePopupContent(a, article) {
//console.log('nonsimplePopupContent');
var diff=null, history=null;
var params=parseParams(a.href);
var oldid=(typeof params.oldid=='undefined' ? null : params.oldid);
//<NOLITE>
if(getValueOf('popupPreviewDiffs') && window.loadDiff) {
diff=params.diff;
}
if(getValueOf('popupPreviewHistory') && getValueOf('popupUseQueryInterface')) {
history=(params.action=='history');
}
//</NOLITE>
a.navpopup.pending=0;
var previewImage=true;
var x;
pg.misc.gImage=null;
if (x=footnoteTarget(a)) {
footnotePreview(x, a.navpopup);
//<NOLITE>
} else if ( diff || diff === 0 ) {
//alert([article,oldid,diff]);
loadDiff(article, oldid, diff, a.navpopup);
} else if ( history && getValueOf('popupUseQueryInterface') ) {
loadQueryPreview('history', article, a.navpopup);
} else if ( pg.re.contribs.test(a.href) && getValueOf('popupUseQueryInterface')) {
loadQueryPreview('contribs', article, a.navpopup);
} else if ( // FIXME should be able to get all preview combinations with options
article.namespace()==pg.ns.image &&
( getValueOf('imagePopupsForImages') || ! anchorContainsImage(a) )
) {
if (getValueOf('popupUseQueryInterface')) {
loadQueryPreview('imagepagepreview', article, a.navpopup);
} else { startArticlePreview(article, oldid, a.navpopup); }
loadImages(article);
//</NOLITE>
} else if (article.namespace() == pg.ns.category &&
getValueOf('popupCategoryMembers')) {
getValueOf('popupUseQueryInterface') &&
loadQueryPreview('category', article, a.navpopup);
startArticlePreview(article, oldid, a.navpopup);
}
else if (!article.namespace()!=pg.ns.image && previewImage ) {
startArticlePreview(article, oldid, a.navpopup);
}
}

function pendingNavpopTask(navpop) {
if (navpop && navpop.pending===null) { navpop.pending=0; }
++navpop.pending;
debugData(navpop);
}

function completedNavpopTask(navpop) {
//console.log('completedNavpopTask...');
//console.log('...navpop='+navpop+', navpop.pending='+navpop.pending);
if (navpop && navpop.pending) { --navpop.pending; }
debugData(navpop);
}

function startArticlePreview(article, oldid, navpop) {
//console.log('startArticlePreview');
navpop.redir=0;
loadPreview(article, oldid, navpop);
}

function loadPreview(article, oldid, navpop) {
//console.log('loadPreview(' + article + ', ' + oldid + ', ' + navpop + ')');
pendingNavpopTask(navpop);
if (!navpop.redir) { navpop.originalArticle=article; }
if (!navpop.visible && getValueOf('popupLazyDownloads')) {
var id=(navpop.redir) ? 'DOWNLOAD_PREVIEW_REDIR_HOOK' : 'DOWNLOAD_PREVIEW_HOOK';
//console.log(id);
//console.log(navpop);
navpop.addHook(function() {
//console.log('hook from loadPreview called');
getWiki(article, insertPreview, oldid, navpop);
return true; }, 'unhide', 'before', id);
} else {
//console.log('calling getWiki directly from loadPreview');
getWiki(article, insertPreview, oldid, navpop);
}
}

function loadPreviewFromRedir(redirMatch, navpop) {
// redirMatch is a regex match
//console.log('loadPreviewFromRedir');
var target = new Title().fromWikiText(redirMatch[2]);
var trailingRubbish=redirMatch[4];
navpop.redir++;
navpop.redirTarget=target;
//<NOLITE>
if (window.redirLink) {
var warnRedir = redirLink(target, navpop.article);
setPopupHTML(warnRedir, 'popupWarnRedir', navpop.idNumber);
}
//</NOLITE>
navpop.article=target;
fillEmptySpans({redir: true, redirTarget: target, navpopup:navpop});
return loadPreview(target, null, navpop);
}

function insertPreview(download) {
//console.log('insertPreview');
if (!download.owner) { return; }

var redirMatch = pg.re.redirect.exec(download.data);
if (download.owner.redir===0 && redirMatch) {
completedNavpopTask(download.owner);
loadPreviewFromRedir(redirMatch, download.owner);
return;
}

if (download.owner.visible || !getValueOf('popupLazyPreviews')) {
insertPreviewNow(download);
} else {
var id=(download.owner.redir) ? 'PREVIEW_REDIR_HOOK' : 'PREVIEW_HOOK';
//console.log(id);
download.owner.addHook( function(){insertPreviewNow(download); return true;},
'unhide', 'after', id );
}
}

function insertPreviewNow(download) {
//console.log('insertPreviewNow');
if (!download.owner) { return; }
var wikiText=download.data;
var navpop=download.owner;
completedNavpopTask(navpop);
var art=navpop.redirTarget || navpop.originalArticle;

//<NOLITE>
//console.log('running makeFixDabs');
makeFixDabs(wikiText, navpop);
//console.log('done makeFixDabs');
if (getValueOf('popupSummaryData') && window.getPageInfo) {
var info=getPageInfo(wikiText, download);
setPopupTrailer(getPageInfo(wikiText, download), navpop.idNumber);
}

//console.log('done page info');
var imagePage='';
if (art.namespace()==pg.ns.image) { imagePage=art.toString(); }
else { imagePage=getValidImageFromWikiText(wikiText); }
if(imagePage) { loadImages(Title.fromWikiText(imagePage)); }
//</NOLITE>

if (getValueOf('popupPreviews')) { insertArticlePreview(download, art, navpop); }

}

function insertArticlePreview(download, art, navpop) {
//console.log('insertArticlePreview');
if (download && typeof download.data == typeof ''){
if (art.namespace()==pg.ns.template && getValueOf('popupPreviewRawTemplates')) {
// FIXME compare/consolidate with diff escaping code for wikitext
var h='<hr><tt>' + download.data.entify().split('\\n').join('<br>\\n') + '</tt>';
setPopupHTML(h, 'popupPreview', navpop.idNumber);
}
else {
var p=prepPreviewmaker(download.data, art, navpop);
p.showPreview();
}
}
}

function prepPreviewmaker(data, article, navpop) {
//console.log('prepPreviewmaker, article='+article);
// deal with tricksy anchors
var d=anchorize(data, article.anchorString());
var urlBase=joinPath([pg.wiki.articlebase, article.urlString()]);
var p=new Previewmaker(d.substring(0,10000), urlBase, navpop);
return p;
}


// Try to imitate the way mediawiki generates HTML anchors from section titles
function anchorize(d, anch) {
if (!anch) { return d; }
var anchRe=RegExp('=+\\s*' + literalizeRegex(anch).replace(/[_ ]/g, '[_ ]') + '\\s*=+');
var match=d.match(anchRe);
if(match && match.length > 0 && match[0]) { return d.substring(d.indexOf(match[0])); }

// now try to deal with == foo [[bar|baz]] boom == -> #foo_baz_boom
var lines=d.split('\n');
for (var i=0; i<lines.length; ++i) {
lines[i]=lines[i].replace(RegExp('[[]{2}([^|\\]]*?[|])?(.*?)[\\]]{2}', 'g'), '$2')
.replace(/'''([^'])/g, '$1').replace(RegExp("''([^'])", 'g'), '$1');
if (lines[i].match(anchRe)) {
return d.split('\n').slice(i).join('\n').replace(RegExp('^[^=]*'), '');
}
}
return d;
}

function killPopup() {
if (getValueOf('popupShortcutKeys') && window.rmPopupShortcuts) { rmPopupShortcuts(); }
if (!pg) { return; }
pg.current.link && pg.current.link.navpopup && pg.current.link.navpopup.banish();
pg.current.link=null;
abortAllDownloads();
window.stopImagesDownloading && stopImagesDownloading();
if (pg.timer.checkPopupPosition !== null) {
clearInterval(pg.timer.checkPopupPosition);
pg.timer.checkPopupPosition=null;
}
if (pg.timer.checkImages !== null) { clearInterval(pg.timer.checkImages); pg.timer.checkImages=null; }
if (pg.timer.image !== null) { clearInterval(pg.timer.image); pg.timer.image=null; }
return true; // preserve default action
}
// ENDFILE: actions.js
// STARTFILE: domdrag.js
/**
@fileoverview
The {@link Drag} object, which enables objects to be dragged around.

<pre>
*************************************************
dom-drag.js
09.25.2001
www.youngpup.net
**************************************************
10.28.2001 - fixed minor bug where events
sometimes fired off the handle, not the root.
*************************************************
Pared down, some hooks added by [[User:Lupin]]

Copyright Aaron Boodman.
Saying stupid things daily since March 2001.
</pre>
*/

/**
Creates a new Drag object. This is used to make various DOM elements draggable.
@constructor
*/
function Drag () {
/**
Condition to determine whether or not to drag. This function should take one parameter, an Event.
To disable this, set it to <code>null</code>.
@type Function
*/
this.startCondition = null;
/**
Hook to be run when the drag finishes. This is passed the final coordinates of
the dragged object (two integers, x and y). To disables this, set it to <code>null</code>.
@type Function
*/
this.endHook = null;
}

/**
Gets an event in a cross-browser manner.
@param {Event} e
@private
*/
Drag.prototype.fixE = function(e) {
if (typeof e == 'undefined') { e = window.event; }
if (typeof e.layerX == 'undefined') { e.layerX = e.offsetX; }
if (typeof e.layerY == 'undefined') { e.layerY = e.offsetY; }
return e;
};
/**
Initialises the Drag instance by telling it which object you want to be draggable, and what you want to drag it by.
@param {DOMElement} o The "handle" by which <code>oRoot</code> is dragged.
@param {DOMElement} oRoot The object which moves when <code>o</code> is dragged, or <code>o</code> if omitted.
*/
Drag.prototype.init = function(o, oRoot) {
var dragObj = this;
this.obj = o;
o.onmousedown = function(e) { dragObj.start.apply( dragObj, [e]); };
o.dragging = false;
o.draggable = true;
o.hmode = true;
o.vmode = true;

o.root = oRoot && oRoot !== null ? oRoot : o ;

if (isNaN(parseInt(o.root.style.left, 10))) { o.root.style.left = "0px"; }
if (isNaN(parseInt(o.root.style.top, 10))) { o.root.style.top = "0px"; }

o.root.onthisStart = function(){};
o.root.onthisEnd = function(){};
o.root.onthis = function(){};
};

/**
Starts the drag.
@private
@param {Event} e
*/
Drag.prototype.start = function(e) {
var o = this.obj; // = this;
e = this.fixE(e);
if (this.startCondition && !this.startCondition(e)) { return; }
var y = parseInt(o.vmode ? o.root.style.top : o.root.style.bottom, 10);
var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right, 10);
o.root.onthisStart(x, y);

o.lastMouseX = e.clientX;
o.lastMouseY = e.clientY;

var dragObj = this;
o.onmousemoveDefault = document.onmousemove;
o.dragging = true;
document.onmousemove = function(e) { dragObj.drag.apply( dragObj, [e] ); };
document.onmouseup = function(e) { dragObj.end.apply( dragObj, [e] ); };
return false;
};
/**
Does the drag.
@param {Event} e
@private
*/
Drag.prototype.drag = function(e) {
e = this.fixE(e);
var o = this.obj;

var ey = e.clientY;
var ex = e.clientX;
var y = parseInt(o.vmode ? o.root.style.top : o.root.style.bottom, 10);
var x = parseInt(o.hmode ? o.root.style.left : o.root.style.right, 10 );
var nx, ny;

nx = x + ((ex - o.lastMouseX) * (o.hmode ? 1 : -1));
ny = y + ((ey - o.lastMouseY) * (o.vmode ? 1 : -1));

this.obj.root.style[o.hmode ? "left" : "right"] = nx + "px";
this.obj.root.style[o.vmode ? "top" : "bottom"] = ny + "px";
this.obj.lastMouseX = ex;
this.obj.lastMouseY = ey;

this.obj.root.onthis(nx, ny);
return false;
};

/**
Ends the drag.
@private
*/
Drag.prototype.end = function() {
document.onmousemove=this.obj.onmousemoveDefault;
document.onmouseup = null;
this.obj.dragging = false;
if (this.endHook) {
this.endHook( parseInt(this.obj.root.style[this.obj.hmode ? "left" : "right"], 10),
parseInt(this.obj.root.style[this.obj.vmode ? "top" : "bottom"], 10));
}
};
// ENDFILE: domdrag.js
// STARTFILE: structures.js
//<NOLITE>
pg.structures.original={};
pg.structures.original.popupLayout=function () {
return ['popupError', 'popupImage', 'popupTopLinks', 'popupTitle',
'popupData', 'popupOtherLinks',
'popupRedir', ['popupWarnRedir', 'popupRedirTopLinks',
'popupRedirTitle', 'popupRedirData', 'popupRedirOtherLinks'],
'popupMiscTools', ['popupRedlink'],
'popupPrePreviewSep', 'popupPreview', 'popupSecondPreview', 'popupPostPreview', 'popupFixDab'];
};
pg.structures.original.popupRedirSpans=function () {
return ['popupRedir', 'popupWarnRedir', 'popupRedirTopLinks',
'popupRedirTitle', 'popupRedirData', 'popupRedirOtherLinks'];
};
pg.structures.original.popupTitle=function (x) {
log ('defaultstructure.popupTitle');
if (!getValueOf('popupNavLinks')) {
return navlinkStringToHTML('<b><<mainlink>></b>',x.article,x.oldid);
}
return '';
};
pg.structures.original.popupTopLinks=function (x) {
log ('defaultstructure.popupTopLinks');
if (getValueOf('popupNavLinks')) { return navLinksHTML(x.article, x.hint, x.oldid); }
return '';
};
pg.structures.original.popupImage=function(x) {
log ('original.popupImage, x.article='+x.article+', x.navpop.idNumber='+x.navpop.idNumber);
return imageHTML(x.article, x.navpop.idNumber);
};
pg.structures.original.popupRedirTitle=pg.structures.original.popupTitle;
pg.structures.original.popupRedirTopLinks=pg.structures.original.popupTopLinks;


function copyStructure(oldStructure, newStructure) {
pg.structures[newStructure]={};
for (var prop in pg.structures[oldStructure]) {
pg.structures[newStructure][prop]=pg.structures[oldStructure][prop];
}
}

copyStructure('original', 'nostalgia');
pg.structures.nostalgia.popupTopLinks=function(x) {
var str='';
str += '<b><<mainlink|shortcut= >></b>';

// user links
// contribs - log - count - email - block
// count only if applicable; block only if popupAdminLinks
str += 'if(user){<br><<contribs|shortcut=c>>';
str+='if(wikimedia){*<<count|shortcut=#>>}';
str+='if(ipuser){}else{*<<email|shortcut=E>>}if(admin){*<<block|shortcut=b>>}}';

// editing links
// talkpage -> edit|new - history - un|watch - article|edit
// other page -> edit - history - un|watch - talk|edit|new
var editstr='<<edit|shortcut=e>>';
var editOldidStr='if(oldid){<<editOld|shortcut=e>>|<<revert|shortcut=v|rv>>|<<edit|cur>>}else{'
+ editstr + '}'
var historystr='<<history|shortcut=h>>';
var watchstr='<<unwatch|unwatchShort>>|<<watch|shortcut=w|watchThingy>>';

str+='<br>if(talk){' +
editOldidStr+'|<<new|shortcut=+>>' + '*' + historystr+'*'+watchstr + '*' +
'<b><<article|shortcut=a>></b>|<<editArticle|edit>>' +
'}else{' + // not a talk page
editOldidStr + '*' + historystr + '*' + watchstr + '*' +
'<b><<talk|shortcut=t>></b>|<<editTalk|edit>>|<<newTalk|shortcut=+|new>>'
+ '}';

// misc links
str += '<br><<whatLinksHere|shortcut=l>>*<<relatedChanges|shortcut=r>>';
str += 'if(admin){<br>}else{*}<<move|shortcut=m>>';

// admin links
str += 'if(admin){*<<unprotect|unprotectShort>>|<<protect|shortcut=p>>*' +
'<<undelete|undeleteShort>>|<<delete|shortcut=d>>}';
return navlinkStringToHTML(str, x.article, x.oldid);
};
pg.structures.nostalgia.popupRedirTopLinks=pg.structures.nostalgia.popupTopLinks;

/** -- fancy -- **/
copyStructure('original', 'fancy');
pg.structures.fancy.popupTitle=function (x) {
return navlinkStringToHTML('<font size=+0><<mainlink>></font>',x.article,x.oldid);
};
pg.structures.fancy.popupTopLinks=function(x) {
var hist='<<history|shortcut=h|hist>>|<<lastEdit|shortcut=/|last>>if(mainspace_en){|<<editors|shortcut=E|eds>>}';
var watch='<<unwatch|unwatchShort>>|<<watch|shortcut=w|watchThingy>>';
var move='<<move|shortcut=m|move>>';
return navlinkStringToHTML('if(talk){' +
'<<edit|shortcut=e>>|<<new|shortcut=+|+>>*' + hist + '*' +
'<<article|shortcut=a>>|<<editArticle|edit>>' + '*' + watch + '*' + move +
'}else{<<edit|shortcut=e>>*' + hist +
'*<<talk|shortcut=t|>>|<<editTalk|edit>>|<<newTalk|shortcut=+|new>>' +
'*' + watch + '*' + move+'}<br>', x.article, x.oldid);
};
pg.structures.fancy.popupOtherLinks=function(x) {
var admin='<<unprotect|unprotectShort>>|<<protect|shortcut=p>>*<<undelete|undeleteShort>>|<<delete|shortcut=d|del>>';
var user='<<contribs|shortcut=c>>if(wikimedia){|<<count|shortcut=#|#>>}';
user+='if(ipuser){|<<arin>>}else{*<<email|shortcut=E|'+
popupString('email')+'>>}if(admin){*<<block|shortcut=b>>}';

var normal='<<whatLinksHere|shortcut=l|links here>>*<<relatedChanges|shortcut=r|related>>';
return navlinkStringToHTML('<br>if(user){' + user + '*}if(admin){'+admin+'if(user){<br>}else{*}}' + normal,
x.article, x.oldid);
};
pg.structures.fancy.popupRedirTitle=pg.structures.fancy.popupTitle;
pg.structures.fancy.popupRedirTopLinks=pg.structures.fancy.popupTopLinks;
pg.structures.fancy.popupRedirOtherLinks=pg.structures.fancy.popupOtherLinks;


/** -- fancy2 -- **/
// hack for [[User:MacGyverMagic]]
copyStructure('fancy', 'fancy2');
pg.structures.fancy2.popupTopLinks=function(x) { // hack out the <br> at the end and put one at the beginning
return '<br>'+pg.structures.fancy.popupTopLinks(x).replace(RegExp('<br>$','i'),'');
};
pg.structures.fancy2.popupLayout=function () { // move toplinks to after the title
return ['popupError', 'popupImage', 'popupTitle', 'popupData', 'popupTopLinks', 'popupOtherLinks',
'popupRedir', ['popupWarnRedir', 'popupRedirTopLinks', 'popupRedirTitle', 'popupRedirData', 'popupRedirOtherLinks'],
'popupMiscTools', ['popupRedlink'],
'popupPrePreviewSep', 'popupPreview', 'popupSecondPreview', 'popupPostPreview', 'popupFixDab'];
};

/** -- menus -- **/
copyStructure('original', 'menus');
pg.structures.menus.popupLayout=function () {
return ['popupError', 'popupImage', 'popupTopLinks', 'popupTitle', 'popupOtherLinks',
'popupRedir', ['popupWarnRedir', 'popupRedirTopLinks', 'popupRedirTitle', 'popupRedirData', 'popupRedirOtherLinks'],
'popupData', 'popupMiscTools', ['popupRedlink'],
'popupPrePreviewSep', 'popupPreview', 'popupSecondPreview', 'popupPostPreview', 'popupFixDab'];
};
function toggleSticky(uid) {
var popDiv=document.getElementById('navpopup_maindiv'+uid);
if (!popDiv) { return; }
if (!popDiv.navpopup.sticky) { popDiv.navpopup.stick(); }
else {
popDiv.navpopup.unstick();
popDiv.navpopup.hide();
}
}
pg.structures.menus.popupTopLinks = function (x, shorter) {
// FIXME this stuff should be cached
var s=[];
var dropdiv='<div class="popup_drop">';
var enddiv='</div>';
var endspan='</span>';
var hist='<<history|shortcut=h>>';
if (!shorter) { hist = '<menurow>' + hist +
'|<<historyfeed|rss>>if(mainspace_en){|<<editors|shortcut=E>>}</menurow>'; }
var lastedit='<<lastEdit|shortcut=/|show last edit>>';
var jsHistory='<<lastContrib|last set of edits>><<sinceMe|changes since mine>>';
var linkshere='<<whatLinksHere|shortcut=l|what links here>>';
var related='<<relatedChanges|shortcut=r|related changes>>';
var search='<menurow><<search|shortcut=s>>if(wikimedia){|<<globalsearch|shortcut=g|global>>}' +
'|<<google|shortcut=G|web>></menurow>';
var watch='<menurow><<unwatch|unwatchShort>>|<<watch|shortcut=w|watchThingy>></menurow>';
var protect='<<unprotect|unprotectShort>>|<<protect|shortcut=p>>|<<protectlog|log>>';
var del='<<undelete|undeleteShort>>|<<delete|shortcut=d>>|<<deletelog|log>>';
var move='<<move|shortcut=m|move page>>';
var nullPurge='<menurow><<nullEdit|shortcut=n|null edit>>|<<purge|shortcut=P>></menurow>';
var viewOptions='<menurow><<view|shortcut=v>>|<<render|shortcut=S>>|<<raw>></menurow>';
var editRow='if(oldid){<menurow><<edit|shortcut=e>>|<<editOld|shortcut=e|this&nbsp;revision>></menurow>' +
'<<revert|shortcut=v>>' + '}else{<<edit|shortcut=e>>}';
var newTopic='if(talk){<<new|shortcut=+|new topic>>}';
var protectDelete='if(admin){<menurow>' + protect + '</menurow><menurow>' + del + '</menurow>}';

if (getValueOf('popupActionsMenu')) {
s.push( '<<mainlink>>*' + dropdiv + '<a href="#">'+popupString('actions') + '</a>');
} else {
s.push( dropdiv + '<<mainlink>>');
}
s.push( '<menu>')
s.push( editRow + newTopic + hist + lastedit )
if (!shorter) { s.push(jsHistory); }
s.push( move + linkshere + related)
if (!shorter) { s.push(nullPurge + search); }
if (!shorter) { s.push(viewOptions); }
s.push('<hr>' + watch + protectDelete);
s.push('<hr>' +
'if(talk){<<article|shortcut=a|view article>><<editArticle|edit article>>}' +
'else{<<talk|shortcut=t|talk page>><<editTalk|edit talk>>' +
'<<newTalk|shortcut=+|new topic>>}</menu>' + enddiv);

// user menu starts here
var email='<<email|shortcut=E|email user>>';
var contribs= 'if(wikimedia){<menurow>}<<contribs|shortcut=c|contributions>>' +
'if(wikimedia){|<<contribsTree|tree>></menurow>}';

s.push('if(user){*' + dropdiv + '<a href="#">'+popupString('user')+'</a>');
s.push('<menu>'); +
s.push('<menurow><<userPage|shortcut=u|user&nbsp;page>>|<<userSpace|space>></menurow>');
s.push('<<userTalk|shortcut=t|user talk>><<editUserTalk|edit user talk>>' +
'<<newUserTalk|shortcut=+|leave comment>>');
if(!shorter) { s.push( 'if(ipuser){<<arin>>}else{' + email + '}') }
else { s.push( 'if(ipuser){}else{' + email + '}') }
s.push('<hr>' + contribs + '<<userlog|shortcut=L|user log>>');
s.push('if(wikimedia){<<count|shortcut=#|edit counter>>}');
s.push('if(admin){<menurow><<unblock|unblockShort>>|<<block|shortcut=b|block user>></menurow>}');
s.push('<<blocklog|shortcut=B|block log>>' + getValueOf('popupExtraUserMenu'));
s.push('</menu>' + enddiv + '}');

// popups menu starts here
if (getValueOf('popupSetupMenu') && !x.navpop.hasPopupMenu /* FIXME: hack */) {
x.navpop.hasPopupMenu=true;
s.push('*' + dropdiv + '<a href="#">' + popupString('popupsMenu') + '</a><menu>');
s.push('<<togglePreviews|toggle previews>>');
s.push('<<purgePopups|reset>>');
s.push('<<disablePopups|disable>>');
s.push('</menu>'+enddiv);
}
return navlinkStringToHTML(s.join(''), x.article, x.oldid);
};

pg.structures.menus.popupRedirTitle=pg.structures.menus.popupTitle;
pg.structures.menus.popupRedirTopLinks=pg.structures.menus.popupTopLinks;

copyStructure('menus', 'shortmenus');
pg.structures.shortmenus.popupTopLinks=function(x) {
return pg.structures.menus.popupTopLinks(x,true);
};
pg.structures.shortmenus.popupRedirTopLinks=pg.structures.shortmenus.popupTopLinks;

//</NOLITE>
pg.structures.lite={};
pg.structures.lite.popupLayout=function () {
return ['popupTitle', 'popupPreview' ];
};
pg.structures.lite.popupTitle=function (x) {
log (x.article + ': structures.lite.popupTitle');
//return navlinkStringToHTML('<b><<mainlink>></b>',x.article,x.oldid);
return '<div><span class="popup_mainlink"><b>' + x.article.toString() + '</b></span></div>';
};
// ENDFILE: structures.js
// STARTFILE: autoedit.js
//<NOLITE>
function getParamValue(paramName, h) {
if (typeof h == 'undefined' ) { h = document.location.href; }
var cmdRe=RegExp('[&?]'+paramName+'=([^&]*)');
var m=cmdRe.exec(h);
if (m) {
try {
return decodeURI(m[1]);
} catch (someError) {}
}
return null;
}

function substitute(data,cmdBody) {
// alert('sub\nfrom: '+cmdBody.from+'\nto: '+cmdBody.to+'\nflags: '+cmdBody.flags);
var fromRe=RegExp(cmdBody.from, cmdBody.flags);
//console.log(fromRe);
return data.replace(fromRe, cmdBody.to);
}

function execCmds(data, cmdList) {
for (var i=0; i<cmdList.length; ++i) {
data=cmdList[i].action(data, cmdList[i]);
}
return data;
}

function parseCmd(str) {
// returns a list of commands
if (!str.length) { return []; }
var p=false;
switch (str.charAt(0)) {
case 's':
p=parseSubstitute(str);
break;
default:
return false;
}
if (p) { return [p].concat(parseCmd(p.remainder)); }
return false;
}

function unEscape(str, sep) {
return str.split('\\\\').join('\\').split('\\'+sep).join(sep).split('\\n').join('\n');
}


function parseSubstitute(str) {
// takes a string like s/a/b/flags;othercmds and parses it

var from,to,flags,tmp;

if (str.length<4) { return false; }
var sep=str.charAt(1);
str=str.substring(2);

tmp=skipOver(str,sep);
if (tmp) { from=tmp.segment; str=tmp.remainder; }
else { return false; }

tmp=skipOver(str,sep);
if (tmp) { to=tmp.segment; str=tmp.remainder; }
else { return false; }

flags='';
if (str.length) {
tmp=skipOver(str,';') || skipToEnd(str, ';');
if (tmp) {flags=tmp.segment; str=tmp.remainder; }
}

return {action: substitute, from: from, to: to, flags: flags, remainder: str};

}

function skipOver(str,sep) {
var endSegment=findNext(str,sep);
if (endSegment<0) { return false; }
var segment=unEscape(str.substring(0,endSegment), sep);
return {segment: segment, remainder: str.substring(endSegment+1)};
}

function skipToEnd(str,sep) {
return {segment: str, remainder: ''};
}

function findNext(str, ch) {
for (var i=0; i<str.length; ++i) {
if (str.charAt(i)=='\\') { i+=2; }
if (str.charAt(i)==ch) { return i; }
}
return -1;
}

function setCheckbox(param, box) {
var val=getParamValue(param);
if (val!==null) {
switch (val) {
case '1': case 'yes': case 'true':
box.checked=true;
break;
case '0': case 'no': case 'false':
box.checked=false;
}
}
}

function autoEdit() {
if (!document.editform) { return false; }
if (window.autoEdit.alreadyRan) { return false; }
window.autoEdit.alreadyRan=true;
var cmdString=getParamValue('autoedit');
if (cmdString) {
try {
var editbox=document.editform.wpTextbox1;
} catch (dang) { return; }
var cmdList=parseCmd(cmdString);
var input=editbox.value;
var output=execCmds(input, cmdList);
editbox.value=output;
}
setCheckbox('autominor', document.editform.wpMinoredit);
setCheckbox('autowatch', document.editform.wpWatchthis);

var rvid = getParamValue('autorv');
if (getValueOf('popupUseQueryInterface') && getParamValue('autorv')) {
var url=pg.wiki.wikibase + '/query.php?format=json&what=revisions&revids='+rvid;
startDownload(url, null, autoEdit2);
} else { autoEdit2(); }
}

function autoEdit2(d) {
var summary=getParamValue('autosummary');
var summaryprompt=getParamValue('autosummaryprompt');
var summarynotice='';
if (d && d.data && getParamValue('autorv')) {
var s = getRvSummary(summary, d.data);
if (s===false) {
summaryprompt=true;
summarynotice=popupString('Failed to get revision information, please edit manually.\n\n');
summary = simplePrintf(summary, [getParamValue('autorv'), '(unknown)', '(unknown)']);
} else { summary = s; }
}
if (summaryprompt) {
var txt= summarynotice +
popupString('Enter a non-empty edit summary or press cancel to abort');
var response=prompt(txt, summary);
if (response) { summary=response; }
else { return; }
}
if (summary) { document.editform.wpSummary.value=summary; }
// Attempt to avoid possible premature clicking of the save button
// (maybe delays in updates to the DOM are to blame?? or a red herring)
setTimeout(autoEdit3, 100);
}

function autoEdit3() {
var btn=getParamValue('autoclick');
if (btn) {
if (document.editform && document.editform[btn]) {
var button=document.editform[btn];
var msg=tprintf('The %s button has been automatically clicked. Please wait for the next page to load.',
[ button.value ]);
bannerMessage(msg);
document.title='('+document.title+')';
button.click();
} else {
alert(tprintf('Could not find button %s. Please check the settings in your javascript file.',
[ btn ]));
}
}
}

function bannerMessage(s) {
var headings=document.getElementsByTagName('h1');
if (headings) {
var div=document.createElement('div');
div.innerHTML='<font size=+1><b>' + s + '</b></font>';
headings[0].parentNode.insertBefore(div, headings[0]);
}
}

function getRvSummary(template, json) {
var o=getJsObj(json);
try {
var edit = anyChild(o.pages).revisions[0];
} catch (badness) {return false;}
var timestamp = edit.timestamp.split(/[A-Z]/g).join(' ').replace(/^ *| *$/g, '');
return simplePrintf(template, [edit.revid, timestamp, edit.user]);
}

addOnloadHook(autoEdit);
//</NOLITE>
// ENDFILE: autoedit.js
// STARTFILE: downloader.js
/**
@fileoverview
{@link Downloader}, a xmlhttprequest wrapper, and helper functions.
*/

/**
Creates a new Downloader
@constructor
@class The Downloader class. Create a new instance of this class to download stuff.
@param {String} url The url to download. This can be omitted and supplied later.
*/
function Downloader(url) {
// Source: http://jibbering.com/2002/4/httprequest.html
/** xmlhttprequest object which we're wrapping */
this.http = false;

/*@cc_on @*/
/*@if (@_jscript_version >= 5)
// JScript gives us Conditional compilation,
// we can cope with old IE versions.
// and security blocked creation of the objects.
try {
this.http = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
this.http = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
// this.http = false;
}
}
@end @*/

if (! this.http && typeof XMLHttpRequest!='undefined') { this.http = new XMLHttpRequest(); }
/**
The url to download
@type String
*/
this.url = url;
/**
A universally unique ID number
@type integer
*/
this.id=null;
/**
Modification date, to be culled from the incoming headers
@type Date
@private
*/
this.lastModified = null;
/**
What to do when the download completes successfully
@type Function
@private
*/
this.callbackFunction = null;
/**
What to do on failure
@type Function
@private
*/
this.onFailure = null;
/**
Flag set on <code>abort</code>
@type boolean
*/
this.aborted = false;
/**
HTTP method. See http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html for possibilities.
@type String
*/
this.method='GET';
/**
Async flag.
@type boolean
*/
this.async=true;
}

new Downloader();

/** Submits the http request. */
Downloader.prototype.send = function (x) {
if (!this.http) { return null; }
return this.http.send(x);
};
/** Aborts the download, setting the <code>aborted</code> field to true. */
Downloader.prototype.abort = function () {
if (!this.http) { return null; }
this.aborted=true;
return this.http.abort();
};
/** Returns the downloaded data. */
Downloader.prototype.getData = function () {if (!this.http) { return null; } return this.http.responseText;};
/** Prepares the download. */
Downloader.prototype.setTarget = function () {
if (!this.http) { return null; }
this.http.open(this.method, this.url, this.async);
};
/** Gets the state of the download. */
Downloader.prototype.getReadyState=function () {if (!this.http) { return null; } return this.http.readyState;};

pg.misc.downloadsInProgress = { };

/** Starts the download.
Note that setTarget {@link Downloader#setTarget} must be run first
*/
Downloader.prototype.start=function () {
if (!this.http) { return; }
pg.misc.downloadsInProgress[this.id] = this;
this.http.send(null);
};

/** Gets the 'Last-Modified' date from the download headers.
Should be run after the download completes.
Returns <code>null</code> on failure.
@return {Date}
*/
Downloader.prototype.getLastModifiedDate=function () {
if(!this.http) { return null; }
var lastmod=null;
try {
lastmod=this.http.getResponseHeader('Last-Modified');
} catch (err) {}
if (lastmod) { return new Date(lastmod); }
return null;
};

/** Sets the callback function.
@param {Function} f callback function, called as <code>f(this)</code> on success
*/
Downloader.prototype.setCallback = function (f) {
if(!this.http) { return; }
this.http.onreadystatechange = f;
};

Downloader.prototype.getStatus = function() { if (!this.http) { return null; } return this.http.status; };

//////////////////////////////////////////////////
// helper functions

/** Creates a new {@link Downloader} and prepares it for action.
@param {String} url The url to download
@param {integer} id The ID of the {@link Downloader} object
@param {Function} callback The callback function invoked on success
@return {String/Downloader} the {@link Downloader} object created, or 'ohdear' if an unsupported browser
*/
function newDownload(url, id, callback, onfailure) {
var d=new Downloader(url);
if (!d.http) { return 'ohdear'; }
d.id=id;
d.setTarget();
if (!onfailure) {
onfailure=2;
}
var f = function () {
if (d.getReadyState() == 4) {
delete pg.misc.downloadsInProgress[this.id];
try {
if ( d.getStatus() == 200 ) {
d.data=d.getData();
d.lastModified=d.getLastModifiedDate();
callback(d);
} else if (typeof onfailure == typeof 1) {
if (onfailure > 0) {
// retry
newDownload(url, id, callback, onfailure - 1);
}
} else if (typeof onfailure == 'function') {
onfailure(d,url,id,callback);
}
} catch (somerr) { /* ignore it */ }
}
};
d.setCallback(f);
return d;
}
/** Simulates a download from cached data.
The supplied data is put into a {@link Downloader} as if it had downloaded it.
@param {String} url The url.
@param {integer} id The ID.
@param {Function} callback The callback, which is invoked immediately as <code>callback(d)</code>,
where <code>d</code> is the new {@link Downloader}.
@param {String} data The (cached) data.
@param {Date} lastModified The (cached) last modified date.
*/
function fakeDownload(url, id, callback, data, lastModified, owner) {
var d=newDownload(url,callback);
d.owner=owner;
d.id=id; d.data=data;
d.lastModified=lastModified;
return callback(d);
}

/**
Starts a download.
@param {String} url The url to download
@param {integer} id The ID of the {@link Downloader} object
@param {Function} callback The callback function invoked on success
@return {String/Downloader} the {@link Downloader} object created, or 'ohdear' if an unsupported browser
*/
function startDownload(url, id, callback) {
var d=newDownload(url, id, callback);
if (typeof d == typeof '' ) { return d; }
d.start();
return d;
}

/**
Aborts all downloads which have been started.
*/
function abortAllDownloads() {
for ( var x in pg.misc.downloadsInProgress ) {
try {
pg.misc.downloadsInProgress[x].aborted=true;
pg.misc.downloadsInProgress[x].abort();
delete pg.misc.downloadsInProgress[x];
} catch (e) { }
}
}
// ENDFILE: downloader.js
// STARTFILE: livepreview.js
// TODO: location is often not correct (eg relative links in previews)

/**
* InstaView - a Mediawiki to HTML converter in JavaScript
* Version 0.6.1
* Copyright (C) Pedro Fayolle 2005-2006
* http://en.wikipedia.org/wiki/User:Pilaf
* Distributed under the BSD license
*
* Changelog:
*
* 0.6.1
* - Fixed problem caused by \r characters
* - Improved inline formatting parser
*
* 0.6
* - Changed name to InstaView
* - Some major code reorganizations and factored out some common functions
* - Handled conversion of relative links (i.e. [[/foo]])
* - Fixed misrendering of adjacent definition list items
* - Fixed bug in table headings handling
* - Changed date format in signatures to reflect Mediawiki's
* - Fixed handling of [[:Image:...]]
* - Updated MD5 function (hopefully it will work with UTF-8)
* - Fixed bug in handling of links inside images
*
* To do:
* - Better support for <math>
* - Full support for <nowiki>
* - Parser-based (as opposed to RegExp-based) inline wikicode handling (make it one-pass and bullet-proof)
* - Support for templates (through AJAX)
* - Support for coloured links (AJAX)
*/


var Insta = {}

function setupLivePreview() {

// options
Insta.conf =
{
baseUrl: '',

user: {},

wiki: {
lang: pg.wiki.lang,
interwiki: pg.wiki.interwiki,
default_thumb_width: 180
},

paths: {
articles: '/' + joinPath([pg.wiki.prePath, pg.wiki.articlePath]) + '/',
math: '/math/', // FIXME
images: ( window.getImageUrlStart ? getImageUrlStart(pg.wiki.hostname) : ''),
images_fallback: 'http://upload.wikimedia.org/wikipedia/commons/',
magnify_icon: 'skins/common/images/magnify-clip.png'
},

locale: {
user: pg.ns.user,
image: pg.ns.image,
category: pg.ns.category,
// shouldn't be used in popup previews, i think
months: ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']
}
}

// options with default values or backreferences
with (Insta.conf) {
user.name = user.name || 'Wikipedian'
user.signature = '[['+locale.user+':'+user.name+'|'+user.name+']]'
//paths.images = 'http://upload.wikimedia.org/wikipedia/' + wiki.lang + '/'
}

// define constants
Insta.BLOCK_IMAGE = new RegExp('^\\[\\['+Insta.conf.locale.image+
':.*?\\|.*?(?:frame|thumbnail|thumb|none|right|left|center)', 'i');

}


Insta.dump = function(from, to)
{
if (typeof from == 'string') from = document.getElementById(from)
if (typeof to == 'string') to = document.getElementById(to)
to.innerHTML = this.convert(from.value)
}

Insta.convert = function(wiki)
{
var ll = (typeof wiki == 'string')? wiki.replace(/\r/g,'').split(/\n/): wiki, // lines of wikicode
o='', // output
p=0, // para flag
$r // result of passing a regexp to $()

// some shorthands
function remain() { return ll.length }
function sh() { return ll.shift() } // shift
function ps(s) { o+=s } // push

function f() // similar to C's printf, uses ? as placeholders, ?? to escape question marks
{
var i=1,a=arguments,f=a[0],o='',c,p
for (;i<a.length; i++) if ((p=f.indexOf('?'))+1) {
// allow character escaping
i -= c=f.charAt(p+1)=='?'?1:0
o += f.substring(0,p)+(c?'?':a[i])
f=f.substr(p+1+c)
} else break;
return o+f
}

function html_entities(s) { return s.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;") }

function max(a,b) { return (a>b)?a:b }
function min(a,b) { return (a<b)?a:b }

// return the first non matching character position between two strings
function str_imatch(a, b)
{
for (var i=0, l=min(a.length, b.length); i<l; i++) if (a.charAt(i)!=b.charAt(i)) break
return i
}

// compare current line against a string or regexp
// if passed a string it will compare only the first string.length characters
// if passed a regexp the result is stored in $r
function $(c) { return (typeof c == 'string') ? (ll[0].substr(0,c.length)==c) : ($r = ll[0].match(c)) }

function $$(c) { return ll[0]==c } // compare current line against a string
function _(p) { return ll[0].charAt(p) } // return char at pos p

function endl(s) { ps(s); sh() }

function parse_list()
{
var prev='';

while (remain() && $(/^([*#:;]+)(.*)$/)) {

var l_match = $r

sh()

var ipos = str_imatch(prev, l_match[1])

// close uncontinued lists
for (var i=prev.length-1; i >= ipos; i--) {

var pi = prev.charAt(i)

if (pi=='*') ps('</ul>')
else if (pi=='#') ps('</ol>')
// close a dl only if the new item is not a dl item (:, ; or empty)
else switch (l_match[1].charAt(i)) { case'':case'*':case'#': ps('</dl>') }
}

// open new lists
for (var i=ipos; i<l_match[1].length; i++) {

var li = l_match[1].charAt(i)

if (li=='*') ps('<ul>')
else if (li=='#') ps('<ol>')
// open a new dl only if the prev item is not a dl item (:, ; or empty)
else switch(prev.charAt(i)) { case'':case'*':case'#': ps('<dl>') }
}

switch (l_match[1].charAt(l_match[1].length-1)) {

case '*': case '#':
ps('<li>' + parse_inline_nowiki(l_match[2])); break

case ';':
ps('<dt>')

var dt_match

// handle ;dt :dd format
if (dt_match = l_match[2].match(/(.*?)(:.*?)$/)) {

ps(parse_inline_nowiki(dt_match[1]))
ll.unshift(dt_match[2])

} else ps(parse_inline_nowiki(l_match[2]))

break

case ':':
ps('<dd>' + parse_inline_nowiki(l_match[2]))
}

prev=l_match[1]
}

// close remaining lists
for (var i=prev.length-1; i>=0; i--)
ps(f('</?>', (prev.charAt(i)=='*')? 'ul': ((prev.charAt(i)=='#')? 'ol': 'dl')))
}

function parse_table()
{
endl(f('<table?>', $(/^\{\|( .*)$/)? $r[1]: ''))

for (;remain();) if ($('|')) switch (_(1)) {
case '}': endl('</table>'); return
case '-': endl(f('<tr ?>', $(/\|-*(.*)/)[1])); break
default: parse_table_data()
}
else if ($('!')) parse_table_data()
else sh()
}

function parse_table_data()
{
var td_line, match_i

// 1: "|+", '|' or '+'
// 2: ??
// 3: attributes ??
// TODO: finish commenting this regexp
var td_match = sh().match(/^(\|\+|\||!)((?:([^[|]*?)\|(?!\|))?(.*))$/)

if (td_match[1] == '|+') ps('<caption');
else ps('<t' + ((td_match[1]=='|')?'d':'h'))

if (typeof td_match[3] != 'undefined') {

ps(' ' + td_match[3])
match_i = 4

} else match_i = 2

ps('>')

if (td_match[1] != '|+') {

// use || or !! as a cell separator depending on context
// NOTE: when split() is passed a regexp make sure to use non-capturing brackets
td_line = td_match[match_i].split((td_match[1] == '|')? '||': /(?:\|\||!!)/)

ps(parse_inline_nowiki(td_line.shift()))

while (td_line.length) ll.unshift(td_match[1] + td_line.pop())

} else ps(td_match[match_i])

var tc = 0, td = []

for (;remain(); td.push(sh()))
if ($('|')) {
if (!tc) break // we're at the outer-most level (no nested tables), skip to td parse
else if (_(1)=='}') tc--
}
else if (!tc && $('!')) break
else if ($('{|')) tc++

if (td.length) ps(Insta.convert(td))
}

function parse_pre()
{
ps('<pre>')
do endl(parse_inline_nowiki(ll[0].substring(1)) + "\n"); while (remain() && $(' '))
ps('</pre>')
}

function parse_block_image()
{
ps(parse_image(sh()))
}

function parse_image(str)
{
//<NOLITE>
// get what's in between "[[Image:" and "]]"
var tag = str.substring(Insta.conf.locale.image.length + 3, str.length - 2);

var width;
var attr = [], filename, caption = '';
var thumb=0, frame=0, center=0;
var align='';

if (tag.match(/\|/)) {
// manage nested links
var nesting = 0;
var last_attr;
for (var i = tag.length-1; i > 0; i--) {
if (tag.charAt(i) == '|' && !nesting) {
last_attr = tag.substr(i+1);
tag = tag.substring(0, i);
break;
} else switch (tag.substr(i-1, 2)) {
case ']]':
nesting++;
i--;
break;
case '[[':
nesting--;
i--;
}
}

attr = tag.split(/\s*\|\s*/);
attr.push(last_attr);
filename = attr.shift();

var w_match;

for (;attr.length; attr.shift())
if (w_match = attr[0].match(/^(\d*)px$/)) width = w_match[1]
else switch(attr[0]) {
case 'thumb':
case 'thumbnail':
thumb=true;
case 'frame':
frame=true;
break;
case 'none':
case 'right':
case 'left':
center=false;
align=attr[0];
break;
case 'center':
center=true;
align='none';
break;
default:
if (attr.length == 1) caption = attr[0];
}

} else filename = tag;


var o='';

if (frame) {

if (align=='') align = 'right';

o += f("<div class='thumb t?'>", align);

if (thumb) {
if (!width) width = Insta.conf.wiki.default_thumb_width;

o += f("<div style='width:?px;'>?", 2+width*1, make_image(filename, caption, width)) +
f("<div class='thumbcaption'><div class='magnify' style='float:right'><a href='?' class='internal' title='Enlarge'><img src='?'></a></div>?</div>",
Insta.conf.paths.articles + Insta.conf.locale.image + ':' + filename,
Insta.conf.paths.magnify_icon,
parse_inline_nowiki(caption)
)
} else {
o += '<div>' + make_image(filename, caption) + f("<div class='thumbcaption'>?</div>", parse_inline_nowiki(caption))
}

o += '</div></div>';

} else if (align != '') {
o += f("<div class='float?'><span>?</span></div>", align, make_image(filename, caption, width));
} else {
return make_image(filename, caption, width);
}

return center? f("<div class='center'>?</div>", o): o;
//</NOLITE>
}

function parse_inline_nowiki(str)
{
var start, lastend=0
var substart=0, nestlev=0, open, close, subloop;
var html='';

while (-1 != (start = str.indexOf('<nowiki>', substart))) {
html += parse_inline_wiki(str.substring(lastend, start));
start += 8;
substart = start;
subloop = true;
do {
open = str.indexOf('<nowiki>', substart);
close = str.indexOf('</nowiki>', substart);
if (close<=open || open==-1) {
if (close==-1) {
return html + html_entities(str.substr(start));
}
substart = close+9;
if (nestlev) {
nestlev--;
} else {
lastend = substart;
html += html_entities(str.substring(start, lastend-9));
subloop = false;
}
} else {
substart = open+8;
nestlev++;
}
} while (subloop)
}

return html + parse_inline_wiki(str.substr(lastend));
}

function make_image(filename, caption, width)
{
//<NOLITE>
// uppercase first letter in file name
filename = filename.charAt(0).toUpperCase() + filename.substr(1);
// replace spaces with underscores
filename = filename.replace(/ /g, '_');

caption = strip_inline_wiki(caption);

var md5 = hex_md5(filename);

var source = md5.charAt(0) + '/' + md5.substr(0,2) + '/' + filename;

if (width) width = "width='" + width + "px'";

var img = f("<img onerror=\"this.onerror=null;this.src='?'\" src='?' ? ?>", Insta.conf.paths.images_fallback + source, Insta.conf.paths.images + source, (caption!='')? "alt='" + caption + "'" : '', width);

return f("<a class='image' ? href='?'>?</a>", (caption!='')? "title='" + caption + "'" : '', Insta.conf.paths.articles + Insta.conf.locale.image + ':' + filename, img);
//</NOLITE>
}

function parse_inline_images(str)
{
//<NOLITE>
var start, substart=0, nestlev=0;
var loop, close, open, wiki, html;

while (-1 != (start=str.indexOf('[[', substart))) {
if(str.substr(start+2).match(RegExp('^' + Insta.conf.locale.image + ':','i'))) {
loop=true;
substart=start;
do {
substart+=2;
close=str.indexOf(']]',substart);
open=str.indexOf('[[',substart);
if (close<=open||open==-1) {
if (close==-1) return str;
substart=close;
if (nestlev) {
nestlev--;
} else {
wiki=str.substring(start,close+2);
html=parse_image(wiki);
str=str.replace(wiki,html);
substart=start+html.length;
loop=false;
}
} else {
substart=open;
nestlev++;
}
} while (loop)

} else break;
}

//</NOLITE>
return str;
}

// the output of this function doesn't respect the FILO structure of HTML
// but since most browsers can handle it I'll save myself the hassle
function parse_inline_formatting(str)
{
var em,st,i,li,o='';
while ((i=str.indexOf("''",li))+1) {
o += str.substring(li,i);
li=i+2;
if (str.charAt(i+2)=="'") {
li++;
st=!st;
o+=st?'<strong>':'</strong>';
} else {
em=!em;
o+=em?'<em>':'</em>';
}
}
return o+str.substr(li);
}

function parse_inline_wiki(str)
{
var aux_match;

str = parse_inline_images(str);
str = parse_inline_formatting(str);

// math
while (aux_match = str.match(/<(?:)math>(.*?)<\/math>/i)) {
var math_md5 = hex_md5(aux_match[1]);
str = str.replace(aux_match[0], f("<img src='?.png'>", Insta.conf.paths.math+math_md5));
}

// Build a Mediawiki-formatted date string
var date = new Date;
var minutes = date.getUTCMinutes();
if (minutes < 10) minutes = '0' + minutes;
var date = f("?:?, ? ? ? (UTC)", date.getUTCHours(), minutes, date.getUTCDate(), Insta.conf.locale.months[date.getUTCMonth()], date.getUTCFullYear());

// text formatting
return str.
// signatures
replace(/~{5}(?!~)/g, date).
replace(/~{4}(?!~)/g, Insta.conf.user.name+' '+date).
replace(/~{3}(?!~)/g, Insta.conf.user.name).

// [[:Category:...]], [[:Image:...]], etc...
replace(RegExp('\\[\\[:((?:'+Insta.conf.locale.category+'|'+Insta.conf.locale.image+'|'+Insta.conf.wiki.interwiki+'):.*?)\\]\\]','gi'), "<a href='"+Insta.conf.paths.articles+"$1'>$1</a>").
replace(RegExp('\\[\\[(?:'+Insta.conf.locale.category+'|'+Insta.conf.wiki.interwiki+'):.*?\\]\\]','gi'),'').

// [[/Relative links]]
replace(/\[\[(\/[^|]*?)\]\]/g, f("<a href='?$1'>$1</a>", Insta.conf.baseUrl)).

// [[/Replaced|Relative links]]
replace(/\[\[(\/.*?)\|(.+?)\]\]/g, f("<a href='?$1'>$2</a>", Insta.conf.baseUrl)).

// [[Common links]]
replace(/\[\[([^|]*?)\]\](\w*)/g, f("<a href='?$1'>$1$2</a>", Insta.conf.paths.articles)).

// [[Replaced|Links]]
replace(/\[\[(.*?)\|([^\]]+?)\]\](\w*)/g, f("<a href='?$1'>$2$3</a>", Insta.conf.paths.articles)).

// [[Stripped:Namespace|Namespace]]
replace(/\[\[([^\]]*?:)?(.*?)( *\(.*?\))?\|\]\]/g, f("<a href='?$1$2$3'>$2</a>", Insta.conf.paths.articles)).

// External links
replace(/\[(https?|news|ftp|mailto|gopher|irc):(\/*)([^\]]*?) (.*?)\]/g, "<a class='external' href='$1:$2$3'>$4</a>").
replace(/\[http:\/\/(.*?)\]/g, "<a class='external' href='http://$1'>[#]</a>").
replace(/\[(news|ftp|mailto|gopher|irc):(\/*)(.*?)\]/g, "<a class='external' href='$1:$2$3'>$1:$2$3</a>").
replace(/(^| )(https?|news|ftp|mailto|gopher|irc):(\/*)([^ $]*[^.,!?;: $])/g, "$1<a class='external' href='$2:$3$4'>$2:$3$4</a>").

replace('__NOTOC__','').
replace('__NOEDITSECTION__','');
}

function strip_inline_wiki(str)
{
return str
.replace(/\[\[[^\]]*\|(.*?)\]\]/g,'$1')
.replace(/\[\[(.*?)\]\]/g,'$1')
.replace(/''(.*?)''/g,'$1');
}

// begin parsing
for (;remain();) if ($(/^(={1,6})(.*)\1(.*)$/)) {
p=0
endl(f('<h?>?</h?>?', $r[1].length, parse_inline_nowiki($r[2]), $r[1].length, $r[3]))

} else if ($(/^[*#:;]/)) {
p=0
parse_list()

} else if ($(' ')) {
p=0
parse_pre()

} else if ($('{|')) {
p=0
parse_table()

} else if ($(/^----+$/)) {
p=0
endl('<hr>')

} else if ($(Insta.BLOCK_IMAGE)) {
p=0
parse_block_image()

} else {

// handle paragraphs
if ($$('')) {
if (p = (remain()>1 && ll[1]==(''))) endl('<p><br>')
} else {
if(!p) {
ps('<p>')
p=1
}
ps(parse_inline_nowiki(ll[0]) + ' ')
}

sh();
}

return o
};

window.wiki2html=function(txt,baseurl) {
Insta.conf.baseUrl=baseurl;
return Insta.convert(txt);
};
// ENDFILE: livepreview.js
// STARTFILE: pageinfo.js
//<NOLITE>
function popupFilterPageSize(data) {
return formatBytes(data.length);
}

function popupFilterCountLinks(data) {
var num=countLinks(data);
return String(num) + '&nbsp;' + ((num!=1)?popupString('wikiLinks'):popupString('wikiLink'));
}

function popupFilterCountImages(data) {
var num=countImages(data);
return String(num) + '&nbsp;' + ((num!=1)?popupString('images'):popupString('image'));
}

function popupFilterCountCategories(data) {
var num=countCategories(data);
return String(num) + '&nbsp;' + ((num!=1)?popupString('categories'):popupString('category'));
}


function popupFilterLastModified(data,download) {
var lastmod=download.lastModified;
var now=new Date();
var age=now-lastmod;
if (lastmod && getValueOf('popupLastModified')) {
return (tprintf('%s old', [formatAge(age)])).replace(RegExp(' ','g'), '&nbsp;');
}
return '';
}

function formatAge(age) {
// coerce into a number
var a=0+age, aa=a;

var seclen = 1000;
var minlen = 60*seclen;
var hourlen = 60*minlen;
var daylen = 24*hourlen;
var weeklen = 7*daylen;

var numweeks = (a-a%weeklen)/weeklen; a = a-numweeks*weeklen; var sweeks = addunit(numweeks, 'week');
var numdays = (a-a%daylen)/daylen; a = a-numdays*daylen; var sdays = addunit(numdays, 'day');
var numhours = (a-a%hourlen)/hourlen; a = a-numhours*hourlen; var shours = addunit(numhours,'hour');
var nummins = (a-a%minlen)/minlen; a = a-nummins*minlen; var smins = addunit(nummins, 'minute');
var numsecs = (a-a%seclen)/seclen; a = a-numsecs*seclen; var ssecs = addunit(numsecs, 'second');

if (aa > 4*weeklen) { return sweeks; }
if (aa > weeklen) { return sweeks + ' ' + sdays; }
if (aa > daylen) { return sdays + ' ' + shours; }
if (aa > 6*hourlen) { return shours; }
if (aa > hourlen) { return shours + ' ' + smins; }
if (aa > 10*minlen) { return smins; }
if (aa > minlen) { return smins + ' ' + ssecs; }
return ssecs;
}

function addunit(num,str) { return '' + num + ' ' + ((num!=1) ? popupString(str+'s') : popupString(str)) ;}

function runPopupFilters(list, data, download) {
//console.log('runPopupFilters');
var ret=[];
for (var i=0; i<list.length; ++i) {
if (list[i] && typeof list[i] == 'function') {
var s=list[i](data, download, download.owner.article);
if (s) { ret.push(s); }
}
}
//console.log(ret);
return ret;
}

function getPageInfo(data, download) {
//console.log('getPageInfo');
if (!data || data.length === 0) { return popupString('Empty page'); }

var popupFilters=getValueOf('popupFilters') || [];
var extraPopupFilters = getValueOf('extraPopupFilters') || [];
var pageInfoArray = runPopupFilters(popupFilters.concat(extraPopupFilters), data, download);

var pageInfo=pageInfoArray.join(', ');
if (pageInfo !== '' ) { pageInfo = upcaseFirst(pageInfo); }
return pageInfo;
}


// this could be improved!
function countLinks(wikiText) { return wikiText.split('[[').length - 1; }

// if N = # matches, n = # brackets, then
// String.parenSplit(regex) intersperses the N+1 split elements
// with Nn other elements. So total length is
// L= N+1 + Nn = N(n+1)+1. So N=(L-1)/(n+1).

function countImages(wikiText) {
return (wikiText.parenSplit(pg.re.image).length - 1) / (pg.re.imageBracketCount + 1);
}

function countCategories(wikiText) {
return (wikiText.parenSplit(pg.re.category).length - 1) / (pg.re.categoryBracketCount + 1);
}

function popupFilterStubDetect(data, download, article) {
//console.log('popupFilterStubDetect');
var counts=stubCount(data, article);
if (counts.real) { return popupString('stub'); }
if (counts.sect) { return popupString('section stub'); }
return '';
}

function popupFilterDisambigDetect(data, download, article) {
if (getValueOf('popupOnlyArticleDabStub') && article.namespace()) { return ''; }
return (isDisambig(data, article)) ? popupString('disambig') : '';
}

function formatBytes(num) {
return (num > 949) ? (Math.round(num/100)/10+popupString('kB')) : (num +'&nbsp;' + popupString('bytes')) ;
}
//</NOLITE>
// ENDFILE: pageinfo.js
// STARTFILE: titles.js
/**
@fileoverview Defines the {@link Title} class, and associated crufty functions.

<code>Title</code> deals with article titles and their various
forms. {@link Stringwrapper} is the parent class of
<code>Title</code>, which exists simply to make things a little
neater.

*/

/**
Creates a new Stringwrapper.
@constructor

@class the Stringwrapper class. This base class is not really
useful on its own; it just wraps various common string operations.
*/
function Stringwrapper() {
/**
Wrapper for this.toString().indexOf()
@param {String} x
@type integer
*/
this.indexOf=function(x){return this.toString().indexOf(x);};
/**
Returns this.value.
@type String
*/
this.toString=function(){return this.value;};
/**
Wrapper for {@link String#parenSplit} applied to this.toString()
@param {RegExp} x
@type Array
*/
this.parenSplit=function(x){return this.toString().parenSplit(x);};
/**
Wrapper for this.toString().substring()
@param {String} x
@param {String} y (optional)
@type String
*/
this.substring=function(x,y){
if (typeof y=='undefined') { return this.toString().substring(x); }
return this.toString().substring(x,y);
};
/**
Wrapper for this.toString().split()
@param {String} x
@type Array
*/
this.split=function(x){return this.toString().split(x);};
/**
Wrapper for this.toString().replace()
@param {String} x
@param {String} y
@type String
*/
this.replace=function(x,y){ return this.toString().replace(x,y); };
}


/**
Creates a new <code>Title</code>.
@constructor

@class The Title class. Holds article titles and converts them into
various forms. Also deals with anchors, by which we mean the bits
of the article URL after a # character, representing locations
within an article.

@param {String} value The initial value to assign to the
article. This must be the canonical title (see {@link
Title#value}. Omit this in the constructor and use another function
to set the title if this is unavailable.
*/
function Title(val) {
/**
The canonical article title. This must be in UTF-8 with no
entities, escaping or nasties. Also, underscores should be
replaced with spaces.
@type String
@private
*/
this.value=null;
/**
The canonical form of the anchor. This should be exactly as
it appears in the URL, i.e. with the .C3.0A bits in.
@type String
*/
this.anchor='';

this.setUtf(val);
}
Title.prototype=new Stringwrapper();
/**
Returns the canonical representation of the article title, optionally without anchor.
@param {boolean} omitAnchor
@fixme Decide specs for anchor
@return String The article title and the anchor.
*/
Title.prototype.toString=function(omitAnchor) {
return this.value + ( (!omitAnchor && this.anchor) ? '#' + this.anchorString() : '' );
};
Title.prototype.anchorString=function() {
if (!this.anchor) { return ''; }

var split=this.anchor.parenSplit(/((?:[.][0-9A-F]{2})+)/);
var len=split.length;
for (var j=1; j<len; j+=2) {
// FIXME s/decodeURI/decodeURIComponent/g ?
split[j]=decodeURIComponent(split[j].split('.').join('%')).split('_').join(' ');
}
return split.join('');
};
Title.prototype.urlAnchor=function() {
var split=this.anchor.parenSplit('/((?:[%][0-9A-F]{2})+)/');
var len=split.length;
for (var j=1; j<len; j+=2) {
split[j]=split[j].split('%').join('.');
}
return split.join('');
};
Title.fromURL=function(h) {
return new Title().fromURL(h);
};
Title.prototype.fromURL=function(h) {
if (typeof h != 'string') {
this.value=null;
return this;
}

// NOTE : playing with decodeURI, encodeURI, escape, unescape,
// we seem to be able to replicate the IE borked encoding

// IE doesn't do this new-fangled utf-8 thing.
// and it's worse than that.
// IE seems to treat the query string differently to the rest of the url
// the query is treated as bona-fide utf8, but the first bit of the url is pissed around with

// we fix up & for all browsers, just in case.
var splitted=h.split('?');
splitted[0]=splitted[0].split('&').join('%26');

if (pg.flag.linksLikeIE) {
splitted[0]=encodeURI(decode_utf8(splitted[0]));
}

h=splitted.join('?');

var contribs=pg.re.contribs.exec(h);
if (contribs !== null) {
if (contribs[1]=='title=') { contribs[3]=contribs[3].split('+').join(' '); }
this.setUtf(this.decodeNasties(pg.ns.user + ':' + contribs[3]));
return this;
}

var email=pg.re.email.exec(h);
if (email !== null) {
this.setUtf(this.decodeNasties(pg.ns.user + ':' + email[3]));
return this;
}

// no more special cases to check --
// hopefully it's not a disguised user-related page
var m=pg.re.main.exec(h);
if(m===null) { this.value=null; }
else {
var fromBotInterface = /[?](.+[&])?title=/.test(h);
if (fromBotInterface) {
m[2]=m[2].split('+').join('_');
}
var extracted = m[2] + (m[3] ? '#' + m[3] : '');
this.setUtf(this.decodeNasties(extracted));
}
return this;
};
Title.prototype.decodeNasties=function(txt) {
var ret= this.decodeEscapes(decodeURI(txt));
ret = ret.replace(/[_ ]*$/, '');
return ret;
};
Title.prototype.decodeEscapes=function(txt) {
var split=txt.parenSplit(/((?:[%][0-9A-Fa-f]{2})+)/);
var len=split.length;
for (var i=1; i<len; i=i+2) {
// FIXME is decodeURIComponent better?
split[i]=unescape(split[i]);
}
return split.join('');
};
Title.fromAnchor=function(a) {
return new Title().fromAnchor(a);
};
Title.prototype.fromAnchor=function(a) {
if (!a) { this.value=null; return this; }
return this.fromURL(a.href);
};
Title.fromWikiText=function(txt) {
return new Title().fromWikiText(txt);
};
Title.prototype.fromWikiText=function(txt) {
// FIXME - testing needed
if (!pg.flag.linksLikeIE) { txt=myDecodeURI(txt); }
this.setUtf(txt);
return this;
};
Title.prototype.hintValue=function(){
if(!this.value) { return ''; }
return safeDecodeURI(this.value);
};
//<NOLITE>
Title.prototype.toUserName=function(withNs) {
//console.log('toUserName, value='+this.value);
if (this.namespace() != pg.ns.user && this.namespace() != pg.ns.usertalk) {
this.value=null;
return;
}
this.value = (withNs ? pg.ns.user + ':' : '') + this.stripNamespace().split('/')[0];
//console.log(this.value);
};
Title.prototype.userName=function(withNs) {
var t=(new Title(this.value));
t.toUserName(withNs);
if (t.value) { return t; }
return null;
};
Title.prototype.toTalkPage=function() {
// convert article to a talk page, or if we can't return null
// or, in other words, return null if this ALREADY IS a talk page
// and return the corresponding talk page otherwise
if (this.value===null) { return null; }
var talkRegex=namespaceListToRegex(pg.ns.talkList);
if (talkRegex.exec(this.value)) { this.value=null; return null;}

var nsReg=namespaceListToRegex(pg.ns.withTalkList);
var splitted=this.value.parenSplit(nsReg);
if (splitted.length<2) {
this.value= (pg.ns.talkList[0]+':'+this.value).split(' ').join('_');
return this.value;
}
for (var i=0; i< pg.ns.withTalkList.length; ++i) {
if (splitted[1]==pg.ns.withTalkList[i]) {
splitted[1]=pg.ns.talkList[i];
this.value=splitted.join(':').substring(1).split(' ').join('_');
return this.value;
}
}
this.value=null;
return null;
};
//</NOLITE>
Title.prototype.namespace=function() {
var n=this.value.indexOf(':');
if (n<0) { return ''; }
var list=pg.ns.list;
for (var i=0; i<list.length; ++i) {
if (upcaseFirst(list[i]) == this.value.substring(0,n)) { return list[i]; }
}
return '';
};
//<NOLITE>
Title.prototype.talkPage=function() {
var t=new Title(this.value);
t.toTalkPage();
if (t.value) { return t; }
return null;
};
Title.prototype.isTalkPage=function() {
if (this.talkPage()===null) { return true; }
return false;
};
Title.prototype.toArticleFromTalkPage=function() {
var talkRegex=namespaceListToRegex(pg.ns.talkList);
var splitted=this.value.parenSplit(talkRegex);
if (splitted.length < 2 || splitted[0].length > 0) { this.value=null; return null; }
if (splitted[1]==pg.ns.talkList[0]) {
splitted[1]='';
this.value=splitted.join(':').substring(2).split(' ').join('_');
return this.value;
}
for (var i=1; i< pg.ns.talkList.length; ++i) {
if (splitted[1]==pg.ns.talkList[i] || splitted[1]==pg.ns.talkList[i].split(' ').join('_')) {
splitted[1]=pg.ns.withTalkList[i];
this.value= splitted.join(':').substring(1).split(' ').join('_');
return this.value;
}
}
this.value=null;
return this.value;
};
Title.prototype.articleFromTalkPage=function() {
var t=new Title(this.value);
t.toArticleFromTalkPage();
if (t.value) { return t; }
return null;
};
Title.prototype.articleFromTalkOrArticle=function() {
var t=new Title(this.value);
if ( t.toArticleFromTalkPage() ) { return t; }
return this;
};
Title.prototype.isIpUser=function() {
return pg.re.ipUser.test(this.userName());
};
//</NOLITE>
Title.prototype.stripNamespace=function(){ // returns a string, not a Title
// this isn't very sophisticated
// it just removes everything up to the final :
// BUG: probably does silly things for images with colons in the name - check it out
var list = this.value.split(':');
return list[list.length-1];
};
Title.prototype.setUtf=function(value){
if (!value) { this.value=''; return; }
var anch=value.indexOf('#');
if(anch < 0) { this.value=value.split('_').join(' '); this.anchor=''; return; }
this.value=value.substring(0,anch).split('_').join(' ');
this.anchor=value.substring(anch+1);
this.ns=null; // wait until namespace() is called
};
Title.prototype.setUrl=function(urlfrag) {
var anch=urlfrag.indexOf('#');
this.value=safeDecodeURI(urlfrag.substring(0,anch));
this.anchor=value.substring(anch+1);
};
Title.prototype.append=function(x){
this.setUtf(this.value + x);
};
Title.prototype.urlString=function(x) {
x || ( x={} );
var v=this.toString(true);
if (!x.omitAnchor && this.anchor) { v+= '#' + this.urlAnchor(); }
if (!x.keepSpaces) { v=v.split(' ').join('_'); }
return encodeURI(v).split('&').join('%26').split('?').join('%3F').split('+').join('%2B');
};
Title.prototype.removeAnchor=function() {
return new Title(this.toString(true));
};


function paramValue(param, url) {
var s=url.parenSplit(RegExp('[?&]' + literalizeRegex(param) + '=([^?&]*)'));
if (!url) { return null; }
return s[1] || null;
}

function parseParams(url) {
var ret={};
if (url.indexOf('?')==-1) { return ret; }
var s=url.split('?').slice(1).join();
var t=s.split('&');
for (var i=0; i<t.length; ++i) {
var z=t[i].split('=');
z.push(null);
ret[z[0]]=z[1];
}
return ret;
}

// all sorts of stuff here
// FIXME almost everything needs to be rewritten

function oldidFromAnchor(a) { return paramValue('oldid', a.href); }
//function diffFromAnchor(a) { return paramValue('diff', a.href); }


function wikiMarkupToAddressFragment (str) { // for images
var ret = safeDecodeURI(str);
ret = ret.split(' ').join('_');
ret = encodeURI(ret);
return ret;
}

// (a) myDecodeURI (first standard decodeURI, then pg.re.urlNoPopup)
// (b) change spaces to underscores
// (c) encodeURI (just the straight one, no pg.re.urlNoPopup)

function myDecodeURI (str) {
var ret;
// FIXME decodeURIComponent??
try { ret=decodeURI(str.toString()); }
catch (summat) { return str; }
for (var i=0; i<pg.misc.decodeExtras.length; ++i) {
var from=pg.misc.decodeExtras[i].from;
var to=pg.misc.decodeExtras[i].to;
ret=ret.split(from).join(to);
}
return ret;
}

function safeDecodeURI(str) { var ret=myDecodeURI(str); return ret || str; }

///////////
// TESTS //
///////////

//<NOLITE>
function isIpUser(user) {return pg.re.ipUser.test(user);}

function isDisambig(data, article) {
if (!getValueOf('popupAllDabsStubs') && article.namespace()) { return false; }
return ! article.isTalkPage() && pg.re.disambig.test(data);
}

function stubCount(data, article) {
//console.log('stubCount, article='+article);
if (!getValueOf('popupAllDabsStubs') && article.namespace()) { return false; }
var sectStub=0;
var realStub=0;
if (pg.re.stub.test(data)) {
var s=data.parenSplit(pg.re.stub);
for (var i=1; i<s.length; i=i+2) {
if (s[i]) { ++sectStub; }
else { ++realStub; }
}
}
return { real: realStub, sect: sectStub };
}

function isValidImageName(str){ // extend as needed...
return ( str.indexOf('{') == -1 );
}

function isInStrippableNamespace(article) {
return ( findInArray( pg.ns.nonArticleList, article.namespace() ) > -1 );
}

function isInMainNamespace(article) { return !isInStrippableNamespace(article); }

function anchorContainsImage(a) {
// iterate over children of anchor a
// see if any are images
if (a===null) { return false; }
kids=a.childNodes;
for (var i=0; i<kids.length; ++i) { if (kids[i].nodeName=='IMG') { return true; } }
return false;
}
//</NOLITE>
function isPopupLink(a) {
// NB for performance reasons, TOC links generally return true
// they should be stripped out later

// FIXME is this faster inline?
if (a.onclick) { return false; }
var h=a.href;
if ( (h.indexOf(pg.wiki.titlebase) === 0 || h.indexOf(pg.wiki.articlebase) === 0 ||
h.indexOf(pg.wiki.titlebase2) === 0 ) &&
!pg.re.urlNoPopup.test(h) ) {
return true;
}
return (
(pg.re.email.test(h) || pg.re.contribs.test(h)) &&
h.indexOf('&limit=') == -1 );
}
// ENDFILE: titles.js
// STARTFILE: cookies.js
//<NOLITE>
//////////////////////////////////////////////////
// Cookie handling
// from http://www.quirksmode.org/js/cookies.html

var Cookie= {
create: function(name,value,days)
{
var expires;
if (days)
{
var date = new Date();
date.setTime(date.getTime()+(days*24*60*60*1000));
expires = "; expires="+date.toGMTString();
}
else { expires = ""; }
document.cookie = name+"="+value+expires+"; path=/";
},

read: function(name)
{
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++)
{
var c = ca[i];
while (c.charAt(0)==' ') { c = c.substring(1,c.length); }
if (c.indexOf(nameEQ) === 0) { return c.substring(nameEQ.length,c.length); }
}
return null;
},

erase: function(name)
{
Cookie.create(name,"",-1);
}
};
//</NOLITE>
// ENDFILE: cookies.js
// STARTFILE: getpage.js
//////////////////////////////////////////////////
// Wiki-specific downloading
//

// Schematic for a getWiki call
//
// getWiki->-getPageWithCaching
// |
// false | true
// getPage<-[findPictureInCache]->-onComplete(a fake download)
// \.
// (async)->addPageToCache(download)->-onComplete(download)


/** @todo {document}
@param {Title} article
@param {Function} onComplete
@param {integer} oldid
@param {Navapopup} owner
*/
function getWiki(article, onComplete, oldid, owner) {
// set ctype=text/css to get around opera gzip bug
var url = pg.wiki.titlebase + article.removeAnchor().urlString() +
'&action=raw&ctype=text/css';
if (oldid || oldid===0 || oldid==='0') { url += '&oldid='+oldid; }
url += '&maxage=0&smaxage=0';

getPageWithCaching(url, onComplete, owner);
}

// check cache to see if page exists

function getPageWithCaching(url, onComplete, owner) {
log('getPageWithCaching, url='+url);
var i=findInPageCache(url);
if (i > -1) {
var d=fakeDownload(url, owner.idNumber, onComplete,
pg.cache.pages[i].data, pg.cache.pages[i].lastModified,
owner);
} else {
var d=getPage(url, onComplete, owner);
if (d && owner && owner.addDownload) {
owner.addDownload(d);
d.owner=owner;
}
}
}

function getPage(url, onComplete, owner) {
log('getPage');
var callback= function (d) { if (!d.aborted) {addPageToCache(d); onComplete(d);} };
return startDownload(url, owner.idNumber, callback);
}

function findInPageCache(url) {
for (var i=0; i<pg.cache.pages.length; ++i) {
if (url==pg.cache.pages[i].url) { return i; }
}
return -1;
}

function addPageToCache(download) {
log('addPageToCache '+download.url);
var page = {url: download.url, data: download.data, lastModified: download.lastModified};
return pg.cache.pages.push(page);
}
// ENDFILE: getpage.js
// STARTFILE: md5-2.2alpha.js
//<NOLITE>
/*
* A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
* Digest Algorithm, as defined in RFC 1321.
* Version 2.2-alpha Copyright (C) Paul Johnston 1999 - 2005
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
* Distributed under the BSD License
* See http://pajhome.org.uk/crypt/md5 for more info.
*/

/*
* Configurable variables. You may need to tweak these to be compatible with
* the server-side, but the defaults work in most cases.
*/
var hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */
var b64pad = ""; /* base-64 pad character. "=" for strict RFC compliance */

/*
* These are the functions you'll usually want to call
* They take string arguments and return either hex or base-64 encoded strings
*/
function hex_md5(s) { return rstr2hex(rstr_md5(str2rstr_utf8(s))); }
function b64_md5(s) { return rstr2b64(rstr_md5(str2rstr_utf8(s))); }
function any_md5(s, e) { return rstr2any(rstr_md5(str2rstr_utf8(s)), e); }
function hex_hmac_md5(k, d)
{ return rstr2hex(rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d))); }
function b64_hmac_md5(k, d)
{ return rstr2b64(rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d))); }
function any_hmac_md5(k, d, e)
{ return rstr2any(rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d)), e); }

/*
* Perform a simple self-test to see if the VM is working
*/
function md5_vm_test()
{
return hex_md5("abc") == "900150983cd24fb0d6963f7d28e17f72";
}

/*
* Calculate the MD5 of a raw string
*/
function rstr_md5(s)
{
return binl2rstr(binl_md5(rstr2binl(s), s.length * 8));
}

/*
* Calculate the HMAC-MD5, of a key and some data (raw strings)
*/
function rstr_hmac_md5(key, data)
{
var bkey = rstr2binl(key);
if(bkey.length > 16) bkey = binl_md5(bkey, key.length * 8);

var ipad = Array(16), opad = Array(16);
for(var i = 0; i < 16; i++)
{
ipad[i] = bkey[i] ^ 0x36363636;
opad[i] = bkey[i] ^ 0x5C5C5C5C;
}

var hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);
return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));
}

/*
* Convert a raw string to a hex string
*/
function rstr2hex(input)
{
var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
var output = "";
var x;
for(var i = 0; i < input.length; i++)
{
x = input.charCodeAt(i);
output += hex_tab.charAt((x >>> 4) & 0x0F)
+ hex_tab.charAt( x & 0x0F);
}
return output;
}

/*
* Convert a raw string to a base-64 string
*/
function rstr2b64(input)
{
var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var output = "";
var len = input.length;
for(var i = 0; i < len; i += 3)
{
var triplet = (input.charCodeAt(i) << 16)
| (i + 1 < len ? input.charCodeAt(i+1) << 8 : 0)
| (i + 2 < len ? input.charCodeAt(i+2) : 0);
for(var j = 0; j < 4; j++)
{
if(i * 8 + j * 6 > input.length * 8) output += b64pad;
else output += tab.charAt((triplet >>> 6*(3-j)) & 0x3F);
}
}
return output;
}

/*
* Convert a raw string to an arbitrary string encoding
*/
function rstr2any(input, encoding)
{
var divisor = encoding.length;
var remainders = Array();
var i, q, x, quotient;

/* Convert to an array of 16-bit big-endian values, forming the dividend */
var dividend = Array(input.length / 2);
for(i = 0; i < dividend.length; i++)
{
dividend[i] = (input.charCodeAt(i * 2) << 8) | input.charCodeAt(i * 2 + 1);
}

/*
* Repeatedly perform a long division. The binary array forms the dividend,
* the length of the encoding is the divisor. Once computed, the quotient
* forms the dividend for the next step. We stop when the dividend is zero.
* All remainders are stored for later use.
*/
while(dividend.length > 0)
{
quotient = Array();
x = 0;
for(i = 0; i < dividend.length; i++)
{
x = (x << 16) + dividend[i];
q = Math.floor(x / divisor);
x -= q * divisor;
if(quotient.length > 0 || q > 0)
quotient[quotient.length] = q;
}
remainders[remainders.length] = x;
dividend = quotient;
}

/* Convert the remainders to the output string */
var output = "";
for(i = remainders.length - 1; i >= 0; i--)
output += encoding.charAt(remainders[i]);

return output;
}

/*
* Encode a string as utf-8.
* For efficiency, this assumes the input is valid utf-16.
*/
function str2rstr_utf8(input)
{
var output = "";
var i = -1;
var x, y;

while(++i < input.length)
{
/* Decode utf-16 surrogate pairs */
x = input.charCodeAt(i);
y = i + 1 < input.length ? input.charCodeAt(i + 1) : 0;
if(0xD800 <= x && x <= 0xDBFF && 0xDC00 <= y && y <= 0xDFFF)
{
x = 0x10000 + ((x & 0x03FF) << 10) + (y & 0x03FF);
i++;
}

/* Encode output as utf-8 */
if(x <= 0x7F)
output += String.fromCharCode(x);
else if(x <= 0x7FF)
output += String.fromCharCode(0xC0 | ((x >>> 6 ) & 0x1F),
0x80 | ( x & 0x3F));
else if(x <= 0xFFFF)
output += String.fromCharCode(0xE0 | ((x >>> 12) & 0x0F),
0x80 | ((x >>> 6 ) & 0x3F),
0x80 | ( x & 0x3F));
else if(x <= 0x1FFFFF)
output += String.fromCharCode(0xF0 | ((x >>> 18) & 0x07),
0x80 | ((x >>> 12) & 0x3F),
0x80 | ((x >>> 6 ) & 0x3F),
0x80 | ( x & 0x3F));
}
return output;
}

/*
* Encode a string as utf-16
*/
function str2rstr_utf16le(input)
{
var output = "";
for(var i = 0; i < input.length; i++)
output += String.fromCharCode( input.charCodeAt(i) & 0xFF,
(input.charCodeAt(i) >>> 8) & 0xFF);
return output;
}

function str2rstr_utf16be(input)
{
var output = "";
for(var i = 0; i < input.length; i++)
output += String.fromCharCode((input.charCodeAt(i) >>> 8) & 0xFF,
input.charCodeAt(i) & 0xFF);
return output;
}

/*
* Convert a raw string to an array of little-endian words
* Characters >255 have their high-byte silently ignored.
*/
function rstr2binl(input)
{
var output = Array(input.length >> 2);
for(var i = 0; i < output.length; i++)
output[i] = 0;
for(var i = 0; i < input.length * 8; i += 8)
output[i>>5] |= (input.charCodeAt(i / 8) & 0xFF) << (i%32);
return output;
}

/*
* Convert an array of little-endian words to a string
*/
function binl2rstr(input)
{
var output = "";
for(var i = 0; i < input.length * 32; i += 8)
output += String.fromCharCode((input[i>>5] >>> (i % 32)) & 0xFF);
return output;
}

/*
* Calculate the MD5 of an array of little-endian words, and a bit length.
*/
function binl_md5(x, len)
{
/* append padding */
x[len >> 5] |= 0x80 << ((len) % 32);
x[(((len + 64) >>> 9) << 4) + 14] = len;

var a = 1732584193;
var b = -271733879;
var c = -1732584194;
var d = 271733878;

for(var i = 0; i < x.length; i += 16)
{
var olda = a;
var oldb = b;
var oldc = c;
var oldd = d;

a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);
d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);
c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819);
b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);
a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);
d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426);
c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);
b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);
a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416);
d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);
c = md5_ff(c, d, a, b, x[i+10], 17, -42063);
b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);
a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682);
d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);
c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);
b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329);

a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);
d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);
c = md5_gg(c, d, a, b, x[i+11], 14, 643717713);
b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);
a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);
d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083);
c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);
b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);
a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438);
d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);
c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);
b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501);
a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);
d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);
c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473);
b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);

a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);
d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);
c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562);
b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);
a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);
d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353);
c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);
b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);
a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174);
d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);
c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);
b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189);
a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);
d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);
c = md5_hh(c, d, a, b, x[i+15], 16, 530742520);
b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);

a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);
d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415);
c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);
b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);
a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571);
d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);
c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);
b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);
a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359);
d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);
c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);
b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649);
a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);
d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);
c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259);
b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);

a = safe_add(a, olda);
b = safe_add(b, oldb);
c = safe_add(c, oldc);
d = safe_add(d, oldd);
}
return Array(a, b, c, d);
}

/*
* These functions implement the four basic operations the algorithm uses.
*/
function md5_cmn(q, a, b, x, s, t)
{
return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);
}
function md5_ff(a, b, c, d, x, s, t)
{
return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
}
function md5_gg(a, b, c, d, x, s, t)
{
return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
}
function md5_hh(a, b, c, d, x, s, t)
{
return md5_cmn(b ^ c ^ d, a, b, x, s, t);
}
function md5_ii(a, b, c, d, x, s, t)
{
return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
}

/*
* Add integers, wrapping at 2^32. This uses 16-bit operations internally
* to work around bugs in some JS interpreters.
*/
function safe_add(x, y)
{
var lsw = (x & 0xFFFF) + (y & 0xFFFF);
var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
return (msw << 16) | (lsw & 0xFFFF);
}

/*
* Bitwise rotate a 32-bit number to the left.
*/
function bit_rol(num, cnt)
{
return (num << cnt) | (num >>> (32 - cnt));
}
//</NOLITE>
// ENDFILE: md5-2.2alpha.js
// STARTFILE: parensplit.js
//////////////////////////////////////////////////
// parenSplit

// String.prototype.parenSplit should do what ECMAscript says
// String.prototype.split does, interspersing paren matches between
// the split elements

if (String('abc'.split(/(b)/))!='a,b,c') {
// broken String.split, e.g. konq, IE
String.prototype.parenSplit=function (re) {
re=nonGlobalRegex(re);
var s=this;
var m=re.exec(s);
var ret=[];
while (m && s) {
// without the following loop, we have
// 'ab'.parenSplit(/a|(b)/) != 'ab'.split(/a|(b)/)
for(var i=0; i<m.length; ++i) {
if (typeof m[i]=='undefined') m[i]='';
}
ret.push(s.substring(0,m.index));
ret = ret.concat(m.slice(1));
s=s.substring(m.index + m[0].length);
m=re.exec(s);
}
ret.push(s);
return ret;
};
} else {
String.prototype.parenSplit=function (re) { return this.split(re); };
String.prototype.parenSplit.isNative=true;
}

function nonGlobalRegex(re) {
var s=re.toString();
flags='';
for (var j=s.length; s.charAt(j) != '/'; --j) {
if (s.charAt(j) != 'g') { flags += s.charAt(j); }
}
var t=s.substring(1,j);
return RegExp(t,flags);
}
// ENDFILE: parensplit.js
// STARTFILE: tools.js
// IE madness with encoding
// ========================
//
// suppose throughout that the page is in utf8, like wikipedia
//
// if a is an anchor DOM element and a.href should consist of
//
// http://host.name.here/wiki/foo?bar=baz
//
// then IE gives foo as "latin1-encoded" utf8; we have foo = decode_utf8(decodeURI(foo_ie))
// but IE gives bar=baz correctly as plain utf8
//
// ---------------------------------
//
// IE's xmlhttp doesn't understand utf8 urls. Have to use encodeURI here.
//
// ---------------------------------
//
// summat else

// Source: http://aktuell.de.selfhtml.org/artikel/javascript/utf8b64/utf8.htm

//<NOLITE>
function encode_utf8(rohtext) {
// dient der Normalisierung des Zeilenumbruchs
rohtext = rohtext.replace(/\r\n/g,"\n");
var utftext = "";
for(var n=0; n<rohtext.length; n++)
{
// ermitteln des Unicodes des aktuellen Zeichens
var c=rohtext.charCodeAt(n);
// alle Zeichen von 0-127 => 1byte
if (c<128)
utftext += String.fromCharCode(c);
// alle Zeichen von 127 bis 2047 => 2byte
else if((c>127) && (c<2048)) {
utftext += String.fromCharCode((c>>6)|192);
utftext += String.fromCharCode((c&63)|128);}
// alle Zeichen von 2048 bis 66536 => 3byte
else {
utftext += String.fromCharCode((c>>12)|224);
utftext += String.fromCharCode(((c>>6)&63)|128);
utftext += String.fromCharCode((c&63)|128);}
}
return utftext;
}


function getJsObj(json) {
var jsobj;
try {
eval('jsobj='+json);
return jsobj;
} catch (someError) {
log('Something went wrong with getJsobj, json='+json);
return 1;
}
}

function anyChild(obj) {
for (var p in obj) {
return obj[p];
}
return null;
}

//</NOLITE>

function decode_utf8(utftext) {
var plaintext = ""; var i=0; var c=c1=c2=0;
// while-Schleife, weil einige Zeichen uebersprungen werden
while(i<utftext.length)
{
c = utftext.charCodeAt(i);
if (c<128) {
plaintext += String.fromCharCode(c);
i++;}
else if((c>191) && (c<224)) {
c2 = utftext.charCodeAt(i+1);
plaintext += String.fromCharCode(((c&31)<<6) | (c2&63));
i+=2;}
else {
c2 = utftext.charCodeAt(i+1); c3 = utftext.charCodeAt(i+2);
plaintext += String.fromCharCode(((c&15)<<12) | ((c2&63)<<6) | (c3&63));
i+=3;}
}
return plaintext;
}


function upcaseFirst(str) {
if (typeof str != typeof '' || str=='') return '';
return str.charAt(0).toUpperCase() + str.substring(1);
}


function findInArray(arr, foo) {
if (!arr || !arr.length) { return -1; }
var len=arr.length;
for (var i=0; i<len; ++i) { if (arr[i]==foo) { return i; } }
return -1;
}

function nextOne (array, value) {
// NB if the array has two consecutive entries equal
// then this will loop on successive calls
var i=findInArray(array, value);
if (i<0) { return null; }
return array[i+1];
}

function literalizeRegex(str){
return str.replace(RegExp('([-.|()\\+?*^${}\\[\\]])', 'g'), '\\$1');
}

String.prototype.entify=function() {
//var shy='&shy;';
return this.split('&').join('&amp;').split('<').join('&lt;').split('>').join('&gt;'/*+shy*/).split('"').join('&quot;');
};

function findThis(array, value) {
if (typeof array.length == 'undefined') { return null; }
for (var i=0; i<array.length; ++i) {
if (array[i]==value) { return i; }
}
return null;
}

function removeNulls(list) {
var ret=[];
for (var i=0; i<list.length; ++i) {
if (list[i]) {
ret.push(list[i]);
}
}
return ret;
}
function joinPath(list) {
return removeNulls(list).join('/');
}


function simplePrintf(str, subs) {
if (!str || !subs) { return str; }
var ret=[];
var s=str.parenSplit(/(%s|\$[0-9]+)/);
var i=0;
do {
ret.push(s.shift());
if ( !s.length ) { break; }
var cmd=s.shift();
if (cmd == '%s') {
if ( i < subs.length ) { ret.push(subs[i]); } else { ret.push(cmd); }
++i;
} else {
var j=parseInt( cmd.replace('$', ''), 10 ) - 1;
if ( j > -1 && j < subs.length ) { ret.push(subs[j]); } else { ret.push(cmd); }
}
} while (s.length > 0);
return ret.join('');
}

function max(a,b){return a<b ? b : a;}
function min(a,b){return a>b ? b : a;}

function isString(x) { return (typeof x === 'string' || x instanceof String); }
//function isNumber(x) { return (typeof x === 'number' || x instanceof Number); }
function isRegExp(x) { return x instanceof RegExp; }
function isArray (x) { return x instanceof Array; }
function isObject(x) { return x instanceof Object; }
function isFunction(x) {
return !isRegExp(x) && (typeof x === 'function' || x instanceof Function);
}

function repeatString(s,mult) {
var ret='';
for (var i=0; i<mult; ++i) { ret += s; }
return ret;
}

function zeroFill(s, min) {
min = min || 2;
var t=s.toString();
return repeatString('0', min - t.length) + t;
}

function map(f, o) {
if (isArray(o)) { return map_array(f,o); }
return map_object(f,o);
}
function map_array(f,o) {
var ret=[];
for (var i=0; i<o.length; ++i) {
ret.push(f(o[i]));
}
return ret;
}
function map_object(f,o) {
var ret={};
for (var i in o) { ret[o]=f(o[i]); }
return ret;
}
// ENDFILE: tools.js
// STARTFILE: dab.js
//<NOLITE>
//////////////////////////////////////////////////
// Dab-fixing code
//


function retargetDab(newTarget, oldTarget, friendlyCurrentArticleName) {
log('retargetDab: newTarget='+newTarget + ' oldTarget=' + oldTarget);
return changeLinkTargetLink(
{newTarget: newTarget,
text: newTarget.split(' ').join('&nbsp;'),
hint: tprintf('disambigHint', [newTarget]),
summary: simplePrintf(
getValueOf('popupFixDabsSummary'), [friendlyCurrentArticleName, newTarget ]),
clickButton: 'wpDiff', minor: true, oldTarget: oldTarget,
watch: getValueOf('popupWatchDisambiggedPages')
});
}

function listLinks(wikitext, oldTarget) {
var reg=RegExp('\\[\\[([^|]*?)(\\||\\]\\])', 'gi');
var ret=[];
var splitted=wikitext.parenSplit(reg);
// ^[a-z]+ should match interwiki links, hopefully (case-insensitive)
// and ^[a-z]* should match those and [[:Category...]] style links too
var omitRegex=RegExp('^[a-z]*:|^[Ss]pecial:|^[Ii]mage|^[Cc]ategory');
var friendlyCurrentArticleName= oldTarget.toString();

for (var i=1; i<splitted.length; i=i+3) {
if (typeof splitted[i] == typeof 'string' && splitted[i].length>0 && !omitRegex.test(splitted[i])) {
ret.push( retargetDab(splitted[i], oldTarget, friendlyCurrentArticleName) );
} /* if */
} /* for loop */

ret = rmDupesFromSortedList(ret.sort());

var wikTarget='wiktionary:' + friendlyCurrentArticleName.replace( RegExp('^(.+)\\s+[(][^)]+[)]\\s*$'), '$1' );
ret.push( retargetDab(wikTarget, oldTarget, friendlyCurrentArticleName) );

ret.push(changeLinkTargetLink(
{ newTarget: null,
text: popupString('remove this link').split(' ').join('&nbsp;'),
hint: popupString("remove all links to this disambig page from this article"),
clickButton: "wpDiff", oldTarget: oldTarget,
summary: simplePrintf(getValueOf('popupRmDabLinkSummary'), [friendlyCurrentArticleName]),
watch: getValueOf('popupWatchDisambiggedPages')}));
return ret;
}

function rmDupesFromSortedList(list) {
var ret=[];
for (var i=0; i<list.length; ++i) {
if (ret.length===0 || list[i]!=ret[ret.length-1]) { ret.push(list[i]); }
}
return ret;
}

function makeFixDab(data, oldTarget) {
var list=listLinks(data, oldTarget);
if (list.length===0) { log('listLinks returned empty list'); return null; }
var html='<hr>' + popupString('Click to disambiguate this link to:') + '<br>';
html+=list[0];
for (var i=1; i<list.length; ++i) { html += ', '+list[i]; }
return html;
}


function makeFixDabs(wikiText, navpop) {
//console.log('makeFixDabs, navpop.article='+navpop.article.toString());
if (getValueOf('popupFixDabs') && isDisambig(wikiText, navpop.article) &&
Title.fromURL(location.href).namespace() != pg.ns.special &&
navpop.article.talkPage() ) {
//console.log('running makeFixDab');
setPopupHTML(makeFixDab(wikiText, navpop.originalArticle), 'popupFixDab', navpop.idNumber);
}
}

function popupRedlinkHTML(article) {
return changeLinkTargetLink(
{ newTarget: null, text: popupString('remove this link').split(' ').join('&nbsp;'),
hint: popupString("remove all links to this page from this article"),
clickButton: "wpDiff",
oldTarget: article.toString(),
summary: simplePrintf(getValueOf('popupRedlinkSummary'), [article.toString()])});
}
//</NOLITE>
// ENDFILE: dab.js
// STARTFILE: htmloutput.js
// this has to use a timer loop as we don't know if the DOM element exists when we want to set the text
function setPopupHTML (str, elementId, popupId, onSuccess) {
if (elementId=='popupPreview') {
//console.log('setPopupHTML, str='+str.substring(0,100)+', \n elementId='+elementId+', popupId='+popupId);
}
if (typeof popupId === 'undefined') {
console.error('popupId is not defined in setPopupHTML, html='+str.substring(0,100));
popupId = pg.idNumber;
}

var popupElement=document.getElementById(elementId+popupId);
if (popupElement) {
popupElement.innerHTML=str;
if (onSuccess) { onSuccess(); }
setTimeout(checkPopupPosition, 100);
return true;
} else {
// call this function again in a little while...
setTimeout(function(){
//console.log('setPopupHTML being run again...');
setPopupHTML(str,elementId,popupId,onSuccess);
}, 600);
}
return null;
}

//<NOLITE>
function setImageStatus(str, id) {return; } // setPopupHTML(str, 'popupImageStatus', id);}
function setPopupTrailer(str,id) {return setPopupHTML(str, 'popupData', id);}
//</NOLITE>


function fillEmptySpans(args) { return fillEmptySpans2(args); }

// args.navpopup is mandatory
// optional: args.redir, args.redirTarget
function fillEmptySpans2(args) { // if redir is present and true then redirTarget is mandatory
var redir=true;
if (typeof args != 'object' || typeof args.redir == 'undefined' || !args.redir) { redir=false; }
var a=args.navpopup.parentAnchor;

var article, hint, oldid;
if (redir && typeof args.redirTarget == typeof {}) {
article=args.redirTarget; hint=null;
} else {
article=(new Title()).fromAnchor(a);
hint=a.originalTitle || article.hintValue();
oldid=(getValueOf('popupHistoricalLinks')) ? oldidFromAnchor(a) : null;
}
var x={ article:article, hint: hint, oldid: oldid, navpop:args.navpopup };

var structure=pg.structures[getValueOf('popupStructure')];
if (typeof structure != 'object') {
setPopupHTML('popupError', 'Unknown structure (this should never happen): '+
pg.option.popupStructure, args.navpopup.idNumber);
return;
}
var spans=flatten(pg.misc.layout);
var numspans = spans.length;
var redirs=pg.misc.redirSpans;

for (var i=0; i<numspans; ++i) {
var f=findThis(redirs, spans[i]);
//log('redir='+redir+', f='+f+', spans[i]='+spans[i]);
if ( (f!==null && !redir) || (f===null && redir) ) {
//log('skipping this set of the loop');
continue;
}
var structurefn=structure[spans[i]];
switch (typeof structurefn) {
case 'function':
//log('running '+spans[i]+'({article:'+x.article+', hint:'+x.hint+', oldid: '+x.oldid+'})');
setPopupHTML(structurefn(x), spans[i], args.navpopup.idNumber);
break;
case 'string':
setPopupHTML(structurefn, spans[i], args.navpopup.idNumber);
break;
default:
errlog('unknown thing with label '+spans[i]);
break;
}
}
}

// flatten an array
function flatten(list, start) {
var ret=[];
if (typeof start == 'undefined') { start=0; }
for (var i=start; i<list.length; ++i) {
if (typeof list[i] == typeof []) {
return ret.concat(flatten(list[i])).concat(flatten(list, i+1));
}
else { ret.push(list[i]); }
}
return ret;
}

// Generate html for whole popup
function popupHTML (a) {
getValueOf('popupStructure');
var structure=pg.structures[pg.option.popupStructure];
if (typeof structure != 'object') {
//return 'Unknown structure: '+pg.option.popupStructure;
// override user choice
pg.option.popupStructure=pg.optionDefault.popupStructure;
return popupHTML(a);
}
if (typeof structure.popupLayout != 'function') { return 'Bad layout'; }
pg.misc.layout=structure.popupLayout();
if (typeof structure.popupRedirSpans == 'function') { pg.misc.redirSpans=structure.popupRedirSpans(); }
else { pg.misc.redirSpans=[]; }
return makeEmptySpans(pg.misc.layout, a.navpopup);
}

function makeEmptySpans (list, navpop) {
var ret='';
for (var i=0; i<list.length; ++i) {
if (typeof list[i] == typeof '') {
ret += emptySpanHTML(list[i], navpop.idNumber, 'div');
} else if (typeof list[i] == typeof [] && list[i].length > 0 ) {
ret = ret.parenSplit(RegExp('(</[^>]*?>$)')).join(makeEmptySpans(list[i], navpop));
} else if (typeof list[i] == typeof {} && list[i].nodeType ) {
ret += emptySpanHTML(list[i].name, navpop.idNumber, list[i].nodeType);
}
}
return ret;
}


function emptySpanHTML(name, id, tag, classname) {
tag = tag || 'span';
classname = classname || name;
if (name == getValueOf('popupDragHandle')) { classname += ' popupDragHandle'; }
return simplePrintf('<%s id="%s" class="%s"></%s>', [tag, name + id, classname, tag]);
}

// generate html for popup image
// <a id="popupImageLinkn"><img id="popupImagen">
// where n=idNumber
function imageHTML(article, idNumber) {
return simplePrintf('<a id="popupImageLink$1">' +
'<img align="right" valign="top" id="popupImg$1" style="display: none;"></img>' +
'</a>', [ idNumber ]);
}

function popTipsSoonFn(id, when) {
when || ( when=250 );
//console.log('popTipsSoonFn, id='+id+', when='+when);
var popTips=function(){ setupTooltips(document.getElementById(id)); };
return function() { setTimeout( popTips, when ); };
}

function setPopupTipsAndHTML(html, divname, idnumber) {
//console.log('setPopupTipsAndHTML');
setPopupHTML(html, divname, idnumber,
getValueOf('popupSubpopups') ? popTipsSoonFn(divname + idnumber) : null);
}
// ENDFILE: htmloutput.js
// STARTFILE: mouseout.js
//////////////////////////////////////////////////
// fuzzy checks

function fuzzyCursorOffMenus(x,y, fuzz, parent) {
if (!parent) { return null; }
var uls=parent.getElementsByTagName('ul');
for (var i=0; i<uls.length; ++i) {
if (uls[i].className=='popup_menu') {
if (uls[i].offsetWidth > 0) return false;
} // else {document.title+='.';}
}
return true;
}

function checkPopupPosition () { // stop the popup running off the right of the screen
// FIXME avoid pg.current.link
pg.current.link && pg.current.link.navpopup &&
pg.current.link.navpopup.limitHorizontalPosition();
}

function mouseOutWikiLink () {
if (!window.popupsReady || !window.popupsReady()) { return; }
//console ('mouseOutWikiLink');
var a=this;
if (a.navpopup==null) return;
if ( ! a.navpopup.isVisible() ) {
//console.log('banishing since invisible');
a.navpopup.banish();
return;
}
Navpopup.tracker.addHook(posCheckerHook(a.navpopup));
}

function posCheckerHook(navpop) {
return function() {
//console.log('posCheckerHook');
if (!navpop.isVisible()) { return true; /* remove this hook */ }
if (Navpopup.tracker.dirty) {
//console.log('dirty!');
return false;
}
var x=Navpopup.tracker.x, y=Navpopup.tracker.y;
var mouseOverNavpop = navpop.isWithin(x,y,navpop.fuzz, navpop.mainDiv) ||
!fuzzyCursorOffMenus(x,y,navpop.fuzz, navpop.mainDiv);

// FIXME it'd be prettier to do this internal to the Navpopup objects
var t=getValueOf('popupHideDelay');
if (t) { t = t * 1000; }
if (!t) {
if(!mouseOverNavpop) {
navpop.banish();
return true; /* remove this hook */
}
return false;
}
// we have a hide delay set
var d=+(new Date());
if ( !navpop.mouseLeavingTime ) {
navpop.mouseLeavingTime = d;
return false;
}
if ( mouseOverNavpop ) {
navpop.mouseLeavingTime=null;
return false;
}
if (d - navpop.mouseLeavingTime > t) {
//console.log('banishing after timeout');
navpop.mouseLeavingTime=null;
navpop.banish(); return true; /* remove this hook */
}
return false;
};
}

function runStopPopupTimer(navpop) {
// at this point, we should have left the link but remain within the popup
// so we call this function again until we leave the popup.
if (!navpop.stopPopupTimer) {
navpop.stopPopupTimer=setInterval(posCheckerHook(navpop), 500);
navpop.addHook(function(){clearInterval(navpop.stopPopupTimer);},
'hide', 'before');
}
}
// ENDFILE: mouseout.js
// STARTFILE: previewmaker.js
/**
@fileoverview
Defines the {@link Previewmaker} object, which generates short previews from wiki markup.
*/

/**
Creates a new Previewmaker
@constructor
@class The Previewmaker class. Use an instance of this to generate short previews from Wikitext.
@param {String} wikiText The Wikitext source of the page we wish to preview.
@param {String} baseUrl The url we should prepend when creating relative urls.
@param {Navpopup} owner The navpop associated to this preview generator
*/
function Previewmaker(wikiText, baseUrl, owner) {
/** The wikitext which is manipulated to generate the preview. */
this.data=wikiText;
this.baseUrl=baseUrl;
this.owner=owner;
}
/** Remove HTML comments
@private
*/
Previewmaker.prototype.killComments = function () {
// this also kills trailing spaces and one trailing newline, eg [[diamyo]]
this.data=this.data.replace(RegExp('<!--[\\s\\S]*?--> *\\n?', 'g'), '');
};
/**
@private
*/
Previewmaker.prototype.killDivs = function () {
// say goodbye, divs (can be nested, so use * not *?)
this.data=this.data.replace(RegExp('< *div[^>]* *>[\\s\\S]*?< */ *div *>',
'gi'), '');
};
/**
@private
*/
Previewmaker.prototype.killGalleries = function () {
this.data=this.data.replace(RegExp('< *gallery[^>]* *>[\\s\\S]*?< */ *gallery *>',
'gi'), '');
};
/**
@private
*/
Previewmaker.prototype.kill = function(opening, closing, subopening, repl) {
var oldk=this.data;
var k=this.killStuff(this.data, opening, closing, subopening, repl);
while (k.length < oldk.length) {
oldk=k;
k=this.killStuff(k, opening, closing, subopening, repl);
}
this.data=k;
};
/**
@private
*/
Previewmaker.prototype.killStuff = function (txt, opening, closing, subopening, repl) {
var op=this.makeRegexp(opening);
var cl=this.makeRegexp(closing, '^');
var sb=subopening ? this.makeRegexp(subopening, '^') : null;
repl = repl || '';
if (!op || !cl) {
alert('Navigation Popups error: op or cl is null! something is wrong.');
return;
}
if (!op.test(txt)) { return txt; }
var ret='';
var opResult = op.exec(txt);
ret = txt.substring(0,opResult.index);
txt=txt.substring(opResult.index+opResult[0].length);
var depth = 1;
while (txt.length > 0) {
//console.log('depth: '+depth + ', txt='+txt);
var removal=0;
if (cl.test(txt)) {
depth--;
removal=cl.exec(txt)[0].length;
} else if (sb && sb.test(txt)) {
depth++;
removal=sb.exec(txt)[0].length;
}
if ( !removal ) { removal = 1; }
txt=txt.substring(removal);
if (depth==0) { break; }
}
return ret + repl + txt;
};
/**
@private
*/
Previewmaker.prototype.makeRegexp = function (x, prefix, suffix) {
prefix = prefix || '';
suffix = suffix || '';
var reStr='';
var flags='';
if (isString(x)) {
reStr=prefix + literalizeRegex(x) + suffix;
} else if (isRegExp(x)) {
var s=x.toString().substring(1);
var sp=s.split('/');
flags=sp[sp.length-1];
sp[sp.length-1]='';
s=sp.join('/');
s=s.substring(0,s.length-1);
reStr= prefix + s + suffix;
} else {
log ('makeRegexp failed');
}

log ('makeRegexp: got reStr=' + reStr + ', flags=' + flags);
return RegExp(reStr, flags);
};
/**
@private
*/
Previewmaker.prototype.killBoxTemplates = function () {

// taxobox removal... in fact, there's a saudiprincebox_begin, so let's be more general
// also, have float_begin, ... float_end
this.kill(RegExp('[{][{][^{}\\s|]*?(float|box)[_ ](begin|start)', 'i'), /[}][}]\s*/, '{{');

// infoboxes etc
// from [[User:Zyxw/popups.js]]: kill frames too
this.kill(RegExp('[{][{][^{}\\s|]*?(infobox|elementbox|frame)[_ ]', 'i'), /[}][}]\s*/, '{{');

};
/**
@private
*/
Previewmaker.prototype.killTemplates = function () {
this.kill('{{', '}}', '{{', ' ');
};
/**
@private
*/
Previewmaker.prototype.killTables = function () {
// tables are bad, too
// this can be slow, but it's an inprovement over a browser hang
// torture test: [[Comparison_of_Intel_Central_Processing_Units]]
this.kill('{|', /[|]}\s*/, '{|');
this.kill(/<table.*?>/i, /<\/table.*?>/i, /<table.*?>/i);
// remove lines starting with a pipe for the hell of it (?)
this.data=this.data.replace(RegExp('^[|].*$', 'mg'), '');
};
/**
@private
*/
Previewmaker.prototype.killImages = function () {
// images and categories are a nono
this.kill(RegExp('[[][[]\\s*(' + pg.ns.image + '|' + pg.ns.category + ')\\s*:', 'i'),
/\]\]\s*/, '[[');
};
/**
@private
*/
Previewmaker.prototype.killHTML = function () {
// kill <ref ...>...</ref>
this.kill(/<ref\b.*?>/i, /<\/ref>/i);

// let's also delete entire lines starting with <. it's worth a try.
this.data=this.data.replace(RegExp('(^|\\n) *<.*', 'g'), '\n');

// and those pesky html tags, but not <nowiki>
var splitted=this.data.parenSplit(/(<.*?>)/);
var len=splitted.length;
for (var i=1; i<len; i=i+2) {
switch (splitted[i]) {
case '<nowiki>':
case '</nowiki>':
break;
default:
splitted[i]='';
}
}
this.data=splitted.join('');
};
/**
@private
*/
Previewmaker.prototype.killChunks = function() { // heuristics alert
// chunks of italic text? you crazy, man?
var italicChunkRegex=new RegExp
("((^|\\n)\\s*:*\\s*''[^']([^']|'''|'[^']){20}(.|\\n[^\\n])*''[.!?\\s]*\\n)+", 'g');
// keep stuff separated, though, so stick in \n (fixes [[Union Jack]]?
this.data=this.data.replace(italicChunkRegex, '\n');
};
/**
@private
*/
Previewmaker.prototype.mopup = function () {
// we simply *can't* be doing with horizontal rules right now
this.data=this.data.replace(RegExp('^-{4,}','mg'),'');

// no indented lines
this.data=this.data.replace(RegExp('(^|\\n) *:[^\\n]*','g'), '');

// replace __TOC__, __NOTOC__ and whatever else there is
// this'll probably do
this.data=this.data.replace(RegExp('^__[A-Z_]*__ *$', 'gmi'),'');
};
/**
@private
*/
Previewmaker.prototype.firstBit = function () {
// dont't be givin' me no subsequent paragraphs, you hear me?
/// first we "normalize" section headings, removing whitespace after, adding before
var d=this.data;

if (getValueOf('popupPreviewCutHeadings')) {
this.data=this.data.replace(RegExp('\\s*(==+[^=]*==+)\\s*', 'g'), '\n\n$1 ');
/// then we want to get rid of paragraph breaks whose text ends badly
this.data=this.data.replace(RegExp('([:;]) *\\n{2,}', 'g'), '$1\n');

this.data=this.data.replace(RegExp('^[\\s\\n]*'), '');
stuff=(RegExp('^([^\\n]|\\n[^\\n\\s])*')).exec(this.data);
if (stuff) { d = stuff[0]; }
if (!getValueOf('popupPreviewFirstParOnly')) { d = this.data; }

/// now put \n\n after sections so that bullets and numbered lists work
d=d.replace(RegExp('(==+[^=]*==+)\\s*', 'g'), '$1\n\n');
}

// superfluous sentences are RIGHT OUT.
// note: exactly 1 set of parens here needed to make the slice work
d = d.parenSplit(RegExp('([!?.]+["'+"'"+']*\\s)','g'));
// leading space is bad, mmkay?
d[0]=d[0].replace(RegExp('^\\s*'), '');

var notSentenceEnds=RegExp('([^.][a-z][.][a-z]|etc|sic|Dr|Mr|Mrs|Ms|St|no|\\[[^\\]]*|\\s[A-Zvclm])$', 'i');

d = this.fixSentenceEnds(d, notSentenceEnds);

var maxChars=getValueOf('popupMaxPreviewCharacters');
var n=getValueOf('popupMaxPreviewSentences');
var dd;

do {dd=this.firstSentences(d,n); --n; }
while ( dd.length > maxChars && n > 0 );

this.data = dd;
};
/**
@private
*/
Previewmaker.prototype.fixSentenceEnds = function(strs, reg) {
// take an array of strings, strs
// join strs[i] to strs[i+1] & strs[i+2] if strs[i] matches regex reg

for (var i=0; i<strs.length-2; ++i) {
if (reg.test(strs[i])) {
a=[];
for (var j=0; j<strs.length; ++j) {
if (j<i) a[j]=strs[j];
if (j==i) a[i]=strs[i]+strs[i+1]+strs[i+2];
if (j>i+2) a[j-2]=strs[j];
}
return this.fixSentenceEnds(a,reg);
}
}
return strs;
};
/**
@private
*/
Previewmaker.prototype.firstSentences = function(strs, howmany) {
var t=strs.slice(0, 2*howmany);
return t.join('');
};
/**
@private
*/
Previewmaker.prototype.killBadWhitespace = function() {
this.data=this.data.replace(/^ *$/gm, '');
};
/**
Runs the various methods to generate the preview.
The preview is stored in the <code>html</html> field.
@private
*/
Previewmaker.prototype.makePreview = function() {
//console.log('makePreview, owner='+this.owner);
//console.log('this.owner.article.namespace()='+this.owner.article.namespace());
//console.log('starting makePreview');
//console.log(this.owner);
//console.log(this.owner.article);
//console.log(this.owner.article.namespace());
if (this.owner.article.namespace()!=pg.ns.template) {
//console.log('running this.killComments()');
this.killComments();
//console.log('running this.killDivs()');
this.killDivs();
//console.log('running this.killGalleries()');
this.killGalleries();
//console.log('running this.killBoxTemplates()');
this.killBoxTemplates();

if (getValueOf('popupPreviewKillTemplates')) {
//console.log('running this.killTemplates()');
this.killTemplates();
} else {
//console.log('running this.killMultilineTemplates()');
this.killMultilineTemplates();
}
//console.log('running this.killTables()');
this.killTables();
//console.log('running this.killImages()');
this.killImages();
//console.log('running this.killHTML()');
this.killHTML();
//console.log('running this.killChunks()');
this.killChunks();
//console.log('running this.mopup()');
this.mopup();

//console.log('running this.firstBit()');
this.firstBit();
//console.log('running this.killBadWhitespace()');
this.killBadWhitespace();
}
//console.log('running wiki2html');
this.html=wiki2html(this.data, this.baseUrl); // needs livepreview
//console.log('running this.fixHTML()');
this.fixHTML();
//console.log('running this.stripLongTemplates()');
this.stripLongTemplates();
//console.log('done makePreview');
};

//<NOLITE>
/** Test function for debugging preview problems one step at a time.
*/
function previewSteps(txt) {
try {
txt=txt || document.editform.wpTextbox1.value;
} catch (err) {
if (pg.cache.pages.length > 0) {
txt=pg.cache.pages[pg.cache.pages.length-1].data;
} else {
alert('provide text or use an edit page');
}
}
txt=txt.substring(0,10000);
var base=pg.wiki.articlebase + Title.fromURL(document.location.href).urlString();
var p=new Previewmaker(txt, base, pg.current.link.navpopup);
if (this.owner.article.namespace() != pg.ns.template) {
p.killComments(); if (!confirm('done killComments(). Continue?\n---\n' + p.data)) { return; }
p.killDivs(); if (!confirm('done killDivs(). Continue?\n---\n' + p.data)) { return; }
p.killGalleries(); if (!confirm('done killGalleries(). Continue?\n---\n' + p.data)) { return; }
p.killBoxTemplates(); if (!confirm('done killBoxTemplates(). Continue?\n---\n' + p.data)) { return; }

if (getValueOf('popupPreviewKillTemplates')) {
p.killTemplates(); if (!confirm('done killTemplates(). Continue?\n---\n' + p.data)) { return; }
} else {
p.killMultilineTemplates(); if (!confirm('done killMultilineTemplates(). Continue?\n---\n' + p.data)) { return; }
}

p.killTables(); if (!confirm('done killTables(). Continue?\n---\n' + p.data)) { return; }
p.killImages(); if (!confirm('done killImages(). Continue?\n---\n' + p.data)) { return; }
p.killHTML(); if (!confirm('done killHTML(). Continue?\n---\n' + p.data)) { return; }
p.killChunks(); if (!confirm('done killChunks(). Continue?\n---\n' + p.data)) { return; }
p.mopup(); if (!confirm('done mopup(). Continue?\n---\n' + p.data)) { return; }

p.firstBit(); if (!confirm('done firstBit(). Continue?\n---\n' + p.data)) { return; }
p.killBadWhitespace(); if (!confirm('done killBadWhitespace(). Continue?\n---\n' + p.data)) { return; }
}

p.html=wiki2html(p.data, base); // needs livepreview
p.fixHTML(); if (!confirm('done fixHTML(). Continue?\n---\n' + p.html)) { return; }
p.stripLongTemplates(); if (!confirm('done stripLongTemplates(). Continue?\n---\n' + p.html)) { return; }
alert('finished preview - end result follows.\n---\n' + p.html);
}
//</NOLITE>

/**
Works around a quoting bug in livepreview.
<code>wiki2html('[[Foo\'s "bar"]]')</code> gives @literal{<a href='Foo's "bar"'>}
which doesn't do very well. We change this into @literal{<a href="Foo's %22bar%22">}
@private
*/
Previewmaker.prototype.fixHTML = function() {
if(!this.html) return;
// all links seem to have potential issues with quotation marks
var splitted=this.html.parenSplit(/href='([^>]*)'/g);
var ret='';
for (var i=0; i<splitted.length; ++i) {
if(i%2==0) { ret += splitted[i]; continue; }
if(i%2==1) { ret += 'href="' + splitted[i].split('"').join('%22') + '"'; }
}
// fix question marks in wiki links
// maybe this'll break some stuff :-(
ret=ret.replace(RegExp('\(<a href="/' + pg.wiki.articlePath + '/[^"]*\)[?]\(.*?"\)', 'g'), '$1%3F$2');
// FIXME fix up % too
this.html=ret;
};
/**
Generates the preview and displays it in the current popup.

Does nothing if the generated preview is invalid or consists of whitespace only.
Also activates wikilinks in the preview for subpopups if the popupSubpopups option is true.
*/
Previewmaker.prototype.showPreview = function () {
this.makePreview();
if (typeof this.html != typeof '') return;
if (RegExp('^\\s*$').test(this.html)) return;
setPopupHTML('<hr>', 'popupPrePreviewSep', this.owner.idNumber);
setPopupTipsAndHTML(this.html, 'popupPreview', this.owner.idNumber);
};
/**
@private
*/
Previewmaker.prototype.stripLongTemplates = function() {
// operates on the HTML!
this.html=this.html.replace(RegExp('^.{0,1000}[{][{][^}]*?(<(p|br)( /)?>\\s*){2,}([^{}]*?[}][}])?', 'gi'), '');
this.html=this.html.split('\n').join(' '); // workaround for <pre> templates
this.html=this.html.replace(RegExp('[{][{][^}]*<pre>[^}]*[}][}]','gi'), '');
};
/**
@private
*/
Previewmaker.prototype.killMultilineTemplates = function() {
this.kill(RegExp('\\s*[{][{][^{}]*\\n'), '}}', '{{');
};
// ENDFILE: previewmaker.js
// STARTFILE: querypreview.js
//<NOLITE>
function loadQueryPreview(queryType, article, navpop) {
var art=new Title(article).urlString();
var url=pg.wiki.wikibase + '/query.php?format=json&';
var htmlGenerator=function(a,d){alert('invalid html generator');};
switch (queryType) {
case 'history':
url += 'titles=' + art + '&what=revisions|userinfo&uioptions=timecorrection&rvcomments&rvlimit=' +
getValueOf('popupHistoryPreviewLimit');
htmlGenerator=historyPreviewHTML;
break;
case 'imagelinks':
// redundant case
url += 'titles=' + art + '&what=imagelinks&ilfilter=all';
htmlGenerator=imagelinksPreviewHTML;
break;
case 'category':
url += 'what=category&cptitle=' + art;
htmlGenerator=categoryPreviewHTML;
break;
case 'contribs':
url += 'what=usercontribs|userinfo&uioptions=timecorrection&titles=' + art + '&uccomments' +
'&uclimit=' + getValueOf('popupContribsPreviewLimit');
htmlGenerator=contribsPreviewHTML;
break;
case 'imagepagepreview':
var trail='&what=imageinfo|content|imagelinks&ilfilter=all';
if (!getValueOf('popupImageLinks')) { trail = '&what=imageinfo|content'; }
if (pg.wiki.commons) { trail += '&iishared'; }
url += 'titles=' + art + trail;
htmlGenerator=imagepagePreviewHTML;
break;
case 'sharedimagepage':
url += 'titles=' + art + '&what=content&proxylang=' + pg.wiki.commonslang;
htmlGenerator=sharedImagePagePreviewHTML;
break;
}
pendingNavpopTask(navpop);
//console.log(htmlGenerator);
var callback=function(d){
//console.log('query callback');
showQueryPreview(queryType, htmlGenerator(article,d,navpop), navpop.idNumber, navpop, d);
};
var go = function(){
//console.log('go, url=' +url);
//console.log('navpop.idNumber=' +navpop.idNumber);
getPageWithCaching(url, callback, navpop);
return true;
}
if (navpop.visible || !getValueOf('popupLazyDownloads')) { go(); }
else { navpop.addHook(go, 'unhide', 'before', 'DOWNLOAD_'+queryType+'_QUERY_DATA'); }
}

function showQueryPreview(queryType, html, id, navpop, download) {
//console.log('showQueryPreview');
//console.log(html.length);
//console.log('ok');
var target='popupPreview';
switch (queryType) {
case 'imagelinks':
case 'category':
target='popupPostPreview'; break;
case 'sharedimagepage':
target='popupSecondPreview'; break;
}
//console.log('ok2');
//console.log('setting html, length '+html.length);
setPopupTipsAndHTML(html, target, id);
//console.log('ok3');
completedNavpopTask(navpop);
//console.log('ok4');
}

function sharedImagePagePreviewHTML(article, download, navpop) {
//console.log('sharedImagePagePreviewHTML');
var jsObj=getJsObj(download.data);
try {
var page=anyChild(jsObj.pages);
var content=(page && page.content) ? page.content['*'] : null;
} catch (someError) { return 'sharedimagepage preview failed :( is the query.php extension installed?'; }
var ret='';
if (content) {
var p=prepPreviewmaker(content, article, navpop);
p.makePreview();
if (p.html) { ret += '<hr>' + p.html; }
}
return ret;
}


function imagepagePreviewHTML(article, download, navpop) {
var jsObj=getJsObj(download.data);
try {
var page=anyChild(jsObj['pages']);
var content=(page && page.content) ? page.content['*'] : null;
var a=page.image;
var b=page.sharedimage;
} catch (someError) { return 'imagepage preview failed :( is the query.php extension installed?'; }
var ret='';
if (content) {
var p=prepPreviewmaker(content, article, navpop);
p.makePreview();
if (p.html) { ret += '<hr>' + p.html; }
}
//console.log(ret.substring(0,100));
var sharingInfo=getSharingInfo(a,b);
//console.log(sharingInfo);
if (sharingInfo) { ret += '<hr>' + sharingInfo; }
//console.log(sharingInfo);
//console.log(ret.substring(0,100));
if (content!==null && getValueOf('popupSummaryData')) {
var info=getPageInfo(content, download);
log(info);
setPopupTrailer(info, navpop.idNumber);
}
if (!a && b) {
//console.log('loading shared image preview');
loadQueryPreview('sharedimagepage', article, navpop);
}
showQueryPreview('imagelinks', imagelinksPreviewHTML(article,download), navpop.idNumber, download);
return ret;
}

function getSharingInfo(a,b) {
if (!pg.wiki.commons) { return ''; }
var sharingInfo='';
if (a && b) {
if (checkSameImage(a,b)) {
sharingInfo = popupString('commons dupe');
} else {
sharingInfo = popupString('commons conflict');
}
} else if (a && !b) {
// nothing interesting
if (getValueOf('popupShowNonCommonsImages')) {
sharingInfo = popupString('not commons');
}
} else if (!a && b) {
sharingInfo = popupString('commons only');
} else {
sharingInfo = popupString('No image found');
}
return sharingInfo;
}

function checkSameImage(a,b){
return (a['size']==b['size'] && a['width']==b['width'] && a['bits']==b['bits'] &&
a['media']==b['media'] && a['mime']==b['mime']);
}

function imagelinksPreviewHTML(article, download) {
var jsobj=getJsObj(download.data);
try {
var list=anyChild(jsobj['pages'])['imagelinks'];
if (!list) { return popupString('No image links found'); }
} catch(someError) { return 'Image links preview generation failed :( Is the query.php extension installed?'; }
var ret=[];
for (var i=0; i<list.length; ++i) { ret.push(list[i]['*']); }
if (ret.length === 0) { return popupString('No image links found'); }
return '<h2>' + popupString('File links') + '</h2>' + linkList(ret);
}

function categoryPreviewHTML(article, download) {
var jsobj=getJsObj(download.data);
try{ var list=jsobj['pages']; }
catch(someError) { return 'Category preview failed :( Is the query.php extension installed?'; }
var ret=[];
for (var p in list) { ret.push(list[p]['title']); }
if (ret.length === 0) { return popupString('Empty category'); }
return '<h2>' + tprintf('Category members (%s shown)', [ret.length]) + '</h2>' +linkList(ret);
}

function linkList(list) {
list.sort(function(x,y) { return (x==y ? 0 : (x<y ? -1 : 1)); });
var buf=[];
for (var i=0; i<list.length; ++i) {
buf.push(wikiLink({article: new Title(list[i]),
text: list[i].split(' ').join('&nbsp;'),
action: 'view'}));
}
return buf.join(', ');
}

function contribsPreviewHTML(article, download, navpop) {
//console.log('contribsPreviewHTML');
return historyPreviewHTML(article, download, navpop, true);
}

function historyPreviewHTML(article, download, navpop, reallyContribs) {
//console.log('historyPreviewHTML');
var jsobj=getJsObj(download.data);
try {
var tz=jsobj.meta.user.timecorrection;
var edits=anyChild(jsobj.pages)[reallyContribs ? 'contributions' : 'revisions'];
} catch (someError) {
//console.log('historyPreivewHTML failed.');
return 'Preview failed :-( Is the query.php extension installed?';
}
var timeOffset = getTimeOffset(tz);
Cookie.create('popTz', timeOffset, 1);

var ret=editPreviewTable(article, edits, reallyContribs, timeOffset);
return ret;
}

function getTimeOffset(tz) {
return ( tz && tz.indexOf(':') > -1 ) ? ( parseInt(tz,10)*60 + parseInt(tz.split(':')[1],10) ) : 0;
}

function editPreviewTable(article, h, reallyContribs, timeOffset) {
//console.log('editPreviewTable, timeOffset='+timeOffset);
var html=['<table>'];
var day=null;
var curart=article;
//console.log('a_');
//console.log('a' + h.length);
for (var i=0; i<h.length; ++i) {
//console.log('b');
if (reallyContribs) { var page=h[i]['*']; curart = new Title(page); }
var minor=typeof h[i]['minor']=='undefined' ? '' : '<b>m </b>';
//console.log('getting editDate');
var editDate=adjustDate(getDateFromTimestamp(h[i].timestamp), timeOffset);
//console.log(editDate);
var thisDay = dayFormat(editDate);
//console.log(thisDay);
var thisTime = timeFormat(editDate);
//console.log(thisTime);
if (thisDay==day) { thisDay=''; }
else { day=thisDay; }
if (thisDay) {
html.push( '<tr><td colspan=3><span class="popup_history_date">' +
thisDay+'</span></td></tr>' );
}
html.push('<tr class="popup_history_row_' + ( (i%2) ? 'odd' : 'even') + '">');
html.push('<td>(<a href="' + pg.wiki.titlebase + new Title(curart).urlString() +
'&diff=prev&oldid=' + h[i]['revid'] + '">' + popupString('last') + '</a>)</td>');
html.push('<td>' +
'<a href="' + pg.wiki.titlebase + new Title(curart).urlString() +
'&oldid=' + h[i]['revid'] + '">' + thisTime + '</a></td>');
var col3url='', col3txt='';
if (!reallyContribs) {
var user=h[i]['user'];
col3url=pg.wiki.titlebase + pg.ns.user + ':' + new Title(user).urlString();
col3txt=user;
} else {
col3url=pg.wiki.titlebase + curart.urlString();
col3txt=page; // FIXME do we have to escape this?
}
html.push('<td>' + (reallyContribs ? minor : '') +
'<a href="' + col3url + '">' + col3txt + '</a></td>');
var comment='';
if (typeof h[i]['comment'] != 'undefined') { comment=h[i]['comment'].entify();}
else { comment=h[i]['*']; }
html.push('<td>' + (!reallyContribs ? minor : '') + comment + '</td>');
html.push('</tr>');
html=[html.join('')];
//console.log(1);
}
html.push('</table>');
//console.log(html.join.length + 'ending');
return html.join('');
}

function getDateFromTimestamp(t) {
var s=t.split(/[^0-9]/);
switch(s.length) {
case 0: return null;
case 1: return new Date(s[0]);
case 2: return new Date(s[0], s[1]-1);
case 3: return new Date(s[0], s[1]-1, s[2]);
case 4: return new Date(s[0], s[1]-1, s[2], s[3]);
case 5: return new Date(s[0], s[1]-1, s[2], s[3], s[4]);
case 6: return new Date(s[0], s[1]-1, s[2], s[3], s[4], s[5]);
default: return new Date(s[0], s[1]-1, s[2], s[3], s[4], s[5], s[6]);
}
}

function adjustDate(d, offset) {
// offset is in minutes
var o=offset * 60 * 1000;
return new Date( +d + o);
}

function dayFormat(editDate, utc) {
if (utc) { return map(zeroFill, [editDate.getUTCFullYear(), editDate.getUTCMonth()+1, editDate.getUTCDate()]).join('-'); }
return map(zeroFill, [editDate.getFullYear(), editDate.getMonth()+1, editDate.getDate()]).join('-');
}

function timeFormat(editDate, utc) {
if (utc) { return map(zeroFill, [editDate.getUTCHours(), editDate.getUTCMinutes(), editDate.getUTCSeconds()]).join(':'); }
return map(zeroFill, [editDate.getHours(), editDate.getMinutes(), editDate.getSeconds()]).join(':');
}

//</NOLITE>
// ENDFILE: querypreview.js
// STARTFILE: debug.js
////////////////////////////////////////////////////////////////////
// Debugging functions
////////////////////////////////////////////////////////////////////

function log(){}; // dummy to stop errors
function setupDebugging() {
//<NOLITE>
// debugging - change DEBUG to NONE to switch off
if (window.popupDebug) { // popupDebug is set from .version
window.log=function(x) { //if(gMsg!='')gMsg += '\n'; gMsg+=time() + ' ' + x; };
if (pg.debugLevel != log.None) { window.logger.debug(x); }
}
window.errlog=function(x) {
if (pg.debugLevel != log.None) { window.logger.error(x); }
}
pg.debugLevel=Log.DEBUG;
window.logger = new Log(pg.debugLevel, Log.popupLogger);
log('Initializing logger');
} else {
//</NOLITE>
window.log = function(x) {};
window.errlog = function(x) {};
//<NOLITE>
}
//</NOLITE>
}
// ENDFILE: debug.js
// STARTFILE: images.js
//<NOLITE>
// FIXME rewrite ALL of this
// How the URLs for images in the popup come about

// loadPreview
// |
// getWiki
// |<----------------see other schematic for details
// insertPreview (insertPreview = onComplete)
// |
// | insertPreview gets a wikiText fragment from
// | the wikiText downloaded by getWiki
// |
// [wikiMarkupToAddressFragment]
// |
// | mouseOverWikiLink (gets an "address fragment",
// | | no processing needed)
// \->-*loadThisImage---<----loadImages
// |
// [image(Thumb)URL]-->--hopefully valid image urls

// FIXME get rid of pg.idNumber

function sequentialLoadThisImage (image) {
if (!getValueOf('popupImages')) { return false; }
if (!isValidImageName(image)) { return false; }

var imageUrls=getImageUrls(image);
if (!imageUrls) { return null; }

var img=new Image();
img.isNew=true;
img.pg.idNumber=pg.idNumber;
img.counter=1;

img.onload = function () {
// clear status thingy
setImageStatus('');

var i=findThis(imageUrls, this.src);
var goodSrc=this.src;

var setPopupImage=function () {
var popupImage=document.getElementById("popupImage"+this.pg.idNumber);
if (popupImage && typeof popupImage.src != 'undefined') {
clearInterval(pg.timer.image);
popupImage.src=goodSrc;
popupImage.width=getValueOf('popupImageSize');
popupImage.style.display='inline';
setPopupImageLink(image, pg.wiki.imageSources[i].wiki);
return true;
} else { return false; }
};
pg.timer.image=setInterval(setPopupImage, 250);
pg.cache.images.push(goodSrc);
};

img.onerror = function () {
pg.cache.badImageUrls.push(this.src);
};

img.setNext = function () {
var currentSrc=null;
var newSrc;
if (!this.isNew) { currentSrc=this.src; }
this.isNew=false;

newSrc= (currentSrc) ? nextOne(imageUrls, currentSrc) : imageUrls[0];

while (findThis(pg.cache.badImageUrls, newSrc)) {
newSrc=nextOne(imageUrls, newSrc);
if (!newSrc) {
setImageStatus (' :-(');
return;
}
}
setImageStatus(' '+findThis(imageUrls, newSrc));
this.src=newSrc;
};

// start the ball rolling
img.setNext();

}

function loadThisImageAtThisUrl(image, url) {
log('loading "best" image:\n'+url);
pg.misc.gImage=new Title(image.toString());
pg.misc.imageArray = [];
pg.misc.imageArray[0] = new Image();
pg.misc.imageArray[0].src=url;
if (pg.timer.image || pg.timer.image===0) {
clearInterval(pg.timer.image);
pg.counter.checkImages=0;
}
pg.timer.image=setInterval(checkImages, 250);
return;
}

// methinks this is unbelievably silly
// it dovetails with the parallel image loader function
function checkImages() {
//log('checkImages: pg.counter.loop='+pg.counter.loop+'; pg.counter.checkImages='+pg.counter.checkImages);
if (pg.timer.checkImages || pg.timer.checkImages===0) {
clearInterval(pg.timer.checkImages);
pg.timer.checkImages=null;
if (pg.counter.loop > 10) {pg.counter.loop=0; log('too many iterations of checkImages'); return;}
pg.counter.loop++;
} else pg.counter.checkImages++;

var status = ( pg.counter.checkImages % 2 ) ? ':' : '.' ;
setImageStatus(status);

if (pg.counter.checkImages > 100) {
pg.counter.checkImages = 0;
log ('pg.counter.checkImages too big in checkImages; returning');
clearInterval(pg.timer.image);
}

var popupImage=null;
popupImage=document.getElementById("popupImg"+pg.idNumber);
if (popupImage == null) {
// this doesn't seem to happen any more in practise for some reason
// still, I'll leave it in
log('checkImages: document.getElementById("popupImg'+pg.idNumber+'") is null! retrying in 333ms...');
pg.timer.checkImages=setInterval("checkImages()",333);
return;
}

log('checkImages: found element popupImg'+pg.idNumber+', and src='+popupImage.src);

// get the first image to successfully load
// and put it in the popupImage
for(var i = 0; i < pg.misc.imageArray.length; ++i) {
if(isImageOk(pg.misc.imageArray[i])) {
// stop all the gubbins, assign the image and return

log('checkImages: got at pos '+i+', src='+pg.misc.imageArray[i].src);
clearInterval(pg.timer.image);

if(pg.misc.gImage && pg.misc.gImage.namespace() == pg.ns.image) {
popupImage.src=pg.misc.imageArray[i].src;
popupImage.width=getValueOf('popupImageSize');
popupImage.style.display='inline';
// should we check to see if it's already there? maybe...
pg.cache.images.push(pg.misc.imageArray[i].src);

setPopupImageLink(pg.misc.gImage, pg.wiki.imageSources[i].wiki);
stopImagesDownloading();
}

setImageStatus('');

// reset evil nonconstant globals
delete pg.misc.imageArray; pg.misc.imageArray=[];
pg.timer.image=null;

pg.counter.checkImages=0;
pg.counter.loop=0;

return popupImage.src;
}
}
log('checkImages: no good image found. retrying in a tic...');
pg.timer.checkImages=setInterval("checkImages()",333);
}

function stopImagesDownloading() {
pg.misc.gImage=null;
if (pg.misc.imageArray == null) { return null; }
for (var i=0; i<pg.misc.imageArray.length; ++i) {
//pg.misc.imageArray[i].src=''; // this is a REALLY BAD IDEA
delete pg.misc.imageArray[i];
//pg.misc.imageArray[i] = new Image();
}
pg.misc.imageArray = [];
}

function toggleSize() {
var imgContainer=this;
if (!imgContainer) { alert('imgContainer is null :/'); return;}
img=imgContainer.firstChild;
if (!img) { alert('img is null :/'); return;}
if (!img.style.width || img.style.width=='') { img.style.width='100%'; }
else { img.style.width=''; }
}

function setPopupImageLink (img, wiki) {
if( wiki === null || img === null ) { return null; }

var a=document.getElementById("popupImageLink"+pg.idNumber);
if (a === null) { return null; }

switch (getValueOf('popupThumbAction')) {
case 'imagepage':
if (pg.current.article.namespace()!=pg.ns.image) {
a.href=pg.wiki.titlebase + img.urlString();
// FIXME: unreliable pg.idNumber
popTipsSoonFn('popupImage' + pg.idNumber)();
break;
} // else fall through
case 'sizetoggle':
a.onclick=toggleSize;
a.title=popupString('Toggle image size');
return;
case 'linkfull':
var linkURL = imageURL(img, wiki);
if (linkURL) {
a.href = linkURL;
a.title=popupString('Open full-size image');
}
return;
}
}

function isImageOk(img) {
// IE test
if (!img.complete) { return false; }

// gecko test
if (typeof img.naturalWidth != "undefined" && img.naturalWidth == 0) { return false; }

// test for konqueror and opera

// note that img.width must not be defined in the html with a width="..."
// for this to work.

// konq seems to give "broken images" width 16, presumably an icon width
// this test would probably work in gecko too, *except for very small images*
if (typeof img.width == 'undefined' || img.width <= 16) { return false; }

// No other way of checking: assume it's ok.
return true;
}

// those odd a/a5/ bits of image urls
function imagePathComponent(article) { // article is string, no namespace
// FIXME needs testing with odd characters
var forhash=article.split(' ').join('_');
var hash=hex_md5(forhash);
return hash.substring(0,1) + '/' + hash.substring(0,2) + '/';
}

function getImageUrlStart(wiki) { // this returns a trailing slash
switch (wiki) {
case 'en.wikipedia.org': return 'http://upload.wikimedia.org/wikipedia/en/';
case pg.wiki.commons: return 'http://upload.wikimedia.org/wikipedia/commons/';
case 'en.wiktionary.org': return 'http://en.wiktionary.org/upload/en/';
case 'secure.wikimedia.org':
return joinPath(['http://upload.wikimedia.org', pg.wiki.prePath]) + '/'; break;
default: // unsupported - take a guess
if (pg.wiki.wikimedia) {
return 'http://upload.wikimedia.org/wikipedia/' + pg.wiki.lang +'/';
}
/* this should work for wikicities */
return 'http://' + wiki + '/images/';
}
}

function imageURL(img, wiki) {
if (getValueOf('popupImagesFromThisWikiOnly') && wiki != pg.wiki.hostname) return null;
var imgurl=null;
var pathcpt = imagePathComponent(img.stripNamespace());
imgurl=getImageUrlStart(wiki) + pathcpt + img.stripNamespace().split(' ').join('_');
return imgurl;
}

function imageThumbURL(img, wiki, width) {
//
// eg http://upload.wikimedia.org/wikipedia/en/thumb/6/61/
// Rubiks_cube_solved.jpg/120px-Rubiks_cube_solved.jpg
// ^^^^^^^^^^^^^^^^^^^^^^^
// wikicities omits this bit
// AND wikicities needs a new pathcpt for each filename including thumbs

if (getValueOf('popupImagesFromThisWikiOnly') && wiki != pg.wiki.hostname) return null;
if (getValueOf('popupNeverGetThumbs')) return null;

var imgurl=null;
var stripped=img.stripNamespace();
var pathcpt;
if (pg.wiki.wikimedia) pathcpt = imagePathComponent(stripped);
else pathcpt = imagePathComponent(width+'px-'+stripped);
imgurl=getImageUrlStart(wiki) + "thumb/" + pathcpt;
if (pg.wiki.wikimedia) imgurl += stripped + '/';
imgurl += width +"px-" + stripped;
return imgurl;
}

function loadImages(image) {
if (typeof image.stripNamespace != 'function') { alert('loadImages bad'); }
if (getValueOf('popupLoadImagesSequentially')) { return sequentialLoadThisImage(image); }
return parallelLoadThisImage(image);
}

function getImageUrls(image) {
if (typeof image.stripNamespace != 'function') { alert('getImageUrls bad'); }
var imageUrls=[];
for (var i=0; i<pg.wiki.imageSources.length; ++i) {
var url;
if (pg.wiki.imageSources[i].thumb) {
url=imageThumbURL(image, pg.wiki.imageSources[i].wiki, pg.wiki.imageSources[i].width);
} else { url=imageURL(image, pg.wiki.imageSources[i].wiki); }
for (var j=0; j<pg.cache.images.length; ++j) {
if (url == pg.cache.images[j]) {
loadThisImageAtThisUrl(image, url);
return null;
}
}
if (url!=null) imageUrls.push(url);
}
return imageUrls;
}


// this is probably very wasteful indeed of bandwidth
// hey ho

function parallelLoadThisImage (image) {
if (typeof image.stripNamespace != 'function') { alert('parallelLoadThisImage bad'); }
if (!getValueOf('popupImages')) return;
if (!isValidImageName(image)) return false;

var imageUrls=getImageUrls(image);
if (!imageUrls) return null;

for (var i=0; i<imageUrls.length; ++i) {
var url = imageUrls[i];
pg.misc.imageArray[i]=new Image();
pg.misc.imageArray[i].src=url;
}
if (pg.timer.image != null) {
clearInterval(pg.timer.image);
pg.counter.checkImages=0;
}
pg.misc.gImage=new Title(image.toString());
pg.timer.image=setInterval("checkImages()", 250);
return true;
}

function getValidImageFromWikiText(wikiText) {
var imagePage=null;
// nb in pg.re.image we're interested in the second bracketed expression
// this may change if the regex changes :-(
//var match=pg.re.image.exec(wikiText);
var matched=null;
var match;
// strip html comments, used by evil bots :-(
var t = removeMatchesUnless(wikiText, RegExp('(<!--[\\s\\S]*?-->)'), 1,
RegExp('^<!--[^[]*popup', 'i'));

while ( match = pg.re.image.exec(t) ) {
// now find a sane image name - exclude templates by seeking {
var m = match[2] || match[6];
var pxWidth=match[4];
if ( isValidImageName(m) &&
(!pxWidth || parseInt(pxWidth,10) >= getValueOf('popupMinImageWidth')) ) {
matched=m;
break;
}
}
pg.re.image.lastIndex=0;
if (!matched) { return null; }
return pg.ns.image+':'+upcaseFirst(matched);
}

function removeMatchesUnless(str, re1, parencount, re2) {
var split=str.parenSplit(re1);
var c=parencount + 1;
for (var i=0; i<split.length; ++i) {
if ( i%c === 0 || re2.test(split[i]) ) { continue; }
split[i]='';
}
return split.join('');
}

//</NOLITE>
// ENDFILE: images.js
// STARTFILE: namespaces.js
// Set up namespaces and other non-strings.js localization
// (currently that means redirs too)

// Put the right namespace list into pg.ns.list, based on pg.wiki.lang
// Default to english if nothing seems to fit
function setNamespaceList() {
var m="Media";
var list = [m, "Special", "Talk", "User", "User talk", "Wikipedia", "Wikipedia talk", "Image", "Image talk", "MediaWiki", "MediaWiki talk", "Template", "Template talk", "Help", "Help talk", "Category", "Category talk", "Portal", "Portal talk"];
var nsIndex = { '': 0, 'Special': 1,
'Talk': 2, 'User': 3, 'User talk': 4, 'Wikipedia': 5,
'Wikipedia talk': 6, 'Image': 7, 'Image talk': 8, 'MediaWiki': 9,
'MediaWiki talk': 10, 'Template': 11, 'Template talk': 12,
'Help': 13, 'Help talk': 14, 'Category': 15, 'Category talk':16,
'Portal': 17, 'Portal talk': 18};
var nsLists = {
//<NOLITE>
"af": [m, "Spesiaal", "Bespreking", "Gebruiker", "Gebruikerbespreking", "Wikipedia", "Wikipediabespreking", "Beeld", "Beeldbespreking", "MediaWiki", "MediaWikibespreking", "Sjabloon", "Sjabloonbespreking", "Hulp", "Hulpbespreking", "Kategorie", "Kategoriebespreking"],
"als": [m, "Spezial", "Diskussion", "Benutzer", "Benutzer Diskussion", "Wikipedia", "Wikipedia Diskussion", "Bild", "Bild Diskussion", "MediaWiki", "MediaWiki Diskussion", "Vorlage", "Vorlage Diskussion", "Hilfe", "Hilfe Diskussion", "Kategorie", "Kategorie Diskussion"],
"ar": ["ملف", "خاص", "نقاش", "مستخدم", "نقاش المستخدم", "ويكيبيديا", "نقاش ويكيبيديا", "صورة", "نقاش الصورة", "ميدياويكي", "نقاش ميدياويكي", "Template", "نقاش Template", "مساعدة", "نقاش المساعدة", "تصنيف", "نقاش التصنيف"],
"ast": [m, "Especial", "Discusión", "Usuariu", "Usuariu discusión", "Uiquipedia", "Uiquipedia discusión", "Imaxen", "Imaxen discusión", "MediaWiki", "MediaWiki discusión", "Plantilla", "Plantilla discusión", "Ayuda", "Ayuda discusión", "Categoría", "Categoría discusión"],
"be": ["Мэдыя", "Спэцыяльныя", "Абмеркаваньне", "Удзельнік", "Гутаркі ўдзельніка", "Вікіпэдыя", "Абмеркаваньне Вікіпэдыя", "Выява", "Абмеркаваньне выявы", "MediaWiki", "Абмеркаваньне MediaWiki", "Шаблён", "Абмеркаваньне шаблёну", "Дапамога", "Абмеркаваньне дапамогі", "Катэгорыя", "Абмеркаваньне катэгорыі"],
"bg": ["Медия", "Специални", "Беседа", "Потребител", "Потребител беседа", "Уикипедия", "Уикипедия беседа", "Картинка", "Картинка беседа", "МедияУики", "МедияУики беседа", "Шаблон", "Шаблон беседа", "Помощ", "Помощ беседа", "Категория", "Категория беседа"],
"bm": [m, "Special", "Discuter", "Utilisateur", "Discussion Utilisateur", "Wikipedia", "Discussion Wikipedia", "Image", "Discussion Image", "MediaWiki", "Discussion MediaWiki", "Modèle", "Discussion Modèle", "Aide", "Discussion Aide", "Catégorie", "Discussion Catégorie"],
"bn": ["বিশেষ", "আলাপ", "ব্যবহারকারী", "ব্যবহারকারী আলাপ", "উইকিপেডিয়া", "উইকিপেডিয়া আলাপ", "চিত্র", "চিত্র আলাপ", "MediaWik i আলাপ", m, "MediaWiki", "Template", "Template talk", "Help", "Help talk", "Category", "Category talk"],
"br": [m, "Dibar", "Kaozeal", "Implijer", "Kaozeadenn Implijer", "Wikipedia", "Kaozeadenn Wikipedia", "Skeudenn", "Kaozeadenn Skeudenn", "MediaWiki", "Kaozeadenn MediaWiki", "Patrom", "Kaozeadenn Patrom", "Skoazell", "Kaozeadenn Skoazell", "Rummad", "Kaozeadenn Rummad"],
"ca": [m, "Especial", "Discussió", "Usuari", "Usuari Discussió", "Viquipèdia", "Viquipèdia Discussió", "Imatge", "Imatge Discussió", "MediaWiki", "MediaWiki Discussió", "Template", "Template Discussió", "Ajuda", "Ajuda Discussió", "Categoria", "Categoria Discussió"],
"cs": ["Média", "Speciální", "Diskuse", "Wikipedista", "Wikipedista diskuse", "Wikipedie", "Wikipedie diskuse", "Soubor", "Soubor diskuse", "MediaWiki", "MediaWiki diskuse", "Šablona", "Šablona diskuse", "Nápověda", "Nápověda diskuse", "Kategorie", "Kategorie diskuse"],
"csb": [m, "Specjalnô", "Diskùsëjô", "Brëkòwnik", "Diskùsëjô brëkòwnika", "Wiki", "Diskùsëjô Wiki", "Òbrôzk", "Diskùsëjô òbrôzków", "MediaWiki", "Diskùsëjô MediaWiki", "Szablóna", "Diskùsëjô Szablónë", "Pòmòc", "Diskùsëjô Pòmòcë", "Kategòrëjô", "Diskùsëjô Kategòrëji"],
"cv": ["Медиа", "Ятарлă", "Сӳтсе явасси", "Хутшăнакан", "Хутшăнаканăн канашлу страници", "Wikipedia", "0", "Ӳкерчĕк", "Ӳкерчĕке сӳтсе явмалли", "MediaWiki", "MediaWiki сӳтсе явмалли", "Шаблон", "Шаблона сӳтсе явмалли", "Пулăшу", "Пулăшăва сӳтсе явмалли", "Категори", "Категорине сӳтсе явмалли"],
"cy": [m, "Arbennig", "Sgwrs", "Defnyddiwr", "Sgwrs Defnyddiwr", "Wicipedia", "Sgwrs Wicipedia", "Delwedd", "Sgwrs Delwedd", "MediaWiki", "Sgwrs MediaWiki", "Nodyn", "Sgwrs Nodyn", "Help", "Help talk", "Category", "Category talk"],
"da": [m, "Speciel", "Diskussion", "Bruger", "Bruger diskussion", "Wikipedia", "Wikipedia diskussion", "Billede", "Billede diskussion", "MediaWiki", "MediaWiki diskussion", "Skabelon", "Skabelon diskussion", "Hjælp", "Hjælp diskussion", "Kategori", "Kategori diskussion"],
"de": [m, "Spezial", "Diskussion", "Benutzer", "Benutzer Diskussion", "Wikipedia", "Wikipedia Diskussion", "Bild", "Bild Diskussion", "MediaWiki", "MediaWiki Diskussion", "Vorlage", "Vorlage Diskussion", "Hilfe", "Hilfe Diskussion", "Kategorie", "Kategorie Diskussion", "Portal", "Portal Diskussion"],
"el": ["Μέσον", "Ειδικό", "Συζήτηση", "Χρήστης", "Συζήτηση χρήστη", "Βικιπαίδεια", "Βικιπαίδεια συζήτηση", "Εικόνα", "Συζήτηση εικόνας", "MediaWiki", "MediaWiki talk", "Πρότυπο", "Συζήτηση προτύπου", "Βοήθεια", "Συζήτηση βοήθειας", "Κατηγορία", "Συζήτηση κατηγορίας"],
"eo": [m, "Speciala", "Diskuto", "Vikipediisto", "Vikipediista diskuto", "Vikipedio", "Vikipedio diskuto", "Dosiero", "Dosiera diskuto", "MediaWiki", "MediaWiki diskuto", "Ŝablono", "Ŝablona diskuto", "Helpo", "Helpa diskuto", "Kategorio", "Kategoria diskuto"],
"es": [m, "Especial", "Discusión", "Usuario", "Usuario Discusión", "Wikipedia", "Wikipedia Discusión", "Imagen", "Imagen Discusión", "MediaWiki", "MediaWiki Discusión", "Plantilla", "Plantilla Discusión", "Ayuda", "Ayuda Discusión", "Categoría", "Categoría Discusión"],
"et": ["Meedia", "Eri", "Arutelu", "Kasutaja", "Kasutaja arutelu", "Vikipeedia", "Vikipeedia arutelu", "Pilt", "Pildi arutelu", "MediaWiki", "MediaWiki arutelu", "Mall", "Malli arutelu", "Juhend", "Juhendi arutelu", "Kategooria", "Kategooria arutelu"],
"eu": [m, "Aparteko", "Eztabaida", "Lankide", "Lankide eztabaida", "Wikipedia", "Wikipedia eztabaida", "Irudi", "Irudi eztabaida", "MediaWiki", "MediaWiki eztabaida", "Template", "Template talk", "Help", "Help talk", "Category", "Category talk"],
"fa": ["مدیا", "ویژه", "بحث", "کاربر", "بحث کاربر", "ویکی‌پدیا", "بحث ویکی‌پدیا", "تصویر", "بحث تصویر", "مدیاویکی", "بحث مدیاویکی", "الگو", "بحث الگو", "راهنما", "بحث راهنما", "رده", "بحث رده"],
"fi": [m, "Toiminnot", "Keskustelu", "Käyttäjä", "Keskustelu käyttäjästä", "Wikipedia", "Keskustelu Wikipediasta", "Kuva", "Keskustelu kuvasta", "MediaWiki", "MediaWiki talk", "Malline", "Keskustelu mallineesta", "Ohje", "Keskustelu ohjeesta", "Luokka", "Keskustelu luokasta"],
"fo": ["Miðil", "Serstakur", "Kjak", "Brúkari", "Brúkari kjak", "Wikipedia", "Wikipedia kjak", "Mynd", "Mynd kjak", "MidiaWiki", "MidiaWiki kjak", "Fyrimynd", "Fyrimynd kjak", "Hjálp", "Hjálp kjak", "Bólkur", "Bólkur kjak"],
"fr": [m, "Special", "Discuter", "Utilisateur", "Discussion Utilisateur", "Wikipédia", "Discussion Wikipédia", "Image", "Discussion Image", "MediaWiki", "Discussion MediaWiki", "Modèle", "Discussion Modèle", "Aide", "Discussion Aide", "Catégorie", "Discussion Catégorie", "Portail", "Discussion Portail"],
"fur": [m, "Speciâl", "Discussion", "Utent", "Discussion utent", "Vichipedie", "Discussion Vichipedie", "Figure", "Discussion figure", "MediaWiki", "Discussion MediaWiki", "Model", "Discussion model", "Jutori", "Discussion jutori", "Categorie", "Discussion categorie"],
"fy": [m, "Wiki", "Oerlis", "Meidogger", "Meidogger oerlis", "Wikipedy", "Wikipedy oerlis", "Ofbyld", "Ofbyld oerlis", "MediaWiki", "MediaWiki oerlis", "Berjocht", "Berjocht oerlis", "Hulp", "Hulp oerlis", "Kategory", "Kategory oerlis"],
"ga": ["Meán", "Speisialta", "Plé", "Úsáideoir", "Plé úsáideora", "Vicipéid", "Plé Vicipéide", "Íomhá", "Plé íomhá", "MediaWiki", "Plé MediaWiki", "Teimpléad", "Plé teimpléid", "Cabhair", "Plé cabhrach", "Catagóir", "Plé catagóire"],
"gu": [m, "Special", "Talk", "User", "User talk", "વિકિપીડિયા", "વિકિપીડિયા talk", "Image", "Image talk", "MediaWiki", "MediaWiki talk", "Template", "Template talk", "Help", "Help talk", "Category", "Category talk"],
"he": [m, "מיוחד", "שיחה", "משתמש", "שיחת משתמש", "ויקיפדיה", "שיחת ויקיפדיה", "תמונה", "שיחת תמונה", "MediaWiki", "שיחת MediaWiki", "תבנית", "שיחת תבנית", "עזרה", "שיחת עזרה", "קטגוריה", "שיחת קטגוריה"],
"hi": [m, "विशेष", "वार्ता", "सदस्य", "सदस्य वार्ता", "विकिपीडिया", "विकिपीडिया वार्ता", "चित्र", "चित्र वार्ता", "MediaWiki", "MediaWiki talk", "Template", "Template talk", "श्रेणी", "श्रेणी वार्ता", "Help", "Help talk"],
"hr": ["Mediji", "Posebno", "Razgovor", "Suradnik", "Razgovor sa suradnikom", "Wikipedia", "Razgovor Wikipedia", "Slika", "Razgovor o slici", "MediaWiki", "MediaWiki razgovor", "Predložak", "Razgovor o predlošku", "Pomoć", "Razgovor o pomoći", "Kategorija", "Razgovor o kategoriji"],
"hu": ["Média", "Speciális", "Vita", "User", "User vita", "Wikipédia", "Wikipédia vita", "Kép", "Kép vita", "MediaWiki", "MediaWiki vita", "Sablon", "Sablon vita", "Segítség", "Segítség vita", "Kategória", "Kategória vita"],
"ia": [m, "Special", "Discussion", "Usator", "Discussion Usator", "Wikipedia", "Discussion Wikipedia", "Imagine", "Discussion Imagine", "MediaWiki", "Discussion MediaWiki", "Template", "Template talk", "Help", "Help talk", "Category", "Category talk"],
"id": [m, "Istimewa", "Bicara", "Pengguna", "Bicara Pengguna", "Wikipedia", "Pembicaraan Wikipedia", "Gambar", "Pembicaraan Gambar", "MediaWiki", "Pembicaraan MediaWiki", "Templat", "Pembicaraan Templat", "Bantuan", "Pembicaraan Bantuan", "Kategori", "Pembicaraan Kategori"],
"is": ["Miðill", "Kerfissíða", "Spjall", "Notandi", "Notandaspjall", "Wikipedia", "Wikipediaspjall", "Mynd", "Myndaspjall", "Melding", "Meldingarspjall", "Snið", "Sniðaspjall", "Hjálp", "Hjálparspjall", "Flokkur", "Flokkaspjall"],
"it": [m, "Speciale", "Discussione", "Utente", "Discussioni utente", "Wikipedia", "Discussioni Wikipedia", "Immagine", "Discussioni immagine", "MediaWiki", "Discussioni MediaWiki", "Template", "Discussioni template", "Aiuto", "Discussioni aiuto", "Categoria", "Discussioni categoria"],
"ja": [m, "特別", "ノート", "利用者", "利用者‐会話", "Wikipedia", "Wikipedia‐ノート", "画像", "画像‐ノート", "MediaWiki", "MediaWiki‐ノート", "Template", "Template‐ノート", "Help", "Help‐ノート", "Category", "Category‐ノート"],
"ka": ["მედია", "სპეციალური", "განხილვა", "მომხმარებელი", "მომხმარებელი განხილვა", "ვიკიპედია", "ვიკიპედია განხილვა", "სურათი", "სურათი განხილვა", "მედიავიკი", "მედიავიკი განხილვა", "თარგი", "თარგი განხილვა", "დახმარება", "დახმარება განხილვა", "კატეგორია", "კატეგორია განხილვა"],
"ko": [m, "특수기능", "토론", "사용자", "사용자토론", "위키백과", "위키백과토론", "그림", "그림토론", "분류", "분류토론", "MediaWiki", "MediaWiki talk", "Template", "Template talk", "Help", "Help talk"],
"ku": ["Medya", "Taybet", "Nîqaş", "Bikarhêner", "Bikarhêner nîqaş", "Wîkîpediya", "Wîkîpediya nîqaş", "Wêne", "Wêne nîqaş", "MediaWiki", "MediaWiki nîqaş", "Şablon", "Şablon nîqaş", "Alîkarî", "Alîkarî nîqaş", "Kategorî", "Kategorî nîqaş"],
"la": ["Specialis", "Disputatio", "Usor", "Disputatio Usoris", "Vicipaedia", "Disputatio Vicipaediae", "Imago", "Disputatio Imaginis", "MediaWiki", "Disputatio MediaWiki", "Formula", "Disputatio Formulae", "Auxilium", "Disputatio Auxilii", "Categoria", "Disputatio Categoriae", m],
"li": [m, "Speciaal", "Euverlik", "Gebroeker", "Euverlik gebroeker", "Wikipedia", "Euverlik Wikipedia", "Aafbeilding", "Euverlik afbeelding", "MediaWiki", "Euverlik MediaWiki", "Sjabloon", "Euverlik sjabloon", "Help", "Euverlik help", "Kategorie", "Euverlik kategorie"],
"lt": ["Medija", "Specialus", "Aptarimas", "Naudotojas", "Naudotojo aptarimas", "Wikipedia", "Wikipedia aptarimas", "Vaizdas", "Vaizdo aptarimas", "MediaWiki", "MediaWiki aptarimas", "Šablonas", "Šablono aptarimas", "Pagalba", "Pagalbos aptarimas", "Kategorija", "Kategorijos aptarimas"],
"mk": ["Медија", "Специјални", "Разговор", "Корисник", "Корисник разговор", "Wikipedia", "Wikipedia разговор", "Слика", "Слика разговор", "МедијаВики", "МедијаВики разговор", "Шаблон", "Шаблон разговор", "Помош", "Помош разговор", "Категорија", "Категорија разговор"],
"ms": [m, "Istimewa", "Perbualan", "Pengguna", "Perbualan Pengguna", "Wikipedia", "Perbualan Wikipedia", "Imej", "Imej Perbualan", "MediaWiki", "MediaWiki Perbualan", "Template", "Template talk", "Help", "Help talk", "Category", "Category talk"],
"mt": [m, "Special", "Talk", "User", "User talk", "Wikipedija", "Wikipedija talk", "Image", "Image talk", "MediaWiki", "MediaWiki talk", "Template", "Template talk", "Help", "Help talk", "Category", "Category talk"],
"nap": [m, "Speciale", "Discussione", "Utente", "Discussioni utente", "Wikipedia", "Discussioni Wikipedia", "Immagine", "Discussioni immagine", "MediaWiki", "Discussioni MediaWiki", "Template", "Discussioni template", "Aiuto", "Discussioni aiuto", "Categoria", "Discussioni categoria"],
"nds": [m, "Spezial", "Diskuschoon", "Bruker", "Bruker Diskuschoon", "Wikipedia", "Wikipedia Diskuschoon", "Bild", "Bild Diskuschoon", "MediaWiki", "MediaWiki Diskuschoon", "Vörlaag", "Vörlaag Diskuschoon", "Hülp", "Hülp Diskuschoon", "Kategorie", "Kategorie Diskuschoon"],
"nl": [m, "Speciaal", "Overleg", "Gebruiker", "Overleg gebruiker", "Wikipedia", "Overleg Wikipedia", "Afbeelding", "Overleg afbeelding", "MediaWiki", "Overleg MediaWiki", "Sjabloon", "Overleg sjabloon", "Help", "Overleg help", "Categorie", "Overleg categorie"],
"nn": ["Filpeikar", "Spesial", "Diskusjon", "Brukar", "Brukardiskusjon", "Wikipedia", "Wikipedia-diskusjon", "Fil", "Fildiskusjon", "MediaWiki", "MediaWiki-diskusjon", "Mal", "Maldiskusjon", "Hjelp", "Hjelpdiskusjon", "Kategori", "Kategoridiskusjon"],
"no": ["Medium", "Spesial", "Diskusjon", "Bruker", "Brukerdiskusjon", "Wikipedia", "Wikipedia-diskusjon", "Bilde", "Bildediskusjon", "MediaWiki", "MediaWiki-diskusjon", "Mal", "Maldiskusjon", "Hjelp", "Hjelpdiskusjon", "Kategori", "Kategoridiskusjon"],
"nv": [m, "Special", "Naaltsoos baa yinísht'į́", "Choinish'įįhí", "Choinish'įįhí baa yinísht'į́", "Wikiibíídiiya", "Wikiibíídiiya baa yinísht'į́", "E'elyaaígíí", "E'elyaaígíí baa yinísht'į́", "MediaWiki", "MediaWiki baa yinísht'į́", "Template", "Template talk", "Aná'álwo'", "Aná'álwo' baa yinísht'į́", "T'ááłáhági át'éego", "T'ááłáhági át'éego baa yinísht'į́"],
"oc": ["Especial", "Discutir", "Utilisator", "Discutida Utilisator", "Oiquipedià", "Discutida Oiquipedià", "Image", "Discutida Image", "MediaWiki", "MediaWiki talk", "Template", "Template talk", m, "Help", "Help talk", "Category", "Category talk"],
"os": [m, "Сæрмагонд", "Дискусси", "Архайæг", "Архайæджы дискусси", "Wikipedia", "0", "Ныв", "Нывы тыххæй дискусси", "MediaWiki", "Дискусси MediaWiki", "Шаблон", "Шаблоны тыххæй дискусси", "Æххуыс", "Æххуысы тыххæй дискусси", "Категори", "Категорийы тыххæй дискусси"],
"pa": ["ਮੀਡੀਆ", "ਖਾਸ", "ਚਰਚਾ", "ਮੈਂਬਰ", "ਮੈਂਬਰ ਚਰਚਾ", "Wikipedia", "Wikipedia ਚਰਚਾ", "ਤਸਵੀਰ", "ਤਸਵੀਰ ਚਰਚਾ", "ਮੀਡੀਆਵਿਕਿ", "ਮੀਡੀਆਵਿਕਿ ਚਰਚਾ", "ਨਮੂਨਾ", "ਨਮੂਨਾ ਚਰਚਾ", "ਮਦਦ", "ਮਦਦ ਚਰਚਾ", "ਸ਼੍ਰੇਣੀ", "ਸ਼੍ਰੇਣੀ ਚਰਚਾ"],
"pl": [m, "Specjalna", "Dyskusja", "Wikipedysta", "Dyskusja Wikipedysty", "Wikipedia", "Dyskusja Wikipedii", "Grafika", "Dyskusja grafiki", "MediaWiki", "Dyskusja MediaWiki", "Szablon", "Dyskusja szablonu", "Pomoc", "Dyskusja pomocy", "Kategoria", "Dyskusja kategorii", "Portal", "Dyskusja portalu"],
"pt": [m, "Especial", "Discussão", "Usuário", "Usuário Discussão", "Wikipedia", "Wikipedia Discussão", "Imagem", "Imagem Discussão", "MediaWiki", "MediaWiki Discussão", "Predefinição", "Predefinição Discussão", "Ajuda", "Ajuda Discussão", "Categoria", "Categoria Discussão"],
"ro": [m, "Special", "Discuţie", "Utilizator", "Discuţie Utilizator", "Wikipedia", "Discuţie Wikipedia", "Imagine", "Discuţie Imagine", "MediaWiki", "Discuţie MediaWiki", "Format", "Discuţie Format", "Ajutor", "Discuţie Ajutor", "Categorie", "Discuţie Categorie"],
"ru": ["Медиа", "Служебная", "Обсуждение", "Участник", "Обсуждение участника", "Википедия", "Обсуждение Википедии", "Изображение", "Обсуждение изображения", "MediaWiki", "Обсуждение MediaWiki", "Шаблон", "Обсуждение шаблона", "Справка", "Обсуждение справки", "Категория", "Обсуждение категории"],
"sc": ["Speciale", "Contièndha", "Utente", "Utente discussioni", "Wikipedia", "Wikipedia discussioni", "Immàgini", "Immàgini contièndha", m, "MediaWiki", "MediaWiki talk", "Template", "Template talk", "Help", "Help talk", "Category", "Category talk"],
"sk": ["Médiá", "Špeciálne", "Diskusia", "Redaktor", "Diskusia s redaktorom", "Wikipédia", "Diskusia k Wikipédii", "Obrázok", "Diskusia k obrázku", "MediaWiki", "Diskusia k MediaWiki", "Šablóna", "Diskusia k šablóne", "Pomoc", "Diskusia k pomoci", "Kategória", "Diskusia ku kategórii"],
"sl": [m, "Posebno", "Pogovor", "Uporabnik", "Uporabniški pogovor", "Wikipedija", "Pogovor k Wikipediji", "Slika", "Pogovor k sliki", "MediaWiki", "MediaWiki talk", "Template", "Template talk", "Help", "Help talk", "Category", "Category talk"],
"sq": [m, "Speciale", "Diskutim", "Përdoruesi", "Përdoruesi diskutim", "Wikipedia", "Wikipedia diskutim", "Figura", "Figura diskutim", "MediaWiki", "MediaWiki diskutim", "Stampa", "Stampa diskutim", "Ndihmë", "Ndihmë diskutim", "Category", "Category talk"],
"sr": [m, "Посебно", "Разговор", "Корисник", "Разговор са корисником", "Википедија", "Разговор о Википедији", "Слика", "Разговор о слици", "МедијаВики", "Разговор о МедијаВикију", "Шаблон", "Разговор о шаблону", "Помоћ", "Разговор о помоћи", "Категорија", "Разговор о категорији", "Портал", "Разговор о порталу"],
"sv": [m, "Special", "Diskussion", "Användare", "Användardiskussion", "Wikipedia", "Wikipediadiskussion", "Bild", "Bilddiskussion", "MediaWiki", "MediaWiki diskussion", "Mall", "Malldiskussion", "Hjälp", "Hjälp diskussion", "Kategori", "Kategoridiskussion"],
"ta": ["ஊடகம்", "சிறப்பு", "பேச்சு", "பயனர்", "பயனர் பேச்சு", "Wikipedia", "Wikipedia பேச்சு", "படிமம்", "படிமப் பேச்சு", "மீடியாவிக்கி", "மீடியாவிக்கி பேச்சு", "வார்ப்புரு", "வார்ப்புரு பேச்சு", "உதவி", "உதவி பேச்சு", "பகுப்பு", "பகுப்பு பேச்சு"],
"th": [m, "พิเศษ", "พูดคุย", "ผู้ใช้", "คุยเกี่ยวกับผู้ใช้", "Wikipedia", "Wikipedia talk", "ภาพ", "คุยเกี่ยวกับภาพ", "MediaWiki", "คุยเกี่ยวกับ MediaWiki", "Template", "Template talk", "Help", "Help talk", "Category", "Category talk"],
"tlh": ["Doch", "le'", "ja'chuq", "lo'wI'", "lo'wI' ja'chuq", "wIqIpe'DIya", "wIqIpe'DIya ja'chuq", "nagh beQ", "nagh beQ ja'chuq", "MediaWiki", "MediaWiki ja'chuq", "chen'ay'", "chen'ay' ja'chuq", "QaH", "QaH ja'chuq", "Segh", "Segh ja'chuq"],
"tr": [m, "Özel", "Tartışma", "Kullanıcı", "Kullanıcı mesaj", "Vikipedi", "Vikipedi tartışma", "Resim", "Resim tartışma", "MedyaViki", "MedyaViki tartışma", "Şablon", "Şablon tartışma", "Yardım", "Yardım tartışma", "Kategori", "Kategori tartışma"],
"tt": [m, "Maxsus", "Bäxäs", "Äğzä", "Äğzä bäxäse", "Wikipedia", "Wikipedia bäxäse", "Räsem", "Räsem bäxäse", "MediaWiki", "MediaWiki bäxäse", "Ürnäk", "Ürnäk bäxäse", "Yärdäm", "Yärdäm bäxäse", "Törkem", "Törkem bäxäse"],
"uk": ["Медіа", "Спеціальні", "Обговорення", "Користувач", "Обговорення користувача", "Wikipedia", "Обговорення Wikipedia", "Зображення", "Обговорення зображення", "MediaWiki", "Обговорення MediaWiki", "Шаблон", "Обговорення шаблону", "Довідка", "Обговорення довідки", "Категорія", "Обговорення категорії"],
"vi": ["Phương tiện", "Đặc biệt", "Thảo luận", "Thành viên", "Thảo luận Thành viên", "Wikipedia", "Thảo luận Wikipedia", "Hình", "Thảo luận Hình", "MediaWiki", "Thảo luận MediaWiki", "Tiêu bản", "Thảo luận Tiêu bản", "Trợ giúp", "Thảo luận Trợ giúp", "Thể loại", "Thảo luận Thể loại"],
"wa": [m, "Sipeciås", "Copene", "Uzeu", "Uzeu copene", "Wikipedia", "Wikipedia copene", "Imådje", "Imådje copene", "MediaWiki", "MediaWiki copene", "Modele", "Modele copene", "Aidance", "Aidance copene", "Categoreye", "Categoreye copene"]
//</NOLITE>
};
pg.ns.list = nsLists[pg.wiki.lang] || list;
pg.ns.index = nsIndex;
}

function namespaceListToRegex(list) {return RegExp('^('+list.join('|').split(' ').join('[ _]')+'):');};
// function setNamespaceList is ugly as sin, moved to later in the code

function setNamespaces() {
setNamespaceList();
pg.ns.withTalkList=[null]; // NB root (article) corresponds with this entry, null
pg.ns.talkList=[pg.ns.list[2]];

// if the number of namespaces changes then this will have to be changed
// maybe the easiest way is to specify the arrays by hand as in the comments following the loop

for (var i=3; i+1<pg.ns.list.length; i=i+2) {
pg.ns.withTalkList.push(pg.ns.list[i]);
pg.ns.talkList.push(pg.ns.list[i+1]);
}

// ALERT! SILLY HARDCODED VALUES FOLLOW!
pg.ns.special = pg.ns.list[pg.ns.index.Special];
pg.ns.image = pg.ns.list[pg.ns.index.Image];
pg.ns.user = pg.ns.list[pg.ns.index.User];
pg.ns.usertalk = pg.ns.list[pg.ns.index['User talk']];
pg.ns.category = pg.ns.list[pg.ns.index.Category];
pg.ns.template = pg.ns.list[pg.ns.index.Template];
pg.ns.nonArticleList=pg.ns.list.slice(0,2).concat(pg.ns.list.slice(2));
}


function setRedirs() {
var r='redirect';
var R='REDIRECT';
var redirLists={
//<NOLITE>
'ar': [ R, 'تحويل' ],
'be': [ r, 'перанакіраваньне' ],
'bg': [ r, 'пренасочване', 'виж' ],
'bs': [ r, 'Preusmjeri', 'preusmjeri', 'PREUSMJERI' ],
'cs': [ R, 'PŘESMĚRUJ' ],
'cy': [ r, 'ail-cyfeirio' ],
'et': [ r, 'suuna' ],
'ga': [ r, 'athsheoladh' ],
'he': [ R, 'הפניה' ],
'is': [ r, 'tilvísun', 'TILVÍSUN' ],
'mk': [ r, 'пренасочување', 'види' ],
'nds': [ r, 'wiederleiden' ],
'nn': [ r, 'omdiriger' ],
'pt': [ R, 'redir' ],
'ru': [ R, 'ПЕРЕНАПРАВЛЕНИЕ', 'ПЕРЕНАПР' ],
'sk': [ r, 'presmeruj' ],
'sr': [ r, 'Преусмери', 'преусмери', 'ПРЕУСМЕРИ', 'Preusmeri', 'preusmeri', 'PREUSMERI' ],
'tt': [ 'yünältü' ],
'vi': [ r, 'đổi' ] // no comma
//</NOLITE>
};
var redirList=redirLists[ pg.wiki.lang ] || [r, R];
// Mediawiki is very tolerant about what comes after the #redirect at the start
pg.re.redirect=RegExp('^\\s*[#](' + redirList.join('|') + ').*?\\[{2}([^\\|\\]]*)(|[^\\]]*)?\\]{2}\\s*(.*)', 'i');
}

function setInterwiki() {
if (pg.wiki.wikimedia) {
pg.wiki.interwiki='aa|ab|af|ak|als|am|an|ang|ar|arc|as|ast|av|ay|az|ba|be|ber|bg|bh|bi|bm|bn|bdf|bo|br|bs|ca|ce|ceb|ch|cho|chr|chy|co|commons|cr|cs|csb|cu|cv|cy|da|de|dv|dz|el|en|eo|es|et|eu|fa|ff|fi|fiu-vro|fj|fo|fr|fur|fy|ga|gd|gil|gl|gn|got|gu|gv|ha|haw|he|hi|ho|hr|ht|hu|hy|hz|ia|id|ie|ig|ii|ik|io|is|it|iu|ja|jbo|jv|ka|kg|ki|kj|kk|kl|km|kn|ko|kr|ks|ku|kv|kw|ky|la|lad|lan|lb|lg|li|ln|lo|lt|lu|lv|mg|mh|mi|mk|ml|mn|mo|mr|ms|mt|mus|my|na|nah|nap|nb|nd|nds|ne|ng|nl|nn|no|nr|nv|ny|oc|oj|om|or|os|pa|pam|pi|pl|ps|pt|qu|rm|rn|ro|roa-rup|ru|rw|sa|sc|scn|sco|sd|se|sg|sh|si|simple|sk|sl|sm|smg|sn|so|sq|sr|ss|st|su|sv|sw|ta|te|tg|th|ti|tk|tl|tlh|tn|to|tpi|tr|ts|tt|tum|tw|ty|ug|uk|ur|uz|ve|vi|vk|vo|wa|war|wen|wo|xh|yi|yo|za|zh|zh-min-nan|zu';
pg.re.interwiki=RegExp('^'+pg.wiki.interwiki+':');
} else {
pg.wiki.interwiki=null;
pg.re.interwiki=RegExp('^$');
}
}

function nsRe(label) {
var l=upcaseFirst(label);
return nsRegexString(pg.ns.list[pg.ns.index[l]], l);
}

function nsRegexString(str, extra) {
return '(?:' + str + '|' + encodeURI(str) + (extra ? '|' + extra : '') + ')';
}

function nsRegex(str, extra) {
return RegExp(nsRegexString(str, extra));
}
// ENDFILE: namespaces.js
// STARTFILE: selpop.js
//<NOLITE>
function getEditboxSelection() {
// see http://www.webgurusforum.com/8/12/0
try {
var editbox=document.editform.wpTextbox1;
} catch (dang) { return; }
// IE, Opera
if (document.selection) { return document.selection.createRange().text; }
// Mozilla
var selStart = editbox.selectionStart;
var selEnd = editbox.selectionEnd;
return (editbox.value).substring(selStart, selEnd);
}

function doSelectionPopup() {
// popup if the selection looks like [[foo|anything afterwards at all
// or [[foo|bar]]text without ']]'
// or [[foo|bar]]
var sel=getEditboxSelection();
var open=sel.indexOf('[[');
var pipe=sel.indexOf('|');
var close=sel.indexOf(']]');
if (open == -1 || ( pipe == -1 && close == -1) ) { return; }
if (pipe != -1 && open > pipe || close != -1 && open > close) { return; }
var article=new Title(sel.substring(open+2, (pipe < 0) ? close : pipe)).urlString();
if (close > 0 && sel.substring(close+2).indexOf('[[') >= 0) { return; }
var a=document.createElement('a');
a.href=pg.wiki.titlebase + article;
mouseOverWikiLink2(a);
if (a.navpopup) {
a.navpopup.addHook(function(){runStopPopupTimer(a.navpopup);}, 'unhide', 'after');
}
}
//</NOLITE>
// ENDFILE: selpop.js
// STARTFILE: navpopup.js
/**
@fileoverview Defines two classes: {@link Navpopup} and {@link Mousetracker}.

<code>Navpopup</code> describes popups: when they appear, where, what
they look like and so on.

<code>Mousetracker</code> "captures" the mouse using
<code>document.onmousemove</code>.
*/


/**
Creates a new Mousetracker.
@constructor
@class The Mousetracker class. This monitors mouse movements and manages associated hooks.
*/
function Mousetracker() {
/**
Interval to regularly run the hooks anyway, in milliseconds.
@type Integer
*/
this.loopDelay=400;

/**
Timer for the loop.
@type Timer
*/
this.timer=null;

/**
Flag - are we switched on?
@type Boolean
*/
this.active=false;
/**
Flag - are we probably inaccurate, i.e. not reflecting the actual mouse position?
*/
this.dirty=true;
/**
Array of hook functions.
@private
@type Array
*/
this.hooks=[];
}

/**
Adds a hook, to be called when we get events.
@param {Function} f A function which is called as
<code>f(x,y)</code>. It should return <code>true</code> when it
wants to be removed, and <code>false</code> otherwise.
*/
Mousetracker.prototype.addHook = function (f) {
this.hooks.push(f);
};

/**
Runs hooks, passing them the x
and y coords of the mouse. Hook functions that return true are
passed to {@link Mousetracker#removeHooks} for removal.
@private
*/
Mousetracker.prototype.runHooks = function () {
if (!this.hooks || !this.hooks.length) { return; }
//log('Mousetracker.runHooks; we got some hooks to run');
var remove=false;
var removeObj={};
// this method gets called a LOT -
// pre-cache some variables
var x=this.x, y=this.y, len = this.hooks.length;

for (var i=0; i<len; ++i) {
//~ run the hook function, and remove it if it returns true
if (this.hooks[i](x, y)===true) {
remove=true;
removeObj[i]=true;
}
}
if (remove) { this.removeHooks(removeObj); }
};

/**
Removes hooks.
@private
@param {Object} removeObj An object whose keys are the index
numbers of functions for removal, with values that evaluate to true
*/
Mousetracker.prototype.removeHooks = function(removeObj) {
var newHooks=[];
var len = this.hooks.length;
for (var i=0; i<len; ++i) {
if (! removeObj[i]) { newHooks.push(this.hooks[i]); }
}
this.hooks=newHooks;
};


/**
Event handler for mouse wiggles.
We simply grab the event, set x and y and run the hooks.
This makes the cpu all hot and bothered :-(
@private
@param {Event} e Mousemove event
*/
Mousetracker.prototype.track=function (e) {
//~ Apparently this is needed in IE.
e = e || window.event;
var x, y;
if (e) {
if (e.pageX) { x=e.pageX; y=e.pageY; }
else if (typeof e.clientX!='undefined') {
var left, top, docElt = window.document.documentElement;

if (docElt) { left=docElt.scrollLeft; }
left = left || window.document.body.scrollLeft || window.document.scrollLeft || 0;

if (docElt) { top=docElt.scrollTop; }
top = top || window.document.body.scrollTop || window.document.scrollTop || 0;

x=e.clientX + left;
y=e.clientY + top;
} else { return; }
this.setPosition(x,y);
}
};

/**
Sets the x and y coordinates stored and takes appropriate action,
running hooks as appropriate.
@param {Integer} x, y Screen coordinates to set
*/

Mousetracker.prototype.setPosition=function(x,y) {
//console.log('Mousetracker.setPosition' + +(new Date()));
this.x = x;
this.y = y;
if (this.dirty || this.hooks.length === 0) { this.dirty=false; return; }
if (typeof this.lastHook_x != 'number') { this.lastHook_x = -100; this.lastHook_y=-100; }
var diff = (this.lastHook_x - x)*(this.lastHook_y - y);
diff = (diff >= 0) ? diff : -diff;
if ( diff > 1 ) {
this.lastHook_x=x;
this.lastHook_y=y;
if (this.dirty) { this.dirty = false; }
else { this.runHooks(); }
}
}

/**
Sets things in motion, unless they are already that is, registering an event handler on <code>document.onmousemove</code>.
A half-hearted attempt is made to preserve the old event handler if there is one.
*/
Mousetracker.prototype.enable = function () {
if (this.active) { return; }
this.active=true;
//~ Save the current handler for mousemove events. This isn't too
//~ robust, of course.
this.savedHandler=document.onmousemove;
//~ Gotta save @tt{this} again for the closure, and use apply for
//~ the member function.
var savedThis=this;
document.onmousemove=function (e) {savedThis.track.apply(savedThis, [e]);};
if (this.loopDelay) { this.timer = setInterval(function() { //log('loop delay in mousetracker is working');
savedThis.runHooks();}, this.loopDelay); }
};

/**
Disables the tracker, removing the event handler.
*/
Mousetracker.prototype.disable = function () {
if (!this.active) { return; }
if (typeof this.savedHandler=='function') {
document.onmousemove=this.savedHandler;
} else { delete document.onmousemove; }
if (this.timer) { clearInterval(this.timer); }
this.active=false;
};

/**
Creates a new Navpopup.
Gets a UID for the popup and
@param init Contructor object. If <code>init.draggable</code> is true or absent, the popup becomes draggable.
@constructor
@class The Navpopup class. This generates popup hints, and does some management of them.
*/
function Navpopup(init) {
//alert('new Navpopup(init)');
/** UID for each Navpopup instance.
Read-only.
@type integer
*/
this.uid=Navpopup.uid++;
/**
Read-only flag for current visibility of the popup.
@type boolean
@private
*/
this.visible=false;
/** Flag to be set when we want to cancel a previous request to
show the popup in a little while.
@private
@type boolean
*/
this.noshow=false;
/** Categorised list of hooks.
@see #runHooks
@see #addHook
@private
@type Object
*/
this.hooks={
'create': [],
'unhide': [],
'hide': []
};
/** list of unique IDs of hook functions, to avoid duplicates
@private
*/
this.hookIds={};
/** List of downloads associated with the popup.
@private
@type Array
*/
this.downloads=[];
/** Number of uncompleted downloads.
@type integer
*/
this.pending=null;
/** Tolerance in pixels when detecting whether the mouse has left the popup.
@type integer
*/
this.fuzz=5;
/** Flag to toggle running {@link #limitHorizontalPosition} to regulate the popup's position.
@type boolean
*/
this.constrained=true;
/** The popup width in pixels.
@private
@type integer
*/
this.width=0;
/** The popup width in pixels.
@private
@type integer
*/
this.height=0;
/** The main content DIV element.
@type HTMLDivElement
*/
this.mainDiv=null;
this.createMainDiv();

// if (!init || typeof init.draggable=='undefined' || init.draggable) {
// this.makeDraggable(true);
// }
}

/**
A UID for each Navpopup. This constructor property is just a counter.
@type integer
@private
*/
Navpopup.uid=0;

/**
Retrieves the {@link #visible} attribute, indicating whether the popup is currently visible.
@type boolean
*/
Navpopup.prototype.isVisible=function() {
return this.visible;
};

/**
Repositions popup using CSS style.
@private
@param {integer} x x-coordinate (px)
@param {integer} y y-coordinate (px)
@param {boolean} noLimitHor Don't call {@link #limitHorizontalPosition}
*/
Navpopup.prototype.reposition= function (x,y, noLimitHor) {
log ('reposition('+x+','+y+','+noLimitHor+')');
if (typeof x != 'undefined' && x!==null) { this.left=x; }
if (typeof y != 'undefined' && y!==null) { this.top=y; }
if (typeof this.left != 'undefined' && typeof this.top != 'undefined') {
this.mainDiv.style.left=this.left + 'px';
this.mainDiv.style.top=this.top + 'px';
}
if (!noLimitHor) { this.limitHorizontalPosition(); }
//console.log('navpop'+this.uid+' - (left,top)=(' + this.left + ',' + this.top + '), css=('
//+ this.mainDiv.style.left + ',' + this.mainDiv.style.top + ')');
};

/**
Prevents popups from being in silly locations. Hopefully.
Should not be run if {@link #constrained} is true.
@private
*/
Navpopup.prototype.limitHorizontalPosition=function() {
if (!this.constrained || this.tooWide) { return; }
this.updateDimensions();
var x=this.left;
var w=this.width;
var cWidth=document.body.clientWidth;


log('limitHorizontalPosition: x='+x+
', this.left=' + this.left +
', this.width=' + this.width +
', cWidth=' + cWidth);


if ( (x+w) >= cWidth ||
( x > 0 && this.maxWidth && this.width < this.maxWidth && this.height > this.width
&& x > cWidth - this.maxWidth ) ) {
// This is a very nasty hack. There has to be a better way!
// We find the "natural" width of the div by positioning it at the far left
// then reset it so that it should be flush right (well, nearly)
this.mainDiv.style.left='-10000px';
this.mainDiv.style.width = this.maxWidth + 'px';
var naturalWidth=parseInt(this.mainDiv.offsetWidth, 10);
var newLeft=cWidth - naturalWidth - 1;
if (newLeft < 0) { newLeft = 0; this.tooWide=true; } // still unstable for really wide popups?
log ('limitHorizontalPosition: moving to ('+newLeft + ','+ this.top+');' + ' naturalWidth=' + naturalWidth + ', clientWidth=' + cWidth);
this.reposition(newLeft, null, true);
}
};

/**
Counter indicating the z-order of the "highest" popup.
We start the z-index at 1000 so that popups are above everything
else on the screen.
@private
@type integer
*/
Navpopup.highest=1000;

/**
Brings popup to the top of the z-order.
We increment the {@link #highest} property of the contructor here.
@private
*/
Navpopup.prototype.raise = function () {
this.mainDiv.style.zIndex=Navpopup.highest + 1;
++Navpopup.highest;
};

/**
Shows the popup provided {@link #noshow} is not true.
Updates the position, brings the popup to the top of the z-order and unhides it.
*/
Navpopup.prototype.show = function () {
//document.title+='s';
if (this.noshow) { return; }
//document.title+='t';
this.reposition();
this.raise();
this.unhide();
};


/**
Runs the {@link #show} method in a little while, unless we're
already visible.
@param {integer} time Delay in milliseconds
@see #showSoonIfStable
*/
Navpopup.prototype.showSoon = function (time) {
if (this.visible) { return; }
this.noshow=false;
//~ We have to save the value of @tt{this} so that the closure below
//~ works.
var savedThis=this;
//this.start_x = Navpopup.tracker.x;
//this.start_y = Navpopup.tracker.y;
setTimeout(function () {
if (Navpopup.tracker.active) {
savedThis.reposition.apply(savedThis, [Navpopup.tracker.x + 2, Navpopup.tracker.y + 2]);
}
//~ Have to use apply to invoke his member function here
savedThis.show.apply(savedThis, []);
}, time);
};

/**
Checks to see if the mouse pointer has
stabilised (checking every <code>time</code>/2 milliseconds) and runs the
{@link #show} method if it has. This method makes {@link #showSoon} redundant.
@param {integer} time The minimum time (ms) before the popup may be shown.
*/
Navpopup.prototype.showSoonIfStable = function (time) {
log ('showSoonIfStable, time='+time);
if (this.visible) { return; }
this.noshow = false;

//~ initialize these variables so that we never run @tt{show} after
//~ just half the time
this.stable_x = -10000; this.stable_y = -10000;

var stableShow = function() {
log('stableShow called');
var new_x = Navpopup.tracker.x, new_y = Navpopup.tracker.y;
var dx = savedThis.stable_x - new_x, dy = savedThis.stable_y - new_y;
var fuzz2 = 0; // savedThis.fuzz * savedThis.fuzz;
//document.title += '[' + [savedThis.stable_x,new_x, savedThis.stable_y,new_y, dx, dy, fuzz2].join(',') + '] ';
if ( dx * dx <= fuzz2 && dy * dy <= fuzz2 ) {
log ('mouse is stable');
clearInterval(savedThis.showSoonStableTimer);
savedThis.reposition.apply(savedThis, [new_x + 2, new_y + 2]);
savedThis.show.apply(savedThis, []);
return;
}
savedThis.stable_x = new_x; savedThis.stable_y = new_y;
};
var savedThis = this;
this.showSoonStableTimer = setInterval(stableShow, time/2);
};

/**
Makes the popup unhidable until we call {@link #unstick}.
*/
Navpopup.prototype.stick=function() {
this.noshow=false;
this.sticky=true;
};

/**
Allows the popup to be hidden.
*/
Navpopup.prototype.unstick=function() {
this.sticky=false;
};

/**
Sets the {@link #noshow} flag and hides the popup. This should be called
when the mouse leaves the link before
(or after) it's actually been displayed.
*/
Navpopup.prototype.banish = function () {
log ('banish called');
// hide and prevent showing with showSoon in the future
this.noshow=true;
if (this.showSoonStableTimer) {
log('clearing showSoonStableTimer');
clearInterval(this.showSoonStableTimer);
}
this.hide();
};

/**
Runs hooks added with {@link #addHook}.
@private
@param {String} key Key name of the {@link #hooks} array - one of 'create', 'unhide', 'hide'
@param {String} when Controls exactly when the hook is run: either 'before' or 'after'
*/
Navpopup.prototype.runHooks = function (key, when) {
if (!this.hooks[key]) { return; }
var keyHooks=this.hooks[key];
var len=keyHooks.length;
for (var i=0; i< len; ++i) {
if (keyHooks[i] && keyHooks[i].when == when) {
if (keyHooks[i].hook.apply(this, [])) {
// remove the hook
if (keyHooks[i].hookId) {
delete this.hookIds[keyHooks[i].hookId];
}
keyHooks[i]=null;
}
}
}
};

/**
Adds a hook to the popup. Hook functions are run with <code>this</code> set to refer to the Navpopup instance, and no arguments.
@param {Function} hook The hook function. Functions that return true are deleted.
@param {String} key Key name of the {@link #hooks} array - one of 'create', 'unhide', 'hide'
@param {String} when Controls exactly when the hook is run: either 'before' or 'after'
@param {String} uid A truthy string identifying the hook function; if it matches another hook in this position, it won't be added again.
*/
Navpopup.prototype.addHook = function ( hook, key, when, uid ) {
when = when || 'after';
if (!this.hooks[key]) { return; }
// if uid is specified, don't add duplicates
var hookId=null;
if (uid) {
hookId=[key,when,uid].join('|');
//console.log('got hook Id ' + hookId);
if (this.hookIds[hookId]) {
//console.log('not adding ' + hookId);
return;
}
this.hookIds[hookId]=true;
}
this.hooks[key].push( {hook: hook, when: when, hookId: hookId} );
};

/**
Creates the main DIV element, which contains all the actual popup content.
Runs hooks with key 'create'.
@private
*/
Navpopup.prototype.createMainDiv = function () {
if (this.mainDiv) { return; }
this.runHooks('create', 'before');
var mainDiv=document.createElement('div');

var savedThis=this;
mainDiv.onclick=function(e) {savedThis.onclickHandler(e);};
mainDiv.className=(this.className) ? this.className : 'navpopup_maindiv';
mainDiv.id=mainDiv.className + this.uid;

mainDiv.style.position='absolute';
mainDiv.style.display='none';
mainDiv.className='navpopup';

// easy access to javascript object through DOM functions
mainDiv.navpopup=this;

this.mainDiv=mainDiv;
document.body.appendChild(mainDiv);
this.runHooks('create', 'after');
};
/**
Calls the {@link #raise} method.
@private
*/
Navpopup.prototype.onclickHandler=function(e) {
this.raise();
};
/**
Makes the popup draggable, using a {@link Drag} object.
@private
*/
Navpopup.prototype.makeDraggable=function(handleName) {
if (!this.mainDiv) { this.createMainDiv(); }
var drag=new Drag();
if (!handleName) {
drag.startCondition=function(e) {
try { if (!e.shiftKey) { return false; } } catch (err) { return false; }
return true;
};
}
var dragHandle = document.getElementById(handleName) || this.mainDiv;
var np=this;
drag.endHook=function(x,y) {
Navpopup.tracker.dirty=true;
np.reposition(x,y);
};
drag.init(dragHandle,this.mainDiv);
};

/** Hides the popup using CSS. Runs hooks with key 'hide'.
Sets {@link #visible} appropriately. {@link #banish} should be called externally instead of this method.

@private
*/
Navpopup.prototype.hide = function () {
this.runHooks('hide', 'before');
this.abortDownloads();
if (this.sticky) { return; }
if (typeof this.visible != 'undefined' && this.visible) {
this.mainDiv.style.display='none';
this.visible=false;
}
this.runHooks('hide', 'after');
};

/** Shows the popup using CSS. Runs hooks with key 'unhide'.
Sets {@link #visible} appropriately. {@link #show} should be called externally instead of this method.
@private
*/
Navpopup.prototype.unhide = function () {
this.runHooks('unhide', 'before');
if (typeof this.visible != 'undefined' && !this.visible) {
this.mainDiv.style.display='inline';
this.visible=true;
}
this.runHooks('unhide', 'after');
};

/**
Sets the <code>innerHTML</code> attribute of the main div containing the popup content.
@param {String} html The HTML to set.
*/
Navpopup.prototype.setInnerHTML = function (html) {
this.mainDiv.innerHTML = html;
};

/**
Updates the {@link #width} and {@link #height} attributes with the CSS properties.
@private
*/
Navpopup.prototype.updateDimensions = function () {
this.width=parseInt(this.mainDiv.offsetWidth, 10);
this.height=parseInt(this.mainDiv.offsetHeight, 10);
};

/**
Checks if the point (x,y) is within {@link #fuzz} of the
{@link #mainDiv}.
@param {integer} x x-coordinate (px)
@param {integer} y y-coordinate (px)
@type boolean
*/
Navpopup.prototype.isWithin = function(x,y) {
//~ If we're not even visible, no point should be considered as
//~ being within the popup.
if (!this.visible) { return false; }
this.updateDimensions();
var fuzz=this.fuzz || 0;
//~ Use a simple box metric here.
return (x+fuzz >= this.left && x-fuzz <= this.left + this.width &&
y+fuzz >= this.top && y-fuzz <= this.top + this.height);
};

/**
Adds a download to {@link #downloads}.
@param {Downloader} download
*/
Navpopup.prototype.addDownload=function(download) {
if (!download) { return; }
this.downloads.push(download);
};
/**
Aborts the downloads listed in {@link #downloads}.
@see Downloader#abort
*/
Navpopup.prototype.abortDownloads=function() {
for(var i=0; i<this.downloads.length; ++i) {
var d=this.downloads[i];
if (d && d.abort) { d.abort(); }
}
this.downloads=[];
};


/**
A {@link Mousetracker} instance which is a property of the constructor (pseudo-global).
*/
Navpopup.tracker=new Mousetracker();
// ENDFILE: navpopup.js
// STARTFILE: diff.js
//<NOLITE>
/*
* Javascript Diff Algorithm
* By John Resig (http://ejohn.org/) and [[:en:User:Lupin]]
*
* More Info:
* http://ejohn.org/projects/javascript-diff-algorithm/
*/

function delFmt(x) {
if (!x.length) { return ''; }
return "<del class='popupDiff'>" + x.join('').split('\n').join('&para;\n') +"</del>";
}
function insFmt(x) {
if (!x.length) { return ''; }
return "<ins class='popupDiff'>" + x.join('').split('\n').join('&para;\n') +"</ins>";
}

function countCrossings(a, b, i, eject) {
// count the crossings on the edge starting at b[i]
if (!b[i].row && b[i].row !== 0) { return -1; }
var count=0;
for (var j=0; j<a.length; ++j) {
if (!a[j].row && a[j].row !== 0) { continue; }
if ( (j-b[i].row)*(i-a[j].row) > 0) {
if(eject) { return true; }
count++;
}
}
return count;
}

function shortenDiffString(str, context) {
var re=RegExp('(<del[\\s\\S]*?</del>|<ins[\\s\\S]*?</ins>)');
var splitted=str.parenSplit(re);
var ret=[''];
for (var i=0; i<splitted.length; i+=2) {
if (splitted[i].length < 2*context) {
ret[ret.length-1] += splitted[i];
if (i+1<splitted.length) { ret[ret.length-1] += splitted[i+1]; }
continue;
}
else {
if (i > 0) { ret[ret.length-1] += splitted[i].substring(0,context); }
if (i+1 < splitted.length) {
ret.push(splitted[i].substring(splitted[i].length-context) +
splitted[i+1]);
}
}
}
while (ret.length > 0 && !ret[0]) { ret = ret.slice(1); }
return ret;
}


function diffString( o, n, simpleSplit ) {
var splitRe=RegExp('([[]{2}|[\]]{2}|[{]{2,3}|[}]{2,3}|[|]|=|[*:]+|\\s|\\b)');

o=o.entify(); n=n.entify();
var out, i;
if (simpleSplit) { out = diff( o.split(/\b/), n.split(/\b/) ); }
else { out = diff( o.parenSplit(splitRe), n.parenSplit(splitRe) ); }
var str = "";
var acc=[]; // accumulator for prettier output

// crossing pairings -- eg 'A B' vs 'B A' -- cause problems, so let's iron them out
// this doesn't always do things optimally but it should be fast enough
var maxOutputPair=0;
for (i=0; i<out.n.length; ++i) {
if ( out.n[i].paired ) {
if( maxOutputPair > out.n[i].row ) {
// tangle - delete pairing
out.o[ out.n[i].row ]=out.o[ out.n[i].row ].text;
out.n[i]=out.n[i].text;
}
if (maxOutputPair < out.n[i].row) { maxOutputPair = out.n[i].row; }
}
}

// output the stuff preceding the first paired old line
for (i=0; i<out.o.length && !out.o[i].paired; ++i) { acc.push( out.o[i] ); }
str += delFmt(acc); acc=[];

// main loop
for ( i = 0; i < out.n.length; ++i ) {
// output unpaired new "lines"
while ( i < out.n.length && !out.n[i].paired ) { acc.push( out.n[i++] ); }
str += insFmt(acc); acc=[];
if ( i < out.n.length ) { // this new "line" is paired with the (out.n[i].row)th old "line"
str += out.n[i].text;
// output unpaired old rows starting after this new line's partner
var m = out.n[i].row + 1;
while ( m < out.o.length && !out.o[m].paired ) { acc.push ( out.o[m++] ); }
str += delFmt(acc); acc=[];
}
}
return str;
}

// see http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Object
// FIXME: use obj.hasOwnProperty instead of this kludge!
window.jsReservedProperties=RegExp('^(constructor|prototype|__((define|lookup)[GS]etter)__' +
'|eval|hasOwnProperty|propertyIsEnumerable' +
'|to(Source|String|LocaleString)|(un)?watch|valueOf)$');
function diffBugAlert(word) {
if (!diffBugAlert.list[word]) {
diffBugAlert.list[word]=1;
alert('Bad word: '+word+'\n\nPlease report this bug.');
}
}
diffBugAlert.list={};

function makeDiffHashtable(src) {
var ret={};
for ( var i = 0; i < src.length; i++ ) {
if ( jsReservedProperties.test(src[i]) ) { src[i] += '<!-- -->'; }
if ( !ret[ src[i] ] ) { ret[ src[i] ] = []; }
try { ret[ src[i] ].push( i ); } catch (err) { diffBugAlert(src[i]); }
}
return ret;
}

function diff( o, n ) {
//console.log('diff: o.length='+o.length+', n.length='+n.length);

// pass 1: make hashtable ns with new rows as keys
var ns = makeDiffHashtable(n);

// pass 2: make hashtable os with old rows as keys
var os = makeDiffHashtable(o);

// pass 3: pair unique new rows and matching unique old rows
var i;
for ( i in ns ) {
if ( ns[i].length == 1 && os[i] && os[i].length == 1 ) {
n[ ns[i][0] ] = { text: n[ ns[i][0] ], row: os[i][0], paired: true };
o[ os[i][0] ] = { text: o[ os[i][0] ], row: ns[i][0], paired: true };
}
}

// pass 4: pair matching rows immediately following paired rows (not necessarily unique)
for ( i = 0; i < n.length - 1; i++ ) {
if ( n[i].paired && ! n[i+1].paired && n[i].row + 1 < o.length && ! o[ n[i].row + 1 ].paired &&
n[i+1] == o[ n[i].row + 1 ] ) {
n[i+1] = { text: n[i+1], row: n[i].row + 1, paired: true };
o[n[i].row+1] = { text: o[n[i].row+1], row: i + 1, paired: true };
}
}

// pass 5: pair matching rows immediately preceding paired rows (not necessarily unique)
for ( i = n.length - 1; i > 0; i-- ) {
if ( n[i].paired && ! n[i-1].paired && n[i].row > 0 && ! o[ n[i].row - 1 ].paired &&
n[i-1] == o[ n[i].row - 1 ] ) {
n[i-1] = { text: n[i-1], row: n[i].row - 1, paired: true };
o[n[i].row-1] = { text: o[n[i].row-1], row: i - 1, paired: true };
}
}

return { o: o, n: n };
}
//</NOLITE>
// ENDFILE: diff.js
// STARTFILE: init.js
function setSiteInfo() {
if (window.popupLocalDebug) {
pg.wiki.hostname = 'en.wikipedia.org';
} else {
pg.wiki.hostname = location.hostname; // use in preference to location.hostname for flexibility (?)
}
pg.wiki.wikimedia=RegExp('(wiki([pm]edia|source|books|news|quote)|wiktionary)[.]org').test(pg.wiki.hostname);
pg.wiki.wikia=RegExp('[.]wikia[.]com$', 'i').test(pg.wiki.hostname);
pg.wiki.isLocal=RegExp('^localhost').test(pg.wiki.hostname);
pg.wiki.commons=( pg.wiki.wikimedia && pg.wiki.hostname != 'commons.wikimedia.org') ? 'commons.wikimedia.org' : null;
pg.wiki.commonslang = pg.wiki.commons ? pg.wiki.commons.split('.')[0] : null;
pg.wiki.lang = pg.wiki.hostname.split('.')[0];
// toolDbName needs pg.wiki.lang and pg.wiki.hostname
window.toolDbName && (pg.wiki.userNameCookie=toolDbName(true) + 'UserName');
pg.wiki.prePath='';
if (pg.wiki.hostname == 'secure.wikimedia.org') {
var s=document.location.href.split('/');
pg.wiki.prePath=s.slice(3,5).join('/');
pg.wiki.lang=s[4];
}
var port = location.port ? ':' + location.port : '';
pg.wiki.sitebase = joinPath([pg.wiki.hostname + port, pg.wiki.prePath]);
}

function getArticlePath() {
if (isFunction(window.siteArticlePath)) {
return siteArticlePath();
}
return 'wiki';
}

function getBotInterfacePath() {
if (isFunction(window.siteBotInterfacePath)) {
return siteBotInterfacePath();
}
var botInterfacePath = pg.wiki.articlePath.replace(/\/index[.]php$/, '');
if (pg.wiki.wikimedia) { botInterfacePath = 'w'; } // as in http://some.thing.com/w/index.php?title=foo
else if (pg.wiki.wikia) { botInterfacePath = ''; }
return botInterfacePath;
}

function setTitleBase() {
var protocol = ( window.popupLocalDebug ? 'http:' : location.protocol );
pg.wiki.articlePath = getArticlePath(); // as in http://some.thing.com/wiki/Article
pg.wiki.botInterfacePath = getBotInterfacePath();
// default mediawiki setting is paths like http://some.thing.com/articlePath/index.php?title=foo

var titletail = joinPath([pg.wiki.botInterfacePath, 'index.php?title=']);
var titletail2 = joinPath([pg.wiki.botInterfacePath, 'wiki.phtml?title=']);

// other sites may need to add code here to set titletail depending on how their urls work

pg.wiki.titlebase = protocol + '//' + joinPath([pg.wiki.sitebase, titletail]);
pg.wiki.titlebase2 = protocol + '//' + joinPath([pg.wiki.sitebase, titletail2]);
pg.wiki.wikibase = protocol + '//' + joinPath([pg.wiki.sitebase, pg.wiki.botInterfacePath]);
pg.wiki.articlebase = protocol + '//' + joinPath([pg.wiki.sitebase, pg.wiki.articlePath]);
}


//////////////////////////////////////////////////
// Global regexps

function setMainRegex() {
var reStart='[^:]*://';
var preTitles = joinPath([literalizeRegex(pg.wiki.botInterfacePath), '(?:index[.]php|wiki[.]phtml)[?]title=']);
// slightly ugly hack when pg.wiki.articlePath is empty
preTitles += '|' + literalizeRegex( ( pg.wiki.articlePath ? pg.wiki.articlePath + '/' : ''));

var reEnd='/(' + preTitles + ')([^&?#]*)[^#]*(?:#(.+))?';
pg.re.main = RegExp(reStart + literalizeRegex(pg.wiki.sitebase) + reEnd);
}

function setRegexps() {
setMainRegex();
var sp=nsRe('Special');
pg.re.urlNoPopup=RegExp('((title=|/)' + sp + '(?:%3A|:)|section=[0-9])') ;
pg.re.contribs =RegExp('(title=|/)' + sp + '(?:%3A|:)Contributions' + '(&target=|/|/' + pg.ns.user+':)(.*)') ;
pg.re.email =RegExp('(title=|/)' + sp + '(?:%3A|:)Emailuser' + '(&target=|/|/(?:' + pg.ns.user+':)?)(.*)') ;

//<NOLITE>
var im=nsRe('Image');
// note: tries to get images in infobox templates too, e.g. movie pages, album pages etc
// (^|\[\[)image: *([^|\]]*[^|\] ]) *
// (^|\[\[)image: *([^|\]]*[^|\] ])([^0-9\]]*([0-9]+) *px)?
// $4 = 120 as in 120px
pg.re.image = RegExp('(^|\\[\\[)' + im + ': *([^|\\]]*[^|\\] ])' +
'([^0-9\\]]*([0-9]+) *px)?|(?:\\n *[|]?|[|]) *' +
'(image|image_(?:file|skyline|name|flag|seal)|cover|badge|logo)' +
' *= *(?:\\[\\[ *)?(?:' + im + ':)?' +
'([^|]*?)(?:\\]\\])? *[|]? *\\n', 'img') ;
pg.re.imageBracketCount = 6;

pg.re.category = RegExp('\\[\\[' +nsRe('Category') +
': *([^|\\]]*[^|\\] ]) *', 'i');
pg.re.categoryBracketCount = 1;

pg.re.ipUser=RegExp('('+nsRe('User')+':)?' +
'((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}' +
'(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])');

pg.re.stub= RegExp('(sect)?stub[}][}]|This .*-related article is a .*stub', 'im') ;
pg.re.disambig=RegExp('([{][{]\\s*disambig|disambig\\s*[}][}]|disamb\\s*[}][}]|dab\\s*[}][}])' +
// explicit, whole template names on next line
'|[{][{]\\s*(((geo|hn|road?|school|number)dis)|[234][lc][acw]|shipindex)(\\s*[|][^}]*)?\\s*[}][}]' +
'|is a .*disambiguation.*page', 'im') ;

//</NOLITE>
// FIXME replace with general parameter parsing function, this is daft
pg.re.oldid=RegExp('[?&]oldid=([^&]*)');
pg.re.diff=RegExp('[?&]diff=([^&]*)');
}


//<NOLITE>
//////////////////////////////////////////////////
// Image sources

function setImageSources() {
pg.wiki.imageSources=[];

// frequently seen thumbs
pg.wiki.imageSources.push(
{wiki: pg.wiki.hostname, thumb: true, width: 180}, // default
{wiki: pg.wiki.hostname, thumb: true, width: 120} // gallery
);

// frequently seen thumbs on commons
if (pg.wiki.commons) {
pg.wiki.imageSources.push(
{wiki: pg.wiki.commons, thumb: true, width: 180},
{wiki: pg.wiki.commons, thumb: true, width: 120}
);
}

// unusual thumb sizes and full-size
pg.wiki.imageSources.push(
{wiki: pg.wiki.hostname, thumb: true, width: 200}, // common?
{wiki: pg.wiki.hostname, thumb: true, width: 250}, // common?
{wiki: pg.wiki.hostname, thumb: true, width: 300},
{wiki: pg.wiki.hostname, thumb: true, width: 210},
{wiki: pg.wiki.hostname, thumb: true, width: 230},
{wiki: pg.wiki.hostname, thumb: false, width: 0} // no comma
);

// full-size on commons
if (pg.wiki.commons) {
pg.wiki.imageSources.push({wiki: pg.wiki.commons, thumb: false, width: 0});
}
}
//</NOLITE>

//////////////////////////////////////////////////
// miscellany

function setupCache() {
// page caching
pg.cache.pages = [];
pg.cache.images = [];

// global array for 404'ed image urls
pg.cache.badImageUrls=[];
}

function setMisc() {
pg.current.link=null;
pg.current.links=[];
pg.current.linksHash={};

// downloading images are put here
pg.misc.imageArray=[];

setupCache();
// FIXME what is this for?
pg.misc.gImage=null; // global for image

// check to see if images are done with this timer
pg.timer.image=null;

// These are for checkImages()
pg.counter.checkImages=0;
pg.timer.checkImages=null;
pg.timer.checkPopupPosition=null;
pg.counter.loop=0;

// ids change with each popup: popupImage0, popupImage1 etc
pg.idNumber=0;

// for myDecodeURI
pg.misc.decodeExtras = [
{from: '%2C', to: ',' },
{from: '_', to: ' ' },
{from: '%24', to: '$'},
{from: '%26', to: '&' } // no ,
];

}

function leadingInteger(s){
var n=s.match(/^(\d*)/)[1];
if (n) { return +n; }
return null;
}

function setBrowserHacks() {
var useOriginal=false;
// browser-specific hacks
if (typeof window.opera != 'undefined') {
//if (leadingInteger(opera.version()) < 9)
{ useOriginal=true; } // v9 beta still seems to have buggy css
setDefault('popupNavLinkSeparator', ' &#183; ');
} else if (navigator.appName=='Konqueror') {
setDefault('popupNavLinkSeparator', ' &bull; ');
pg.flag.isKonq=true;
} else if ( navigator.vendor && navigator.vendor.toLowerCase().indexOf('apple computer')===0) {
pg.flag.isSafari=true;
var webkit=+navigator.userAgent.replace(RegExp('^.*AppleWebKit[/](\\d+).*', 'i'), '$1');
if (webkit < 420) { useOriginal=true; }
} else if (navigator.appName.indexOf("Microsoft")!=-1) {
setDefault('popupNavLinkSeparator', ' &#183; ');
useOriginal=true;
pg.flag.isIE=true;
}
if (pg.flag.isIE || pg.flag.isKonq || pg.flag.isSafari) {
pg.flag.linksLikeIE=true;
}
if (useOriginal && pg.structures.original) {
setDefault('popupStructure','original');
}
}

function setupPopups() {
// NB translatable strings should be set up first (strings.js)

// basics
setupDebugging();
setSiteInfo();
setTitleBase();

// namespaces etc
setNamespaces();
setInterwiki();

// regexps
setRegexps();
setRedirs();

// other stuff
window.setImageSources && setImageSources();
setOptions(); // see options.js
setBrowserHacks();
setMisc();
setupLivePreview();

// main deal here
setupTooltips();
Navpopup.tracker.enable();
}
// ENDFILE: init.js
// STARTFILE: navlinks.js
//<NOLITE>
//////////////////////////////////////////////////
// navlinks... let the fun begin
//

function defaultNavlinkSpec() {
var str='';
str += '<b><<mainlink|shortcut= >></b>';
if (getValueOf('popupLastEditLink')) {
str += '*<<lastEdit|shortcut=/>>|<<lastContrib>>|<<sinceMe>>if(oldid){|<<oldEdit>>|<<diffCur>>}';
}

// user links
// contribs - log - count - email - block
// count only if applicable; block only if popupAdminLinks
str += 'if(user){<br><<contribs|shortcut=c>>*<<userlog|shortcut=L|log>>';
str+='if(ipuser){*<<arin>>}if(wikimedia){*<<count|shortcut=#>>}';
str+='if(ipuser){}else{*<<email|shortcut=E>>}if(admin){*<<block|shortcut=b>>|<<blocklog|log>>}}';

// editing links
// talkpage -> edit|new - history - un|watch - article|edit
// other page -> edit - history - un|watch - talk|edit|new
var editstr='<<edit|shortcut=e>>';
var editOldidStr='if(oldid){<<editOld|shortcut=e>>|<<revert|shortcut=v|rv>>|<<edit|cur>>}else{' + editstr + '}'
var historystr='<<history|shortcut=h>>if(mainspace_en){|<<editors|shortcut=E|>>}';
var watchstr='<<unwatch|unwatchShort>>|<<watch|shortcut=w|watchThingy>>';

str+='<br>if(talk){' +
editOldidStr+'|<<new|shortcut=+>>' + '*' + historystr+'*'+watchstr + '*' +
'<b><<article|shortcut=a>></b>|<<editArticle|edit>>' +
'}else{' + // not a talk page
editOldidStr + '*' + historystr + '*' + watchstr + '*' +
'<b><<talk|shortcut=t>></b>|<<editTalk|edit>>|<<newTalk|shortcut=+|new>>'
+ '}';

// misc links
str += '<br><<whatLinksHere|shortcut=l>>*<<relatedChanges|shortcut=r>>*<<move|shortcut=m>>';

// admin links
str += 'if(admin){<br><<unprotect|unprotectShort>>|<<protect|shortcut=p>>|<<protectlog|log>>*' +
'<<undelete|undeleteShort>>|<<delete|shortcut=d>>|<<deletelog|log>>}';
return str;
}

function navLinksHTML (article, hint, oldid) {
var str = '<span class="popupNavLinks">' + defaultNavlinkSpec() + '</span>';
// BAM
return navlinkStringToHTML(str, article, oldid);
}

function expandConditionalNavlinkString(s,article,oldid,recursionCount) {
// nested conditionals (up to 10 deep) are ok, hopefully! (work from the inside out)
if (typeof recursionCount!=typeof 0) { recursionCount=0; }
var conditionalSplitRegex=RegExp(
//(1 if \\( (2 2) \\) {(3 3)} (4 else {(5 5)} 4)1)
'(;?\\s*if\\s*\\(\\s*([\\w]*)\\s*\\)\\s*\\{([^{}]*)\\}(\\s*else\\s*\\{([^{}]*?)\\}|))', 'i');
var splitted=s.parenSplit(conditionalSplitRegex);
// $1: whole conditional
// $2: test condition
// $3: true expansion
// $4: else clause (possibly empty)
// $5: false expansion (possibly null)
var numParens=5;
var ret = splitted[0];
for (var i=1; i<splitted.length; i=i+numParens+1) {

var testString=splitted[i+2-1];
var trueString=splitted[i+3-1];
var falseString=splitted[i+5-1];
if (typeof falseString=='undefined' || !falseString) { falseString=''; }
var testResult=null;

switch (testString) {
case 'user':
//console.log('test: user');
testResult=(article.userName())?true:false;
break;
case 'talk':
testResult=(article.talkPage())?false:true; // talkPage converts _articles_ to talkPages
break;
case 'admin':
testResult=getValueOf('popupAdminLinks')?true:false;
break;
case 'oldid':
testResult=(typeof oldid != 'undefined' && oldid)?true:false;
break;
case 'ipuser':
testResult=(article.isIpUser())?true:false;
break;
case 'mainspace_en':
testResult=isInMainNamespace(article) && pg.wiki.hostname=='en.wikipedia.org';
break;
case 'wikimedia':
testResult=(pg.wiki.wikimedia) ? true : false;
break;
}

switch(testResult) {
case null: ret+=splitted[i]; break;
case true: ret+=trueString; break;
case false: ret+=falseString; break;
}

// append non-conditional string
ret += splitted[i+numParens];
}
if (conditionalSplitRegex.test(ret) && recursionCount < 10) {
return expandConditionalNavlinkString(ret,article,oldid,recursionCount+1);
}
return ret;
}

function navlinkStringToArray(s, article, oldid) {
s=expandConditionalNavlinkString(s,article,oldid);
var splitted=s.parenSplit(RegExp('<<(.*?)>>'));
var ret=[];
for (var i=0; i<splitted.length; ++i) {
if (i%2) { // i odd, so s is a tag
var t=new navlinkTag();
var ss=splitted[i].split('|');
t.id=ss[0];
for (var j=1; j<ss.length; ++j) {
var sss=ss[j].split('=');
if (sss.length>1) {
t[sss[0]]=sss[1];
}
else { // no assignment (no "="), so treat this as a title (overwriting the last one)
t.text=popupString(sss[0]);
}
}
t.article=article;
if (typeof oldid != 'undefined' && oldid != null) { t.oldid=oldid; }
if (!t.text && t.id != 'mainlink') { t.text=popupString(t.id); }
ret.push(t);
}
else { // plain HTML
ret.push(splitted[i]);
}
}
return ret;
}


function navlinkSubstituteHTML(s) {
return s.split('*').join(getValueOf('popupNavLinkSeparator'))
.split('<menurow>').join('<li class="popup_menu_row">')
.split('</menurow>').join('</li>')
.split('<menu>').join('<ul class="popup_menu">')
.split('</menu>').join('</ul>');

}

function navlinkDepth(magic,s) {
return s.split('<' + magic + '>').length - s.split('</' + magic + '>').length;
}


// navlinkString: * becomes the separator
// <<foo|bar=baz|fubar>> becomes a foo-link with attribute bar='baz'
// and visible text 'fubar'
// if(test){...} and if(test){...}else{...} work too (nested ok)

function navlinkStringToHTML(s,article,oldid) {
//limitAlert(navlinkStringToHTML, 5, 'navlinkStringToHTML\n' + article + '\n' + (typeof article));
var p=navlinkStringToArray(s,article,oldid);
var html='';
var menudepth = 0; // nested menus not currently allowed, but doesn't do any harm to code for it
var menurowdepth = 0;
var wrapping = null;
for (var i=0; i<p.length; ++i) {
if (typeof p[i] == typeof '') {
html+=navlinkSubstituteHTML(p[i]);
menudepth += navlinkDepth('menu', p[i]);
menurowdepth += navlinkDepth('menurow', p[i]);
// if (menudepth === 0) {
// tagType='span';
// } else if (menurowdepth === 0) {
// tagType='li';
// } else {
// tagType = null;
// }
} else if (typeof p[i].type != 'undefined' && p[i].type=='navlinkTag') {
if (menudepth > 0 && menurowdepth === 0) {
html += '<li class="popup_menu_item">' + p[i].html() + '</li>';
} else {
html+=p[i].html();
}
}
}
return html;
}

function navlinkTag() {
this.type='navlinkTag';
}

navlinkTag.prototype.html=function () {
this.getNewWin();
this.getPrintFunction();
var html='';
var opening, closing;
var tagType='span';
if (!tagType) {
opening = ''; closing = '';
} else {
opening = '<' + tagType + ' class="popup_' + this.id + '">';
closing = '</' + tagType + '>';
}
if (typeof this.print!='function') {
errlog ('Oh dear - invalid print function for a navlinkTag, id='+this.id);
} else {
html=this.print(this);
if (typeof html != typeof '') {html='';}
else if (typeof this.shortcut!='undefined') html=addPopupShortcut(html, this.shortcut);
}
return opening + html + closing;
};

navlinkTag.prototype.getNewWin=function() {
getValueOf('popupLinksNewWindow');
if (typeof pg.option.popupLinksNewWindow[this.id] === 'undefined') { this.newWin=null; }
this.newWin=pg.option.popupLinksNewWindow[this.id];
}

navlinkTag.prototype.getPrintFunction=function() { //think about this some more
// this.id and this.article should already be defined
if (typeof this.id!=typeof '' || typeof this.article!=typeof {} ) { return; }
var html='';
var a,t;

switch (this.id) {
case 'email': case 'contribs': case 'block': case 'unblock':
case 'userlog': case 'userSpace':
this.article=this.article.userName();
}

switch (this.id) {
case 'userTalk': case 'newUserTalk': case 'editUserTalk':
case 'userPage': case 'monobook': case 'editMonobook': case 'blocklog':
this.article=this.article.userName(true);
// fall through; no break
case 'pagelog': case 'deletelog': case 'protectlog':
delete this.oldid;
}

if (this.id=='editMonobook' || this.id=='monobook') { this.article.append('/monobook.js'); }

if (this.id != 'mainlink') {
// FIXME anchor handling should be done differently with Title object
this.article=this.article.removeAnchor();
// if (typeof this.text=='undefined') this.text=popupString(this.id);
}

switch (this.id) {
case 'undelete': this.print=specialLink; this.specialpage='Undelete'; this.sep='/'; break;
case 'whatLinksHere': this.print=specialLink; this.specialpage='Whatlinkshere'; break;
case 'relatedChanges': this.print=specialLink; this.specialpage='Recentchangeslinked'; break;
case 'move': this.print=specialLink; this.specialpage='Movepage'; break;
case 'contribs': this.print=specialLink; this.specialpage='Contributions'; break;
case 'email': this.print=specialLink; this.specialpage='Emailuser'; break;
case 'block': this.print=specialLink; this.specialpage='Blockip'; this.sep='&ip='; break;
case 'unblock': this.print=specialLink; this.specialpage='Ipblocklist'; this.sep='&action=unblock&ip='; break;
case 'userlog': this.print=specialLink; this.specialpage='Log'; this.sep='&user='; break;
case 'blocklog': this.print=specialLink; this.specialpage='Log'; this.sep='&type=block&page='; break;
case 'pagelog': this.print=specialLink; this.specialpage='Log'; this.sep='&page='; break;
case 'protectlog': this.print=specialLink; this.specialpage='Log'; this.sep='&type=protect&page='; break;
case 'deletelog': this.print=specialLink; this.specialpage='Log'; this.sep='&type=delete&page='; break;
case 'userSpace': this.print=specialLink; this.specialpage='Prefixindex'; this.sep='&namespace=2&from='; break;
case 'search': this.print=specialLink; this.specialpage='Search'; this.sep='&fulltext=Search&search='; break;
case 'history': case 'historyfeed': case 'unwatch': case 'watch':
case 'unprotect': case 'protect':
this.print=wikiLink; this.action=this.id; break;

case 'delete':
this.print=wikiLink; this.action='delete';
if (this.article.namespace()==pg.ns.image) {
var img=this.article.stripNamespace();
this.action+='&image='+img;
}
break;

case 'edit': // editOld should keep the oldid, but edit should not.
delete this.oldid; // fall through
case 'view': case 'purge': case 'render':
this.print=wikiLink;
this.action=this.id; break;
case 'raw':
this.print=wikiLink; this.action='raw&ctype=text/css'; break;
case 'new':
this.print=wikiLink; this.action='edit&section=new'; break;
case 'mainlink':
if (typeof this.text=='undefined') { this.text=this.article.toString().entify(); }
if (getValueOf('popupSimplifyMainLink') && isInStrippableNamespace(this.article)) {
var s=this.text.split('/'); this.text=s[s.length-1];
if (this.text=='' && s.length > 1) { this.text=s[s.length-2]; }
}
this.print=titledWikiLink;
if (typeof this.title=='undefined' && pg.current.link && typeof pg.current.link.href != 'undefined') {
this.title=safeDecodeURI((pg.current.link.originalTitle)?pg.current.link.originalTitle:this.article);
if (typeof this.oldid != 'undefined' && this.oldid) {
this.title=tprintf('Revision %s of %s', [this.oldid, this.title]);
}
}
this.action='view'; break;
case 'userPage':
case 'article':
case 'monobook':
case 'editMonobook':
case 'editArticle':
delete this.oldid;
//alert(this.id+'\n'+this.article + '\n'+ typeof this.article);
this.article=this.article.articleFromTalkOrArticle();
//alert(this.id+'\n'+this.article + '\n'+ typeof this.article);
this.print=wikiLink;
if (this.id.indexOf('edit')==0) {
this.action='edit';
} else { this.action='view';}
break;
case 'userTalk':
case 'talk':
this.article=this.article.talkPage();
delete this.oldid;
this.print=wikiLink;
this.action='view'; break;
case 'arin':
this.print=arinLink; break;
case 'count':
this.print=kateLink; break;
case 'google':
this.print=googleLink; break;
case 'contribsTree':
this.print=contribsTreeLink; break;
case 'editors':
this.print=editorListLink; break;
case 'globalsearch':
this.print=globalSearchLink; break;
case 'lastEdit':
this.print=titledDiffLink;
this.title=popupString('Show the last edit');
this.from='prev'; this.to='cur'; break;
case 'oldEdit':
this.print=titledDiffLink;
this.title=popupString('Show the edit made to get revision') + ' ' + this.oldid;
this.from='prev'; this.to=this.oldid; break;
case 'editOld':
this.print=wikiLink; this.action='edit'; break;
case 'revert':
this.print=wikiLink; this.action='revert'; break;
case 'nullEdit':
this.print=wikiLink; this.action='nullEdit'; break;
case 'diffCur':
this.print=titledDiffLink;
this.title=tprintf('Show changes since revision %s', [this.oldid]);
this.from=this.oldid; this.to='cur'; break;
case 'editUserTalk':
case 'editTalk':
delete this.oldid;
this.article=this.article.talkPage();
this.action='edit'; this.print=wikiLink; break;
case 'newUserTalk':
case 'newTalk':
this.article=this.article.talkPage();
this.action='edit&section=new'; this.print=wikiLink; break;
case 'lastContrib':
case 'sinceMe':
this.print=magicHistoryLink;
break;
case 'togglePreviews':
this.text=popupString(pg.option.simplePopups ? 'enable previews' : 'disable previews');
case 'disablePopups': case 'purgePopups':
this.print=popupMenuLink;
break;
default:
this.print=function () {return 'Unknown navlink type: '+this.id+''};
}
};
//
// end navlinks
//////////////////////////////////////////////////
//</NOLITE>
// ENDFILE: navlinks.js
// STARTFILE: shortcutkeys.js
//<NOLITE>
function popupHandleKeypress(evt) {
var keyCode = window.event ? window.event.keyCode : ( evt.keyCode ? evt.keyCode : evt.which);
if (!keyCode || !pg.current.link || !pg.current.link.navpopup) { return; }
if (keyCode==27) { // escape
killPopup();
return false; // swallow keypress
}

var letter=String.fromCharCode(keyCode);
var links=pg.current.link.navpopup.mainDiv.getElementsByTagName('A');
var startLink=0;
var i,j;

if (popupHandleKeypress.lastPopupLinkSelected) {
for (i=0; i<links.length; ++i) {
if (links[i]==popupHandleKeypress.lastPopupLinkSelected) { startLink=i; }
}
}
for (j=0; j<links.length; ++j) {
i=(startLink + j + 1) % links.length;
if (links[i].getAttribute('popupkey')==letter) {
if (evt && evt.preventDefault) evt.preventDefault();
links[i].focus();
popupHandleKeypress.lastPopupLinkSelected=links[i];
return false; // swallow keypress
}
}

// pass keypress on
if (document.oldPopupOnkeypress) { return document.oldPopupOnkeypress(evt); }
return true;
}

function addPopupShortcuts() {
if (document.onkeypress && document.onkeypress.toString()==popupHandleKeypress.toString()) return;
document.oldPopupOnkeypress=document.onkeypress;
document.onkeypress=popupHandleKeypress;
}

function rmPopupShortcuts() {
popupHandleKeypress.lastPopupLinkSelected=null;
try {
if (document.oldPopupOnkeypress && document.oldPopupOnkeypress.toString()==popupHandleKeypress.toString()) {
// panic
document.onkeypress=null; //function () {};
return;
}
document.onkeypress=document.oldPopupOnkeypress;
} catch (nasties) { /* IE goes here */ }
}


function addLinkProperty(html, property) {
// take "<a href=...>...</a> and add a property
// not sophisticated at all, easily broken
var i=html.indexOf('>');
if (i<0) { return html; }
return html.substring(0,i) + ' ' + property + html.substring(i);
}

function addPopupShortcut(html, key) {
if (!getValueOf('popupShortcutKeys')) { return html; }
var ret= addLinkProperty(html, 'popupkey="'+key+'"');
if (key==' ') { key=popupString('spacebar'); }
return ret.replace(RegExp('^(.*?)(title=")(.*?)(".*)$', 'i'),'$1$2$3 ['+key+']$4');
}
//</NOLITE>
// ENDFILE: shortcutkeys.js
// STARTFILE: diffpreview.js
//<NOLITE>
function loadDiff(article, oldid, diff, navpop) {
//console.log('loadDiff');
navpop.diffData={};
var oldRev, newRev;
switch (diff) {
case 'cur':
switch ( oldid ) {
case null:
case '':
case 'prev':
// eg newmessages diff link
oldRev='0&direction=prev';
newRev=0;
break;
default:
oldRev = oldid;
newRev = 0;
}
break;
case 'prev':
oldRev = ( oldid || 0 ) + '&direction=prev'; newRev = oldid; break;
case 'next':
oldRev = oldid; newRev = oldid + '&direction=next';
break;
default:
oldRev = oldid || 0; newRev = diff || 0; break;
}
oldRev = oldRev || 0;
newRev = newRev || 0;

var go = function() {
//console.log('go');
pendingNavpopTask(navpop);
getWiki(article, doneDiffNew, newRev, navpop);

pendingNavpopTask(navpop);
getWiki(article, doneDiffOld, oldRev, navpop);

var tz = Cookie.read('popTz');
if (getValueOf('popupUseQueryInterface') && getValueOf('popupAdjustDiffDates') && tz===null) {
pendingNavpopTask(navpop);
getPageWithCaching(pg.wiki.wikibase + '/query.php?format=json&what=userinfo&uioptions=timecorrection',
function(d) {
completedNavpopTask(navpop);
setTimecorrectionCookie(d);
if (diffDownloadsComplete(navpop)) { insertDiff(navpop); }
}, navpop);
}
return true; // remove hook once run
}
if (navpop.visible || !getValueOf('popupLazyDownloads')) { go(); }
else { navpop.addHook(go, 'unhide', 'before', 'DOWNLOAD_DIFFS'); }
}

function setTimecorrectionCookie(d) {
Cookie.create('popTz', getTimeOffset(getJsObj(d.data).meta.user.timecorrection), 1);
}

function doneDiff(download, isOld) {
//console.log('doneDiff');
if (!download.owner || !download.owner.diffData) { return; }
var navpop=download.owner;
var label= (isOld) ? 'Old' : 'New';
var otherLabel=(isOld) ? 'New' : 'Old';
navpop.diffData[label]=download;
completedNavpopTask(download.owner);
if (diffDownloadsComplete(navpop)) { insertDiff(navpop); }
}

function diffDownloadsComplete(navpop) {
if (getValueOf('popupUseQueryInterface') && Cookie.read('popTz')===null) { return false; }
return navpop.diffData.Old && navpop.diffData.New;
}

function doneDiffNew(download) { doneDiff(download, false); }
function doneDiffOld(download) { doneDiff(download, true); }

function rmBoringLines(a,b,context) {

if (typeof context == 'undefined') { context=2; }
// this is fairly slow... i think it's quicker than doing a word-based diff from the off, though
var aa=[], aaa=[];
var bb=[], bbb=[];
var i, j;

// first, gather all disconnected nodes in a and all crossing nodes in a and b
for (i=0; i<a.length; ++i ) {
if(!a[i].paired) { aa[i]=1; }
else if (countCrossings(b,a,i, true)) {
aa[i]=1;
bb[ a[i].row ] = 1;
}
}

// pick up remaining disconnected nodes in b
for (i=0; i<b.length; ++i ) {
if (bb[i]==1) { continue; }
if(!b[i].paired) { bb[i]=1; }
}

// another pass to gather context: we want the neighbours of included nodes which are not yet included
// we have to add in partners of these nodes, but we don't want to add context for *those* nodes in the next pass
for (i=0; i<b.length; ++i) {
if ( bb[i] == 1 ) {
for (j=max(0,i-context); j < min(b.length, i+context); ++j) {
if ( !bb[j] ) { bb[j] = 1; aa[ b[j].row ] = 0.5; }
}
}
}

for (i=0; i<a.length; ++i) {
if ( aa[i] == 1 ) {
for (j=max(0,i-context); j < min(a.length, i+context); ++j) {
if ( !aa[j] ) { aa[j] = 1; bb[ a[j].row ] = 0.5; }
}
}
}

for (i=0; i<bb.length; ++i) {
if (bb[i] > 0) { // it's a row we need
if (b[i].paired) { bbb.push(b[i].text); } // joined; partner should be in aa
else {
bbb.push(b[i]);
}
}
}
for (i=0; i<aa.length; ++i) {
if (aa[i] > 0) { // it's a row we need
if (a[i].paired) { aaa.push(a[i].text); } // joined; partner should be in aa
else {
aaa.push(a[i]);
}
}
}

return { a: aaa, b: bbb};
}

function stripOuterCommonLines(a,b,context) {
var i=0;
while (i<a.length && i < b.length && a[i]==b[i]) { ++i; }
var j=a.length-1; var k=b.length-1;
while ( j>=0 && k>=0 && a[j]==b[k] ) { --j; --k; }

return { a: a.slice(max(0,i - 1 - context), min(a.length+1, j + context+1)),
b: b.slice(max(0,i - 1 - context), min(b.length+1, k + context+1)) };
}

function insertDiff(navpop) {
//console.log('insertDiff');
// for speed reasons, we first do a line-based diff, discard stuff that seems boring, then do a word-based diff
// FIXME: sometimes this gives misleading diffs as distant chunks are squashed together
var oldlines=navpop.diffData.Old.data.split('\n');
var newlines=navpop.diffData.New.data.split('\n');
var inner=stripOuterCommonLines(oldlines,newlines,getValueOf('popupDiffContextLines'));
oldlines=inner.a; newlines=inner.b;
var truncated=false;
getValueOf('popupDiffMaxLines');
if (oldlines.length > pg.option.popupDiffMaxLines || newlines.length > pg.option.popupDiffMaxLines) {
// truncate
truncated=true;
inner=stripOuterCommonLines(oldlines.slice(0,pg.option.popupDiffMaxLines),
newlines.slice(0,pg.option.popupDiffMaxLines),
pg.option.popupDiffContextLines);
oldlines=inner.a; newlines=inner.b;
}

var lineDiff=diff(oldlines, newlines);
var lines2=rmBoringLines(lineDiff.o, lineDiff.n);
var oldlines2=lines2.a; var newlines2=lines2.b;

var simpleSplit = !String.prototype.parenSplit.isNative;
var html='<hr>';
if (getValueOf('popupDiffDates')) {
html += diffDatesTable(navpop.diffData.Old, navpop.diffData.New);
html += '<hr>';
}
html += shortenDiffString(
diffString(oldlines2.join('\n'), newlines2.join('\n'), simpleSplit),
getValueOf('popupDiffContextCharacters') ).join('<hr>');
setPopupTipsAndHTML(html.split('\n').join('<br>') +
(truncated ? '<hr><b>'+popupString('Diff truncated for performance reasons')+'</b>' : '') ,
'popupPreview', navpop.idNumber);
}

function diffDatesTable( oldDl, newDl ) {
var html='<table class="popup_diff_dates">';
html += diffDatesTableRow( newDl, tprintf('New revision'));
html += diffDatesTableRow( oldDl, tprintf('Old revision'));
html += '</table>';
return html;
}
function diffDatesTableRow( dl, label ) {
var txt='';
if (!dl) {
txt=popupString('Something went wrong :-(');
} else if (!dl.lastModified) {
txt= (/^\s*$/.test(dl.data)) ?
popupString('Empty revision, maybe non-existent') : popupString('Unknown date');
} else {
var datePrint=getValueOf('popupDiffDatePrinter');
if (typeof dl.lastModified[datePrint] == 'function') {
if (getValueOf('popupAdjustDiffDates')) {
var off;
if (off=Cookie.read('popTz')) {
var d2=adjustDate(dl.lastModified, off);
txt = dayFormat(d2, true) + ' ' + timeFormat(d2, true);
}
} else {
txt = dl.lastModified[datePrint]();
}
} else {
txt = tprintf('Invalid %s %s', ['popupDiffDatePrinter', datePrint]);
}
}
var revlink = generalLink({url: dl.url.replace(/&.*?(oldid=[0-9]+(?:&direction=[^&]*)?).*/, '&$1'),
text: label, title: label});
return simplePrintf('<tr><td>%s</td><td>%s</td></tr>', [ revlink, txt ]);
}
//</NOLITE>
// ENDFILE: diffpreview.js
// STARTFILE: links.js
//<NOLITE>
/////////////////////
// LINK GENERATION //
/////////////////////

// titledDiffLink --> titledWikiLink --> generalLink
// wikiLink --> titledWikiLink --> generalLink
// kateLink --> generalLink

function titledDiffLink(l) { // article, text, title, from, to) {
return titledWikiLink({article: l.article, action: l.to + '&oldid=' + l.from,
newWin: l.newWin,
text: l.text, title: l.title,
/* hack: no oldid here */
actionName: 'diff'});
}


function wikiLink(l) {
//{article:article, action:action, text:text, oldid}) {
if (! (typeof l.article == typeof {}
&& typeof l.action == typeof '' && typeof l.text==typeof '')) return null;
if (typeof l.oldid == 'undefined') l.oldid=null;
if (!/^((edit|view|revert|render)$|(raw))/.test(l.action)) { l.oldid=null; }
var hint=popupString(l.action + 'Hint'); // revertHint etc etc etc
var oldidData=[l.oldid, safeDecodeURI(l.article)];
var revisionString = tprintf('revision %s of %s', oldidData);
log('revisionString='+revisionString);
switch (l.action) {
case 'edit&section=new': hint = popupString('newSectionHint'); break;
case 'raw&ctype=text/css': hint=popupString('rawHint'); break;
case 'revert':
var p=parseParams(pg.current.link.href);
l.action='edit&autoclick=wpSave&autosummary=' + revertSummary(l.oldid, p.diff);
if (p.diff=='prev') {
l.action += '&direction=prev';
revisionString = tprintf('the revision prior to revision %s of %s', oldidData);
}
if (getValueOf('popupRevertSummaryPrompt')) { l.action += '&autosummaryprompt=true'; }
log('revisionString is now '+revisionString);
break;
case 'nullEdit':
l.action='edit&autoclick=wpSave&autosummary=null';
break;
case 'historyfeed':
l.action='history&feed=rss';
break;
}

if (hint) {
if (l.oldid) {
hint = simplePrintf(hint, [revisionString]);
}
else {
hint = simplePrintf(hint, [safeDecodeURI(l.article)]);
}
}
else {
hint = safeDecodeURI(l.article + '&action=' + l.action) + (l.oldid) ? '&oldid='+l.oldid : '';
}

return titledWikiLink({article: l.article, action: l.action, text: l.text, newWin:l.newWin,
title: hint, oldid: l.oldid});
}

function revertSummary(oldid, diff) {
if (getValueOf('popupUseQueryInterface')) { return revertSummaryQueried(oldid, diff); }
if (typeof getValueOf('popupTimeOffset') == 'number' && /[?&]action=history/.test(document.location.href)) {
var links=document.links;
var numlinks=links.length;
var date=null, editor=null;
var dateRe = RegExp('^([0-9]{2}:[0-9]{2}),\s*(.*[1-3][0-9]{3})$');
for (var i=0; i<numlinks-1; ++i) {
if (RegExp('oldid='+oldid).test(links[i].href) && dateRe.test(links[i].innerHTML)) {
// help konqueror out by putting the time at the end
var ds = links[i].innerHTML.replace(dateRe, '$2 $1');
// d is parsed according to current locale, in FF at least
// this is only OK if the user has set the time offset in prefs!
var d=new Date(+(new Date(ds)) - 1000*3600*getValueOf('popupTimeOffset'));
// strip out zero seconds and timezone in date, since they're prolly bogus
date=d.toString().replace(/([0-9]{2}:[0-9]{2}):00.*/, '$1');
editor=Title.fromURL(links[i+1].href).userName();
break;
}
}
if (date && editor && diff != 'prev') {
return simplePrintf(getValueOf('popupExtendedRevertSummary'), [date, editor, oldid]);
}
}
if (diff != 'prev') {
return simplePrintf(getValueOf('popupRevertSummary'), [ oldid ]);
}
return simplePrintf(getValueOf('popupRevertToPreviousSummary'), [ oldid ]);
}

function revertSummaryQueried(oldid, diff) {
var ret='';
if (diff == 'prev') {
ret=getValueOf('popupQueriedRevertToPreviousSummary');
} else { ret = getValueOf('popupQueriedRevertSummary'); }
return ret + '&autorv=' + oldid;
}

function titledWikiLink(l) {
// possible properties of argument:
// article, action, text, title, oldid, actionName, className
// oldid = null is fine here

// article and action are mandatory args

if (typeof l.article == 'undefined' || typeof l.action=='undefined') {
errlog('got undefined article or actino in titledWikiLink');
return null;
}

var base = pg.wiki.titlebase + l.article.urlString();
var url=base;

if (typeof l.actionName=='undefined' || !l.actionName) { l.actionName='action'; }

// no need to add &action=view, and this confuses anchors
if (l.action != 'view') { url = base + '&' + l.actionName + '=' + l.action; }

if (typeof l.oldid!='undefined' && l.oldid) { url+='&oldid='+l.oldid; }

var cssClass=pg.misc.defaultNavlinkClassname;
if (typeof l.className!='undefined' && l.className) { cssClass=l.className; }

return generalNavLink({url: url, newWin: l.newWin,
title: (typeof l.title != 'undefined') ? l.title : null,
text: (typeof l.text!='undefined')?l.text:null,
className: cssClass});
}

function getLastContrib(wikipage, newWin) {
getHistoryInfo(wikipage, function(x){processLastContribInfo(x,{page: wikipage, newWin: newWin})});
}
function processLastContribInfo(info, stuff) {
if(!info.edits || !info.edits.length) { alert('Popups: an odd thing happened. Please retry.'); return; }
if(!info.firstNewEditor) {
alert(tprintf('Only found one editor: %s made %s edits', [info.edits[0].editor,info.edits.length]));
return;
}
var newUrl=pg.wiki.titlebase + new Title(stuff.page).urlString() + '&diff=cur&oldid='+info.firstNewEditor.oldid;
displayUrl(newUrl, stuff.newWin);
}
function getDiffSinceMyEdit(wikipage, newWin) {
getHistoryInfo(wikipage, function(x){processDiffSinceMyEdit(x,{page: wikipage, newWin: newWin})});
}
function processDiffSinceMyEdit(info, stuff) {
if(!info.edits || !info.edits.length) { alert('Popups: something fishy happened. Please try again.'); return; }
var friendlyName=stuff.page.split('_').join(' ');
if(!info.myLastEdit) {
alert(tprintf('Couldn\'t find an edit by %s\nin the last %s edits to\n%s',
[info.userName, getValueOf('popupHistoryLimit'), friendlyName]));
return;
}
if(info.myLastEdit.index==0) {
alert(tprintf("%s seems to be the last editor to the page %s", [info.userName, friendlyName]));
return;
}
var newUrl=pg.wiki.titlebase + new Title(stuff.page).urlString() + '&diff=cur&oldid='+ info.myLastEdit.oldid;
displayUrl(newUrl, stuff.newWin);
}
function displayUrl(url, newWin){
if(newWin) { window.open(url); }
else { document.location=url; }
}

function purgePopups() {
processAllPopups(true);
setupCache(); // deletes all cached items (not browser cached, though...)
pg.option={};
abortAllDownloads();
}

function processAllPopups(nullify, banish) {
for (var i=0; i<pg.current.links.length; ++i) {
if (!pg.current.links[i].navpopup) { continue; }
(nullify || banish) && pg.current.links[i].navpopup.banish();
nullify && (pg.current.links[i].navpopup=null);
}
}

function disablePopups(){
processAllPopups(false, true);
setupTooltips(null, true);
}

function togglePreviews() {
processAllPopups(true, true);
pg.option.simplePopups=!pg.option.simplePopups;
abortAllDownloads();
}

function magicHistoryLink(l) {
// FIXME use onclick change href trick to sort this out instead of window.open

var jsUrl='', title='';
switch(l.id) {
case 'lastContrib':
jsUrl=simplePrintf('javascript:getLastContrib(\'%s\',%s)',
[l.article.toString(true).split("'").join("\\'"), l.newWin]);
title=popupString('lastContribHint');
break;
case 'sinceMe':
jsUrl=simplePrintf('javascript:getDiffSinceMyEdit(\'%s\',%s)',
[l.article.toString(true).split("'").join("\\'"), l.newWin]);
title=popupString('sinceMeHint');
break;
}

return generalNavLink({url: jsUrl, newWin: false, // can't have new windows with JS links, I think
title: title, text: l.text});
}

function popupMenuLink(l) {
var jsUrl=simplePrintf('javascript:%s()', [l.id]);
var title=popupString(simplePrintf('%sHint', [l.id]));
return generalNavLink({url: jsUrl, newWin:false, title:title, text:l.text});
}

function specialLink(l) {
// properties: article, specialpage, text, sep
if (typeof l.specialpage=='undefined'||!l.specialpage) return null;
var base = pg.wiki.titlebase + pg.ns.special+':'+l.specialpage;
if (typeof l.sep == 'undefined' || l.sep===null) l.sep='&target=';
var article=l.article.urlString({keepSpaces: l.specialpage=='Search'});
var hint=popupString(l.specialpage+'Hint');
switch (l.specialpage) {
case 'Log':
switch (l.sep) {
case '&user=': hint=popupString('userLogHint'); break;
case '&type=block&page=': hint=popupString('blockLogHint'); break;
case '&page=': hint=popupString('pageLogHint'); break;
case '&type=protect&page=': hint=popupString('protectLogHint'); break;
case '&type=delete&page=': hint=popupString('deleteLogHint'); break;
default: log('Unknown log type, sep=' + l.sep); hint='Missing hint (FIXME)';
}
break;
case 'Prefixindex': article += '/'; break;
}
if (hint) hint = simplePrintf(hint, [safeDecodeURI(l.article)]);
else hint = safeDecodeURI(l.specialpage+':'+l.article) ;

var url = base + l.sep + article;
return generalNavLink({url: url, title: hint, text: l.text, newWin:l.newWin});
}

function generalLink(l) {
// l.url, l.text, l.title, l.newWin, l.className

if (typeof l.url=='undefined') return null;

// only quotation marks in the url can screw us up now... I think
var url=l.url.split('"').join('%22');

var ret='<a href="' + url + '"';
if (typeof l.title!='undefined' && l.title) ret += ' title="' + l.title + '"';
var newWin;
if (typeof l.newWin=='undefined' || l.newWin===null) newWin=getValueOf('popupNewWindows');
else newWin=l.newWin;
if (newWin) ret += ' target="_blank"';
if (typeof l.className!='undefined'&&l.className) ret+=' class="'+l.className+'"';
ret += '>';
if (typeof l.text==typeof '') ret+= l.text;
ret +='</a>';
return ret;
}

function appendParamsToLink(linkstr, params) {
var sp=linkstr.parenSplit(RegExp('(href="[^"]+?)"', 'i'));
if (sp.length<2) return null;
var ret=sp.shift() + sp.shift();
ret += '&' + params + '"';
ret += sp.join('');
return ret;
}

function changeLinkTargetLink(x) { // newTarget, text, hint, summary, clickButton, minor) {
if (x.newTarget) {
log ('changeLinkTargetLink: newTarget=' + x.newTarget);
}
// optional: oldTarget (in wikitext)
// if x.newTarget omitted or null, remove the link

//x.text=encodeURI(x.text); // this buggers things up on zh.wikipedia.org and doesn't seem necessary
x.clickButton=encodeURI(x.clickButton);

// FIXME: first character of page title as well as namespace should be case insensitive
// eg [[category:foo]] and [[Category:Foo]] are equivalent
// this'll break if charAt(0) is nasty
var cA=literalizeRegex(x.oldTarget);
var chs=cA.charAt(0).toUpperCase();
chs='['+chs + chs.toLowerCase()+']';
var currentArticleRegexBit=chs+cA.substring(1);
currentArticleRegexBit=currentArticleRegexBit
.split(RegExp('[_ ]+', 'g')).join('[_ ]+')
.split('\\(').join('(?:%2528|\\()')
.split('\\)').join('(?:%2529|\\))');
currentArticleRegexBit = '\\s*(' + currentArticleRegexBit + ')\\s*';
// e.g. Computer (archaic) -> \s*([Cc]omputer[_ ](?:%2528|\()archaic(?:%2528|\)))\s*

// autoedit=s~\[\[([Cc]ad)\]\]~[[Computer-aided%20design|$1]]~g;s~\[\[([Cc]AD)[|]~[[Computer-aided%20design|~g

// get the page to edit from the title
try {
//var title=document.getElementsByTagName('h1')[0].innerHTML.replace(RegExp(' ', 'g'), '_');
var title=document.title.split(' - ');
title[title.length-1]='';
title=title.join(' - ').replace(/ - $/, '');
} catch (err) { return; }

var lk=titledWikiLink({article: new Title(title), newWin:x.newWin,
action: 'edit',
text: x.text,
title: x.hint,
className: 'popup_change_title_link'
});
var cmd='';
if (x.newTarget) {
// escape '&' and other nasties
var t=encodeURI(x.newTarget);
var s=encodeURI(literalizeRegex(x.newTarget));
cmd += 's~\\[\\['+currentArticleRegexBit+'\\]\\]~[['+t+'|$1]]~g;';
cmd += 's~\\[\\['+currentArticleRegexBit+'[|]~[['+t+'|~g;';
cmd += 's~\\[\\['+s + '\\|' + s + '\\]\\]~[[' + t + ']]~g';
} else {
cmd += 's~\\[\\['+currentArticleRegexBit+'\\]\\]~$1~g;';
cmd += 's~\\[\\['+currentArticleRegexBit+'[|](.*?)\\]\\]~$2~g';
}
cmd += '&autoclick='+x.clickButton;
cmd += ( x.minor == null ) ? '' : '&autominor='+x.minor;
cmd += ( x.watch == null ) ? '' : '&autowatch='+x.watch;
cmd += '&autosummary='+x.summary;
return appendParamsToLink(lk, 'autoedit='+cmd);
}


function redirLink(redirMatch, article) {
// NB redirMatch is in wikiText
var ret='';

if (getValueOf('popupAppendRedirNavLinks') && getValueOf('popupNavLinks')) {
ret += '<hr>';
if (getValueOf('popupFixRedirs') && typeof autoEdit != 'undefined' && autoEdit) {
log('redirLink: newTarget=' + redirMatch);
ret += addPopupShortcut(
changeLinkTargetLink(
{newTarget: redirMatch, text: popupString('Redirects'),
hint: popupString('Fix this redirect'),
summary: simplePrintf(getValueOf('popupFixRedirsSummary'),
[article.toString(), redirMatch ]),
oldTarget: article.toString(),
clickButton: getValueOf('popupRedirAutoClick'), minor: true,
watch: getValueOf('popupWatchRedirredPages')})
, 'R');
ret += popupString(' to ');
}
else ret += popupString('Redirects') + popupString(' to ');
return ret;
}

else return '<br> ' + popupString('Redirects') + popupString(' to ') +
titledWikiLink({article: new Title().fromWikiText(redirMatch), action: 'view', /* FIXME: newWin */
text: safeDecodeURI(redirMatch), title: popupString('Bypass redirect')});
}

function arinLink(l) {
if (!saneLinkCheck(l)) { return null; }
if ( ! l.article.isIpUser() || ! pg.wiki.wikimedia) return null;

var uN=safeDecodeURI(l.article.userName());

return generalNavLink({url:'http://ws.arin.net/cgi-bin/whois.pl?queryinput=' + uN, newWin:l.newWin,
title: tprintf('Look up %s in ARIN whois database', [uN]),
text: l.text});
}

function toolDbName(cookieStyle) {
var ret=null;
var theWiki=pg.wiki.hostname.split('.')[1];
if (pg.wiki.hostname==pg.wiki.commons) {
ret = 'commonswiki';
} else {
switch(theWiki) {
case 'wikipedia':
ret = pg.wiki.lang + 'wiki';
break;
default:
ret = pg.wiki.lang + theWiki;
break;
}
}
if (!cookieStyle) { ret+= '_p'; }
return ret;
}

function saneLinkCheck(l) {
if (typeof l.article != typeof {} || typeof l.text != typeof '') { return false; }
return true;
}
function kateLink(l) {
if(!saneLinkCheck(l)) return null;
if (! pg.wiki.wikimedia) return null;
var uN=safeDecodeURI(l.article.userName());
var tool=getValueOf('popupEditCounterTool');
var url;
var defaultToolUrl='http://tools.wikimedia.de/~$3/cgi-bin/count_edits?dbname=$2&user=$1';

switch(tool) {
case 'custom':
url=simplePrintf(getValueOf('popupEditCounterUrl'), [ uN, toolDbName() ]);
break;
default:
url=simplePrintf(defaultToolUrl, [ uN, toolDbName(), tool ]);
}
return generalNavLink({url:url, title: tprintf('katelinkHint', [uN]), newWin:l.newWin, text: l.text});
}


function contribsTreeLink(l) {
if(!saneLinkCheck(l)) return null;
if (! pg.wiki.wikimedia) return null;
var uN=safeDecodeURI(l.article.userName());

var url='http://tools.wikimedia.de/~interiot/cgi-bin/contribution_tree?dbname=';
url += toolDbName() + '&user='+ uN;

return generalNavLink({url:url, title: tprintf('contribsTreeHint', [uN]), newWin:l.newWin, text: l.text});
}

function globalSearchLink(l) {
if(!saneLinkCheck(l)) return null;

var base='http://vs.aka-online.de/cgi-bin/globalwpsearch.pl?timeout=120&search=';
var article=l.article.urlString({keepSpaces:true});

return generalNavLink({url:base + article, newWin:l.newWin,
title: tprintf('globalSearchHint', [article]),
text: l.text});
}

function googleLink(l) {
if(!saneLinkCheck(l)) return null;

var base='http://www.google.com/search?q=';
var article=l.article.urlString({keepSpaces:true});

return generalNavLink({url:base + '%22' + article + '%22', newWin:l.newWin,
title: tprintf('googleSearchHint', [article]),
text: l.text});
}

function editorListLink(l) {
if(!saneLinkCheck(l)) return null;
var article= l.article.articleFromTalkPage() || l.article;
var base='http://tools.wikimedia.de/~tim/counter/?page=';
return generalNavLink({url:base+article.urlString(),
title: tprintf('editorListHint', [article]), newWin:l.newWin, text: l.text});
}

function generalNavLink(l) {
l.className = (l.className==null) ? 'popupNavLink' : l.className;
return generalLink(l);
}

//////////////////////////////////////////////////
// magic history links
//

function getHistoryInfo(wikipage, whatNext) {
log('getHistoryInfo');
getHistory(wikipage, whatNext ? function(d){whatNext(processHistory(d));} : processHistory);
}

// FIXME eliminate pg.idNumber ... how? :-(

function getHistory(wikipage, onComplete) {
log('getHistory');
var url;
if (getValueOf('popupUseQueryInterface')) {
url = pg.wiki.wikibase + '/query.php?format=json&what=revisions&titles=' +
new Title(wikipage).urlString() + '&rvlimit=' + getValueOf('popupHistoryLimit');
} else {
url = pg.wiki.titlebase + new Title(wikipage).urlString() +
'&action=history' + '&limit=' + getValueOf('popupHistoryLimit');
}
log('getHistory: url='+url);
return startDownload(url, pg.idNumber+'history', onComplete);
}

function processHistory(download) {
if (getValueOf('popupUseQueryInterface')) {
return processHistoryQuery(download);
}
return processHistoryScreenScrape(download);
}

function processHistoryScreenScrape(download) {
// screen scrape alert

var d=download.data;
// pg.misc.data=d; // for debugging

var edits=[];
var split=d.split('<li>');

for (var i=0; i<split.length; ++i) {
var histRe=RegExp(
'^[(].*?type="radio" value="([0-9]*)".*?class=\'history-user\'>' +
'<a href="(/wiki/User:|/w/index.php[?]title=(Special:Contributions&amp;target=|User:))([^&"]*)');
var match=histRe.exec(split[i]);
if (match) {
edits.push({ oldid: match[1], editor: match[4] });
}
}
var userName=getValueOf('popupUserName') ||
Cookie.read(pg.wiki.userNameCookie).split('+').join('_');
return finishProcessHistory(edits, userName);
}

function processHistoryQuery(download) {
log ('processHistoryQuery');
var d=download.data;
log('d='+d);
var jsobj;
try {
log('trying to parse JSON');
log('jsobj=' + d);
eval('jsobj=' + d);
log('done eval; jsobj='+jsobj);
window.x=jsobj;
var p=jsobj['pages'];
log('got p');
for (var pageid in p) {
var revisions=p[pageid]['revisions'];
// we only get the first one
break;
}
log('got revisions');
log(revisions.length +' of them');
} catch (someError) {
log('Something went wrong with JSON business');
return finishProcessHistory([]);
}
var edits=[];
for (var i=0; i<revisions.length; ++i) {
edits.push({ oldid: revisions[i]['revid'], editor: revisions[i]['user'] });
}
log('processed ' + edits.length + ' edits');
var userName=getValueOf('popupUserName') ||
unescape(Cookie.read(pg.wiki.userNameCookie).split('+').join(' '));
return finishProcessHistory(edits, userName);
}


function finishProcessHistory(edits, userName) {
var histInfo={};

histInfo.edits=edits;
histInfo.userName=userName;

for (var i=0; i<edits.length; ++i) {
if (typeof histInfo.myLastEdit == 'undefined' && userName && edits[i].editor==userName) {
histInfo.myLastEdit={index: i, oldid: edits[i].oldid, previd: (i==0 ? null : edits[i-1].oldid)};
}
if (typeof histInfo.firstNewEditor == 'undefined' && edits[i].editor != edits[0].editor) {
histInfo.firstNewEditor={index:i, oldid:edits[i].oldid, previd: (i==0 ? null : edits[i-1].oldid)};
}
}
//pg.misc.historyInfo=histInfo;
return histInfo;
}
//</NOLITE>
// ENDFILE: links.js
// STARTFILE: options.js
//////////////////////////////////////////////////
// options

// check for cookies and existing value, else use default
function defaultize(x) {
var val=null;
if (x!='popupCookies') {
defaultize('popupCookies');
if (pg.option.popupCookies && (val=Cookie.read(x))) {
pg.option[x]=val;
return;
}
}
if (pg.option[x]===null || typeof pg.option[x]=='undefined') {
if (typeof window[x] != 'undefined' ) pg.option[x]=window[x];
else pg.option[x]=pg.optionDefault[x];
}
}

function newOption(x, def) {
pg.optionDefault[x]=def;
}

function setDefault(x, def) {
return newOption(x, def);
}

function getValueOf(varName) {
defaultize(varName);
return pg.option[varName];
}

function useDefaultOptions() { // for testing
for (var p in pg.optionDefault) {
pg.option[p]=pg.optionDefault[p];
if (typeof window[p]!='undefined') { delete window[p]; }
}
}

function setOptions() {
// user-settable parameters and defaults

// Basic options
newOption('popupDelay', 0.5);
newOption('popupHideDelay', 0.5);
newOption('simplePopups', false);
newOption('popupStructure', 'shortmenus'); // see later - default for popupStructure is 'original' if simplePopups is true
newOption('popupActionsMenu', true);
newOption('popupSetupMenu', true);
newOption('popupAdminLinks', false);
newOption('popupShortcutKeys', false);
newOption('popupHistoricalLinks', true);
newOption('popupOnlyArticleLinks', true);
newOption('removeTitles', true);
newOption('popupMaxWidth', 350);
newOption('popupInitialWidth', false); // integer or false
newOption('popupSimplifyMainLink', true);
newOption('popupAppendRedirNavLinks', true);
newOption('popupTocLinks', false);
newOption('popupSubpopups', true);
newOption('popupUserName', ''); // should be magically detected with cookies if this isn't set
newOption('popupDragHandle', false /* 'popupTopLinks' */);
newOption('popupLazyPreviews', true);
newOption('popupLazyDownloads', true);
newOption('popupAllDabsStubs', false);
newOption('popupDebugging', false);
newOption('popupAdjustDiffDates', true),

//<NOLITE>
// images
newOption('popupImages', true);
newOption('imagePopupsForImages', true);
newOption('popupNeverGetThumbs', false);
newOption('popupImagesFromThisWikiOnly', false);
newOption('popupMinImageWidth', 50);
newOption('popupLoadImagesSequentially', false);
//newOption('popupImagesToggleSize', true);
newOption('popupThumbAction', 'imagepage'); //'sizetoggle');
newOption('popupImageSize', 60);
newOption('popupShowNonCommonsImages', false);

// redirs, dabs, reversion
newOption('popupFixRedirs', false);
newOption('popupRedirAutoClick', 'wpDiff');
newOption('popupFixDabs', false);
newOption('popupRevertSummaryPrompt', false);
newOption('popupRedlinkRemoval', false);
newOption('popupWatchDisambiggedPages', null);
newOption('popupWatchRedirredPages', null);

// navlinks
newOption('popupNavLinks', true);
newOption('popupNavLinkSeparator', ' &sdot; ');
newOption('popupLastEditLink', true);
newOption('popupEditCounterTool', 'interiot');
newOption('popupEditCounterUrl', '');
newOption('popupExtraUserMenu', '');
//</NOLITE>

// previews etc
newOption('popupPreviews', true);
newOption('popupSummaryData', true);
newOption('popupMaxPreviewSentences', 4);
newOption('popupMaxPreviewCharacters', 600);
newOption('popupLastModified', true);
newOption('popupPreviewKillTemplates', true);
newOption('popupPreviewRawTemplates', false);
newOption('popupPreviewFirstParOnly', true);
newOption('popupPreviewCutHeadings', true);

//<NOLITE>
// diffs
newOption('popupPreviewDiffs', true);
newOption('popupDiffMaxLines', 100);
newOption('popupDiffContextLines', 2);
newOption('popupDiffContextCharacters', 40);
newOption('popupDiffDates', true);
newOption('popupDiffDatePrinter', 'toLocaleString');

// edit summaries. God, these are ugly.
newOption('popupFixDabsSummary', popupString('defaultpopupFixDabsSummary') );
newOption('popupExtendedRevertSummary', popupString('defaultpopupExtendedRevertSummary') );
newOption('popupTimeOffset', null);
newOption('popupRevertSummary', popupString('defaultpopupRevertSummary') );
newOption('popupRevertToPreviousSummary', popupString('defaultpopupRevertToPreviousSummary') );
newOption('popupQueriedRevertSummary', popupString('defaultpopupQueriedRevertSummary') );
newOption('popupQueriedRevertToPreviousSummary', popupString('defaultpopupQueriedRevertToPreviousSummary') );
newOption('popupFixRedirsSummary', popupString('defaultpopupFixRedirsSummary') );
newOption('popupRedlinkSummary', popupString('defaultpopupRedlinkSummary') );
newOption('popupRmDabLinkSummary', popupString('defaultpopupRmDabLinkSummary') );
//</NOLITE>
// misc
newOption('popupCookies', false);
newOption('popupHistoryLimit', 50);
//<NOLITE>
newOption('popupFilters', [popupFilterStubDetect, popupFilterDisambigDetect,
popupFilterPageSize, popupFilterCountLinks,
popupFilterCountImages, popupFilterCountCategories,
popupFilterLastModified]);
newOption('extraPopupFilters', []);
newOption('popupOnEditSelection', true);
newOption('popupUseQueryInterface', true);
newOption('popupPreviewHistory', true);
newOption('popupImageLinks', true);
newOption('popupCategoryMembers', true);
newOption('popupHistoryPreviewLimit', 25);
newOption('popupContribsPreviewLimit',25);
//</NOLITE>

// new windows
newOption('popupNewWindows', false);
newOption('popupLinksNewWindow', {'lastContrib': true, 'sinceMe': true});
}
// ENDFILE: options.js
// STARTFILE: strings.js
//<NOLITE>
//////////////////////////////////////////////////
// Translatable strings
//////////////////////////////////////////////////
//
// See instructions at
// http://en.wikipedia.org/wiki/Wikipedia:Tools/Navigation_popups/Translation

pg.string = {
/////////////////////////////////////
// summary data, searching etc.
/////////////////////////////////////
'article': 'article',
'category': 'category',
'categories': 'categories',
'image': 'image',
'images': 'images',
'stub': 'stub',
'section stub': 'section stub',
'Empty page': 'Empty page',
'kB': 'kB',
'bytes': 'bytes',
'day': 'day',
'days': 'days',
'hour': 'hour',
'hours': 'hours',
'minute': 'minute',
'minutes': 'minutes',
'second': 'second',
'seconds': 'seconds',
'week': 'week',
'weeks': 'weeks',
'search': 'search',
'SearchHint': 'Find English Wikipedia articles containing %s',
'web': 'web',
'global': 'global',
'globalSearchHint': 'Search across Wikipedias in different languages for %s',
'googleSearchHint': 'Google for %s',
/////////////////////////////////////
// article-related actions and info
// (some actions also apply to user pages)
/////////////////////////////////////
'actions': 'actions', ///// view articles and view talk
'popupsMenu': 'popups',
'togglePreviewsHint': 'Toggle preview generation in popups on this page',
'toggle previews': 'toggle previews',
'reset': 'reset',
'disable': 'disable popups',
'disablePopupsHint': 'Disable popups on this page. Reload page to re-enable.',
'purgePopupsHint': 'Reset popups, clearing all cached popup data.',
'PopupsHint': 'Reset popups, clearing all cached popup data.',
'spacebar': 'space',
'view': 'view',
'view article': 'view article',
'viewHint': 'Go to %s',
'talk': 'talk',
'talk page': 'talk page',
'this&nbsp;revision': 'this&nbsp;revision',
'revision %s of %s': 'revision %s of %s',
'Revision %s of %s': 'Revision %s of %s',
'the revision prior to revision %s of %s': 'the revision prior to revision %s of %s',
'Toggle image size': 'Click to toggle image size',
'del': 'del', ///// delete, protect, move
'delete': 'delete',
'deleteHint': 'Delete %s',
'undeleteShort': 'un',
'UndeleteHint': 'Show the deletion history for %s',
'protect': 'protect',
'protectHint': 'Restrict editing rights to %s',
'unprotectShort': 'un',
'unprotectHint': 'Allow %s to be edited by anyone again',
'move': 'move',
'move page': 'move page',
'MovepageHint': 'Change the title of %s',
'edit': 'edit', ///// edit articles and talk
'edit article': 'edit article',
'editHint': 'Change the content of %s',
'edit talk': 'edit talk',
'new': 'new',
'new topic': 'new topic',
'newSectionHint': 'Start a new section on %s',
'null edit': 'null edit',
'nullEditHint': 'Submit an edit to %s, making no changes ',
'hist': 'hist', ///// history, diffs, editors, related
'history': 'history',
'historyHint': 'List the changes made to %s',
'last': 'last',
'lastEdit': 'lastEdit',
'show last edit': 'most recent edit',
'Show the last edit': 'Show the effects of the most recent change',
'lastContrib': 'lastContrib',
'last set of edits': 'latest edits',
'lastContribHint': 'Show the net effect of changes made by the last editor',
'cur': 'cur',
'diffCur': 'diffCur',
'Show changes since revision %s': 'Show changes since revision %s',
'%s old': '%s old', // as in 4 weeks old
'oldEdit': 'oldEdit',
'purge': 'purge',
'purgeHint': 'Demand a fresh copy of %s',
'raw': 'source',
'rawHint': 'Download the source of %s',
'render': 'simple',
'renderHint': 'Show a plain HTML version of %s',
'Show the edit made to get revision': 'Show the edit made to get revision',
'sinceMe': 'sinceMe',
'changes since mine': 'diff my edit',
'sinceMeHint': 'Show changes since my last edit',
'Couldn\'t find an edit by %s\nin the last %s edits to\n%s': 'Couldn\'t find an edit by %s\nin the last %s edits to\n%s',
'eds': 'eds',
'editors': 'editors',
'editorListHint': 'List the users who have edited %s',
'related': 'related',
'relatedChanges': 'relatedChanges',
'related changes': 'related changes',
'RecentchangeslinkedHint': 'Show changes in articles related to %s',
'editOld': 'editOld', ///// edit old version, or revert
'rv': 'rv',
'revert': 'revert',
'revertHint': 'Revert to %s',
'defaultpopupRedlinkSummary': 'Removing link to empty page [[%s]] using [[:en:Wikipedia:Tools/Navigation_popups|popups]]',
'defaultpopupFixDabsSummary': 'Disambiguate [[%s]] to [[%s]] using [[:en:Wikipedia:Tools/Navigation_popups|popups]]',
'defaultpopupFixRedirsSummary': 'Redirect bypass from [[%s]] to [[%s]] using [[:en:Wikipedia:Tools/Navigation_popups|popups]]',
'defaultpopupExtendedRevertSummary': 'Revert to revision dated %s by %s, oldid %s using [[:en:Wikipedia:Tools/Navigation_popups|popups]]',
'defaultpopupRevertToPreviousSummary': 'Revert to the revision prior to revision %s using [[:en:Wikipedia:Tools/Navigation_popups|popups]]',
'defaultpopupRevertSummary': 'Revert to revision %s using [[:en:Wikipedia:Tools/Navigation_popups|popups]]',
'defaultpopupQueriedRevertToPreviousSummary': 'Revert to the revision prior to revision $1 dated $2 by $3 using [[:en:Wikipedia:Tools/Navigation_popups|popups]]',
'defaultpopupQueriedRevertSummary': 'Revert to revision $1 dated $2 by $3 using [[:en:Wikipedia:Tools/Navigation_popups|popups]]',
'defaultpopupRmDabLinkSummary': 'Remove link to dab page [[%s]] using [[:en:Wikipedia:Tools/Navigation_popups|popups]]',
'Redirects': 'Redirects', // as in Redirects to ...
' to ': ' to ', // as in Redirects to ...
'Bypass redirect': 'Bypass redirect',
'Fix this redirect': 'Fix this redirect',
'disambig': 'disambig', ///// add or remove dab etc.
'disambigHint': 'Disambiguate this link to [[%s]]',
'Click to disambiguate this link to:': 'Click to disambiguate this link to:',
'remove this link': 'remove this link',
'remove all links to this page from this article': 'remove all links to this page from this article',
'remove all links to this disambig page from this article': 'remove all links to this disambig page from this article',
'mainlink': 'mainlink', ///// links, watch, unwatch
'wikiLink': 'wikiLink',
'wikiLinks': 'wikiLinks',
'links here': 'links here',
'whatLinksHere': 'whatLinksHere',
'what links here': 'what links here',
'WhatlinkshereHint': 'List the pages that are hyperlinked to %s',
'unwatchShort': 'un',
'watchThingy': 'watch', // called watchThingy because {}.watch is a function
'watchHint': 'Add %s to my watchlist',
'unwatchHint': 'Remove %s from my watchlist',
'Only found one editor: %s made %s edits': 'Only found one editor: %s made %s edits',
'%s seems to be the last editor to the page %s': '%s seems to be the last editor to the page %s',
'rss': 'rss',
/////////////////////////////////////
// diff previews
/////////////////////////////////////
'Diff truncated for performance reasons': 'Diff truncated for performance reasons',
'Old revision': 'Old revision',
'New revision': 'New revision',
'Something went wrong :-(': 'Something went wrong :-(',
'Empty revision, maybe non-existent': 'Empty revision, maybe non-existent',
'Unknown date': 'Unknown date',
/////////////////////////////////////
// other special previews
/////////////////////////////////////
'Empty category': 'Empty category',
'Category members (%s shown)': 'Category members (%s shown)',
'No image links found': 'No image links found',
'File links': 'File links',
'not commons': 'There is no file with this name on the Wikimedia Commons.',
'commons only': 'This file is from the Wikimedia Commons.',
'No image found': 'No image found',
'commons dupe': 'The same file appears to be available on the Wikimedia Commons.',
'commons conflict': 'A different file with the same name is available on the Wikimedia Commons.',
/////////////////////////////////////
// user-related actions and info
/////////////////////////////////////
'user': 'user', ///// user page, talk, email, space
'user&nbsp;page': 'user&nbsp;page',
'user talk': 'user talk',
'edit user talk': 'edit user talk',
'leave comment': 'leave comment',
'email': 'email',
'email user': 'email user',
'EmailuserHint': 'Send an email to %s',
'space': 'space', // short form for userSpace link
'PrefixindexHint': 'Show pages in the userspace of %s',
'count': 'count', ///// contributions, tree, log
'edit counter': 'edit counter',
'katelinkHint': 'Count the countributions made by %s',
'contribs': 'contribs',
'contributions': 'contributions',
'ContributionsHint': 'List the contributions made by %s',
'tree': 'tree',
'contribsTreeHint': 'Explore %s\'s contributions by namespace and by article',
'log': 'log',
'user log': 'user log',
'userLogHint': 'Show %s\'s user log',
'arin': 'ARIN lookup', ///// ARIN lookup, block user or IP
'Look up %s in ARIN whois database': 'Look up %s in the ARIN whois database',
'unblockShort': 'un',
'block': 'block',
'block user': 'block user',
'IpblocklistHint': 'Unblock %s',
'BlockipHint': 'Prevent %s from editing',
'block log': 'block log',
'blockLogHint': 'Show the block log for %s',
'protectLogHint': 'Show the protection log for %s',
'pageLogHint': 'Show the page log for %s',
'deleteLogHint': 'Show the deletion log for %s',
'Invalid %s %s': 'The option %s is invalid: %s',
/////////////////////////////////////
// Autoediting
/////////////////////////////////////
'Enter a non-empty edit summary or press cancel to abort': 'Enter a non-empty edit summary or press cancel to abort',
'Failed to get revision information, please edit manually.\n\n': 'Failed to get revision information, please edit manually.\n\n',
'The %s button has been automatically clicked. Please wait for the next page to load.': 'The %s button has been automatically clicked. Please wait for the next page to load.',
'Could not find button %s. Please check the settings in your javascript file.': 'Could not find button %s. Please check the settings in your javascript file.',
/////////////////////////////////////
// Popups setup
/////////////////////////////////////
'Open full-size image': 'Open full-size image',
'zxy': 'zxy'
};


function popupString(str) {
if (typeof popupStrings != 'undefined' && popupStrings && popupStrings[str]) { return popupStrings[str]; }
if (pg.string[str]) { return pg.string[str]; }
return str;
}


function tprintf(str,subs) {
if (typeof subs != typeof []) { subs = [subs]; }
return simplePrintf(popupString(str), subs);
}

//</NOLITE>
// ENDFILE: strings.js


//</pre>

Revision as of 04:57, 20 March 2022

function isCompatible(ua){return!!((function(){'use strict';return!this&&Function.prototype.bind;}())&&'querySelector'in document&&'localStorage'in window&&!ua.match(/MSIE 10|NetFront|Opera Mini|S40OviBrowser|MeeGo|Android.+Glass|^Mozilla\/5\.0 .+ Gecko\/$|googleweblight|PLAYSTATION|PlayStation/));}if(!isCompatible(navigator.userAgent)){document.documentElement.className=document.documentElement.className.replace(/(^|\s)client-js(\s|$)/,'$1client-nojs$2');while(window.NORLQ&&NORLQ[0]){NORLQ.shift()();}NORLQ={push:function(fn){fn();}};RLQ={push:function(){}};}else{if(window.performance&&performance.mark){performance.mark('mwStartup');}(function(){'use strict';var mw,log,con=window.console;function logError(topic,data){var msg,e=data.exception;if(con.log){msg=(e?'Exception':'Error')+' in '+data.source+(data.module?' in module '+data.module:'')+(e?':':'.');con.log(msg);if(e&&con.warn){con.warn(e);}}}function Map(){this.values=Object.create(null);}Map.prototype={constructor:Map,get:
function(selection,fallback){var results,i;fallback=arguments.length>1?fallback:null;if(Array.isArray(selection)){results={};for(i=0;i<selection.length;i++){if(typeof selection[i]==='string'){results[selection[i]]=selection[i]in this.values?this.values[selection[i]]:fallback;}}return results;}if(typeof selection==='string'){return selection in this.values?this.values[selection]:fallback;}if(selection===undefined){results={};for(i in this.values){results[i]=this.values[i];}return results;}return fallback;},set:function(selection,value){if(arguments.length>1){if(typeof selection==='string'){this.values[selection]=value;return true;}}else if(typeof selection==='object'){for(var s in selection){this.values[s]=selection[s];}return true;}return false;},exists:function(selection){return typeof selection==='string'&&selection in this.values;}};log=function(){};log.warn=con.warn?Function.prototype.bind.call(con.warn,con):function(){};mw={now:function(){var perf=window.performance,navStart=perf
&&perf.timing&&perf.timing.navigationStart;mw.now=navStart&&perf.now?function(){return navStart+perf.now();}:Date.now;return mw.now();},trackQueue:[],track:function(topic,data){mw.trackQueue.push({topic:topic,data:data});},trackError:function(topic,data){mw.track(topic,data);logError(topic,data);},Map:Map,config:new Map(),messages:new Map(),templates:new Map(),log:log};window.mw=window.mediaWiki=mw;}());(function(){'use strict';var StringSet,store,hasOwn=Object.hasOwnProperty;function defineFallbacks(){StringSet=window.Set||function(){var set=Object.create(null);return{add:function(value){set[value]=true;},has:function(value){return value in set;}};};}defineFallbacks();function fnv132(str){var hash=0x811C9DC5;for(var i=0;i<str.length;i++){hash+=(hash<<1)+(hash<<4)+(hash<<7)+(hash<<8)+(hash<<24);hash^=str.charCodeAt(i);}hash=(hash>>>0).toString(36).slice(0,5);while(hash.length<5){hash='0'+hash;}return hash;}var isES6Supported=typeof Promise==='function'&&Promise.prototype.finally&&/./g.
flags==='g'&&(function(){try{new Function('(a = 0) => a');return true;}catch(e){return false;}}());var registry=Object.create(null),sources=Object.create(null),handlingPendingRequests=false,pendingRequests=[],queue=[],jobs=[],willPropagate=false,errorModules=[],baseModules=["jquery","mediawiki.base"],marker=document.querySelector('meta[name="ResourceLoaderDynamicStyles"]'),lastCssBuffer,rAF=window.requestAnimationFrame||setTimeout;function newStyleTag(text,nextNode){var el=document.createElement('style');el.appendChild(document.createTextNode(text));if(nextNode&&nextNode.parentNode){nextNode.parentNode.insertBefore(el,nextNode);}else{document.head.appendChild(el);}return el;}function flushCssBuffer(cssBuffer){if(cssBuffer===lastCssBuffer){lastCssBuffer=null;}newStyleTag(cssBuffer.cssText,marker);for(var i=0;i<cssBuffer.callbacks.length;i++){cssBuffer.callbacks[i]();}}function addEmbeddedCSS(cssText,callback){if(!lastCssBuffer||cssText.slice(0,7)==='@import'){lastCssBuffer={cssText:'',
callbacks:[]};rAF(flushCssBuffer.bind(null,lastCssBuffer));}lastCssBuffer.cssText+='\n'+cssText;lastCssBuffer.callbacks.push(callback);}function getCombinedVersion(modules){var hashes=modules.reduce(function(result,module){return result+registry[module].version;},'');return fnv132(hashes);}function allReady(modules){for(var i=0;i<modules.length;i++){if(mw.loader.getState(modules[i])!=='ready'){return false;}}return true;}function allWithImplicitReady(module){return allReady(registry[module].dependencies)&&(baseModules.indexOf(module)!==-1||allReady(baseModules));}function anyFailed(modules){for(var i=0;i<modules.length;i++){var state=mw.loader.getState(modules[i]);if(state==='error'||state==='missing'){return modules[i];}}return false;}function doPropagation(){var didPropagate=true;var module;while(didPropagate){didPropagate=false;while(errorModules.length){var errorModule=errorModules.shift(),baseModuleError=baseModules.indexOf(errorModule)!==-1;for(module in registry){if(registry[
module].state!=='error'&&registry[module].state!=='missing'){if(baseModuleError&&baseModules.indexOf(module)===-1){registry[module].state='error';didPropagate=true;}else if(registry[module].dependencies.indexOf(errorModule)!==-1){registry[module].state='error';errorModules.push(module);didPropagate=true;}}}}for(module in registry){if(registry[module].state==='loaded'&&allWithImplicitReady(module)){execute(module);didPropagate=true;}}for(var i=0;i<jobs.length;i++){var job=jobs[i];var failed=anyFailed(job.dependencies);if(failed!==false||allReady(job.dependencies)){jobs.splice(i,1);i-=1;try{if(failed!==false&&job.error){job.error(new Error('Failed dependency: '+failed),job.dependencies);}else if(failed===false&&job.ready){job.ready();}}catch(e){mw.trackError('resourceloader.exception',{exception:e,source:'load-callback'});}didPropagate=true;}}}willPropagate=false;}function setAndPropagate(module,state){registry[module].state=state;if(state==='ready'){store.add(module);}else if(state===
'error'||state==='missing'){errorModules.push(module);}else if(state!=='loaded'){return;}if(willPropagate){return;}willPropagate=true;mw.requestIdleCallback(doPropagation,{timeout:1});}function sortDependencies(module,resolved,unresolved){if(!(module in registry)){throw new Error('Unknown module: '+module);}if(typeof registry[module].skip==='string'){var skip=(new Function(registry[module].skip)());registry[module].skip=!!skip;if(skip){registry[module].dependencies=[];setAndPropagate(module,'ready');return;}}if(!unresolved){unresolved=new StringSet();}var deps=registry[module].dependencies;unresolved.add(module);for(var i=0;i<deps.length;i++){if(resolved.indexOf(deps[i])===-1){if(unresolved.has(deps[i])){throw new Error('Circular reference detected: '+module+' -> '+deps[i]);}sortDependencies(deps[i],resolved,unresolved);}}resolved.push(module);}function resolve(modules){var resolved=baseModules.slice();for(var i=0;i<modules.length;i++){sortDependencies(modules[i],resolved);}return resolved
;}function resolveStubbornly(modules){var resolved=baseModules.slice();for(var i=0;i<modules.length;i++){var saved=resolved.slice();try{sortDependencies(modules[i],resolved);}catch(err){resolved=saved;mw.log.warn('Skipped unavailable module '+modules[i]);if(modules[i]in registry){mw.trackError('resourceloader.exception',{exception:err,source:'resolve'});}}}return resolved;}function resolveRelativePath(relativePath,basePath){var relParts=relativePath.match(/^((?:\.\.?\/)+)(.*)$/);if(!relParts){return null;}var baseDirParts=basePath.split('/');baseDirParts.pop();var prefixes=relParts[1].split('/');prefixes.pop();var prefix;while((prefix=prefixes.pop())!==undefined){if(prefix==='..'){baseDirParts.pop();}}return(baseDirParts.length?baseDirParts.join('/')+'/':'')+relParts[2];}function makeRequireFunction(moduleObj,basePath){return function require(moduleName){var fileName=resolveRelativePath(moduleName,basePath);if(fileName===null){return mw.loader.require(moduleName);}if(hasOwn.call(
moduleObj.packageExports,fileName)){return moduleObj.packageExports[fileName];}var scriptFiles=moduleObj.script.files;if(!hasOwn.call(scriptFiles,fileName)){throw new Error('Cannot require undefined file '+fileName);}var result,fileContent=scriptFiles[fileName];if(typeof fileContent==='function'){var moduleParam={exports:{}};fileContent(makeRequireFunction(moduleObj,fileName),moduleParam,moduleParam.exports);result=moduleParam.exports;}else{result=fileContent;}moduleObj.packageExports[fileName]=result;return result;};}function addScript(src,callback){var script=document.createElement('script');script.src=src;script.onload=script.onerror=function(){if(script.parentNode){script.parentNode.removeChild(script);}if(callback){callback();callback=null;}};document.head.appendChild(script);}function queueModuleScript(src,moduleName,callback){pendingRequests.push(function(){if(moduleName!=='jquery'){window.require=mw.loader.require;window.module=registry[moduleName].module;}addScript(src,
function(){delete window.module;callback();if(pendingRequests[0]){pendingRequests.shift()();}else{handlingPendingRequests=false;}});});if(!handlingPendingRequests&&pendingRequests[0]){handlingPendingRequests=true;pendingRequests.shift()();}}function addLink(url,media,nextNode){var el=document.createElement('link');el.rel='stylesheet';if(media){el.media=media;}el.href=url;if(nextNode&&nextNode.parentNode){nextNode.parentNode.insertBefore(el,nextNode);}else{document.head.appendChild(el);}}function domEval(code){var script=document.createElement('script');if(mw.config.get('wgCSPNonce')!==false){script.nonce=mw.config.get('wgCSPNonce');}script.text=code;document.head.appendChild(script);script.parentNode.removeChild(script);}function enqueue(dependencies,ready,error){if(allReady(dependencies)){if(ready){ready();}return;}var failed=anyFailed(dependencies);if(failed!==false){if(error){error(new Error('Dependency '+failed+' failed to load'),dependencies);}return;}if(ready||error){jobs.push({
dependencies:dependencies.filter(function(module){var state=registry[module].state;return state==='registered'||state==='loaded'||state==='loading'||state==='executing';}),ready:ready,error:error});}dependencies.forEach(function(module){if(registry[module].state==='registered'&&queue.indexOf(module)===-1){queue.push(module);}});mw.loader.work();}function execute(module){if(registry[module].state!=='loaded'){throw new Error('Module in state "'+registry[module].state+'" may not execute: '+module);}registry[module].state='executing';var runScript=function(){var script=registry[module].script;var markModuleReady=function(){setAndPropagate(module,'ready');};var nestedAddScript=function(arr,offset){if(offset>=arr.length){markModuleReady();return;}queueModuleScript(arr[offset],module,function(){nestedAddScript(arr,offset+1);});};try{if(Array.isArray(script)){nestedAddScript(script,0);}else if(typeof script==='function'){if(module==='jquery'){script();}else{script(window.$,window.$,mw.loader.
require,registry[module].module);}markModuleReady();}else if(typeof script==='object'&&script!==null){var mainScript=script.files[script.main];if(typeof mainScript!=='function'){throw new Error('Main file in module '+module+' must be a function');}mainScript(makeRequireFunction(registry[module],script.main),registry[module].module,registry[module].module.exports);markModuleReady();}else if(typeof script==='string'){domEval(script);markModuleReady();}else{markModuleReady();}}catch(e){setAndPropagate(module,'error');mw.trackError('resourceloader.exception',{exception:e,module:module,source:'module-execute'});}};if(registry[module].messages){mw.messages.set(registry[module].messages);}if(registry[module].templates){mw.templates.set(module,registry[module].templates);}var cssPending=0;var cssHandle=function(){cssPending++;return function(){cssPending--;if(cssPending===0){var runScriptCopy=runScript;runScript=undefined;runScriptCopy();}};};if(registry[module].style){for(var key in registry[
module].style){var value=registry[module].style[key];if(key==='css'){for(var i=0;i<value.length;i++){addEmbeddedCSS(value[i],cssHandle());}}else if(key==='url'){for(var media in value){var urls=value[media];for(var j=0;j<urls.length;j++){addLink(urls[j],media,marker);}}}}}if(module==='user'){var siteDeps;var siteDepErr;try{siteDeps=resolve(['site']);}catch(e){siteDepErr=e;runScript();}if(!siteDepErr){enqueue(siteDeps,runScript,runScript);}}else if(cssPending===0){runScript();}}function sortQuery(o){var sorted={};var list=[];for(var key in o){list.push(key);}list.sort();for(var i=0;i<list.length;i++){sorted[list[i]]=o[list[i]];}return sorted;}function buildModulesString(moduleMap){var str=[];var list=[];var p;function restore(suffix){return p+suffix;}for(var prefix in moduleMap){p=prefix===''?'':prefix+'.';str.push(p+moduleMap[prefix].join(','));list.push.apply(list,moduleMap[prefix].map(restore));}return{str:str.join('|'),list:list};}function makeQueryString(params){var chunks=[];for(
var key in params){chunks.push(encodeURIComponent(key)+'='+encodeURIComponent(params[key]));}return chunks.join('&');}function batchRequest(batch){if(!batch.length){return;}var sourceLoadScript,currReqBase,moduleMap;function doRequest(){var query=Object.create(currReqBase),packed=buildModulesString(moduleMap);query.modules=packed.str;query.version=getCombinedVersion(packed.list);query=sortQuery(query);addScript(sourceLoadScript+'?'+makeQueryString(query));}batch.sort();var reqBase={"lang":"en","skin":"cologneblue"};var splits=Object.create(null);for(var b=0;b<batch.length;b++){var bSource=registry[batch[b]].source;var bGroup=registry[batch[b]].group;if(!splits[bSource]){splits[bSource]=Object.create(null);}if(!splits[bSource][bGroup]){splits[bSource][bGroup]=[];}splits[bSource][bGroup].push(batch[b]);}for(var source in splits){sourceLoadScript=sources[source];for(var group in splits[source]){var modules=splits[source][group];currReqBase=Object.create(reqBase);if(group===0&&mw.config.
get('wgUserName')!==null){currReqBase.user=mw.config.get('wgUserName');}var currReqBaseLength=makeQueryString(currReqBase).length+23;var length=currReqBaseLength;var currReqModules=[];moduleMap=Object.create(null);for(var i=0;i<modules.length;i++){var lastDotIndex=modules[i].lastIndexOf('.'),prefix=modules[i].slice(0,Math.max(0,lastDotIndex)),suffix=modules[i].slice(lastDotIndex+1),bytesAdded=moduleMap[prefix]?suffix.length+3:modules[i].length+3;if(currReqModules.length&&length+bytesAdded>mw.loader.maxQueryLength){doRequest();length=currReqBaseLength;moduleMap=Object.create(null);currReqModules=[];}if(!moduleMap[prefix]){moduleMap[prefix]=[];}length+=bytesAdded;moduleMap[prefix].push(suffix);currReqModules.push(modules[i]);}if(currReqModules.length){doRequest();}}}}function asyncEval(implementations,cb){if(!implementations.length){return;}mw.requestIdleCallback(function(){try{domEval(implementations.join(';'));}catch(err){cb(err);}});}function getModuleKey(module){return module in
registry?(module+'@'+registry[module].version):null;}function splitModuleKey(key){var index=key.lastIndexOf('@');if(index===-1||index===0){return{name:key,version:''};}return{name:key.slice(0,index),version:key.slice(index+1)};}function registerOne(module,version,dependencies,group,source,skip){if(module in registry){throw new Error('module already registered: '+module);}version=String(version||'');if(version.slice(-1)==='!'){if(!isES6Supported){return;}version=version.slice(0,-1);}registry[module]={module:{exports:{}},packageExports:{},version:version,dependencies:dependencies||[],group:typeof group==='undefined'?null:group,source:typeof source==='string'?source:'local',state:'registered',skip:typeof skip==='string'?skip:null};}mw.loader={moduleRegistry:registry,maxQueryLength:5000,addStyleTag:newStyleTag,enqueue:enqueue,resolve:resolve,work:function(){store.init();var q=queue.length,storedImplementations=[],storedNames=[],requestNames=[],batch=new StringSet();while(q--){var module=
queue[q];if(mw.loader.getState(module)==='registered'&&!batch.has(module)){registry[module].state='loading';batch.add(module);var implementation=store.get(module);if(implementation){storedImplementations.push(implementation);storedNames.push(module);}else{requestNames.push(module);}}}queue=[];asyncEval(storedImplementations,function(err){store.stats.failed++;store.clear();mw.trackError('resourceloader.exception',{exception:err,source:'store-eval'});var failed=storedNames.filter(function(name){return registry[name].state==='loading';});batchRequest(failed);});batchRequest(requestNames);},addSource:function(ids){for(var id in ids){if(id in sources){throw new Error('source already registered: '+id);}sources[id]=ids[id];}},register:function(modules){if(typeof modules!=='object'){registerOne.apply(null,arguments);return;}function resolveIndex(dep){return typeof dep==='number'?modules[dep][0]:dep;}for(var i=0;i<modules.length;i++){var deps=modules[i][2];if(deps){for(var j=0;j<deps.length;j++
){deps[j]=resolveIndex(deps[j]);}}registerOne.apply(null,modules[i]);}},implement:function(module,script,style,messages,templates){var split=splitModuleKey(module),name=split.name,version=split.version;if(!(name in registry)){mw.loader.register(name);}if(registry[name].script!==undefined){throw new Error('module already implemented: '+name);}if(version){registry[name].version=version;}registry[name].script=script||null;registry[name].style=style||null;registry[name].messages=messages||null;registry[name].templates=templates||null;if(registry[name].state!=='error'&&registry[name].state!=='missing'){setAndPropagate(name,'loaded');}},load:function(modules,type){if(typeof modules==='string'&&/^(https?:)?\/?\//.test(modules)){if(type==='text/css'){addLink(modules);}else if(type==='text/javascript'||type===undefined){addScript(modules);}else{throw new Error('Invalid type '+type);}}else{modules=typeof modules==='string'?[modules]:modules;enqueue(resolveStubbornly(modules));}},state:function(
states){for(var module in states){if(!(module in registry)){mw.loader.register(module);}setAndPropagate(module,states[module]);}},getState:function(module){return module in registry?registry[module].state:null;},require:function(moduleName){if(mw.loader.getState(moduleName)!=='ready'){throw new Error('Module "'+moduleName+'" is not loaded');}return registry[moduleName].module.exports;}};var hasPendingWrites=false;function flushWrites(){store.prune();while(store.queue.length){store.set(store.queue.shift());}try{localStorage.removeItem(store.key);var data=JSON.stringify(store);localStorage.setItem(store.key,data);}catch(e){mw.trackError('resourceloader.exception',{exception:e,source:'store-localstorage-update'});}hasPendingWrites=false;}mw.loader.store=store={enabled:null,items:{},queue:[],stats:{hits:0,misses:0,expired:0,failed:0},toJSON:function(){return{items:store.items,vary:store.vary,asOf:Math.ceil(Date.now()/1e7)};},key:"MediaWikiModuleStore:commonswiki",vary:"cologneblue:1-3:en",
init:function(){if(this.enabled===null){this.enabled=false;if(false||/Firefox/.test(navigator.userAgent)){this.clear();}else{this.load();}}},load:function(){try{var raw=localStorage.getItem(this.key);this.enabled=true;var data=JSON.parse(raw);if(data&&data.vary===this.vary&&data.items&&Date.now()<(data.asOf*1e7)+259e7){this.items=data.items;}}catch(e){}},get:function(module){if(this.enabled){var key=getModuleKey(module);if(key in this.items){this.stats.hits++;return this.items[key];}this.stats.misses++;}return false;},add:function(module){if(this.enabled){this.queue.push(module);this.requestUpdate();}},set:function(module){var args,encodedScript,descriptor=registry[module],key=getModuleKey(module);if(key in this.items||!descriptor||descriptor.state!=='ready'||!descriptor.version||descriptor.group===1||descriptor.group===0||[descriptor.script,descriptor.style,descriptor.messages,descriptor.templates].indexOf(undefined)!==-1){return;}try{if(typeof descriptor.script==='function'){
encodedScript=String(descriptor.script);}else if(typeof descriptor.script==='object'&&descriptor.script&&!Array.isArray(descriptor.script)){encodedScript='{'+'main:'+JSON.stringify(descriptor.script.main)+','+'files:{'+Object.keys(descriptor.script.files).map(function(file){var value=descriptor.script.files[file];return JSON.stringify(file)+':'+(typeof value==='function'?value:JSON.stringify(value));}).join(',')+'}}';}else{encodedScript=JSON.stringify(descriptor.script);}args=[JSON.stringify(key),encodedScript,JSON.stringify(descriptor.style),JSON.stringify(descriptor.messages),JSON.stringify(descriptor.templates)];}catch(e){mw.trackError('resourceloader.exception',{exception:e,source:'store-localstorage-json'});return;}var src='mw.loader.implement('+args.join(',')+');';if(src.length>1e5){return;}this.items[key]=src;},prune:function(){for(var key in this.items){if(getModuleKey(splitModuleKey(key).name)!==key){this.stats.expired++;delete this.items[key];}}},clear:function(){this.items={
};try{localStorage.removeItem(this.key);}catch(e){}},requestUpdate:function(){if(!hasPendingWrites){hasPendingWrites=true;setTimeout(function(){mw.requestIdleCallback(flushWrites);},2000);}}};}());mw.requestIdleCallbackInternal=function(callback){setTimeout(function(){var start=mw.now();callback({didTimeout:false,timeRemaining:function(){return Math.max(0,50-(mw.now()-start));}});},1);};mw.requestIdleCallback=window.requestIdleCallback?window.requestIdleCallback.bind(window):mw.requestIdleCallbackInternal;(function(){var queue;mw.loader.addSource({"local":"/w/load.php","metawiki":"//meta.wikimedia.org/w/load.php"});mw.loader.register([["site","190bc",[1]],["site.styles","f0uto",[],2],["filepage","2rscn"],["user","s1wiu",[],0],["user.styles","smrj4",[],0],["user.options","1i9g4",[],1],["mediawiki.skinning.elements","1sarl"],["mediawiki.skinning.content","181dn"],["mediawiki.skinning.interface","mu8k8"],["jquery.makeCollapsible.styles","ljtp5"],["mediawiki.skinning.content.parsoid",
"1yx5v"],["mediawiki.skinning.content.externallinks","15suo"],["jquery","1vnvf"],["es6-polyfills","u287e",[],null,null,"return Array.prototype.find\u0026\u0026Array.prototype.findIndex\u0026\u0026Array.prototype.includes\u0026\u0026typeof Promise==='function'\u0026\u0026Promise.prototype.finally;"],["fetch-polyfill","1gvrd",[15]],["web2017-polyfills","k0rck",[13],null,null,"return'IntersectionObserver'in window\u0026\u0026typeof fetch==='function'\u0026\u0026typeof URL==='function'\u0026\u0026'toJSON'in URL.prototype;"],["mediawiki.base","1a5aj",[12]],["jquery.chosen","bppd4"],["jquery.client","1tje2"],["jquery.color","qs4nu"],["jquery.confirmable","1en9n",[115]],["jquery.cookie","1u41n"],["jquery.form","186tg"],["jquery.fullscreen","18ttp"],["jquery.highlightText","t130m",[88]],["jquery.hoverIntent","pqqa9"],["jquery.i18n","31t4a",[114]],["jquery.lengthLimit","qrnp1",[70]],["jquery.makeCollapsible","3zx6r",[9]],["jquery.spinner","yoa8f",[30]],["jquery.spinner.styles","pfek7"],[
"jquery.suggestions","1ykxl",[24]],["jquery.tablesorter","ex6te",[33,116,88]],["jquery.tablesorter.styles","jjsfw"],["jquery.textSelection","em3yw",[18]],["jquery.throttle-debounce","1bymo"],["jquery.tipsy","75pn7"],["jquery.ui","12ffh"],["moment","r6trt",[112,88]],["vue","3awne!"],["@vue/composition-api","1s4l3",[39]],["vuex","ironm!",[39]],["wvui","1ryei",[40]],["wvui-search","w257l",[39]],["@wikimedia/codex","1emtp!",[39]],["mediawiki.template","6nkqm"],["mediawiki.template.mustache","gy30q",[45]],["mediawiki.apipretty","qjpf2"],["mediawiki.api","1sdt6",[76,115]],["mediawiki.content.json","1n6wr"],["mediawiki.confirmCloseWindow","1m54f"],["mediawiki.debug","a5lwb",[203]],["mediawiki.diff","oztjs"],["mediawiki.diff.styles","1jzsw"],["mediawiki.feedback","nllne",[978,211]],["mediawiki.feedlink","5bck4"],["mediawiki.filewarning","1aaoe",[203,215]],["mediawiki.ForeignApi","17f2l",[319]],["mediawiki.ForeignApi.core","15s0r",[85,48,199]],["mediawiki.helplink","5fs9z"],["mediawiki.hlist",
"85ir9"],["mediawiki.htmlform","18f2c",[27,88]],["mediawiki.htmlform.ooui","moc8u",[203]],["mediawiki.htmlform.styles","1x8zm"],["mediawiki.htmlform.ooui.styles","ge3zz"],["mediawiki.icon","17xlm"],["mediawiki.inspect","1w7zb",[70,88]],["mediawiki.notification","i9scp",[88,95]],["mediawiki.notification.convertmessagebox","zb0xo",[67]],["mediawiki.notification.convertmessagebox.styles","dro1f"],["mediawiki.String","1ck84"],["mediawiki.pager.styles","2txmq"],["mediawiki.pager.tablePager","ykcx2"],["mediawiki.pulsatingdot","svyap"],["mediawiki.searchSuggest","16shg",[31,48]],["mediawiki.storage","1sj4u"],["mediawiki.Title","1bqh8",[70,88]],["mediawiki.Upload","3i9e4",[48]],["mediawiki.ForeignUpload","pxkp9",[57,77]],["mediawiki.ForeignStructuredUpload","1s325",[78]],["mediawiki.Upload.Dialog","k8qbo",[81]],["mediawiki.Upload.BookletLayout","y4ry3",[77,86,38,206,211,216,217]],["mediawiki.ForeignStructuredUpload.BookletLayout","gss1b",[79,81,119,182,176]],["mediawiki.toc","5oex3",[92]],[
"mediawiki.toc.styles","1vzj1"],["mediawiki.Uri","1n2iu",[88]],["mediawiki.user","1ab6a",[48,92]],["mediawiki.userSuggest","1tzu5",[31,48]],["mediawiki.util","ucm4f",[18]],["mediawiki.viewport","j19gc"],["mediawiki.checkboxtoggle","nzeg7"],["mediawiki.checkboxtoggle.styles","1esmp"],["mediawiki.cookie","3bl6x",[21]],["mediawiki.experiments","8e8ao"],["mediawiki.editfont.styles","76g2r"],["mediawiki.visibleTimeout","1bmk6"],["mediawiki.action.delete","zjbix",[27,203]],["mediawiki.action.edit","165e7",[34,98,48,94,178]],["mediawiki.action.edit.styles","17fjz"],["mediawiki.action.edit.collapsibleFooter","1jlz7",[28,65,75]],["mediawiki.action.edit.preview","9ldbn",[29,125,86]],["mediawiki.action.history","1j8pz",[28]],["mediawiki.action.history.styles","10vu6"],["mediawiki.action.protect","nuj27",[27,203]],["mediawiki.action.view.metadata","104m6",[110]],["mediawiki.action.view.categoryPage.styles","18sxm"],["mediawiki.action.view.postEdit","11sol",[115,67,203,222]],[
"mediawiki.action.view.redirect","1a3n8",[18]],["mediawiki.action.view.redirectPage","1tcmo"],["mediawiki.action.edit.editWarning","192id",[34,50,115]],["mediawiki.action.view.filepage","zhum4"],["mediawiki.action.styles","xz1f2"],["mediawiki.language","1h2x6",[113]],["mediawiki.cldr","1630p",[114]],["mediawiki.libs.pluralruleparser","8vy0u"],["mediawiki.jqueryMsg","11iw3",[70,112,88,5]],["mediawiki.language.months","1tymc",[112]],["mediawiki.language.names","xubm8",[112]],["mediawiki.language.specialCharacters","cv42u",[112]],["mediawiki.libs.jpegmeta","16fc5"],["mediawiki.page.gallery","7tgpe",[121,88]],["mediawiki.page.gallery.styles","1p8qp"],["mediawiki.page.gallery.slideshow","1j8et",[48,206,225,227]],["mediawiki.page.ready","1m3as",[48]],["mediawiki.page.watch.ajax","1rflu",[48]],["mediawiki.page.preview","1mxad",[28,34,48,53,203]],["mediawiki.page.image.pagination","18sxf",[29,88]],["mediawiki.rcfilters.filters.base.styles","1b228"],[
"mediawiki.rcfilters.highlightCircles.seenunseen.styles","gwlmv"],["mediawiki.rcfilters.filters.ui","ncui8",[28,85,86,173,212,219,221,222,223,225,226]],["mediawiki.interface.helpers.styles","1436n"],["mediawiki.special","1r76y"],["mediawiki.special.apisandbox","o0vbb",[28,85,193,179,202,217]],["mediawiki.special.block","3z6jo",[61,176,192,183,193,190,217,219]],["mediawiki.misc-authed-ooui","4897z",[62,173,178]],["mediawiki.misc-authed-pref","1b18i",[5]],["mediawiki.misc-authed-curate","1auv8",[20,29,48]],["mediawiki.special.changeslist","1cy7m"],["mediawiki.special.changeslist.watchlistexpiry","dgsac",[131]],["mediawiki.special.changeslist.enhanced","1xll3"],["mediawiki.special.changeslist.legend","174an"],["mediawiki.special.changeslist.legend.js","fa4m4",[28,92]],["mediawiki.special.contributions","ua2dg",[28,115,176,202]],["mediawiki.special.edittags","1di11",[17,27]],["mediawiki.special.import","5dvpi",[173]],["mediawiki.special.import.styles.ooui","1owcj"],[
"mediawiki.special.preferences.ooui","kr0k3",[50,94,68,75,183,178]],["mediawiki.special.preferences.styles.ooui","1rcr5"],["mediawiki.special.recentchanges","1b2m9",[173]],["mediawiki.special.revisionDelete","e8jxp",[27]],["mediawiki.special.search","1sevh",[195]],["mediawiki.special.search.commonsInterwikiWidget","5zvgb",[85,48]],["mediawiki.special.search.interwikiwidget.styles","17wtq"],["mediawiki.special.search.styles","qgber"],["mediawiki.special.unwatchedPages","ygz13",[48]],["mediawiki.special.upload","s2u79",[29,48,50,119,131,45]],["mediawiki.special.userlogin.common.styles","b44v9"],["mediawiki.special.userlogin.login.styles","1bqrv"],["mediawiki.special.createaccount","104qy",[48]],["mediawiki.special.userlogin.signup.styles","1abpp"],["mediawiki.special.userrights","faiav",[27,68]],["mediawiki.special.watchlist","du6lj",[48,203,222]],["mediawiki.special.version","5yx4s"],["mediawiki.legacy.config","odz9c"],["mediawiki.legacy.commonPrint","1hzmi"],["mediawiki.legacy.shared",
"c35jl"],["mediawiki.ui","1pvn3"],["mediawiki.ui.checkbox","11acr"],["mediawiki.ui.radio","1ixij"],["mediawiki.ui.anchor","mw0v4"],["mediawiki.ui.button","1kidx"],["mediawiki.ui.input","1pxwt"],["mediawiki.ui.icon","d4fyb"],["mediawiki.widgets","1jppb",[48,174,206,216]],["mediawiki.widgets.styles","1kqtv"],["mediawiki.widgets.AbandonEditDialog","1qv1d",[211]],["mediawiki.widgets.DateInputWidget","17wo9",[177,38,206,227]],["mediawiki.widgets.DateInputWidget.styles","v2g8d"],["mediawiki.widgets.visibleLengthLimit","uj2nl",[27,203]],["mediawiki.widgets.datetime","1mxgx",[88,203,222,226,227]],["mediawiki.widgets.expiry","1xp7z",[179,38,206]],["mediawiki.widgets.CheckMatrixWidget","bbszi",[203]],["mediawiki.widgets.CategoryMultiselectWidget","fr599",[57,206]],["mediawiki.widgets.SelectWithInputWidget","yjlkr",[184,206]],["mediawiki.widgets.SelectWithInputWidget.styles","4wtw6"],["mediawiki.widgets.SizeFilterWidget","1ht3s",[186,206]],["mediawiki.widgets.SizeFilterWidget.styles","b3yqn"],[
"mediawiki.widgets.MediaSearch","18dlo",[57,206]],["mediawiki.widgets.Table","1vxru",[206]],["mediawiki.widgets.TagMultiselectWidget","1mwuq",[206]],["mediawiki.widgets.UserInputWidget","1555z",[48,206]],["mediawiki.widgets.UsersMultiselectWidget","1h6xp",[48,206]],["mediawiki.widgets.NamespacesMultiselectWidget","jiviu",[206]],["mediawiki.widgets.TitlesMultiselectWidget","593ki",[173]],["mediawiki.widgets.TagMultiselectWidget.styles","1hdc9"],["mediawiki.widgets.SearchInputWidget","haq07",[74,173,222]],["mediawiki.widgets.SearchInputWidget.styles","176ja"],["mediawiki.watchstar.widgets","12mms",[202]],["mediawiki.deflate","glf6m"],["oojs","1ch6v"],["mediawiki.router","ajk4o",[201]],["oojs-router","3j2x4",[199]],["oojs-ui","1gvrd",[209,206,211]],["oojs-ui-core","y3pnc",[112,199,205,204,213]],["oojs-ui-core.styles","ijoc2"],["oojs-ui-core.icons","s3euz"],["oojs-ui-widgets","r4cj7",[203,208]],["oojs-ui-widgets.styles","7tf34"],["oojs-ui-widgets.icons","1qv5j"],["oojs-ui-toolbars","hleq3"
,[203,210]],["oojs-ui-toolbars.icons","vjnbt"],["oojs-ui-windows","va15m",[203,212]],["oojs-ui-windows.icons","jdo4c"],["oojs-ui.styles.indicators","dx7t6"],["oojs-ui.styles.icons-accessibility","aymn6"],["oojs-ui.styles.icons-alerts","mh1i3"],["oojs-ui.styles.icons-content","1e3rd"],["oojs-ui.styles.icons-editing-advanced","1fisb"],["oojs-ui.styles.icons-editing-citation","1kwa3"],["oojs-ui.styles.icons-editing-core","d7p5d"],["oojs-ui.styles.icons-editing-list","u1nbk"],["oojs-ui.styles.icons-editing-styling","cq71p"],["oojs-ui.styles.icons-interactions","1byl9"],["oojs-ui.styles.icons-layout","13ato"],["oojs-ui.styles.icons-location","w3uik"],["oojs-ui.styles.icons-media","17wz9"],["oojs-ui.styles.icons-moderation","11alw"],["oojs-ui.styles.icons-movement","6due7"],["oojs-ui.styles.icons-user","12u19"],["oojs-ui.styles.icons-wikimedia","hwe5s"],["skins.vector.user","1xvcb",[],0],["skins.vector.user.styles","1gxes",[],0],["skins.vector.search","1tkv8!",[85,43]],[
"skins.vector.styles.legacy","19veb"],["skins.vector.styles","1kz7n"],["skins.vector.icons.js","1f1is"],["skins.vector.icons","1x573"],["skins.vector.es6","9he0d!",[93,123,124,86,235]],["skins.vector.js","r9gz2",[123,235]],["skins.vector.legacy.js","1li6r",[123]],["skins.monobook.styles","zpxzv"],["skins.monobook.scripts","glb5a",[86,215]],["skins.modern","10ioi"],["skins.cologneblue","eaifj"],["skins.timeless","rsgv2"],["skins.timeless.js","poasm"],["ext.timeline.styles","poumc"],["ext.wikihiero","129wi"],["ext.wikihiero.special","djmbz",[247,29,203]],["ext.wikihiero.visualEditor","d1kzb",[441]],["ext.charinsert","4sxcx",[34]],["ext.charinsert.styles","ou48j"],["ext.cite.styles","1lb4h"],["ext.cite.style","yx4l1"],["ext.cite.visualEditor.core","1aq9b",[449]],["ext.cite.visualEditor","9ja3e",[253,252,254,215,218,222]],["ext.cite.ux-enhancements","11f2g"],["ext.citeThisPage","1rb6k"],["ext.inputBox.styles","14cr4"],["ext.pygments","1u9pi"],["ext.pygments.linenumbers","zyy6j"],[
"ext.geshi.visualEditor","16uth",[441]],["ext.categoryTree","12fll",[48]],["ext.categoryTree.styles","1ho9u"],["ext.spamBlacklist.visualEditor","ovffn"],["mediawiki.api.titleblacklist","6nhct",[48]],["ext.titleblacklist.visualEditor","1taqb"],["mw.PopUpMediaTransform","340aa",[281,76,284]],["mw.TMHGalleryHook.js","11rpk"],["ext.tmh.embedPlayerIframe","1ybhf",[286,284]],["mw.MediaWikiPlayerSupport","1p0go",[284]],["mw.MediaWikiPlayer.loader","scrqo",[286]],["ext.tmh.video-js","1xn38"],["ext.tmh.videojs-ogvjs","r5nu3",[282,272]],["ext.tmh.player","1eaze",[281,277,76]],["ext.tmh.player.dialog","bt0x9",[276,211]],["ext.tmh.player.inline","1ql9o",[272,76]],["ext.tmh.player.styles","jqwum"],["ext.tmh.thumbnail.styles","hrhb9"],["ext.tmh.transcodetable","qysvh",[48,202]],["ext.tmh.timedtextpage.styles","8t06n"],["ext.tmh.OgvJsSupport","1rgvj"],["ext.tmh.OgvJs","1tz99",[281]],["embedPlayerIframeStyle","2hl6r"],["mw.MwEmbedSupport","432l5",[88]],["mediawiki.UtilitiesTime","sobvx"],[
"jquery.embedPlayer","3n73h"],["mw.EmbedPlayer","1dnws",[281,21,25,37,85,285,115,289,284]],["mw.EmbedPlayerKplayer","9brbg"],["mw.EmbedPlayerNative","fkawj"],["mw.EmbedPlayerVLCApp","iihbe",[85]],["mw.EmbedPlayerIEWebMPrompt","k2n9t"],["mw.EmbedPlayerOgvJs","183ok",[281,29]],["mw.EmbedPlayerImageOverlay","1ihz4"],["mw.TimedText","147im",[117,287]],["ext.urlShortener.special","cyon8",[85,62,173,202]],["ext.urlShortener.toolbar","1wlu3",[48]],["ext.securepoll.htmlform","9l7jw",[29,190]],["ext.securepoll","7ece9"],["ext.securepoll.special","lvyc3"],["ext.score.visualEditor","1tpzs",[301,441]],["ext.score.visualEditor.icons","y5pvy"],["ext.score.popup","cebyg",[48]],["ext.score.errors","s56a4"],["ext.cirrus.serp","6fxwx",[85,200]],["ext.cirrus.explore-similar","1ij99",[48,46]],["ext.nuke.confirm","1itba",[115]],["ext.confirmEdit.editPreview.ipwhitelist.styles","1hytm"],["ext.confirmEdit.visualEditor","dqe95",[969]],["ext.confirmEdit.simpleCaptcha","13qx3"],[
"ext.confirmEdit.fancyCaptcha.styles","kxycq"],["ext.confirmEdit.fancyCaptcha","1dz3b",[48]],["ext.confirmEdit.fancyCaptchaMobile","1dz3b",[500]],["ext.centralauth","1bgnl",[29,88]],["ext.centralauth.centralautologin","eb423",[115]],["ext.centralauth.centralautologin.clearcookie","1kb7x"],["ext.centralauth.misc.styles","157rq"],["ext.centralauth.globaluserautocomplete","1ik8f",[31,48]],["ext.centralauth.globalrenameuser","1maty",[88]],["ext.centralauth.ForeignApi","1tkmh",[58]],["ext.widgets.GlobalUserInputWidget","1bs9f",[48,206]],["ext.GlobalUserPage","ibfm1"],["ext.apifeatureusage","ohwd2"],["ext.dismissableSiteNotice","1tqui",[21,88]],["ext.dismissableSiteNotice.styles","1psm7"],["ext.centralNotice.startUp","1ptwd",[327]],["ext.centralNotice.geoIP","spv2q",[21]],["ext.centralNotice.choiceData","q64bi",[331]],["ext.centralNotice.display","up6v4",[326,329,642,85,75]],["ext.centralNotice.kvStore","yqh2i"],["ext.centralNotice.bannerHistoryLogger","qedmi",[328]],[
"ext.centralNotice.impressionDiet","n5zrg",[328]],["ext.centralNotice.largeBannerLimit","p2grr",[328]],["ext.centralNotice.legacySupport","1kh3o",[328]],["ext.centralNotice.bannerSequence","q58r6",[328]],["ext.centralNotice.freegeoipLookup","1ab6b",[326]],["ext.centralNotice.impressionEventsSampleRate","1kg37",[328]],["ext.centralNotice.cspViolationAlert","1arm3"],["ext.wikimediamessages.contactpage.affcomchapthorg","1ukrj"],["ext.wikimediamessages.contactpage.affcomusergroup","168yb"],["mediawiki.special.block.feedback.request","yglzq"],["ext.collection","1l010",[343,37,112]],["ext.collection.bookcreator.styles","1tk4t"],["ext.collection.bookcreator","macvf",[342,75,88]],["ext.collection.checkLoadFromLocalStorage","4crv1",[341]],["ext.collection.suggest","1wfr5",[343]],["ext.collection.offline","1bnwx"],["ext.collection.bookcreator.messageBox","1gvrd",[349,348,60]],["ext.collection.bookcreator.messageBox.styles","utfnk"],["ext.collection.bookcreator.messageBox.icons","4yd6p"],[
"ext.ElectronPdfService.print.styles","13dj6"],["ext.ElectronPdfService.special.styles","1q6mi"],["ext.ElectronPdfService.special.selectionImages","qem34"],["ext.advancedSearch.initialstyles","1mr14"],["ext.advancedSearch.styles","15jsx"],["ext.advancedSearch.searchtoken","1vhat",[],1],["ext.advancedSearch.elements","1km28",[354,85,86,206,222,223]],["ext.advancedSearch.init","170rl",[356,355]],["ext.advancedSearch.SearchFieldUI","1h395",[76,206]],["ext.abuseFilter","6lhiu"],["ext.abuseFilter.edit","13rna",[29,34,48,50,206]],["ext.abuseFilter.tools","1yw3k",[29,48]],["ext.abuseFilter.examine","1az7d",[29,48]],["ext.abuseFilter.ace","67phm",[625]],["ext.abuseFilter.visualEditor","148wm"],["pdfhandler.messages","1n82m"],["ext.wikiEditor","sfzfp",[34,37,118,86,173,217,218,219,220,221,225,45],3],["ext.wikiEditor.styles","3kdjm",[],3],["ext.wikiEditor.realtimepreview","1yass",[366,125]],["ext.CodeMirror","lf2hh",[370,34,37,86,221]],["ext.CodeMirror.data","1r8p9"],["ext.CodeMirror.lib",
"12rli"],["ext.CodeMirror.addons","18r8x",[371]],["ext.CodeMirror.mode.mediawiki","vl3og",[371]],["ext.CodeMirror.lib.mode.css","12rkf",[371]],["ext.CodeMirror.lib.mode.javascript","kv1z9",[371]],["ext.CodeMirror.lib.mode.xml","1n718",[371]],["ext.CodeMirror.lib.mode.htmlmixed","12m9d",[374,375,376]],["ext.CodeMirror.lib.mode.clike","1eahy",[371]],["ext.CodeMirror.lib.mode.php","19ek6",[378,377]],["ext.CodeMirror.visualEditor.init","1pesf"],["ext.CodeMirror.visualEditor","1fqt4",[441]],["ext.MassMessage.styles","yqa78"],["ext.MassMessage.special.js","gysrf",[27,35,37,115]],["ext.MassMessage.content.js","gn56m",[20,37,48]],["ext.MassMessage.create","igvel",[37,62,115]],["ext.MassMessage.edit","1k1lh",[178,202]],["ext.uploadWizard.page","dmxs3",[391],4],["ext.uploadWizard.page.styles","hi1gv"],["ext.uploadWizard.uploadCampaign.display","jogv3"],["uw.EventFlowLogger","me1f9",[199],5],["ext.uploadWizard","9l46c",[28,29,50,94,54,65,119,86,173,182,176,215,217,219,222,224,226,390],4],[
"mediasearch.styles","1dty8"],["mediasearch","19tdf",[40,392,57,75,86,41,15]],["ext.betaFeatures","1dfn3",[18,203]],["ext.betaFeatures.styles","8xj2r"],["ext.GWToolset","7lqo7",[29,37]],["mmv","19wk1",[19,23,36,85,402]],["mmv.ui.ondemandshareddependencies","qzh6b",[397,202]],["mmv.ui.download.pane","1wqlm",[166,173,398]],["mmv.ui.reuse.shareembed","1la1k",[173,398]],["mmv.ui.tipsyDialog","tk9ym",[397]],["mmv.bootstrap","htny5",[170,172,404,201]],["mmv.bootstrap.autostart","1bp9m",[402]],["mmv.head","f0dls",[75,86]],["ext.linter.edit","h2pbf",[34]],["socket.io","fcmug"],["dompurify","cw5fe"],["color-picker","1hxf4"],["unicodejs","alrva"],["papaparse","5tm70"],["rangefix","ekvqx"],["spark-md5","1uk2w"],["ext.visualEditor.supportCheck","hzrm9",[],6],["ext.visualEditor.sanitize","1snr7",[407,430],6],["ext.visualEditor.progressBarWidget","1ns9r",[],6],["ext.visualEditor.tempWikitextEditorWidget","151cl",[94,86],6],["ext.visualEditor.desktopArticleTarget.init","18nor",[415,413,416,427,34,85,
123,75],6],["ext.visualEditor.desktopArticleTarget.noscript","wmadm"],["ext.visualEditor.targetLoader","1s3bz",[429,427,34,85,75,86],6],["ext.visualEditor.desktopTarget","1lk2x",[],6],["ext.visualEditor.desktopArticleTarget","oictp",[433,438,420,443],6],["ext.visualEditor.collabTarget","1paqc",[431,437,94,173,222,223],6],["ext.visualEditor.collabTarget.desktop","1fvqe",[422,438,420,443],6],["ext.visualEditor.collabTarget.init","1sgot",[413,173,202],6],["ext.visualEditor.collabTarget.init.styles","18e9s"],["ext.visualEditor.ve","1mbx1",[],6],["ext.visualEditor.track","1lfjv",[426],6],["ext.visualEditor.core.utils","fkgtc",[427,202],6],["ext.visualEditor.core.utils.parsing","1584k",[426],6],["ext.visualEditor.base","51brd",[428,429,409],6],["ext.visualEditor.mediawiki","1ytcn",[430,419,32,669],6],["ext.visualEditor.mwsave","1r7le",[441,27,29,53,222],6],["ext.visualEditor.articleTarget","1ioq4",[442,432,175],6],["ext.visualEditor.data","djggw",[431]],["ext.visualEditor.core","74kgf",[414,
413,18,410,411,412],6],["ext.visualEditor.commentAnnotation","vvma3",[435],6],["ext.visualEditor.rebase","7l1o6",[408,452,436,228,406],6],["ext.visualEditor.core.desktop","127qa",[435],6],["ext.visualEditor.welcome","k180i",[202],6],["ext.visualEditor.switching","136a5",[48,202,214,217,219],6],["ext.visualEditor.mwcore","1jk4k",[453,431,440,439,130,73,10,173],6],["ext.visualEditor.mwextensions","1gvrd",[434,464,457,459,444,461,446,458,447,449],6],["ext.visualEditor.mwextensions.desktop","1gvrd",[442,448,82],6],["ext.visualEditor.mwformatting","139um",[441],6],["ext.visualEditor.mwimage.core","1xo1s",[441],6],["ext.visualEditor.mwimage","1ch6a",[445,187,38,225,229],6],["ext.visualEditor.mwlink","1aui8",[441],6],["ext.visualEditor.mwmeta","4nqx1",[447,108],6],["ext.visualEditor.mwtransclusion","1oal4",[441,190],6],["treeDiffer","ylkzm"],["diffMatchPatch","1f0tq"],["ext.visualEditor.checkList","17b0s",[435],6],["ext.visualEditor.diffing","1qcbz",[451,435,450],6],[
"ext.visualEditor.diffPage.init.styles","11pe4"],["ext.visualEditor.diffLoader","1un0a",[419],6],["ext.visualEditor.diffPage.init","1adaq",[455,202,214,217],6],["ext.visualEditor.language","5blra",[435,669,117],6],["ext.visualEditor.mwlanguage","1ucrg",[435],6],["ext.visualEditor.mwalienextension","1i211",[441],6],["ext.visualEditor.mwwikitext","s0yaf",[447,94],6],["ext.visualEditor.mwgallery","9vuvx",[441,121,187,225],6],["ext.visualEditor.mwsignature","18e03",[449],6],["ext.visualEditor.experimental","1gvrd",[],6],["ext.visualEditor.icons","1gvrd",[465,466,215,216,217,219,220,221,222,223,226,227,228,213],6],["ext.visualEditor.moduleIcons","6ft35"],["ext.visualEditor.moduleIndicators","1vxt1"],["ext.citoid.visualEditor","eol1g",[255,468]],["ext.citoid.visualEditor.data","zugge",[431]],["ext.citoid.wikibase.init","8dvhj"],["ext.citoid.wikibase","1fcrm",[469,37,202]],["ext.templateData","1t2ui"],["ext.templateDataGenerator.editPage","1mtwk"],["ext.templateDataGenerator.data","196in",[
199]],["ext.templateDataGenerator.editTemplatePage","8fvwg",[471,475,473,34,669,48,206,211,222,223,226]],["ext.templateData.images","k0ymw"],["ext.TemplateWizard","1jxpj",[34,173,176,190,209,211,222]],["ext.wikiLove.icon","1c1zm"],["ext.wikiLove.startup","by1r0",[37,48,170]],["ext.wikiLove.local","psm3n"],["ext.wikiLove.init","1y0df",[478]],["mediawiki.libs.guiders","1l1fg"],["ext.guidedTour.styles","d0h2x",[481,170]],["ext.guidedTour.lib.internal","1uwi4",[88]],["ext.guidedTour.lib","sbcuo",[642,483,482]],["ext.guidedTour.launcher","6pn6x"],["ext.guidedTour","13bf4",[484]],["ext.guidedTour.tour.firstedit","1fgpr",[486]],["ext.guidedTour.tour.test","1jpds",[486]],["ext.guidedTour.tour.onshow","1md6f",[486]],["ext.guidedTour.tour.uprightdownleft","p83px",[486]],["mobile.pagelist.styles","191j1"],["mobile.pagesummary.styles","1kwqc"],["mobile.placeholder.images","d6esn"],["mobile.userpage.styles","jz4wg"],["mobile.startup.images","1983o"],["mobile.init.styles","x1mvo"],["mobile.init",
"1vmw8",[85,500]],["mobile.ooui.icons","1pzgm"],["mobile.user.icons","1gfit"],["mobile.startup","mp8ig",[35,124,200,75,46,170,172,86,498,491,492,493,495]],["mobile.editor.overlay","1smeh",[50,94,67,171,175,502,500,499,202,219]],["mobile.editor.images","wfxsa"],["mobile.talk.overlays","oxhfl",[169,501]],["mobile.mediaViewer","149jl",[500]],["mobile.languages.structured","hftdv",[500]],["mobile.special.mobileoptions.styles","1g0pj"],["mobile.special.mobileoptions.scripts","wh13m",[500]],["mobile.special.nearby.styles","pt0l6"],["mobile.special.userlogin.scripts","1rm8n"],["mobile.special.nearby.scripts","4rqmw",[85,508,500]],["mobile.special.mobilediff.images","1sw4x"],["skins.minerva.base.styles","5fl1j"],["skins.minerva.content.styles.images","1oojh"],["skins.minerva.icons.loggedin","1nypb"],["skins.minerva.amc.styles","8zh2z"],["skins.minerva.overflow.icons","15f9y"],["skins.minerva.icons.wikimedia","37d33"],["skins.minerva.icons.images.scripts.misc","1uiku"],[
"skins.minerva.icons.page.issues.uncolored","1rea5"],["skins.minerva.icons.page.issues.default.color","1fdjj"],["skins.minerva.icons.page.issues.medium.color","l4bw4"],["skins.minerva.mainPage.styles","rawid"],["skins.minerva.userpage.styles","juhd4"],["skins.minerva.talk.styles","18sa5"],["skins.minerva.personalMenu.icons","1brfr"],["skins.minerva.mainMenu.advanced.icons","lfbh9"],["skins.minerva.mainMenu.icons","19pyg"],["skins.minerva.mainMenu.styles","crld4"],["skins.minerva.loggedin.styles","5kzqc"],["skins.minerva.scripts","16n0n",[85,93,169,500,518,520,521,519,527,528,531]],["skins.minerva.messageBox.styles","czo5c"],["skins.minerva.categories.styles","1plbi"],["ext.math.styles","1v9c1"],["ext.math.scripts","16fem"],["mw.widgets.MathWbEntitySelector","amyw4",[57,173,759,211]],["ext.math.visualEditor","12uvp",[533,441]],["ext.math.visualEditor.mathSymbolsData","ltjso",[536]],["ext.math.visualEditor.mathSymbols","1tj2q",[537]],["ext.math.visualEditor.chemSymbolsData","ar9ku",[536]
],["ext.math.visualEditor.chemSymbols","r7qo8",[539]],["ext.babel","16oqx"],["ext.translate","l9w3r"],["ext.translate.base","1g7m5",[48]],["ext.translate.dropdownmenu","1iyql"],["ext.translate.specialpages.styles","11yms"],["ext.translate.loader","99tf1"],["ext.translate.messagetable","b9v49",[543,546,551,85]],["ext.translate.pagetranslation.uls","53l29",[659]],["ext.translate.edit.documentation","8jmkw",[206,211]],["ext.translate.edit.documentation.styles","o89na"],["ext.translate.parsers","r5h25",[88]],["ext.translate.quickedit","wz3du"],["ext.translate.selecttoinput","194te"],["ext.translate.special.languagestats","1iujn",[32,48,206]],["ext.translate.messagerenamedialog","1h859",[206,211]],["ext.translate.groupselector","1as75",[543,546,568,37]],["ext.translate.editor","k90v0",[543,544,28,34,85,94,86]],["ext.translate.special.managetranslatorsandbox.styles","g4vp0"],["ext.translate.special.pagemigration","24p6q",[48,166,170]],["ext.translate.special.pagepreparation","rpyyw",[48,53,
166]],["ext.translate.special.searchtranslations","180vt",[557,556,659]],["ext.translate.special.translate","x80qo",[557,556,547,669,75]],["ext.translate.special.translate.styles","18sw5"],["ext.translate.specialTranslationStash","1bubs",[557,547,659]],["ext.translate.special.translationstats","12ghs",[567,179]],["ext.translate.translationstats.embedded","3bcgj",[567]],["ext.translate.translationstats.graphbuilder.js","1jj2d",[48]],["ext.translate.statsbar","1hpik"],["ext.translate.statstable","1obok"],["ext.translate.tag.languages","1adwu"],["ext.translate.special.aggregategroups","1o87z",[37,48]],["ext.translate.special.importtranslations","us1ru",[37]],["ext.translate.special.managetranslatorsandbox","1g37o",[546,659,37]],["ext.translate.special.searchtranslations.operatorsuggest","1qc0g",[37]],["ext.translate.special.pagetranslation","emxjj",[85,170,173]],["ext.translate.special.managegroups","qaduc",[555]],["ext.translate.ve","1fald",[441]],[
"ext.translationnotifications.notifytranslators","1ttvz",[37,85,86]],["ext.translationnotifications.translatorsignup","ll3h2"],["ext.vipsscaler","5smlp",[581]],["jquery.ucompare","1w08f"],["ext.interwiki.specialpage","pge0w"],["ext.echo.logger","18jip",[86,199]],["ext.echo.ui.desktop","1gssv",[590,585]],["ext.echo.ui","85m0d",[586,583,964,206,215,216,222,226,227,228]],["ext.echo.dm","1bfmy",[589,38]],["ext.echo.api","wqab8",[57]],["ext.echo.mobile","g25f4",[585,200,46]],["ext.echo.init","1u3o0",[587]],["ext.echo.styles.badge","19gi8"],["ext.echo.styles.notifications","16fds"],["ext.echo.styles.alert","dce45"],["ext.echo.special","12b13",[594,585]],["ext.echo.styles.special","1djtg"],["ext.thanks.images","103j4"],["ext.thanks","mqgir",[48,92]],["ext.thanks.corethank","152tn",[596,20,211]],["ext.thanks.mobilediff","15xmd",[595,500]],["ext.thanks.flowthank","hptio",[596,211]],["ext.flow.contributions","1cyi3"],["ext.flow.contributions.styles","rx8lo"],["ext.flow.templating","1irde",[605,
86,38]],["ext.flow.mediawiki.ui.form","a0n6w"],["ext.flow.styles.base","1s3zc"],["mediawiki.template.handlebars","1uj4u",[45]],["ext.flow.components","1ez0r",[613,602,35,85,199]],["ext.flow.dm","q0zhg",[48,199]],["ext.flow.ui","gtwpg",[607,611,413,94,75,86,202,217,220,228]],["ext.flow","1ha9n",[606,612,608]],["ext.flow.visualEditor","1aqlt",[611,438,420,443,460]],["ext.flow.visualEditor.icons","1mo93"],["ext.flow.jquery.conditionalScroll","15yer"],["ext.flow.jquery.findWithParent","ihgvx"],["ext.disambiguator","1ltfs!",[48,67]],["ext.disambiguator.visualEditor","aqsjf",[448]],["ext.discussionTools.init.styles","1du29"],["ext.discussionTools.init","1bzz9",[616,429,85,75,86,38,211,411]],["ext.discussionTools.debug","1utlc",[617]],["ext.discussionTools.ReplyWidget","48pik",[969,617,175,178,206]],["ext.discussionTools.ReplyWidgetPlain","bal4k",[619,440,94]],["ext.discussionTools.ReplyWidgetVisual","rfxv9",[619,433,462,460]],["ext.codeEditor","v0khv",[623],3],["jquery.codeEditor","byuo7",[
625,624,366,211],3],["ext.codeEditor.icons","mpdks"],["ext.codeEditor.ace","1nct8",[],7],["ext.codeEditor.ace.modes","5rdce",[625],7],["ext.scribunto.errors","1k506",[37]],["ext.scribunto.logs","kr527"],["ext.scribunto.edit","1lvk4",[29,48]],["ext.RevisionSlider.lazyCss","hjlz2"],["ext.RevisionSlider.lazyJs","cqh11",[634,227]],["ext.RevisionSlider.init","fvevk",[634,635,226]],["ext.RevisionSlider.noscript","1fgu3"],["ext.RevisionSlider.Settings","7m4kh",[75,86]],["ext.RevisionSlider.Slider","1patb",[636,37,85,38,202,222,227]],["ext.RevisionSlider.dialogImages","5uj3c"],["ext.TwoColConflict.SplitJs","bndc5",[639,640,73,75,86,202,222]],["ext.TwoColConflict.SplitCss","1yrn4"],["ext.TwoColConflict.Split.TourImages","5h5fk"],["ext.TwoColConflict.Util","17tmk"],["ext.TwoColConflict.JSCheck","1kalq"],["ext.eventLogging","g514l",[86]],["ext.eventLogging.debug","aryjb"],["ext.eventLogging.jsonSchema","uo1an"],["ext.eventLogging.jsonSchema.styles","125zq"],["ext.wikimediaEvents","ydlq5",[642,85,
93,75,95]],["ext.wikimediaEvents.wikibase","8bkyv",[642,93]],["ext.navigationTiming","1a7ql",[642]],["ext.uls.common","1ukz5",[669,75,86]],["ext.uls.compactlinks","vq2j4",[649,170]],["ext.uls.ime","1xepw",[659,667]],["ext.uls.displaysettings","jwiel",[651,658,167,168]],["ext.uls.geoclient","ijzbu",[92]],["ext.uls.i18n","37yzm",[26,88]],["ext.uls.interface","he130",[665]],["ext.uls.interlanguage","1ylyh"],["ext.uls.languagenames","juked"],["ext.uls.languagesettings","7ifid",[660,661,670,170]],["ext.uls.mediawiki","joiy0",[649,657,660,665,668]],["ext.uls.messages","15kzc",[654]],["ext.uls.preferences","w4ber",[75,86]],["ext.uls.preferencespage","39jcv"],["ext.uls.pt","oavu8"],["ext.uls.setlang","1pv59",[85,48,170]],["ext.uls.webfonts","yefw5",[661]],["ext.uls.webfonts.repository","llohn"],["jquery.ime","1wgdk"],["jquery.uls","1v3z2",[26,669,670]],["jquery.uls.data","p81me"],["jquery.uls.grid","cnek2"],["rangy.core","1sbtu"],["ext.FileImporter.SpecialJs","1djml",[48,202]],[
"ext.FileImporter.SpecialCss","6grg3"],["ext.FileImporter.Images","qluje"],["wikibase.client.init","16uxb"],["wikibase.client.miscStyles","6yl1g"],["wikibase.client.linkitem.init","geh0s",[29]],["jquery.wikibase.linkitem","kw70o",[29,36,37,57,759,758,975]],["wikibase.client.action.edit.collapsibleFooter","znjul",[28,65,75]],["SpecialConstraintReportPage","6tazx",[204]],["wikibase.quality.constraints.icon","cb8hb"],["wikibase.quality.constraints.ui","1q41z",[28,206,760]],["wikibase.quality.constraints.gadget","pxyun",[48,215,681,682],null,null,"return!mw.config.exists('wbEntityId')||mw.config.get('wgMFMode')||!mw.config.get('wbIsEditView');"],["wikibase.quality.constraints.suggestions","1o0sm",[761]],["mediawiki.template.mustache+dom","1d1xi",[46]],["wikibase.mediainfo.base","1a4dz",[203]],["wikibase.mediainfo.readme","1vwhc",[686,685]],["wikibase.mediainfo.uls","157xe",[659,206]],["wikibase.mediainfo.getDeserializer","2cvv2",[690]],[
"wikibase.mediainfo.serialization.MediaInfoDeserializer","19xt6",[791]],["wikibase.mediainfo.filePageDisplay","1rpx7",[109,219,227,692,693]],["wikibase.mediainfo.filepage.styles","v0kuv"],["wikibase.mediainfo.statements","pakhm",[685,817,211,222,224,810,686,694,688,791,766]],["wikibase.mediainfo.statements.styles","165bx"],["ext.wikimediaBadges","xxzpt"],["ext.TemplateSandbox.top","1lfwo"],["ext.TemplateSandbox","16kj6",[696]],["ext.TemplateSandbox.visualeditor","sf8j7",[173,202]],["ext.jsonConfig","ung4s"],["ext.jsonConfig.edit","t0qa8",[34,188,211]],["ext.graph.styles","ghik1"],["ext.graph.data","lnpu6"],["ext.graph.loader","1rnlv",[48]],["ext.graph.vega1","8dzub",[702,85]],["ext.graph.vega2","a8el9",[702,85]],["ext.graph.sandbox","e2bnd",[622,705,50]],["ext.graph.visualEditor","1072e",[702,445,188]],["ext.MWOAuth.styles","mma12"],["ext.MWOAuth.AuthorizeDialog","5xi0x",[37]],["ext.oath.totp.showqrcode","b22bu"],["ext.oath.totp.showqrcode.styles","5iqin"],["ext.webauthn.ui.base",
"aquki",[115,202]],["ext.webauthn.register","cvoxt",[712,48]],["ext.webauthn.login","9wo3z",[712]],["ext.webauthn.manage","16wxd",[712,48]],["ext.webauthn.disable","1rdca",[712]],["ext.checkUser","12tki",[32,85,71,75,173,217,219,222,224,226,228]],["ext.checkUser.styles","1s9ge"],["ext.guidedTour.tour.checkuserinvestigateform","15adu",[486]],["ext.guidedTour.tour.checkuserinvestigate","12w9i",[717,486]],["ext.quicksurveys.lib","15bza",[642,29,85,93,75]],["ext.quicksurveys.lib.vue","b35l0",[721,42]],["ext.quicksurveys.init","7d3rt"],["ext.kartographer","5d704"],["ext.kartographer.style","12fvq"],["ext.kartographer.site","1n5nk"],["mapbox","1spcu"],["leaflet.draw","rqbqy",[727]],["ext.kartographer.link","wd8as",[731,200]],["ext.kartographer.box","3vmjx",[732,743,726,725,735,85,48,225]],["ext.kartographer.linkbox","1ijfh",[735]],["ext.kartographer.data","1jj2n"],["ext.kartographer.dialog","gscu7",[727,200,206,211,222]],["ext.kartographer.dialog.sidebar","14t0l",[75,222,227]],[
"ext.kartographer.util","1d9jl",[724]],["ext.kartographer.frame","zg7jg",[730,200]],["ext.kartographer.staticframe","1n23r",[731,200,225]],["ext.kartographer.preview","y6o47"],["ext.kartographer.editing","1oqrk",[48]],["ext.kartographer.editor","1gvrd",[730,728]],["ext.kartographer.visualEditor","75vxo",[735,441,224]],["ext.kartographer.lib.prunecluster","1mdne",[727]],["ext.kartographer.lib.topojson","1em2u",[727]],["ext.kartographer.wv","14ibw",[742,219]],["ext.kartographer.specialMap","19ibl"],["ext.pageviewinfo","9mu3h",[705,202]],["ext.3d","1qcqu",[29]],["ext.3d.styles","1p924"],["mmv.3d","14hp3",[747,397]],["mmv.3d.head","y7cpb",[747,203,214,216]],["ext.3d.special.upload","b1fz9",[752,155]],["ext.3d.special.upload.styles","u2y0d"],["ext.GlobalPreferences.global","95i41",[173,181,191]],["ext.GlobalPreferences.global-nojs","f4960"],["ext.GlobalPreferences.local-nojs","lra5j"],["ext.MachineVision.init","1iohe"],["ext.MachineVision","1lo7k",[642,685,206,211,41,810,791,766]],[
"mw.config.values.wbSiteDetails","dfozq"],["mw.config.values.wbRepo","18lj4"],["wikibase","medaf"],["jquery.wikibase.entityselector","41jsy",[783,782]],["jquery.wikibase.toolbar.styles","14gpd"],["wikibase.common","onmxf"],["wikibase.templates","1xito"],["wikibase.entityChangers.EntityChangersFactory","9qec7",[760,810,791]],["wikibase.utilities.ClaimGuidGenerator","1txib",[792,760]],["wikibase.view.__namespace","v05s8",[760]],["wikibase.view.ReadModeViewFactory","15wvm",[769]],["wikibase.view.ControllerViewFactory","1iq0y",[772,773,29,976,793,761,818,759,202,781,809,977,791,827,764,766,767]],["wikibase.datamodel","bg6il",[784]],["dataValues","1x9qh"],["jquery.animateWithEvent","m5zes"],["jquery.inputautoexpand","qjpzz",[783]],["jquery.ui.commonssuggester","c5ffu",[782,781]],["jquery.ui.languagesuggester","9idpd",[782]],["util.ContentLanguages","8cpdw",[792]],["util.Extendable","1t66e"],["util.MessageProvider","1t74e"],["util.MessageProviders","1wgjx"],["util.Notifier","1yswp"],[
"util.highlightSubstring","7zp51"],["jquery.ui.suggester","44kwp",[37,792]],["jquery.event.special.eachchange","1htxs"],["dataValues.DataValue","1flhc",[771,792]],["dataValues.values","yrpso",[786]],["dataValues.TimeValue","ublw8",[784]],["valueFormatters","175oc",[792]],["valueParsers","1vv43"],["valueParsers.ValueParserStore","19cy7",[788]],["valueParsers.parsers","anxub",[785,788]],["wikibase.serialization","xeln2",[785,770]],["util.inherit","z0abd"],["jquery.valueview","1mukq",[784,37,805,798,787,789]],["jquery.valueview.Expert","1wczi",[777,779,780,792]],["jquery.valueview.experts.CommonsMediaType","19l88",[774,802]],["jquery.valueview.experts.GeoShape","1m184",[774,802]],["jquery.valueview.experts.TabularData","1dxue",[774,802]],["jquery.valueview.experts.EmptyValue","1y5dn",[794]],["jquery.valueview.experts.GlobeCoordinateInput","bwpsm",[806,802,778]],["jquery.valueview.experts.MonolingualText","4zdme",[775,806,802]],["jquery.valueview.experts.QuantityInput","lmd4h",[782,806,802
]],["jquery.valueview.experts.StringValue","9qiet",[773,794]],["jquery.valueview.experts.TimeInput","1cemv",[786,806,778]],["jquery.valueview.experts.UnDeserializableValue","1utrk",[794]],["jquery.valueview.ExpertStore","1hxut",[794]],["jquery.valueview.ExpertExtender","hyq4v",[772,783,793]],["wikibase.tainted-ref","1ssos",[39]],["jquery.wikibase.wbtooltip","1lygh",[36,37,809]],["wikibase.buildErrorOutput","jvpsi",[760]],["wikibase.api.RepoApi","1xgrf",[57,86]],["wikibase.api.ValueCaller","1tx95",[784,810]],["wikibase.formatters.ApiValueFormatter","7zbiv",[787,760]],["wikibase.experts.__namespace","evopy",[760]],["wikibase.experts.Entity","1b6oz",[802,761,759,813]],["wikibase.experts.Item","3lh2e",[814]],["wikibase.experts.Property","6esqn",[814]],["mw.config.values.wbDataTypes","1m4gi"],["mw.config.values.wbRefTabsEnabled","mru1o"],["wikibase.entityPage.entityLoaded","1ygqx",[85,760]],["wikibase.EntityInitializer","196yu",[760,791]],["wikibase.getUserLanguages","ffn5j",[760]],[
"wikibase.ui.entityViewInit","2inbf",[804,762,808,124,817,790,820,967,811,765,826,812,821,768]],["wikibase.ui.entitysearch","bpdte",[29,761]],["wikibase.special.newEntity","18c5g"],["wikibase.special.mergeItems","1bvxk"],["wikibase.experts.modules","1yney",[795,796,797,815,816,799,800,801,803]],["wikibase.sites","hwcm0",[758,760,975]],["wikibase.federatedPropertiesLeavingSiteNotice","1qwmx",[202]],["wikibase.federatedPropertiesEditRequestFailureNotice","vgllt",[202]],["ext.centralauth.globalrenamequeue","18igp"],["ext.centralauth.globalrenamequeue.styles","z2t5w"],["ext.gadget.Gallerypreview","qyj4y",[88],2],["ext.gadget.Slideshow","1xjr7",[21,88],2],["ext.gadget.ZoomViewer","froaz",[88],2],["ext.gadget.CollapsibleTemplates","1240v",[88],2],["ext.gadget.popups","1gepn",[86],2],["ext.gadget.fastcci","1q3fq",[76],2],["ext.gadget.edittop","cxotd",[88],2],["ext.gadget.addsection-plus","125r9",[],2],["ext.gadget.OldEdittools","dz1ds",[],2],["ext.gadget.NoUploadWizard","1xq8p",[88],2],[
"ext.gadget.ImprovedUploadForm","19jbk",[86,0,3],2],["ext.gadget.Watchlist-wo-uploads","72mpr",[],2],["ext.gadget.VIAFDataImporter","n5z4t",[88],2],["ext.gadget.HidePostEdit","1iv1e",[],2],["ext.gadget.CropTool","nll5e",[85],2],["ext.gadget.VideoCutTool","1s5ct",[85],2],["ext.gadget.ImageMapEdit","vmcxk",[],2],["ext.gadget.Favorites","16jci",[86],2],["ext.gadget.RotateLink","n9va4",[86],2],["ext.gadget.RenameLink","1h9ow",[896],2],["ext.gadget.CategoryAboveAll","xg5ea",[],2],["ext.gadget.CategoryAboveBelowImage","o6zjx",[],2],["ext.gadget.Long-Image-Names-in-Categories","120kz",[],2],["ext.gadget.GlobalUsageUI","l2nsb",[938,932,36],2],["ext.gadget.DisableImageAnnotator","7e5kp",[],2],["ext.gadget.GalleryFilterExtension","fl3ot",[123],2],["ext.gadget.LargerGallery","68itd",[3],2],["ext.gadget.Hide-Captions","1yia5",[],2],["ext.gadget.Compact-Captions","3dk47",[],2],["ext.gadget.Collapse-Captions","1s4bc",[28],2],["ext.gadget.HideStructuredDataTab","bu2tk",[],2],["ext.gadget.ACDC",
"1pxif",[13],2],["ext.gadget.Stockphoto","1q545",[86],2],["ext.gadget.UTCLiveClock","qnw76",[48],2],["ext.gadget.UTCLiveClock-pagestyles","k5ik9",[],2],["ext.gadget.LocalLiveClock","dj67l",[],2],["ext.gadget.search-new-tab","1klen",[],2],["ext.gadget.diffGreenBlue","1avrp",[],2],["ext.gadget.DiffOldStyle","173ov",[],2],["ext.gadget.PrettyLog","199dj",[88],2],["ext.gadget.ExtraTabs2","19jae",[88],2],["ext.gadget.rightsfilter","19mhb",[88],2],["ext.gadget.contribsrange","1i2cm",[88,29],2],["ext.gadget.WatchlistNotice","s850y",[],2],["ext.gadget.historyNumbered","hlnan",[],2],["ext.gadget.ThreadedDiscussions","jnfj3",[],2],["ext.gadget.typographyrefreshoverride","1n3sd",[],2],["ext.gadget.markAdmins","1n2w4",[88],2],["ext.gadget.Wdsearch","109qr",[],2],["ext.gadget.advanced-search","ex68f",[],2],["ext.gadget.MyGallery","1oe88",[938],2],["ext.gadget.linkscount","1exdw",[],2],["ext.gadget.scrollUpButton","1hjxj",[],2],["ext.gadget.externalsearch","1pc0p",[112],2],[
"ext.gadget.TabularImportExport","1ilb4",[202,48,34],2],["ext.gadget.Infobox","2oqh0",[],2],["ext.gadget.MoreMenu-local","66fx4",[48],2],["ext.gadget.fuzzyeverywhere","bxn4a",[48],2],["ext.gadget.uploadWizardMobile","jv4yx",[],2],["ext.gadget.ThumbnailPurger","y9p7q",[872],2],["ext.gadget.purgetab","1at7y",[48],2],["ext.gadget.GalleryDetails","axx4h",[88],2],["ext.gadget.AddInformation","7pu70",[],2],["ext.gadget.WhatIsThat","sgodk",[88],2],["ext.gadget.AjaxQuickDelete","16mu7",[86,939,940,938],2],["ext.gadget.QuickDelete","1j5t2",[896],2],["ext.gadget.UserMessages","12zqg",[],2],["ext.gadget.GoogleImagesTineye","17v1f",[88],2],["ext.gadget.RegexMenuFramework","1y32k",[88],2],["ext.gadget.VisualFileChange","sxmuo",[86,3],2],["ext.gadget.Cat-a-lot","1i3ub",[88],2],["ext.gadget.HotCat","7c3ax",[],2],["ext.gadget.Glamorous","1bsll",[88],2],["ext.gadget.Searchnotincat","1mxsq",[88],2],["ext.gadget.CatScan2-link","tti4s",[88],2],["ext.gadget.Geocodecattodo","zp99r",[88],2],[
"ext.gadget.WikiMiniAtlas","8njxm",[],2],["ext.gadget.LocatorTool","2bazw",[88],2],["ext.gadget.BiDiEditing","1qz36",[],2],["ext.gadget.ShortLink","1c32g",[88],2],["ext.gadget.EoMagicalConversion","yt85q",[],2],["ext.gadget.MyLangNotify","cf17m",[],2],["ext.gadget.LanguageSelect","1lf6y",[86,0,3],2],["ext.gadget.DeferredDisplay","ptqey",[],2],["ext.gadget.QInominator","17m5f",[],2],["ext.gadget.QICvote","1c70o",[48,202],2],["ext.gadget.DelReqHandler","bxdgx",[946,88],2],["ext.gadget.instantDelete","1dxld",[88],2],["ext.gadget.autodel","drjy0",[946,896,947],2],["ext.gadget.CleanDeleteReasons","1ketz",[],2],["ext.gadget.LicenseReview","19035",[],2],["ext.gadget.PermissionOTRS","1e8hu",[88],2],["ext.gadget.RTRC","1itgq",[88],2],["ext.gadget.modrollback","jvar3",[88],2],["ext.gadget.botRollback","16kgf",[88],2],["ext.gadget.UdelReqHandler","xsgjz",[88],2],["ext.gadget.EditRequest","j7ddp",[939],2],["ext.gadget.Restore-a-lot","h2aqw",[88,37],2],["ext.gadget.userRightsManager","aml8i",[],2],
["ext.gadget.ProveIt","jn8px",[48,21,34,37],2],["ext.gadget.GlobalUsage","10tfq",[48,945],2],["ext.gadget.SettingsUI","14fcn",[37,86,940],2],["ext.gadget.SettingsManager","1u3iv",[86],2],["ext.gadget.editDropdown","yu6r1",[86],2],["ext.gadget.JStack","1nfyx",[],2],["ext.gadget.libAPI","111as",[86],2],["ext.gadget.libUtil","36a3h",[88],2],["ext.gadget.libCommons","jq08p",[],2],["ext.gadget.libJQuery","1ib1w",[],2],["ext.gadget.libWikiDOM","8n0jl",[88],2],["ext.gadget.libGlobalReplace","15f4r",[941,938],2],["ext.gadget.libCat","85o2f",[941,937],2],["ext.gadget.progressDialog","10zu4",[],2],["ext.gadget.jquery.badge","zgb5x",[],2],["ext.gadget.jquery.blockUI","1h7i5",[],2],["ext.gadget.jquery.in-view","183s5",[],2],["ext.gadget.jquery.fullscreen","b0ipk",[],2],["ext.gadget.jquery.mousewheel","1mppu",[],2],["ext.gadget.jquery.rotate","2h4s4",[],2],["ext.gadget.ImageStack","1xobw",[949],2],["ext.gadget.CommonsDashboard","snz5w",[],2],["ext.gadget.WatchlistNotice.core","vd8sv",[75,934],2],[
"ext.gadget.jquery.jqplot","1v88i",[],2],["ext.gadget.math.seedrandom","10u93",[],2],["ext.gadget.POTYEnhancements.core","alob6",[88,0,37],2],["ext.gadget.VisualFileChange.core","7ks4j",[],2],["ext.gadget.VisualFileChange.ui","14dgq",[],2],["ext.gadget.VisualFileChange.exec","gw4dk",[],2],["ext.gadget.VisualFileChange.cfg","ug2d4",[],2],["ext.gadget.AnonymousI18N","k4tg9",[],2],["ext.guidedTour.tour.firsteditve","muzw7",[486]],["ext.echo.emailicons","1ut1u"],["ext.echo.secondaryicons","1ru3m"],["ext.guidedTour.tour.flowOptIn","naw7r",[486]],["ext.wikimediaEvents.visualEditor","7jlvn",[419]],["wikibase.WikibaseContentLanguages","1dccb",[657,776,760]],["wikibase.special.languageLabelDescriptionAliases","djnut",[202,977]],["ext.confirmEdit.CaptchaInputWidget","1qawk",[203]],["ext.globalCssJs.user","1son6",[],0,"metawiki"],["ext.globalCssJs.user.styles","1son6",[],0,"metawiki"],["ext.guidedTour.tour.RcFiltersIntro","d8lrr",[486]],["ext.guidedTour.tour.WlFiltersIntro","y3nea",[486]],[
"ext.guidedTour.tour.RcFiltersHighlight","1xgce",[486]],["wikibase.Site","78xgv",[659]],["jquery.util.getDirectionality","1bdtc",[659]],["wikibase.getLanguageNameByCode","1xcsw",[659,760]],["mediawiki.messagePoster","fp4uv",[57]]]);mw.config.set(window.RLCONF||{});mw.loader.state(window.RLSTATE||{});mw.loader.load(window.RLPAGEMODULES||[]);queue=window.RLQ||[];RLQ=[];RLQ.push=function(fn){if(typeof fn==='function'){fn();}else{RLQ[RLQ.length]=fn;}};while(queue[0]){RLQ.push(queue.shift());}NORLQ={push:function(){}};}());}
mw.loader.implement("jquery.spinner@yoa8f",function($,jQuery,require,module){(function(){var defaults={id:undefined,size:'small',type:'inline'};$.extend({createSpinner:function(opts){var i,$spinner,$container;if(typeof opts==='string'){opts={id:opts};}opts=$.extend({},defaults,opts);$spinner=$('<div>').addClass('mw-spinner').attr('title','...');if(opts.id!==undefined){$spinner.attr('id','mw-spinner-'+opts.id);}$spinner.addClass(opts.size==='large'?'mw-spinner-large':'mw-spinner-small').addClass(opts.type==='block'?'mw-spinner-block':'mw-spinner-inline');$container=$('<div>').addClass('mw-spinner-container').appendTo($spinner);for(i=0;i<12;i++){$container.append($('<div>'));}return $spinner;},removeSpinner:function(id){return $('#mw-spinner-'+id).remove();}});$.fn.injectSpinner=function(opts){return this.after($.createSpinner(opts));};}());});mw.loader.implement("jquery.spinner.styles@pfek7",null,{"css":[
".mw-spinner{position:relative}.mw-spinner \u003E .mw-spinner-container{transform-origin:0 0}.mw-spinner-small{width:20px;height:20px}.mw-spinner-small \u003E .mw-spinner-container{transform:scale(0.3125)}.mw-spinner-large{width:32px;height:32px}.mw-spinner-large \u003E .mw-spinner-container{transform:scale(0.5)}.mw-spinner-block{display:block;width:100%;text-align:center}.mw-spinner-block \u003E .mw-spinner-container{display:inline-block;vertical-align:top}.mw-spinner-block.mw-spinner-small \u003E .mw-spinner-container{min-width:20px}.mw-spinner-block.mw-spinner-large \u003E .mw-spinner-container{min-width:32px}.mw-spinner-inline{display:inline-block;vertical-align:middle} .mw-spinner-container \u003E div{transform-origin:32px 32px;animation:mw-spinner 1.2s linear infinite}.mw-spinner-container \u003E div:after{content:' ';display:block;position:absolute;top:3px; left:29px;width:5px;height:14px;border-radius:20%;background:#000}.mw-spinner-container \u003E div:nth-child(1){transform:rotate(0deg);animation-delay:-1.1s}.mw-spinner-container \u003E div:nth-child(2){transform:rotate(30deg);animation-delay:-1s}.mw-spinner-container \u003E div:nth-child(3){transform:rotate(60deg);animation-delay:-0.9s}.mw-spinner-container \u003E div:nth-child(4){transform:rotate(90deg);animation-delay:-0.8s}.mw-spinner-container \u003E div:nth-child(5){transform:rotate(120deg);animation-delay:-0.7s}.mw-spinner-container \u003E div:nth-child(6){transform:rotate(150deg);animation-delay:-0.6s}.mw-spinner-container \u003E div:nth-child(7){transform:rotate(180deg);animation-delay:-0.5s}.mw-spinner-container \u003E div:nth-child(8){transform:rotate(210deg);animation-delay:-0.4s}.mw-spinner-container \u003E div:nth-child(9){transform:rotate(240deg);animation-delay:-0.3s}.mw-spinner-container \u003E div:nth-child(10){transform:rotate(270deg);animation-delay:-0.2s}.mw-spinner-container \u003E div:nth-child(11){transform:rotate(300deg);animation-delay:-0.1s}.mw-spinner-container \u003E div:nth-child(12){transform:rotate(330deg);animation-delay:0s}@keyframes mw-spinner{0%{opacity:1}100%{opacity:0}}"
]});

mw.loader.implement("ext.gadget.AjaxQuickDelete@16mu7",function($,jQuery,require,module){(function(){'use strict';if(window.AjaxQuickDelete){return;}var AQD,conf=mw.config.get(['wgArticleId','wgCanonicalNamespace','wgCanonicalSpecialPageName','wgCategories','wgFormattedNamespaces','wgNamespaceNumber','wgPageName','wgRestrictionEdit','wgUserGroups','wgUserLanguage','wgUserName','wgIsRedirect']),nsNr=conf.wgNamespaceNumber,pageName=conf.wgPageName;function _firstItem(o){for(var i in o){if(Object.prototype.hasOwnProperty.call(o,i)){return o[i];}}}$.ucFirst=function(s){return s[0].toUpperCase()+s.slice(1);};AQD=window.AjaxQuickDelete={version:'1.1.3',preinstall:function(){if(conf.wgCanonicalSpecialPageName==='Movepage'&&Number($('select[name="wpNewTitleNs"]').val())===6){$('#mw-movepage-table').before('<div class="warningbox">Consider using <i>Move & Replace</i> from the menu on file pages (open with a single click) when moving files to care for global usage and redirects.</div>');}this.
doNothing=(!conf.wgArticleId||nsNr<0||/^Commons:Deletion/.test(pageName));if(this.doNothing){return;}if(conf.wgUserGroups.indexOf('sysop')!==-1){this.userRights='sysop';}else if(conf.wgUserGroups.indexOf('filemover')!==-1){this.userRights='filemover';}else{this.userRights=['autopatrolled','patroller','image-reviewer'].filter(function(g){return conf.wgUserGroups.indexOf(g)!==-1;})[0];}if(['filemover','sysop'].indexOf(this.userRights)!==-1&&nsNr===6){var $moveLink=$('#ca-move'),$moveLanchor=$moveLink.find('a');this.$moveLink=$moveLink=$moveLanchor.length?$moveLanchor:$moveLink;$moveLink.text($moveLink.text()+' & Replace').attr('title','Click in order to '+$moveLink.attr('title')+' and replace usage. Default form though new tab.').on('click',function(e){e.preventDefault();AQD.moveFile();});}},install:function(){if(this.doNothing){return;}if(conf.wgRestrictionEdit&&conf.wgRestrictionEdit.length&&conf.wgUserGroups.indexOf(conf.wgRestrictionEdit[0])===-1){return;}$(document).triggerHandler(
'scriptLoaded',['AjaxQuickDelete']);var link;if(nsNr===14){link=mw.util.addPortletLink('p-tb','#',this.i18n.toolboxLinkDiscuss,'t-ajaxquickdiscusscat');if(link){link.addEventListener('click',function(e){e.preventDefault();mw.loader.using('jquery.ui').then(function(){AQD.discussCategory();});});}}else{link=mw.util.addPortletLink('p-tb','#',this.i18n.toolboxLinkDelete,'t-ajaxquickdelete');if(link){link.addEventListener('click',function(e){e.preventDefault();AQD.nominateForDeletion();});}}if(this.$moveLink){this.$moveLink.html($('<span>').text(this.i18n.dropdownMove));$('#AjaxRenameLink').append('<a href="javascript:AjaxQuickDelete.moveFile();">'+this.i18n.moveAndReplace+'</a>').append('<a href="javascript:AjaxQuickDelete.loadAndDeclineRequest(\'move\');" class="ajaxDeleteDeclineMove"><sup> '+this.i18n.anyDecline+'</sup></a>');$('#mw-imagepage-content .convert-to-dr').find('.ctdr-btn-convert').on('click',this._convertToDR).show().end().find('.ctdr-btn-remove').on('click',this.
_removeAnyTag).show();}else if(this.userRights){$('#mw-imagepage-content .convert-to-dr .ctdr-btn-convert').on('click',this._convertToDR).show();}if(this.userRights==='sysop'&&nsNr===6){var dupeSection=$('#AjaxDupeProcess');if(dupeSection.length){dupeSection.append($('<a>',{href:'#',text:this.i18n.processDupes,style:'font-weight:bold',click:function(e){e.preventDefault();AQD.processDupes();}})).show();}else{dupeSection=$('#mw-imagepage-section-duplicates .mw-imagepage-duplicates');if(dupeSection.length){dupeSection.find('li:first').append($('<span>',{style:'display:none',id:'AjaxDupeDestination',text:dupeSection.find('a').attr('title')})).append(' ',$('<sup>').append($('<a>',{href:'#',text:'['+this.i18n.processDupes+']',style:'background:#CEB',click:function(e){e.preventDefault();AQD.processDupes();}})));}}}mw.loader.using('user',function(){if(mw.user.options.get('gadget-QuickDelete')){mw.loader.using('ext.gadget.QuickDelete').always(function(){AQD.doInsertTagButtons();});}});},
initialize:function(){pageName=conf.wgPageName;this.tasks=[];this.destination=undefined;this.details=undefined;this.declineReason=undefined;this.notifyUser=true;this.watchlist='preferences';},fileExists:function(){this.i18n.moveDestination=this.i18n.moveOtherDestination;this.moveFile();},moveFile:function(){var o=this;o.initialize();mw.loader.using(['jquery.ui']).then(function(){o.showProgress();if($('#AjaxRenameLink').length){o.possibleDestination=$('#AjaxRenameDestination').text();o.possibleReason=o.cleanReason($('#AjaxRenameReason').text());}o.addTask('getMoveToken');var linkstoimage=$('#mw-imagepage-section-linkstoimage');if($('#globalusage').length||(linkstoimage.length&&linkstoimage.find('a').not('.mw-redirect').length-linkstoimage.find('.mw-imagepage-linkstoimage-ns2 a[href^="/wiki/User:OgreBot/Uploads"]').length)){o.inUse=true;o.addTask('chkPreMoveDecline');}o.addTask('promptForMoveTarget');o.addTask('doesFileExist');o.fileNameExistsCB='fileExists';o.addTask('movePage');o.
addTask('removeTemplate');o.addTask('queryRedirects');o.addTask('replaceUsage');o.addTask('reloadPage');o.nextTask();});},promptForMoveTargetCB:function(AQD){if(AQD.inUse){$('#AjaxQuestion2').prop('disabled',true);}},promptForMoveTarget:function(){var toAppend;this.showProgress();if(mw.user.options.get('gadget-RenameLink')){toAppend=[$('<a>').text(this.i18n.moreInformation).on('click',function(){if(!AQD.rGetPolicy){importScript('MediaWiki:RenameRequest.js');mw.hook('aqd.renamerequest.i18n').fire();}mw.hook('aqd.renamerequest.run').fire({exec:this});}).button({icons:{primary:'ui-icon-script'},showLabel:true,text:false}).css({fontSize:'.6em',margin:'0',width:'2.5em','float':'right'}),'<br>'];}mw.hook('aqd.prompt').remove(this.promptForMoveTargetCB).add(this.promptForMoveTargetCB);this.prompt([{message:this.i18n.moveDestination,prefill:this.cleanFileName(this.possibleDestination||pageName),returnvalue:'destination',appendNode:toAppend,cleanUp:true,noEmpty:true},{message:this.i18n.
reasonForMove,prefill:((this.reason||this.possibleReason||'').trim().replace(/'{2,}/g,'').replace(/\s{2,}/g,' ')),returnvalue:'reason',cleanUp:true,noEmpty:false},{message:this.i18n.leaveRedirect,prefill:true,returnvalue:'wpLeaveRedirect',noEmpty:false,type:'checkbox'},{message:this.i18n.useCORSForReplace,prefill:!window.aqdCORSOptOut,returnvalue:'replaceUsingCORS',noEmpty:false,type:'checkbox'}],this.i18n.movingFile);},chkPreMoveDecline:function(){$('#mw-imagepage-section-linkstoimage').find('a').each(function(){if($(this).text()==='Commons:File renaming/Recently declined rename requests'){alert(AQD.i18n.warnRename);return false;}});this.nextTask();},loadAndDeclineRequest:function(reason){var that=this;mw.loader.using('jquery.ui').then(function(){that.declineRequest.call(that,reason);});},declineRequest:function(reason){reason=reason||this.declineReason;this.initialize();this.addTask('getMoveToken');this.addTask('removeTemplate');this.addTask('reloadPage');switch(reason){case'move':
reason='rename request declined: does not comply with [[COM:FR|renaming guidelines]]';if(window.AjaxDeclineMoveWatchFile){this.watchlist='watch';}break;}this.prompt([{message:'',prefill:reason||'',returnvalue:'declineReason',cleanUp:false,noEmpty:true,byteLimit:250}],this.i18n.declineRequest);},insertTagOnPage:function(tag,img_summary,talk_tag,talk_summary,prompt_text,page,optin_notify){var o=this;this.initialize();mw.loader.using(['jquery.ui'],function(){o.pageName=(page||pageName).replace(/_/g,' ');o.tag=tag.replace('%USER%',conf.wgUserName)+'\n';o.img_summary=img_summary;o.addTask('findCreator');o.addTask('prependTemplate');if(o.isMobile()&&/(?:copyvio|nsd|npd|nld)/.test(tag)){o.addTask('listMobileUploadSpeedy');}var prompt=[];if(talk_tag&&talk_tag!=='undefined'){o.talk_tag=talk_tag.replace('%FILE%',o.pageName);o.talk_summary=talk_summary.replace('%FILE%','[[:'+o.pageName+']]');o.usersNeeded=true;prompt.push({message:o.i18n.notifyUser,prefill:true,returnvalue:'notifyUser',type:
'checkbox'});o.addTask('notifyUploaders');}o.addTask('reloadPage');if(tag.indexOf('%PARAMETER%')!==-1){prompt.push({message:'',prefill:'',returnvalue:'reason',cleanUp:true,noEmpty:true,minLength:1});o.prompt(prompt,prompt_text||o.i18n.reasonForDeletion);}else if(optin_notify&&prompt.length&&o.talk_summary){o.prompt(prompt,o.talk_summary);}else{o.nextTask();}});},discussCategory:function(){this.initialize();this.pageName=pageName.replace(/_/g,' ');this.startDate=new Date();this.tag='<!-- BEGIN CFD TEMPLATE -->
<!-- Please do not remove or change this [[Template:Cfd]] message until the survey and discussion at [[WP:Cfd]] is closed -->
{{Cfd full|day=20|month=March|year=2022|startmonth=March|startyear=2022|1=|type=deletion }}<!-- End of Cfd message, feel free to edit beyond this point. -->
<!-- END CFD TEMPLATE -->\n';this.img_summary='This category needs discussion';this.talk_tag='{{subst:cdw|1='+pageName+'}}';this.talk_summary='[[:'+pageName+']] needs discussion';this.subpage_summary='Starting category discussion';this.requestPage='Commons:Categories for discussion/'+this.formatDate('YYYY/MM/')+pageName;this.dailyLogPage='Commons:Categories for discussion/'+this.formatDate('YYYY/MM');this.addTask('findCreator');this.addTask('prependTemplate');this.addTask('createRequestSubpage');this.addTask(
'listRequestSubpage');this.addTask('notifyUploaders');this.addTask('reloadPage');var lazyLoadNode=this.createLazyLoadNode(this.i18n.moreInformation,'MediaWiki:Gadget-AjaxQuickDelete.js/DiscussCategoryInfo','#AjaxQuickDeleteCatInfo');this.prompt([{message:'',prefill:'',returnvalue:'reason',cleanUp:true,appendNode:lazyLoadNode,noEmpty:true,parseReason:true}],this.i18n.reasonForDiscussion);},nominateForDeletion:function(page){var o=this;this.initialize();mw.loader.using(['mediawiki.String','jquery.ui'],function(){o.pageName=(page||pageName).replace(/_/g,' ');o.startDate=new Date();var requestPage=o.pageName,mwString=require('mediawiki.String');while(mwString.byteLength(requestPage)+mwString.byteLength(o.requestPagePrefix.replace(/^.+?:/,''))>=255){requestPage=requestPage.slice(0,requestPage.length-1).trim();}o.requestPage=o.requestPagePrefix+requestPage;o.dailyLogPage=o.requestPagePrefix+o.formatDate('YYYY/MM/DD');o.tag='{{delete|reason=%PARAMETER%|subpage='+requestPage+o.formatDate(
'|year=YYYY|month=MON|day=DAY}}\n');switch(nsNr){case 8:o.tag='/*'+o.tag+'*/';break;case 10:case 100:case 106:o.tag='<noinclude>'+o.tag+'</noinclude>';break;case 828:o.tag='\n--[=[ '+o.tag+' ]=]\n';}if(o.templateReplace){o.declineReason=o.img_summary;}o.img_summary='Nominating for deletion';o.talk_tag='== File:&#39;+requestPage+&#39; listed for discussion ==
[[File:Information.svg|30px|left]] A file that you uploaded or altered, [[:File:&#39;+requestPage+&#39;]], has been listed at [[Wikipedia:Files for discussion]]. Please see the [[Wikipedia:Files for discussion/2022 March 20#File:&#39;+requestPage+&#39;|'''discussion''']] to see why it has been listed (you may have to search for the title of the image to find its entry). Feel free to add your opinion on the matter below the nomination. Thank you. <!-- Template:Fdw -->';o.talk_summary='[[:'+o.pageName+']] has been nominated for deletion';o.subpage_summary='Starting deletion request';if(conf.wgIsRedirect){o.tag+='\n';}o.addTask('findCreator');o.addTask(o.templateReplace?'replaceTemplate':'prependTemplate');o.addTask('createRequestSubpage');o.addTask('listRequestSubpage');o.addTask('purge');o.addTask('notifyUploaders');if(o.isMobile()){o.addTask('listMobileUpload');}o.addTask('reloadPage');var lazyLoadNode=o.createLazyLoadNode(o.i18n.moreInformation,'MediaWiki:Gadget-AjaxQuickDelete.js/DeleteInfo','#AjaxQuickDeleteDeleteInfo');o.prevDRNode=$('<ul>').attr('id','AjaxDeletePrevRequests');o.secureCall('checkForFormerDR');var
toAppend=$('<div>').append($('<div>').attr('class','ajaxDeleteLazyLoad').css({'max-height':Math.max(Math.round($(window).height()/2)-250,100),'min-height':0,overflow:'auto'}).append(o.prevDRNode),'<br>',lazyLoadNode);o.prompt([{message:'',prefill:o.reason||'',returnvalue:'reason',cleanUp:true,noEmpty:true,appendNode:toAppend,parseReason:true}],o.i18n.reasonForDeletion);});},checkForFormerDR:function(){if(nsNr%2===0){this.talkPage=conf.wgFormattedNamespaces[nsNr+1]+':'+this.pageName.replace(conf.wgCanonicalNamespace+':','');this.queryAPI({prop:'templates',titles:this.talkPage,tltemplates:'Template:Kept',tllimit:1},'formerDRTalk');}this.queryAPI({list:'backlinks',bltitle:this.pageName,blnamespace:4,blfilterredir:'nonredirects',bllimit:500},'formerDRRequestpage');},formerDRTalk:function(r){var pgs=r.query.pages;$.each(pgs,function(id,pg){if(Array.isArray(pg.templates)){$('<li>').append($('<a>',{text:AQD.i18n.keptAfterDR,href:mw.util.getUrl(AQD.talkPage)})).prependTo(AQD.prevDRNode);}else
if(pg.missing===undefined){$('<li>').append($('<a>',{text:AQD.i18n.hasTalkpage,href:mw.util.getUrl(AQD.talkPage)})).appendTo(AQD.prevDRNode);}});},formerDRRequestpage:function(r){var bls=r.query.backlinks,_addItem=function(t,m,bl){$('<li>').append($('<a>',{text:t.replace('%PAGE%',bl.title),href:mw.util.getUrl(bl.title)}))[m](AQD.prevDRNode);};$.each(bls,function(i,bl){if(this.requestPage===bl.title){_addItem(AQD.i18n.mentionedInDR,'prependTo',bl);}else if(/^Commons:Deletion requests\/\D/.test(bl.title)){_addItem(AQD.i18n.mentionedInDR,'appendTo',bl);}else if(/^Commons:Village pump\//.test(bl.title)){_addItem(AQD.i18n.mentionedInForum,'appendTo',bl);}});},renderNode:function($node,remotecontent,selector){if(selector){selector=' '+selector;}$node.load(mw.util.wikiScript()+'?'+$.param({action:'render',title:remotecontent,uselang:conf.wgUserLanguage})+(selector||''),function(){$node.find('a').attr('href',function(i,v){return v.replace('MediaWiki:Anoneditwarning',conf.wgPageName);});});
return $node;},createLazyLoadNode:function(label,page,selector){return $('<div>',{style:'min-height:40px;'}).append($('<a>',{href:'#',text:label}).on('click',function(e){e.preventDefault();var $content=$(this).parent().find('.ajaxDeleteLazyLoad'),$contentInner=$content.find('.ajax-quick-delete-loading');if($contentInner.length){AQD.renderNode($content,$contentInner.data('aqdPage'),selector);}$content.toggle('fast');}),$('<div>',{'class':'ajaxDeleteLazyLoad',style:'display:none;'}).append($('<span>',{'class':'ajax-quick-delete-loading',text:this.i18n.loading}).data('aqdPage',page)));},extractFromHTML:function($el){$el=$($el).parent();this.templateRegExp=$el.find('.ctdr-regex').text();var m=this.templateRegExp.match(/^\/(.+)\/(i)?$/);if(!m||!m[1]){m=new Error(this.i18n.templateRegExp);this.fail(m);throw m;}this.templateRegExp=new RegExp(m[1],m[2]);this.declineReason=$el.find('.ctdr-template-decline-reason').text();m=$el.find('.ctdr-template-name').text();this.reason=
'This file was initially tagged by %USER%'+(m?(' as \'\'\''+m+'\'\'\''):'');},removeProgress:function(){this.showProgress();return this.nextTask();},_removeAnyTag:function(e){AQD.extractFromHTML(e.currentTarget||this);AQD.removeAnyTag();return false;},removeAnyTag:function(){this.addTask('declineRequest');this.nextTask();},_convertToDR:function(e){e=e.currentTarget||this;AQD.extractFromHTML(e);AQD.convertToDR(e);return false;},convertToDR:function(el){this.initialize();this.declineReason='This file does not qualify for [[COM:SPEEDY|speedy-deletion]] and a regular deletion request will be started.';this.templateReplace=true;this.addTask('findTemplateAdder');this.addTask('getMoveToken');this.addTask('removeTemplate');this.addTask('removeProgress');this.addTask('nominateForDeletion');$(el).closest('.convert-to-dr').hide();this.nextTask();},findTemplateAdder:function(){var query={prop:'revisions',rvprop:'content|user',titles:pageName.replace(/_/g,' '),rvlimit:50};this.queryAPI(query,
'findTemplateAdderCB');},findTemplateAdderCB:function(result){var reason,user,pgRevs,template;$.each(result.query.pages,function(id,pg){pgRevs=pg.revisions;pgRevs.forEach(function(rv){var m=rv['*'].match(AQD.templateRegExp);if(m){user=rv.user;if(m.length>1&&!template){template=m[1];}if(m.length>2&&!reason){reason=m[2];}}else{return false;}});});if(!user){mw.log.warn(pgRevs);throw new Error(this.i18n.findTemplateAdderErr);}this.reason=this.reason.replace('%USER%','[[User:'+user+'|'+user+']]');if(template){this.reason+=' ('+template+')';}if(reason){this.reason+=' and the most recent rationale was: <tt>'+reason+'</tt>';}this.nextTask();},processDupes:function(){this.initialize();if($('#globalusage').length||!$('#mw-imagepage-nolinkstoimage').length){this.inUse=true;}this.addTask('getDupeDetails');this.addTask('compareDetails');this.addTask('mergeDescriptions');this.addTask('saveDescription');this.addTask('replaceUsage');this.addTask('queryRedirects');this.addTask('deletePage');this.
addTask('redirectPage');this.addTask('reloadPage');this.destination=$('#AjaxDupeDestination').text();this.nextTask();},getDupeDetails:function(){this.queryAPI({curtimestamp:1,meta:'tokens',prop:'imageinfo|revisions|info',rvprop:'content|timestamp',inprop:'watched',iiprop:'sha1|size|url',iiurlwidth:365,redirects:1,titles:pageName.replace(/_/g,' ')+'|'+this.destination},'getDupeDetailsCB');this.showProgress('Fetching details');},getDupeDetailsCB:function(result){this.details=[];if(result){var q=result.query,id,pg,ii,n,pages=q.pages;for(id in pages){if(Object.prototype.hasOwnProperty.call(pages,id)){pg=pages[id];if(!pg.imageinfo){this.disableReport=true;throw new Error(((pg.title.trim()==='{{{1}}}')?this.i18n.dupeParaErr:this.i18n.dupeExistErr.replace('%TITLE%',pg.title))+' (pg.imageinfo is undefined)');}ii=pg.imageinfo[0];n={title:pg.title,size:ii.size,width:ii.width,height:ii.height,thumburl:ii.thumburl,thumbwidth:ii.thumbwidth,thumbheight:ii.thumbheight,descriptionurl:ii.descriptionurl
,sha1:ii.sha1,content:pg.revisions[0]['*'],starttimestamp:result.curtimestamp};this.details.push(n);this.csrftoken=q.tokens.csrftoken;if(pg.watched!==undefined){this.pageWasWatched=true;}}}}if(this.details.length<2){this.disableReport=true;throw new Error(this.i18n.noPageFound);}if(this.details[0].title!==pageName.replace(/_/g,' ')){this.details.reverse();}this.nextTask();},prependTemplate:function(){var page={title:this.pageName,text:this.tag,editType:'prependtext',watchlist:window.AjaxDeleteWatchFile?'watch':this.watchlist,minor:false};this.showProgress(this.i18n.addingAnyTemplate);this.savePage(page,this.img_summary,'nextTask');},replaceTemplate:function(text){var page={title:this.destination||pageName,text:text||this.tag+this.pageContent,editType:'text',starttimestamp:this.starttimestamp,timestamp:this.timestamp,watchlist:window.AjaxDeleteWatchFile?'watch':this.watchlist,minor:false};this.templateReplace=false;this.showProgress(this.i18n.addingAnyTemplate);this.savePage(page,(this.
declineReason||this.img_summary),'nextTask');},createRequestSubpage:function(){this.templateAdded=true;var page={title:this.requestPage,text:'\n=== [[:'+this.pageName+']] ===\n'+this.reason+' [[User:DB|DB]] ([[User talk:DB|talk]]) 04:57, 20 March 2022 (UTC)\n',watchlist:'watch',editType:'appendtext'};if(this.isMobile()){page.text+='\n<noinclude>[[Category:MobileUpload-related deletion requests]]</noinclude>';}this.showProgress(this.i18n.creatingNomination);this.savePage(page,this.subpage_summary,'nextTask');},listRequestSubpage:function(){var page={};page.title=this.dailyLogPage;page.text='\n{{'+this.requestPage+'}}\n';page.watchlist='preferences';page.editType='appendtext';this.showProgress(this.i18n.listingNomination);this.savePage(page,'Listing [['+this.requestPage+']]','nextTask');},isMobile:function(){var isMobile=false,cats=conf.wgCategories;for(var i=0,len=cats.length;i<len;i++){isMobile=isMobile||/^Uploaded with Mobile/.test(cats[i]);}return isMobile;},listMobileUpload:function(){var page={title:
'Commons:Deletion requests/mobile tracking',text:'\n{{'+this.requestPage+'}}\n',watchlist:'preferences',editType:'appendtext'};this.showProgress(this.i18n.listingMobile);this.savePage(page,'Listing [['+this.requestPage+']]','nextTask');},listMobileUploadSpeedy:function(){var page={title:'Commons:Mobile app/deletion request tracking',text:'\n# [[:'+this.pageName+']]',watchlist:'preferences',editType:'appendtext'};this.showProgress(this.i18n.listingMobile);this.savePage(page,'Listing [['+this.pageName+']]','nextTask');},verifyUserNotify:function(user){this.queryAPI({prop:'info',titles:this.userTalkPrefix+user,redirects:1,inprop:'protection'},'verifyUserNotifyCB');},verifyUserNotifyCB:function(result){var page;this.notifyUser=true;if(!result||!result.query||!result.query.pages){mw.log.warn('Verify user: result.query.pages is undefined. ',result);return this.uploaderNotified();}result=result.query.pages;for(var pg in result){pg=result[pg];page=pg.title;pg=pg.protection;if(pg){for(var p=0;p
<pg.length;p++){var pt=pg[p];if(pt&&pt.type==='edit'&&pt.level==='sysop'){this.disableReport=true;if(pt.expiry==='infinity'){this.notifyUser=false;}}}}}if(this.notifyUser&&page){page={title:page,text:'\n'+this.talk_tag+' [[User:DB|DB]] ([[User talk:DB|talk]]) 04:57, 20 March 2022 (UTC)\n',editType:'appendtext',redirect:true,minor:false};if(window.AjaxDeleteWatchUserTalk){page.watchlist='watch';}this.savePage(page,this.talk_summary,'uploaderNotified');}else{this.uploaderNotified();}},notifyUploaders:function(){this.uploadersToNotify=0;if(this.notifyUser){for(var user in this.uploaders){if(Object.prototype.hasOwnProperty.call(this.uploaders,user)){if(user===conf.wgUserName){continue;}this.verifyUserNotify(user);this.showProgress(this.i18n.notifyingUploader.replace('%USER%',user));this.uploadersToNotify++;}}}if(!this.uploadersToNotify){this.nextTask();}},uploaderNotified:function(){this.uploadersToNotify--;if(!this.uploadersToNotify){this.nextTask();}},findCreator:function(){var q={curtimestamp:1,meta:'tokens',prop:'revisions',titles:this.pageName,
rvprop:'timestamp|user',rvdir:'newer',rvslots:'main',rvlimit:1};if(nsNr===6){$.extend(q,{prop:q.prop+'|imageinfo',rvprop:q.rvprop+'|content',iiprop:'user|comment|sha1',iilimit:'50',list:'logevents',letype:'import',leprop:'user',letitle:this.pageName});}this.showProgress(this.i18n.preparingToEdit);this.queryAPI(q,'findCreatorCB');},findCreatorCB:function(r){this.uploaders={};if(!r||!r.query||!r.query.pages){this.disableReport=true;throw new Error(this.i18n.noPageFound);}var q=r.query,pg=_firstItem(q.pages),rv;if(!pg||!pg.revisions){throw new Error(this.i18n.noCreatorFound);}this.csrftoken=q.tokens.csrftoken;rv=pg.revisions[0];if(nsNr!==6||!pg.imageinfo){this.starttimestamp=r.curtimestamp;this.timestamp=rv.timestamp;if((this.pageCreator=rv.user)){this.uploaders[this.pageCreator]=true;}}else{var info=pg.imageinfo,i=info.length,content=rv.slots.main['*'],seenHashes={};for(--i;i>=0;i--){var iii=info[i],rev=seenHashes[iii.sha1];if(iii.sha1&&rev){for(rev;rev>i;rev--){var u=info[rev-1].user;if
(this.uploaders[u]<rev){delete this.uploaders[u];}}continue;}seenHashes[iii.sha1]=i+1;if(this.uploaders[iii.user]){continue;}if(mw.libs.commons.isSmallChangesBot(iii.user)){continue;}iii=mw.libs.commons.getUploadBotUser(iii.user,content,iii.comment,rv.user);if(iii){this.uploaders[iii]=i+1;}}if((info=q.logevents)&&(i=info.length)){for(--i;i>=0;i--){if(info[i].user){this.uploaders[info[i].user]=true;}}}}this.nextTask();},getMoveToken:function(){this.showProgress(this.i18n.preparingToEdit);var query={curtimestamp:1,prop:'info|revisions',meta:'tokens',rvprop:'content|timestamp',inprop:'watched',titles:this.pageName||pageName.replace(/_/g,' ')};if(!this.declineReason){query.prop+='|imageinfo';query.iiprop='mediatype|mime|timestamp';}this.queryAPI(query,'getMoveTokenCB');},getMoveTokenCB:function(result){var q=result.query||{},pg=_firstItem(q.pages);if(!pg||!pg.revisions){this.disableReport=true;throw new Error(this.i18n.noPageFound);}$.extend(this,{csrftoken:q.tokens.csrftoken,pageContent:
pg.revisions[0]['*'],starttimestamp:result.curtimestamp,timestamp:pg.revisions[0].timestamp});if(pg.watched!==undefined){this.pageWasWatched=true;}var ii=pg.imageinfo;if(ii&&ii.length&&ii[0].mime){ii=ii[0];this.imagetimestamp=ii.timestamp;this.mimeFileExtension=ii.mime.toLowerCase().replace('image/jpeg','jpg').replace(/image\/(?:x-|vnd\.)?(png|gif|xcf|djvu|svg|tiff)(?:\+xml)?/,'$1').replace(/application\/(ogg|pdf)/,'$1').replace(/video\/(webm)/,'$1').replace('audio/midi','mid').replace(/audio\/(?:x-|vnd\.)?wave?/,'wav').replace(/audio\/(?:x-)?flac/,'flac');if(this.mimeFileExtension.length>5){this.mimeFileExtension='';}else if(this.mimeFileExtension==='ogg'){switch(ii.mediatype){case'AUDIO':this.mimeFileExtension='oga';break;case'VIDEO':this.mimeFileExtension='ogv';break;}}}this.nextTask();},doesFileExist:function(){if(!this.destination){return alert(this.i18n.moveDestination);}this.destination=this.cleanFileName(this.destination);var query={prop:'info|revisions',titles:this.destination
,rvprop:'content',rvlimit:2};this.showProgress(this.i18n.checkFileExists);this.queryAPI(query,'doesFileExistCB');},doesFileExistCB:function(result){if(!result||!result.query||!result.query.pages){throw new Error('Checking filename: result.query.pages is undefined. '+this.destination);}var exists=true,pg=_firstItem(result.query.pages),getRedirRegExp=function(title){title=title.replace(/^(File|Image):/,'').replace(/_/g,' ');return new RegExp('^\\s*#REDIRECT\\s*\\[\\[File\\:['+mw.util.escapeRegExp(title[0].toUpperCase())+mw.util.escapeRegExp(title[0].toLowerCase())+']'+mw.util.escapeRegExp(title.slice(1)).replace(/ /g,'[ _]')+'\\s*\\]\\]','');};if(pg.missing!==undefined){exists=false;}else if(!pg.revisions||pg.revisions.length===1&&getRedirRegExp(pageName).test(pg.revisions[0]['*'].replace('Image:','File:'))){exists=false;}if(exists){if(this.fileNameExistsCB){this[this.fileNameExistsCB](pg.title.replace(/^File:/,''));}return;}this.nextTask();},removeTemplate:function(){this.replaceWith=(
this.replaceWith||(this.templateRegExp?'':'$1$2'));var newText=this.pageContent.replace((this.templateRegExp||/(?:([^=])\n)?\{\{(?:rename|rename media|move)\s*\|.*?\}\}(?:\n([^=]))?/i),this.replaceWith);if(newText===this.pageContent){return this.nextTask();}this.showProgress(this.i18n.removingTemplate);newText=this.pageContent=newText.trim();if(this.templateReplace){this.img_summary=this.declineReason;return this.nextTask();}if(!this.declineReason){this.img_summary='Removing template; rename done';}this.replaceTemplate(newText||'{{Di-no license|date=20 March 2022}}');},replaceUsage:function(){if(!this.inUse){return this.nextTask();}this.showProgress(this.i18n.replacingUsage);var reasonShort='[[COM:Duplicate|Duplicate]]:';if(!this.details){AQD.reason=AQD.reason.replace(/\[\[Commons:File[_ ]renaming[^[\]]*\]\]:? ?/i,'');reasonShort='[[COM:FR|File renamed]]:';}mw.loader.using('ext.gadget.libGlobalReplace',function(){if(AQD.replaceUsingCORS){mw.libs.globalReplace(pageName,AQD.destination,reasonShort,AQD.reason).
fail(function(err){throw new Error(err);}).done(function(){AQD.nextTask();}).progress(function(r){AQD.showProgress(r);mw.log(r);});}else{mw.libs.globalReplaceDelinker(pageName,AQD.destination,reasonShort+' '+AQD.reason,function(){AQD.nextTask();},function(err){throw new Error(err);});}});},redirectPage:function(){var page={title:pageName,text:'#REDIRECT [['+this.destination+']]',editType:'text',watchlist:AQD.pageWasWatched?'watch':'preferences'};this.showProgress(this.i18n.redirectingFile);this.savePage(page,'Redirecting to duplicate file','nextTask');},saveDescription:function(){var page={title:this.destination,text:this.newPageText,editType:'text',watchlist:AQD.pageWasWatched?'watch':'preferences'};this.showProgress(this.i18n.savingDescription);this.savePage(page,'Merging details from duplicate ([['+pageName+']])','nextTask');},queryRedirects:function(){mw.loader.using('mediawiki.api').then(function(){return new mw.Api().loadMessagesIfMissing(['Whatlinkshere']);}).then(function(){AQD
.showProgress(mw.msg('Whatlinkshere'));AQD.queryAPI({generator:'backlinks',gblfilterredir:'redirects',prop:'revisions',rvprop:'content',gbltitle:AQD.pageName||pageName.replace(/_/g,' ')},AQD.queryRedirectsCB?AQD.queryRedirectsCB:'updateRedirects');});},updateRedirects:function(result){AQD.redirectsToUpdate=0;if(result.query&&result.query.pages){this.showProgress(this.i18n.updRedir);$.each(result.query.pages,function(id,pg){var rv=pg.revisions[0];if(!rv||!rv['*']){return;}if(AQD.checkFileExt(pg.title,AQD.destination,true)){return mw.log('Redirect skipped, not same mimetype.',pg.title);}var page={title:pg.title,text:rv['*'].replace(/#\s*REDIRECT\s*\[\[.+/,'#REDIRECT [['+AQD.destination+']]'),editType:'text',watchlist:'preferences'};AQD.savePage(page,'Updating redirect while processing [['+pageName.replace(/_/g,' ')+']]','updateRedirectsCB');AQD.redirectsToUpdate++;});}if(!AQD.redirectsToUpdate){AQD.nextTask();}},updateRedirectsCB:function(){AQD.redirectsToUpdate--;if(!AQD.
redirectsToUpdate){AQD.nextTask();}},prompt:function(questions,title,width){var o=this,dlgButtons={};dlgButtons[this.i18n.submitButtonLabel]=function(){questions.forEach(function(v,i){var response=document.getElementById('AjaxQuestion'+i);response=(v.type==='checkbox')?response.checked:response.value;if(v.cleanUp){if(v.returnvalue==='reason'){response=AQD.cleanReason(response);}if(v.returnvalue==='destination'){response=AQD.cleanFileName(response);}}AQD[v.returnvalue]=response;if(v.returnvalue==='reason'&&AQD.tag){AQD.tag=AQD.tag.replace('%PARAMETER%',response);if(AQD.talk_tag){AQD.talk_tag=AQD.talk_tag.replace('%PARAMETER%',response);}AQD.img_summary=AQD.img_summary.replace('%PARAMETER%',response).replace('%PARAMETER-LINKED%','[[:'+response+']]');}});$(this).dialog('close');AQD.nextTask();};dlgButtons[this.i18n.cancelButtonLabel]=function(){$(this).dialog('close');};var $submitButton,$AjaxDeleteContainer=$('<div>',{id:'AjaxDeleteContainer'}),_parseReason=function(){var $el=$(this),
$parserResultNode=$el.data('parserResultNode');if(!$parserResultNode){return;}$parserResultNode.css('color','#877');var _gotParsedText=function(r){try{$parserResultNode.html(r);$parserResultNode.css('color','#000');}catch(ex){}};mw.loader.using(['ext.gadget.libAPI'],function(){mw.libs.commons.api.parse($el.val(),conf.wgUserLanguage,pageName,_gotParsedText);});},_validateInput=function(event){var $el=$(this),v=$el.data('v');if(v.noEmpty){$submitButton.button('option','disabled',$el.val().trim().length<(v.minLength||8));}if(($el.prop('nodeName')!=='TEXTAREA')&&(event.which===13)&&(v.enterToSubmit!==false)&&!$submitButton.button('option','disabled')){$submitButton.trigger('click');}},_convertToTextarea=function(){var $el=$(this),$input=$el.data('toConvert'),$tarea=$('<textarea>',{id:$input.attr('id'),style:'height:10em; width:98%; display:none;'});$el.off().fadeOut();$input.parent().prepend($tarea.data('v',$input.data('v')).data('parserResultNode',$input.data('parserResultNode')).val(
$input.val()).on('keyup',_parseReason).on('keyup input',_validateInput));$tarea.slideDown();$input.remove();};questions.forEach(function(v,i){v.type=(v.type||'text');if(v.type==='textarea'){$AjaxDeleteContainer.append('<label for="AjaxQuestion'+i+'">'+v.message+'</label>').append('<textarea rows=20 id="AjaxQuestion'+i+'">');}else{$AjaxDeleteContainer.append('<label for="AjaxQuestion'+i+'">'+v.message+'</label>').append('<input type="'+v.type+'" id="AjaxQuestion'+i+'" style="width:97%;">');}var curQuestion=$AjaxDeleteContainer.find('#AjaxQuestion'+i);if(v.parseReason){var $parserResultNode=$('<div>',{id:'AjaxQuestionParse'+i,html:'&nbsp;'});$AjaxDeleteContainer.append('<br><label for="AjaxQuestionParse'+i+'">'+o.i18n.previewLabel+'</label>').append($parserResultNode);curQuestion.data('parserResultNode',$parserResultNode).keyup(_parseReason);}if(v.type!=='textarea'){$AjaxDeleteContainer.append('<br>');}$AjaxDeleteContainer.append(v.appendNode?v.appendNode:'<br>');if(typeof v.byteLimit===
'number'){mw.loader.using('jquery.lengthLimit',function(){curQuestion.byteLimit(v.byteLimit);});}curQuestion.data('v',v);curQuestion.on('keyup input',_validateInput);curQuestion.val(v.prefill);if(v.type==='checkbox'){curQuestion.prop('checked',v.prefill).attr('style','margin-left: 5px');}});if(mw.user.isAnon()){AQD.renderNode($('<div>',{id:'ajaxDeleteAnonwarning'}),'MediaWiki:Anoneditwarning').appendTo($AjaxDeleteContainer);}$('<div>').append($AjaxDeleteContainer).dialog({width:(width||600),modal:true,title:title,dialogClass:'wikiEditor-toolbar-dialog',close:function(){$(this).dialog('destroy').remove();if(AQD.currentTask==='formerDRRequestpage'){mw.util.$content.find('.convert-to-dr').show();}},buttons:dlgButtons,open:function(){var $buttons=$(this).parent().find('.ui-dialog-buttonpane button');$submitButton=$buttons.eq(0).specialButton('proceed');$buttons.eq(1).specialButton('cancel');}});questions.forEach(function(v,i){var curQuestion=$AjaxDeleteContainer.find('#AjaxQuestion'+i);
curQuestion.trigger('keyup');if(v.type==='text'){var $q=curQuestion.wrap('<div style="position:relative;">').parent(),$i=$.createIcon('ui-icon-arrow-4-diag').attr('title',AQD.i18n.expandToTextarea);$('<span>',{'class':'ajaxTextareaConverter'}).append($i).appendTo($q).data('toConvert',curQuestion).on('click',_convertToTextarea);}});$('#AjaxQuestion0').trigger('focus').trigger('select');mw.hook('aqd.prompt').fire(o);},compareDetails:function(){var d=this.details[0],f=this.details[1],$swapButton,$overlayButton;if(d.sha1===f.sha1){this.exactDupes=true;this.nextTask();return;}var $imgD=$('<div>').append($('<img>',{src:d.thumburl,height:d.thumbheight,width:d.thumbwidth}),$('<div>',{id:'AjaxDeleteImgDel',html:Math.round(d.size/1000)+' KiB <br>'+d.width+'×'+d.height+'<br>'}).append($('<a>',{href:d.descriptionurl,text:d.title,target:'_blank'}))),$imgF=$('<div>').append($('<img>',{src:f.thumburl,height:f.thumbheight,width:f.thumbwidth}),$('<div>',{id:'AjaxDeleteImgKeep',html:Math.round(f.size/
1000)+' KiB <br>'+f.width+'×'+f.height+'<br>'}).append($('<a>',{href:f.descriptionurl,text:f.title,target:'_blank'}))),dlgButtons={};dlgButtons[this.i18n.submitButtonLabel]=function(){$(this).dialog('close');AQD.nextTask();};dlgButtons[this.i18n.inverseButtonLabel]=function(){$(this).dialog('close');AQD.destination=pageName.replace(/_/g,' ');pageName=f.title;AQD.details.reverse();AQD.inUse=true;setTimeout(function(){AQD.compareDetails();},20);};dlgButtons[this.i18n.swapImagesButtonLabel]=function(){if($imgD[0].nextSibling===$imgF[0]){$imgD.before($imgF);}else{$imgF.before($imgD);}};var $fClone;dlgButtons[this.i18n.overlayButtonLabel]=function(){if($fClone){$fClone.remove();$fClone=0;}else{$fClone=$imgF.clone().appendTo($imgF.parent());$fClone.css('position','absolute');var pos=$imgD.position();$fClone.css({top:pos.top-1,left:pos.left-1}).fadeTo(0,0.65);mw.loader.using(['jquery.ui'],function(){$fClone.css({background:'rgba(200, 200, 200, 0.5)',width:'auto',border:'1px solid #0c9'}).
draggable();$fClone.find('img').resizable();$fClone.children('div').fadeTo(0,0.7);});}};this.showProgress();var $AjaxDupeContainer=$('<div>',{id:'AjaxDupeContainer'}).append($imgD,$imgF);$('<div>').append($AjaxDupeContainer).dialog({width:800,modal:true,title:this.i18n.compareDetails,draggable:false,dialogClass:'wikiEditor-toolbar-dialog',close:function(){$(this).dialog('destroy').remove();},buttons:dlgButtons,open:function(){var $buttons=$(this).parent().find('.ui-dialog-buttonpane button');$buttons.eq(0).specialButton('proceed');$buttons.eq(1).button({icons:{primary:'ui-icon-refresh'}});$swapButton=$buttons.eq(2).button({icons:{primary:'ui-icon-transfer-e-w'}});$overlayButton=$buttons.eq(3).button({icons:{primary:'ui-icon-newwin'}});$swapButton.css('float',(($swapButton.css('float')==='left')?'right':'left'));$overlayButton.css('float',(($overlayButton.css('float')==='left')?'right':'left'));}});mw.loader.load(['ext.gadget.libGlobalReplace','ext.gadget.libWikiDOM']);},
mergeDescriptions:function(){var newPageText=this.details[1].content;mw.loader.using(['ext.gadget.libGlobalReplace','ext.gadget.libWikiDOM'],function(){newPageText=mw.libs.wikiDOM.nowikiEscaper(newPageText).doCleanUp();AQD.showProgress();AQD.prompt([{message:'',prefill:AQD.details[0].content,returnvalue:'discard',cleanUp:false,noEmpty:false,type:'textarea',enterToSubmit:false},{message:'',prefill:newPageText,returnvalue:'newPageText',cleanUp:false,noEmpty:false,type:'textarea',enterToSubmit:false},{message:AQD.i18n.useCORSForReplace,prefill:!window.aqdCORSOptOut,returnvalue:'replaceUsingCORS',noEmpty:false,type:'checkbox'}],AQD.i18n.mergeDescription,800);AQD.destination=AQD.details[1].title;AQD.reason='Exact or scaled-down duplicate: [[:'+AQD.destination+']]';});},correctMIME:function(fn){var f=fn||this.destination;if(this.mimeFileExtension){f=f.replace(/\.\w{2,5}$/,'.'+this.mimeFileExtension);}if(!fn){this.destination=f;return this.nextTask();}else{return f;}},cleanFileName:function(
fn,ignoreMIME){fn=fn.replace(/^(?:Image|File):/i,'').replace(/(\.\w{2,5})+$/,function($e){return $e.toLowerCase();}).replace(/\.jpe*g$/,'.jpg').replace(/~{3,}/g,'').replace(/[\u00A0\u1680\u180E\u2000-\u200B\u2028\u2029\u202F\u205F\u3000]/,' ').replace(/\s+|_/g,' ').replace(/[\x00-\x1f\x7f]/g,'').replace(/%([0-9A-Fa-f]{2})/g,'% $1').replace(/&(([A-Za-z0-9\x80-\xff]+|#[0-9]+|#x[0-9A-Fa-f]+);)/g,'& $1').replace(/''/g,'"').replace(/[:/|#]/g,'-').replace(/[\]}>]/g,')').replace(/[[{<]/g,'(');fn=this.checkFileExt(pageName,fn,ignoreMIME)||fn;return'File:'+$.ucFirst(fn);},checkFileExt:function(of,fn,ignoreMIME){var currentExt=(!ignoreMIME&&this.mimeFileExtension)?this.mimeFileExtension:of.replace(/.*?\.(\w{2,5})$/,'$1').toLowerCase().replace('jpeg','jpg'),reCurrentExt=new RegExp('\\.'+mw.util.escapeRegExp(currentExt)+'$','i'),reDestExt=new RegExp('\\.'+mw.util.escapeRegExp(fn.replace(/.*?\.(\w{2,5})$/,'$1'))+'$','i');if(!reCurrentExt.test(fn)){fn=fn.replace(reDestExt,'.'+currentExt);if(!
reCurrentExt.test(fn)){fn+='.'+currentExt;}}else{fn=false;}return fn;},cleanReason:function(uncleanReason){return uncleanReason.trim().replace(/(?:--|–|—)? ?~{3,5} ?/,'').replace(/\|\s/g,'&#124; ');},showProgress:function(message){if(!message){if(this.progressDialog){this.progressDialog.remove();}this.progressDialog=0;document.body.style.cursor='default';return;}if($('#feedbackContainer').length){$('#feedbackContainer').html(message);}else{document.body.style.cursor='wait';this.progressDialog=$('<div>').html('<div id="feedbackContainer">'+(message||this.i18n.preparingToEdit)+'</div>').dialog({width:450,height:'auto',minHeight:90,modal:true,resizable:false,draggable:false,closeOnEscape:false,dialogClass:'ajaxDeleteFeedback',open:function(){$(this).parent().find('.ui-dialog-titlebar').hide();},close:function(){$(this).dialog('destroy').remove();}});}},savePage:function(page,summary,callback){if(AQD.csrftoken){mw.user.tokens.set('csrfToken',AQD.csrftoken);}$.extend(true,page,{cb:
function(r){AQD.secureCall(callback,r);},errCb:function(t,r){if(AQD.uploadersToNotify){AQD.secureCall(callback,r);}AQD.fail(t,r);},summary:summary});mw.loader.using(['ext.gadget.libAPI'],function(){mw.libs.commons.api.editPage(page);});},movePage:function(){mw.user.tokens.set('csrfToken',AQD.csrftoken);if(pageName.replace(/_/g,' ')===AQD.destination){return AQD.nextTask();}mw.loader.using(['ext.gadget.libAPI'],function(){var moveArgs={cb:function(){AQD.nextTask();},errCb:function(t,r){if(r&&r.error&&/articleexists/.test(r.error.code)){AQD.disableReport=true;}AQD.fail(t,r);},from:pageName,to:AQD.destination,reason:AQD.reason,movetalk:true,watchlist:AQD.pageWasWatched?'watch':'preferences'};if(AQD.wpLeaveRedirect===false){moveArgs.noredirect=true;}AQD.showProgress(AQD.i18n.movingFile);mw.libs.commons.api.movePage(moveArgs);});},deletePage:function(){mw.user.tokens.set('csrfToken',AQD.csrftoken);mw.loader.using(['ext.gadget.libAPI'],function(){AQD.showProgress(AQD.i18n.deletingFile);mw.
libs.commons.api.deletePage({cb:function(){AQD.nextTask();},errCb:function(t,r){AQD.fail(t,r);},title:pageName,reason:AQD.reason});});},purge:function(){this.nextTask();$.post(this.apiURL,{format:'json',action:'purge',forcelinkupdate:1,titles:pageName});},queryAPI:function(params,callback){mw.loader.using(['ext.gadget.libAPI'],function(){params.action=params.action||'query';mw.libs.commons.api.query(params,{method:'GET',cache:false,cb:function(r){AQD.secureCall(callback,r);},errCb:function(t,r){AQD.fail(t,r);}});});},secureCall:function(fn,r){var o=AQD;try{o.currentTask=arguments[0];if(typeof fn==='function'){return fn.apply(o,Array.prototype.slice.call(arguments,1));}else if(typeof fn==='string'){return o[fn].apply(o,Array.prototype.slice.call(arguments,1));}else{mw.log.warn(fn,this.tasks);o.fail('This is not a function!');}}catch(ex){o.fail(ex,r);}},tasks:[],currentTask:'',addTask:function(task){this.tasks.push(task);},nextTask:function(){this.secureCall(this.tasks.shift());},
retryTask:function(){this.secureCall(this.currentTask);},reloadPage:function(){this.showProgress();if(this.pageName&&this.pageName.replace(/ /g,'_')!==pageName){return;}location.href=mw.util.getUrl(this.destination||pageName);},fail:function(err,r){var o=this,msg,dlgButtons={};if(typeof err==='object'){msg=err.message+' \n\n '+err.name;if(err.lineNumber){msg+=' @line'+err.lineNumber;}err=msg;}if(typeof r==='object'){if(r.error&&/tpt-target-page|readonly/.test(r.error.code)){this.disableReport=true;}}msg=this.i18n.taskFailure[this.currentTask]||this.i18n.genericFailure;if(this.img_summary==='Nominating for deletion'){msg+=' '+(this.templateAdded?this.i18n.completeRequestByHand:this.i18n.addTemplateByHand);}dlgButtons[this.i18n.retryButtonLabel]=function(){$(this).remove();o.retryTask();};if(['movePage','deletePage','notifyUploaders'].indexOf(o.currentTask)!==-1&&(/code 50\d|missingtitle/.test(err))){dlgButtons[this.i18n.ignoreButtonLabel]=function(){$(this).remove();o.nextTask();};}if(!
this.disableReport){dlgButtons[this.i18n.reportButtonLabel]=function(){var randomId=Math.round(Math.random()*1099511627776),toSend='\n== Autoreport by AjaxQuickDelete '+randomId+' ==\n'+err+'\nAQD version: '+o.version+'\n++++\n:Task: '+o.currentTask+'\n:NextTask: '+o.tasks[0]+'\n:LastTask: '+o.tasks[o.tasks.length-1]+'\n:Page: {{Page|1='+(o.pageName||pageName)+'}}\n:Skin: '+mw.user.options.get('skin')+'\n:[{{fullurl:Special:Contributions|target=DB&offset=20220320045730}} Contribs] '+'[{{fullurl:Special:Log|user=DB&offset=20220320045730}} Log] '+'before error [[User:DB|DB]] 04:57, 20 March 2022 (UTC)\n\n';$('#feedbackContainer').contents().remove().end().append($('<img>',{src:'//upload.wikimedia.org/wikipedia/commons/d/de/Ajax-loader.gif'})).css('text-align','center');$.post(o.apiURL,{action:'edit',format:'json',title:'MediaWiki talk:Gadget-AjaxQuickDelete.js/auto-errors',summary:
'/*Autoreport by AjaxQuickDelete '+randomId+'*/ error with random id',appendtext:toSend,token:(o.csrftoken||mw.user.tokens.get('csrfToken'))},function(){o.reloadPage();});};}dlgButtons[this.i18n.abortButtonLabel]=function(){$(this).remove();};this.disableReport=false;this.showProgress();this.progressDialog=$('<div>').append($('<div>',{id:'feedbackContainer',html:(msg+'<br>'+this.i18n.errorDetails+'<br>'+mw.html.escape(err)+'<br>'+(this.tag?(this.i18n.tagWas+this.tag):'')+'<br><a href="'+mw.util.getUrl('MediaWiki talk:AjaxQuickDelete.js')+'" >'+this.i18n.errorReport.replace(/%BUTTON%/,'<tt>'+this.i18n.reportButtonLabel+'</tt>')+'</a>')})).dialog({width:550,modal:true,closeOnEscape:false,title:this.i18n.errorDlgTitle,dialogClass:'ajaxDeleteError',buttons:dlgButtons,close:function(){$(this).dialog('destroy').remove();}});if(mw.log.warn){mw.log.warn(err);}},formatDate:function(fmt,date){return mw.libs.commons.formatDate(fmt,date,(mw.libs.commons.api&&mw.libs.commons.api.getCurrentDate()||
new Date()));},requestPagePrefix:'Commons:Deletion requests/',userTalkPrefix:conf.wgFormattedNamespaces[3]+':',apiURL:mw.util.wikiScript('api'),apiErrorThreshold:10,i18n:{toolboxLinkDelete:'Nominate for deletion',toolboxLinkDiscuss:'Nominate category for discussion',reasonForDeletion:'Why should this file be deleted?',reasonForDiscussion:'Why does this category need discussion?',moreInformation:'More information',loading:'Loading…',keptAfterDR:'This page was kept after a deletion request. Please contact the administrator who kept it before re-nominating.',hasTalkpage:'There is a talk page. Consider reading it or adding your remarks.',mentionedInDR:'Consider reading the deletion debate –%PAGE%– that links to this page.',mentionedInForum:'On %PAGE%, this page is part of a discussion.',previewLabel:'Preview:',submitButtonLabel:'Proceed',cancelButtonLabel:'Cancel',abortButtonLabel:'Abort',reportButtonLabel:'Report automatically',retryButtonLabel:'Retry',ignoreButtonLabel:
'Ignore and continue',inverseButtonLabel:'Inverse. Keep this delete other',swapImagesButtonLabel:'Swap to compare',overlayButtonLabel:'Overlay to compare',expandToTextarea:'Expand to textarea',notifyUser:'Notify users',preparingToEdit:'Preparing to edit pages… ',creatingNomination:'Creating nomination page… ',listingNomination:'Adding nomination page to daily list… ',addingAnyTemplate:'Adding template to '+conf.wgCanonicalNamespace.toLowerCase()+' page… ',notifyingUploader:'Notifying %USER%… ',listingMobile:'Listing mobile upload',updRedir:'Updating redirects',toolboxLinkSource:'No source',toolboxLinkLicense:'No license',toolboxLinkPermission:'No permission',toolboxLinkCopyvio:'Report copyright violation',reasonForCopyvio:'Why is this file a copyright violation?',notAllowed:'You do not have the neccessary rights to move files',reasonForMove:'Why do you want to move this file?',moveDestination:'What should be the new filename?',moveOtherDestination:
'The name you have specified exists. Choose a new name, please.',checkFileExists:'Checking whether file exists',movingFile:'Moving file',replacingUsage:'Ordering CommonsDelinker to replace all usage',dropdownMove:'Move & Replace',leaveRedirect:'Leave a redirect behind:',moveAndReplace:'Move file and replace all usage',warnRename:'File renaming was recently declined, be prudent!',removingTemplate:'Removing template',declineRequest:'Why do you want to decline the request?',anyDecline:'Decline request',useCORSForReplace:'Try to replace usage immediately using your user account:',deletingFile:'Deleting file',compareDetails:'Please compare the images before merging the descriptions. The image with the bold text will be deleted.',mergeDescription:'Please now merge the file descriptions',redirectingFile:'Redirecting file',savingDescription:'Saving new details',processDupes:'Process Duplicates',errorDlgTitle:'Error',genericFailure:'An error occurred while trying to do the requested action. ',
taskFailure:{listUploaders:'An error occurred while determining the '+(nsNr===6?' uploader(s) of this file':'creator of this page')+'.',loadPages:'An error occurred while preparing to nominate this '+conf.wgCanonicalNamespace.toLowerCase()+' for deletion.',prependDeletionTemplate:'An error occurred while adding the {{delete}} template to this '+conf.wgCanonicalNamespace.toLowerCase()+'.',createRequestSubpage:'An error occurred while creating the request subpage.',listRequestSubpage:'An error occurred while adding the deletion request to today’s log.',notifyUploaders:'An error occurred while notifying the '+(nsNr===6?' uploader(s) of this file':'creator of this page')+'.',movePage:'Error while moving the page.',deletePage:'Error deleting the page.'},addTemplateByHand:'To nominate this '+conf.wgCanonicalNamespace.toLowerCase()+' for deletion, please edit the page to add the {{delete}} template and follow the instructions shown on it.',completeRequestByHand:
'Please follow the instructions on the deletion notice to complete the request.',errorDetails:'A detailed description of the error is shown below:',errorReport:'Manually report the error here or click on %BUTTON% to send an automatic error-report.',tagWas:'The tag to be inserted into this page was ',templateRegExp:'The template does not expose a valid regular expression for {{X-To-DR}}. Go the the template and fix it there.',findTemplateAdderErr:'Unable to find the person who added the template. This can occur if the template was already removed, the page is deleted or a redirect to the template is used. In this case you must add the redirect to the RegExp of the target template.',dupeParaErr:'Error in the duplicate-template, check your language version!',dupeExistErr:'Retrieving information about %TITLE% failed. It is possible that it is deleted, the last revision is corrupt or the file is a redirect.',noCreatorFound:
'The page you are attempting to add a tag to was deleted or moved. Unable to retrieve the content.',noPageFound:'The page you are attempting to modify or move is corrupted, was deleted or moved: Unable to retrieve history and contents.'}};AQD.preinstall();if(conf.wgUserLanguage!=='en'){$.when(mw.loader.getScript(mw.util.wikiScript()+'?title=MediaWiki:Gadget-AjaxQuickDelete.js/'+conf.wgUserLanguage+'.js&action=raw&ctype=text/javascript'),$.ready).always(function(){AQD.install();});}else{$(function(){AQD.install();});}}());},{"css":[
".ajaxDeleteFeedback{border:1px #A9DE16 solid !important;background:#EAF2CB url(//upload.wikimedia.org/wikipedia/commons/d/de/Ajax-loader.gif) no-repeat 8px 14px !important;padding-left:2.85em !important;padding-top:10px !important;font-size:1.1em !important;word-wrap:break-word}.ajaxDeleteError{border:1px #DE1616 solid!important;background:#F2CBCB!important;padding-left:0em}.ajaxDeleteDeclineMove{float:right;background:#F2CBCB;padding:0.3em}.ajaxDeleteLazyLoad{min-height:100px;max-height:450px;border:#ddd solid 1px;overflow:auto}#AjaxDupeContainer{position:relative}#AjaxDupeContainer \u003E div{margin:5px;display:inline-block;vertical-align:top;width:365px}#AjaxDeleteContainer textarea{margin:10px;display:inline-block;width:365px;font-size:0.9em}#AjaxDeleteImgDel{color:red;font-weight:bold}#AjaxDeleteImgKeep{color:green} #AjaxQuestionParse,#AjaxQuestionParse0,div[id^=\"AjaxQuestionParse\"]{min-height:50px;max-height:300px;overflow:auto;color:#000;background:#DDD;border:1px solid #EEE} #AjaxQuestion0,#AjaxQuestion1,div[id^=\"AjaxQuestion\"]{direction:ltr} #AjaxQuestionParse a.new,#AjaxQuestionParse0 a.new,div[id^=\"AjaxQuestionParse\"] a.new{color:#BA0000 !important}.ajaxTextareaConverter{position:absolute;right:0px;top:1px;cursor:pointer}"
]});mw.loader.implement("ext.gadget.CollapsibleTemplates@1240v",function($,jQuery,require,module){(function($,mw){'use strict';function toggleTemplate($element){if($element.is('tr')){$element.parent().parent().toggleClass('collapsed');$element.nextAll('tr').toggleClass('hidden');}else{$element.parent().toggleClass('expanded').toggleClass('collapsed').find('div.body').slideToggle((mw.config.get('skin')==='vector')?150:0);}}function launch($content){var $tableTmp=$content.find('table.collapsible');$content=$content.find('div.collapsibletemplate').each(function(i,el){el=$(el).attr('dir',document.documentElement.getAttribute('dir')).find('.body');if(el[0]){if($(this).hasClass('collapsed'))el.hide();el.removeClass('show-on-commons');}});$tableTmp=$tableTmp.map(function(i,el){el=$(el).find('> tbody > tr');if(el[0]){if($(this).hasClass('collapsed'))el.not(':first-child').toggleClass('hidden');return el[0];}});$($content.find('div.collapsibleheader').show().add($tableTmp)).on('mousedown',function(
e){var $t=$(e.target);if($t.is('a')||$t.parents('a').length)return true;toggleTemplate($(e.currentTarget));return false;});}mw.hook('wikipage.content').add(launch);}(jQuery,mediaWiki));},{"css":[
"div.collapsibletemplate .headertext{padding-left:18px;background-image:url(//upload.wikimedia.org/wikipedia/commons/1/10/MediaWiki_Vector_skin_action_arrow.png);background-position:left 50%;background-repeat:no-repeat}div.collapsibletemplate.collapsed .headertext{background-image:url(//upload.wikimedia.org/wikipedia/commons/4/41/MediaWiki_Vector_skin_right_arrow.png)}div.collapsibletemplate.collapsed[dir=\"rtl\"] .headertext{background-image:url(//upload.wikimedia.org/wikipedia/commons/1/1e/MediaWiki_Vector_skin_left_arrow.png)}div.collapsibletemplate .header{padding:3px;cursor:pointer} table.collapsible \u003E tbody \u003E tr:first-child th,.collapsibleTH{padding-right:18px;background-image:url(//upload.wikimedia.org/wikipedia/commons/1/10/MediaWiki_Vector_skin_action_arrow.png);background-position:99% 50%;background-repeat:no-repeat}table.collapsible.collapsed \u003E tbody \u003E tr:first-child th,.collapsibleCollapsedTH{background-image:url(//upload.wikimedia.org/wikipedia/commons/4/41/MediaWiki_Vector_skin_right_arrow.png);cursor:pointer}table.collapsible.collapsed[dir=\"rtl\"] \u003E tbody \u003E tr:first-child th{background-image:url(//upload.wikimedia.org/wikipedia/commons/1/1e/MediaWiki_Vector_skin_left_arrow.png)}.hidden{display:none}"
]});mw.loader.implement("ext.gadget.HotCat@7c3ax",function($,jQuery,require,module){(function($,mw){var conf=$.extend({},mw.config.values,{wgServer:window.location.host.indexOf('.m.')>-1?'//'+window.location.host:mw.config.get('wgServer')});if((window.HotCat&&!window.HotCat.nodeName)||conf.wgAction==='edit')return;var HC=window.HotCat={messages:{cat_removed:'removed [[Category:$1]]',template_removed:'removed {{[[Category:$1]]}}',cat_added:'added [[Category:$1]]',cat_keychange:'new key for [[Category:$1]]: "$2"',cat_notFound:'Category "$1" not found',cat_exists:'Category "$1" already exists; not added.',cat_resolved:' (redirect [[Category:$1]] resolved)',uncat_removed:'removed {{uncategorized}}',separator:'; ',prefix:'',using:' using [[Help:Gadget-HotCat|HotCat]]',multi_change:'$1 categories',commit:'Save',ok:'OK',cancel:'Cancel',multi_error:'Could not retrieve the page text from the server. Therefore, your category changes '+'cannot be saved. We apologize for the inconvenience.',
short_catchange:null},categories:'Categories',disambig_category:'Disambiguation',redir_category:'Category redirects',links:{change:'(±)',remove:'(\u2212)',add:'(+)',restore:'(×)',undo:'(×)',down:'(\u2193)',up:'(\u2191)'},changeTag:conf.wgUserName?'HotCat':'',tooltips:{change:'Modify',remove:'Remove',add:'Add a new category',restore:'Undo changes',undo:'Undo changes',down:'Open for modifying and display subcategories',up:'Open for modifying and display parent categories'},addmulti:'<span>+<sup>+</sup></span>',multi_tooltip:'Modify several categories',disable:function(){var ns=conf.wgNamespaceNumber;var nsIds=conf.wgNamespaceIds;return(ns<0||ns===10||ns===828||ns===8||ns===6&&!conf.wgArticleId||ns===2&&/\.(js|css)$/.test(conf.wgTitle)||nsIds&&(ns===nsIds.creator||ns===nsIds.timedtext||ns===nsIds.institution));},uncat_regexp:/\{\{\s*[Uu]ncategorized\s*[^}]*\}\}\s*(<!--.*?-->\s*)?/g,existsYes:'//upload.wikimedia.org/wikipedia/commons/thumb/b/be/P_yes.svg/20px-P_yes.svg.png',existsNo:
'//upload.wikimedia.org/wikipedia/commons/thumb/4/42/P_no.svg/20px-P_no.svg.png',template_categories:{},engine_names:{searchindex:'Search index',pagelist:'Page list',combined:'Combined search',subcat:'Subcategories',parentcat:'Parent categories'},capitalizePageNames:null,upload_disabled:false,blacklist:null,bg_changed:'#FCA',no_autocommit:false,del_needs_diff:false,suggest_delay:100,editbox_width:40,suggestions:'combined',fixed_search:false,use_up_down:true,listSize:10,single_minor:true,dont_add_to_watchlist:false,shortcuts:null,addShortcuts:function(map){if(!map)return;window.HotCat.shortcuts=window.HotCat.shortcuts||{};for(var k in map){if(!map.hasOwnProperty(k)||typeof k!=='string')continue;var v=map[k];if(typeof v!=='string')continue;k=k.replace(/^\s+|\s+$/g,'');v=v.replace(/^\s+|\s+$/g,'');if(!k.length||!v.length)continue;window.HotCat.shortcuts[k]=v;}}};var ua=navigator.userAgent.toLowerCase();var is_webkit=/applewebkit\/\d+/.test(ua)&&ua.indexOf('spoofer')<0;var cat_prefix=null;
var noSuggestions=false;function LoadTrigger(needed){var self=this;self.queue=[];self.needed=needed;self.register=function(callback){if(self.needed<=0)callback();else self.queue.push(callback);};self.loaded=function(){self.needed--;if(self.needed===0){for(var i=0;i<self.queue.length;i++)self.queue[i]();self.queue=[];}};}var loadTrigger=new LoadTrigger(2);function load(uri,callback){var s=document.createElement('script');s.src=uri;var called=false;s.onload=s.onerror=function(){if(!called&&callback){called=true;callback();}if(s.parentNode){s.parentNode.removeChild(s);}};document.head.appendChild(s);}function loadJS(page,callback){load(conf.wgServer+conf.wgScript+'?title='+encodeURIComponent(page)+'&action=raw&ctype=text/javascript',callback);}function loadURI(href,callback){var url=href;if(url.substring(0,2)==='//')url=window.location.protocol+url;else if(url.substring(0,1)==='/')url=conf.wgServer+url;load(url,callback);}loadJS('MediaWiki:Gadget-HotCat.js/local_defaults',loadTrigger.
loaded);if(conf.wgUserLanguage!=='en'){if(window.hotcat_translations_from_commons===undefined)window.hotcat_translations_from_commons=true;if(window.hotcat_translations_from_commons&&conf.wgServer.indexOf('//commons')<0){loadURI('//commons.wikimedia.org/w/index.php?title='+'MediaWiki:Gadget-HotCat.js/'+conf.wgUserLanguage+'&action=raw&ctype=text/javascript',loadTrigger.loaded);}else{loadJS('MediaWiki:Gadget-HotCat.js/'+conf.wgUserLanguage,loadTrigger.loaded);}}else{loadTrigger.loaded();}var wikiTextBlank='[\\t _\\xA0\\u1680\\u180E\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]+';var wikiTextBlankRE=new RegExp(wikiTextBlank,'g');var wikiTextBlankOrBidi='[\\t _\\xA0\\u1680\\u180E\\u2000-\\u200B\\u200E\\u200F\\u2028-\\u202F\\u205F\\u3000]*';var formattedNamespaces=conf.wgFormattedNamespaces;var namespaceIds=conf.wgNamespaceIds;function autoLocalize(namespaceNumber,fallback){function createRegexpStr(name){if(!name||!name.length)return'';var regex_name='';for(var i=0;i<name.length;i++){
var initial=name.charAt(i),ll=initial.toLowerCase(),ul=initial.toUpperCase();if(ll===ul)regex_name+=initial;else regex_name+='['+ll+ul+']';}return regex_name.replace(/([\\^$.?*+()])/g,'\\$1').replace(wikiTextBlankRE,wikiTextBlank);}fallback=fallback.toLowerCase();var canonical=formattedNamespaces[String(namespaceNumber)].toLowerCase();var regexp=createRegexpStr(canonical);if(fallback&&canonical!==fallback)regexp+='|'+createRegexpStr(fallback);if(namespaceIds){for(var cat_name in namespaceIds){if(typeof cat_name==='string'&&cat_name.toLowerCase()!==canonical&&cat_name.toLowerCase()!==fallback&&namespaceIds[cat_name]===namespaceNumber){regexp+='|'+createRegexpStr(cat_name);}}}return regexp;}HC.category_canonical=formattedNamespaces['14'];HC.category_regexp=autoLocalize(14,'category');if(formattedNamespaces['10'])HC.template_regexp=autoLocalize(10,'template');function make(arg,literal){if(!arg)return null;return literal?document.createTextNode(arg):document.createElement(arg);}function
param(name,uri){uri=uri||document.location.href;var re=new RegExp('[&?]'+name+'=([^&#]*)');var m=re.exec(uri);if(m&&m.length>1)return decodeURIComponent(m[1]);return null;}function title(href){if(!href)return null;var script=conf.wgScript+'?';if(href.indexOf(script)===0||href.indexOf(conf.wgServer+script)===0||conf.wgServer.substring(0,2)==='//'&&href.indexOf(document.location.protocol+conf.wgServer+script)===0){return param('title',href);}else{var prefix=conf.wgArticlePath.replace('$1','');if(href.indexOf(prefix))prefix=conf.wgServer+prefix;if(href.indexOf(prefix)&&prefix.substring(0,2)==='//')prefix=document.location.protocol+prefix;if(href.indexOf(prefix)===0)return decodeURIComponent(href.substring(prefix.length));}return null;}function hasClass(elem,name){return(' '+elem.className+' ').indexOf(' '+name+' ')>=0;}function capitalize(str){if(!str||!str.length)return str;return str.substr(0,1).toUpperCase()+str.substr(1);}function wikiPagePath(pageName){return conf.wgArticlePath.
replace('$1',encodeURIComponent(pageName).replace(/%3A/g,':').replace(/%2F/g,'/'));}function escapeRE(str){return str.replace(/([\\^$.?*+()[\]])/g,'\\$1');}function substituteFactory(options){options=options||{};var lead=options.indicator||'$';var indicator=escapeRE(lead);var lbrace=escapeRE(options.lbrace||'{');var rbrace=escapeRE(options.rbrace||'}');var re;re=new RegExp('(?:'+indicator+'('+indicator+'))|'+'(?:'+indicator+'(\\d+))|'+'(?:'+indicator+'(?:'+lbrace+'([^'+lbrace+rbrace+']+)'+rbrace+'))|'+'(?:'+indicator+'(?!(?:['+indicator+lbrace+']|\\d))(\\S+?)\\b)','g');return function(str,map){if(!map)return str;return str.replace(re,function(match,prefix,idx,key,alpha){if(prefix===lead)return lead;var k=alpha||key||idx;var replacement=typeof map[k]==='function'?map[k](match,k):map[k];return typeof replacement==='string'?replacement:(replacement||match);});};}var substitute=substituteFactory();var replaceShortcuts=(function(){var replaceHash=substituteFactory({indicator:'#',lbrace:'[',
rbrace:']'});return function(str,map){var s=replaceHash(str,map);return HC.capitalizePageNames?capitalize(s):s;};}());var findCatsRE=new RegExp('\\[\\['+wikiTextBlankOrBidi+'(?:'+HC.category_regexp+')'+wikiTextBlankOrBidi+':[^\\]]+\\]\\]','g');function replaceByBlanks(match){return match.replace(/(\s|\S)/g,' ');}function find_category(wikitext,category,once){var cat_regex=null;if(HC.template_categories[category]){cat_regex=new RegExp('\\{\\{'+wikiTextBlankOrBidi+'('+HC.template_regexp+'(?='+wikiTextBlankOrBidi+':))?'+wikiTextBlankOrBidi+'(?:'+HC.template_categories[category]+')'+wikiTextBlankOrBidi+'(\\|.*?)?\\}\\}','g');}else{var cat_name=escapeRE(category);var initial=cat_name.substr(0,1);cat_regex=new RegExp('\\[\\['+wikiTextBlankOrBidi+'('+HC.category_regexp+')'+wikiTextBlankOrBidi+':'+wikiTextBlankOrBidi+(initial==='\\'||!HC.capitalizePageNames?initial:'['+initial.toUpperCase()+initial.toLowerCase()+']')+cat_name.substring(1).replace(wikiTextBlankRE,wikiTextBlank)+
wikiTextBlankOrBidi+'(\\|.*?)?\\]\\]','g');}if(once)return cat_regex.exec(wikitext);var copiedtext=wikitext.replace(/<!--(\s|\S)*?-->/g,replaceByBlanks).replace(/<nowiki>(\s|\S)*?<\/nowiki>/g,replaceByBlanks);var result=[];var curr_match=null;while((curr_match=cat_regex.exec(copiedtext))!==null){result.push({match:curr_match});}result.re=cat_regex;return result;}var interlanguageRE=null;function change_category(wikitext,toRemove,toAdd,key,is_hidden){function find_insertionpoint(wikitext){var copiedtext=wikitext.replace(/<!--(\s|\S)*?-->/g,replaceByBlanks).replace(/<nowiki>(\s|\S)*?<\/nowiki>/g,replaceByBlanks);var index=-1;findCatsRE.lastIndex=0;while(findCatsRE.exec(copiedtext)!==null)index=findCatsRE.lastIndex;if(index<0){var match=null;if(!interlanguageRE){match=/((^|\n\r?)(\[\[\s*(([a-z]{2,3}(-[a-z]+)*)|simple|tokipona)\s*:[^\]]+\]\]\s*))+$/.exec(copiedtext);}else{match=interlanguageRE.exec(copiedtext);}if(match)index=match.index;return{idx:index,onCat:false};}return{idx:index,
onCat:index>=0};}var summary=[],nameSpace=HC.category_canonical,cat_point=-1,keyChange=(toRemove&&toAdd&&toRemove===toAdd&&toAdd.length),matches;if(key)key='|'+key;if(toRemove&&toRemove.length){matches=find_category(wikitext,toRemove);if(!matches||!matches.length){return{text:wikitext,summary:summary,error:HC.messages.cat_notFound.replace(/\$1/g,toRemove)};}else{var before=wikitext.substring(0,matches[0].match.index),after=wikitext.substring(matches[0].match.index+matches[0].match[0].length);if(matches.length>1){matches.re.lastIndex=0;after=after.replace(matches.re,'');}if(toAdd){if(key===null)key=matches[0].match[2];}var i=before.length-1;while(i>=0&&before.charAt(i)!=='\n'&&before.substr(i,1).search(/\s/)>=0)i--;var j=0;while(j<after.length&&after.charAt(j)!=='\n'&&after.substr(j,1).search(/\s/)>=0)j++;if(i>=0&&before.charAt(i)==='\n'&&(!after.length||j<after.length&&after.charAt(j)==='\n'))i--;if(i>=0)before=before.substring(0,i+1);else before='';if(j<after.length)after=after.
substring(j);else after='';if(before.length&&before.substring(before.length-1).search(/\S/)>=0&&after.length&&after.substr(0,1).search(/\S/)>=0){before+=' ';}cat_point=before.length;if(cat_point===0&&after.length&&after.substr(0,1)==='\n')after=after.substr(1);wikitext=before+after;if(!keyChange){if(HC.template_categories[toRemove]){summary.push(HC.messages.template_removed.replace(/\$1/g,toRemove));}else{summary.push(HC.messages.cat_removed.replace(/\$1/g,toRemove));}}}}if(toAdd&&toAdd.length){matches=find_category(wikitext,toAdd);if(matches&&matches.length){return{text:wikitext,summary:summary,error:HC.messages.cat_exists.replace(/\$1/g,toAdd)};}else{var onCat=false;if(cat_point<0){var point=find_insertionpoint(wikitext);cat_point=point.idx;onCat=point.onCat;}else{onCat=true;}var newcatstring='[['+nameSpace+':'+toAdd+(key||'')+']]';if(cat_point>=0){var suffix=wikitext.substring(cat_point);wikitext=wikitext.substring(0,cat_point)+(cat_point>0?'\n':'')+newcatstring+(!onCat?'\n':'');if(
suffix.length&&suffix.substr(0,1)!=='\n')wikitext+='\n'+suffix;else wikitext+=suffix;}else{if(wikitext.length&&wikitext.substr(wikitext.length-1,1)!=='\n')wikitext+='\n';wikitext+=(wikitext.length?'\n':'')+newcatstring;}if(keyChange){var k=key||'';if(k.length)k=k.substr(1);summary.push(substitute(HC.messages.cat_keychange,[null,toAdd,k]));}else{summary.push(HC.messages.cat_added.replace(/\$1/g,toAdd));}if(HC.uncat_regexp&&!is_hidden){var txt=wikitext.replace(HC.uncat_regexp,'');if(txt.length!==wikitext.length){wikitext=txt;summary.push(HC.messages.uncat_removed);}}}}return{text:wikitext,summary:summary,error:null};}function evtKeys(e){var code=0;if(e.ctrlKey){if(e.ctrlKey||e.metaKey)code|=1;if(e.shiftKey)code|=2;}return code;}function evtKill(e){if(e.preventDefault){e.preventDefault();e.stopPropagation();}else{e.cancelBubble=true;}return false;}var catLine=null,onUpload=false,editors=[],commitButton=null,commitForm=null,multiSpan=null,pageText=null,pageTime=null,pageWatched=false,
watchCreate=false,watchEdit=false,minorEdits=false,editToken=null,is_rtl=false,serverTime=null,lastRevId=null,pageTextRevId=null,conflictingUser=null,newDOM=false;function CategoryEditor(){this.initialize.apply(this,arguments);}function setPage(json){var startTime=null;if(json&&json.query){if(json.query.pages){var page=json.query.pages[!conf.wgArticleId?'-1':String(conf.wgArticleId)];if(page){if(page.revisions&&page.revisions.length){pageText=page.revisions[0]['*'];if(page.revisions[0].timestamp)pageTime=page.revisions[0].timestamp.replace(/\D/g,'');if(page.revisions[0].revid)pageTextRevId=page.revisions[0].revid;if(page.revisions.length>1)conflictingUser=page.revisions[1].user;}if(page.lastrevid)lastRevId=page.lastrevid;if(page.starttimestamp)startTime=page.starttimestamp.replace(/\D/g,'');pageWatched=typeof page.watched==='string';if(json.query.tokens)editToken=json.query.tokens.csrftoken;if(page.langlinks&&(!json['query-continue']||!json['query-continue'].langlinks)){var re='';for(
var i=0;i<page.langlinks.length;i++)re+=(i>0?'|':'')+page.langlinks[i].lang.replace(/([\\^$.?*+()])/g,'\\$1');if(re.length)interlanguageRE=new RegExp('((^|\\n\\r?)(\\[\\[\\s*('+re+')\\s*:[^\\]]+\\]\\]\\s*))+$');}}}if(json.query.general){if(json.query.general.time&&!startTime)startTime=json.query.general.time.replace(/\D/g,'');if(HC.capitalizePageNames===null){HC.capitalizePageNames=(json.query.general['case']==='first-letter');}}serverTime=startTime;if(json.query.userinfo&&json.query.userinfo.options){watchCreate=!HC.dont_add_to_watchlist&&json.query.userinfo.options.watchcreations==='1';watchEdit=!HC.dont_add_to_watchlist&&json.query.userinfo.options.watchdefault==='1';minorEdits=json.query.userinfo.options.minordefault===1;if(minorEdits)HC.single_minor=true;}}}var saveInProgress=false;function initiateEdit(doEdit,failure){if(saveInProgress)return;saveInProgress=true;var oldButtonState;if(commitButton){oldButtonState=commitButton.disabled;commitButton.disabled=true;}function fail(){
saveInProgress=false;if(commitButton)commitButton.disabled=oldButtonState;failure.apply(this,arguments);}$.getJSON(conf.wgServer+conf.wgScriptPath+'/api.php?'+'format=json&action=query&rawcontinue=&titles='+encodeURIComponent(conf.wgPageName)+'&prop=info%7Crevisions%7Clanglinks&inprop=watched&rvprop=content%7Ctimestamp%7Cids%7Cuser&lllimit=500'+'&rvlimit=2&rvdir=newer&rvstartid='+conf.wgCurRevisionId+'&meta=siteinfo%7Cuserinfo%7Ctokens&type=csrf&uiprop=options',function(json){setPage(json);doEdit(fail);}).fail(function(req){fail(req.status+' '+req.statusText);});}function multiChangeMsg(count){var msg=HC.messages.multi_change;if(typeof msg!=='string'&&msg.length)if(mw.language&&mw.language.convertPlural){msg=mw.language.convertPlural(count,msg);}else{msg=msg[msg.length-1];}return substitute(msg,[null,String(count)]);}function currentTimestamp(){var now=new Date();var ts=String(now.getUTCFullYear());function two(s){return s.substr(s.length-2);}ts+=two('0'+(now.getUTCMonth()+1))+two('0'+
now.getUTCDate())+two('00'+now.getUTCHours())+two('00'+now.getUTCMinutes())+two('00'+now.getUTCSeconds());return ts;}function performChanges(failure,singleEditor){if(pageText===null){failure(HC.messages.multi_error);return;}if(HC.messages.cat_keychange.indexOf('$2')<0)HC.messages.cat_keychange+='"$2"';if(!HC.messages.short_catchange)HC.messages.short_catchange='[['+HC.category_canonical+':$1]]';var action;var selfEditConflict=(lastRevId!==null&&lastRevId!==conf.wgCurRevisionId||pageTextRevId!==null&&pageTextRevId!==conf.wgCurRevisionId)&&conflictingUser&&conflictingUser===conf.wgUserName;if(singleEditor&&!singleEditor.noCommit&&!HC.no_autocommit&&editToken&&!selfEditConflict){commitForm.wpEditToken.value=editToken;action=commitForm.wpDiff;if(action)action.name=action.value='wpSave';}else{action=commitForm.wpSave;if(action)action.name=action.value='wpDiff';}var result={text:pageText},changed=[],added=[],deleted=[],changes=0,toEdit=singleEditor?[singleEditor]:editors,error=null,edit,i;
for(i=0;i<toEdit.length;i++){edit=toEdit[i];if(edit.state===CategoryEditor.CHANGED){result=change_category(result.text,edit.originalCategory,edit.currentCategory,edit.currentKey,edit.currentHidden);if(!result.error){changes++;if(!edit.originalCategory||!edit.originalCategory.length){added.push(edit.currentCategory);}else{changed.push({from:edit.originalCategory,to:edit.currentCategory});}}else if(error===null){error=result.error;}}else if(edit.state===CategoryEditor.DELETED&&edit.originalCategory&&edit.originalCategory.length){result=change_category(result.text,edit.originalCategory,null,null,false);if(!result.error){changes++;deleted.push(edit.originalCategory);}else if(error===null){error=result.error;}}}if(error!==null){action=commitForm.wpSave;if(action)action.name=action.value='wpDiff';}commitForm.wpMinoredit.checked=minorEdits;commitForm.wpWatchthis.checked=!conf.wgArticleId&&watchCreate||watchEdit||pageWatched;if(conf.wgArticleId||!!singleEditor){if(action&&action.value===
'wpSave'){if(HC.changeTag){commitForm.wpChangeTags.value=HC.changeTag;HC.messages.using='';HC.messages.prefix='';}}else{commitForm.wpAutoSummary.value=HC.changeTag;}if(changes===1){if(result.summary&&result.summary.length)commitForm.wpSummary.value=HC.messages.prefix+result.summary.join(HC.messages.separator)+HC.messages.using;commitForm.wpMinoredit.checked=HC.single_minor||minorEdits;}else if(changes){var summary=[];var shortSummary=[];for(i=0;i<deleted.length;i++)summary.push('−'+substitute(HC.messages.short_catchange,[null,deleted[i]]));if(deleted.length===1)shortSummary.push('−'+substitute(HC.messages.short_catchange,[null,deleted[0]]));else if(deleted.length)shortSummary.push('− '+multiChangeMsg(deleted.length));for(i=0;i<added.length;i++)summary.push('+'+substitute(HC.messages.short_catchange,[null,added[i]]));if(added.length===1)shortSummary.push('+'+substitute(HC.messages.short_catchange,[null,added[0]]));else if(added.length)shortSummary.push('+ '+multiChangeMsg(added.
length));var arrow=is_rtl?'\u2190':'\u2192';for(i=0;i<changed.length;i++){if(changed[i].from!==changed[i].to){summary.push('±'+substitute(HC.messages.short_catchange,[null,changed[i].from])+arrow+substitute(HC.messages.short_catchange,[null,changed[i].to]));}else{summary.push('±'+substitute(HC.messages.short_catchange,[null,changed[i].from]));}}if(changed.length===1){if(changed[0].from!==changed[0].to){shortSummary.push('±'+substitute(HC.messages.short_catchange,[null,changed[0].from])+arrow+substitute(HC.messages.short_catchange,[null,changed[0].to]));}else{shortSummary.push('±'+substitute(HC.messages.short_catchange,[null,changed[0].from]));}}else if(changed.length){shortSummary.push('± '+multiChangeMsg(changed.length));}if(summary.length){summary=summary.join(HC.messages.separator);if(summary.length>200-HC.messages.prefix.length-HC.messages.using.length)summary=shortSummary.join(HC.messages.separator);commitForm.wpSummary.value=HC.messages.prefix+summary+HC.messages.using;}}}
commitForm.wpTextbox1.value=result.text;commitForm.wpStarttime.value=serverTime||currentTimestamp();commitForm.wpEdittime.value=pageTime||commitForm.wpStarttime.value;if(selfEditConflict)commitForm.oldid.value=String(pageTextRevId||conf.wgCurRevisionId);commitForm.hcCommit.click();}function resolveOne(page,toResolve){var cats=page.categories,lks=page.links,is_dab=false,is_redir=typeof page.redirect==='string',is_hidden=page.categoryinfo&&typeof page.categoryinfo.hidden==='string',is_missing=typeof page.missing==='string',i;for(i=0;i<toResolve.length;i++){if(i&&toResolve[i].dabInputCleaned!==page.title.substring(page.title.indexOf(':')+1))continue;toResolve[i].currentHidden=is_hidden;toResolve[i].inputExists=!is_missing;toResolve[i].icon.src=(is_missing?HC.existsNo:HC.existsYes);}if(is_missing)return;if(!is_redir&&cats&&(HC.disambig_category||HC.redir_category)){for(var c=0;c<cats.length;c++){var cat=cats[c].title;if(cat){cat=cat.substring(cat.indexOf(':')+1).replace(/_/g,' ');if(cat===
HC.disambig_category){is_dab=true;break;}else if(cat===HC.redir_category){is_redir=true;break;}}}}if(!is_redir&&!is_dab)return;if(!lks||!lks.length)return;var titles=[];for(i=0;i<lks.length;i++){if(lks[i].ns===14&&lks[i].title&&lks[i].title.length){var match=lks[i].title;match=match.substring(match.indexOf(':')+1);if(!HC.blacklist||!HC.blacklist.test(match))titles.push(match);}}if(!titles.length)return;for(i=0;i<toResolve.length;i++){if(i&&toResolve[i].dabInputCleaned!==page.title.substring(page.title.indexOf(':')+1))continue;toResolve[i].inputExists=true;toResolve[i].icon.src=HC.existsYes;if(titles.length>1){toResolve[i].dab=titles;}else{toResolve[i].text.value=titles[0]+(toResolve[i].currentKey!==null?'|'+toResolve[i].currentKey:'');}}}function resolveRedirects(toResolve,params){if(!params||!params.query||!params.query.pages)return;for(var p in params.query.pages)resolveOne(params.query.pages[p],toResolve);}function resolveMulti(toResolve,callback){var i;for(i=0;i<toResolve.length;i++
){toResolve[i].dab=null;toResolve[i].dabInput=toResolve[i].lastInput;}if(noSuggestions){callback(toResolve);return;}var args='action=query&prop=info%7Clinks%7Ccategories%7Ccategoryinfo&plnamespace=14'+'&pllimit='+(toResolve.length*10)+'&cllimit='+(toResolve.length*10)+'&format=json&titles=';for(i=0;i<toResolve.length;i++){var v=toResolve[i].dabInput;v=replaceShortcuts(v,HC.shortcuts);toResolve[i].dabInputCleaned=v;args+=encodeURIComponent('Category:'+v);if(i+1<toResolve.length)args+='%7C';}$.getJSON(conf.wgServer+conf.wgScriptPath+'/api.php?'+args,function(json){resolveRedirects(toResolve,json);callback(toResolve);}).fail(function(req){if(!req)noSuggestions=true;callback(toResolve);});}function makeActive(which){if(which.is_active)return;for(var i=0;i<editors.length;i++)if(editors[i]!==which)editors[i].inactivate();which.is_active=true;if(which.dab){showDab(which);}else{var expectedInput=which.lastRealInput||which.lastInput||'';var actualValue=which.text.value||'';if(!expectedInput.
length&&actualValue.length||expectedInput.length&&actualValue.indexOf(expectedInput)){which.showsList=false;var v=actualValue.split('|');which.lastRealInput=which.lastInput=v[0];if(v.length>1)which.currentKey=v[1];if(which.lastSelection){which.lastSelection={start:v[0].length,end:v[0].length};}}if(which.showsList)which.displayList();if(which.lastSelection){if(is_webkit){window.setTimeout(function(){which.setSelection(which.lastSelection.start,which.lastSelection.end);},1);}else{which.setSelection(which.lastSelection.start,which.lastSelection.end);}}}}function showDab(which){if(!which.is_active){makeActive(which);}else{which.showSuggestions(which.dab,false,null,null);which.dab=null;}}function multiSubmit(){var toResolve=[];for(var i=0;i<editors.length;i++)if(editors[i].state===CategoryEditor.CHANGE_PENDING||editors[i].state===CategoryEditor.OPEN)toResolve.push(editors[i]);if(!toResolve.length){initiateEdit(function(failure){performChanges(failure);},function(msg){alert(msg);});return;}
resolveMulti(toResolve,function(resolved){var firstDab=null;var dontChange=false;for(var i=0;i<resolved.length;i++){if(resolved[i].lastInput!==resolved[i].dabInput){dontChange=true;}else{if(resolved[i].dab){if(!firstDab)firstDab=resolved[i];}else{if(resolved[i].acceptCheck(true))resolved[i].commit();}}}if(firstDab){showDab(firstDab);}else if(!dontChange){initiateEdit(function(failure){performChanges(failure);},function(msg){alert(msg);});}});}function setMultiInput(){if(commitButton||onUpload)return;commitButton=make('input');commitButton.type='button';commitButton.value=HC.messages.commit;commitButton.onclick=multiSubmit;if(multiSpan)multiSpan.parentNode.replaceChild(commitButton,multiSpan);else catLine.appendChild(commitButton);}function checkMultiInput(){if(!commitButton)return;var hasChanges=false;for(var i=0;i<editors.length;i++){if(editors[i].state!==CategoryEditor.UNCHANGED){hasChanges=true;break;}}commitButton.disabled=!hasChanges;}var suggestionEngines={opensearch:{uri:
'/api.php?format=json&action=opensearch&namespace=14&limit=30&search=Category:$1',handler:function(queryResult,queryKey){if(queryResult&&queryResult.length>=2){var key=queryResult[0].substring(queryResult[0].indexOf(':')+1);var titles=queryResult[1];var exists=false;if(!cat_prefix)cat_prefix=new RegExp('^('+HC.category_regexp+'):');for(var i=0;i<titles.length;i++){cat_prefix.lastIndex=0;var m=cat_prefix.exec(titles[i]);if(m&&m.length>1){titles[i]=titles[i].substring(titles[i].indexOf(':')+1);if(key===titles[i])exists=true;}else{titles.splice(i,1);i--;}}titles.exists=exists;if(queryKey!==key)titles.normalized=key;return titles;}return null;}},internalsearch:{uri:'/api.php?format=json&action=query&list=allpages&apnamespace=14&aplimit=30&apfrom=$1&apprefix=$1',handler:function(queryResult){if(queryResult&&queryResult.query&&queryResult.query.allpages){var titles=queryResult.query.allpages;for(var i=0;i<titles.length;i++)titles[i]=titles[i].title.substring(titles[i].title.indexOf(':')+1);
return titles;}return null;}},exists:{uri:'/api.php?format=json&action=query&prop=info&titles=Category:$1',handler:function(queryResult,queryKey){if(queryResult&&queryResult.query&&queryResult.query.pages&&!queryResult.query.pages[-1]){for(var p in queryResult.query.pages){var title=queryResult.query.pages[p].title;title=title.substring(title.indexOf(':')+1);var titles=[title];titles.exists=true;if(queryKey!==title)titles.normalized=title;return titles;}}return null;}},subcategories:{uri:'/api.php?format=json&action=query&list=categorymembers&cmtype=subcat&cmlimit=max&cmtitle=Category:$1',handler:function(queryResult){if(queryResult&&queryResult.query&&queryResult.query.categorymembers){var titles=queryResult.query.categorymembers;for(var i=0;i<titles.length;i++)titles[i]=titles[i].title.substring(titles[i].title.indexOf(':')+1);return titles;}return null;}},parentcategories:{uri:'/api.php?format=json&action=query&prop=categories&titles=Category:$1&cllimit=max',handler:function(
queryResult){if(queryResult&&queryResult.query&&queryResult.query.pages){for(var p in queryResult.query.pages){if(queryResult.query.pages[p].categories){var titles=queryResult.query.pages[p].categories;for(var i=0;i<titles.length;i++)titles[i]=titles[i].title.substring(titles[i].title.indexOf(':')+1);return titles;}}}return null;}}};var suggestionConfigs={searchindex:{name:'Search index',engines:['opensearch'],cache:{},show:true,temp:false,noCompletion:false},pagelist:{name:'Page list',engines:['internalsearch','exists'],cache:{},show:true,temp:false,noCompletion:false},combined:{name:'Combined search',engines:['opensearch','internalsearch'],cache:{},show:true,temp:false,noCompletion:false},subcat:{name:'Subcategories',engines:['subcategories'],cache:{},show:true,temp:true,noCompletion:true},parentcat:{name:'Parent categories',engines:['parentcategories'],cache:{},show:true,temp:true,noCompletion:true}};CategoryEditor.UNCHANGED=0;CategoryEditor.OPEN=1;CategoryEditor.CHANGE_PENDING=2;
CategoryEditor.CHANGED=3;CategoryEditor.DELETED=4;var dummyElement=make('\xa0',true);function forceRedraw(){if(dummyElement.parentNode)document.body.removeChild(dummyElement);else document.body.appendChild(dummyElement);}var BS=8,TAB=9,RET=13,ESC=27,SPACE=32,PGUP=33,PGDOWN=34,UP=38,DOWN=40,DEL=46,IME=229;CategoryEditor.prototype={initialize:function(line,span,after,key,is_hidden){if(!span){this.isAddCategory=true;this.originalCategory='';this.originalKey=null;this.originalExists=false;if(!newDOM){span=make('span');span.className='noprint';if(key){span.appendChild(make(' | ',true));if(after){after.parentNode.insertBefore(span,after.nextSibling);after=after.nextSibling;}else if(line){line.appendChild(span);}}else if(line&&line.firstChild){span.appendChild(make(' ',true));line.appendChild(span);}}this.linkSpan=make('span');this.linkSpan.className='noprint nopopups hotcatlink';var lk=make('a');lk.href='#catlinks';lk.onclick=this.open.bind(this);lk.appendChild(make(HC.links.add,true));lk.
title=HC.tooltips.add;this.linkSpan.appendChild(lk);span=make(newDOM?'li':'span');span.className='noprint';if(is_rtl)span.dir='rtl';span.appendChild(this.linkSpan);if(after){after.parentNode.insertBefore(span,after.nextSibling);}else if(line){line.appendChild(span);}this.normalLinks=null;this.undelLink=null;this.catLink=null;}else{if(is_rtl)span.dir='rtl';this.isAddCategory=false;this.catLink=span.firstChild;this.originalCategory=after;this.originalKey=(key&&key.length>1)?key.substr(1):null;this.originalExists=!hasClass(this.catLink,'new');this.makeLinkSpan();if(!this.originalExists&&this.upDownLinks)this.upDownLinks.style.display='none';span.appendChild(this.linkSpan);}this.originalHidden=is_hidden;this.line=line;this.engine=HC.suggestions;this.span=span;this.currentCategory=this.originalCategory;this.currentExists=this.originalExists;this.currentHidden=this.originalHidden;this.currentKey=this.originalKey;this.state=CategoryEditor.UNCHANGED;this.lastSavedState=CategoryEditor.UNCHANGED
;this.lastSavedCategory=this.originalCategory;this.lastSavedKey=this.originalKey;this.lastSavedExists=this.originalExists;this.lastSavedHidden=this.originalHidden;if(this.catLink&&this.currentKey)this.catLink.title=this.currentKey;editors[editors.length]=this;},makeLinkSpan:function(){this.normalLinks=make('span');var lk=null;if(this.originalCategory&&this.originalCategory.length){lk=make('a');lk.href='#catlinks';lk.onclick=this.remove.bind(this);lk.appendChild(make(HC.links.remove,true));lk.title=HC.tooltips.remove;this.normalLinks.appendChild(make(' ',true));this.normalLinks.appendChild(lk);}if(!HC.template_categories[this.originalCategory]){lk=make('a');lk.href='#catlinks';lk.onclick=this.open.bind(this);lk.appendChild(make(HC.links.change,true));lk.title=HC.tooltips.change;this.normalLinks.appendChild(make(' ',true));this.normalLinks.appendChild(lk);if(!noSuggestions&&HC.use_up_down){this.upDownLinks=make('span');lk=make('a');lk.href='#catlinks';lk.onclick=this.down.bind(this);lk.
appendChild(make(HC.links.down,true));lk.title=HC.tooltips.down;this.upDownLinks.appendChild(make(' ',true));this.upDownLinks.appendChild(lk);lk=make('a');lk.href='#catlinks';lk.onclick=this.up.bind(this);lk.appendChild(make(HC.links.up,true));lk.title=HC.tooltips.up;this.upDownLinks.appendChild(make(' ',true));this.upDownLinks.appendChild(lk);this.normalLinks.appendChild(this.upDownLinks);}}this.linkSpan=make('span');this.linkSpan.className='noprint nopopups hotcatlink';this.linkSpan.appendChild(this.normalLinks);this.undelLink=make('span');this.undelLink.className='nopopups hotcatlink';this.undelLink.style.display='none';lk=make('a');lk.href='#catlinks';lk.onclick=this.restore.bind(this);lk.appendChild(make(HC.links.restore,true));lk.title=HC.tooltips.restore;this.undelLink.appendChild(make(' ',true));this.undelLink.appendChild(lk);this.linkSpan.appendChild(this.undelLink);},invokeSuggestions:function(dont_autocomplete){if(this.engine&&suggestionConfigs[this.engine]&&
suggestionConfigs[this.engine].temp&&!dont_autocomplete)this.engine=HC.suggestions;this.state=CategoryEditor.CHANGE_PENDING;var self=this;window.setTimeout(function(){self.textchange(dont_autocomplete);},HC.suggest_delay);},makeForm:function(){var form=make('form');form.method='POST';form.onsubmit=this.accept.bind(this);this.form=form;var self=this;var text=make('input');text.type='text';text.size=HC.editbox_width;if(!noSuggestions){text.onkeyup=function(evt){var key=evt.keyCode||0;if(self.ime&&self.lastKey===IME&&!self.usesComposition&&(key===TAB||key===RET||key===ESC||key===SPACE))self.ime=false;if(self.ime)return true;if(key===UP||key===DOWN||key===PGUP||key===PGDOWN){if(self.keyCount===0)return self.processKey(evt);}else{if(key===ESC&&self.lastKey!==IME){if(!self.resetKeySelection()){self.cancel();return;}}self.invokeSuggestions(key===BS||key===DEL||key===ESC);}return true;};text.onkeydown=function(evt){var key=evt.keyCode||0;self.lastKey=key;self.keyCount=0;if(!self.ime&&key===IME
&&!self.usesComposition){self.ime=true;}else if(self.ime&&key!==IME&&!(key>=16&&key<=20||key>=91&&key<=93||key===144)){self.ime=false;}if(self.ime)return true;if(key===RET)return self.accept(evt);return(key===ESC)?evtKill(evt):true;};text.onkeypress=function(evt){self.keyCount++;return self.processKey(evt);};$(text).on('focus',function(){makeActive(self);});$(text).on((text.onbeforedeactivate!==undefined&&text.createTextRange)?'beforedeactivate':'blur',this.saveView.bind(this));try{$(text).on('compositionstart',function(){self.lastKey=IME;self.usesComposition=true;self.ime=true;});$(text).on('compositionend',function(){self.lastKey=IME;self.usesComposition=true;self.ime=false;});$(text).on('textInput',function(){self.ime=false;self.invokeSuggestions(false);});}catch(any){}$(text).on('blur',function(){self.usesComposition=false;self.ime=false;});}this.text=text;this.icon=make('img');var list=null;if(!noSuggestions){list=make('select');list.onclick=function(){if(self.highlightSuggestion(
0))self.textchange(false,true);};list.ondblclick=function(e){if(self.highlightSuggestion(0))self.accept(e);};list.onchange=function(){self.highlightSuggestion(0);self.text.focus();};list.onkeyup=function(evt){if(evt.keyCode===ESC){self.resetKeySelection();self.text.focus();window.setTimeout(function(){self.textchange(true);},HC.suggest_delay);}else if(evt.keyCode===RET){self.accept(evt);}};if(!HC.fixed_search){var engineSelector=make('select');for(var key in suggestionConfigs){if(suggestionConfigs[key].show){var opt=make('option');opt.value=key;if(key===this.engine)opt.selected=true;opt.appendChild(make(suggestionConfigs[key].name,true));engineSelector.appendChild(opt);}}engineSelector.onchange=function(){self.engine=self.engineSelector.options[self.engineSelector.selectedIndex].value;self.text.focus();self.textchange(true,true);};this.engineSelector=engineSelector;}}this.list=list;function button_label(id,defaultText){var label=null;if(onUpload&&window.UFUI!==undefined&&window.
UIElements!==undefined&&UFUI.getLabel instanceof Function){try{label=UFUI.getLabel(id,true);while(label&&label.nodeType!==3)label=label.firstChild;}catch(ex){label=null;}}if(!label||!label.data)return defaultText;return label.data;}var OK=make('input');OK.type='button';OK.value=button_label('wpOkUploadLbl',HC.messages.ok);OK.onclick=this.accept.bind(this);this.ok=OK;var cancel=make('input');cancel.type='button';cancel.value=button_label('wpCancelUploadLbl',HC.messages.cancel);cancel.onclick=this.cancel.bind(this);this.cancelButton=cancel;var span=make('span');span.className='hotcatinput';span.style.position='relative';span.appendChild(text);span.appendChild(make('\xa0',true));span.style.whiteSpace='nowrap';if(list)span.appendChild(list);if(this.engineSelector)span.appendChild(this.engineSelector);if(!noSuggestions)span.appendChild(this.icon);span.appendChild(OK);span.appendChild(cancel);form.appendChild(span);form.style.display='none';this.span.appendChild(form);},display:function(evt)
{if(this.isAddCategory&&!onUpload&&this.line){new CategoryEditor(this.line,null,this.span,true);}if(!commitButton&&!onUpload){for(var i=0;i<editors.length;i++){if(editors[i].state!==CategoryEditor.UNCHANGED){setMultiInput();break;}}}if(!this.form)this.makeForm();if(this.list)this.list.style.display='none';if(this.engineSelector)this.engineSelector.style.display='none';this.currentCategory=this.lastSavedCategory;this.currentExists=this.lastSavedExists;this.currentHidden=this.lastSavedHidden;this.currentKey=this.lastSavedKey;this.icon.src=(this.currentExists?HC.existsYes:HC.existsNo);this.text.value=this.currentCategory+(this.currentKey!==null?'|'+this.currentKey:'');this.originalState=this.state;this.lastInput=this.currentCategory;this.inputExists=this.currentExists;this.state=this.state===CategoryEditor.UNCHANGED?CategoryEditor.OPEN:CategoryEditor.CHANGE_PENDING;this.lastSelection={start:this.currentCategory.length,end:this.currentCategory.length};this.showsList=false;if(this.catLink)
this.catLink.style.display='none';this.linkSpan.style.display='none';this.form.style.display='inline';this.ok.disabled=false;var result=evtKill(evt);this.text.focus();this.text.readOnly=false;checkMultiInput();return result;},show:function(evt,engine,readOnly){var result=this.display(evt);var v=this.lastSavedCategory;if(!v.length)return result;this.text.readOnly=!!readOnly;this.engine=engine;this.textchange(false,true);forceRedraw();return result;},open:function(evt){return this.show(evt,(this.engine&&suggestionConfigs[this.engine].temp)?HC.suggestions:this.engine);},down:function(evt){return this.show(evt,'subcat',true);},up:function(evt){return this.show(evt,'parentcat');},cancel:function(){if(this.isAddCategory&&!onUpload){this.removeEditor();return;}this.inactivate();this.form.style.display='none';if(this.catLink)this.catLink.style.display='';this.linkSpan.style.display='';this.state=this.originalState;this.currentCategory=this.lastSavedCategory;this.currentKey=this.lastSavedKey;
this.currentExists=this.lastSavedExists;this.currentHidden=this.lastSavedHidden;if(this.catLink)if(this.currentKey&&this.currentKey.length){this.catLink.title=this.currentKey;}else{this.catLink.title='';}if(this.state===CategoryEditor.UNCHANGED){if(this.catLink)this.catLink.style.backgroundColor='transparent';}else{if(!onUpload){try{this.catLink.style.backgroundColor=HC.bg_changed;}catch(ex){}}}checkMultiInput();forceRedraw();},removeEditor:function(){if(!newDOM){var next=this.span.nextSibling;if(next)next.parentNode.removeChild(next);}if(this.span&&this.span.parentNode){this.span.parentNode.removeChild(this.span);}for(var i=0;i<editors.length;i++){if(editors[i]===this){editors.splice(i,1);break;}}checkMultiInput();},rollback:function(evt){this.undoLink.parentNode.removeChild(this.undoLink);this.undoLink=null;this.currentCategory=this.originalCategory;this.currentKey=this.originalKey;this.currentExists=this.originalExists;this.currentHidden=this.originalHidden;this.lastSavedCategory=
this.originalCategory;this.lastSavedKey=this.originalKey;this.lastSavedExists=this.originalExists;this.lastSavedHidden=this.originalHidden;this.state=CategoryEditor.UNCHANGED;if(!this.currentCategory||!this.currentCategory.length){this.removeEditor();}else{this.catLink.removeChild(this.catLink.firstChild);this.catLink.appendChild(make(this.currentCategory,true));this.catLink.href=wikiPagePath(HC.category_canonical+':'+this.currentCategory);this.catLink.title=this.currentKey||'';this.catLink.className=this.currentExists?'':'new';this.catLink.style.backgroundColor='transparent';if(this.upDownLinks)this.upDownLinks.style.display=this.currentExists?'':'none';checkMultiInput();}return evtKill(evt);},inactivate:function(){if(this.list)this.list.style.display='none';if(this.engineSelector)this.engineSelector.style.display='none';this.is_active=false;},acceptCheck:function(dontCheck){this.sanitizeInput();var value=this.text.value.split('|');var key=null;if(value.length>1)key=value[1];var v=
value[0].replace(/_/g,' ').replace(/^\s+|\s+$/g,'');if(HC.capitalizePageNames)v=capitalize(v);this.lastInput=v;v=replaceShortcuts(v,HC.shortcuts);if(!v.length){this.cancel();return false;}if(!dontCheck&&(conf.wgNamespaceNumber===14&&v===conf.wgTitle||HC.blacklist&&HC.blacklist.test(v))){this.cancel();return false;}this.currentCategory=v;this.currentKey=key;this.currentExists=this.inputExists;return true;},accept:function(evt){this.noCommit=(evtKeys(evt)&1)!==0;var result=evtKill(evt);if(this.acceptCheck()){var toResolve=[this];var original=this.currentCategory;resolveMulti(toResolve,function(resolved){if(resolved[0].dab){showDab(resolved[0]);}else{if(resolved[0].acceptCheck(true)){resolved[0].commit((resolved[0].currentCategory!==original)?HC.messages.cat_resolved.replace(/\$1/g,original):null);}}});}return result;},close:function(){if(!this.catLink){this.catLink=make('a');this.catLink.appendChild(make('foo',true));this.catLink.style.display='none';this.span.insertBefore(this.catLink,
this.span.firstChild.nextSibling);}this.catLink.removeChild(this.catLink.firstChild);this.catLink.appendChild(make(this.currentCategory,true));this.catLink.href=wikiPagePath(HC.category_canonical+':'+this.currentCategory);this.catLink.className=this.currentExists?'':'new';this.lastSavedCategory=this.currentCategory;this.lastSavedKey=this.currentKey;this.lastSavedExists=this.currentExists;this.lastSavedHidden=this.currentHidden;this.inactivate();this.form.style.display='none';this.catLink.title=this.currentKey||'';this.catLink.style.display='';if(this.isAddCategory){if(onUpload&&this.line){new CategoryEditor(this.line,null,this.span,true);}this.isAddCategory=false;this.linkSpan.parentNode.removeChild(this.linkSpan);this.makeLinkSpan();this.span.appendChild(this.linkSpan);}if(!this.undoLink){var span=make('span');var lk=make('a');lk.href='#catlinks';lk.onclick=this.rollback.bind(this);lk.appendChild(make(HC.links.undo,true));lk.title=HC.tooltips.undo;span.appendChild(make(' ',true));span
.appendChild(lk);this.normalLinks.appendChild(span);this.undoLink=span;if(!onUpload){try{this.catLink.style.backgroundColor=HC.bg_changed;}catch(ex){}}}if(this.upDownLinks)this.upDownLinks.style.display=this.lastSavedExists?'':'none';this.linkSpan.style.display='';this.state=CategoryEditor.CHANGED;checkMultiInput();forceRedraw();},commit:function(){if((this.currentCategory===this.originalCategory&&(this.currentKey===this.originalKey||this.currentKey===null&&!this.originalKey.length))||conf.wgNamespaceNumber===14&&this.currentCategory===conf.wgTitle||HC.blacklist&&HC.blacklist.test(this.currentCategory)){this.cancel();return;}this.close();if(!commitButton&&!onUpload){var self=this;initiateEdit(function(failure){performChanges(failure,self);},function(msg){alert(msg);});}},remove:function(evt){this.doRemove(evtKeys(evt)&1);return evtKill(evt);},doRemove:function(noCommit){if(this.isAddCategory){this.cancel();return;}if(!commitButton&&!onUpload){for(var i=0;i<editors.length;i++){if(
editors[i].state!==CategoryEditor.UNCHANGED){setMultiInput();break;}}}if(commitButton){this.catLink.title='';this.catLink.style.cssText+='; text-decoration : line-through !important;';try{this.catLink.style.backgroundColor=HC.bg_changed;}catch(ex){}this.originalState=this.state;this.state=CategoryEditor.DELETED;this.normalLinks.style.display='none';this.undelLink.style.display='';checkMultiInput();}else{if(onUpload){this.removeEditor();}else{this.originalState=this.state;this.state=CategoryEditor.DELETED;this.noCommit=noCommit||HC.del_needs_diff;var self=this;initiateEdit(function(failure){performChanges(failure,self);},function(msg){self.state=self.originalState;alert(msg);});}}},restore:function(evt){this.catLink.title=this.currentKey||'';this.catLink.style.textDecoration='';this.state=this.originalState;if(this.state===CategoryEditor.UNCHANGED){this.catLink.style.backgroundColor='transparent';}else{try{this.catLink.style.backgroundColor=HC.bg_changed;}catch(ex){}}this.normalLinks.
style.display='';this.undelLink.style.display='none';checkMultiInput();return evtKill(evt);},selectEngine:function(engineName){if(!this.engineSelector)return;for(var i=0;i<this.engineSelector.options.length;i++)this.engineSelector.options[i].selected=this.engineSelector.options[i].value===engineName;},sanitizeInput:function(){var v=this.text.value||'';v=v.replace(/^(\s|_)+/,'');var re=new RegExp('^('+HC.category_regexp+'):');if(re.test(v))v=v.substring(v.indexOf(':')+1).replace(/^(\s|_)+/,'');v=v.replace(/\u200E$/,'');if(HC.capitalizePageNames)v=capitalize(v);if(this.text.value!==null&&this.text.value!==v)this.text.value=v;},makeCall:function(url,callbackObj,engine,queryKey,cleanKey){var cb=callbackObj,e=engine,v=queryKey,z=cleanKey,thisObj=this;function done(){cb.callsMade++;if(cb.callsMade===cb.nofCalls){if(cb.exists)cb.allTitles.exists=true;if(cb.normalized)cb.allTitles.normalized=cb.normalized;if(!cb.dontCache&&!suggestionConfigs[cb.engineName].cache[z])suggestionConfigs[cb.
engineName].cache[z]=cb.allTitles;thisObj.text.readOnly=false;if(!cb.cancelled)thisObj.showSuggestions(cb.allTitles,cb.noCompletion,v,cb.engineName);if(cb===thisObj.callbackObj)thisObj.callbackObj=null;cb=undefined;}}$.getJSON(url,function(json){var titles=e.handler(json,z);if(titles&&titles.length){if(cb.allTitles===null)cb.allTitles=titles;else cb.allTitles=cb.allTitles.concat(titles);if(titles.exists)cb.exists=true;if(titles.normalized)cb.normalized=titles.normalized;}done();}).fail(function(req){if(!req)noSuggestions=true;cb.dontCache=true;done();});},callbackObj:null,textchange:function(dont_autocomplete,force){makeActive(this);this.sanitizeInput();var v=this.text.value;var pipe=v.indexOf('|');if(pipe>=0){this.currentKey=v.substring(pipe+1);v=v.substring(0,pipe);}else{this.currentKey=null;}if(this.lastInput===v&&!force)return;if(this.lastInput!==v)checkMultiInput();this.lastInput=v;this.lastRealInput=v;this.ok.disabled=v.length&&HC.blacklist&&HC.blacklist.test(v);if(noSuggestions)
{if(this.list)this.list.style.display='none';if(this.engineSelector)this.engineSelector.style.display='none';if(this.icon)this.icon.style.display='none';return;}if(!v.length){this.showSuggestions([]);return;}var cleanKey=v.replace(/[\u200E\u200F\u202A-\u202E]/g,'').replace(wikiTextBlankRE,' ');cleanKey=replaceShortcuts(cleanKey,HC.shortcuts);cleanKey=cleanKey.replace(/^\s+|\s+$/g,'');if(!cleanKey.length){this.showSuggestions([]);return;}if(this.callbackObj)this.callbackObj.cancelled=true;var engineName=suggestionConfigs[this.engine]?this.engine:'combined';dont_autocomplete=dont_autocomplete||suggestionConfigs[engineName].noCompletion;if(suggestionConfigs[engineName].cache[cleanKey]){this.showSuggestions(suggestionConfigs[engineName].cache[cleanKey],dont_autocomplete,v,engineName);return;}var engines=suggestionConfigs[engineName].engines;this.callbackObj={allTitles:null,callsMade:0,nofCalls:engines.length,noCompletion:dont_autocomplete,engineName:engineName};this.makeCalls(engines,this.
callbackObj,v,cleanKey);},makeCalls:function(engines,cb,v,cleanKey){for(var j=0;j<engines.length;j++){var engine=suggestionEngines[engines[j]];var url=conf.wgServer+conf.wgScriptPath+engine.uri.replace(/\$1/g,encodeURIComponent(cleanKey));this.makeCall(url,cb,engine,v,cleanKey);}},showSuggestions:function(titles,dontAutocomplete,queryKey,engineName){this.text.readOnly=false;this.dab=null;this.showsList=false;if(!this.list)return;if(noSuggestions){if(this.list)this.list.style.display='none';if(this.engineSelector)this.engineSelector.style.display='none';if(this.icon)this.icon.style.display='none';this.inputExists=true;return;}this.engineName=engineName;if(engineName){if(!this.engineSelector)this.engineName=null;}else{if(this.engineSelector)this.engineSelector.style.display='none';}if(queryKey){if(this.lastInput.indexOf(queryKey))return;if(this.lastQuery&&this.lastInput.indexOf(this.lastQuery)===0&&this.lastQuery.length>queryKey.length)return;}this.lastQuery=queryKey;var v=this.text.
value.split('|');var key=v.length>1?'|'+v[1]:'';v=(HC.capitalizePageNames?capitalize(v[0]):v[0]);var vNormalized=v;var knownToExist=titles&&titles.exists;var i;if(titles){if(titles.normalized&&v.indexOf(queryKey)===0){vNormalized=titles.normalized+v.substring(queryKey.length);}var vLow=vNormalized.toLowerCase();if(HC.blacklist){for(i=0;i<titles.length;i++){if(HC.blacklist.test(titles[i])){titles.splice(i,1);i--;}}}titles.sort(function(a,b){if(a===b)return 0;if(a.indexOf(b)===0)return 1;if(b.indexOf(a)===0)return-1;var prefixMatchA=(a.indexOf(vNormalized)===0?1:0);var prefixMatchB=(b.indexOf(vNormalized)===0?1:0);if(prefixMatchA!==prefixMatchB)return prefixMatchB-prefixMatchA;var aLow=a.toLowerCase(),bLow=b.toLowerCase();prefixMatchA=(aLow.indexOf(vLow)===0?1:0);prefixMatchB=(bLow.indexOf(vLow)===0?1:0);if(prefixMatchA!==prefixMatchB)return prefixMatchB-prefixMatchA;if(a<b)return-1;if(b<a)return 1;return 0;});for(i=0;i<titles.length;i++){if(i+1<titles.length&&titles[i]===titles[i+1]||
conf.wgNamespaceNumber===14&&titles[i]===conf.wgTitle){titles.splice(i,1);i--;}}}if(!titles||!titles.length){if(this.list)this.list.style.display='none';if(this.engineSelector)this.engineSelector.style.display='none';if(engineName&&suggestionConfigs[engineName]&&!suggestionConfigs[engineName].temp){if(this.icon)this.icon.src=HC.existsNo;this.inputExists=false;}return;}var firstTitle=titles[0];var completed=this.autoComplete(firstTitle,v,vNormalized,key,dontAutocomplete);var existing=completed||knownToExist||firstTitle===replaceShortcuts(v,HC.shortcuts);if(engineName&&suggestionConfigs[engineName]&&!suggestionConfigs[engineName].temp){this.icon.src=(existing?HC.existsYes:HC.existsNo);this.inputExists=existing;}if(completed){this.lastInput=firstTitle;if(titles.length===1){this.list.style.display='none';if(this.engineSelector)this.engineSelector.style.display='none';return;}}while(this.list.firstChild)this.list.removeChild(this.list.firstChild);for(i=0;i<titles.length;i++){var opt=make(
'option');opt.appendChild(make(titles[i],true));opt.selected=completed&&(i===0);this.list.appendChild(opt);}this.displayList();},displayList:function(){this.showsList=true;if(!this.is_active){this.list.style.display='none';if(this.engineSelector)this.engineSelector.style.display='none';return;}var nofItems=(this.list.options.length>HC.listSize?HC.listSize:this.list.options.length);if(nofItems<=1)nofItems=2;this.list.size=nofItems;this.list.style.align=is_rtl?'right':'left';this.list.style.zIndex=5;this.list.style.position='absolute';var anchor=is_rtl?'right':'left';var listh=0;if(this.list.style.display==='none'){this.list.style.top=this.text.offsetTop+'px';this.list.style[anchor]='-10000px';this.list.style.display='';listh=this.list.offsetHeight;this.list.style.display='none';}else{listh=this.list.offsetHeight;}var maxListHeight=listh;if(nofItems<HC.listSize)maxListHeight=(listh/nofItems)*HC.listSize;function viewport(what){if(is_webkit&&!document.evaluate){return window['inner'+what]
;}var s='client'+what;if(window.opera)return document.body[s];return(document.documentElement?document.documentElement[s]:0)||document.body[s]||0;}function scroll_offset(what){var s='scroll'+what;var result=(document.documentElement?document.documentElement[s]:0)||document.body[s]||0;if(is_rtl&&what==='Left'){if(result<0)result=-result;if(!is_webkit)result=scroll_offset('Width')-viewport('Width')-result;}return result;}function position(node){if(node.getBoundingClientRect){var box=node.getBoundingClientRect();return{x:Math.round(box.left+scroll_offset('Left')),y:Math.round(box.top+scroll_offset('Top'))};}var t=0,l=0;do{t+=(node.offsetTop||0);l+=(node.offsetLeft||0);node=node.offsetParent;}while(node);return{x:l,y:t};}var textPos=position(this.text),nl=0,nt=0,offset=0,textBoxWidth=this.text.offsetWidth||this.text.clientWidth;if(this.engineName){this.engineSelector.style.zIndex=5;this.engineSelector.style.position='absolute';this.engineSelector.style.width=textBoxWidth+'px';if(this.
engineSelector.style.display==='none'){this.engineSelector.style[anchor]='-10000px';this.engineSelector.style.top='0';this.engineSelector.style.display='';offset=this.engineSelector.offsetHeight;this.engineSelector.style.display='none';}else{offset=this.engineSelector.offsetHeight;}this.engineSelector.style[anchor]=nl+'px';}if(textPos.y<maxListHeight+offset+1){nt=this.text.offsetHeight+offset+1;if(this.engineName)this.engineSelector.style.top=this.text.offsetHeight+'px';}else{nt=-listh-offset-1;if(this.engineName)this.engineSelector.style.top=-(offset+1)+'px';}this.list.style.top=nt+'px';this.list.style.width='';this.list.style[anchor]=nl+'px';if(this.engineName){this.selectEngine(this.engineName);this.engineSelector.style.display='';}this.list.style.display='block';if(this.list.offsetWidth<textBoxWidth){this.list.style.width=textBoxWidth+'px';return;}var scroll=scroll_offset('Left');var view_w=viewport('Width');var w=this.list.offsetWidth;var l_pos=position(this.list);var left=l_pos.x
;var right=left+w;if(left<scroll||right>scroll+view_w){if(w>view_w){w=view_w;this.list.style.width=w+'px';if(is_rtl)left=right-w;else right=left+w;}var relative_offset=0;if(left<scroll)relative_offset=scroll-left;else if(right>scroll+view_w)relative_offset=-(right-scroll-view_w);if(is_rtl)relative_offset=-relative_offset;if(relative_offset)this.list.style[anchor]=(nl+relative_offset)+'px';}},autoComplete:function(newVal,actVal,normalizedActVal,key,dontModify){if(newVal===actVal)return true;if(dontModify||this.ime||!this.canSelect())return false;if(newVal.indexOf(actVal)){if(normalizedActVal&&newVal.indexOf(normalizedActVal)===0){if(this.lastRealInput===actVal)this.lastRealInput=normalizedActVal;actVal=normalizedActVal;}else{return false;}}this.text.focus();this.text.value=newVal+key;this.setSelection(actVal.length,newVal.length);return true;},canSelect:function(){return this.text.setSelectionRange||this.text.createTextRange||this.text.selectionStart!==undefined&&this.text.selectionEnd
!==undefined;},setSelection:function(from,to){if(!this.text.value)return;if(this.text.setSelectionRange){this.text.setSelectionRange(from,to);}else if(this.text.selectionStart!==undefined){if(from>this.text.selectionStart){this.text.selectionEnd=to;this.text.selectionStart=from;}else{this.text.selectionStart=from;this.text.selectionEnd=to;}}else if(this.text.createTextRange){var new_selection=this.text.createTextRange();new_selection.move('character',from);new_selection.moveEnd('character',to-from);new_selection.select();}},getSelection:function(){var from=0,to=0;if(!this.text.value){}else if(this.text.selectionStart!==undefined){from=this.text.selectionStart;to=this.text.selectionEnd;}else if(document.selection&&document.selection.createRange){var rng=document.selection.createRange().duplicate();if(rng.parentElement()===this.text){try{var textRng=this.text.createTextRange();textRng.move('character',0);textRng.setEndPoint('EndToEnd',rng);to=textRng.text.length;textRng.setEndPoint(
'EndToStart',rng);from=textRng.text.length;}catch(notFocused){from=this.text.value.length;to=from;}}}return{start:from,end:to};},saveView:function(){this.lastSelection=this.getSelection();},processKey:function(evt){var dir=0;switch(this.lastKey){case UP:dir=-1;break;case DOWN:dir=1;break;case PGUP:dir=-HC.listSize;break;case PGDOWN:dir=HC.listSize;break;case ESC:return evtKill(evt);}if(dir){if(this.list.style.display!=='none'){this.highlightSuggestion(dir);return evtKill(evt);}else if(this.keyCount<=1&&(!this.callbackObj||this.callbackObj.callsMade===this.callbackObj.nofCalls)){this.textchange();}}return true;},highlightSuggestion:function(dir){if(noSuggestions||!this.list||this.list.style.display==='none')return false;var curr=this.list.selectedIndex;var tgt=-1;if(dir===0){if(curr<0||curr>=this.list.options.length)return false;tgt=curr;}else{tgt=curr<0?0:curr+dir;tgt=tgt<0?0:tgt;if(tgt>=this.list.options.length)tgt=this.list.options.length-1;}if(tgt!==curr||dir===0){if(curr>=0&&curr<
this.list.options.length&&dir!==0)this.list.options[curr].selected=false;this.list.options[tgt].selected=true;var v=this.text.value.split('|');var key=v.length>1?'|'+v[1]:'';var completed=this.autoComplete(this.list.options[tgt].text,this.lastRealInput,null,key,false);if(!completed||this.list.options[tgt].text===this.lastRealInput){this.text.value=this.list.options[tgt].text+key;if(this.canSelect())this.setSelection(this.list.options[tgt].text.length,this.list.options[tgt].text.length);}this.lastInput=this.list.options[tgt].text;this.inputExists=true;if(this.icon)this.icon.src=HC.existsYes;this.state=CategoryEditor.CHANGE_PENDING;}return true;},resetKeySelection:function(){if(noSuggestions||!this.list||this.list.style.display==='none')return false;var curr=this.list.selectedIndex;if(curr>=0&&curr<this.list.options.length){this.list.options[curr].selected=false;var v=this.text.value.split('|');var key=v.length>1?'|'+v[1]:'';var result=v[0]!==this.lastInput;if(v[0]!==this.lastRealInput){
this.text.value=this.lastRealInput+key;result=true;}this.lastInput=this.lastRealInput;return result;}return false;}};function initialize(){var config=(window.JSconfig!==undefined&&JSconfig.keys)?JSconfig.keys:{};HC.dont_add_to_watchlist=(window.hotcat_dont_add_to_watchlist!==undefined?!!window.hotcat_dont_add_to_watchlist:(config.HotCatDontAddToWatchlist!==undefined?config.HotCatDontAddToWatchlist:HC.dont_add_to_watchlist));HC.no_autocommit=(window.hotcat_no_autocommit!==undefined?!!window.hotcat_no_autocommit:(config.HotCatNoAutoCommit!==undefined?config.HotCatNoAutoCommit:(conf.wgNamespaceNumber%2?true:HC.no_autocommit)));HC.del_needs_diff=(window.hotcat_del_needs_diff!==undefined?!!window.hotcat_del_needs_diff:(config.HotCatDelNeedsDiff!==undefined?config.HotCatDelNeedsDiff:HC.del_needs_diff));HC.suggest_delay=window.hotcat_suggestion_delay||config.HotCatSuggestionDelay||HC.suggest_delay;HC.editbox_width=window.hotcat_editbox_width||config.HotCatEditBoxWidth||HC.editbox_width;HC.
suggestions=window.hotcat_suggestions||config.HotCatSuggestions||HC.suggestions;if(typeof HC.suggestions!=='string'||!suggestionConfigs[HC.suggestions])HC.suggestions='combined';HC.fixed_search=(window.hotcat_suggestions_fixed!==undefined?!!window.hotcat_suggestions_fixed:(config.HotCatFixedSuggestions!==undefined?config.HotCatFixedSuggestions:HC.fixed_search));HC.single_minor=(window.hotcat_single_changes_are_minor!==undefined?!!window.hotcat_single_changes_are_minor:(config.HotCatMinorSingleChanges!==undefined?config.HotCatMinorSingleChanges:HC.single_minor));HC.bg_changed=window.hotcat_changed_background||config.HotCatChangedBackground||HC.bg_changed;HC.use_up_down=(window.hotcat_use_category_links!==undefined?!!window.hotcat_use_category_links:(config.HotCatUseCategoryLinks!==undefined?config.HotCatUseCategoryLinks:HC.use_up_down));HC.listSize=window.hotcat_list_size||config.HotCatListSize||HC.listSize;if(conf.wgDBname!=='commonswiki')HC.changeTag=config.HotCatChangeTag||'';if(HC.
changeTag){var eForm=document.editform,catRegExp=new RegExp('^\\[\\[('+HC.category_regexp+'):'),oldTxt;var isMinorChange=function(){var newTxt=eForm.wpTextbox1;if(!newTxt)return;newTxt=newTxt.value;var oldLines=oldTxt.match(/^.*$/gm),newLines=newTxt.match(/^.*$/gm),cArr;var except=function(aArr,bArr){var result=[],lArr,sArr;if(aArr.length<bArr.length){lArr=bArr;sArr=aArr;}else{lArr=aArr;sArr=bArr;}for(var i=0;i<lArr.length;i++){var item=lArr[i];var ind=$.inArray(item,sArr);if(ind===-1)result.push(item);else sArr.splice(ind,1);}return result.concat(sArr);};cArr=except(oldLines,newLines);if(cArr.length){cArr=$.grep(cArr,function(c){c=$.trim(c);return(c&&!catRegExp.test(c));});}if(!cArr.length){oldTxt=newTxt;return true;}};if(conf.wgAction==='submit'&&conf.wgArticleId&&eForm&&eForm.wpSummary&&document.getElementById('wikiDiff')){var sum=eForm.wpSummary,sumA=eForm.wpAutoSummary;if(sum.value&&sumA.value===HC.changeTag){sumA.value=sumA.value.replace(HC.changeTag,
'd41d8cd98f00b204e9800998ecf8427e');var $ct=$('<input type="hidden" name="wpChangeTags">').val(HC.changeTag);$(eForm).append($ct);oldTxt=eForm.wpTextbox1.value;$('#wpSave').one('click',function(){if($ct.val())sum.value=sum.value.replace((HC.messages.using||HC.messages.prefix),'');});var removeChangeTag=function(){$(eForm.wpTextbox1).add(sum).one('input',function(){window.setTimeout(function(){if(!isMinorChange())$ct.val('');else removeChangeTag();},500);});};removeChangeTag();}}}HC.listSize=parseInt(HC.listSize,10);if(isNaN(HC.listSize)||HC.listSize<5)HC.listSize=5;HC.listSize=Math.min(HC.listSize,30);if(HC.engine_names){for(var key in HC.engine_names)if(suggestionConfigs[key]&&HC.engine_names[key])suggestionConfigs[key].name=HC.engine_names[key];}is_rtl=hasClass(document.body,'rtl');if(!is_rtl){if(document.defaultView&&document.defaultView.getComputedStyle){is_rtl=document.defaultView.getComputedStyle(document.body,null).getPropertyValue('direction');}else if(document.body.
currentStyle){is_rtl=document.body.currentStyle.direction;}else{is_rtl=document.body.style.direction;}is_rtl=(is_rtl==='rtl');}}function can_edit(){var container=null;switch(mw.config.get('skin')){case'cologneblue':container=document.getElementById('quickbar');case'standard':case'nostalgia':if(!container)container=document.getElementById('topbar');var lks=container.getElementsByTagName('a');for(var i=0;i<lks.length;i++){if(param('title',lks[i].href)===conf.wgPageName&&param('action',lks[i].href)==='edit'){return true;}}return false;default:return document.getElementById('ca-edit')!==null;}}function closeForm(){for(var i=0;i<editors.length;i++){var edit=editors[i];if(edit.state===CategoryEditor.OPEN){edit.cancel();}else if(edit.state===CategoryEditor.CHANGE_PENDING){edit.sanitizeInput();var value=edit.text.value.split('|');var key=null;if(value.length>1)key=value[1];var v=value[0].replace(/_/g,' ').replace(/^\s+|\s+$/g,'');if(!v.length){edit.cancel();}else{edit.currentCategory=v;edit.
currentKey=key;edit.currentExists=this.inputExists;edit.close();}}}}function setup_upload(){onUpload=true;var ip=document.getElementById('mw-htmlform-description')||document.getElementById('wpDestFile');if(!ip){ip=document.getElementById('wpDestFile');while(ip&&ip.nodeName.toLowerCase()!=='table')ip=ip.parentNode;}if(!ip)return;var reupload=document.getElementById('wpForReUpload');var destFile=document.getElementById('wpDestFile');if((reupload&&!!reupload.value)||(destFile&&(destFile.disabled||destFile.readOnly))){return;}var labelCell=make('td');var lineCell=make('td');catLine=make('div');catLine.className='catlinks';catLine.id='catlinks';catLine.style.textAlign=is_rtl?'right':'left';catLine.style.margin='0';catLine.style.border='none';lineCell.appendChild(catLine);var label=null;if(window.UFUI&&window.UIElements&&UFUI.getLabel instanceof Function){try{label=UFUI.getLabel('wpCategoriesUploadLbl');}catch(ex){label=null;}}if(!label){labelCell.id='hotcatLabel';labelCell.appendChild(make(
HC.categories,true));}else{labelCell.id='hotcatLabelTranslated';labelCell.appendChild(label);}labelCell.className='mw-label';labelCell.style.textAlign='right';labelCell.style.verticalAlign='middle';var form=document.getElementById('upload')||document.getElementById('mw-upload-form');if(form){var newRow=ip.insertRow(-1);newRow.appendChild(labelCell);newRow.appendChild(lineCell);form.onsubmit=(function(oldSubmit){return function(){var do_submit=true;if(oldSubmit){if(typeof oldSubmit==='string'){do_submit=eval(oldSubmit);}else if(oldSubmit instanceof Function){do_submit=oldSubmit.apply(form,arguments);}}if(!do_submit)return false;closeForm();var eb=document.getElementById('wpUploadDescription')||document.getElementById('wpDesc');var addedOne=false;for(var i=0;i<editors.length;i++){var t=editors[i].currentCategory;if(!t)continue;var key=editors[i].currentKey;var new_cat='[['+HC.category_canonical+':'+t+(key?'|'+key:'')+']]';var cleanedText=eb.value.replace(/<!--(\s|\S)*?-->/g,'').replace(
/<nowiki>(\s|\S)*?<\/nowiki>/g,'');if(!find_category(cleanedText,t,true)){eb.value+='\n'+new_cat;addedOne=true;}}if(addedOne){eb.value=eb.value.replace(/\{\{subst:unc\}\}/g,'');}return true;};}(form.onsubmit));}}var cleanedText=null;function isOnPage(span){if(span.firstChild.nodeType!==Node.ELEMENT_NODE)return null;var catTitle=title(span.firstChild.getAttribute('href'));if(!catTitle)return null;catTitle=catTitle.substr(catTitle.indexOf(':')+1).replace(/_/g,' ');if(HC.blacklist&&HC.blacklist.test(catTitle))return null;var result={title:catTitle,match:['','','']};if(pageText===null)return result;if(cleanedText===null){cleanedText=pageText.replace(/<!--(\s|\S)*?-->/g,'').replace(/<nowiki>(\s|\S)*?<\/nowiki>/g,'');}result.match=find_category(cleanedText,catTitle,true);return result;}var initialized=false;var setupTimeout=null;function findByClass(scope,tag,className){var result=$(scope).find(tag+'.'+className);return(result&&result.length)?result[0]:null;}function setup(additionalWork){if
(initialized)return;initialized=true;if(setupTimeout){window.clearTimeout(setupTimeout);setupTimeout=null;}catLine=catLine||document.getElementById('mw-normal-catlinks');var hiddenCats=document.getElementById('mw-hidden-catlinks');if(!catLine){var footer=null;if(!hiddenCats){footer=findByClass(document,'div','printfooter');if(!footer)return;}catLine=make('div');catLine.id='mw-normal-catlinks';catLine.style.textAlign=is_rtl?'right':'left';var label=make('a');label.href=conf.wgArticlePath.replace('$1','Special:Categories');label.title=HC.categories;label.appendChild(make(HC.categories,true));catLine.appendChild(label);catLine.appendChild(make(':',true));var container=(hiddenCats?hiddenCats.parentNode:document.getElementById('catlinks'));if(!container){container=make('div');container.id='catlinks';footer.parentNode.insertBefore(container,footer.nextSibling);}container.className='catlinks noprint';container.style.display='';if(!hiddenCats)container.appendChild(catLine);else container.
insertBefore(catLine,hiddenCats);}if(is_rtl)catLine.dir='rtl';function createEditors(line,is_hidden){var i;var cats=line.getElementsByTagName('li');if(cats.length){newDOM=true;line=cats[0].parentNode;}else{cats=line.getElementsByTagName('span');}var copyCats=new Array(cats.length);for(i=0;i<cats.length;i++)copyCats[i]=cats[i];for(i=0;i<copyCats.length;i++){var test=isOnPage(copyCats[i]);if(test!==null&&test.match!==null&&line){new CategoryEditor(line,copyCats[i],test.title,test.match[2],is_hidden);}}return copyCats.length?copyCats[copyCats.length-1]:null;}var lastSpan=createEditors(catLine,false);new CategoryEditor(newDOM?catLine.getElementsByTagName('ul')[0]:catLine,null,null,lastSpan!==null,false);if(!onUpload){if(pageText!==null&&hiddenCats){if(is_rtl)hiddenCats.dir='rtl';createEditors(hiddenCats,true);}var enableMulti=make('span');enableMulti.className='noprint';if(is_rtl)enableMulti.dir='rtl';catLine.insertBefore(enableMulti,catLine.firstChild.nextSibling);enableMulti.appendChild(
make('\xa0',true));multiSpan=make('span');enableMulti.appendChild(multiSpan);multiSpan.innerHTML='(<a>'+HC.addmulti+'</a>)';var lk=multiSpan.getElementsByTagName('a')[0];lk.onclick=function(evt){setMultiInput();checkMultiInput();return evtKill(evt);};lk.title=HC.multi_tooltip;lk.style.cursor='pointer';}cleanedText=null;if(additionalWork instanceof Function)additionalWork();mw.hook('hotcat.ready').fire();$('body').trigger('hotcatSetupCompleted');}function createCommitForm(){if(commitForm)return;var formContainer=make('div');formContainer.style.display='none';document.body.appendChild(formContainer);formContainer.innerHTML='<form id="hotcatCommitForm" method="post" enctype="multipart/form-data" action="'+conf.wgScript+'?title='+encodeURIComponent(conf.wgPageName)+'&action=submit">'+'<input type="hidden" name="wpTextbox1">'+'<input type="hidden" name="model" value="'+conf.wgPageContentModel+'">'+'<input type="hidden" name="format" value="text/x-wiki">'+
'<input type="hidden" name="wpSummary" value="">'+'<input type="checkbox" name="wpMinoredit" value="1">'+'<input type="checkbox" name="wpWatchthis" value="1">'+'<input type="hidden" name="wpAutoSummary" value="d41d8cd98f00b204e9800998ecf8427e">'+'<input type="hidden" name="wpEdittime">'+'<input type="hidden" name="wpStarttime">'+'<input type="hidden" name="wpDiff" value="wpDiff">'+'<input type="hidden" name="oldid" value="0">'+'<input type="submit" name="hcCommit" value="hcCommit">'+'<input type="hidden" name="wpEditToken">'+'<input type="hidden" name="wpUltimateParam" value="1">'+'<input type="hidden" name="wpChangeTags">'+'<input type="hidden" value="ℳ𝒲♥𝓊𝓃𝒾𝒸ℴ𝒹ℯ" name="wpUnicodeCheck">'+'</form>';commitForm=document.getElementById('hotcatCommitForm');}function getPage(){if(!conf.wgArticleId){if(conf.wgNamespaceNumber===2)return;pageText='';pageTime=null;setup(createCommitForm);}else{var url=conf.wgServer+conf.wgScriptPath+
'/api.php?format=json&callback=HotCat.start&action=query&rawcontinue=&titles='+encodeURIComponent(conf.wgPageName)+'&prop=info%7Crevisions&rvprop=content%7Ctimestamp%7Cids&meta=siteinfo&rvlimit=1&rvstartid='+conf.wgCurRevisionId;var s=make('script');s.src=url;HC.start=function(json){setPage(json);setup(createCommitForm);};document.getElementsByTagName('head')[0].appendChild(s);setupTimeout=window.setTimeout(function(){setup(createCommitForm);},4000);}}function setState(state){var cats=state.split('\n');if(!cats.length)return null;if(initialized&&editors.length===1&&editors[0].isAddCategory){var newSpans=[];var before=editors.length===1?editors[0].span:null;var i;for(i=0;i<cats.length;i++){if(!cats[i].length)continue;var cat=cats[i].split('|');var key=cat.length>1?cat[1]:null;cat=cat[0];var lk=make('a');lk.href=wikiPagePath(HC.category_canonical+':'+cat);lk.appendChild(make(cat,true));lk.title=cat;var span=make('span');span.appendChild(lk);if(!i)catLine.insertBefore(make(' ',true),
before);catLine.insertBefore(span,before);if(before&&i+1<cats.length)parent.insertBefore(make(' | ',true),before);newSpans.push({element:span,title:cat,key:key});}if(before)before.parentNode.insertBefore(make(' | ',true),before);for(i=0;i<newSpans.length;i++){new CategoryEditor(catLine,newSpans[i].element,newSpans[i].title,newSpans[i].key);}}return null;}function getState(){var result=null;for(var i=0;i<editors.length;i++){var text=editors[i].currentCategory;var key=editors[i].currentKey;if(text&&text.length){if(key!==null)text+='|'+key;if(result===null)result=text;else result+='\n'+text;}}return result;}function really_run(){initialize();if(!HC.upload_disabled&&conf.wgNamespaceNumber===-1&&conf.wgCanonicalSpecialPageName==='Upload'&&conf.wgUserName){setup_upload();setup(function(){if(window.UploadForm&&UploadForm.previous_hotcat_state)UploadForm.previous_hotcat_state=setState(UploadForm.previous_hotcat_state);});}else{if(!conf.wgIsArticle||conf.wgAction!=='view'||param('diff')!==null
||param('oldid')!==null||!can_edit()||HC.disable())return;getPage();}}function run(){if(HC.started)return;HC.started=true;loadTrigger.register(really_run);}window.hotcat_get_state=function(){return getState();};window.hotcat_set_state=function(state){return setState(state);};window.hotcat_close_form=function(){closeForm();};HC.runWhenReady=function(callback){mw.hook('hotcat.ready').add(callback);};mw.config.set('disableAJAXCategories',true);if(conf.wgCanonicalSpecialPageName!=='Upload'){mw.hook('postEdit').add(function(){if(document.querySelector('#catlinks .hotcatlink')){return;}catLine=null;editors=[];initialized=false;HC.started=false;run();});}$.when(mw.loader.using('user'),$.ready).always(run);}(jQuery,mediaWiki));mw.loader.using(['mediawiki.user','mediawiki.util','jquery.cookie'],function(){'use strict';if(6!==mw.config.get('wgNamespaceNumber')||window.HotCatAutoRemoveCheckCatOptOut||!$('.checkcategories')[0])return;var chCatRE=/\{\{[Cc]heck[ _]categories[^\}\{]*\}\}/g,selfName=
'([[MediaWiki:Gadget-Hotcatcheck.js|Script]]): ',cookieName='checkCat',cookie=$.cookie(cookieName);var createjIcon=function(iconClass){return $('<span>').attr('class','ui-icon '+iconClass+' catcheck-inline-icon').text(' ');};var createNotifyArea=function(textNode,icon,state){return $('<div>').attr('class','ui-widget').append($('<div>').attr({'class':state+' ui-corner-all',style:'margin-top: 20px; padding: 0.7em;'}).append($('<p>').append(createjIcon(icon).css('marginRight','0.3em'),textNode)));};mw.util.addCSS('.catcheck-inline-icon { display: inline-block; position: relative; top: 2px; }');$('body').one('submit.checkCatListener','#hotcatCommitForm',function(e){if('disabled'===cookie)return true;var hotCatForm=this,newVal=hotCatForm.wpTextbox1.value.replace(chCatRE,''),dlgButtons={},$dlgCheckCookie,$permaSaveHint,$textHintNode,$dlg;var doRemove=function(){hotCatForm.wpSummary.value='Removing [[Template:Check categories|{'+'{Check categories}}]] '+hotCatForm.wpSummary.value;hotCatForm.
wpTextbox1.value=newVal;};var writeCookie=function(val){$.cookie(cookieName,val,{expires:7,path:'/'});};dlgButtons['Yes, Remove']=function(){doRemove();if($dlgCheckCookie[0].checked)writeCookie('auto');$(this).dialog('close');};dlgButtons['No, keep it']=function(){if($dlgCheckCookie[0].checked)writeCookie('disabled');$(this).dialog('close');};var _addToJS=function(e){e.preventDefault();if($permaSaveHint.hasClass('ui-state-disabled'))return;var $el=$(this);$el.off('click').text('Please wait.');$permaSaveHint.addClass('ui-state-disabled');var params={action:'edit',title:'User:'+mw.config.get('wgUserName')+'/common.js',summary:selfName+'Saving HotCat configuration.',appendtext:$el.data('addText'),token:(window['wikilove-edittoken']||mw.user.tokens.get('csrfToken')),format:'json'};var editDone=function(editStat){if(!editStat)return;if(editStat.error){alert('Unable to save to your common.js using the API\n'+editStat.error.code+'\n'+editStat.error.info);$el.text('Edit-Error!');}else{$el.text
('Done.');$permaSaveHint.fadeOut();}};$.post(mw.util.wikiScript('api'),params,editDone);};var prompt=function(){$dlgCheckCookie=$('<input type="checkbox" />').attr({id:'hotCatAutoRemoveCheckCatCookie'}).change(function(){if(this.checked){$permaSaveHint.fadeIn();}else{$permaSaveHint.fadeOut();}});$textHintNode=$('<ul>');$('<li>').append($('<a>',{href:'#',text:'Disable this feature.'}).data('addText','\nwindow.HotCatAutoRemoveCheckCatOptOut = true;').click(_addToJS)).appendTo($textHintNode);$('<li>').append($('<a>',{href:'#',text:'Remove {{check categories}} when editing using HotCat without prompting.'}).data('addText','\nwindow.HotCatAutoRemoveCheckCat = true;').click(_addToJS)).appendTo($textHintNode);$permaSaveHint=createNotifyArea($('<span>',{text:'Save these setting in your common.js: '}).append($textHintNode),'ui-icon-info','ui-state-highlight');$dlg=$('<div>').append($('<span>').attr({style:'font-size: 2em; line-height: 1.8em;'}).append($('<span>').text(" {{check categories}} ").
attr({style:'background-color:#F8CCB0; text-decoration:line-through !important; display:inline-block;'}),$('<span>').text(" ?"))).append('<br>',$dlgCheckCookie,$('<label>').attr({'for':'hotCatAutoRemoveCheckCatCookie'}).text('Don\'t ask again'),'<br>').append(mw.user.isAnon()?'':$permaSaveHint.hide());$dlg.dialog({modal:true,closeOnEscape:true,title:"{{check categories}} (−)?",width:450,buttons:dlgButtons,close:function(){$('#hotcatCommitForm').submit();},open:function(){var $buttons=$(this).parent().find('.ui-dialog-buttonpane button');$buttons.eq(0).button({icons:{primary:'ui-icon-circle-check'}});$buttons.eq(1).button({icons:{primary:'ui-icon-cancel'}});}});};if(newVal!==hotCatForm.wpTextbox1.value){if(window.HotCatAutoRemoveCheckCat||cookie==='auto'){doRemove();return true;}e.preventDefault();mw.loader.using(['jquery.ui'],function(){prompt();});}return true;});var $okLink=$('<a>',{href:'#',html:'<s>{{Check categories}}</s>',title:
'Categories are OK! Immediately remove the template.'}).click(function(e){e.preventDefault();var $el=$(this);$el.off('click');var doEdit=function(result){if(!result)return;$el.text('Doing.');var text=result.replace(chCatRE,'');if(text===result){$el.text('Template not found!');return;}var params={action:'edit',title:mw.config.get('wgPageName'),nocreate:1,summary:selfName+'Categories are checked and OK. You can help [[Category:Media needing category review|reviewing]]!',text:text,token:(window['wikilove-edittoken']||mw.user.tokens.get('csrfToken')),format:'json'};var editDone=function(editStat){if(!editStat)return;if(editStat.error){alert('Unable to remove "Check categories" with the API\n'+editStat.error.code+'\n'+editStat.error.info);$el.text('Edit-Error!');}else{$el.text('Edit Done.');}$('.checkcategories').fadeOut();};$el.text('Doing..');$.post(mw.util.wikiScript('api'),params,editDone);};$el.text('Doing');$.ajax({url:mw.config.get('wgScript'),data:{action:'raw',title:mw.config.get(
'wgPageName').replace(/ /g,'_'),maxage:0,smaxage:0},dataType:'text',error:function(){$el.text('Error!');},success:doEdit,type:'GET',cache:false});});$(function(){$('#catlinks').find('ul:first').append($('<li>').append($okLink));});});});mw.loader.implement("ext.gadget.ImprovedUploadForm@19jbk",function($,jQuery,require,module){(function($,mw){'use strict';function enableNewUploadForm(){if(mw.user.options.get('gadget-OldUploadForm')==='1')window.UploadForm_forcebasic=true;if(window.UploadForm_forcebasic===undefined){window.UploadForm_forcebasic=(!window.JSconfig||window.JSconfig.keys.UploadForm_newlayout===undefined)?false:(!window.JSconfig.keys.UploadForm_newlayout);}var isNlWLM=mw.util.getParamValue('uselang')==='nlwikilovesmonuments';if(!isNlWLM&&!(window.JSconfig&&window.JSconfig.keys.UploadForm_loadform)&&window.UploadForm_forcebasic)return;if($.createSpinner&&!window.UploadForm){$('#mw-upload-form').prepend($.createSpinner({id:'UploadLoadingSpinner',size:'large',type:'block'}));window.setTimeout(function(){$.removeSpinner('UploadLoadingSpinner');},2800);}importScript('MediaWiki:UploadForm.js');if(isNlWLM)importScript('MediaWiki:UploadFormNlWikiLovesMonuments.js');}if(mw.config.get('wgCanonicalSpecialPageName')===
'Upload'&&mw.util.getParamValue('uploadformstyle')!=='plain'){mw.loader.using(['jquery.spinner','mediawiki.util'],enableNewUploadForm);if(!document.getElementById('commons-upwiz-advertising-button')&&!document.getElementById('noupwizjsbutton')&&mw.config.get('wgUserLanguage').length<8&&mw.util.getParamValue('wpForReUpload')!=='1'){var oldUF='You are using the old upload form. Try the <b><a href="/wiki/Special:UploadWizard">Upload Wizard</a></b> instead.';oldUF='<div id="su-nointro" style="padding:0.3em 1em;background:#EEF;font-size:large;margin:0 0 0.5em 0;border:2px solid #ACF;text-align:center;position:relative;">'+oldUF+'</div>';$(oldUF).insertBefore('#uploadtext');}}}(jQuery,mediaWiki));});mw.loader.implement("ext.gadget.LanguageSelect@1lf6y",function($,jQuery,require,module){(function($,mw){'use strict';var multilingual,commonsUserLanguage=mw.config.get('wgUserLanguage');multilingual=window.multilingual={cookie:'commonswiki_language_js',helpUrl:'//meta.wikimedia.org/wiki/Meta:Language_select',langCountThreshold:4,$p:$('#mw-content-text'),method:'prepend',$OuterContainer:$(),stringHelp:{'ar':'اختيار اللغة','be-tarask':'Выбар мовы','be-x-old':'Выбар мовы','bn':'ভাষা নির্বাচন:','ceb':'Pagpili og pinulongan','cs':'Výběr jazyka:','da':'Vælg sprog:','de':'Sprachauswahl:','en':'Language select:','et':'Keelevalik:','eo':'Lingvoelekto:','es':'Seleccionar idioma:','fa':'انتخاب زبان:','fr':'Sélecteur de langue&nbsp;:','gl':'Selección de lingua:','hu':'Nyelvválasztás:','hr':'Odabir jezika:','it':'Seleziona lingua:','ko':'언어 선택:','mk':'Јазик:','ml':
'ഭാഷ തിരഞ്ഞെടുക്കുക:','mwl':'Scuolha de la lhéngua:','nap':'Sciglie na lengua:','nds':'Spraakutwahl:','nl':'Taal:','pl':'Wybierz język:','pt':'Seleção do idioma:','pt-br':'Seleção do idioma:','ru':'Выбор языка:','sv':'Välj språk:','tl':'Pumili ng wika','tr':'Dil seçimi:','zh-hans':'语言选择'},stringShowAll:{'ar':'عرض الكل','be-tarask':'Паказаць усе','be-x-old':'Паказаць усе','bn':'সব দেখান','ceb':'Ipakita tanan','cs':'Zobrazit všechny','da':'Vis alle','de':'Alle anzeigen','en':'Show all','eo':'ĉiuj','es':'Mostrar todos','et':'Näita kõiki','fa':'نمایش همه','fr':'Toutes les langues','gl':'Mostrar todas','hu':'Mutasd mind','hr':'prikaži sve','it':'Mostra tutte','ko':'모두 보기','mk':'Сите','ml':'എല്ലാം','mwl':'Amostrar todos','nap':'Vire tutte','nds':'All wiesen','nl':'Toon alles','pl':'Pokaż wszystkie','pt':'Mostrar todos','pt-br':'Mostrar todos','ru':
'Показать все','sv':'Visa alla','tl':'Ipakita ang lahat','tr':'Tümünü göster','zh-hans':'全部显示'},getBrowserLanguage:function(){return navigator.userLanguage||navigator.language||navigator.browserLanguage;},setCookieLanguage:function(language){$.cookie(this.cookie,language,{expires:100,path:'/'});},deleteCookieLanguage:function(language){$.cookie(this.cookie,null,{path:'/'});},getLanguage:function(){var language='';language=$.cookie(this.cookie);if(!language&&commonsUserLanguage&&!mw.user.isAnon()){language=commonsUserLanguage;}if(!language)language=this.getBrowserLanguage();return language;},buildWidget:function(language){this.$container=$('<div/>');this.$container.attr('id','langselectorcontainer');this.$container.html('<a href="'+this.helpUrl+'" class="ls_link">'+this.stringHelpText+'</a> ');this.$select=$('<select/>');var seen={};this.mls.find('[lang]').each(function(){var lang=$(this).attr('lang');if(!seen[lang]){seen[lang]=true;var verboseLang=lang;if(window.
wpAvailableLanguages)verboseLang=wpAvailableLanguages[lang]||lang;multilingual.$select.append($('<option>',{text:verboseLang,value:lang}));}});this.$select.prepend('<option value="showall">'+this.stringShowallText+'</option>');this.$select.attr('id','langselector');this.$select.val(this.getLanguage());this.$select.change(function(){multilingual.setCookieLanguage($('#langselector').val());multilingual.apply($('#langselector').val());});this.$container.append(this.$select);this.$OuterContainer[this.method](this.$container);},init:function(){if(typeof ls_enable!=='undefined')return;if(mw.config.get('wgNamespaceNumber')<0)return;if(-1===$.inArray(mw.config.get('wgAction'),['view','purge','edit','historysubmit','submit']))return;$(document).triggerHandler('scriptLoaded',['Multilingual description',multilingual]);var language=this.getLanguage();this.stringHelpText=(this.stringHelp[language]||this.stringHelp[commonsUserLanguage.split('-')[0]]||this.stringHelp.en);this.stringShowallText=(this.
stringShowAll[language]||this.stringShowAll[commonsUserLanguage.split('-')[0]]||this.stringShowAll.en);var blockElements=['div','table'];$.each(blockElements,function(i,be){multilingual.$p.find(be+'.description[lang]+'+be+'.description[lang]').each(function(){var $this=$(this);if($this.parent().hasClass('multilingual'))return;var group=$(this).prevUntil(':not('+be+'.description[lang])').add($(this)).add($(this).nextUntil(':not('+be+'.description[lang])'));if(group.length<multilingual.langCountThreshold){return true;}group.wrapAll('<div class="multilingual"></div>');});});this.mls=multilingual.$p.find('.multilingual');if(!this.mls.length)return;this.buildWidget();this.apply(this.getLanguage());},apply:function(language){if(!language){this.deleteCookieLanguage();language=this.getLanguage();}this.mls.each(function(){var $ml=$(this);if($ml.parent('[class^="image_annotation_content"]').length)return true;var id=$ml.attr('id');if(id==='bodyContent'||id==='wikiPreview'||id==='LangTableLangs')
return true;var $reqLang=$ml.find('[lang="'+language+'"]');if($reqLang.length){$ml.children('[lang][lang!="'+language+'"]').hide();$ml.children('[lang="'+language+'"]').show();}else{$ml.children('[lang]').show();}});}};mw.loader.using(['jquery.cookie','mediawiki.user','mediawiki.util','site','user'],function(){$(document).ready(function(){if($('#file').length){multilingual.method='append';multilingual.$OuterContainer=$('#file');}else{multilingual.method='prepend';multilingual.$OuterContainer=mw.util.$content;}multilingual.init();});});})(jQuery,mediaWiki);});mw.loader.implement("ext.gadget.RenameLink@1h9ow",function($,jQuery,require,module){(function($,mw){'use strict';if(mw.config.get('wgNamespaceNumber')!==6||!mw.config.get('wgUserName')||mw.config.get('wgIsRedirect')){return;}var cats=mw.config.get('wgCategories'),usergroups=mw.config.get('wgUserGroups'),restriction=mw.config.get('wgRestrictionEdit'),userlang=mw.config.get('wgUserLanguage'),maincats=['Media requiring renaming','Media renaming requests needing target','Incomplete media renaming requests'];if(restriction&&restriction.length&&usergroups.indexOf(restriction[0])===-1){return;}var i18n={ar:'نقل',az:'Adını dəyiş','be-tarask':'Перайменаваць',bn:'স্থানান্তর',ca:'Canvia el nom',cs:'Přesunout',de:'Verschieben',en:'Move',es:'Trasladar',fa:'انتقال',fr:'Renommer',gl:'Mover',hr:'Premjesti',it:'Rinomina',ja:'移動',kk:'Атауын өзгерту',ko:'이동',ml:'തലക്കെട്ട് മാറ്റുക',nl:'Hernoemen',pl:
'Przenieś',pt:'Mover',ro:'Redenumire',ru:'Переименовать',sk:'Premenovať',sv:'Flytta',th:'เปลี่ยนชื่อ (ย้าย)',tr:'Taşı',uk:'Перейменувати',yue:'搬','zh-hant':'移動'},i18nP={ar:'جارٍ تحميل السكريبت',az:'Skript yüklənir','be-tarask':'Загрузка скрыпта',bn:'স্ক্রিপ্ট লোড হচ্ছে',ca:'S’està carregant l’script',cs:'Nahrávám skript',de:'Programmcode laden',en:'Loading script',es:'Cargando la secuencia de órdenes',fa:'بارگیری اسکریپت',fr:'Chargement',gl:'Cargando o script',hr:'Učitavanje skripte',id:'Memuat skrip',it:'Caricamento script in corso',kk:'Скрипт жүктелуде',ko:'스크립트 로딩 중',ml:'സ്ക്രിപ്റ്റ് തയ്യാറാക്കുന്നു.',nl:'Script laden',pl:'Ładowanie skryptu',pt:'Carregando script',ro:'Se încarcă scriptul',ru:'Загрузка скрипта',sk:
'Skript sa načítava',sv:'Laddar skript',th:'กำลังโหลดสคริปต์',tr:'Betik yükleniyor',uk:'Завантаження скрипта',yue:'喺度搞緊代碼……唔該等陣……','zh-hant':'載入腳本'};function onClickToStart(e){e.preventDefault();mw.loader.using(['jquery.ui']).then(function(){AjaxQuickDelete.showProgress(i18nP[userlang]||i18nP[userlang.split('-')[0]]||i18nP.en);});if(!window.rRename){mw.loader.load('/w/index.php?title=MediaWiki:RenameRequest.js&action=raw&ctype=text/javascript');}mw.hook('aqd.renamerequest.run').fire('start');}$(function(){mw.hook('aqd.renamerequest.i18n').fire(i18n);for(var i=0;i<maincats.length;i++){if(cats.indexOf(maincats[i])!==-1){$('#renameChange').show().find('a').on('click',onClickToStart);return;}}if(usergroups.indexOf('sysop')+usergroups.indexOf('filemover')===-2){$(mw.util.addPortletLink('p-cactions','#',i18n[userlang]||i18n[userlang.split('-')[0]]||i18n.en,'ca-rename','Request renaming this file.','m'))
.on('click',onClickToStart);}});}(jQuery,mediaWiki));});mw.loader.implement("ext.gadget.RotateLink@n9va4",function($,jQuery,require,module){$(function(){'use strict';var ext,$fileinfo,i18n,title=new mw.Title(mw.config.get('wgPageName'));if(!title||mw.user.isAnon()||title.getNamespaceId()!==mw.config.get('wgNamespaceIds').file||['ogg','oga','ogv','opus','webm','mid','svg','pdf','djvu','stl'].indexOf(ext=title.getExtension()&&title.getExtension().toLowerCase())!==-1||(Array.isArray(title=window.rotateFileTypes)&&title.indexOf(ext)===-1)||((ext=mw.config.get('wgRestrictionEdit'))&&ext.length&&mw.config.get('wgUserGroups').indexOf(ext[0])===-1)||(mw.config.get('wgUserEditCount')<16&&$('#mw-imagepage-section-filehistory tr:last > td:last').prev('td').find('a').eq(0).text()!==mw.config.get('wgUserName'))){return;}function loadAndStart(e){e.preventDefault();if(window.rRot){$(document).triggerHandler('rotaterequest',['start']);}else{$(document).on('scriptLoaded',function(evt,d){if(d&&d==='rotaterequest'){$(this).triggerHandler(d,['start']);}});mw.
loader.load('/w/index.php?title=MediaWiki:RotateRequest.js&action=raw&ctype=text/javascript');}}if((ext=mw.config.get('wgCategories')).indexOf('Images requiring rotation')!==-1||ext.indexOf('Images requiring rotation by bot')!==-1){$('#rotateChangeAngle').show().on('click','a',loadAndStart);return;}$fileinfo=$('#mw-content-text .fileInfo');if(!$fileinfo.length){return;}i18n={ar:'طلب تدوير',ca:'demana girar-la',cs:'vyžádat otočení',da:'Anmod om rotation',de:'Bild drehen',el:'θέλει περιστροφή;',en:'request rotation',es:'solicitar la rotación',fa:'درخواست چرخش',fr:'demander la rotation',gl:'solicitar a rotación',hr:'zahtjev za okretanjem slike',it:'richiedi rotazione',ja:'画像の回転を依頼',mk:'побарај свртување',ml:'തിരിക്കാൻ നിർദ്ദേശിക്കുക',nl:'Rotatie aanvragen',pl:'Obróć grafikę',pt:'Solicitar rotação',ro:'Cerere de rotaţie',ru:'запросить поворот',sl:
'zahteva za zasuk',sr:'захтевање ротације',sv:'Begär rotation',uk:'запит на обертання',zh:'请求旋转','zh-hant':'請求旋轉','zh-hk':'請求旋轉','zh-mo':'請求旋轉','zh-tw':'請求旋轉'};ext=mw.config.get('wgUserLanguage');$fileinfo.append('; ',$('<a>').attr({href:'#',style:'white-space:nowrap; display:inline-block;',title:'Request a (permanent) correction of the rotation if the thumbnails display in the wrong orientation. Please try to purge the server’s and client’s cache before if this file is an upload before middle of October 2011.'}).on('click',loadAndStart).append('(',$('<img>').prop('src','//upload.wikimedia.org/wikipedia/commons/7/70/Silk_arrow_rotate_clockwise.png'),i18n[ext]||i18n[ext.split('-')[0]]||i18n.en,')'));});});mw.loader.implement("ext.gadget.Slideshow@1xjr7",function($,jQuery,require,module){var launch=function(){'use strict';if(!mw.util.$content){return;}var getMessage,$c=mw.util.$content.parent();if(mw.libs.GallerySlideshowLoader){mw.log('Duplicate slideshow inclusion detected.');return;}mw.libs.GallerySlideshowLoader=launch;if($('.gallery',$c).find('li').length<2||mw.config.get('wgNamespaceNumber')===-1||mw.util.getParamValue('printable'))return;var msgs=(function(){var translations={en:{"gs-label-start":"Slideshow (all images)","gs-label-gallery":"Gallery Slideshow","gs-label-started":"Show Slideshow","gs-label-category":"Category Slideshow","gs-label-continue":"Resume","gs-title-start":"Start a slideshow of all images (alphabetical by file name)","gs-title-gallery":"Start a slideshow made from the images in the gallery of this page","gs-title-started":"Reopen slideshow pane","gs-title-category":
"Start a category slideshow (alphabetical by sortkey, starting with the first file of the category)","gs-title-continue":"Continue Slideshow where you had left it last time you visited this page."},cs:{"gs-label-start":"Prezentace (všechny obrázky)","gs-label-gallery":"Prezentace galerie","gs-label-started":"Zobrazit prezentaci","gs-label-category":"Prezentace kategorie","gs-label-continue":"Pokračovat","gs-title-start":"Spustit prezentaci všech obrázků (abecedně podle jména souboru)","gs-title-gallery":"Spustit prezentaci všech obrázků v galerii na této stránce","gs-title-started":"Znovuotevřít panel s prezentací","gs-title-category":"Spustit prezentaci kategorie (abecedně podle řadicího klíče počínaje prvním souborem v kategorii)","gs-title-continue":"Pokračovat v prezentaci od místa, kde jste skončili při poslední návštěvě této stránky."},fa:{"gs-label-start":"اسلایدشو (همه تصاویر)","gs-label-gallery":
"اسلایدشو برای نگارخانه","gs-label-started":"نمایش اسلایدشو","gs-label-category":"اسلایدشوی رده","gs-label-continue":"ادامه","gs-title-start":"شروع یک اسلایدشوی برای همهٔ تصاویر (الفبایی بنا به نام پرونده)","gs-title-gallery":"شروع یک اسلایدشوی ساخته\u200cشده از تصاویر نگارخانهٔ این صفحه","gs-title-started":"بازکردن مجدد قاب اسلایدشو","gs-title-category":"شروع یک اسلایدشوی رده (الفبایی مرتب\u200cشده، شروع با اولین پرونده)","gs-title-continue":"ادامهٔ اسلایدشو از آنجایی که دفعهٔ قبلی که این صفحه را بازدید کردید رها کرده\u200cاید."},hr:{"gs-label-start":"Prezentacija (sve slike)","gs-label-gallery":"Prezentacija galerije","gs-label-started":"Započni prezentaciju","gs-label-category":"Prezentacija kategorije"
,"gs-label-continue":"Nastavi","gs-title-start":"Započni prezentaciju svih slika (abecedno prema imenu)","gs-title-gallery":"Započni prezentaciju slika u galeriji na ovoj stranici","gs-title-started":"Ponovno otvori prezentaciju","gs-title-category":"Započni prezentaciju kategorije (abecedno prema ključu za sortiranje počevši s prvom datotekom u kategoriji)","gs-title-continue":"Nastavi prezentaciju prekinutu prilikom zadnjeg posjeta ovoj stranici."},it:{"gs-label-start":"Presentazione (tutte le immagini)","gs-label-gallery":"Presentazione della galleria","gs-label-started":"Mostra la presentazione","gs-label-category":"Presentazione della categoria","gs-label-continue":"Ricomincia","gs-title-start":"Inizia una presentazione di tutte le immagini (in ordine alfabetico)","gs-title-gallery":"Inizia un presentazione composta dalle immagini della galleria di questa pagina","gs-title-started":"Riapri il pannello di presentazione","gs-title-category":
"Inizia una presentazione della galleria (in ordine alfabetico, partendo dal primo file della categoria)","gs-title-continue":"Continua la presentazione da dove l'hai lasciata l'ultima volta che hai visitato questa pagina."},ml:{"gs-label-start":"സ്ലൈഡ്ഷോ (എല്ലാ ചിത്രങ്ങളും)","gs-label-gallery":"ചിത്രശാല സ്ലൈഡ്\u200cഷോ","gs-label-started":"സ്ലൈഡ്\u200cഷോ പ്രദർശിപ്പിക്കുക","gs-label-category":"വർഗ്ഗത്തിന്റെ സ്ലൈഡ്\u200cഷോ","gs-label-continue":"പുനരാരംഭിക്കുക","gs-title-start":"എല്ലാ ചിത്രങ്ങളുടേയും സ്ലൈഡ്\u200cഷോ തുടങ്ങുക (ചിത്രങ്ങളുടെ പേരുകളുടെ അക്ഷരമാലാക്രമത്തിൽ)","gs-title-gallery":
"ഈ താളിലെ ചിത്രശാലയിലെ ചിത്രങ്ങളുടെ സ്ലൈഡ്\u200cഷോ തുടങ്ങുക","gs-title-started":"സ്ലൈഡ്\u200cഷോ കളം വീണ്ടും തുറക്കുക","gs-title-category":"വർഗ്ഗത്തിന്റെ സ്ലൈഡ്\u200cഷോ തുടങ്ങുക (സോർട്ട്\u200cകീ ഉപയോഗിച്ചുള്ള അക്ഷരമാലാക്രമത്തിൽ, വർഗ്ഗത്തിലെ ആദ്യപ്രമാണം മുതൽ)","gs-title-continue":"ഈ താളിൽ താങ്കൾ കഴിഞ്ഞ പ്രാവശ്യം നിർത്തിയിടത്ത് നിന്ന് സ്ലൈഡ്\u200cഷോ തുടരുക."},pt:{"gs-label-start":"Slideshow (todas as imagens)","gs-label-gallery":"Slideshow da Galeria","gs-label-started":"Mostrar Slideshow","gs-label-category":"Slideshow da Categoria",
"gs-label-continue":"Reiniciar","gs-title-start":"Iniciar uma apresentação de todas as imagens (por ordem alfabética)","gs-title-gallery":"Iniciar uma apresentação a partir das imagens da galeria desta página","gs-title-started":"Reabrir painel de apresentação","gs-title-category":"Iniciar uma apresentação da galeria (por ordem alfabética, iniciando com o primeiro ficheiro da categoria)","gs-title-continue":"Continue a apresentação de onde parou na última vez que visitou esta página."}},languageNameParts=mw.config.get('wgUserLanguage').split('-'),lang;translations.no=translations.nb;if(languageNameParts[1]==='hans'||languageNameParts[1]==='cn'||languageNameParts[1]==='sg'||languageNameParts[1]==='my'){lang='zh-hans';}else if(languageNameParts[1]==='hant'||languageNameParts[1]==='hk'||languageNameParts[1]==='tw'||languageNameParts[1]==='mo'){lang='zh-hant';}else if(translations[languageNameParts[0]]){lang=languageNameParts[0];}else{lang='en';}return $.extend(true,
translations.en,translations[lang]);}());mw.messages.set(msgs);getMessage=function(msg){msg=mw.message('gs-'+msg);return(msg.exists()?msg.toString():msg);};mw.loader.using(['jquery.cookie','mediawiki.util','jquery.ui','jquery.hoverIntent'],function(){var isCategory=mw.config.get('wgNamespaceNumber')===14,$gButtons=$('<div>',{id:'GallerySlideStartButtons'}),$gButtonsInner=$('<div>',{id:'GallerySlideStartButtonsInner'}).appendTo($gButtons);if(isCategory){$('#mw-category-media',$c).prepend($gButtons);}else{$(mw.util.$content,$c).find('#firstHeading').before($gButtons);}var startSlideshow=function(o,cont,screenread){if(!o)return;if(cont)o.cont=cont;if(screenread){o.readFromScreen=true;o.remoteUse=true;}o.start();};var loadSlideshowAndStart=function(cont,screenread){$startButton.button({label:getMessage('label-started')}).attr('title',getMessage('title-started'));if('object'===typeof window.GallerySlide){startSlideshow(window.GallerySlide,cont,screenread);}else{$(document).on('slideshow',
function(e,st,o){if('codeLoaded'===st&&o){startSlideshow(o,cont,screenread);}});window.importScriptURI(mw.config.get('wgServer')+mw.config.get('wgScript')+'?'+$.param({title:'MediaWiki:GallerySlideshow.js',action:'raw',ctype:'text/javascript',dummy:9}));}};var createButton=function(type,msg){return $('<button>',{role:'button',id:'GallerySlide'+type,title:getMessage('title-'+(msg||type)),text:getMessage('label-'+(msg||type))});},$startButton=createButton('start',isCategory?'category':'gallery').button({icons:{secondary:'ui-icon-slideshow'}}).addClass('ui-button-green').click(function(){if(isCategory){loadSlideshowAndStart();}else{loadSlideshowAndStart(0,true);}});if($('#mw-category-media .gallery',$c).prevAll('a').length){$gButtonsInner.append(createButton('gallery').button({icons:{primary:'ui-icon-image'}}).click(function(){loadSlideshowAndStart(0,true);}));}var lastQuery=$.cookie('gs'+mw.config.get('wgPageName').replace('Category:','1:').replace('Commons:','2:'));if(lastQuery){
$gButtonsInner.append(createButton('continue').button({icons:{primary:'ui-icon-seek-next'}}).click(function(){loadSlideshowAndStart(lastQuery);}));}$startButton.appendTo($gButtonsInner);$gButtons.buttonset();$(document).triggerHandler('slideshow',['loadedInstaller',$gButtons]);var autoStart=mw.util.getParamValue('gsAutoStart');if(({'1':1,'true':1,'yes':1,'-1':1}[autoStart])){loadSlideshowAndStart();}var $buttons=$gButtons.find('button'),_switchToIcon=function($b){$b.removeClass('ui-button-text-icon-secondary').removeClass('ui-button-text-icon-primary').addClass('ui-button-icon-only');};$buttons.each(function(i,b){var $b=$(b),oldClass=$b.attr('class'),$t=$b.find('span.ui-button-text'),tw=$t.width();$b.hoverIntent(function(){var hasOldClass=false;$t.stop(true).delay(200).animate({width:tw,opacity:1},{duration:'fast',easing:'linear',step:function(){if(hasOldClass)return;$b.attr('class',oldClass);hasOldClass=true;}});},function(){$t.delay(800).animate({width:0,opacity:0},function(){
_switchToIcon($b);});});_switchToIcon($b);$t.width(0).fadeTo(0,0);});});};$(function(){mw.hook('wikipage.content').add(launch);});},{"css":[
"#content \u003E #GallerySlideStartButtons{font-size:80%}#GallerySlideStartButtons{float:right;white-space:nowrap;position:relative}#GallerySlideStartButtons span.ui-button-text{overflow:hidden}#GallerySlideStartButtonsInner{position:relative;left:-4px} @media print{#GallerySlideStartButtons{display:none !important}}    .ui-button .ui-icon-slideshow{background-repeat:no-repeat;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHAAAAAQCAYAAADOFPsRAAAACXBIWXMAAA7DAAAOwwHHb6hkAAADQklEQVRYhe2Y32tSYRjHTyyCGLE7r7oq8lgkCwTvdhX+BeI/oOeo3WweNrZpo2LdzLYgrNVFdOFU1o6xii67CPJCugghGcwpmbalCdVya7Ef55y+53jOcJtsbus9wvCBD+/zvox9X/lwXl8PRbXr5JbL7UowHmamVfmSJCVAy/IpXyQBWpZPB/gE7Y8fPZ9xMwVZ4n/c06EK8gqyxFblQ15Bkdiiov18QZbY1B+73e4uCJOagcRmIapLarJI5FNDfBdkSU1BoC4gH8KkZmj4DzSBY8Gx1fGJ8RWZ4L2gEBwPbmnz0buja6QF5vP5z7lcLitTKBQ2wZo2X1pa+kpa4JuFkvS++KMhTz7kiAt8lfsuvV382ZCnH/MHCww9DP2efDy5LINeCD0KbWrzifsTK6yHXSPxATSBc6hPamUymY35+flVbZ7NZhdEUfxDIl8TuPh3Q6piH41IfvslnemPEfn8msA55H9BViPelZalqyMvGue3BbYFHqvaAtsCj1cnRSAEbYF1BS8rYhS1uR63UAjaAn9lBEHAIAraXI9b6On+mNA5NL1e47nYOTgtanM9bqFXRuJC9+3ZdYU7L8XuW7OiNt/3FupwODoYhrHUg9+AJYZlUvVrLMteI/EB4KUDWHZRAqlda0TyKQffQfXGLDvoi5QoXzS1Y80XI5ZvGuYt9UBWCaTq1y4F+ObylSeSZcoujyvNcdxZIpvep9QnsgzSQPf82hMZLYM0xfG658tPpNHPl01+Pn3+KPmQF8ZxWcVYgcQHBPa4b0FaWP3qqQDd83FUhikuUsVYAbrnm4ZnwrQ/XoXECj3MHy4fx6Qd8jKgyHiYpDxC4nVCe91TEGYHGVCU7w7qqFs+jk47pGUo31SR6osmlbE3qls+5NlxdGboAF80BWaS6IvGQLy5fK/Xa4CwssvrsmrvQiHRJvdOp/Mc4b3L8gzq0WmV1HehwKb2xPOpgSkD5JUpLmbdfhfaF7Ep/eAz4vkXB2YN8tFpvMlbtXehlwO8TekHXx+cr15meuQe34Nm5w0nLffq2imy29++zPSovRnQat8DiOcrlxkuouRTXNQMeXStl9f0yTf640q+aYg30yO8kl9b25v/D7228kP7LK3bAAAAAElFTkSuQmCC) !important}.ui-state-default .ui-icon-slideshow{background-position:-96px 0;width:16px;height:16px}.ui-state-hover .ui-icon-slideshow{background-position:-64px 0;width:16px;height:16px}.ui-state-active .ui-icon-slideshow{background-position:0 0;width:16px;height:16px}.skin-vector .ui-state-error .ui-icon-slideshow,.skin-vector .ui-button-red .ui-icon-slideshow,.skin-vector .ui-button-green .ui-icon-slideshow,.skin-vector .ui-button-blue .ui-icon-slideshow,.skin-vector .ui-button-orange .ui-icon-slideshow{background-position:-32px 0;width:16px;height:16px}#SlideContainer{width:100%;height:0px;background:#3B3B3B;position:fixed;top:0px;left:0px;z-index:1002;line-height:2em;font:small sans-serif}#GallerySlideHelpSplash{display:block;position:fixed;border:1px solid #000;background:#DDD;max-width:350px;z-index:1005}.cat-label,.license-label{border:#AAA solid 1px;padding:2px;white-space:nowrap}.cat-label{background:#000;color:#EEE;border-radius:4px;-webkit-border-radius:4px;-moz-border-radius:4px;-o-border-radius:4px;-ms-border-radius:4px}.cat-label:visited{color:#5695FD}.license-label{color:gray;display:inline-block}.gs-author-label,.gs-date-label,.gs-uploader-label{font-weight:bold;display:inline-block;min-width:75px}.cat-wrap,.license-wrap{font-size:0.5em;margin-left:2px;margin-top:10px;line-height:2em}.digit-separator{font-size:70%;font-weight:100}    .gs-play{background:url(//upload.wikimedia.org/wikipedia/commons/0/07/Gnome-media-playback-sprite.png) no-repeat top left} .gs-play-bwd{background-position:5px 5px;width:35px;height:35px} .gs-play-fwd{background-position:-40px 5px;width:35px;height:35px} .gs-play-pause{background-position:-85px 5px;width:35px;height:35px} .gs-play-play{background-position:-130px 5px;width:35px;height:35px}  body.rtl .gs-play-fwd{background-position:5px 5px;width:35px;height:35px} body.rtl .gs-play-bwd{background-position:-40px 5px;width:35px;height:35px}    .gs-icon{display:inline-block;background:url(//upload.wikimedia.org/wikipedia/commons/1/11/Slideshow_menu_icon_sprite.png) no-repeat top left} .gs-icon-clock{background-position:0 0} .gs-icon-help{background-position:-32px 0} .gs-icon-keyGo{background-position:-64px 0} .gs-icon-zkey{background-position:-96px 0}.gs-icon-clock,.gs-icon-help,.gs-icon-keyGo,.gs-icon-zkey{height:16px;width:16px}.continue-key-insert,.gs-help-link,.delay-insert{float:right;margin-left:3px;margin-right:3px;display:block}.cont-key-container{word-wrap:break-word;padding:7px 7px 7px 12px;background-color:#EEE;background-position:-93px 50%;font-size:6px;margin-top:10px;display:block}.cont-key-container \u003E a{color:#CCD}.cont-key-container \u003E a:hover{color:#55A}.gs-img-description-desc{background-color:#EEE;margin:10px 0}.gs-img-metrics{color:green}.gs-img-uploader,.gs-img-description,.gs-img-metrics{font-size:0.7em;margin-top:10px}.bar-fwd{right:0;border-radius:2px 0 0 2px ;-webkit-border-radius:2px 0 0 2px ;-moz-border-radius:2px 0 0 2px ;-o-border-radius:2px 0 0 2px }.bar-bwd{left:0;border-radius:0 2px 2px 0;-webkit-border-radius:0 2px 2px 0;-moz-border-radius:0 2px 2px 0;-o-border-radius:0 2px 2px 0}.bar-fwd,.bar-bwd{width:15px;background:#888;overflow:visible;opacity:0.8;-ms-filter:\"progid:DXImageTransform.Microsoft.Alpha(Opacity=80)\";height:100%;position:absolute;top:0;cursor:pointer}.bar-btn-fwd,.bar-btn-bwd{position:relative;display:none;font-size:30px;text-align:center;padding-top:20px;border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px;-o-border-radius:2px;background:#888;z-index:1006;width:40px;height:56px;cursor:pointer;top:45%}.bar-btn-fwd{left:-30px }.slideshow-close-button{border-radius:2px;-webkit-border-radius:2px;-moz-border-radius:2px;-o-border-radius:2px;text-align:center;background:#888;z-index:1019;width:50px;height:40px;position:relative;top:0;left:-30px;font-size:30px}ul.com-gs-thumbs a.com-gs-thumb{overflow:hidden;width:75px;height:75px}div.slideshow-container,div.slideshow{height:100%}div.slideshow{position:relative;display:block;vertical-align:top}div.loader,div.slideshow a.advance-link,.caption-container{width:100%}div.loader,div.slideshow a.advance-link{display:none}div.content{clear:both}div.content a:hover,div.content a:active{text-decoration:underline}div.controls{margin-top:5px;height:50px}div.controls a{padding:5px;display:inline-block}div.ss-controls{display:inline-block}div.nav-controls{margin:0 auto;width:136px;border:1px solid #2B2B2B;padding:0 15px;border-radius:80px;-webkit-border-radius:80px;-moz-border-radius:80px;-o-border-radius:80px;margin-top:6px;opacity:0.4;-ms-filter:\"progid:DXImageTransform.Microsoft.Alpha(Opacity=40)\";box-shadow:3px 2px 7px rgba(0,0,0,0.3);-moz-box-shadow:3px 2px 7px rgba(0,0,0,0.3);-webkit-box-shadow:3px 2px 7px rgba(0,0,0,0.3);-o-box-shadow:3px 2px 7px rgba(0,0,0,0.3);background:#666;background-image:-o-linear-gradient(bottom,rgb(77,77,77) 0%,rgb(171,171,171) 100%);background-image:-moz-linear-gradient(bottom,rgb(77,77,77) 0%,rgb(171,171,171) 100%);background-image:-webkit-gradient(linear,left bottom,left top,from(rgb(77,77,77)),to(rgb(171,171,171)));background-image:-webkit-linear-gradient(bottom,rgb(77,77,77) 0%,rgb(171,171,171) 100%);background-image:-ms-linear-gradient(bottom,rgb(77,77,77) 0%,rgb(171,171,171) 100%);background-image:linear-gradient(bottom,rgb(77,77,77) 0%,rgb(171,171,171) 100%)}span.image-wrapper img{width:100%}div.other-controls{float:right;margin-top:-25px;-ms-filter:\"progid:DXImageTransform.Microsoft.Alpha(Opacity=60)\";opacity:0.6} div.loader{position:absolute;top:0;left:0;background-repeat:no-repeat;background-position:center;height:100%;background-image:url(//upload.wikimedia.org/wikipedia/commons/1/1b/Ajax-loader-dark.gif)}div.slideshow span.image-wrapper{display:block;position:absolute;top:0;left:0}div.slideshow a.advance-link{display:block;text-align:center}div.slideshow a.advance-link:hover,div.slideshow a.advance-link:active,div.slideshow a.advance-link:visited,div.content a,div.navigation a{text-decoration:none}div.caption-container{font-size:1.5em;width:20%;min-width:180px;max-width:320px;position:relative;display:inline-block;vertical-align:top}span.image-caption{display:block;z-index:1003;overflow:auto;position:absolute;width:100%;background:#DDD;padding:10px}.slideshow-container div.caption{padding:0 12px}div.image-title{font-weight:700;font-size:1.4em}div.image-desc{line-height:1.3em;padding-top:12px}div.download{margin-top:8px}#com-gs-thumbs.navigation,.slideshow-container,div.controls{overflow:hidden;margin:0 25px}ul.com-gs-thumbs{position:relative;margin:0;padding:0;left:0;height:80px;width:10000px;overflow:hidden}ul.com-gs-thumbs li,ul.com-gs-thumbs{display:inline-block;zoom:1;display:inline!ie}ul.com-gs-thumbs li{padding:0;margin:2px;list-style:none}a.com-gs-thumb{padding:1px;display:block}a.com-gs-thumb:focus,div.slideshow a.advance-link:focus{outline:none}ul.com-gs-thumbs img{border:none;display:block}"
]});mw.loader.implement("ext.gadget.Stockphoto@1q545",function($,jQuery,require,module){(function(){'use strict';var stockPhoto,modalLoad;if(window.stockPhoto||!/^(?:vector|monobook|timeless)$/.test(mw.config.get('skin'))||mw.config.get('wgCanonicalNamespace')!=='File'||mw.config.get('wgAction')!=='view'){return;}function File(opt){var re,file=this;file.title=opt.pageName.replace(/^[^:]+:|\.[^.]+$/g,'').replace(/_+/g,' ');file.url=opt.originalUrl;file.backlink='https://commons.wikimedia.org/wiki/'+mw.util.wikiUrlencode(opt.pageName);re=new RegExp('\\.(?:'+stockPhoto.audio_only.map(mw.RegExp.escape).join('|')+')$','i');file.audio=re.test(opt.pageName);this.gfdlNote=false;this.attrRequired=true;this.computeMetadata(opt.dom,opt.$licenses);}File.prototype.getLicenseLabel=function(short){if(/^cc[- ]/i.test(short)){return short.toUpperCase().replace(/^(CC)-/,'$1 ').replace(/[- ]([\d.]+)$/,' $1');}return short;};File.prototype.getLicensePrio=function(short){return/^(public domain|cc0)/i.test(
short)?1:/^cc[- ]by(-sa)?[- ]\d/i.test(short)?2:3;};File.prototype.computeMetadata=function(dom,$licenses){var credit,creditHtml,attribution,licenses,via=stockPhoto.i18n.via_wikimedia_commons,file=this,author=dom.$aut.text().trim(),source=dom.$src.text().trim();if(dom.$aut.find('.boilerplate').length){author='';}if(author.match(/^[Uu]nknown$/)){author='';}author=author.replace(/\s*\(talk\)$/i,'');if(author.indexOf('Original uploader was')!==-1){author=author.replace(/\s*Original uploader was\s*/g,'');}if(author.slice(0,3)==='[&#9660;]'){author=author.slice(3);author=author.split('Description')[0].trim();}if(dom.$src.find('.boilerplate').length){source='';}if(dom.$src.find('.int-own-work').length){source='';}if(!author&&source.length<50){author=source;}licenses=[];$licenses.each(function(){var $tpl=$(this),short=$tpl.find('.licensetpl_short').text().trim();if(!short){return;}licenses.push({link:$tpl.find('.licensetpl_link').text().trim(),short:short,label:file.getLicenseLabel(short),
prio:file.getLicensePrio(short),link_req:$tpl.find('.licensetpl_link_req').text().trim(),attr_req:$tpl.find('.licensetpl_attr_req').text().trim()});});licenses.sort(function(a,b){return a.prio-b.prio;});if(licenses[0]&&licenses[0].prio<3){licenses.splice(1);}file.licenses=licenses.map(function(v){if(v.attr_req==='false'){file.attrRequired=false;}if(v.short.indexOf('GFDL')!==-1){file.gfdlNote=true;}if(v.link_req==='true'&&v.link){return{html:'<a href="'+v.link+'">'+mw.html.escape(v.label)+'</a>',txt:v.label+' <'+v.link+'>'};}else{return{html:mw.html.escape(v.label),txt:v.label};}});if(dom.$credit.length){credit=dom.$credit.text();creditHtml=dom.$credit.html();}if(!credit){if(dom.$attr.length){attribution=dom.$attr.text();}else if(dom.$licenseAut.length){attribution=dom.$licenseAut.text();}else if(dom.$creator.length){attribution=dom.$creator.text();}if(!attribution){attribution=(author||stockPhoto.i18n.see_page_for_author);}credit=attribution+file.getLicense()+', '+via;creditHtml=mw.
html.element('a',{href:file.backlink},attribution)+file.getLicense(true)+', '+mw.html.escape(via);}file.credit=credit;file.creditHtml=creditHtml;};File.prototype.getLicense=function(useHtml){var l1,l2,licenses=this.licenses.map(function(l){return useHtml?l.html:l.txt;});if(!licenses.length){return', '+stockPhoto.i18n.see_page_for_license;}if(licenses.length===1){return', '+licenses[0];}if(licenses.length>=2){l2=licenses.pop();l1=licenses.pop();licenses.push(l1+' '+stockPhoto.i18n.or+' '+l2);}return' ('+licenses.join(', ')+')';};stockPhoto={ui_icon_download:'https://upload.wikimedia.org/wikipedia/commons/thumb/9/92/Gnome-document-save.svg/50px-Gnome-document-save.svg.png',ui_icon_web:'https://upload.wikimedia.org/wikipedia/commons/thumb/c/c0/Gnome-emblem-web.svg/50px-Gnome-emblem-web.svg.png',ui_icon_wiki:'https://upload.wikimedia.org/wikipedia/commons/thumb/2/2c/Tango_style_Wikipedia_Icon.svg/50px-Tango_style_Wikipedia_Icon.svg.png',ui_icon_email:
'https://upload.wikimedia.org/wikipedia/commons/thumb/e/ee/Gnome-mail-send.svg/50px-Gnome-mail-send.svg.png',ui_icon_help:'https://upload.wikimedia.org/wikipedia/commons/thumb/e/e7/Dialog-information_on.svg/50px-Dialog-information_on.svg.png',ui_icon_remove:'https://upload.wikimedia.org/wikipedia/commons/thumb/9/9d/Emblem-unreadable.svg/20px-Emblem-unreadable.svg.png',information_template_hints:['fileinfotpl_desc','fileinfotpl_src'],audio_only:['midi','ogg','flac'],horizontal_ui:['midi','ogg','flac','pdf','djvu'],ogg_icon:'/w/resources/assets/file-type-icons/fileicon-ogg.png',init:function(){var $enable,$orgItems,has_information,$imgBox,xoff,yoff,horizontal,html,$base,re;$orgItems=$('#filetoc').find('a[href="#file"], a[href="#filehistory"], a[href="#filelinks"], a[href="#metadata"], a[href="#globalusage"]').parent();if($.cookie('StockPhotoDisabled')){$enable=$('<li>').append($('<a href="#"></a>').text(stockPhoto.i18n.reuse)).click(function(e){e.preventDefault();$(this).remove();$.
cookie('StockPhotoDisabled',null,{path:'/'});stockPhoto.init();});$('#filetoc').append($enable);$orgItems=$orgItems.add($enable);return;}if(!$('#file').length){return;}has_information=stockPhoto.information_template_hints.some(function(v){return document.querySelector('#'+v);});if(!has_information){return;}if(document.querySelector('.nuke')){return;}$imgBox=$('.multipageimage, #file img,#file .mediaContainer');xoff=$imgBox.width()+40;yoff=$('#file').position().top+5;stockPhoto.small_horizontal_layout=(!mw.user.isAnon()||($imgBox.height()<300));re=new RegExp('\\.(?:'+stockPhoto.horizontal_ui.map(mw.RegExp.escape).join('|')+')$','i');horizontal=(stockPhoto.small_horizontal_layout||re.test(mw.config.get('wgTitle'))||(document.documentElement.clientWidth<1030));stockPhoto.share_this(-1);html='<div class="';html+=(horizontal?'stockphoto-layout-horizontal':'stockphoto-layout-vertical');html+=(stockPhoto.small_horizontal_layout?' stockphoto-layout-horizontal-small':'');html+='"';if(!
horizontal){if(document.querySelector('body.rtl')){html+=' style="right: '+xoff+'px; top:'+yoff+'px;"';}else{html+=' style="left: '+xoff+'px; top:'+yoff+'px;"';}}html+='></div>';$base=$(html).append(stockPhoto.add_button_row(stockPhoto.ui_icon_download,stockPhoto.call_download,stockPhoto.i18n.download,stockPhoto.i18n.all_sizes),stockPhoto.add_button_row(stockPhoto.ui_icon_web,stockPhoto.call_web,stockPhoto.i18n.use_this_file_web_short,stockPhoto.i18n.on_a_website),stockPhoto.add_button_row(stockPhoto.ui_icon_wiki,stockPhoto.call_wiki,stockPhoto.i18n.use_this_file_wiki_short,stockPhoto.i18n.on_a_wiki),stockPhoto.add_button_row(stockPhoto.ui_icon_email,'mailto:?subject='+encodeURIComponent(stockPhoto.file.title)+'&body='+encodeURIComponent(stockPhoto.file.backlink+'\n\n'+stockPhoto.file.credit),stockPhoto.i18n.email_link_short,stockPhoto.i18n.to_this_file),stockPhoto.add_button_row(stockPhoto.ui_icon_help,mw.util.getUrl('Special:MyLanguage/Commons:Reusing_content_outside_Wikimedia'),
stockPhoto.i18n.information,stockPhoto.i18n.about_reusing),$('<span class="stockphoto_buttonrow"><a title="'+stockPhoto.i18n.remove_icons+'" class="stockphoto_buttonrow_icon"><img src="'+stockPhoto.ui_icon_remove+'"></a></span>').click(function(){$.cookie('StockPhotoDisabled',true,{expires:60,path:'/'});$base.remove();$orgItems.show();}));if(stockPhoto.small_horizontal_layout){$orgItems.hide();$('#filetoc').append($base);}else{$('#filetoc').after($base);}},add_button_row:function(icon_url,fn,txt,html){var ret,size=50;if(stockPhoto.small_horizontal_layout){size=20;}var realSize=size;if(window.devicePixelRatio>1.0){realSize*=2;}icon_url=icon_url.replace('/50px-','/'+realSize+'px-');ret=document.createElement(typeof fn==='string'?'a':'span');ret.className='stockphoto_buttonrow';ret.title=txt+' '+html;if(typeof fn==='string'){ret.href=fn;}else{ret.role='button';ret.tabIndex=0;ret.onclick=fn;}ret.innerHTML='<span class="stockphoto_buttonrow_icon"><img width="'+size+'" height="'+size+
'" src="'+icon_url+'"></span>'+'<span class="stockphoto_buttonrow_text"><a>'+txt+'</a><small>'+html+'</small></span>';return ret;},stockphoto_get_thumbnail_url:function(width){var thumb_url,alt_title,last;if(stockPhoto.file.audio){return stockPhoto.ogg_icon;}alt_title=mw.config.get('wgCanonicalNamespace')+':'+mw.config.get('wgTitle');$('#file img').each(function(){var i=this.alt;if(i&&i!==alt_title){return;}thumb_url=this.src.split('/');});if(!thumb_url&&$('.mwEmbedPlayer img').length){return $('.mwEmbedPlayer img').attr('src');}if(!thumb_url||!thumb_url.length)return;last=thumb_url.pop().replace(/^\d+px-/,width+'px-').split('?')[0];thumb_url.push(last);thumb_url=thumb_url.join('/');return thumb_url;},is_audio_video_asset:function(url){return/(ogv|ogg|oga|ebm|wav)$/.test(url.slice(-3));},make_html_textarea:function(){var width,type,height,thumb_url,t;width=$('#stockphoto_html_select').val();type=$('input[name="stockphoto_code_type"]:checked').val();if(stockPhoto.is_audio_video_asset(
stockPhoto.file.backlink)&&type==='html'){height=$('.mwEmbedPlayer').length?width*$('.mwEmbedPlayer').height()/$('.mwEmbedPlayer').width():width*$('#file img,#file video').height()/$('#file img,#file video').width();if(height===0){height=20;}$('#stockphoto_html').text('<iframe src="'+stockPhoto.file.backlink+'?embedplayer=yes" width="'+width+'" height="'+height+'" frameborder="0" ></iframe>');return;}thumb_url=stockPhoto.stockphoto_get_thumbnail_url(width);if(type==='html'){t='<a title="'+mw.html.escape(stockPhoto.file.credit)+'" href="'+stockPhoto.file.backlink+'"><img width="'+width+'" alt="'+mw.html.escape(stockPhoto.file.title)+'" src="'+thumb_url+'"></a>';}else if(type==='bbcode'){t='[url='+stockPhoto.file.backlink+'][img]'+thumb_url+'[/img][/url]\n[url='+stockPhoto.file.backlink+']'+stockPhoto.file.title+'[/url]\n'+stockPhoto.file.credit;}$('#stockphoto_html').text(t);},refresh_attribution:function(){$('#stockphoto_attribution').val(stockPhoto.file[this.checked?'creditHtml':
'credit']);},createDialogRow:function(label,prefill,id,prepend,append){var idtext=id?('id="'+id+'"'):'';return'<div class="stockphoto_dialog_row"><b>'+label+':</b><br>'+(prepend||'')+'<input type="text" readonly '+idtext+' onclick="select()" value="'+mw.html.escape(prefill)+'">'+(append||'')+'</div>';},share_this:function(ui_mode){var widths,html,dtitle,dl_links,best_fit,pixelStr,widthSearchMatch,imageWidth,power,i;stockPhoto.file=new File({pageName:mw.config.get('wgPageName'),originalUrl:$('div.fullMedia a').prop('href')||'',dom:{$src:$('#fileinfotpl_src + td'),$aut:$('#fileinfotpl_aut + td'),$attr:$('.licensetpl_attr').eq(0),$credit:$('#fileinfotpl_credit + td'),$creator:$('#creator'),$licenseAut:$('.licensetpl_aut').eq(0)},$licenses:$('.licensetpl')});widths=[];try{pixelStr=$('.fileInfo').contents().get(0).data;widthSearchMatch=/([0-9 ,.\u00a0]+)\s*×/.exec(pixelStr);imageWidth=parseInt(widthSearchMatch[1].replace(/[ ,.\u00a0]/g,''),10);if(isNaN(imageWidth)){throw new Error(
'Cannot parse');}power=Math.floor(Math.log(imageWidth)/Math.log(2));for(i=0;i<5;i++){widths.push(Math.pow(2,power-i));}widths=widths.reverse();}catch(e){widths=[640,800,1024];}if(ui_mode===-1){return;}modalLoad=modalLoad||mw.loader.using('jquery.ui');html='';html+=stockPhoto.createDialogRow(stockPhoto.i18n.page_url,stockPhoto.file.backlink);html+=stockPhoto.createDialogRow(stockPhoto.i18n.file_url,stockPhoto.file.url);html+=stockPhoto.createDialogRow(stockPhoto.i18n.attribution,stockPhoto.file.credit,'stockphoto_attribution','<blockquote class="stockphoto_attribution_preview" onclick="nextSibling.select();return false;">'+stockPhoto.file.creditHtml+'</blockquote>',' <input id="stockphoto_attribution_html" type="checkbox">&nbsp;<label for="stockphoto_attribution_html">'+stockPhoto.i18n.html+'</label>');if(stockPhoto.file.gfdlNote){html+='<span class="stockphoto_note">'+stockPhoto.i18n.gfdl_warning+'</span>';}if(!stockPhoto.file.attrRequired){html+='<br><span class="stockphoto_note">'+
stockPhoto.i18n.no_attr+'</span>';}switch(ui_mode){case 1:dtitle=stockPhoto.i18n.download_this_file;if(stockPhoto.file.url){html+='<div><b>'+stockPhoto.i18n.download_image_file+':</b><br>';dl_links=[];widths.forEach(function(v){if(stockPhoto.file.audio){return;}dl_links.push('<a href="'+stockPhoto.stockphoto_get_thumbnail_url(v)+'" download>'+v+'px</a>');});dl_links.push('<a href="'+stockPhoto.file.url+'" download>'+stockPhoto.i18n.full_resolution+'</a>');if(dl_links.length){html+=dl_links.join(' | ');}else{html+='<i>'+stockPhoto.i18n.not_available+'</i>';}html+='</div>';}break;case 2:dtitle=stockPhoto.i18n.use_this_file_web;html+='<div class="stockphoto_dialog_row"><div style="float: right;">';html+='<input type="radio" name="stockphoto_code_type" value="html" id="stockphoto_code_type_html" onchange="stockPhoto.make_html_textarea();" checked><label for="stockphoto_code_type_html">'+stockPhoto.i18n.html+'</label> ';html+=
'<input type="radio" name="stockphoto_code_type" value="bbcode" id="stockphoto_code_type_bbcode" onchange="stockPhoto.make_html_textarea();"><label for="stockphoto_code_type_bbcode">'+stockPhoto.i18n.bbcode+'</label> ';html+='<select id="stockphoto_html_select" onchange="stockPhoto.make_html_textarea();">';best_fit=75;if(stockPhoto.file.audio){best_fit=120;html+='<option value="120">120'+stockPhoto.i18n.px_wide_icon+'</option>';}else{widths.forEach(function(v){if(v<=$('#file img').width()){best_fit=v;}html+='<option value="'+v+'">'+v+stockPhoto.i18n.px_wide+'</option>';});}html+='</select></div>';html+='<b>'+stockPhoto.i18n.embed_this_file+'</b><textarea onclick="select()" id="stockphoto_html" readonly>';html+='</textarea></div>';break;case 3:dtitle=stockPhoto.i18n.use_this_file_wiki;html=stockPhoto.createDialogRow(stockPhoto.i18n.thumbnail,'[[File:'+mw.config.get('wgTitle')+'|thumb|'+stockPhoto.file.title+']]');html+=stockPhoto.createDialogRow(stockPhoto.i18n.image,'[[File:'+mw.config
.get('wgTitle')+'|'+stockPhoto.file.title+']]');break;}modalLoad.done(function(){$('<div style="display: none;"></div>').html(html).dialog({modal:true,width:610,height:'auto',title:dtitle,close:function(){$(this).remove();}});$('#stockphoto_html_select').val(best_fit);stockPhoto.make_html_textarea();$('#stockphoto_attribution_html').on('change',stockPhoto.refresh_attribution);});},call_download:function(){stockPhoto.share_this(1);},call_web:function(){stockPhoto.share_this(2);},call_wiki:function(){stockPhoto.share_this(3);},i18n:{download:'Download',all_sizes:'all sizes',download_this_file:'Download this file',use_this_file_web_short:'Use this file',on_a_website:'on the web',use_this_file_web:'Use this file on the web',use_this_file_wiki_short:'Use this file',on_a_wiki:'on a wiki',use_this_file_wiki:'Use this file on a wiki',thumbnail:'Thumbnail',image:'Image',email_link_short:'Email a link',to_this_file:'to this file',information:'Information',about_reusing:'about reusing',
remove_icons:'Remove these icons',reuse:'Reuse this file',via_wikimedia_commons:'via Wikimedia Commons',see_page_for_author:'See page for author',see_page_for_license:'see page for license',page_url:'Page URL',file_url:'File URL',attribution:'Attribution',no_attr:'Attribution not legally required',or:'or',gfdl_warning:'Using this file might require attaching a full copy of the <a href="//en.wikipedia.org/wiki/GNU_Free_Documentation_License">GFDL</a>',download_image_file:'Download image file',full_resolution:'Full resolution',not_available:'not available',share_this_file:'Share this file',embed_this_file:'Embed this file',html:'HTML',bbcode:'BBCode',px_wide_icon:'px wide (icon)',px_wide:'px wide'}};window.stockPhoto=stockPhoto;if(mw.config.get('wgUserLanguage')==='en'){$(stockPhoto.init);}else{$.ajax({url:mw.config.get('wgScript')+'?title='+mw.util.wikiUrlencode('MediaWiki:Gadget-Stockphoto.js/'+mw.config.get('wgUserLanguage'))+'&action=raw&ctype=text/javascript',dataType:'script',
crossDomain:true,cache:true}).then(stockPhoto.init);}}());},{"css":[
".stockphoto-layout-vertical{position:absolute;min-width:160px}.stockphoto_buttonrow{cursor:pointer;display:inline-block}a.stockphoto_buttonrow{color:inherit}.stockphoto-layout-vertical .stockphoto_buttonrow{display:flex}.stockphoto-layout-horizontal .stockphoto_buttonrow{margin-left:10px}.stockphoto_buttonrow_icon{opacity:0.7;transform:opacity 0.3 ease}.stockphoto-layout-vertical .stockphoto_buttonrow_icon{display:inline-block;flex:0;margin:0 10px 10px}.stockphoto-layout-horizontal .stockphoto_buttonrow_icon{padding-right:.2em}.stockphoto_buttonrow:hover .stockphoto_buttonrow_icon{opacity:1}.stockphoto_buttonrow_text{display:inline-block;flex:1;vertical-align:middle;text-align:center}.stockphoto-layout-vertical .stockphoto_buttonrow_text a{font-weight:bold}.stockphoto_buttonrow_text small{display:block; font-size:inherit; }.stockphoto-layout-horizontal-small .stockphoto_buttonrow_text small{display:none}.stockphoto_dialog_row{display:block;margin-bottom:15px}.stockphoto_dialog_row input[type=\"text\"],.stockphoto_dialog_row textarea{width:99%}.stockphoto_attribution_preview{margin:0 1em 1em 0;text-align:center;font-size:0.8em}input#stockphoto_attribution{width:88%}.stockphoto_dialog_row textarea{min-height:80px}textarea#stockphoto_html{font-size:90%}.stockphoto_note{display:block;margin-top:-5px;margin-bottom:15px;font-style:italic;font-size:smaller}"
]});mw.loader.implement("ext.gadget.WatchlistNotice@s850y",function($,jQuery,require,module){if($.inArray(mw.config.get('wgCanonicalSpecialPageName'),['Watchlist','Userlogin'])>-1||/^Commons:Community_portal/.test(mw.config.get('wgPageName'))){mw.loader.load('ext.gadget.WatchlistNotice.core');}},{"css":["#watchlist-message{display:block !important} #watchlist-message-inner{resize:vertical}"]});mw.loader.implement("ext.gadget.WikiMiniAtlas@8njxm",function($,jQuery,require,module){mw.loader.load('//meta.wikimedia.org/w/index.php?title=MediaWiki:Wikiminiatlas.js&action=raw&ctype=text/javascript&smaxage=21600&maxage=86400');});mw.loader.implement("ext.gadget.ZoomViewer@froaz",function($,jQuery,require,module){if(mw.config.get('wgNamespaceNumber')===6&&mw.config.get('wgAction')==='view'&&!mw.util.getParamValue('diff')){$(document).ready(function(){'use strict';var name=mw.config.get('wgPageName').replace(/_/g,' '),id=$('#file img[alt=\''+name.replace(/'/g,'\\\'')+'\']').data();if(!id){return;}var p=id.fileHeight*id.fileWidth;if(p<2*1024*1024)return;var links=$("<span>",{id:"ZoomViewerLinks",style:"white-space:nowrap; display:inline-block;"}),fileName=name.match(/File:(.+\.jpe?g)/i);if(!fileName){return;}var url="https://zoomviewer.toolforge.org/index.php?f="+encodeURIComponent(fileName[1]),link=$("<a>",{href:url+"&flash=no",text:"ZoomViewer"});links.append("; ",link);$('.fileInfo').after(links);});}});mw.loader.implement("ext.gadget.fastcci@1q3fq",function($,jQuery,require,module){$(function(){var $slider,$link,$controls,depthThreshold,request,modal,serverList=['//fastcci1.wmflabs.org/','//fastcci2.wmflabs.org/'],url=serverList[Math.floor(Math.random()*serverList.length)],base='//upload.wikimedia.org/wikipedia/commons/thumb/',badge=['e/e7/Cscr-featured.svg/24px-Cscr-featured.svg.png','a/a5/FV_invert_logo.png/24px-FV_invert_logo.png','8/8c/Quality_images_logo.svg/24px-Quality_images_logo.svg.png','d/d7/Valued_image_seal.svg/24px-Valued_image_seal.svg.png'],helpUrl='//commons.wikimedia.org/wiki/Special:MyLanguage/Help:FastCCI',helpIcon='4/44/Help-browser.svg/24px-Help-browser.svg.png',$e=$('<div>').addClass('fastcci-results').on('click','.fastcci-close',function(){$e.empty();tagLine('');}),maxDepth=0,minDepth=Infinity,ns=mw.config.get('wgNamespaceNumber'),namespaceIds=mw.config.get('wgNamespaceIds'),action=mw.config.get('wgAction'),thisPageId=mw.config.get('wgArticleId'),uiLang=mw.
config.get('wgUserLanguage'),$content=$('#bodyContent, #mw-content-text').eq(0),$tagline=null,i18nData={'Strong match':{ar:'تطابق قوی',bn:'জোরালো মিল',ce:'Къовламе цхьаьнадогӀуш',cs:'Bližší shoda',de:'Starke Übereinstimmung',fa:'تطابق قوی',fr:'Correspondance forte',hr:'Strogo podudaranje',it:'Corrispondenza forte',mk:'Строго совпаѓање',ml:'നന്നായി ചേർച്ചയുള്ളവ',pt:'Forte correspondência',ru:'Строгое соответствие',sv:'Stark överensstämmelse',zh:'强匹配'},'Weak match':{ar:'تطابق ضعيف',bn:'দুর্বল মিল',ce:'Ледара цхьаьнадогӀуш',cs:'Vzdálenější shoda',de:'Schwache Übereinstimmung',fa:'تطابق ضعیف',fr:'Correspondance faible',hr:'Približno podudaranje',it:'Corrispondenza debole',mk:'Благо совпаѓање',ml:'ചെറുതായി ചേർച്ചയുള്ളവ',pt:
'Fraca correspondência',ru:'Слабое соответствие',sv:'Svag överensstämmelse',zh:'弱匹配'},'No results.':{ar:'لا نتائج',bn:'কোন ফলাফল নেই',ce:'Хиламаш бац',cs:'Žádné výsledky.',de:'Keine Ergebnisse.',es:'Sin resultados.',fa:'هیچ نتیجه\u200cای.',fr:'Pas de résultats.',hr:'Nema rezultata.',it:'Nessun risultato.',mk:'Нема резултати.',ml:'ഫലങ്ങളൊന്നുമില്ല',pt:'Sem resultados.',ru:'Нет результатов.',sv:'Inga resultat.',tr:'Sonuç yok.',zh:'无结果。'},'Connecting...':{ar:'اتصال...',bn:'সংযোগ হচ্ছে...',ce:'Тасаялар...',cs:'Připojuji se...',de:'Verbinde ...',es:'Estableciendo conexión...',fa:'اتصال...',fr:'Connexion...',hr:'Povezujem se...',it:'Connessione...',mk:'Се поврзувам...',ml:'എടുക്കുന്നു...',pt:'A conectar...',ru:'Соединение...',sv:'Ansluter...',tr:'Bağlanıyor...',
zh:'连接中...'},'Computing...':{ar:'حساب...',bn:'গণনা চলছে...',ce:'Таллам...',cs:'Pracuji...',de:'Arbeite ...',es:'Calculando...',fa:'محاسبه...',fr:'Calcul...',hr:'Računam...',it:'Calcolo...',mk:'Пресметувам...',ml:'കണക്കാക്കുന്നു...',pt:'A calcular...',ru:'Анализ...',sv:'Beräknar...',tr:'Hesaplanıyor...',zh:'计算中...'},'Digging through NUM files...':{ar:'جارِ البحث عن طريق ملفات  NUM...',bn:'NUM ফাইলের মাধ্যমে সন্ধান...',ce:'Файлийн таллам, NUM терахьца ...',cs:'Prohledávám NUM souborů...',de:'Durchsuche NUM Dateien ...',fa:'استخراج از بین NUM پرونده...',fr:'Fouille dans NUM fichiers...',hr:'Pretražujem datoteke (NUM)...',it:'Ricerca nei file NUM...',mk:'Пребарувам по NUM податотеки...',ml:'NUM പ്രമാണങ്ങൾ പരിശോധിക്കുന്നു...',pt:
'Procurando por ficheiros NUM...',ru:'Анализ файлов, числом NUM ...',sv:'Gräver genom NUM filer',zh:'已查找了NUM个文件...'},'Waiting in line. NUM ahead of us.':{ar:'انتظار في الطابور. NUM تعمل حالياً.',bn:'লাইনে অপেক্ষারত। আমাদের NUM এগিয়ে',ce:'РогӀехь хьежар. Тхуна хьалхахь — NUM.',cs:'Čekáme na řadu, jsme NUM.',de:'Warte darauf an die Reihe zu kommen. NUM Anfragen vor uns.',fa:'ایستادن در خط. NUM جلوی ما.',fr:'En attente. NUM requêtes devant nous.',hr:'Pričekajte u redu. Broj zahtjeva na čekanju: NUM.',it:'Attendi il tuo turno. Richieste NUM prima di noi.',mk:'Чекам во редица. Пред нас има NUM.',ml:'കാത്തിരിക്കുന്നു. NUM കൂടുതലാണ്.',pt:'Aguarde na fila. NUM à nossa frente.',ru:'Ожидание в очереди. Перед нами — NUM.',sv:
'Väntar i kö. NUM framför oss.',zh:'队列中,前边有NUM个文件。'},'Advanced...':{ar:'متقدم...',bn:'উন্নত...',ce:'Хьалхадолу...',cs:'Pokročilé...',de:'Erweitert ...',es:'Avanzado...',fa:'پیشرفته...',fr:'Avancé...',hr:'Napredno...',it:'Avanzate...',ml:'വിപുലം...',pt:'Avançado...',ru:'Продвигаемся...',sv:'Avancerat...',tr:'İlerliyor...',zh:'高级...'},'Good pictures':{ar:'صور جيدة',bn:'ভালো চিত্রসমূহ',ce:'Дика суьрташ',cs:'Dobré obrázky',de:'Gute Bilder',es:'Imágenes buenas',fa:'تصاویر خوب',fr:'Bonnes images',hr:'Dobre slike',it:'Immagini belle',mk:'Добри слики',ml:'മികച്ച ചിത്രങ്ങൾ',pt:'Imagens boas',ru:'Хорошие изображения',sv:'Bra bilder',tr:'İyi resimler',zh:'优秀图片'},'All images':{ar:'جميع الصور',bn:'সব চিত্রসমূহ',ce:'Массо суьрташ',cs:
'Všechny obrázky',de:'Alle Bilder',es:'Todas las imágenes',fa:'همهٔ تصاویر',fr:'Toutes les images',hr:'Sve slike',it:'Tutte le immagini',mk:'Сите слики',ml:'എല്ലാ ചിത്രങ്ങളും',pt:'Todas as imagens',ru:'Все изображения',sv:'Alla bilder',tr:'Tüm görseller',zh:'全部图像'},'Featured pictures':{ar:'صور مختارة',bn:'নির্বাচিত চিত্রসমূহ',ce:'Хаьржина суьрташ',cs:'Nejlepší obrázky',de:'Exzellente Bilder',es:'Imágenes destacadas',fa:'تصاویر برگزیده',fr:'Images remarquables',hr:'Izabrane slike',it:'Immagini in vetrina',mk:'Избрани слики',ml:'തിരഞ്ഞെടുത്ത ചിത്രങ്ങൾ',pt:'Imagens em destaque',ru:'Избранные изображения',sv:'Utvalda bilder',tr:'Seçkin resimler',zh:'特色图片'},'Featured videos':{ar:'مقاطع الفيديو المميزة',bn:
'বৈশিষ্ট্যমূলক ভিডিওগুলি',ce:'истакнути видео снимци',cs:'Nejlepší videa',de:'Exzellente Videos',es:'Vídeos destacados',fa:'ویدئوهای برگزیده',fr:'Vidéo remarquables',hi:'विशेष रुप से प्रदर्शित वीडियो',hr:'istaknuti videozapisi',it:'Video in vetrina',ja:'最高級の動画',mk:'најдобрите видеа',ml:'തിരഞ്ഞെടുത്ത വീഡിയോകൾ',nds:'Grootoordige Videos',pl:'Promowane filmy',pt:'Vídeos em Destaque',ru:'Избранные видео',sv:'Utvalda videoklipp',tr:'Seçkin videolar',vi:'video hay nhất',zh:'精選視頻'},'Quality images':{ar:'صور الجودة',bn:'মানসম্মত চিত্রসমূহ',ce:'ЦӀена суьрташ',cs:'Kvalitní obrázky',de:'Qualitätsbilder',es:'Imágenes de calidad',fa:'تصاویر باکیفیت',fr:'Images de qualité',hr:'Kvalitetne slike',it:
'Immagini di qualità',mk:'Квалитетни слики',ml:'മേന്മയേറിയ ചിത്രങ്ങൾ',pt:'Imagens de qualidade',ru:'Качественные изображения',sv:'Kvalitetsbilder',tr:'Kaliteli görseller',zh:'优质图像'},'Valued images':{ar:'صور قيمة',bn:'মূল্যবান চিত্রসমূহ',ce:'Мехала суьрташ',cs:'Hodnotné obrázky',de:'Wertvolle Bilder',fa:'تصاویر ارزشمند',fr:'Images de valeur',hr:'Cijenjene slike',it:'Immagini di valore',mk:'Ценети слики',ml:'മൂല്യമേറിയ ചിത്രങ്ങൾ',pt:'Imagens de valor',ru:'Ценные иллюстрации',sv:'Värdefulla bilder',tr:'Değerli görseller',zh:'最有价值图像'},'Find images':{ar:'البحث عن صور',bn:'চিত্রসমূহ খুঁজুন',ce:'Лаха сурт',cs:'Najít obrázky',de:'Finde Bilder',es:'Encontrar imágenes',fa:'یافتن تصاویر',fr:
'Trouver les images',hr:'Pronađi slike',it:'Trova le immagini',mk:'Пронајди слики',ml:'ചിത്രങ്ങൾ എടുക്കുക:',pt:'Procurar imagens',ru:'Поиск изображений',sv:'Hitta bilder',tr:'Görsel bul',zh:'搜索图像'},'in this category':{ar:'في هذا التصنيف',bn:'এই বিষয়শ্রেণীতে',ce:'хӀокху категореш',cs:'v této kategorii',de:'aus dieser Kategorie',es:'en esta categoría',fa:'در این رده',fr:'dans cette catégorie',hr:'u ovoj kategoriji',it:'in questa categoria',mk:'во категоријава',ml:'ഈ വർഗ്ഗത്തിലെ',pt:'nesta categoria',ru:'в этой категории',sv:'i denna kategori',tr:'bu kategoride',zh:'在本分类'},'and in':{ar:'أضف إلى',bn:'এবং এতে',ce:'кхин чохь',cs:'a zároveň v',de:'die auch sind in',es:'y en',mk:'и во',fa:'و در',fr:'et dans',hr:'kao i u',it:'e in',ml:
'ഒപ്പം ഇതിലേയും',pt:'e em',ru:'и в',sv:'och i',tr:'ve burada',zh:'且在'},'but not in':{ar:'لا تضع في',bn:'কিন্তু এতে নয়',ce:'амма чохь хӀума яц',cs:'ale ne v',fa:'ولی نه در',de:'die nicht sind in',es:'pero no en',fr:'mais pas dans',hr:'ali ne u',it:'ma non in',mk:'но не во',ml:'ഇതിൽ ഉള്ളത് വേണ്ട',pt:'mas não em',ru:'но не в',sv:'men inte i',tr:'burada olmayan',zh:'但不在'},category:{ar:'تصنيف',bn:'বিষয়শ্রেণী',ce:'категори',cs:'kategorie',de:'Kategorie',es:'categoría',fa:'رده',fr:'catégorie',hr:'kategorija',it:'categoria',mk:'категорија',ml:'വർഗ്ഗം',pt:'categoria',ru:'категория',sv:'kategori',tr:'kategori',zh:'分类'},'In this category <b>and</b> in...':{ar:'في هذا التصنيف <b>و</b> في...',bn:'এই বিষয়শ্রেণীতে <b>এবং</b> এতে...',ce:
'ХӀокху категореш чохь <b>кхин</b> чохь...',cs:'V této kategorii <b>a zároveň</b> v…',de:'In dieser Kategorie <b>und</b> in ...',es:'En esta categoría <b>y</b> en...',fa:'در این رده <b>و</b> در...',fr:'Dans cette catégorie <b>et</b> dans...',hr:'U ovoj kategoriji <b>i</b> u...',it:'In questa categoria <b>e</b> in...',mk:'во категоријава <b>и</b> во...',ml:'ഈ വർഗ്ഗത്തിലേയും <b>ഒപ്പം</b> ഇതിലേയും...',pt:'Nesta categoria <b>e</b> em...',ru:'В этой категории <b>и</b> в...',sv:'I denna kategori <b>och</b> i...',tr:'Bu kategoride <b>ve</b> şurada olanlar...',zh:'在本分类<b>且</b>在...'},'In this category <b>but not</b> in...':{ar:'في هذا التصنيف <b>وليس</b> في...',bn:'এই বিষয়শ্রেণীতে <b>কিন্তু</b> এতে নয়...',cs:'V této kategorii, <b>ale ne</b> v…',de:
'In dieser Kategorie, <b>aber nicht</b> in ...',es:'En esta categoría <b>pero no</b> en...',fa:'در این رده <b>ولی نه</b> در...',fr:'Dans cette catégorie <b>mais pas</b> dans...',hr:'U ovoj kategoriji <b>ali ne</b> u...',it:'In questa categoria <b>ma non</b> in...',mk:'во категоријава <b>но не</b> во...',ml:'ഈ വർഗ്ഗത്തിലേയും <b>പക്ഷേ</b> ഇതിലില്ലാത്തവയും...',pt:'Nesta categoria <b>mas não</b> em...',ru:'В этой категории, <b>но не</b> в...',sv:'I denna kategori <b>men inte</b> i...',tr:'Bu kategoride olan <b>ancak</b> şurada olmayanlar...',zh:'在本分类<b>但不</b>在...'},'More...':{ar:'المزيد...',bn:'আরও...',ce:'Кхин...',cs:'Další…',de:'Weitere ...',es:'Más...',fa:'بیشتر...',fr:'Plus...',hr:'Više...',it:'Altro...',mk:'Повеќе...',ml:'കൂടുതൽ...',pt:'Mais...',ru:'Ещё...',sv:'Mer...',tr:'Daha fazla...',zh:
'更多...'},'About FastCCI...':{ar:'حول FastCCI...',bn:'FastCCI সম্পর্কে...',cs:'O FastCCI…',ce:'Цунах лаьцна FastCCI...',de:'Über FastCCI ...',es:'Acerca de FastCCI...',fa:'دربارهٔ FastCCI...',hr:'O FastCCIju',it:'A proposito di FastCCI...',ml:'FastCCI വിവരണം...',pt:'Acerca de FastCCI...',ru:'Описание FastCCI...',sv:'Om FastCCI...',tr:'FastCCI hakkında...',zh:'关于FastCCI...'},Ok:{ar:'موافق',de:'OK',es:'Aceptar',hr:'U redu',it:'Va bene',pt:'OK',sv:'OK',tr:'Tamam',zh:'OK'},Cancel:{ar:'إلغاء',de:'Abbrechen',es:'Cancelar',hr:'Odustani',it:'Annulla',pt:'Cancelar',sv:'Avbryt',tr:'İptal',zh:'取消'}};function i18n(key){if(!(key in i18nData)||!(uiLang in i18nData[key])){return key;}return i18nData[key][uiLang];}function requestXHR(params,callback){$.get('https:'+url,params).then(function(data){var i,res=data.split('\n');for(i=0;i<res.length;++i){callback(res[i]);}});}function requestJS(params,callback){window.
fastcciCallback=function(res){var i;for(i=0;i<res.length;++i){callback(res[i]);}};$.getScript('https:'+url+'?t=js&'+$.param(params));}function requestSocket(params,callback){var ws=new WebSocket('wss:'+url+'?'+$.param(params));ws.onmessage=function(event){callback(event.data);};ws.onerror=function(){};}request=('WebSocket'in window)?requestSocket:(('withCredentials'in new XMLHttpRequest())?requestXHR:requestJS);function processResult(res,ctx,callback,append){var r=res.split('|'),t,l=r.length,i,pageids,ids=Array(l),depths=Array(l),tags=Array(l),ret=append||[];for(i=0;i<l;++i){t=r[i].split(',');ids[i]=t[0];depths[i]=parseInt(t[1],10);tags[i]=parseInt(t[2]||'0',10);}pageids=ids.join('|');$.get(mw.util.wikiScript('api'),{action:'query',pageids:pageids,format:'json',utf8:true,prop:'imageinfo|info',iiprop:'size|user|sha1',inprop:'url'}).done(function(data){var j,l=ids.length,p=data.query.pages;for(j=0;j<l;++j){if(ids[j]in p){p[ids[j]].fastcciDepth=depths[j];p[ids[j]].fastcciTag=tags[j];ret.
push(p[ids[j]]);}else{ret.push(null);}}callback(ret,ctx);});}function breadCrumbs(txt){var token=txt.split(' ');if(token.length!==2||token[0]!=='RESULT'){return;}processResult(token[1],null,function(trail){var l=trail.length,i,bc=[];for(i=0;i<l;++i){if('fullurl'in trail[i]&&'title'in trail[i]){bc.push('<a href="'+trail[i].fullurl+'">'+trail[i].title.replace(/^Category:/,'')+'</a>');}else{bc.push('???');}}$content.prepend($('<div>').addClass('fastcci-breadcrumbs').html(bc.join(' &rarr; ')));});}function fetchGallery(params){var numResult=0,dbAge=0;maxDepth=0;minDepth=Infinity;function slideMove(event,ui){var i;if(ui.value===depthThreshold){return;}depthThreshold=ui.value;for(i=minDepth;i<=maxDepth;++i){if(i>depthThreshold){$('.fastcci-depth'+i).hide();}else{$('.fastcci-depth'+i).show();}}}function addToGallery(txt){var age,token=txt.split(' '),d=300;if(numResult===0){switch(token[0]){case'DONE':$e.text(i18n('No results.'));return;case'QUEUED':$e.text(i18n(
'Waiting in line. NUM ahead of us.').replace('NUM',token[1]));return;case'COMPUTE_START':$e.text(i18n('Computing...'));return;case'WORKING':$e.text(i18n('Digging through NUM files...').replace('NUM',parseInt(token[1],10)+parseInt(token[2],10)));return;}}switch(token[0]){case'DONE':if(dbAge<60){age=dbAge+'s';}else if(dbAge<3600){age=Math.round(dbAge/60)+'m';}else if(dbAge<86400){age=Math.round(dbAge/3600)+'h';}else{age=Math.round(dbAge/86400)+'d';}$e.append($('<div>').addClass('fastcci-resultstatus').text(age));if(numResult===params.s){$e.append($('<button>').text(i18n('More...')).button().on('click',function(){var s=params.s||200,o=params.o||0;params.o=o+s;window.scrollTo(0,0);fetchGallery(params);}));}return;case'DBAGE':dbAge=parseInt(token[1]||'0',10);return;}if(token.length<2||token[0]!=='RESULT'){return;}if(numResult===0){$e.empty().append($controls);$link.attr('href',location.pathname+'?fastcci='+encodeURIComponent(JSON.stringify(params)));depthThreshold=1000;$slider.slider({
change:slideMove,slide:slideMove,stop:slideMove,value:depthThreshold});}numResult+=token[1].split('|').length;processResult(token[1],$('<span>').appendTo($e),function(ids){var j,ow,oh,w,h,p,i,t,depth,$div,path,l=ids.length;for(j=0;j<l;++j){p=ids[j];if(p===null||!('imageinfo'in p)){continue;}depth=p.fastcciDepth;if(depth>maxDepth){maxDepth=depth;}if(depth<minDepth){minDepth=depth;}i=p.imageinfo[0];ow=i.width;oh=i.height;if(ow>oh){w=Math.round(ow*d/oh);h=d;}else{h=Math.round(oh*d/ow);w=d;}t=encodeURIComponent(new mw.Title(p.title).getMain());if(Math.ceil(w)>=ow){w=ow;h=oh;path='/wiki/Special:Redirect/file/'+t;}else{path='/w/index.php?title=Special:Redirect/file/'+t+'&width='+Math.ceil(w);}$div=$('<div>').addClass('fastcci-image').addClass('fastcci-depth'+depth).css({width:d+'px',height:d+'px'}).append($('<a>').attr('href',p.fullurl+'?fastcci_from='+thisPageId+'&'+$.param(params)).append($('<img>').attr('src',path).css({position:'absolute',left:Math.round(-(w-d)/2)+'px',top:Math.round(-(h
-d)/2)+'px'})));if(p.fastcciTag>0&&p.fastcciTag<=4){$('<img>').addClass('fastcci-badge').attr('src',base+badge[p.fastcciTag-1]).appendTo($div);}$e.append($div);}$slider.slider({min:minDepth,max:maxDepth,value:Math.max(maxDepth,depthThreshold)});});}$e.empty().prependTo($content).text(i18n('Connecting...'));request(params,addToGallery);}function tagLine(html){if($tagline===null){$tagline=$('<span>').addClass('fastcci-tagline').appendTo($('#firstHeading>span').eq(0));}$tagline.html(html);}function showDialog(operation){var text;function resolveRedirect(t){modal.isRedirect[t]=true;$.get(mw.util.wikiScript('index'),{action:'raw',title:'Category:'+t},undefined,'text').done(function(data){var m=/\{\{[Cc]ategory[_ ]redirect\|([Cc]ategory:|)([^}]+)\}\}/.exec(data);if(m!==null){$.getJSON(mw.util.wikiScript('api'),{action:'query',format:'json',titles:'Category:'+m[2],indexpageids:true}).done(function(data){var i=parseInt(data.query.pageids[0],10);if(i>=0){modal.isRedirect[t]=i;validate();}});}})
;}function getTagLine(){var v=modal.$input.val();switch(modal.operation){case'and':return i18n('and in')+' <i>'+v+'</i>';case'not':return i18n('but not in')+' <i>'+v+'</i>';}return'';}function pageId(){var v=modal.$input.val();if(v in modal.isRedirect){if(modal.isRedirect[v]===true){return undefined;}else{return modal.isRedirect[v];}}if(v in modal.pageIds){return modal.pageIds[v];}else{return undefined;}}function validate(){if(pageId()!==undefined){modal.$ok.button('enable');}else{modal.$ok.button('disable');}}function performOperation(){var id=pageId();if(id!==undefined){fetchGallery({c1:thisPageId,c2:id,d1:15,d2:15,s:200,a:modal.operation});tagLine(getTagLine());}else{mw.notify('Error.');}modal.$div.dialog('close');}if(!modal){modal={cache:{},pageIds:{},isRedirect:{},operation:null};modal.$div=$('<div>');modal.$input=$('<input>').attr('placeholder',i18n('category')).appendTo(modal.$div).autocomplete({minLength:2,source:function(request,response){var term=request.term.replace(/ /g,'_'
);if(term in modal.cache){response(modal.cache[term]);return;}$.getJSON(mw.util.wikiScript('api'),{action:'query',format:'json',generator:'allpages',gapprefix:term,gapnamespace:14,prop:'templates',tltemplates:'Template:Category_redirect'},function(data){var list=[],a,i,t;if(('query'in data)&&('pages'in data.query)){a=data.query.pages;for(i in a){if(Object.prototype.hasOwnProperty.call(a,i)){t=a[i].title.replace(/^Category:/,'');modal.pageIds[t]=i;if('templates'in a[i]&&!(t in modal.isRedirect)){resolveRedirect(t);}list.push(t);}}modal.cache[term]=list;}validate();response(list.sort());});},change:validate,select:function(e,ui){modal.$input.val(ui.item.value);validate();e.preventDefault();}}).on('keyup',validate).on('keypress',function(e){if(e.keyCode===$.ui.keyCode.ENTER&&pageId()){performOperation();}});modal.$div.dialog({autoOpen:false,modal:true,buttons:[{text:i18n('Ok'),click:performOperation},{text:i18n('Cancel'),click:function(){modal.$div.dialog('close');}}]});modal.$ok=$(
'button',modal.$div.parent()).eq(0);validate();}text={and:['In this category <b>and</b> in...','and in'],not:['In this category <b>but not</b> in...','but not in']};modal.$div.dialog('option','title',i18n(text[operation][0]));modal.operation=operation;modal.$div.dialog('open');}function addCatUI(){var $box=$('#firstHeading'),$buttonset,$menu=$('<ul>').addClass('fastcci-menu'),$advanced=$('<button>').text(i18n('Advanced...')).button({text:false,icons:{primary:'ui-icon-triangle-1-s'}}).on('click',function(e){$menu.toggle();e.stopPropagation();}),width;$buttonset=$('<div>').addClass('fastcci-buttonset').attr('lang',uiLang).append($('<button>').attr('title',i18n('Featured pictures')+', '+i18n('Featured videos')+', '+i18n('Quality images')+', '+i18n('Valued images')).append($('<img>').attr({id:'fastcci-fqv1',src:base+badge[3]}),$('<img>').attr({id:'fastcci-fqv2',src:base+badge[2]}),$('<img>').attr({id:'fastcci-fqv3',src:base+badge[1]}),$('<img>').attr({id:'fastcci-fqv4',src:base+badge[0]}),
$('<span>').attr('id','fastcci-buttontextwrapper').append($('<span>').attr('id','fastcci-buttontext').text(i18n('Good pictures')))).on('click',function(){fetchGallery({c1:thisPageId,d1:15,s:200,a:'fqv'});tagLine(i18n('Good pictures'));}),$advanced).buttonset().append($menu).appendTo($box);width=$buttonset.outerWidth(true);$menu.append($('<li>').append($('<a>').attr('href','#').append($('<span>').attr('id','fastcci-allimages').text(i18n('All images'))).on('click',function(){fetchGallery({c1:thisPageId,d1:15,s:200,a:'list'});tagLine(i18n('All images'));})).css('margin-bottom','0.5em'),$('<li>').append($('<a>').attr('href','#').append($('<img>').addClass('fastcci-badges').attr('src',base+badge[0]),i18n('Featured pictures')).on('click',function(){fetchGallery({c1:thisPageId,c2:3943817,d1:15,d2:0,s:200});tagLine(i18n('Featured pictures'));})),$('<li>').append($('<a>').attr('href','#').append($('<img>').addClass('fastcci-badges').attr('src',base+badge[1]),i18n('Featured videos')).on('click',
function(){fetchGallery({c1:thisPageId,c2:8460057,d1:15,d2:0,s:200});tagLine(i18n('Featured videos'));})),$('<li>').append($('<a>').attr('href','#').append($('<img>').addClass('fastcci-badges').attr('src',base+badge[2]),i18n('Quality images')).on('click',function(){fetchGallery({c1:thisPageId,c2:3618826,d1:15,d2:0,s:200});tagLine(i18n('Quality images'));})),$('<li>').append($('<a>').attr('href','#').append($('<img>').addClass('fastcci-badges').attr('src',base+badge[3]),i18n('Valued images')).on('click',function(){fetchGallery({c1:thisPageId,c2:4143367,d1:15,d2:0,s:200});tagLine(i18n('Valued images'));})).css('margin-bottom','0.5em'),$('<li>').append($('<a>').attr('href','#').append($('<img>').addClass('fastcci-badges').attr('src',base+'4/45/Fastcci_intersect.svg/24px-Fastcci_intersect.svg.png'),i18n('In this category <b>and</b> in...')).on('click',function(){showDialog('and');$menu.hide();})),$('<li>').append($('<a>').attr('href','#').append($('<img>').addClass('fastcci-badges').attr(
'src',base+'d/d5/Fastcci_notin.svg/24px-Fastcci_notin.svg.png'),i18n('In this category <b>but not</b> in...')).on('click',function(){showDialog('not');$menu.hide();})).css('margin-bottom','0.5em'),$('<li>').append($('<a>').attr('href',helpUrl).attr('target','_blank').append($('<img>').addClass('fastcci-badges').attr('src',base+helpIcon),i18n('About FastCCI...')).on('click',function(e){e.stopImmediatePropagation();$menu.hide();}))).menu().position({my:'top',at:'bottom',of:$advanced,within:$buttonset,collide:'none'}).hide();$slider=$('<div>').addClass('fastcci-slider');$link=$('<a>').addClass('fastcci-help').append($('<img>').attr('src','//upload.wikimedia.org/wikipedia/commons/f/fd/Link.png'));$controls=$('<div>').addClass('fastcci-controls').append(i18n('Strong match')).append($slider).append(i18n('Weak match')).append($('<a>').addClass('fastcci-help').attr('href',helpUrl).append($('<img>').attr('src',base+helpIcon))).append($link).append($('<img>').attr('src',
'//upload.wikimedia.org/wikipedia/commons/thumb/4/4c/Grey_close_x.svg/22px-Grey_close_x.svg.png').addClass('fastcci-close'));function resize(){var space=$('#firstHeading').width()-$('#firstHeading>span').width()-10;if(space<width){$('#fastcci-buttontext').hide();}else{$('#fastcci-buttontext').show();}}resize();$(window).on('resize',resize);$(document).on('click',function(){$menu.hide();});}if(ns===namespaceIds.category&&action==='view'){mw.loader.using(['jquery.ui'],addCatUI);var param,urlarg=mw.util.getParamValue('fastcci');if(urlarg){try{param=JSON.parse(urlarg);param.c1=thisPageId;param.s=param.s||200;if(param.s>1000){param.s=1000;}mw.loader.using('jquery.ui',function(){fetchGallery(param);});}catch(e){mw.notify('FastCCI URL parameters invalid.');}}}var from=mw.util.getParamValue('fastcci_from');if(ns===namespaceIds.file&&from){request({c1:parseInt(from,10),c2:thisPageId,a:'path'},breadCrumbs);}var and_from=mw.util.getParamValue('c2');if(ns===namespaceIds.file&&from){request({c1:
parseInt(and_from,10),c2:thisPageId,a:'path'},breadCrumbs);}});},{"css":[
".sitedir-ltr .mw-indicators{margin-left:1em}.sitedir-rtl .mw-indicators{margin-right:1em} #firstHeading .fastcci-button{color:black;border:1px solid lightgray;margin:0 0.2em 0 0;padding:2px 2px 2px 2px;text-decoration:none; font-size:0.5em;height:28px}#firstHeading\u003E.fastcci-button{float:right;margin:0 0 0.2em 1em; }#firstHeading .fastcci-button\u003Espan{padding:0 0.4em 0 0.4em;position:relative;top:1px}#firstHeading .fastcci-button\u003Eimg{position:relative;top:-2px;vertical-align:middle}#firstHeading .fastcci-tagline{font-size:70%;margin-left:1em}.fastcci-breadcrumbs{border:1px solid lightgray;padding:0.5em;margin-bottom:1px}.fastcci-results input[type=\"range\"]{width:40%}.fastcci-results .fastcci-image{overflow:hidden;display:inline-block;position:relative;margin:5px;box-shadow:3px 3px 15px rgba(0,0,0,0.3)}.fastcci-results .fastcci-slider{display:inline-block;margin:0 1em 0 1em;width:40%}.fastcci-help,.fastcci-close{margin-left:2em;cursor:pointer}.fastcci-results .fastcci-badge{position:absolute;top:5px;left:5px}#firstHeading,#mw_header h1{overflow:visible}div.fastcci-buttonset{float:right;position:relative;display:inline-block;font-size:15px;margin:-5px 0 0 0}#firstHeading div.fastcci-buttonset{margin-top:0}div.fastcci-buttonset\u003Ebutton{height:31px;margin:0 -1px 0 0 !important} #firstHeading div.fastcci-buttonset\u003E.ui-button{background:#f8f9fa !important;box-shadow:none !important;color:#36c !important;border-radius:2px !important}#firstHeading div.fastcci-buttonset\u003E.ui-button:hover{background:#fff !important}#fastcci-fqv1,#fastcci-fqv2,#fastcci-fqv3,#fastcci-fqv4{position:absolute;margin-top:-1px}#fastcci-fqv1{left:32px}#fastcci-fqv2{left:25px;margin-top:0}#fastcci-fqv3{left:19px}#fastcci-fqv4{left:4px}#fastcci-buttontextwrapper{margin-left:25px}#fastcci-buttontext{margin-left:15px}.fastcci-menu{position:absolute;font-size:15px;z-index:10;white-space:nowrap;left:initial !important;right:0 !important}.fastcci-menu label{display:block}.fastcci-menu label\u003Eimg{margin:0 0.2em 0 0.2em}.fastcci-menu label\u003Einput{margin-left:0.7em}.fastcci-badges{margin-right:10px}#fastcci-allimages{margin-left:34px}"
]});mw.loader.implement("ext.gadget.libCommons@jq08p",function($,jQuery,require,module){(function($,mw){"use strict";if(!mw.libs.commons)mw.libs.commons={};var lc=mw.libs.commons;$.extend(mw.libs.commons,{fixDoubleEncoding:function(s){if(!s)return s;var utf8=/[u00C2-u00F4][u0080-u00BF][u0080-u00BF]?[u0080-u00BF]?/g;if(!utf8.test(s))return s;var temp="",curr=0,m,hex_digit="0123456789ABCDEF";var str=s.replace(/%/g,'%25');utf8.lastIndex=0;try{while((m=utf8.exec(str))!==null){temp+=str.substring(curr,m.index);m=m[0];for(var i=0;i<m.length;i++){temp+='%'+hex_digit.charAt(m.charCodeAt(i)/16)+hex_digit.charAt(m.charCodeAt(i)%16);}curr=utf8.lastIndex;}if(curr<str.length)temp+=str.substring(curr);temp=decodeURIComponent(temp);return temp;}catch(e){}return s;},smallChangesBots:['FlickreviewR','Rotatebot','Cropbot','Picasa Review Bot','Reedy RotateBot','OgreBot','Panoramio Review Bot','Picasa Review Bot 2','FlickreviewR 2','SteinsplitterBot','Embedded Data Bot',],isSmallChangesBot:function(name){
return($.inArray(name,lc.smallChangesBots)>-1);},getUploadBotUser:function(bot,content,comment,firstTextRevisionUser){var match;switch(bot){case'Upload Bot (Rich Smith)':case'File Upload Bot (Magnus Manske)':match=/^[Tt]ransferr?e?d from .+? by \[\[User:([^\]\|]*)(\|([^\]]*))?\]\] using/.exec(comment);var reOldCH=/[Tt]ransferred to Commons by \[\[User:([^\]\|]+)(?:\|(?:[^\]]*))?\]\] using/;if(!match)match=reOldCH.exec(comment);if(!match)match=reOldCH.exec(content);if(!match)match=/\{\{transferred from\|[^\}\|]+\|([^\}\|]+)\|[^\}\|]+\}\}/.exec(content);var oldGeograph=/geograph.org.uk\]; transferr?e?d by \[\[User:([^\]\|]+)(?:\|(?:[^\]]*))?\]\] using/;if(!match)match=oldGeograph.exec(comment);if(!match)match=oldGeograph.exec(content);if(!match)match=/\* Uploaded by \[\[User:([^\]\|]+)\|(?:(?:[^\]]*))?/.exec(comment);if(!match)match=/\* Uploaded by \[\[User:([^\]\|]+)(?:\|(?:[^\]]*))?\]\]/.exec(content);if(match)match=match[1];match=lc.fixDoubleEncoding(match);break;case'FlickrLickr':
match=/\n\|reviewer=\s*(.+)\n/.exec(content);if(match)match=match[1];break;case'Flickr upload bot':match=/\{\{User:Flickr upload bot\/upload(?:-pd)?(?:\|[^\|\}]*)?\|reviewer=([^\}]+)\}\}/.exec(content);if(match)match=match[1];if(!match)match=firstTextRevisionUser;break;default:return bot;}if(match){match=match.replace(/^[\s_]+/,'').replace(/[\s_]+$/,'').replace(/[\s_]+/g,' ');match=match.substr(0,1).toUpperCase()+match.substr(1);bot=match;}return bot;}});}(jQuery,mediaWiki));});mw.loader.implement("ext.gadget.libJQuery@1ib1w",function($,jQuery,require,module){(function($,mw){"use strict";$.extend({createIcon:function(iconClass){return $('<span>',{'class':'ui-icon '+iconClass+' jquery-inline-icon',text:' '});},createNotifyArea:function(textNode,icon,state){return $('<div>',{'class':'ui-widget'}).append($('<div>',{'class':state+' ui-corner-all',style:'margin-top:20px; padding:0.7em;'}).append($('<p>').append($.createIcon(icon).css('margin-right','.3em'),textNode)));},ucFirst:function(str){return str.charAt(0).toUpperCase()+str.slice(1);}});mw.messages.set({'libjq-cancel-title':"Close this dialog [Esc]",'libjq-proceed-title':"Proceed [Enter] in single-line text fields",'libjq-report-title':"Reporting errors helps improving the application"});var buttonConfig={proceed:{'icon':'ui-icon-circle-check','class':'ui-button-green','title':'libjq-proceed-title'},cancel:{'icon':'ui-icon-circle-close','class':'ui-button-red','title':'libjq-cancel-title'},report:{'icon':
'ui-icon-circle-check','class':'','title':'libjq-report-title'}};$.extend($.fn,{specialButton:function(which){return(function($btn,cfg){return $btn.button({icons:{primary:cfg.icon}}).addClass(cfg['class']).attr('title',mw.msg(cfg.title));}(this,buttonConfig[which]));},_jqInteraction:function(){var $el=this;return $el.hover(function(){$el.addClass('ui-state-hover');},function(){$el.removeClass('ui-state-hover').removeClass('ui-state-active');}).focusin(function(){$el.addClass('ui-state-focus');}).focusout(function(){$el.removeClass('ui-state-focus');}).mousedown(function(e){if(1===e.which)$el.addClass('ui-state-active');}).mouseup(function(){$el.removeClass('ui-state-active');});}});}(jQuery,mediaWiki));},{"css":[".jquery-inline-icon{display:inline-block !important;position:relative;top:2px}"]});mw.loader.implement("ext.gadget.libUtil@36a3h",function($,jQuery,require,module){(function(){"use strict";if(!mw.libs.commons)mw.libs.commons={};var lc=mw.libs.commons;$.extend(mw.libs.commons,{guessUser:function(){var title,target,user;user=mw.config.get('wgRelevantUserName');if(user){return user;}switch(mw.config.get('wgNamespaceNumber')){case 3:case 2:return mw.config.get('wgPageName').match(/.*?\:(.*?)(\/.*)*$/)[1];case-1:try{switch(mw.config.get('wgCanonicalSpecialPageName')){case'CentralAuth':target=mw.util.getParamValue('target');if(target){return target;}title=mw.util.getParamValue('title');if(title){title=title.match(/Special\:(?:CentralAuth)\/(.*)$/);if(title){return title[1];}}if(/Special\:(?:CentralAuth)\//.test(location.href)){return decodeURIComponent(location.href.match(/Special\:(?:CentralAuth)\/(.*?)(?:[\?&].*)?$/)[1]);}break;case'Log':if(mw.util.getParamValue('page')&&/User:+./.test(mw.util.getParamValue('page'))){return mw.util.getParamValue('page').replace('User:',
'');}break;}}catch(ex){}break;}},monthNamesInSiteLang:['','January','February','March','April','May','June','July','August','September','October','November','December'],formatDate:function(fmt,date,fallbackDate){var pad0=function(s){return(s>9?s:"0"+s);};date=date||fallbackDate||new Date();var month=date.getUTCMonth()+1;fmt=fmt.replace(/YYYY/g,date.getUTCFullYear());fmt=fmt.replace(/MM/g,pad0(month));date=date.getUTCDate();fmt=fmt.replace(/DD/g,pad0(date));fmt=fmt.replace(/MON/g,lc.monthNamesInSiteLang[month]);fmt=fmt.replace(/DAY/g,date);return fmt;},getTalkPageFromTitle:function(title){var rens=/^(.+)\:/,pref=title.match(rens),nsid=-1,newPref;if(pref){pref=pref[1].toLowerCase().replace(/ /g,'_');}else{pref='';}nsid=mw.config.get('wgNamespaceIds')[pref];if(0===nsid%2)nsid++;newPref=mw.config.get('wgFormattedNamespaces')[nsid]+':';if(pref){title=title.replace(/^.+\:/,newPref);}else{title=newPref+title;}return title;},titleFromImgSrc:function(src){mw.log.warn(
".titleFromImgSrc() is deprecated. Use mw.Title.newFromImg() instead.");try{return decodeURIComponent(src).match(/\/[a-f0-9]\/[a-f0-9]{2}\/(\S+\.\S{2,5})\//)[1].replace(/_/g,' ');}catch(ex){try{return decodeURIComponent(src).match(/thumb\.php.*(?:\?|\&)f=(\S+\.\S{2,5})(?:\&.+)?$/)[1].replace(/_/g,' ');}catch(ex2){try{return decodeURIComponent(src).match(/\/[a-f0-9]\/[a-f0-9]{2}\/(\S+\.\S{2,5})$/)[1].replace(/_/g,' ');}catch(ex3){}}}}});}());});