wikiparser-node 1.18.0 → 1.18.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/bin/config.js +3 -1
- package/bundle/bundle-es7.min.js +24 -24
- package/bundle/bundle-lsp.min.js +95 -29
- package/bundle/bundle.min.js +24 -24
- package/config/.schema.json +14 -1
- package/config/default.json +460 -4
- package/config/enwiki.json +111 -0
- package/config/jawiki.json +954 -0
- package/config/llwiki.json +117 -0
- package/config/minimum.json +3 -0
- package/config/moegirl.json +104 -0
- package/config/zhwiki.json +109 -0
- package/data/signatures.json +141 -353
- package/dist/base.d.mts +10 -1
- package/dist/base.d.ts +10 -1
- package/dist/bin/config.js +67 -39
- package/dist/index.js +7 -5
- package/dist/lib/document.d.ts +6 -6
- package/dist/lib/document.js +43 -36
- package/dist/lib/lsp.d.ts +20 -3
- package/dist/lib/lsp.js +267 -103
- package/dist/src/attribute.js +10 -4
- package/dist/src/index.js +2 -2
- package/dist/src/nowiki/doubleUnderscore.js +3 -2
- package/dist/src/transclude.js +23 -12
- package/dist/util/diff.js +1 -1
- package/dist/util/lint.js +32 -1
- package/extensions/dist/base.js +1 -1
- package/extensions/dist/lsp.js +0 -5
- package/extensions/es7/base.js +1 -1
- package/i18n/zh-hans.json +1 -0
- package/i18n/zh-hant.json +1 -0
- package/package.json +6 -3
package/bundle/bundle-lsp.min.js
CHANGED
|
@@ -1,38 +1,104 @@
|
|
|
1
|
-
"use strict";(()=>{var da=Object.create;var vt=Object.defineProperty;var qi=Object.getOwnPropertyDescriptor;var ga=Object.getOwnPropertyNames;var ua=Object.prototype.hasOwnProperty;var _i=(a,n)=>(n=Symbol[a])?n:Symbol.for("Symbol."+a),At=a=>{throw TypeError(a)};var Oi=(a,n,e)=>n in a?vt(a,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[n]=e;var Bi=(a,n)=>vt(a,"name",{value:n,configurable:!0});var k=(a,n)=>()=>(a&&(n=a(a=0)),n);var pa=(a,n)=>()=>(n||a((n={exports:{}}).exports,n),n.exports),se=(a,n)=>{for(var e in n)vt(a,e,{get:n[e],enumerable:!0})},ca=(a,n,e,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of ga(n))!ua.call(a,r)&&r!==e&&vt(a,r,{get:()=>n[r],enumerable:!(t=qi(n,r))||t.enumerable});return a};var J=a=>ca(vt({},"__esModule",{value:!0}),a);var oe=a=>{var n;return[,,,da((n=a==null?void 0:a[_i("metadata")])!=null?n:null)]},Mi=["class","method","getter","setter","accessor","field","value","get","set"],mr=a=>a!==void 0&&typeof a!="function"?At("Function expected"):a,ma=(a,n,e,t,r)=>({kind:Mi[a],name:n,metadata:t,addInitializer:i=>e._?At("Already initialized"):r.push(mr(i||null))}),ha=(a,n)=>Oi(n,_i("metadata"),a[3]),ae=(a,n,e,t)=>{for(var r=0,i=a[n>>1],s=i&&i.length;r<s;r++)n&1?i[r].call(e):t=i[r].call(e,t);return t},le=(a,n,e,t,r,i)=>{var s,o,l,u,p,d=n&7,g=!!(n&8),f=!!(n&16),h=d>3?a.length+1:d?g?1:2:0,m=Mi[d+5],x=d>3&&(a[h-1]=[]),y=a[h]||(a[h]=[]),w=d&&(!f&&!g&&(r=r.prototype),d<5&&(d>3||!f)&&qi(d<4?r:{get[e](){return c(this,i)},set[e]($){return b(this,i,$)}},e));d?f&&d<4&&Bi(i,(d>2?"set ":d>1?"get ":"")+e):Bi(r,e);for(var C=t.length-1;C>=0;C--)u=ma(d,e,l={},a[3],y),d&&(u.static=g,u.private=f,p=u.access={has:f?$=>fa(r,$):$=>e in $},d^3&&(p.get=f?$=>(d^1?c:A)($,r,d^4?i:w.get):$=>$[e]),d>2&&(p.set=f?($,L)=>b($,r,L,d^4?i:w.set):($,L)=>$[e]=L)),o=(0,t[C])(d?d<4?f?i:w[m]:d>4?void 0:{get:w.get,set:w.set}:r,u),l._=1,d^4||o===void 0?mr(o)&&(d>4?x.unshift(o):d?f?i=o:w[m]=o:r=o):typeof o!="object"||o===null?At("Object expected"):(mr(s=o.get)&&(w.get=s),mr(s=o.set)&&(w.set=s),mr(s=o.init)&&x.unshift(s));return d||ha(a,r),w&&vt(r,e,w),f?d^4?i:w:r},te=(a,n,e)=>Oi(a,typeof n!="symbol"?n+"":n,e),qn=(a,n,e)=>n.has(a)||At("Cannot "+e),fa=(a,n)=>Object(n)!==n?At('Cannot use the "in" operator on this value'):a.has(n),c=(a,n,e)=>(qn(a,n,"read from private field"),e?e.call(a):n.get(a)),T=(a,n,e)=>n.has(a)?At("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(a):n.set(a,e),b=(a,n,e,t)=>(qn(a,n,"write to private field"),t?t.call(a,e):n.set(a,e),e),A=(a,n,e)=>(qn(a,n,"access private method"),e);var Vr=(a,n,e,t)=>({set _(r){b(a,n,r,e)},get _(){return c(a,n,t)}});var Di,Wi,Hi=k(()=>{"use strict";Di=(()=>{let a={redirect:1,onlyinclude:1,noinclude:1,include:1,comment:1,ext:1,arg:2,"magic-word":2,template:2,heading:2,html:3,table:4,hr:5,"double-underscore":5,link:6,category:6,file:6,quote:7,"ext-link":8,"free-ext-link":9,"magic-link":9,list:10,dd:10,converter:11};return Object.setPrototypeOf(a,null),a})(),Wi=(()=>{let a=["bold-header","format-leakage","fostered-content","h1","illegal-attr","insecure-style","invalid-gallery","invalid-imagemap","invalid-invoke","invalid-isbn","lonely-apos","lonely-bracket","lonely-http","nested-link","no-arg","no-duplicate","no-ignored","obsolete-attr","obsolete-tag","parsing-order","pipe-like","table-layout","tag-like","unbalanced-header","unclosed-comment","unclosed-quote","unclosed-table","unescaped","unknown-page","unmatched-tag","unterminated-url","url-encoding","var-anchor","void-ext"];return Object.freeze(a),a})()});var Ge,hr,xa,Ui,_n=k(()=>{"use strict";Ge=a=>decodeURIComponent(a.replace(/%(?![\da-f]{2})/giu,"%25")),hr=a=>Math.round(a*255).toString(16).padStart(2,"0"),xa=(()=>{let a=String.raw`#(?:[\da-f]{3,4}|(?:[\da-f]{2}){3,4})(?![\p{L}\d_])`,n=String.raw`(?:\d*\.)?\d+%?`,e=String.raw`(?:\d*\.)?\d+(?:deg|grad|rad|turn)?`,t=String.raw`rgba?\(\s*(?:${String.raw`${new Array(3).fill(n).join(String.raw`\s+`)}(?:\s*\/\s*${n})?`}|${String.raw`${new Array(3).fill(n).join(String.raw`\s*,\s*`)}(?:\s*,\s*${n})?`})\s*\)`,r=String.raw`hsla?\(\s*(?:${String.raw`${e}\s+${n}\s+${n}(?:\s*\/\s*${n})?`}|${String.raw`${e}${String.raw`\s*,\s*(?:\d*\.)?\d+%`.repeat(2)}(?:\s*,\s*${n})?`})\s*\)`;return{full:new RegExp(String.raw`(^|[^\p{L}\d_])(${a}|${t}|${r})`,"giu"),rgb:new RegExp(String.raw`(^|[^\p{L}\d_])(${a}|${t})`,"giu")}})(),Ui=(a,n=!0)=>{let e=[],t=xa[n?"full":"rgb"];t.lastIndex=0;let r=t.exec(a),i=0;for(;r;){let s=r.index+r[1].length;s>i&&e.push([a.slice(i,s),i,s,!1]),{lastIndex:i}=t,e.push([r[2],s,i,a.charAt(s-1)!=="&"||!/^#\d+$/u.test(r[2])]),r=t.exec(a)}return a.length>i&&e.push([a.slice(i),i,a.length,!1]),e}});var Ie,zi,je,Be,nt,St,de,Gi,ye,ba,Ta,it,Vi,Cl,ya,ka,wt,qe,Y=k(()=>{"use strict";_n();Ie=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,zi=String.raw`[^[\]<>"\0-\x1F\x7F${Ie}\uFFFD]`,je=String.raw`(?:\[[\da-f:.]+\]|${zi})`,Be=String.raw`(?:${zi}|\0\d+[cn!~]\x7F)*`,nt=(a,n)=>e=>e.replace(a,n),St=nt(/[\0\x7F]|\r$/gmu,""),de=nt(/\0\d+[cn]\x7F/gu,""),Gi=nt(/[\\{}()|.?*+^$[\]]/gu,String.raw`\$&`),ye=(a,n="")=>a.map(e=>typeof e=="string"?e:e.text()).join(n),ba={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},Ta=nt(/&(?:#(\d+|[Xx][\da-fA-F]+)|([lg]t|[LG]T|[lr]brac[ke]|nbsp|amp|AMP|quot|QUOT));/gu,(a,n,e)=>n?String.fromCodePoint(+((/^x/iu.test(n)?"0":"")+n)):ba[e.toLowerCase()]),it=a=>Ta(a),Vi=nt(/&#(\d+|x[\da-f]+);/giu,(a,n)=>String.fromCodePoint(+((/^x/iu.test(n)?"0":"")+n))),Cl=nt(/\n/gu,String.raw`\n`),ya={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},ka=a=>nt(a,n=>`&${ya[n]};`),wt=ka(/[&<>]/gu),qe=(a,n={})=>{let{pre:e="",post:t="",sep:r=""}=n;return e+a.map(i=>i.print()).join(r)+t}});var Qi=pa((Nl,va)=>{va.exports={ext:[],html:[["b","bdi","del","i","ins","u","font","big","small","sub","sup","h1","h2","h3","h4","h5","h6","cite","code","em","s","strike","strong","tt","var","div","center","blockquote","ol","ul","dl","table","caption","pre","ruby","rb","rp","rt","rtc","p","span","abbr","dfn","kbd","samp","data","time","mark","tr","td","th","q","bdo"],["li","dt","dd"],["br","wbr","hr","meta","link"]],namespaces:{"0":"","6":"File","10":"Template","14":"Category","828":"Module"},nsid:{"":0,file:6,template:10,category:14,module:828},variable:["!","=","pageid","articlepath","server","servername","scriptpath","stylepath"],parserFunction:[{"#language":"language","#special":"special","#speciale":"speciale","#tag":"tag","#formatdate":"formatdate","#dateformat":"formatdate","#invoke":"invoke","#while":"while","#dowhile":"dowhile","#loop":"loop","#forargs":"forargs","#fornumargs":"fornumargs","#if":"if","#ifeq":"ifeq","#switch":"switch","#ifexist":"ifexist","#ifexpr":"ifexpr","#iferror":"iferror","#time":"time","#timel":"timel","#expr":"expr","#rel2abs":"rel2abs","#titleparts":"titleparts","#categorytree":"categorytree","#urldecode":"urldecode","#choose":"choose","#var":"var","#varexists":"varexists","#var_final":"var_final","#vardefine":"vardefine","#vardefineecho":"vardefineecho","#widget":"widget","#related":"related","#cscore":"cscore","#regex":"regex","#regex_var":"regex_var","#regexquote":"regexquote","#regexall":"regexall","#len":"len","#pos":"pos","#rpos":"rpos","#sub":"sub","#count":"count","#rmatch":"rmatch","#rreplace":"rreplace","#replace":"replace","#rsplit":"rsplit","#explode":"explode","#tab":"tab","#seo":"seo","#babel":"babel","#commaseparatedlist":"commaseparatedlist","#coordinates":"coordinates","#lst":"lst","#lsth":"lsth","#lstx":"lstx","#assessment":"assessment","#mentor":"mentor","#property":"property","#target":"target","#section":"lst","#section-x":"lstx","#section-h":"lsth","#statements":"statements"},{"!":"!","=":"=","#FORMAL":"formal","#bcp47":"bcp47","#dir":"dir","#interwikilink":"interwikilink","#interlanguagelink":"interlanguagelink","#timef":"timef","#timefl":"timefl"},["msg","raw"],["subst","safesubst"]],doubleUnderscore:[[],[]],protocol:"bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|matrix:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|worldwind://|xmpp:",interwiki:[],img:{},redirection:["#redirect"],variants:[]}});var On,Xi=k(()=>{"use strict";On=Qi()});var fr,Ct,xr,br,Mn,j,ee=k(()=>{"use strict";j=class{constructor(n,e){T(this,br);T(this,fr);T(this,Ct);T(this,xr);b(this,fr,n),b(this,Ct,e)}get start(){return c(this,Ct)}get top(){return A(this,br,Mn).call(this).top}get left(){return A(this,br,Mn).call(this).left}};fr=new WeakMap,Ct=new WeakMap,xr=new WeakMap,br=new WeakSet,Mn=function(){var n;return(n=c(this,xr))!=null||b(this,xr,c(this,fr).getRootNode().posFromIndex(c(this,Ct))),c(this,xr)}});var $t,Ki,I,P,Ne,D=k(()=>{"use strict";ke();ee();W();$t=(a,n,e,t)=>({line:a+e-1,character:(e===1?n:0)+t}),Ki=a=>(n,e,t,r,i="error")=>{let{start:s}=e,{top:o,left:l}=e instanceof j?e:new j(n,s),{offsetHeight:u,offsetWidth:p}=n,{startIndex:d,startLine:g,startCol:f}=a(n,s,o,l),{line:h,character:m}=$t(g,f,u,p);return{rule:t,message:v.msg(r),severity:i,startIndex:d,endIndex:d+n.toString().length,startLine:g,endLine:h,startCol:f,endCol:m}},I=Ki((a,n,e,t)=>{let r=a.getRelativeIndex(),{top:i,left:s}=a.parentNode.posFromIndex(r);return{startIndex:n+r,startLine:e+i,startCol:i?s:t+s}}),P=Ki((a,n,e,t)=>({startIndex:n,startLine:e,startCol:t})),Ne=(a,n,e)=>{if(a)return a[1];let t=n();return e([re.rev,t]),t}});var Aa,Qr,Ji=k(()=>{"use strict";Aa=(a,n,e)=>{let[t,...r]=a.split("#");return(!t||t===n)&&r.every(i=>i===e)},Qr=(a,n,e)=>({type:t,name:r})=>a.split(",").some(i=>Aa(i.trim(),t,r))});var Tr,It,Nt,yr,kr,Et,Lt,Ft,Xr,Pt,Dn=k(()=>{"use strict";D();ke();Pt=class{constructor(){T(this,Ft);te(this,"childNodes",[]);T(this,Tr);T(this,It);T(this,Nt);T(this,yr);T(this,kr);T(this,Et);T(this,Lt,{})}get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get parentNode(){return c(this,Tr)}get nextSibling(){return c(this,It)}get previousSibling(){return c(this,Nt)}get offsetHeight(){return A(this,Ft,Xr).call(this).height}get offsetWidth(){return A(this,Ft,Xr).call(this).width}getChildNodes(){let{childNodes:n}=this;return Object.isFrozen(n)?[...n]:n}getAttribute(n){return n==="padding"?0:this[n]}setAttribute(n,e){switch(n){case"parentNode":b(this,Tr,e),e||(b(this,It,void 0),b(this,Nt,void 0));break;case"nextSibling":b(this,It,e);break;case"previousSibling":b(this,Nt,e);break;case"aIndex":b(this,Et,[re.rev,e]);break;default:this[n]=e}}getRootNode(){return Ne(c(this,kr),()=>{var n,e;return(e=(n=this.parentNode)==null?void 0:n.getRootNode())!=null?e:this},n=>{let[,e]=n;e.type==="root"&&b(this,kr,n)})}indexFromPos(n,e){{if(n<0||e<0)return;let t=this.getLines();if(n>=t.length)return;let[,r,i]=t[n],s=r+e;return s>i?void 0:s}}posFromIndex(n){let{length:e}=String(this);if(n+=n<0?e:0,n>=0&&n<=e){let t=this.getLines(),r=t.findIndex(([,,i])=>n<=i);return{top:r,left:n-t[r][1]}}}getGaps(n){return 0}getRelativeIndex(n){if(n===void 0){let{parentNode:e}=this;return e?e.getRelativeIndex(e.childNodes.indexOf(this)):0}return Ne(c(this,Lt)[n],()=>{let{childNodes:e}=this,t=n+(n<0?e.length:0),r=this.getAttribute("padding");for(let i=0;i<t;i++)c(this,Lt)[i]=[re.rev,r],r+=e[i].toString().length+this.getGaps(i);return r},e=>{c(this,Lt)[n]=e})}getAbsoluteIndex(){return Ne(c(this,Et),()=>{let{parentNode:n}=this;return n?n.getAbsoluteIndex()+this.getRelativeIndex():0},n=>{b(this,Et,n)})}getBoundingClientRect(){return{...A(this,Ft,Xr).call(this),...this.getRootNode().posFromIndex(this.getAbsoluteIndex())}}seal(n,e){Object.defineProperty(this,n,{enumerable:!e&&!!this[n],configurable:!0})}is(n){return this.type===n}getLines(){return Ne(c(this,yr),()=>{let n=[],e=0;for(let t of String(this).split(`
|
|
2
|
-
`)){let r=e+t.length;n.push([t,e,r]),e=r+1}return n},n=>{b(this,yr,n)})}};Tr=new WeakMap,It=new WeakMap,Nt=new WeakMap,yr=new WeakMap,kr=new WeakMap,Et=new WeakMap,Lt=new WeakMap,Ft=new WeakSet,Xr=function(){let n=this.getLines(),e=n[n.length-1];return{height:n.length,width:e[2]-e[1]}}});var Ve,Wn,Hn,Kr,Yi=k(()=>{"use strict";Y();ke();Ji();Dn();Kr=class extends Pt{constructor(){super(...arguments);T(this,Ve)}get length(){return this.childNodes.length}text(e){return ye(this.childNodes,e)}normalize(){let e=this.getChildNodes(),t=r=>{var i,s;e.splice(r,1),(i=e[r-1])==null||i.setAttribute("nextSibling",e[r]),(s=e[r])==null||s.setAttribute("previousSibling",e[r-1])};for(let r=e.length-1;r>=0;r--){let{type:i,data:s}=e[r];i!=="text"||e.length===1||this.getGaps(r-(r&&1))||s===""&&t(r)}this.setAttribute("childNodes",e)}removeAt(e){return Un(this,e,1)[0]}insertAt(e,t=this.length){return Un(this,t,0,[e]),e}closest(e){let t=Qr(e,this),{parentNode:r}=this;for(;r;){if(t(r))return r;({parentNode:r}=r)}}querySelector(e){let t=Qr(e,this);return A(this,Ve,Wn).call(this,t)}querySelectorAll(e){let t=Qr(e,this);return A(this,Ve,Hn).call(this,t)}append(...e){for(let t of e)this.insertAt(t)}replaceChildren(...e){for(let t=this.length-1;t>=0;t--)this.removeAt(t);this.append(...e)}setText(e,t=0){t+=t<0?this.length:0;let r=this.childNodes[t],{data:i}=r;return r.replaceData(e),i}toString(e,t=""){return this.childNodes.map(r=>r.toString(e)).join(t)}caretPositionFromIndex(e){{if(e===void 0)return;let{length:t}=this.toString();if(e>t||e<-t)return;e+=e<0?t:0;let r=this,i=0,s=0;for(;r.type!=="text";){let{childNodes:o}=r;i+=r.getAttribute("padding");for(let l=0;i<=e&&l<o.length;l++){let u=o[l],{nextSibling:p}=u,d=u.toString(),g=d.length;if(u.setAttribute("aIndex",i),i+=g,i>e||i===e&&g>0&&(!p||p.type==="text"||u.type!=="text"&&(d.trim()||!p.toString().trim()))){r=u,i-=g,s=i;break}i+=r.getGaps(l)}if(r.childNodes===o)return{offsetNode:r,offset:e-s}}return{offsetNode:r,offset:e-s}}}elementFromIndex(e){var t;{let r=(t=this.caretPositionFromIndex(e))==null?void 0:t.offsetNode;return(r==null?void 0:r.type)==="text"?r.parentNode:r}}elementFromPoint(e,t){return this.elementFromIndex(this.indexFromPos(t,e))}lint(e=this.getAbsoluteIndex(),t){let r=[];for(let i=0,s=e+this.getAttribute("padding");i<this.length;i++){let o=this.childNodes[i];o.setAttribute("aIndex",s),r.push(...o.lint(s,t)),s+=o.toString().length+this.getGaps(i)}return r}print(e={}){let t=e.class;return this.toString()?(t===""?"":`<span class="wpb-${t!=null?t:this.type}">`)+qe(this.childNodes,e)+(t===""?"":"</span>"):""}json(e,t=this.getAbsoluteIndex()){let r={...this,type:this.type,range:[t,t+this.toString().length],childNodes:[]};for(let i=0,s=t+this.getAttribute("padding");i<this.length;i++){let o=this.childNodes[i],{length:l}=o.toString();o.setAttribute("aIndex",s),r.childNodes.push(o.type==="text"?{data:o.data,range:[s,s+l]}:o.json(void 0,s)),s+=l+this.getGaps(i)}return r}};Ve=new WeakSet,Wn=function(e){var t;for(let r of this.childNodes){if(r.type==="text")continue;if(e(r))return r;let i=A(t=r,Ve,Wn).call(t,e);if(i)return i}},Hn=function(e){var r;let t=[];for(let i of this.childNodes)i.type!=="text"&&(e(i)&&t.push(i),t.push(...A(r=i,Ve,Hn).call(r,e)));return t}});var zn,Zi,Sa,wa,Ca,$a,Ia,Na,Gn,Jr,es,vr,ts=k(()=>{"use strict";Y();D();W();Dn();zn=String.raw`[${Ie}\t]*`,Zi=String.raw`<\s*(?:/\s*)?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|(?:rfc|pmid)(?=[-::]?${zn}\d)|isbn(?=[-::]?${zn}(?:\d(?:${zn}|-)){6})`,Sa=new RegExp(String.raw`${Zi}|https?[:/]/+`,"giu"),wa=new RegExp(Zi,"giu"),Ca=new Set(["attr-value","ext-link-text","link-text"]),$a={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},Ia={"<":"tag-like","[":"lonely-bracket","{":"lonely-bracket","]":"lonely-bracket","}":"lonely-bracket",h:"lonely-http",r:"lonely-http",p:"lonely-http",i:"lonely-http"},Na=["html","head","style","title","body","a","audio","img","video","embed","iframe","object","canvas","script","col","colgroup","tbody","tfoot","thead","button","input","label","option","select","textarea"];try{Gn=new RegExp(String.raw`[\p{L}\d_]`,"u")}catch(a){Gn=/\w/u}vr=class extends Pt{constructor(e){super();T(this,Jr);te(this,"data","");Object.defineProperties(this,{childNodes:{enumerable:!1,configurable:!1},data:{value:e}})}get type(){return"text"}toString(e){var t;return e&&!((t=this.parentNode)!=null&&t.getAttribute("built"))?de(this.data):this.data}text(){return this.data}lint(e=this.getAbsoluteIndex(),t){var M,F,Q;if(t===!1)return[];let{data:r,parentNode:i,nextSibling:s,previousSibling:o}=this;if(!i)throw new Error("An isolated text node cannot be linted!");let{type:l,name:u,parentNode:p}=i,d=!1;if(l==="attr-value"){let{type:R,name:H,tag:G}=p;if(R!=="ext-attr")d=!0;else if(G==="choose"&&(H==="before"||H==="after"))return[]}if(t!=null||(t=l==="free-ext-link"||l==="ext-link-url"||l==="ext-link-text"||l==="image-parameter"&&u==="link"||d?wa:Sa),r.search(t)===-1)return[];t.lastIndex=0;let g=[],f=s==null?void 0:s.type,h=s==null?void 0:s.name,m=o==null?void 0:o.type,x=this.getRootNode(),y=x.toString(),{ext:w,html:C}=x.getAttribute("config"),{top:$,left:L}=x.posFromIndex(e),O=new Set(["onlyinclude","noinclude","includeonly",...w,...C[0],...C[1],...C[2],...Na]);for(let R=t.exec(r);R;R=t.exec(r)){let[,H,G]=R,{index:E}=R,_=R[0].toLowerCase();if(G&&G!=="]"){let{length:fe}=G;E+=fe,_=_.slice(fe)}let{0:N,length:ue}=_,ie=N==="r"||N==="p"||N==="i";if(N==="<"&&!O.has(H.toLowerCase())||N==="["&&l==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(r.slice(E+1))||s!=null&&s.is("ext")&&h==="nowiki"&&((M=s.innerText)!=null&&M.includes("]")))||ie&&(!i.getAttribute("plain")||Ca.has(l)))continue;N==="]"&&(E||ue>1)&&t.lastIndex--;let me=e+E,pe=me+ue,Te=y[pe],yt=y[me-1],Rn=ue>1&&!(N==="<"&&!/[\s/>]/u.test(Te!=null?Te:"")||d&&(N==="["||N==="]")||ie&&l==="parameter-value")||N==="{"&&(Te===N||yt==="-")||N==="}"&&(yt===N||Te==="-")||N==="["&&(Te===N||l==="ext-link-text"||f==="free-ext-link"&&!r.slice(E+1).trim())||N==="]"&&(yt===N||m==="free-ext-link"&&!r.slice(0,E).includes("]"))?"error":"warning",jn=N==="{"||N==="[";if(Rn==="warning"&&(jn||(N==="]"||N==="}"))){let fe=$a[N],Bn=jn?r.slice(E+1):r.slice(0,E);if(N==="{"&&((F=fe.exec(Bn))==null?void 0:F[0])==="}"||N==="}"&&((Q=fe.exec(Bn))==null?void 0:Q[0])==="{")continue;if(!Bn.includes(N)){let ji=jn?"nextSibling":"previousSibling",rt=this[ji];for(;rt&&(rt.type!=="text"||!fe.test(rt.data));)rt=rt[ji];if(rt&&fe.exec(rt.data)[0]!==N)continue}}ie&&(_=_.toUpperCase());let Fi=this.posFromIndex(E),{line:Pi,character:Ri}=$t($,L,Fi.top+1,Fi.left),kt={rule:Ia[N],message:v.msg('lonely "$1"',ie||N==="h"?_:N),severity:Rn,startIndex:me,endIndex:pe,startLine:Pi,endLine:Pi,startCol:Ri,endCol:Ri+ue};if(N==="<")kt.suggestions=[{desc:"escape",range:[me,me+1],text:"<"}];else if(N==="h"&&l!=="link-text"&&Gn.test(yt||""))kt.suggestions=[{desc:"whitespace",range:[me,me],text:" "}];else if(N==="["&&l==="ext-link-text"){let fe=i.getAbsoluteIndex()+i.toString().length;kt.suggestions=[{desc:"escape",range:[fe,fe+1],text:"]"}]}else if(N==="]"&&m==="free-ext-link"&&Rn==="error"){let fe=e-o.toString().length;kt.fix={range:[fe,fe],text:"[",desc:"left bracket"}}else ie&&(kt.suggestions=[...R[0]===_?[]:[{desc:"uppercase",range:[me,pe],text:_}],...Te===":"||Te==="\uFF1A"?[{desc:"whitespace",range:[pe,pe+1],text:" "}]:[]]);g.push(kt)}return g}replaceData(e){A(this,Jr,es).call(this,e)}print(){return wt(this.data)}};Jr=new WeakSet,es=function(e){this.setAttribute("data",e)}});var ve,st=k(()=>{"use strict";ke();ve=(a=!0,n=!0)=>(e,t)=>{class r extends e{text(){return""}lint(s){return a?[]:super.lint(s)}}return Yr(r,e),r}});var Ar,Ae,Rt=k(()=>{"use strict";q();Ae=class extends S{constructor(e,t,r,i,s,o){super(e,i,s,o);T(this,Ar);b(this,Ar,r)}get type(){return c(this,Ar)}lint(e=this.getAbsoluteIndex()){return super.lint(e,!1)}};Ar=new WeakMap});var jt,V,_e=k(()=>{"use strict";q();V=class extends S{constructor(e,t,r,i,s){super(e,r,i,s);T(this,jt);b(this,jt,t)}get type(){return c(this,jt)}set type(e){b(this,jt,e)}};jt=new WeakMap});var Ea,ot,Ee,Le,Fe,Sr=k(()=>{"use strict";D();Y();ee();W();q();_e();Ea=a=>a==="redirect-target"||a==="link",Fe=class extends S{constructor(e,t,r=v.getConfig(),i=[],s="|"){super(void 0,r,i,{});T(this,ot,!0);T(this,Ee);T(this,Le);if(this.insertAt(new V(e,"link-target",r,i,{})),t!==void 0){let o=new S(t,r,i,{});o.type="link-text",o.setAttribute("stage",10),this.insertAt(o)}b(this,Ee,s)}get link(){return c(this,Le)}get fragment(){return c(this,Le).fragment}afterBuild(){b(this,Le,this.getTitle()),c(this,Ee).includes("\0")&&b(this,Ee,this.buildFromStr(c(this,Ee),0)),this.setAttribute("name",c(this,Le).title),super.afterBuild()}setAttribute(e,t){e==="bracket"?b(this,ot,t):e==="title"?b(this,Le,t):super.setAttribute(e,t)}toString(e){let t=super.toString(e,c(this,Ee));return c(this,ot)?`[[${t}]]`:t}text(){let e=super.text("|");return c(this,ot)?`[[${e}]]`:e}getAttribute(e){return e==="title"?c(this,Le):e==="padding"?2:super.getAttribute(e)}getGaps(e){return e===0?c(this,Ee).length:1}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{childNodes:[i,s],type:o}=this,{encoded:l,fragment:u}=c(this,Le),p=new j(this,e);if(i.childNodes.some(({type:d})=>d==="template")&&r.push(I(i,p,"unknown-page","template in an internal link target","warning")),l){let d=I(i,p,"url-encoding","unnecessary URL encoding in an internal link");d.suggestions=[{desc:"decode",range:[d.startIndex,d.endIndex],text:Ge(i.text())}],r.push(d)}if(o==="link"||o==="category"){let d=s==null?void 0:s.childNodes.findIndex(f=>f.type==="text"&&f.data.includes("|")),g=s==null?void 0:s.childNodes[d];if(g){let f=I(s,p,"pipe-like",'additional "|" in the link text',"warning"),h=f.startIndex+s.getRelativeIndex(d);f.suggestions=[{desc:"escape",range:[h,h+g.data.length],text:g.data.replace(/\|/gu,"|")}],r.push(f)}}if(u!==void 0&&!Ea(o)){let d=I(i,p,"no-ignored","useless fragment"),g=i.childNodes.findIndex(h=>h.type==="text"&&h.data.includes("#")),f=i.childNodes[g];f&&(d.fix={range:[d.startIndex+i.getRelativeIndex(g)+f.data.indexOf("#"),d.endIndex],text:"",desc:"remove"}),r.push(d)}return r}getTitle(e,t){return this.normalizeTitle(this.firstChild.toString(!0),0,e,t,!0,!0)}print(){return super.print(c(this,ot)?{pre:"[[",post:"]]",sep:c(this,Ee)}:{sep:c(this,Ee)})}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t),{type:i,fragment:s}=this;return s!==void 0&&(i==="link"||i==="redirect-target")&&(r.fragment=s),r}};ot=new WeakMap,Ee=new WeakMap,Le=new WeakMap});var ge,Qe=k(()=>{"use strict";q();ge=class extends S{get innerText(){return this.firstChild.data}constructor(n="",e,t){super(n,e,t)}}});var rs,Vn,La,K,Xe=k(()=>{"use strict";st();Qe();rs=[ve()];K=class extends(La=ge){get type(){return"noinclude"}toString(n){return n?"":super.toString()}};Vn=oe(La),K=le(Vn,0,"NoincludeToken",rs,K),ae(Vn,1,K)});var Zr,ns=k(()=>{"use strict";D();Sr();Xe();Zr=class extends Fe{get type(){return"redirect-target"}constructor(n,e,t,r){super(n,void 0,t,r),e!==void 0&&this.insertAt(new K(e,t,r))}getTitle(){return this.normalizeTitle(this.firstChild.toString(),0,!1,!0,!0)}lint(n=this.getAbsoluteIndex()){let e=super.lint(n,!1);if(this.length===2){let t=I(this.lastChild,{start:n},"no-ignored","useless link text");t.startIndex--,t.startCol--,t.fix={range:[t.startIndex,t.endIndex],text:"",desc:"remove"},e.push(t)}return e}}});var is,Ke,Bt,Qn,Fa,at,ss=k(()=>{"use strict";st();q();Rt();ns();is=[ve(!1,!1)];at=class extends(Fa=S){constructor(e,t,r,i,s,o,l=[]){super(void 0,o,l);T(this,Ke);T(this,Bt);b(this,Ke,e),b(this,Bt,s);let u=new RegExp(String.raw`^(?:${o.redirection.join("|")})\s*(?::\s*)?$`,"iu");this.append(new Ae(t,u,"redirect-syntax",o,l,{}),new Zr(r,i==null?void 0:i.slice(1),o,l))}get type(){return"redirect"}getAttribute(e){return e==="padding"?c(this,Ke).length:super.getAttribute(e)}toString(e){return c(this,Ke)+super.toString(e)+c(this,Bt)}lint(e=this.getAbsoluteIndex()){let t=e+c(this,Ke).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",t),this.lastChild.lint(t)}print(){return super.print({pre:c(this,Ke),post:c(this,Bt)})}};Qn=oe(Fa),Ke=new WeakMap,Bt=new WeakMap,at=le(Qn,0,"RedirectToken",is,at),ae(Qn,1,at)});var os={};se(os,{parseRedirect:()=>Pa});var Pa,as=k(()=>{"use strict";W();ss();Pa=(a,n,e)=>{var r;(r=n.regexRedirect)!=null||(n.regexRedirect=new RegExp(String.raw`^(\s*)((?:${n.redirection.join("|")})\s*(?::\s*)?)\[\[([^\n|\]]+)(\|.*?)?\]\](\s*)`,"iu"));let t=n.regexRedirect.exec(a);return t&&v.normalizeTitle(t[3],0,!1,n,!0,!0,!0).valid?(a=`\0${e.length}o\x7F${a.slice(t[0].length)}`,new at(...t.slice(1),n,e),a):!1}});var en,ls=k(()=>{"use strict";q();en=class extends S{get type(){return"onlyinclude"}toString(n){return`<onlyinclude>${super.toString(n)}</onlyinclude>`}getAttribute(n){return n==="padding"?13:n==="plain"||super.getAttribute(n)}print(){return super.print({pre:'<span class="wpb-ext"><onlyinclude></span>',post:'<span class="wpb-ext"></onlyinclude></span>'})}}});var Je,qt,Xn=k(()=>{"use strict";q();qt=class extends S{constructor(e,t,r,i,s,o=[]){super(void 0,s);T(this,Je);te(this,"closed");te(this,"selfClosing");this.setAttribute("name",e.toLowerCase()),b(this,Je,[e,i||e]),this.closed=i!=="",this.selfClosing=i===void 0,this.append(t,r);let l=typeof t=="string"?-1:o.indexOf(t);o.splice(l===-1?1/0:l,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(e){let{selfClosing:t,firstChild:r,lastChild:i}=this,[s,o]=c(this,Je);return t?`<${s}${r.toString(e)}/>`:`<${s}${r.toString(e)}>${i.toString(e)}${this.closed?`</${o}>`:""}`}text(){let[e,t]=c(this,Je);return this.selfClosing?`<${e}${this.firstChild.text()}/>`:`<${e}${super.text(">")}${this.closed?`</${t}>`:""}`}getAttribute(e){return e==="padding"?c(this,Je)[0].length+1:super.getAttribute(e)}getGaps(){return 1}print(){let[e,t]=c(this,Je);return super.print(this.selfClosing?{pre:`<${e}`,post:"/>"}:{pre:`<${e}`,sep:">",post:this.closed?`</${t}>`:""})}};Je=new WeakMap});var ds,Kn,Ra,lt,gs=k(()=>{"use strict";D();ee();st();W();Xn();ds=[ve(!1)];lt=class extends(Ra=qt){get type(){return"include"}constructor(n,e="",t,r,i,s){super(n,e,t!=null?t:"",t===void 0||r!=null?r:"",i,s)}toString(n){return n?"":super.toString()}lint(n=this.getAbsoluteIndex()){let e=[],{firstChild:t,closed:r,name:i}=this,s=new j(this,n);if(t.data.trim()){let o=I(t,s,"no-ignored","useless attribute","warning");o.suggestions=[{desc:"remove",range:[o.startIndex,o.endIndex],text:""}],e.push(o)}if(!r){let o=P(this,s,"unclosed-comment",v.msg("unclosed $1",`<${i}>`));o.suggestions=[{desc:"close",range:[o.endIndex,o.endIndex],text:`</${i}>`}],e.push(o)}return e}};Kn=oe(Ra),lt=le(Kn,0,"IncludeToken",ds,lt),ae(Kn,1,lt)});var _t,tn=k(()=>{"use strict";ke();_t=(a=0)=>(n,e)=>{var r,us;class t extends n{constructor(){super(...arguments);T(this,r)}getAttr(l){return A(this,r,us).call(this).getAttr(l)}}return r=new WeakSet,us=function(){return this.childNodes[a]},Yr(t,n),t}});var Z,ps,cs,nn,Jn,ms,Ot,hs,fs,xs,rn,sn,on,an,bs,Yn=k(()=>{"use strict";Z=new Set(["align"]),ps=new Set(["cite"]),cs=new Set(["cite","datetime"]),nn=new Set(["width"]),Jn=new Set(["axis","align","bgcolor","height","width","valign"]),ms=new Set([...Jn,"abbr","headers","scope","rowspan","colspan"]),Ot=new Set(["type"]),hs=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),fs=new Set(["clear"]),xs=new Set(["bgcolor","align","valign"]),rn=new Set,sn=new Set(["id","class","style","lang","dir","title","tabindex","aria-describedby","aria-flowto","aria-hidden","aria-label","aria-labelledby","aria-level","aria-owns","role","about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),on={div:Z,h1:Z,h2:Z,h3:Z,h4:Z,h5:Z,h6:Z,blockquote:ps,q:ps,p:Z,br:fs,pre:nn,ins:cs,del:cs,ul:Ot,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...hs,"border"]),caption:Z,tr:xs,td:ms,th:ms,img:new Set(["alt","src","width","height","srcset"]),font:new Set(["size","color","face"]),hr:nn,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:Ot,poem:Z,categorytree:Z,combooption:Z},an={gallery:new Set(["mode","showfilename","caption","perrow","widths","heights","showthumbnails"]),poem:new Set(["compact"]),categorytree:new Set(["hideroot","onlyroot","depth","mode","hideprefix","namespaces","showcount","notranslations"]),combooption:new Set(["name","for","inline"]),nowiki:rn,indicator:new Set(["name"]),langconvert:new Set(["from","to"]),ref:new Set(["group","name","extends","follow","dir"]),references:new Set(["group","responsive"]),charinsert:new Set(["label"]),choose:new Set(["uncached","before","after"]),option:new Set(["weight"]),imagemap:rn,inputbox:rn,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:rn,poll:new Set(["id","show-results-before-voting"]),sm2:Ot,flashmp3:Ot,score:new Set(["line_width_inches","lang","override_midi","raw","note-language","override_audio","override_ogg","sound","vorbis"]),seo:new Set(["title","title_mode","title_separator","keywords","description","robots","google_bot","image","image_width","image_height","image_alt","type","site_name","locale","section","author","published_time","twitter_site"]),tab:new Set(["nested","name","index","class","block","inline","openname","closename","collapsed","dropdown","style","bgcolor","container","id","title"]),tabs:new Set(["plain","class","container","id","title","style"]),combobox:new Set(["placeholder","value","id","class","text","dropdown","style"])},bs={table:hs,td:new Set([...Jn,"scope"]),th:Jn,br:fs,caption:Z,div:Z,hr:nn,h1:Z,h2:Z,h3:Z,h4:Z,h5:Z,h6:Z,li:Ot,p:Z,pre:nn,tr:xs,ul:Ot}});var ja,wr,Mt,ne,Pe,Dt,Ts=k(()=>{"use strict";D();Y();Yn();ee();W();q();_e();ja=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,Dt=class extends S{constructor(e,t,r,i="",s,o=[],l=v.getConfig(),u=[]){let p=new V(r,"attr-key",l,u),d;if(r==="title"||t==="img"&&r==="alt")d=new S(s,l,u,{}),d.type="attr-value",d.setAttribute("stage",10);else if(t==="gallery"&&r==="caption"||t==="choose"&&(r==="before"||r==="after")){let g={...l,excludes:[...l.excludes,"heading","html","table","hr","list"]};d=new S(s,g,u,{}),d.type="attr-value",d.setAttribute("stage",1)}else d=new V(s,"attr-value",l,u,{});super(void 0,l,u);T(this,wr);T(this,Mt);T(this,ne);T(this,Pe);b(this,wr,e),this.append(p,d),b(this,ne,i),b(this,Pe,[...o]),b(this,Mt,t),this.setAttribute("name",de(r).trim().toLowerCase())}get type(){return c(this,wr)}get tag(){return c(this,Mt)}get balanced(){return!c(this,ne)||c(this,Pe)[0]===c(this,Pe)[1]}afterBuild(){c(this,ne).includes("\0")&&b(this,ne,this.buildFromStr(c(this,ne),0)),this.parentNode&&b(this,Mt,this.parentNode.name),this.setAttribute("name",this.firstChild.toString(!0).trim().toLowerCase()),super.afterBuild()}toString(e){let[t="",r=""]=c(this,Pe);return c(this,ne)?super.toString(e,c(this,ne)+t)+r:this.firstChild.toString(e)}text(){return c(this,ne)?`${super.text(`${c(this,ne).trim()}"`)}"`:this.firstChild.text()}getGaps(){var e,t;return c(this,ne)?c(this,ne).length+((t=(e=c(this,Pe)[0])==null?void 0:e.length)!=null?t:0):0}lint(e=this.getAbsoluteIndex(),t){var x;let r=super.lint(e,t),{balanced:i,firstChild:s,lastChild:o,type:l,name:u,tag:p}=this,d=this.getValue(),g=new j(this,e);if(!i){let y=I(o,g,"unclosed-quote",v.msg("unclosed $1","quotes"),"warning");y.startIndex--,y.startCol--,y.suggestions=[{range:[y.endIndex,y.endIndex],text:c(this,Pe)[0],desc:"close"}],r.push(y)}let f=an[p],h=on[p],{length:m}=this.toString();if(!(f!=null&&f.has(u))&&!(h!=null&&h.has(u))&&(l==="ext-attr"?f||h:!/\{\{[^{]+\}\}/u.test(u))&&(l==="ext-attr"&&!h||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(u)&&(p==="meta"||p==="link"||!sn.has(u)))){let y=I(s,g,"illegal-attr","illegal attribute name");y.suggestions=[{desc:"remove",range:[e,e+m],text:""}],r.push(y)}else if((x=bs[p])!=null&&x.has(u))r.push(I(s,g,"obsolete-attr","obsolete attribute","warning"));else if(u==="style"&&typeof d=="string"&&ja.test(d))r.push(I(o,g,"insecure-style","insecure style"));else if(u==="tabindex"&&typeof d=="string"&&d!=="0"){let y=I(o,g,"illegal-attr","nonzero tabindex");y.suggestions=[{desc:"remove",range:[e,e+m],text:""},{desc:"0 tabindex",range:[y.startIndex,y.endIndex],text:"0"}],r.push(y)}return r}getValue(){return c(this,ne)?this.lastChild.text().trim():this.type==="ext-attr"||""}print(){let[e="",t=""]=c(this,Pe);return c(this,ne)?super.print({sep:wt(c(this,ne))+e,post:t}):super.print()}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return r.tag=this.tag,r}};wr=new WeakMap,Mt=new WeakMap,ne=new WeakMap,Pe=new WeakMap});var ys,Ba,Zn,Cr,Ye,ln=k(()=>{"use strict";D();Y();ee();W();q();_e();Ts();ys=a=>a.slice(0,-1),Ba=a=>`${ys(a)}-dirty`;try{Zn=new RegExp(String.raw`[\p{L}\d]`,"u")}catch(a){Zn=/[^\W_]/u}Ye=class extends S{constructor(e,t,r,i,s=[]){super(void 0,i,s,{});T(this,Cr);if(b(this,Cr,t),this.setAttribute("name",r),e){let o=/([^\s/](?:(?!\0\d+~\x7F)[^\s/=])*)(?:((?:\s(?:\s|\0\d+[cn]\x7F)*)?(?:=|\0\d+~\x7F)(?:\s|\0\d+[cn]\x7F)*)(?:(["'])([\s\S]*?)(\3|$)|(\S*)))?/gu,l="",u=o.exec(e),p=0,d=()=>{l&&(super.insertAt(new V(l,Ba(t),i,s,{})),l="")};for(;u;){let{index:g,0:f,1:h,2:m,3:x,4:y,5:w,6:C}=u;if(l+=e.slice(p,g),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(de(h).trim())){let $=y!=null?y:C,L=[x,w],O=new Dt(ys(t),r,h,m,$,L,i,s);d(),super.insertAt(O)}else l+=f;({lastIndex:p}=o),u=o.exec(e)}l+=e.slice(p),d()}}get type(){return c(this,Cr)}afterBuild(){let{parentNode:e}=this;(e==null?void 0:e.type)==="td"&&e.subtype==="caption"&&this.setAttribute("name","caption"),super.afterBuild()}getAttrTokens(e){return this.childNodes.filter(t=>t instanceof Dt&&(!e||t.name===e.toLowerCase().trim()))}getAttrToken(e){let t=this.getAttrTokens(e);return t[t.length-1]}getAttr(e){var t;return(t=this.getAttrToken(e))==null?void 0:t.getValue()}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{parentNode:i,childNodes:s}=this,o=new Map,l=new Set,u=new j(this,e);if((i==null?void 0:i.type)==="html"&&i.closing&&this.text().trim()){let p=P(this,u,"no-ignored","attributes of a closing tag"),d=i.getAbsoluteIndex();p.suggestions=[{desc:"remove",range:[e,p.endIndex],text:""},{desc:"open",range:[d+1,d+2],text:""}],r.push(p)}for(let p of s)if(p instanceof Dt){let{name:d}=p;o.has(d)?(l.add(d),o.get(d).push(p)):o.set(d,[p])}else{let d=p.text().trim();if(d){let g=I(p,u,"no-ignored","containing invalid attribute",Zn.test(d)?"error":"warning");g.suggestions=[{desc:"remove",range:[g.startIndex,g.endIndex],text:" "}],r.push(g)}}if(l.size>0)for(let p of l){let d=o.get(p).map(g=>{let f=g.getValue();return[g,f===!0?"":f]});r.push(...d.map(([g,f],h)=>{let m=I(g,u,"no-duplicate",v.msg("duplicated $1 attribute",p)),x={desc:"remove",range:[m.startIndex,m.endIndex],text:""};return!f||d.slice(0,h).some(([,y])=>y===f)?m.fix=x:m.suggestions=[x],m}))}return r}print(){return this.toString()?`<span class="wpb-${this.type}">${this.childNodes.map(e=>e.print(e instanceof V?{class:e.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}};Cr=new WeakMap});var dn,ks=k(()=>{"use strict";W();q();Xe();dn=class extends S{get type(){return"ext-inner"}constructor(n,e=v.getConfig(),t=[]){if(n){let r=/<nowiki>/giu,i=/<\/nowiki>/giu,{length:s}=r.source,o=r.exec(n);o&&(i.lastIndex=o.index+s);let l=i.exec(n),u=0,p="";for(;o&&l;)new K(o[0],e,t),new K(l[0],e,t),p+=`${n.slice(u,o.index)}\0${t.length-1}n\x7F${n.slice(o.index+s,l.index)}\0${t.length}n\x7F`,u=l.index+s+1,r.lastIndex=u,o=r.exec(n),o&&(i.lastIndex=o.index+s),l=i.exec(n);n=p+n.slice(u)}super(n,e,t,{}),this.setAttribute("stage",10)}getAttribute(n){return n==="plain"||super.getAttribute(n)}lint(n=this.getAbsoluteIndex()){return super.lint(n,/<\s*\/\s*(pre)\b/giu)}}});var Wt,ei=k(()=>{"use strict";D();ee();$r();W();q();_e();Wt=class extends S{get type(){return"ext-inner"}constructor(n,e,t=v.getConfig(),r=[],i){if(super(void 0,t,r,{}),e){let s=V;this.append(...e.split(`
|
|
3
|
-
`).map(o=>i?o:
|
|
1
|
+
"use strict";(()=>{var ha=Object.create;var St=Object.defineProperty;var Ui=Object.getOwnPropertyDescriptor;var ma=Object.getOwnPropertyNames;var fa=Object.prototype.hasOwnProperty;var Oi=(a,n)=>(n=Symbol[a])?n:Symbol.for("Symbol."+a),Ct=a=>{throw TypeError(a)};var Hi=(a,n,e)=>n in a?St(a,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[n]=e;var Bi=(a,n)=>St(a,"name",{value:n,configurable:!0});var k=(a,n)=>()=>(a&&(n=a(a=0)),n);var Di=(a,n)=>()=>(n||a((n={exports:{}}).exports,n),n.exports),de=(a,n)=>{for(var e in n)St(a,e,{get:n[e],enumerable:!0})},ba=(a,n,e,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of ma(n))!fa.call(a,r)&&r!==e&&St(a,r,{get:()=>n[r],enumerable:!(t=Ui(n,r))||t.enumerable});return a};var Z=a=>ba(St({},"__esModule",{value:!0}),a);var ge=a=>{var n;return[,,,ha((n=a==null?void 0:a[Oi("metadata")])!=null?n:null)]},zi=["class","method","getter","setter","accessor","field","value","get","set"],fr=a=>a!==void 0&&typeof a!="function"?Ct("Function expected"):a,xa=(a,n,e,t,r)=>({kind:zi[a],name:n,metadata:t,addInitializer:i=>e._?Ct("Already initialized"):r.push(fr(i||null))}),Ta=(a,n)=>Hi(n,Oi("metadata"),a[3]),ue=(a,n,e,t)=>{for(var r=0,i=a[n>>1],s=i&&i.length;r<s;r++)n&1?i[r].call(e):t=i[r].call(e,t);return t},pe=(a,n,e,t,r,i)=>{var s,o,l,g,p,d=n&7,u=!!(n&8),h=!!(n&16),m=d>3?a.length+1:d?u?1:2:0,f=zi[d+5],b=d>3&&(a[m-1]=[]),T=a[m]||(a[m]=[]),C=d&&(!h&&!u&&(r=r.prototype),d<5&&(d>3||!h)&&Ui(d<4?r:{get[e](){return c(this,i)},set[e](A){return x(this,i,A)}},e));d?h&&d<4&&Bi(i,(d>2?"set ":d>1?"get ":"")+e):Bi(r,e);for(var I=t.length-1;I>=0;I--)g=xa(d,e,l={},a[3],T),d&&(g.static=u,g.private=h,p=g.access={has:h?A=>ya(r,A):A=>e in A},d^3&&(p.get=h?A=>(d^1?c:v)(A,r,d^4?i:C.get):A=>A[e]),d>2&&(p.set=h?(A,$)=>x(A,r,$,d^4?i:C.set):(A,$)=>A[e]=$)),o=(0,t[I])(d?d<4?h?i:C[f]:d>4?void 0:{get:C.get,set:C.set}:r,g),l._=1,d^4||o===void 0?fr(o)&&(d>4?b.unshift(o):d?h?i=o:C[f]=o:r=o):typeof o!="object"||o===null?Ct("Object expected"):(fr(s=o.get)&&(C.get=s),fr(s=o.set)&&(C.set=s),fr(s=o.init)&&b.unshift(s));return d||Ta(a,r),C&&St(r,e,C),h?d^4?i:C:r},re=(a,n,e)=>Hi(a,typeof n!="symbol"?n+"":n,e),Bn=(a,n,e)=>n.has(a)||Ct("Cannot "+e),ya=(a,n)=>Object(n)!==n?Ct('Cannot use the "in" operator on this value'):a.has(n),c=(a,n,e)=>(Bn(a,n,"read from private field"),e?e.call(a):n.get(a)),y=(a,n,e)=>n.has(a)?Ct("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(a):n.set(a,e),x=(a,n,e,t)=>(Bn(a,n,"write to private field"),t?t.call(a,e):n.set(a,e),e),v=(a,n,e)=>(Bn(a,n,"access private method"),e);var Xr=(a,n,e,t)=>({set _(r){x(a,n,r,e)},get _(){return c(a,n,t)}});var Wi,Gi,Vi=k(()=>{"use strict";Wi=(()=>{let a={redirect:1,onlyinclude:1,noinclude:1,include:1,comment:1,ext:1,arg:2,"magic-word":2,template:2,heading:2,html:3,table:4,hr:5,"double-underscore":5,link:6,category:6,file:6,quote:7,"ext-link":8,"free-ext-link":9,"magic-link":9,list:10,dd:10,converter:11};return Object.setPrototypeOf(a,null),a})(),Gi=(()=>{let a=["bold-header","format-leakage","fostered-content","h1","illegal-attr","insecure-style","invalid-gallery","invalid-imagemap","invalid-invoke","invalid-isbn","lonely-apos","lonely-bracket","lonely-http","nested-link","no-arg","no-duplicate","no-ignored","obsolete-attr","obsolete-tag","parsing-order","pipe-like","table-layout","tag-like","unbalanced-header","unclosed-comment","unclosed-quote","unclosed-table","unescaped","unknown-page","unmatched-tag","unterminated-url","url-encoding","var-anchor","void-ext"];return Object.freeze(a),a})()});var Ve,br,ka,Qi,Un=k(()=>{"use strict";Ve=a=>decodeURIComponent(a.replace(/%(?![\da-f]{2})/giu,"%25")),br=a=>Math.round(a*255).toString(16).padStart(2,"0"),ka=(()=>{let a=String.raw`#(?:[\da-f]{3,4}|(?:[\da-f]{2}){3,4})(?![\p{L}\d_])`,n=String.raw`(?:\d*\.)?\d+%?`,e=String.raw`(?:\d*\.)?\d+(?:deg|grad|rad|turn)?`,t=String.raw`rgba?\(\s*(?:${String.raw`${new Array(3).fill(n).join(String.raw`\s+`)}(?:\s*\/\s*${n})?`}|${String.raw`${new Array(3).fill(n).join(String.raw`\s*,\s*`)}(?:\s*,\s*${n})?`})\s*\)`,r=String.raw`hsla?\(\s*(?:${String.raw`${e}\s+${n}\s+${n}(?:\s*\/\s*${n})?`}|${String.raw`${e}${String.raw`\s*,\s*(?:\d*\.)?\d+%`.repeat(2)}(?:\s*,\s*${n})?`})\s*\)`;return{full:new RegExp(String.raw`(^|[^\p{L}\d_])(${a}|${t}|${r})`,"giu"),rgb:new RegExp(String.raw`(^|[^\p{L}\d_])(${a}|${t})`,"giu")}})(),Qi=(a,n=!0)=>{let e=[],t=ka[n?"full":"rgb"];t.lastIndex=0;let r=t.exec(a),i=0;for(;r;){let s=r.index+r[1].length;s>i&&e.push([a.slice(i,s),i,s,!1]),{lastIndex:i}=t,e.push([r[2],s,i,a[s-1]!=="&"||!/^#\d+$/u.test(r[2])]),r=t.exec(a)}return a.length>i&&e.push([a.slice(i),i,a.length,!1]),e}});var Ne,Xi,je,_e,st,It,ce,Yi,ye,va,wa,ot,Ki,Pl,Aa,Sa,$t,qe,ee=k(()=>{"use strict";Un();Ne=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,Xi=String.raw`[^[\]<>"\0-\x1F\x7F${Ne}\uFFFD]`,je=String.raw`(?:\[[\da-f:.]+\]|${Xi})`,_e=String.raw`(?:${Xi}|\0\d+[cn!~]\x7F)*`,st=(a,n)=>e=>e.replace(a,n),It=st(/[\0\x7F]|\r$/gmu,""),ce=st(/\0\d+[cn]\x7F/gu,""),Yi=st(/[\\{}()|.?*+^$[\]]/gu,String.raw`\$&`),ye=(a,n="")=>a.map(e=>typeof e=="string"?e:e.text()).join(n),va={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},wa=st(/&(?:#(\d+|[Xx][\da-fA-F]+)|([lg]t|[LG]T|[lr]brac[ke]|nbsp|amp|AMP|quot|QUOT));/gu,(a,n,e)=>n?String.fromCodePoint(+((/^x/iu.test(n)?"0":"")+n)):va[e.toLowerCase()]),ot=a=>wa(a),Ki=st(/&#(\d+|x[\da-f]+);/giu,(a,n)=>String.fromCodePoint(+((/^x/iu.test(n)?"0":"")+n))),Pl=st(/\n/gu,String.raw`\n`),Aa={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},Sa=a=>st(a,n=>`&${Aa[n]};`),$t=Sa(/[&<>]/gu),qe=(a,n={})=>{let{pre:e="",post:t="",sep:r=""}=n;return e+a.map(i=>i.print()).join(r)+t}});var Ji=Di((jl,Ca)=>{Ca.exports={ext:[],html:[["b","bdi","del","i","ins","u","font","big","small","sub","sup","h1","h2","h3","h4","h5","h6","cite","code","em","s","strike","strong","tt","var","div","center","blockquote","ol","ul","dl","table","caption","pre","ruby","rb","rp","rt","rtc","p","span","abbr","dfn","kbd","samp","data","time","mark","tr","td","th","q","bdo"],["li","dt","dd"],["br","wbr","hr","meta","link"]],namespaces:{"0":"","6":"File","10":"Template","14":"Category","828":"Module"},nsid:{"":0,file:6,template:10,category:14,module:828},functionHook:["msgnw"],variable:["!","=","pageid","articlepath","server","servername","scriptpath","stylepath"],parserFunction:[{"#language":"language","#special":"special","#speciale":"speciale","#tag":"tag","#formatdate":"formatdate","#dateformat":"formatdate","#invoke":"invoke","#while":"while","#dowhile":"dowhile","#loop":"loop","#forargs":"forargs","#fornumargs":"fornumargs","#if":"if","#ifeq":"ifeq","#switch":"switch","#ifexist":"ifexist","#ifexpr":"ifexpr","#iferror":"iferror","#time":"time","#timel":"timel","#expr":"expr","#rel2abs":"rel2abs","#titleparts":"titleparts","#categorytree":"categorytree","#urldecode":"urldecode","#choose":"choose","#var":"var","#varexists":"varexists","#var_final":"var_final","#vardefine":"vardefine","#vardefineecho":"vardefineecho","#widget":"widget","#related":"related","#cscore":"cscore","#regex":"regex","#regex_var":"regex_var","#regexquote":"regexquote","#regexall":"regexall","#len":"len","#pos":"pos","#rpos":"rpos","#sub":"sub","#count":"count","#rmatch":"rmatch","#rreplace":"rreplace","#replace":"replace","#rsplit":"rsplit","#explode":"explode","#tab":"tab","#seo":"seo","#babel":"babel","#commaseparatedlist":"commaseparatedlist","#coordinates":"coordinates","#lst":"lst","#lsth":"lsth","#lstx":"lstx","#assessment":"assessment","#mentor":"mentor","#property":"property","#target":"target","#section":"lst","#section-x":"lstx","#section-h":"lsth","#statements":"statements"},{"!":"!","=":"=","#FORMAL":"formal","#bcp47":"bcp47","#dir":"dir","#interwikilink":"interwikilink","#interlanguagelink":"interlanguagelink","#timef":"timef","#timefl":"timefl"},["msg","raw"],["subst","safesubst"]],doubleUnderscore:[[],[]],protocol:"bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|matrix:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|worldwind://|xmpp:",interwiki:[],img:{},redirection:["#redirect"],variants:[]}});var On,Zi=k(()=>{"use strict";On=Ji()});var xr,Nt,Tr,yr,Hn,M,ne=k(()=>{"use strict";M=class{constructor(n,e){y(this,yr);y(this,xr);y(this,Nt);y(this,Tr);x(this,xr,n),x(this,Nt,e)}get start(){return c(this,Nt)}get top(){return v(this,yr,Hn).call(this).top}get left(){return v(this,yr,Hn).call(this).left}};xr=new WeakMap,Nt=new WeakMap,Tr=new WeakMap,yr=new WeakSet,Hn=function(){var n;return(n=c(this,Tr))!=null||x(this,Tr,c(this,xr).getRootNode().posFromIndex(c(this,Nt))),c(this,Tr)}});var Lt,es,L,P,Le,Yr,H=k(()=>{"use strict";ke();ne();D();Lt=(a,n,e,t)=>({line:a+e-1,character:(e===1?n:0)+t}),es=a=>(n,e,t,r,i="error")=>{let{start:s}=e,{top:o,left:l}=e instanceof M?e:new M(n,s),{offsetHeight:g,offsetWidth:p}=n,{startIndex:d,startLine:u,startCol:h}=a(n,s,o,l),{line:m,character:f}=Lt(u,h,g,p);return{rule:t,message:w.msg(r),severity:i,startIndex:d,endIndex:d+n.toString().length,startLine:u,endLine:m,startCol:h,endCol:f}},L=es((a,n,e,t)=>{let r=a.getRelativeIndex(),{top:i,left:s}=a.parentNode.posFromIndex(r);return{startIndex:n+r,startLine:e+i,startCol:i?s:t+s}}),P=es((a,n,e,t)=>({startIndex:n,startLine:e,startCol:t})),Le=(a,n,e)=>{if(a)return a[1];let t=n();return e([oe.rev,t]),t},Yr=(()=>{let a=(n,e)=>n==="ol"&&e==="type"?["1","a","A","i","I"]:n==="th"&&e==="scope"?["row","col","rowgroup","colgroup"]:e==="dir"?["ltr","rtl","auto"]:e==="aria-hidden"?["true","false"]:[];return{provideValues(n,e){return a(n,e).map(t=>({name:t}))}}})()});var Ia,Kr,ts=k(()=>{"use strict";Ia=(a,n,e)=>{let[t,...r]=a.split("#");return(!t||t===n)&&r.every(i=>i===e)},Kr=(a,n,e)=>({type:t,name:r})=>a.split(",").some(i=>Ia(i.trim(),t,r))});var kr,Et,Ft,vr,wr,Pt,Rt,Mt,Jr,jt,Dn=k(()=>{"use strict";H();ke();jt=class{constructor(){y(this,Mt);re(this,"childNodes",[]);y(this,kr);y(this,Et);y(this,Ft);y(this,vr);y(this,wr);y(this,Pt);y(this,Rt,{})}get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get parentNode(){return c(this,kr)}get nextSibling(){return c(this,Et)}get previousSibling(){return c(this,Ft)}get offsetHeight(){return v(this,Mt,Jr).call(this).height}get offsetWidth(){return v(this,Mt,Jr).call(this).width}getChildNodes(){let{childNodes:n}=this;return Object.isFrozen(n)?[...n]:n}getAttribute(n){return n==="padding"?0:this[n]}setAttribute(n,e){switch(n){case"parentNode":x(this,kr,e),e||(x(this,Et,void 0),x(this,Ft,void 0));break;case"nextSibling":x(this,Et,e);break;case"previousSibling":x(this,Ft,e);break;case"aIndex":x(this,Pt,[oe.rev,e]);break;default:this[n]=e}}getRootNode(){return Le(c(this,wr),()=>{var n,e;return(e=(n=this.parentNode)==null?void 0:n.getRootNode())!=null?e:this},n=>{let[,e]=n;e.type==="root"&&x(this,wr,n)})}indexFromPos(n,e){{if(n<0||e<0)return;let t=this.getLines();if(n>=t.length)return;let[,r,i]=t[n],s=r+e;return s>i?void 0:s}}posFromIndex(n){let{length:e}=String(this);if(n+=n<0?e:0,n>=0&&n<=e){let t=this.getLines(),r=t.findIndex(([,,i])=>n<=i);return{top:r,left:n-t[r][1]}}}getGaps(n){return 0}getRelativeIndex(n){if(n===void 0){let{parentNode:e}=this;return e?e.getRelativeIndex(e.childNodes.indexOf(this)):0}return Le(c(this,Rt)[n],()=>{let{childNodes:e}=this,t=n+(n<0?e.length:0),r=this.getAttribute("padding");for(let i=0;i<t;i++)c(this,Rt)[i]=[oe.rev,r],r+=e[i].toString().length+this.getGaps(i);return r},e=>{c(this,Rt)[n]=e})}getAbsoluteIndex(){return Le(c(this,Pt),()=>{let{parentNode:n}=this;return n?n.getAbsoluteIndex()+this.getRelativeIndex():0},n=>{x(this,Pt,n)})}getBoundingClientRect(){return{...v(this,Mt,Jr).call(this),...this.getRootNode().posFromIndex(this.getAbsoluteIndex())}}seal(n,e){Object.defineProperty(this,n,{enumerable:!e&&!!this[n],configurable:!0})}is(n){return this.type===n}getLines(){return Le(c(this,vr),()=>{let n=[],e=0;for(let t of String(this).split(`
|
|
2
|
+
`)){let r=e+t.length;n.push([t,e,r]),e=r+1}return n},n=>{x(this,vr,n)})}};kr=new WeakMap,Et=new WeakMap,Ft=new WeakMap,vr=new WeakMap,wr=new WeakMap,Pt=new WeakMap,Rt=new WeakMap,Mt=new WeakSet,Jr=function(){let n=this.getLines(),e=n[n.length-1];return{height:n.length,width:e[2]-e[1]}}});var Qe,zn,Wn,Zr,rs=k(()=>{"use strict";ee();ke();ts();Dn();Zr=class extends jt{constructor(){super(...arguments);y(this,Qe)}get length(){return this.childNodes.length}text(e){return ye(this.childNodes,e)}normalize(){let e=this.getChildNodes(),t=r=>{var i,s;e.splice(r,1),(i=e[r-1])==null||i.setAttribute("nextSibling",e[r]),(s=e[r])==null||s.setAttribute("previousSibling",e[r-1])};for(let r=e.length-1;r>=0;r--){let{type:i,data:s}=e[r];i!=="text"||e.length===1||this.getGaps(r-(r&&1))||s===""&&t(r)}this.setAttribute("childNodes",e)}removeAt(e){return Gn(this,e,1)[0]}insertAt(e,t=this.length){return Gn(this,t,0,[e]),e}closest(e){let t=Kr(e,this),{parentNode:r}=this;for(;r;){if(t(r))return r;({parentNode:r}=r)}}querySelector(e){let t=Kr(e,this);return v(this,Qe,zn).call(this,t)}querySelectorAll(e){let t=Kr(e,this);return v(this,Qe,Wn).call(this,t)}append(...e){for(let t of e)this.insertAt(t)}replaceChildren(...e){for(let t=this.length-1;t>=0;t--)this.removeAt(t);this.append(...e)}setText(e,t=0){t+=t<0?this.length:0;let r=this.childNodes[t],{data:i}=r;return r.replaceData(e),i}toString(e,t=""){return this.childNodes.map(r=>r.toString(e)).join(t)}caretPositionFromIndex(e){{if(e===void 0)return;let{length:t}=this.toString();if(e>t||e<-t)return;e+=e<0?t:0;let r=this,i=0,s=0;for(;r.type!=="text";){let{childNodes:o}=r;i+=r.getAttribute("padding");for(let l=0;i<=e&&l<o.length;l++){let g=o[l],{nextSibling:p}=g,d=g.toString(),u=d.length;if(g.setAttribute("aIndex",i),i+=u,i>e||i===e&&u>0&&(!p||p.type==="text"||g.type!=="text"&&(d.trim()||!p.toString().trim()))){r=g,i-=u,s=i;break}i+=r.getGaps(l)}if(r.childNodes===o)return{offsetNode:r,offset:e-s}}return{offsetNode:r,offset:e-s}}}elementFromIndex(e){var t;{let r=(t=this.caretPositionFromIndex(e))==null?void 0:t.offsetNode;return(r==null?void 0:r.type)==="text"?r.parentNode:r}}elementFromPoint(e,t){return this.elementFromIndex(this.indexFromPos(t,e))}lint(e=this.getAbsoluteIndex(),t){let r=[];for(let i=0,s=e+this.getAttribute("padding");i<this.length;i++){let o=this.childNodes[i];o.setAttribute("aIndex",s),r.push(...o.lint(s,t)),s+=o.toString().length+this.getGaps(i)}return r}print(e={}){let t=e.class;return this.toString()?(t===""?"":`<span class="wpb-${t!=null?t:this.type}">`)+qe(this.childNodes,e)+(t===""?"":"</span>"):""}json(e,t=this.getAbsoluteIndex()){let r={...this,type:this.type,range:[t,t+this.toString().length],childNodes:[]};for(let i=0,s=t+this.getAttribute("padding");i<this.length;i++){let o=this.childNodes[i],{length:l}=o.toString();o.setAttribute("aIndex",s),r.childNodes.push(o.type==="text"?{data:o.data,range:[s,s+l]}:o.json(void 0,s)),s+=l+this.getGaps(i)}return r}};Qe=new WeakSet,zn=function(e){var t;for(let r of this.childNodes){if(r.type==="text")continue;if(e(r))return r;let i=v(t=r,Qe,zn).call(t,e);if(i)return i}},Wn=function(e){var r;let t=[];for(let i of this.childNodes)i.type!=="text"&&(e(i)&&t.push(i),t.push(...v(r=i,Qe,Wn).call(r,e)));return t}});var Vn,ns,$a,Na,La,Ea,Fa,Pa,Qn,en,is,Ar,ss=k(()=>{"use strict";ee();H();D();Dn();Vn=String.raw`[${Ne}\t]*`,ns=String.raw`<\s*(?:/\s*)?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|(?:rfc|pmid)(?=[-::]?${Vn}\d)|isbn(?=[-::]?${Vn}(?:\d(?:${Vn}|-)){6})`,$a=new RegExp(String.raw`${ns}|https?[:/]/+`,"giu"),Na=new RegExp(ns,"giu"),La=new Set(["attr-value","ext-link-text","link-text"]),Ea={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},Fa={"<":"tag-like","[":"lonely-bracket","{":"lonely-bracket","]":"lonely-bracket","}":"lonely-bracket",h:"lonely-http",r:"lonely-http",p:"lonely-http",i:"lonely-http"},Pa=["html","head","style","title","body","a","audio","img","video","embed","iframe","object","canvas","script","col","colgroup","tbody","tfoot","thead","button","input","label","option","select","textarea"];try{Qn=new RegExp(String.raw`[\p{L}\d_]`,"u")}catch(a){Qn=/\w/u}Ar=class extends jt{constructor(e){super();y(this,en);re(this,"data","");Object.defineProperties(this,{childNodes:{enumerable:!1,configurable:!1},data:{value:e}})}get type(){return"text"}toString(e){var t;return e&&!((t=this.parentNode)!=null&&t.getAttribute("built"))?ce(this.data):this.data}text(){return this.data}lint(e=this.getAbsoluteIndex(),t){var O,F,X;if(t===!1)return[];let{data:r,parentNode:i,nextSibling:s,previousSibling:o}=this;if(!i)throw new Error("An isolated text node cannot be linted!");let{type:l,name:g,parentNode:p}=i,d=!1;if(l==="attr-value"){let{type:W,name:se,tag:E}=p;if(W!=="ext-attr")d=!0;else if(E==="choose"&&(se==="before"||se==="after"))return[]}if(t!=null||(t=l==="free-ext-link"||l==="ext-link-url"||l==="ext-link-text"||l==="image-parameter"&&g==="link"||d?Na:$a),r.search(t)===-1)return[];t.lastIndex=0;let u=[],h=s==null?void 0:s.type,m=s==null?void 0:s.name,f=o==null?void 0:o.type,b=this.getRootNode(),T=b.toString(),{ext:C,html:I}=b.getAttribute("config"),{top:A,left:$}=b.posFromIndex(e),j=new Set(["onlyinclude","noinclude","includeonly",...C,...I[0],...I[1],...I[2],...Pa]);for(let W=t.exec(r);W;W=t.exec(r)){let[,se,E]=W,{index:_}=W,B=W[0].toLowerCase();if(E&&E!=="]"){let{length:xe}=E;_+=xe,B=B.slice(xe)}let{0:N,length:z}=B,le=N==="r"||N==="p"||N==="i";if(N==="<"&&!j.has(se.toLowerCase())||N==="["&&l==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(r.slice(_+1))||s!=null&&s.is("ext")&&m==="nowiki"&&((O=s.innerText)!=null&&O.includes("]")))||le&&(!i.getAttribute("plain")||La.has(l)))continue;N==="]"&&(_||z>1)&&t.lastIndex--;let Q=e+_,ie=Q+z,R=T[ie],$e=T[Q-1],wt=z>1&&!(N==="<"&&!/[\s/>]/u.test(R!=null?R:"")||d&&(N==="["||N==="]")||le&&l==="parameter-value")||N==="{"&&(R===N||$e==="-")||N==="}"&&($e===N||R==="-")||N==="["&&(R===N||l==="ext-link-text"||h==="free-ext-link"&&!r.slice(_+1).trim())||N==="]"&&($e===N||f==="free-ext-link"&&!r.slice(0,_).includes("]"))?"error":"warning",_n=N==="{"||N==="[";if(wt==="warning"&&(_n||(N==="]"||N==="}"))){let xe=Ea[N],qn=_n?r.slice(_+1):r.slice(0,_);if(N==="{"&&((F=xe.exec(qn))==null?void 0:F[0])==="}"||N==="}"&&((X=xe.exec(qn))==null?void 0:X[0])==="{")continue;if(!qn.includes(N)){let qi=_n?"nextSibling":"previousSibling",it=this[qi];for(;it&&(it.type!=="text"||!xe.test(it.data));)it=it[qi];if(it&&xe.exec(it.data)[0]!==N)continue}}le&&(B=B.toUpperCase());let Mi=this.posFromIndex(_),{line:ji,character:_i}=Lt(A,$,Mi.top+1,Mi.left),At={rule:Fa[N],message:w.msg('lonely "$1"',le||N==="h"?B:N),severity:wt,startIndex:Q,endIndex:ie,startLine:ji,endLine:ji,startCol:_i,endCol:_i+z};if(N==="<")At.suggestions=[{desc:"escape",range:[Q,Q+1],text:"<"}];else if(N==="h"&&l!=="link-text"&&Qn.test($e||""))At.suggestions=[{desc:"whitespace",range:[Q,Q],text:" "}];else if(N==="["&&l==="ext-link-text"){let xe=i.getAbsoluteIndex()+i.toString().length;At.suggestions=[{desc:"escape",range:[xe,xe+1],text:"]"}]}else if(N==="]"&&f==="free-ext-link"&&wt==="error"){let xe=e-o.toString().length;At.fix={range:[xe,xe],text:"[",desc:"left bracket"}}else le&&(At.suggestions=[...W[0]===B?[]:[{desc:"uppercase",range:[Q,ie],text:B}],...R===":"||R==="\uFF1A"?[{desc:"whitespace",range:[ie,ie+1],text:" "}]:[]]);u.push(At)}return u}replaceData(e){v(this,en,is).call(this,e)}print(){return $t(this.data)}};en=new WeakSet,is=function(e){this.setAttribute("data",e)}});var ve,at=k(()=>{"use strict";ke();ve=(a=!0,n=!0)=>(e,t)=>{class r extends e{text(){return""}lint(s){return a?[]:super.lint(s)}}return tn(r,e),r}});var Sr,we,_t=k(()=>{"use strict";U();we=class extends S{constructor(e,t,r,i,s,o){super(e,i,s,o);y(this,Sr);x(this,Sr,r)}get type(){return c(this,Sr)}lint(e=this.getAbsoluteIndex()){return super.lint(e,!1)}};Sr=new WeakMap});var qt,Y,Be=k(()=>{"use strict";U();Y=class extends S{constructor(e,t,r,i,s){super(e,r,i,s);y(this,qt);x(this,qt,t)}get type(){return c(this,qt)}set type(e){x(this,qt,e)}};qt=new WeakMap});var Ra,lt,Ee,Fe,Pe,Cr=k(()=>{"use strict";H();ee();ne();D();U();Be();Ra=a=>a==="redirect-target"||a==="link",Pe=class extends S{constructor(e,t,r=w.getConfig(),i=[],s="|"){super(void 0,r,i,{});y(this,lt,!0);y(this,Ee);y(this,Fe);if(this.insertAt(new Y(e,"link-target",r,i,{})),t!==void 0){let o=new S(t,r,i,{});o.type="link-text",o.setAttribute("stage",10),this.insertAt(o)}x(this,Ee,s)}get link(){return c(this,Fe)}get fragment(){return c(this,Fe).fragment}afterBuild(){x(this,Fe,this.getTitle()),c(this,Ee).includes("\0")&&x(this,Ee,this.buildFromStr(c(this,Ee),0)),this.setAttribute("name",c(this,Fe).title),super.afterBuild()}setAttribute(e,t){e==="bracket"?x(this,lt,t):e==="title"?x(this,Fe,t):super.setAttribute(e,t)}toString(e){let t=super.toString(e,c(this,Ee));return c(this,lt)?`[[${t}]]`:t}text(){let e=super.text("|");return c(this,lt)?`[[${e}]]`:e}getAttribute(e){return e==="title"?c(this,Fe):e==="padding"?2:super.getAttribute(e)}getGaps(e){return e===0?c(this,Ee).length:1}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{childNodes:[i,s],type:o}=this,{encoded:l,fragment:g}=c(this,Fe),p=new M(this,e);if(i.childNodes.some(({type:d})=>d==="template")&&r.push(L(i,p,"unknown-page","template in an internal link target","warning")),l){let d=L(i,p,"url-encoding","unnecessary URL encoding in an internal link");d.suggestions=[{desc:"decode",range:[d.startIndex,d.endIndex],text:Ve(i.text())}],r.push(d)}if(o==="link"||o==="category"){let d=s==null?void 0:s.childNodes.findIndex(h=>h.type==="text"&&h.data.includes("|")),u=s==null?void 0:s.childNodes[d];if(u){let h=L(s,p,"pipe-like",'additional "|" in the link text',"warning"),m=h.startIndex+s.getRelativeIndex(d);h.suggestions=[{desc:"escape",range:[m,m+u.data.length],text:u.data.replace(/\|/gu,"|")}],r.push(h)}}if(g!==void 0&&!Ra(o)){let d=L(i,p,"no-ignored","useless fragment"),u=i.childNodes.findIndex(m=>m.type==="text"&&m.data.includes("#")),h=i.childNodes[u];h&&(d.fix={range:[d.startIndex+i.getRelativeIndex(u)+h.data.indexOf("#"),d.endIndex],text:"",desc:"remove"}),r.push(d)}return r}getTitle(e,t){return this.normalizeTitle(this.firstChild.toString(!0),0,e,t,!0,!0)}print(){return super.print(c(this,lt)?{pre:"[[",post:"]]",sep:c(this,Ee)}:{sep:c(this,Ee)})}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t),{type:i,fragment:s}=this;return s!==void 0&&(i==="link"||i==="redirect-target")&&(r.fragment=s),r}};lt=new WeakMap,Ee=new WeakMap,Fe=new WeakMap});var he,Xe=k(()=>{"use strict";U();he=class extends S{get innerText(){return this.firstChild.data}constructor(n="",e,t){super(n,e,t)}}});var os,Xn,Ma,J,Ye=k(()=>{"use strict";at();Xe();os=[ve()];J=class extends(Ma=he){get type(){return"noinclude"}toString(n){return n?"":super.toString()}};Xn=ge(Ma),J=pe(Xn,0,"NoincludeToken",os,J),ue(Xn,1,J)});var rn,as=k(()=>{"use strict";H();Cr();Ye();rn=class extends Pe{get type(){return"redirect-target"}constructor(n,e,t,r){super(n,void 0,t,r),e!==void 0&&this.insertAt(new J(e,t,r))}getTitle(){return this.normalizeTitle(this.firstChild.toString(),0,!1,!0,!0)}lint(n=this.getAbsoluteIndex()){let e=super.lint(n,!1);if(this.length===2){let t=L(this.lastChild,{start:n},"no-ignored","useless link text");t.startIndex--,t.startCol--,t.fix={range:[t.startIndex,t.endIndex],text:"",desc:"remove"},e.push(t)}return e}}});var ls,Ke,Bt,Yn,ja,dt,ds=k(()=>{"use strict";at();U();_t();as();ls=[ve(!1,!1)];dt=class extends(ja=S){constructor(e,t,r,i,s,o,l=[]){super(void 0,o,l);y(this,Ke);y(this,Bt);x(this,Ke,e),x(this,Bt,s);let g=new RegExp(String.raw`^(?:${o.redirection.join("|")})\s*(?::\s*)?$`,"iu");this.append(new we(t,g,"redirect-syntax",o,l,{}),new rn(r,i==null?void 0:i.slice(1),o,l))}get type(){return"redirect"}getAttribute(e){return e==="padding"?c(this,Ke).length:super.getAttribute(e)}toString(e){return c(this,Ke)+super.toString(e)+c(this,Bt)}lint(e=this.getAbsoluteIndex()){let t=e+c(this,Ke).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",t),this.lastChild.lint(t)}print(){return super.print({pre:c(this,Ke),post:c(this,Bt)})}};Yn=ge(ja),Ke=new WeakMap,Bt=new WeakMap,dt=pe(Yn,0,"RedirectToken",ls,dt),ue(Yn,1,dt)});var gs={};de(gs,{parseRedirect:()=>_a});var _a,us=k(()=>{"use strict";D();ds();_a=(a,n,e)=>{var r;(r=n.regexRedirect)!=null||(n.regexRedirect=new RegExp(String.raw`^(\s*)((?:${n.redirection.join("|")})\s*(?::\s*)?)\[\[([^\n|\]]+)(\|.*?)?\]\](\s*)`,"iu"));let t=n.regexRedirect.exec(a);return t&&w.normalizeTitle(t[3],0,!1,n,!0,!0,!0).valid?(a=`\0${e.length}o\x7F${a.slice(t[0].length)}`,new dt(...t.slice(1),n,e),a):!1}});var nn,ps=k(()=>{"use strict";U();nn=class extends S{get type(){return"onlyinclude"}toString(n){return`<onlyinclude>${super.toString(n)}</onlyinclude>`}getAttribute(n){return n==="padding"?13:n==="plain"||super.getAttribute(n)}print(){return super.print({pre:'<span class="wpb-ext"><onlyinclude></span>',post:'<span class="wpb-ext"></onlyinclude></span>'})}}});var Je,Ut,Kn=k(()=>{"use strict";U();Ut=class extends S{constructor(e,t,r,i,s,o=[]){super(void 0,s);y(this,Je);re(this,"closed");re(this,"selfClosing");this.setAttribute("name",e.toLowerCase()),x(this,Je,[e,i||e]),this.closed=i!=="",this.selfClosing=i===void 0,this.append(t,r);let l=typeof t=="string"?-1:o.indexOf(t);o.splice(l===-1?1/0:l,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(e){let{selfClosing:t,firstChild:r,lastChild:i}=this,[s,o]=c(this,Je);return t?`<${s}${r.toString(e)}/>`:`<${s}${r.toString(e)}>${i.toString(e)}${this.closed?`</${o}>`:""}`}text(){let[e,t]=c(this,Je);return this.selfClosing?`<${e}${this.firstChild.text()}/>`:`<${e}${super.text(">")}${this.closed?`</${t}>`:""}`}getAttribute(e){return e==="padding"?c(this,Je)[0].length+1:super.getAttribute(e)}getGaps(){return 1}print(){let[e,t]=c(this,Je);return super.print(this.selfClosing?{pre:`<${e}`,post:"/>"}:{pre:`<${e}`,sep:">",post:this.closed?`</${t}>`:""})}};Je=new WeakMap});var cs,Jn,qa,gt,hs=k(()=>{"use strict";H();ne();at();D();Kn();cs=[ve(!1)];gt=class extends(qa=Ut){get type(){return"include"}constructor(n,e="",t,r,i,s){super(n,e,t!=null?t:"",t===void 0||r!=null?r:"",i,s)}toString(n){return n?"":super.toString()}lint(n=this.getAbsoluteIndex()){let e=[],{firstChild:t,closed:r,name:i}=this,s=new M(this,n);if(t.data.trim()){let o=L(t,s,"no-ignored","useless attribute","warning");o.suggestions=[{desc:"remove",range:[o.startIndex,o.endIndex],text:""}],e.push(o)}if(!r){let o=P(this,s,"unclosed-comment",w.msg("unclosed $1",`<${i}>`));o.suggestions=[{desc:"close",range:[o.endIndex,o.endIndex],text:`</${i}>`}],e.push(o)}return e}};Jn=ge(qa),gt=pe(Jn,0,"IncludeToken",cs,gt),ue(Jn,1,gt)});var Ot,sn=k(()=>{"use strict";ke();Ot=(a=0)=>(n,e)=>{var r,ms;class t extends n{constructor(){super(...arguments);y(this,r)}getAttr(l){return v(this,r,ms).call(this).getAttr(l)}}return r=new WeakSet,ms=function(){return this.childNodes[a]},tn(t,n),t}});var te,fs,bs,an,Zn,xs,Ht,Ts,ys,ks,on,ln,dn,gn,vs,ei=k(()=>{"use strict";te=new Set(["align"]),fs=new Set(["cite"]),bs=new Set(["cite","datetime"]),an=new Set(["width"]),Zn=new Set(["axis","align","bgcolor","height","width","valign"]),xs=new Set([...Zn,"abbr","headers","scope","rowspan","colspan"]),Ht=new Set(["type"]),Ts=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),ys=new Set(["clear"]),ks=new Set(["bgcolor","align","valign"]),on=new Set,ln=new Set(["id","class","style","lang","dir","title","tabindex","aria-describedby","aria-flowto","aria-hidden","aria-label","aria-labelledby","aria-level","aria-owns","role","about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),dn={div:te,h1:te,h2:te,h3:te,h4:te,h5:te,h6:te,blockquote:fs,q:fs,p:te,br:ys,pre:an,ins:bs,del:bs,ul:Ht,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...Ts,"border"]),caption:te,tr:ks,td:xs,th:xs,img:new Set(["alt","src","width","height","srcset"]),font:new Set(["size","color","face"]),hr:an,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:Ht,poem:te,categorytree:te,combooption:te},gn={gallery:new Set(["mode","showfilename","caption","perrow","widths","heights","showthumbnails"]),poem:new Set(["compact"]),categorytree:new Set(["hideroot","onlyroot","depth","mode","hideprefix","namespaces","showcount","notranslations"]),combooption:new Set(["name","for","inline"]),nowiki:on,indicator:new Set(["name"]),langconvert:new Set(["from","to"]),ref:new Set(["group","name","extends","follow","dir"]),references:new Set(["group","responsive"]),charinsert:new Set(["label"]),choose:new Set(["uncached","before","after"]),option:new Set(["weight"]),imagemap:on,inputbox:on,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:on,poll:new Set(["id","show-results-before-voting"]),sm2:Ht,flashmp3:Ht,score:new Set(["line_width_inches","lang","override_midi","raw","note-language","override_audio","override_ogg","sound","vorbis"]),seo:new Set(["title","title_mode","title_separator","keywords","description","robots","google_bot","image","image_width","image_height","image_alt","type","site_name","locale","section","author","published_time","twitter_site"]),tab:new Set(["nested","name","index","class","block","inline","openname","closename","collapsed","dropdown","style","bgcolor","container","id","title"]),tabs:new Set(["plain","class","container","id","title","style"]),combobox:new Set(["placeholder","value","id","class","text","dropdown","style"])},vs={table:Ts,td:new Set([...Zn,"scope"]),th:Zn,br:ys,caption:te,div:te,hr:an,h1:te,h2:te,h3:te,h4:te,h5:te,h6:te,li:Ht,p:te,pre:an,tr:ks,ul:Ht}});var Ba,Ua,Ir,Dt,ae,Re,zt,ws=k(()=>{"use strict";H();ee();ei();ne();D();U();Be();Ba=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,Ua=new Set(["ext","arg","magic-word","template"]),zt=class extends S{constructor(e,t,r,i="",s,o=[],l=w.getConfig(),g=[]){let p=new Y(r,"attr-key",l,g),d;if(r==="title"||t==="img"&&r==="alt")d=new S(s,l,g,{}),d.type="attr-value",d.setAttribute("stage",10);else if(t==="gallery"&&r==="caption"||t==="choose"&&(r==="before"||r==="after")){let u={...l,excludes:[...l.excludes,"heading","html","table","hr","list"]};d=new S(s,u,g,{}),d.type="attr-value",d.setAttribute("stage",1)}else d=new Y(s,"attr-value",l,g,{});super(void 0,l,g);y(this,Ir);y(this,Dt);y(this,ae);y(this,Re);x(this,Ir,e),this.append(p,d),x(this,ae,i),x(this,Re,[...o]),x(this,Dt,t),this.setAttribute("name",ce(r).trim().toLowerCase())}get type(){return c(this,Ir)}get tag(){return c(this,Dt)}get balanced(){return!c(this,ae)||c(this,Re)[0]===c(this,Re)[1]}afterBuild(){c(this,ae).includes("\0")&&x(this,ae,this.buildFromStr(c(this,ae),0)),this.parentNode&&x(this,Dt,this.parentNode.name),this.setAttribute("name",this.firstChild.toString(!0).trim().toLowerCase()),super.afterBuild()}toString(e){let[t="",r=""]=c(this,Re);return c(this,ae)?super.toString(e,c(this,ae)+t)+r:this.firstChild.toString(e)}text(){return c(this,ae)?`${super.text(`${c(this,ae).trim()}"`)}"`:this.firstChild.text()}getGaps(){var e,t;return c(this,ae)?c(this,ae).length+((t=(e=c(this,Re)[0])==null?void 0:e.length)!=null?t:0):0}lint(e=this.getAbsoluteIndex(),t){var b;let r=super.lint(e,t),{balanced:i,firstChild:s,lastChild:o,type:l,name:g,tag:p}=this,d=this.getValue(),u=new M(this,e);if(!i){let T=L(o,u,"unclosed-quote",w.msg("unclosed $1","quotes"),"warning");T.startIndex--,T.startCol--,T.suggestions=[{range:[T.endIndex,T.endIndex],text:c(this,Re)[0],desc:"close"}],r.push(T)}let h=gn[p],m=dn[p],{length:f}=this.toString();if(!(h!=null&&h.has(g))&&!(m!=null&&m.has(g))&&(l==="ext-attr"?h||m:!/\{\{[^{]+\}\}/u.test(g))&&(l==="ext-attr"&&!m||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(g)&&(p==="meta"||p==="link"||!ln.has(g)))){let T=L(s,u,"illegal-attr","illegal attribute name");T.suggestions=[{desc:"remove",range:[e,e+f],text:""}],r.push(T)}else if(g==="style"&&typeof d=="string"&&Ba.test(d))r.push(L(o,u,"insecure-style","insecure style"));else if(g==="tabindex"&&typeof d=="string"&&d!=="0"){let T=L(o,u,"illegal-attr","nonzero tabindex");T.suggestions=[{desc:"remove",range:[e,e+f],text:""},{desc:"0 tabindex",range:[T.startIndex,T.endIndex],text:"0"}],r.push(T)}else if(l!=="ext-attr"&&!o.childNodes.some(({type:T})=>Ua.has(T))){let T=Yr.provideValues(p,g),C=String(d).toLowerCase();T.length>0&&T.every(({name:I})=>I!==C)&&r.push(L(o,u,"illegal-attr","illegal attribute value","warning"))}return(b=vs[p])!=null&&b.has(g)&&r.push(L(s,u,"obsolete-attr","obsolete attribute","warning")),r}getValue(){return c(this,ae)?this.lastChild.text().trim():this.type==="ext-attr"||""}print(){let[e="",t=""]=c(this,Re);return c(this,ae)?super.print({sep:$t(c(this,ae))+e,post:t}):super.print()}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return r.tag=this.tag,r}};Ir=new WeakMap,Dt=new WeakMap,ae=new WeakMap,Re=new WeakMap});var As,Oa,ti,$r,Ze,un=k(()=>{"use strict";H();ee();ne();D();U();Be();ws();As=a=>a.slice(0,-1),Oa=a=>`${As(a)}-dirty`;try{ti=new RegExp(String.raw`[\p{L}\d]`,"u")}catch(a){ti=/[^\W_]/u}Ze=class extends S{constructor(e,t,r,i,s=[]){super(void 0,i,s,{});y(this,$r);if(x(this,$r,t),this.setAttribute("name",r),e){let o=/([^\s/](?:(?!\0\d+~\x7F)[^\s/=])*)(?:((?:\s(?:\s|\0\d+[cn]\x7F)*)?(?:=|\0\d+~\x7F)(?:\s|\0\d+[cn]\x7F)*)(?:(["'])([\s\S]*?)(\3|$)|(\S*)))?/gu,l="",g=o.exec(e),p=0,d=()=>{l&&(super.insertAt(new Y(l,Oa(t),i,s,{})),l="")};for(;g;){let{index:u,0:h,1:m,2:f,3:b,4:T,5:C,6:I}=g;if(l+=e.slice(p,u),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(ce(m).trim())){let A=T!=null?T:I,$=[b,C],j=new zt(As(t),r,m,f,A,$,i,s);d(),super.insertAt(j)}else l+=h;({lastIndex:p}=o),g=o.exec(e)}l+=e.slice(p),d()}}get type(){return c(this,$r)}afterBuild(){let{parentNode:e}=this;(e==null?void 0:e.type)==="td"&&e.subtype==="caption"&&this.setAttribute("name","caption"),super.afterBuild()}getAttrTokens(e){return this.childNodes.filter(t=>t instanceof zt&&(!e||t.name===e.toLowerCase().trim()))}getAttrToken(e){let t=this.getAttrTokens(e);return t[t.length-1]}getAttr(e){var t;return(t=this.getAttrToken(e))==null?void 0:t.getValue()}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{parentNode:i,childNodes:s}=this,o=new Map,l=new Set,g=new M(this,e);if((i==null?void 0:i.type)==="html"&&i.closing&&this.text().trim()){let p=P(this,g,"no-ignored","attributes of a closing tag"),d=i.getAbsoluteIndex();p.suggestions=[{desc:"remove",range:[e,p.endIndex],text:""},{desc:"open",range:[d+1,d+2],text:""}],r.push(p)}for(let p of s)if(p instanceof zt){let{name:d}=p;o.has(d)?(l.add(d),o.get(d).push(p)):o.set(d,[p])}else{let d=p.text().trim();if(d){let u=L(p,g,"no-ignored","containing invalid attribute",ti.test(d)?"error":"warning");u.suggestions=[{desc:"remove",range:[u.startIndex,u.endIndex],text:" "}],r.push(u)}}if(l.size>0)for(let p of l){let d=o.get(p).map(u=>{let h=u.getValue();return[u,h===!0?"":h]});r.push(...d.map(([u,h],m)=>{let f=L(u,g,"no-duplicate",w.msg("duplicated $1 attribute",p)),b={desc:"remove",range:[f.startIndex,f.endIndex],text:""};return!h||d.slice(0,m).some(([,T])=>T===h)?f.fix=b:f.suggestions=[b],f}))}return r}print(){return this.toString()?`<span class="wpb-${this.type}">${this.childNodes.map(e=>e.print(e instanceof Y?{class:e.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}};$r=new WeakMap});var pn,Ss=k(()=>{"use strict";D();U();Ye();pn=class extends S{get type(){return"ext-inner"}constructor(n,e=w.getConfig(),t=[]){if(n){let r=/<nowiki>/giu,i=/<\/nowiki>/giu,{length:s}=r.source,o=r.exec(n);o&&(i.lastIndex=o.index+s);let l=i.exec(n),g=0,p="";for(;o&&l;)new J(o[0],e,t),new J(l[0],e,t),p+=`${n.slice(g,o.index)}\0${t.length-1}n\x7F${n.slice(o.index+s,l.index)}\0${t.length}n\x7F`,g=l.index+s+1,r.lastIndex=g,o=r.exec(n),o&&(i.lastIndex=o.index+s),l=i.exec(n);n=p+n.slice(g)}super(n,e,t,{}),this.setAttribute("stage",10)}getAttribute(n){return n==="plain"||super.getAttribute(n)}lint(n=this.getAbsoluteIndex()){return super.lint(n,/<\s*\/\s*(pre)\b/giu)}}});var Wt,ri=k(()=>{"use strict";H();ne();Nr();D();U();Be();Wt=class extends S{get type(){return"ext-inner"}constructor(n,e,t=w.getConfig(),r=[],i){if(super(void 0,t,r,{}),e){let s=Y;this.append(...e.split(`
|
|
3
|
+
`).map(o=>i?o:ut(o,t,r,n)).map(o=>new s(o,"param-line",t,r,{})))}r.splice(r.indexOf(this),1),r.push(this)}toString(n){return super.toString(n,`
|
|
4
4
|
`)}text(){return super.text(`
|
|
5
|
-
`)}getGaps(){return 1}lint(n=this.getAbsoluteIndex()){let e=new
|
|
6
|
-
`})}}});var Ir,Ht,gn,Ut,ti=k(()=>{"use strict";D();ke();ee();W();q();Rt();Ut=class extends S{constructor(e,t,r,i=[]){super(void 0,r,i);T(this,Ht);T(this,Ir);b(this,Ir,e);let s=new S(t[0],r,i);s.type="heading-title",s.setAttribute("stage",2);let o=new Ae(t[1],/^\s*$/u,"heading-trail",r,i,{});this.append(s,o)}get type(){return"heading"}get level(){return c(this,Ir)}toString(e){let t=A(this,Ht,gn).call(this);return t+this.firstChild.toString(e)+t+this.lastChild.toString(e)}text(){let e=A(this,Ht,gn).call(this);return e+this.firstChild.text()+e}getAttribute(e){return e==="padding"?this.level:super.getAttribute(e)}getGaps(){return this.level}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{firstChild:i,level:s}=this,o=i.toString(),l=o.startsWith("="),u=l||o.endsWith("="),p=i.childNodes.filter(zt("quote")),d=p.filter(({bold:m})=>m),g=p.filter(({italic:m})=>m),f=new j(this,e);if(this.level===1){let m=I(i,f,"h1","<h1>");u||(m.suggestions=[{desc:"h2",range:[m.startIndex,m.endIndex],text:`=${o}=`}]),r.push(m)}if(u){let m=I(i,f,"unbalanced-header",v.msg("unbalanced $1 in a section header",'"="'));if(o!=="=")if(l){let[x]=/^=+/u.exec(o);m.suggestions=[{desc:`h${s}`,range:[m.startIndex,m.startIndex+x.length],text:""},{desc:`h${s+x.length}`,range:[m.endIndex,m.endIndex],text:x}]}else{let x=/[^=](=+)$/u.exec(o)[1];m.suggestions=[{desc:`h${s}`,range:[m.endIndex-x.length,m.endIndex],text:""},{desc:`h${s+x.length}`,range:[m.startIndex,m.startIndex],text:x}]}r.push(m)}this.closest("html-attrs,table-attrs")&&r.push(P(this,f,"parsing-order","section header in an HTML tag"));let h=this.getRootNode().toString();if(d.length%2){let m=I(d[d.length-1],{...f,start:e+s,left:f.left+s},"format-leakage",v.msg("unbalanced $1 in a section header","bold apostrophes")),x=e+s+o.length;h.slice(m.endIndex,x).trim()?m.suggestions=[{desc:"close",range:[x,x],text:"'''"}]:m.fix={desc:"remove",range:[m.startIndex,m.endIndex],text:""},r.push(m)}if(g.length%2){let m=I(g[g.length-1],{start:e+s},"format-leakage",v.msg("unbalanced $1 in a section header","italic apostrophes")),x=e+s+o.length;m.fix=h.slice(m.endIndex,x).trim()?{desc:"close",range:[x,x],text:"''"}:{desc:"remove",range:[m.startIndex,m.endIndex],text:""},r.push(m)}return r}print(){let e=A(this,Ht,gn).call(this);return super.print({pre:e,sep:e})}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return r.level=this.level,r}};Ir=new WeakMap,Ht=new WeakSet,gn=function(){return"=".repeat(this.level)}});var qa,un,vs=k(()=>{"use strict";Y();D();W();q();qa=new RegExp(`https?://${je}${Be}$`,"iu"),un=class extends S{get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){var n;try{return!!((n=this.parentNode)!=null&&n.getDuplicatedArgs().some(([e])=>e===this.name))}catch(e){return!1}}constructor(n,e,t=v.getConfig(),r=[]){super(void 0,t,r);let i=new S(typeof n=="number"?void 0:n,t,r,{}),s=new S(e,t,r);i.type="parameter-key",i.setAttribute("stage",2),s.type="parameter-value",s.setAttribute("stage",2),this.append(i,s)}trimName(n,e=!0){let t=(typeof n=="string"?n:n.toString(!0)).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");return this.setAttribute("name",t),t}afterBuild(){if(!this.anon){let{parentNode:n,firstChild:e}=this,t=this.trimName(e);n&&n.getArgs(t,!1,!1).add(this)}super.afterBuild()}toString(n){return this.anon?this.lastChild.toString(n):super.toString(n,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(n=this.getAbsoluteIndex(),e){var s;let t=super.lint(n,e),{firstChild:r}=this,i=(s=qa.exec(r.text()))==null?void 0:s[0];if(i&&new URL(i).search){let o=I(r,{start:n},"unescaped","unescaped query string in an anonymous parameter");o.startIndex=o.endIndex,o.startLine=o.endLine,o.startCol=o.endCol,o.endIndex++,o.endCol++,o.fix={range:[o.startIndex,o.endIndex],text:"{{=}}",desc:"escape"},t.push(o)}return t}print(){return super.print({sep:this.anon?"":"="})}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e);return Object.assign(t,{anon:this.anon,duplicated:this.duplicated}),t}}});var Er,gt,ut,Gt,Ze,pn,As,Nr,Ss=k(()=>{"use strict";Y();D();ke();ee();q();vs();_e();Rt();Nr=class extends S{constructor(e,t,r,i=[]){var m,x;let s,o=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(e);o&&(s=Number(o[1]),e=e.replace(`\0${s}h\x7F`,i[s].toString().replace(/^\n/u,"")));super(void 0,r,i,{});T(this,Ze);te(this,"modifier","");T(this,Er,"template");T(this,gt,!1);T(this,ut,new Map);T(this,Gt);let{parserFunction:[l,u],variable:p}=r,d=(m=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(e))==null?void 0:m[0];if(d)this.setAttribute("modifier",d),e=e.slice(d.length);else if(e.includes(":")){let[y,...w]=e.split(":"),[C]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((x=w[0])!=null?x:"");this.setModifier(`${y}:${C}`)&&(e=w.join(":").slice(C.length))}let g=e.includes(":");if(g||t.length===0&&!c(this,gt)){let y=e.indexOf(":"),w=y===-1?e:e.slice(0,y),C=y===-1?void 0:e.slice(y+1),$=de(w),L=$[C===void 0?"trim":"trimStart"](),O=L.toLowerCase(),M=Array.isArray(u),F=M?u.includes(L):Object.prototype.hasOwnProperty.call(u,L),Q=!M&&F?u[L]:Object.prototype.hasOwnProperty.call(l,O)&&l[O];if(M&&F||p.includes(Q)||g&&Q){this.setAttribute("name",Q||O.replace(/^#/u,"")),b(this,Er,"magic-word");let H=new RegExp(String.raw`^\s*${L}\s*$`,F?"u":"iu"),G=new Ae(w,H,"magic-word-name",r,i,{});if(super.insertAt(G),C!==void 0&&t.unshift([C]),this.name==="invoke")for(let E=0;E<2;E++){let _=t.shift();if(!_)break;let N=new V(_.join("="),`invoke-${E?"function":"module"}`,r,i);super.insertAt(N)}}}if(this.type==="template"){let y=de(e).trim();if(!this.normalizeTitle(y,10,!0,!0).valid)throw i.pop(),new SyntaxError("Invalid template name");let w=new V(e,"template-name",r,i,{});super.insertAt(w)}typeof s=="number"&&(i[s]=void 0);let f=this.isTemplate(),h=1;for(let y=0;y<t.length;y++){let w=t[y];f||this.name==="switch"&&y>0||this.name==="tag"&&y>1||(w[0]=w.join("="),w.length=1),w.length===1&&(w.unshift(h),h++),this.insertAt(new un(...w,r,i))}this.seal("modifier")}get type(){return c(this,Er)}setModifier(e){let{parserFunction:[,,t,r]}=this.getAttribute("config"),i=de(e).trim();if(e&&!i.endsWith(":"))return!1;let s=i.slice(0,-1).toLowerCase(),o=t.includes(s),l=r.includes(s);return c(this,gt)&&o||!c(this,gt)&&(l||e==="")||(re.running||this.length>1)&&(o||l||e==="")?(this.setAttribute("modifier",e),b(this,gt,o),!!e):!1}isTemplate(){return this.type==="template"||this.name==="invoke"}getModule(){var e;if(this.type!=="magic-word"||this.name!=="invoke")throw new Error("TranscludeToken.getModule method is only for modules!");return[A(this,Ze,pn).call(this).title,(e=this.childNodes[2])==null?void 0:e.toString(!0).trim()]}afterBuild(){this.modifier.includes("\0")&&this.setAttribute("modifier",this.buildFromStr(this.modifier,0)),super.afterBuild(),this.isTemplate()&&this.type==="template"&&(b(this,Gt,A(this,Ze,pn).call(this)),this.setAttribute("name",c(this,Gt).title))}toString(e){return`{{${this.modifier}${this.type==="magic-word"?this.firstChild.toString(e)+(this.length===1?"":":")+this.childNodes.slice(1).map(t=>t.toString(e)).join("|"):super.toString(e,"|")}}}`}text(){let{childNodes:e,length:t,firstChild:r,modifier:i,type:s,name:o}=this;return s==="magic-word"&&o==="vardefine"?"":`{{${i}${s==="magic-word"?r.text()+(t===1?"":":")+ye(e.slice(1),"|"):super.text("|")}}}`}getAttribute(e){switch(e){case"padding":return this.modifier.length+2;case"title":return c(this,Gt);default:return super.getAttribute(e)}}getGaps(){return 1}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t);if(!this.isTemplate())return r;let{type:i,childNodes:s,length:o}=this,l=new j(this,e),u=i==="magic-word";if(u&&!A(this,Ze,pn).call(this).valid)r.push(I(s[1],l,"invalid-invoke","illegal module name"));else{let d=s[u?1:0],g=d.childNodes.findIndex(h=>h.type==="text"&&it(h.data).includes("#")),f=d.childNodes[g];if(f){let h=I(d,l,"no-ignored","useless fragment");h.fix={range:[h.startIndex+d.getRelativeIndex(g)+f.data.indexOf("#"),h.endIndex],text:"",desc:"remove"},r.push(h)}}if(u&&o===2)return r.push(P(this,l,"invalid-invoke","missing module function")),r;let p=this.getDuplicatedArgs().filter(([,d])=>!d[0].querySelector("ext"));if(p.length>0)for(let[,d]of p)r.push(...d.map(g=>{let f=I(g,l,"no-duplicate","duplicated parameter");return f.suggestions=[{desc:"remove",range:[f.startIndex-1,f.endIndex],text:""}],f}));return r}insertAt(e,t=this.length){return super.insertAt(e,t),e.anon?A(this,Ze,As).call(this,e):e.name&&this.getArgs(e.name,!1,!1).add(e),e}getAllArgs(){return this.childNodes.filter(zt("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:e})=>e)}getArgs(e,t,r=!0){let i=String(e).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),s;return c(this,ut).has(i)?s=c(this,ut).get(i):(s=new Set(this.getAllArgs().filter(({name:o})=>i===o)),c(this,ut).set(i,s)),s}getDuplicatedArgs(){return[...c(this,ut)].filter(([,{size:e}])=>e>1).map(([e,t])=>[e,[...t]])}getPossibleValues(){let{type:e,name:t,childNodes:r}=this;if(e==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let i;switch(t){case"if":case"ifexist":case"ifexpr":case"iferror":i=2;break;case"ifeq":i=3;break;default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}let s=r.slice(i,i+2).map(({childNodes:[,o]})=>o);for(let o=0;o<s.length;){let{length:l,0:u}=s[o].childNodes.filter(p=>p.text().trim());if(l===0)s.splice(o,1);else if(l>1||u.type!=="magic-word")o++;else try{let p=u.getPossibleValues();s.splice(o,1,...p),o+=p.length}catch(p){o++}}return s}print(){let{childNodes:e,length:t,firstChild:r,modifier:i,type:s}=this;return`<span class="wpb-${s}">{{${wt(i)}${s==="magic-word"?r.print()+(t===1?"":":")+qe(e.slice(1),{sep:"|"}):qe(e,{sep:"|"})}}}</span>`}};Er=new WeakMap,gt=new WeakMap,ut=new WeakMap,Gt=new WeakMap,Ze=new WeakSet,pn=function(){let e=this.type==="template";return this.normalizeTitle(this.childNodes[e?0:1].toString(!0),e?10:828,!0)},As=function(e){let t=this.getAnonArgs(),r=typeof e!="number";for(let i=r?t.indexOf(e):e-1;i<t.length;i++){let s=t[i],{name:o}=s,l=String(i+1);(o!==l||s===e)&&(s.setAttribute("name",l),this.getArgs(l,!1,!1).add(s))}}});var ws,ri,_a,pt,Cs=k(()=>{"use strict";st();q();ws=[ve()];pt=class extends(_a=S){get type(){return"hidden"}};ri=oe(_a),pt=le(ri,0,"HiddenToken",ws,pt),ae(ri,1,pt)});var mn,$s,cn,Is=k(()=>{"use strict";Y();D();ee();q();_e();Cs();cn=class extends S{constructor(e,t,r=[]){super(void 0,t,r,{});T(this,mn);for(let i=0;i<e.length;i++){let s=e[i];if(i===0){let o=new V(s,"arg-name",t,r,{});super.insertAt(o)}else if(i>1){let o=new pt(s,t,r);super.insertAt(o)}else{let o=new S(s,t,r);o.type="arg-default",o.setAttribute("stage",2),super.insertAt(o)}}}get type(){return"arg"}get default(){var e,t;return(t=(e=this.childNodes[1])==null?void 0:e.text())!=null?t:!1}toString(e){return`{{{${super.toString(e,"|")}}}}`}text(){return`{{{${ye(this.childNodes.slice(0,2),"|")}}}}`}getAttribute(e){return e==="padding"?3:super.getAttribute(e)}getGaps(){return 1}afterBuild(){A(this,mn,$s).call(this),super.afterBuild()}lint(e=this.getAbsoluteIndex(),t){let{childNodes:[r,i,...s]}=this;if(!this.getAttribute("include")){let l=P(this,{start:e},"no-arg","unexpected template argument");return i&&(l.suggestions=[{range:[e,l.endIndex],text:i.text(),desc:"expand"}]),[l]}r.setAttribute("aIndex",e+3);let o=r.lint(e+3,t);if(i){let l=e+4+r.toString().length;i.setAttribute("aIndex",l),o.push(...i.lint(l,t))}if(s.length>0){let l=new j(this,e);o.push(...s.map(u=>{let p=I(u,l,"no-ignored","invisible content inside triple braces");return p.startIndex--,p.startCol--,p.suggestions=[{desc:"remove",range:[p.startIndex,p.endIndex],text:""},{desc:"escape",range:[p.startIndex,p.startIndex+1],text:"{{!}}"}],p}))}return o}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return r.default=this.default,r}};mn=new WeakSet,$s=function(){this.setAttribute("name",this.firstChild.toString(!0).trim())}});var Fs={};se(Fs,{parseBraces:()=>Lr});var Oa,Ns,Es,Ls,Lr,hn=k(()=>{"use strict";Y();ti();Ss();Is();Oa={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},Ns=String.raw`|\{{2,}`,Es=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),Ls=a=>{let n=de(a).trim().toLowerCase();return Es.has(n)?Es.get(n):/^(?:filepath|(?:full|canonical)urle?):./u.test(n)?"m":/^#vardefine:./u.test(n)?"n":"t"},Lr=(a,n,e)=>{var f,h,m,x,y,w;let t=String.raw`${(f=n.excludes)!=null&&f.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,r]}=n,i=[],s=[],o=C=>C.replace(/\0(\d+)\x7F/gu,($,L)=>s[L]);a=a.replace(/\{\{([^\n{}[]*)\}\}(?!\})|\[\[[^\n[\]{]*\]\]/gu,(C,$)=>{if($!==void 0)try{let{length:L}=e,O=$.split("|");return new Nr(O[0],O.slice(1).map(M=>{let F=M.indexOf("=");return F===-1?[M]:[M.slice(0,F),M.slice(F+1)]}),n,e),`\0${L}${Ls(O[0])}\x7F`}catch(L){if(!(L instanceof SyntaxError)||L.message!=="Invalid template name")throw L}return s.push(C),`\0${s.length-1}\x7F`});let l=a.lastIndexOf("}}")-a.length,u=l+a.length!==-1,p=new RegExp(t+(u?Ns:""),"gmu"),d=p.exec(a),g;for(;d||g!==void 0&&g<=a.length&&((m=(h=i[i.length-1])==null?void 0:h[0])!=null&&m.startsWith("="));){if(d!=null&&d[1]){let[,{length:_}]=d;d[0]=d[0].slice(_),d.index+=_}let{0:C,index:$}=d!=null?d:{0:`
|
|
7
|
-
`,index:a.length}
|
|
8
|
-
`){
|
|
9
|
-
)`:""}(\s*)$`,"u");return[p,d,
|
|
10
|
-
`))!=null?i:[]){let o=/^([^|]+)(?:\|(.*))?/u.exec(s);if(!o){super.insertAt(s.trim()?new
|
|
5
|
+
`)}getGaps(){return 1}lint(n=this.getAbsoluteIndex()){let e=new M(this,n),t=w.msg("invalid parameter of <$1>",this.name),r=[];for(let i of this.childNodes){i.setAttribute("aIndex",n);let s=i.childNodes.filter(({type:o})=>o!=="comment"&&o!=="include"&&o!=="noinclude");if(s.some(({type:o})=>o==="ext"))r.push(L(i,e,"no-ignored",t));else{let o=s.findIndex(({type:g})=>g!=="text"),l=s.slice(0,o===-1?void 0:o).map(String).join("");if(l&&!(o===-1?/^[a-z]+(?:\[\])?\s*=/iu:/^[a-z]+(?:\[\])?\s*(?:=|$)/iu).test(l)){let g=L(i,e,"no-ignored",t);g.suggestions=[{desc:"remove",range:[g.startIndex,g.endIndex],text:""}],r.push(g)}else r.push(...i.lint(n,!1))}n+=i.toString().length+1}return r}print(){return super.print({sep:`
|
|
6
|
+
`})}}});var Lr,Gt,cn,Vt,ni=k(()=>{"use strict";H();ke();ne();D();U();_t();Vt=class extends S{constructor(e,t,r,i=[]){super(void 0,r,i);y(this,Gt);y(this,Lr);x(this,Lr,e);let s=new S(t[0],r,i);s.type="heading-title",s.setAttribute("stage",2);let o=new we(t[1],/^\s*$/u,"heading-trail",r,i,{});this.append(s,o)}get type(){return"heading"}get level(){return c(this,Lr)}toString(e){let t=v(this,Gt,cn).call(this);return t+this.firstChild.toString(e)+t+this.lastChild.toString(e)}text(){let e=v(this,Gt,cn).call(this);return e+this.firstChild.text()+e}getAttribute(e){return e==="padding"?this.level:super.getAttribute(e)}getGaps(){return this.level}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{firstChild:i,level:s}=this,o=i.toString(),l=o.startsWith("="),g=l||o.endsWith("="),p=i.childNodes.filter(Qt("quote")),d=p.filter(({bold:f})=>f),u=p.filter(({italic:f})=>f),h=new M(this,e);if(this.level===1){let f=L(i,h,"h1","<h1>");g||(f.suggestions=[{desc:"h2",range:[f.startIndex,f.endIndex],text:`=${o}=`}]),r.push(f)}if(g){let f=L(i,h,"unbalanced-header",w.msg("unbalanced $1 in a section header",'"="'));if(o!=="=")if(l){let[b]=/^=+/u.exec(o);f.suggestions=[{desc:`h${s}`,range:[f.startIndex,f.startIndex+b.length],text:""},{desc:`h${s+b.length}`,range:[f.endIndex,f.endIndex],text:b}]}else{let b=/[^=](=+)$/u.exec(o)[1];f.suggestions=[{desc:`h${s}`,range:[f.endIndex-b.length,f.endIndex],text:""},{desc:`h${s+b.length}`,range:[f.startIndex,f.startIndex],text:b}]}r.push(f)}this.closest("html-attrs,table-attrs")&&r.push(P(this,h,"parsing-order","section header in an HTML tag"));let m=this.getRootNode().toString();if(d.length%2){let f=L(d[d.length-1],{...h,start:e+s,left:h.left+s},"format-leakage",w.msg("unbalanced $1 in a section header","bold apostrophes")),b=e+s+o.length;m.slice(f.endIndex,b).trim()?f.suggestions=[{desc:"close",range:[b,b],text:"'''"}]:f.fix={desc:"remove",range:[f.startIndex,f.endIndex],text:""},r.push(f)}if(u.length%2){let f=L(u[u.length-1],{start:e+s},"format-leakage",w.msg("unbalanced $1 in a section header","italic apostrophes")),b=e+s+o.length;f.fix=m.slice(f.endIndex,b).trim()?{desc:"close",range:[b,b],text:"''"}:{desc:"remove",range:[f.startIndex,f.endIndex],text:""},r.push(f)}return r}print(){let e=v(this,Gt,cn).call(this);return super.print({pre:e,sep:e})}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return r.level=this.level,r}};Lr=new WeakMap,Gt=new WeakSet,cn=function(){return"=".repeat(this.level)}});var Ha,hn,Cs=k(()=>{"use strict";ee();H();D();U();Ha=new RegExp(`https?://${je}${_e}$`,"iu"),hn=class extends S{get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){var n;try{return!!((n=this.parentNode)!=null&&n.getDuplicatedArgs().some(([e])=>e===this.name))}catch(e){return!1}}constructor(n,e,t=w.getConfig(),r=[]){super(void 0,t,r);let i=new S(typeof n=="number"?void 0:n,t,r,{}),s=new S(e,t,r);i.type="parameter-key",i.setAttribute("stage",2),s.type="parameter-value",s.setAttribute("stage",2),this.append(i,s)}trimName(n,e=!0){let t=(typeof n=="string"?n:n.toString(!0)).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");return this.setAttribute("name",t),t}afterBuild(){if(!this.anon){let{parentNode:n,firstChild:e}=this,t=this.trimName(e);n&&n.getArgs(t,!1,!1).add(this)}super.afterBuild()}toString(n){return this.anon?this.lastChild.toString(n):super.toString(n,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(n=this.getAbsoluteIndex(),e){var s;let t=super.lint(n,e),{firstChild:r}=this,i=(s=Ha.exec(r.text()))==null?void 0:s[0];if(i&&new URL(i).search){let o=L(r,{start:n},"unescaped","unescaped query string in an anonymous parameter");o.startIndex=o.endIndex,o.startLine=o.endLine,o.startCol=o.endCol,o.endIndex++,o.endCol++,o.fix={range:[o.startIndex,o.endIndex],text:"{{=}}",desc:"escape"},t.push(o)}return t}print(){return super.print({sep:this.anon?"":"="})}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e);return Object.assign(t,{anon:this.anon,duplicated:this.duplicated}),t}}});var Fr,et,pt,ct,Xt,tt,mn,Is,Er,$s=k(()=>{"use strict";ee();H();ke();ne();U();Cs();Be();_t();Er=class extends S{constructor(e,t,r,i=[]){var C,I;let s,o=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(e);o&&(s=Number(o[1]),e=e.replace(`\0${s}h\x7F`,i[s].toString().replace(/^\n/u,"")));super(void 0,r,i,{});y(this,tt);re(this,"modifier","");y(this,Fr,"template");y(this,et,":");y(this,pt,!1);y(this,ct,new Map);y(this,Xt);let{parserFunction:[l,g],variable:p,functionHook:d}=r,u=(C=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(e))==null?void 0:C[0];if(u)this.setAttribute("modifier",u),e=e.slice(u.length);else if(e.includes(":")){let[A,...$]=e.split(":"),[j]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((I=$[0])!=null?I:"");this.setModifier(`${A}:${j}`)&&(e=$.join(":").slice(j.length))}let h=e.search(/[::]/u),m=e[h]==="\uFF1A",f=h!==-1;if(f||t.length===0&&!c(this,pt)){let A=f?e.slice(0,h):e,$=f&&e.slice(h+1),j=ce(A),O=f?j.slice(j.search(/\S/u))+(m?"\uFF1A":""):j.trim(),F=O.toLowerCase(),X=Array.isArray(g),W=X?g.includes(O):Object.prototype.hasOwnProperty.call(g,O),se=!X&&W?g[O]:Object.prototype.hasOwnProperty.call(l,F)&&l[F],E=X&&W||!("functionHook"in r)||d.includes(se),_=X&&W||p.includes(se);if(f?se&&E:_){this.setAttribute("name",se||F.replace(/^#|:$/u,"")),x(this,Fr,"magic-word"),m&&x(this,et,"\uFF1A");let B=new RegExp(String.raw`^\s*${O}\s*$`,W?"u":"iu"),N=new we(A,B,"magic-word-name",r,i,{});if(super.insertAt(N),$!==!1&&t.unshift([$]),this.name==="invoke")for(let z=0;z<2;z++){let le=t.shift();if(!le)break;let Q=new Y(le.join("="),`invoke-${z?"function":"module"}`,r,i);super.insertAt(Q)}}}if(this.type==="template"){let A=ce(e).trim();if(!this.normalizeTitle(A,10,!0,!0).valid)throw i.pop(),new SyntaxError("Invalid template name");let $=new Y(e,"template-name",r,i,{});super.insertAt($)}typeof s=="number"&&(i[s]=void 0);let b=this.isTemplate(),T=1;for(let A=0;A<t.length;A++){let $=t[A];b||this.name==="switch"&&A>0||this.name==="tag"&&A>1||($[0]=$.join("="),$.length=1),$.length===1&&($.unshift(T),T++),this.insertAt(new hn(...$,r,i))}this.seal("modifier")}get type(){return c(this,Fr)}setModifier(e){let{parserFunction:[,,t,r]}=this.getAttribute("config"),i=ce(e).trim();if(e&&!i.endsWith(":"))return!1;let s=i.slice(0,-1).toLowerCase(),o=t.includes(s),l=r.includes(s);return c(this,pt)&&o||!c(this,pt)&&(l||e==="")||(oe.running||this.length>1)&&(o||l||e==="")?(this.setAttribute("modifier",e),x(this,pt,o),!!e):!1}isTemplate(){return this.type==="template"||this.name==="invoke"}getModule(){var e;if(this.type!=="magic-word"||this.name!=="invoke")throw new Error("TranscludeToken.getModule method is only for modules!");return[v(this,tt,mn).call(this).title,(e=this.childNodes[2])==null?void 0:e.toString(!0).trim()]}afterBuild(){this.modifier.includes("\0")&&this.setAttribute("modifier",this.buildFromStr(this.modifier,0)),super.afterBuild(),this.isTemplate()&&this.type==="template"&&(x(this,Xt,v(this,tt,mn).call(this)),this.setAttribute("name",c(this,Xt).title))}toString(e){return`{{${this.modifier}${this.type==="magic-word"?this.firstChild.toString(e)+(this.length===1?"":c(this,et))+this.childNodes.slice(1).map(t=>t.toString(e)).join("|"):super.toString(e,"|")}}}`}text(){let{childNodes:e,length:t,firstChild:r,modifier:i,type:s,name:o}=this;return s==="magic-word"&&o==="vardefine"?"":`{{${i}${s==="magic-word"?r.text()+(t===1?"":c(this,et))+ye(e.slice(1),"|"):super.text("|")}}}`}getAttribute(e){switch(e){case"padding":return this.modifier.length+2;case"title":return c(this,Xt);case"colon":return c(this,et);default:return super.getAttribute(e)}}getGaps(){return 1}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t);if(!this.isTemplate())return r;let{type:i,childNodes:s,length:o}=this,l=new M(this,e),g=i==="magic-word";if(g&&!v(this,tt,mn).call(this).valid)r.push(L(s[1],l,"invalid-invoke","illegal module name"));else{let d=s[g?1:0],u=d.childNodes.findIndex(m=>m.type==="text"&&ot(m.data).includes("#")),h=d.childNodes[u];if(h){let m=L(d,l,"no-ignored","useless fragment");m.fix={range:[m.startIndex+d.getRelativeIndex(u)+h.data.indexOf("#"),m.endIndex],text:"",desc:"remove"},r.push(m)}}if(g&&o===2)return r.push(P(this,l,"invalid-invoke","missing module function")),r;let p=this.getDuplicatedArgs().filter(([,d])=>!d[0].querySelector("ext"));if(p.length>0)for(let[,d]of p)r.push(...d.map(u=>{let h=L(u,l,"no-duplicate","duplicated parameter");return h.suggestions=[{desc:"remove",range:[h.startIndex-1,h.endIndex],text:""}],h}));return r}insertAt(e,t=this.length){return super.insertAt(e,t),e.anon?v(this,tt,Is).call(this,e):e.name&&this.getArgs(e.name,!1,!1).add(e),e}getAllArgs(){return this.childNodes.filter(Qt("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:e})=>e)}getArgs(e,t,r=!0){let i=String(e).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),s;return c(this,ct).has(i)?s=c(this,ct).get(i):(s=new Set(this.getAllArgs().filter(({name:o})=>i===o)),c(this,ct).set(i,s)),s}getDuplicatedArgs(){return[...c(this,ct)].filter(([,{size:e}])=>e>1).map(([e,t])=>[e,[...t]])}getPossibleValues(){let{type:e,name:t,childNodes:r}=this;if(e==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let i;switch(t){case"if":case"ifexist":case"ifexpr":case"iferror":i=2;break;case"ifeq":i=3;break;default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}let s=r.slice(i,i+2).map(({childNodes:[,o]})=>o);for(let o=0;o<s.length;){let{length:l,0:g}=s[o].childNodes.filter(p=>p.text().trim());if(l===0)s.splice(o,1);else if(l>1||g.type!=="magic-word")o++;else try{let p=g.getPossibleValues();s.splice(o,1,...p),o+=p.length}catch(p){o++}}return s}print(){let{childNodes:e,length:t,firstChild:r,modifier:i,type:s}=this;return`<span class="wpb-${s}">{{${$t(i)}${s==="magic-word"?r.print()+(t===1?"":c(this,et))+qe(e.slice(1),{sep:"|"}):qe(e,{sep:"|"})}}}</span>`}};Fr=new WeakMap,et=new WeakMap,pt=new WeakMap,ct=new WeakMap,Xt=new WeakMap,tt=new WeakSet,mn=function(){let e=this.type==="template";return this.normalizeTitle(this.childNodes[e?0:1].toString(!0),e?10:828,!0)},Is=function(e){let t=this.getAnonArgs(),r=typeof e!="number";for(let i=r?t.indexOf(e):e-1;i<t.length;i++){let s=t[i],{name:o}=s,l=String(i+1);(o!==l||s===e)&&(s.setAttribute("name",l),this.getArgs(l,!1,!1).add(s))}}});var Ns,ii,Da,ht,Ls=k(()=>{"use strict";at();U();Ns=[ve()];ht=class extends(Da=S){get type(){return"hidden"}};ii=ge(Da),ht=pe(ii,0,"HiddenToken",Ns,ht),ue(ii,1,ht)});var bn,Es,fn,Fs=k(()=>{"use strict";ee();H();ne();U();Be();Ls();fn=class extends S{constructor(e,t,r=[]){super(void 0,t,r,{});y(this,bn);for(let i=0;i<e.length;i++){let s=e[i];if(i===0){let o=new Y(s,"arg-name",t,r,{});super.insertAt(o)}else if(i>1){let o=new ht(s,t,r);super.insertAt(o)}else{let o=new S(s,t,r);o.type="arg-default",o.setAttribute("stage",2),super.insertAt(o)}}}get type(){return"arg"}get default(){var e,t;return(t=(e=this.childNodes[1])==null?void 0:e.text())!=null?t:!1}toString(e){return`{{{${super.toString(e,"|")}}}}`}text(){return`{{{${ye(this.childNodes.slice(0,2),"|")}}}}`}getAttribute(e){return e==="padding"?3:super.getAttribute(e)}getGaps(){return 1}afterBuild(){v(this,bn,Es).call(this),super.afterBuild()}lint(e=this.getAbsoluteIndex(),t){let{childNodes:[r,i,...s]}=this;if(!this.getAttribute("include")){let l=P(this,{start:e},"no-arg","unexpected template argument");return i&&(l.suggestions=[{range:[e,l.endIndex],text:i.text(),desc:"expand"}]),[l]}r.setAttribute("aIndex",e+3);let o=r.lint(e+3,t);if(i){let l=e+4+r.toString().length;i.setAttribute("aIndex",l),o.push(...i.lint(l,t))}if(s.length>0){let l=new M(this,e);o.push(...s.map(g=>{let p=L(g,l,"no-ignored","invisible content inside triple braces");return p.startIndex--,p.startCol--,p.suggestions=[{desc:"remove",range:[p.startIndex,p.endIndex],text:""},{desc:"escape",range:[p.startIndex,p.startIndex+1],text:"{{!}}"}],p}))}return o}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return r.default=this.default,r}};bn=new WeakSet,Es=function(){this.setAttribute("name",this.firstChild.toString(!0).trim())}});var js={};de(js,{parseBraces:()=>Pr});var za,Ps,Rs,Ms,Pr,xn=k(()=>{"use strict";ee();ni();$s();Fs();za={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},Ps=String.raw`|\{{2,}`,Rs=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),Ms=a=>{let n=ce(a).trim().toLowerCase();return Rs.has(n)?Rs.get(n):/^(?:filepath|(?:full|canonical)urle?):./u.test(n)?"m":/^#vardefine:./u.test(n)?"n":"t"},Pr=(a,n,e)=>{var h,m,f,b,T,C;let t=String.raw`${(h=n.excludes)!=null&&h.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,r]}=n,i=[],s=[],o=I=>I.replace(/\0(\d+)\x7F/gu,(A,$)=>s[$]);a=a.replace(/\{\{([^\n{}[]*)\}\}(?!\})|\[\[[^\n[\]{]*\]\]/gu,(I,A)=>{if(A!==void 0)try{let{length:$}=e,j=A.split("|");return new Er(j[0],j.slice(1).map(O=>{let F=O.indexOf("=");return F===-1?[O]:[O.slice(0,F),O.slice(F+1)]}),n,e),`\0${$}${Ms(j[0])}\x7F`}catch($){if(!($ instanceof SyntaxError)||$.message!=="Invalid template name")throw $}return s.push(I),`\0${s.length-1}\x7F`});let l=a.lastIndexOf("}}")-a.length,g=l+a.length!==-1,p=new RegExp(t+(g?Ps:""),"gmu"),d=p.exec(a),u;for(;d||u!==void 0&&u<=a.length&&((f=(m=i[i.length-1])==null?void 0:m[0])!=null&&f.startsWith("="));){if(d!=null&&d[1]){let[,{length:B}]=d;d[0]=d[0].slice(B),d.index+=B}let{0:I,index:A}=d!=null?d:{0:`
|
|
7
|
+
`,index:a.length},$=(b=i.pop())!=null?b:{},{0:j,index:O,parts:F,findEqual:X,pos:W}=$,se=I==="="&&X,E=B=>{F[F.length-1].push(o(B.slice(W,A)))};if(I==="]]"||I==="}-")u=A+2;else if(I===`
|
|
8
|
+
`){u=A+1;let{pos:B,findEqual:N}=(T=i[i.length-1])!=null?T:{};if(B===void 0||N||ce(a.slice(B,O))!==""){let z=/^(={1,6})(.+)\1((?:\s|\0\d+[cn]\x7F)*)$/u.exec(a.slice(O,A));z&&(a=`${a.slice(0,O)}\0${e.length}h\x7F${a.slice(A)}`,u=O+4+String(e.length).length,z[2]=o(z[2]),new Vt(z[1].length,z.slice(2),n,e))}}else if(I==="|"||se)u=A+1,E(a),I==="|"&&F.push([]),$.pos=u,$.findEqual=I==="|",i.push($);else if(I.startsWith("}}")){let B=I.slice(0,Math.min(j.length,3)),N=j.length-B.length,{length:z}=e;u=A+B.length,E(a);let le=!1,Q="t";if(B.length===3){let ie=F.map($e=>$e.join("=")),R=ie.length>1&&ce(ie[1]).trim();new fn(ie,n,e),R&&R.endsWith(":")&&r.includes(R.slice(0,-1).toLowerCase())&&(Q="s")}else try{new Er(F[0][0],F.slice(1),n,e),Q=Ms(F[0][0])}catch(ie){if(ie instanceof SyntaxError&&ie.message==="Invalid template name")le=!0;else throw ie}le||(a=`${a.slice(0,O+N)}\0${z}${Q}\x7F${a.slice(u)}`,u=O+N+3+String(z).length,N>1?i.push({0:j.slice(0,N),index:O,pos:O+N,parts:[[]]}):N===1&&a[O-1]==="-"&&i.push({0:"-{",index:O-1,pos:O+1,parts:[[]]}))}else u=A+I.length,I.startsWith("{")&&(d.pos=u,d.parts=[[]]),i.push(..."0"in $?[$]:[],d);let _=i[i.length-1];if(g&&l+a.length<u)for(g=!1;(C=_==null?void 0:_[0])!=null&&C.startsWith("{");)i.pop(),_=i[i.length-1];p=new RegExp(t+(g?Ps:"")+(_?`|${za[_[0][0]]}${_.findEqual?"|=":""}`:""),"gmu"),p.lastIndex=u,d=p.exec(a)}return o(a)}});var Tn,_s=k(()=>{"use strict";Nr();xn();D();ri();Tn=class extends Wt{constructor(n,e,t=w.getConfig(),r=[]){let i=Symbol("InputboxToken"),{length:s}=r;r.push(i),e&&(e=ut(e,t,r,n)),e&&(e=Pr(e,t,r)),r.splice(s,1),super(n,e,t,r,{})}}});function qs(a,n,e,t,r){n=n.trim();let i=n.replace(a==="link"?/\0\d+[tq]\x7F/gu:/\0\d+t\x7F/gu,"").trim();switch(a){case"width":return!i&&!!n||/^(?:\d+x?|\d*x\d+)(?:\s*px)?$/u.test(i);case"link":{if(!i)return n;let s=new RegExp(String.raw`^(?:${e.protocol}|//|\0\d+m\x7F)`,"iu"),o=new RegExp(String.raw`^(?:(?:${e.protocol}|//)${je}|\0\d+m\x7F)${_e}$`,"iu");if(s.test(i))return o.test(i)&&n;i.startsWith("[[")&&i.endsWith("]]")&&(i=i.slice(2,-2));let l=w.normalizeTitle(i,0,!1,e,!1,t,!0,!0);return l.valid&&l}case"lang":return(r==="svg"||r==="svgz")&&!/[^a-z\d-]/u.test(i);case"alt":case"class":case"manualthumb":return!0;case"page":return(r==="djvu"||r==="djv"||r==="pdf")&&Number(i)>0;default:return!!i&&!isNaN(i)}}var Wa,fe,kn,Bs,yn,Us=k(()=>{"use strict";ee();H();D();U();Wa=new Set(["alt","link","lang","page","caption"]);yn=class extends S{constructor(e,t,r,i){var n=(...Iu)=>(super(...Iu),y(this,kn),y(this,fe,""),this);var g;let s,o=Object.entries(r.img).map(([p,d])=>{let u=new RegExp(String.raw`^(\s*(?!\s))${p.replace("$1","(.*)")}${p.endsWith("$1")?`(?=$|
|
|
9
|
+
)`:""}(\s*)$`,"u");return[p,d,u]}),l=o.find(([,p,d])=>(s=d.exec(e),s&&(s.length!==4||qs(p,s[2],r,!0,t)!==!1)));if(l&&s){s.length===3?(n(void 0,r,i),x(this,fe,e)):(n(s[2],r,i,{}),x(this,fe,s[1]+l[0]+s[3])),this.setAttribute("name",l[1]);return}n(e,{...r,excludes:[...(g=r.excludes)!=null?g:[],"list"]},i),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get type(){return"image-parameter"}get link(){return this.name==="link"?qs("link",super.text(),this.getAttribute("config")):void 0}afterBuild(){var e;((e=this.parentNode)==null?void 0:e.type)==="gallery-image"&&!Wa.has(this.name)&&this.setAttribute("name","invalid"),super.afterBuild()}toString(e){return c(this,fe)?c(this,fe).replace("$1",super.toString(e)):super.toString(e)}text(){return c(this,fe)?c(this,fe).replace("$1",super.text()).trim():super.text().trim()}getAttribute(e){return e==="plain"?this.name==="caption":e==="padding"?Math.max(0,c(this,fe).indexOf("$1")):super.getAttribute(e)}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{link:i,name:s}=this;if(s==="invalid"){let o=P(this,{start:e},"invalid-gallery","invalid image parameter");o.fix={range:[e-1,o.endIndex],text:"",desc:"remove"},r.push(o)}else if(typeof i=="object"&&i.encoded){let o=P(this,{start:e},"url-encoding","unnecessary URL encoding in an internal link");o.suggestions=[{desc:"decode",range:[e,o.endIndex],text:Ve(this.text())}],r.push(o)}return r}getValue(){return this.name==="invalid"?this.text():v(this,kn,Bs).call(this)||super.text()}print(){return c(this,fe)?`<span class="wpb-image-parameter">${c(this,fe).replace("$1",`<span class="wpb-image-caption">${qe(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}};fe=new WeakMap,kn=new WeakSet,Bs=function(){return c(this,fe)&&!c(this,fe).includes("$1")}});var Os,Hs,Ds,Ga,Yt,si=k(()=>{"use strict";ee();H();ne();D();Cr();Us();Os=new Map([["manualthumb","Thumb"],["frameless","Frameless"],["framed","Frame"],["thumbnail","Thumb"]]),Hs=new Set(["left","right","center","none"]),Ds=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),Ga=(a,n,e,t)=>{if(t===void 0)return[];let r=new RegExp(`${[a,n,e].map(Yi).join("|")}`,"gu"),i=[],s=r.exec(t),o=0,l=0;for(;s;){let{0:g,index:p}=s;g!==e?o+=g===a?1:-1:o===0&&(i.push(t.slice(l,p)),{lastIndex:l}=r),s=r.exec(t)}return i.push(t.slice(l)),i},Yt=class extends Pe{get type(){return"file"}get extension(){return this.getAttribute("title").extension}constructor(n,e,t=w.getConfig(),r=[],i="|"){super(n,void 0,t,r,i);let{extension:s}=this.getTitle(!0,!0);this.append(...Ga("-{","}-","|",e).map(o=>new yn(o,s,t,r)))}lint(n=this.getAbsoluteIndex(),e){var h;let t=super.lint(n,e),r=this.getAllArgs().filter(({childNodes:m})=>{let f=m.filter(b=>b.text().trim());return f.length!==1||f[0].type!=="arg"}),i=[...new Set(r.map(({name:m})=>m))],s=i.filter(m=>Os.has(m)),o=i.filter(m=>Hs.has(m)),l=i.filter(m=>Ds.has(m)),[g]=s,p=g==="framed"||g==="manualthumb",d=new M(this,n);if(this.closest("ext-link-text")&&((h=this.getValue("link"))==null?void 0:h.trim())!==""&&t.push(P(this,d,"nested-link","internal link in an external link")),p)for(let m of r.filter(({name:f})=>f==="width")){let f=L(m,d,"invalid-gallery","invalid image parameter");f.fix={range:[f.startIndex-1,f.endIndex],text:"",desc:"remove"},t.push(f)}if(r.length===i.length&&s.length<2&&o.length<2&&l.length<2)return t;let u=(m,f)=>b=>{let T=L(b,d,"no-duplicate",w.msg(`${m} image $1 parameter`,f));return T.suggestions=[{desc:"remove",range:[T.startIndex-1,T.endIndex],text:""}],T};for(let m of i){if(m==="invalid"||m==="width"&&p)continue;let f=r.filter(({name:b})=>b===m);m==="caption"&&(f=[...f.slice(0,-1).filter(b=>b.text()),...f.slice(-1)]),f.length>1&&t.push(...f.map(u("duplicated",m)))}return s.length>1&&t.push(...r.filter(({name:m})=>Os.has(m)).map(u("conflicting","frame"))),o.length>1&&t.push(...r.filter(({name:m})=>Hs.has(m)).map(u("conflicting","horizontal-alignment"))),l.length>1&&t.push(...r.filter(({name:m})=>Ds.has(m)).map(u("conflicting","vertical-alignment"))),t}getAllArgs(){return this.childNodes.slice(1)}getArgs(n){return this.getAllArgs().filter(({name:e})=>n===e)}getArg(n){let e=this.getArgs(n);return e[n==="manualthumb"?0:e.length-1]}getValue(n){var e;return(e=this.getArg(n))==null?void 0:e.getValue()}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e),{extension:r}=this;return r&&(t.extension=r),t}}});var Kt,oi=k(()=>{"use strict";H();D();U();si();Kt=class extends Yt{constructor(e,t,r,i=w.getConfig(),s=[]){let o;if(r!==void 0){let{length:l}=s;o=new S(r,i,s);for(let g=1;g<11;g++)o.parseOnce();s.splice(l,1)}super(t,o==null?void 0:o.toString(),i,s);re(this,"privateType","imagemap-image");this.setAttribute("bracket",!1),this.privateType=`${e}-image`,this.seal("privateType",!0)}get type(){return this.privateType}getTitle(e){let t=this.type==="imagemap-image";return this.normalizeTitle(this.firstChild.toString(),t?0:6,e,!0,!t)}getAttribute(e){return e==="padding"?0:super.getAttribute(e)}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{ns:i}=this.getAttribute("title");if(i!==6){let s=P(this,{start:e},"invalid-gallery","invalid gallery image");s.suggestions=[{desc:"prefix",range:[e,e],text:"File:"}],r.push(s)}return r}}});var mt,zs,ai,vn,Ws=k(()=>{"use strict";D();U();oi();Ye();vn=class extends S{constructor(e,t=w.getConfig(),r=[]){var i;super(void 0,t,r,{});y(this,mt);for(let s of(i=e==null?void 0:e.split(`
|
|
10
|
+
`))!=null?i:[]){let o=/^([^|]+)(?:\|(.*))?/u.exec(s);if(!o){super.insertAt(s.trim()?new J(s,t,r):s);continue}let[,l,g]=o;v(this,mt,zs).call(this,l)?super.insertAt(new Kt("gallery",l,g,t,r)):super.insertAt(new J(s,t,r))}}get type(){return"ext-inner"}get widths(){return v(this,mt,ai).call(this,"widths")}get heights(){return v(this,mt,ai).call(this,"heights")}toString(e){return super.toString(e,`
|
|
11
11
|
`)}text(){return super.text(`
|
|
12
12
|
`).replace(/\n\s*\n/gu,`
|
|
13
|
-
`)}getGaps(){return 1}lint(e=this.getAbsoluteIndex(),t){let{top:r,left:i}=this.getRootNode().posFromIndex(e),s=[];for(let o=0;o<this.length;o++){let l=this.childNodes[o],
|
|
14
|
-
`})}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return Object.assign(r,{widths:this.widths,heights:this.heights}),r}};
|
|
15
|
-
`),i=new Set(e.protocol.split("|")),s=
|
|
13
|
+
`)}getGaps(){return 1}lint(e=this.getAbsoluteIndex(),t){let{top:r,left:i}=this.getRootNode().posFromIndex(e),s=[];for(let o=0;o<this.length;o++){let l=this.childNodes[o],g=l.toString(),{length:p}=g,d=g.trim(),{type:u}=l,h=r+o,m=o?0:i;if(l.setAttribute("aIndex",e),u==="noinclude"&&d&&!/^<!--.*-->$/u.test(d)){let f=e+p;s.push({rule:"no-ignored",message:w.msg("invalid content in <$1>","gallery"),severity:d.startsWith("|")?"warning":"error",startIndex:e,endIndex:f,startLine:h,endLine:h,startCol:m,endCol:m+p,suggestions:[{desc:"remove",range:[e,f],text:""},{desc:"comment",range:[e,f],text:`<!--${g}-->`}]})}else u!=="noinclude"&&u!=="text"&&s.push(...l.lint(e,t));e+=p+1}return s}print(){return super.print({sep:`
|
|
14
|
+
`})}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return Object.assign(r,{widths:this.widths,heights:this.heights}),r}};mt=new WeakSet,zs=function(e){return this.normalizeTitle(e,6,!0,!0,!0).valid},ai=function(e){var i,s;let t=(i=this.parentNode)==null?void 0:i.getAttr(e),r=typeof t=="string"&&((s=/^(\d+)\s*(?:px)?$/u.exec(t))==null?void 0:s[1]);return r&&Number(r)||120}});var Jt,li=k(()=>{"use strict";H();Cr();Jt=class extends Pe{get type(){return"link"}lint(n=this.getAbsoluteIndex(),e){let t=super.lint(n,e);return this.closest("ext-link-text")&&t.push(P(this,{start:n},"nested-link","internal link in an external link")),t}}});var Va,Qa,Rr,Ue,wn=k(()=>{"use strict";H();ee();ne();D();U();Va=String.raw`(?:[${Ne}\t]| |�*160;|&#[xX]0*[aA]0;)`,Qa=new RegExp(`${Va}+`,"gu"),Ue=class extends S{constructor(e,t="free-ext-link",r=w.getConfig(),i){super(e,r,i,{});y(this,Rr);x(this,Rr,t)}get type(){return c(this,Rr)}get innerText(){let e=new Map([["!","|"],["=","="]]),t=ye(this.childNodes.map(r=>{let{type:i}=r,s=String(r.name);return i==="magic-word"&&e.has(s)?e.get(s):r}));return this.type==="magic-link"&&(t=t.replace(Qa," ")),t}get link(){let{innerText:e}=this;return this.type==="magic-link"?e.startsWith("ISBN")?`ISBN ${e.slice(5).replace(/[- ]/gu,"").replace(/x$/u,"X")}`:e:Ki(e)}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),i=new M(this,e),{type:s,childNodes:o}=this;if(s==="magic-link"){let{link:d}=this;if(d.startsWith("ISBN")){let u=[...d.slice(5)].map(h=>h==="X"?10:Number(h));(u.length===10&&u.reduce((h,m,f)=>h+m*(10-f),0)%11||u.length===13&&(u[12]===10||u.reduce((h,m,f)=>h+m*(f%2?3:1),0)%10))&&r.push(P(this,i,"invalid-isbn","invalid ISBN"))}return r}let l=s==="ext-link-url",g=l?/\|/u:/[,;。:!?()]+/u,p=o.find(d=>d.type==="text"&&g.test(d.data));if(p){let{data:d}=p,u=L(p,i,"unterminated-url",w.msg("$1 in URL",l?'"|"':"full-width punctuation"),"warning"),{index:h,0:m}=g.exec(d),f=u.startIndex+h;u.suggestions=l?[{desc:"whitespace",range:[f,f+1],text:" "}]:[{desc:"whitespace",range:[f,f],text:" "},{desc:"escape",range:[f,f+m.length],text:encodeURI(m)}],r.push(u)}return r}getUrl(e){{let{type:t}=this,{link:r}=this;if(t==="magic-link"){if(r.startsWith("ISBN"))return this.normalizeTitle(`BookSources/${r.slice(5)}`,-1,!0).getUrl(e);r=r.startsWith("RFC")?`https://tools.ietf.org/html/rfc${r.slice(4)}`:`https://pubmed.ncbi.nlm.nih.gov/${r.slice(5)}`}else r.startsWith("//")&&(r=`https:${r}`);return new URL(r)}}};Rr=new WeakMap});var Oe,Zt,di=k(()=>{"use strict";H();D();U();wn();Zt=class extends S{constructor(e,t="",r="",i=w.getConfig(),s=[]){super(void 0,i,s,{});y(this,Oe);let o=e&&/^\0\d+f\x7F$/u.test(e)?s[Number(e.slice(1,-2))]:new Ue(e,"ext-link-url",i,s);if(this.insertAt(o),x(this,Oe,t),r){let l=new S(r,i,s,{});l.type="ext-link-text",l.setAttribute("stage",10),this.insertAt(l)}}get type(){return"ext-link"}toString(e){return this.length===1?`[${super.toString(e)}${c(this,Oe)}]`:`[${super.toString(e,c(this,Oe))}]`}text(){return`[${super.text(" ")}]`}getAttribute(e){return e==="padding"?1:super.getAttribute(e)}getGaps(){return c(this,Oe).length}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t);return this.length===1&&this.closest("heading-title")&&r.push(P(this,{start:e},"var-anchor","variable anchor in a section header")),r}print(){return super.print(this.length===1?{pre:"[",post:`${c(this,Oe)}]`}:{pre:"[",sep:c(this,Oe),post:"]"})}};Oe=new WeakMap});var Mr,Gs=k(()=>{"use strict";U();Ye();li();di();Mr=class extends S{get type(){return"imagemap-link"}constructor(n,e,t,r,i=[]){super(void 0,r,i),this.append(n,e.length===2?new Jt(...e,r,i):new Zt(...e,r,i),new J(t,r,i))}}});var An,Vs=k(()=>{"use strict";H();ke();ne();D();U();Ye();oi();Gs();An=class extends S{get type(){return"ext-inner"}get image(){return this.childNodes.find(Qt("imagemap-image"))}constructor(n,e=w.getConfig(),t=[]){if(super(void 0,e,t,{}),!n)return;let r=n.split(`
|
|
15
|
+
`),i=new Set(e.protocol.split("|")),s=J,o=!0,l=!1;for(let g of r){let p=g.trim();if(!(l||!p||p.startsWith("#"))){if(o){let d=g.indexOf("|"),u=d===-1?g:g.slice(0,d),{valid:h,ns:m}=this.normalizeTitle(u,0,!0,!0);if(h&&m===6){let f=new Kt("imagemap",u,d===-1?void 0:g.slice(d+1),e,t);super.insertAt(f),o=!1;continue}else l=!0}else if(g.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(g);continue}else if(g.includes("[")){let d=g.indexOf("["),u=g.slice(d),h=/^\[\[([^|]+)(?:\|([^\]]+))?\]\][\w\s]*$/u.exec(u);if(h){if(this.normalizeTitle(h[1],0,!0,!0,!1,!0).valid){super.insertAt(new Mr(g.slice(0,d),h.slice(1),u.slice(u.indexOf("]]")+2),e,t));continue}}else if(i.has(u.slice(1,u.indexOf(":")+1))||i.has(u.slice(1,u.indexOf("//")+2))){let m=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(u);if(m){super.insertAt(new Mr(g.slice(0,d),m.slice(1),u.slice(u.indexOf("]")+1),e,t));continue}}}}super.insertAt(new s(g,e,t))}}toString(n){return super.toString(n,`
|
|
16
16
|
`)}text(){return super.text(`
|
|
17
17
|
`).replace(/\n{2,}/gu,`
|
|
18
|
-
`)}getGaps(){return 1}lint(n=this.getAbsoluteIndex(),e){let t=super.lint(n,e),r=new
|
|
19
|
-
`})}}});var vn,Us=k(()=>{"use strict";D();W();Qe();vn=class extends ge{get type(){return"ext-inner"}lint(n=this.getAbsoluteIndex()){let{name:e,firstChild:{data:t}}=this;if((e==="templatestyles"||e==="section")&&t){let i=P(this,{start:n},"void-ext",v.msg("nothing should be in <$1>",e));return i.fix={range:[n,i.endIndex],text:"",desc:"empty"},[i]}let r=new RegExp(String.raw`<\s*(?:/\s*)${e==="nowiki"?"":"?"}(${e})\b`,"giu");return super.lint(n,r)}}});var An={};se(An,{NestedToken:()=>li});var Ua,Rr,Jt,li,Sn=k(()=>{"use strict";D();ee();$r();hn();W();q();di();Xe();Ua=new Set(["comment","include","arg","template","magic-word"]),li=class extends S{constructor(e,t,r,i,s=[]){if(typeof t=="boolean"){let o=Symbol("InputboxToken"),{length:l}=s;s.push(o),e&&(e=dt(e,i,s,t)),e&&(e=Lr(e,i,s)),s.splice(l,1)}else e&&(e=e.replace(t,(o,l,u,p,d)=>{let g=`\0${s.length+1}e\x7F`;return new De(l,u,p,d,i,!1,s),g}));e&&(e=e.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(o,l,u)=>(new K(u,i,s),`${l}\0${s.length}n\x7F`)));super(e,i,s);T(this,Rr);T(this,Jt);b(this,Rr,[...r]),b(this,Jt,t)}get type(){return"ext-inner"}lint(e=this.getAbsoluteIndex(),t){let r=new j(this,e),i=c(this,Jt)?"includeonly":"noinclude",s=typeof c(this,Jt)=="boolean"?new RegExp(String.raw`^(?:<${i}(?:\s[^>]*)?/?>|</${i}\s*>)$`,"iu"):/^<!--[\s\S]*-->$/u;return[...super.lint(e,t),...this.childNodes.filter(o=>{let{type:l,name:u}=o;if(l==="ext")return!c(this,Rr).includes(u);if(Ua.has(l))return!1;let p=o.toString().trim();return p&&!s.test(p)}).map(o=>{let l=I(o,r,"no-ignored",v.msg("invalid content in <$1>",this.name));return l.suggestions=[{desc:"remove",range:[l.startIndex,l.endIndex],text:""},{desc:"comment",range:[l.startIndex,l.endIndex],text:`<!--${o.toString()}-->`}],l})]}};Rr=new WeakMap,Jt=new WeakMap});var zs,Gs,gi,za,De,di=k(()=>{"use strict";D();ee();W();tn();q();Xn();ln();ks();ei();Ps();Ds();Hs();Us();zs=(a,n)=>{let e=new Set(a);return e.delete(n),[...e]};Gs=[_t()];De=class extends(za=qt){get type(){return"ext"}constructor(n,e,t,r,i=v.getConfig(),s=!1,o=[]){var g;let l=n.toLowerCase(),u=new Ye(!e||/^\s/u.test(e)?e:` ${e}`,"ext-attrs",l,i,o),p={...i,ext:zs(i.ext,l),excludes:[...(g=i.excludes)!=null?g:[]]},d;switch(p.inExt=!0,l){case"tab":p.ext=zs(p.ext,"tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":l==="poem"&&p.excludes.push("heading"),d=new S(t,p,o);break;case"pre":d=new dn(t,p,o);break;case"dynamicpagelist":d=new Wt(s,t,p,o);break;case"inputbox":p.excludes.push("heading"),d=new fn(s,t,p,o);break;case"references":{let{NestedToken:f}=(Sn(),J(An));p.excludes.push("heading"),d=new f(t,s,["ref"],p,o);break}case"choose":{let{NestedToken:f}=(Sn(),J(An));d=new f(t,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],p,o);break}case"combobox":{let{NestedToken:f}=(Sn(),J(An));d=new f(t,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],p,o);break}case"gallery":d=new Tn(t,p,o);break;case"imagemap":d=new kn(t,p,o);break;default:d=new vn(t,p,o)}d.setAttribute("name",l),d.type==="plain"&&(d.type="ext-inner"),super(n,u,d,r,i,o),this.seal("closed",!0)}lint(n=this.getAbsoluteIndex(),e){let t=super.lint(n,e),r=new j(this,n);return this.name!=="nowiki"&&this.closest("html-attrs,table-attrs")&&t.push(P(this,r,"parsing-order","extension tag in HTML tag attributes")),this.name==="ref"&&this.closest("heading-title")&&t.push(P(this,r,"var-anchor","variable anchor in a section header")),t}};gi=oe(za),De=le(gi,0,"ExtToken",Gs,De),ae(gi,1,De)});var Vs,ui,Ga,mt,Qs=k(()=>{"use strict";D();st();W();Qe();Vs=[ve(!1)];mt=class extends(Ga=ge){constructor(e,t,r,i){super(e,r,i);te(this,"closed");this.closed=t}get type(){return"comment"}getAttribute(e){return e==="padding"?4:super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){if(this.closed)return[];let t=P(this,{start:e},"unclosed-comment",v.msg("unclosed $1","HTML comment"));return t.suggestions=[{range:[t.endIndex,t.endIndex],text:"-->",desc:"close"}],[t]}toString(e){return e?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"<!--",post:this.closed?"-->":""})}};ui=oe(Ga),mt=le(ui,0,"CommentToken",Vs,mt),ae(ui,1,mt)});var Js={};se(Js,{parseCommentAndExt:()=>dt});var Ks,Va,pi,Qa,Xa,Ka,Xs,dt,$r=k(()=>{"use strict";ls();Xe();gs();di();Qs();Ks="<onlyinclude>",Va="</onlyinclude>",{length:pi}=Ks,Qa=new WeakMap,Xa=new WeakMap,Ka=(a,n)=>{let e=n?Qa:Xa;if(e.has(a))return e.get(a);let t=n?"includeonly":"(?:no|only)include",r=n?"noinclude":"includeonly",i=new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${t}(?:\s[^>]*)?/?>|</${t}\s*>|<(${a.join("|")})(\s[^>]*?)?(?:/>|>([\s\S]*?)</(\1\s*)>)|<(${r})(\s[^>]*?)?(?:/>|>([\s\S]*?)(?:</(${r}\s*)>|$))`,"giu");return e.set(a,i),i},Xs=a=>{let n=a.indexOf(Ks);return{i:n,j:a.indexOf(Va,n+pi)}},dt=(a,n,e,t)=>{if(t){let{i:r,j:i}=Xs(a);if(r!==-1&&i!==-1){let s="",o=l=>{new K(l,n,e),s+=`\0${e.length-1}n\x7F`};for(;r!==-1&&i!==-1;){let l=`\0${e.length}e\x7F`;new en(a.slice(r+pi,i),n,e),r>0&&o(a.slice(0,r)),s+=l,a=a.slice(i+pi+1),{i:r,j:i}=Xs(a)}return a&&o(a),s}}return a.replace(Ka(n.ext,t),(r,i,s,o,l,u,p,d,g)=>{let f=e.length,h="n";if(i)h="e",new De(i,s,o,l,n,u,e);else if(r.startsWith("<!--")){h="c";let m=r.endsWith("-->");new mt(r.slice(4,m?-3:void 0),m,n,e)}else u?new lt(u,p,d,g,n,e):new K(r,n,e);return`\0${f}${h}\x7F`})}});var Ja,Ya,Za,Ys,Yt,Re,et,We,ci,el,ht,Zs=k(()=>{"use strict";D();ke();ee();tn();q();Ja=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),Ya=new Set(["b","big","center","cite","code","del","dfn","em","font","i","ins","kbd","mark","pre","q","s","samp","small","strike","strong","sub","sup","tt","u","var"]),Za=new Set(["strike","big","center","font","tt"]);Ys=[_t()];ht=class extends(el=S){constructor(e,t,r,i,s,o){super(void 0,s,o);T(this,Yt);T(this,Re);T(this,et);T(this,We);this.insertAt(t),this.setAttribute("name",e.toLowerCase()),b(this,Yt,r),b(this,Re,i),b(this,et,e)}get type(){return"html"}get selfClosing(){return c(this,Re)}get closing(){return c(this,Yt)}toString(e){return`<${this.closing?"/":""}${c(this,et)}${super.toString(e)}${c(this,Re)?"/":""}>`}text(){let{closing:e}=this,t=c(this,et)+(e?"":super.text());return`<${e?"/":""}${t}${c(this,Re)?"/":""}>`}getAttribute(e){return e==="padding"?c(this,et).length+(this.closing?2:1):super.getAttribute(e)}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{name:i,parentNode:s,closing:o,selfClosing:l}=this,u=new j(this,e);if(i==="h1"&&!o){let m=P(this,u,"h1","<h1>");m.suggestions=[{desc:"h2",range:[e+2,e+3],text:"2"}],r.push(m)}if(this.closest("table-attrs")){let m=P(this,u,"parsing-order","HTML tag in table attributes");m.fix={desc:"remove",range:[e,m.endIndex],text:""},r.push(m)}Za.has(i)&&r.push(P(this,u,"obsolete-tag","obsolete HTML tag","warning")),(i==="b"||i==="strong")&&this.closest("heading-title")&&r.push(P(this,u,"bold-header","bold in section header","warning"));let{html:[,p,d]}=this.getAttribute("config"),g=d.includes(i),f=p.includes(i);if(o&&(l||g)||l&&(!g&&!f)){let m=P(this,u,"unmatched-tag",o?"tag that is both closing and self-closing":"invalid self-closing tag"),x={desc:"open",range:[e+1,e+2],text:""},y={desc:"no self-closing",range:[m.endIndex-2,m.endIndex-1],text:""};f?m.suggestions=[x,y]:o?m.fix=g?x:y:m.suggestions=[y,{desc:"close",range:[m.endIndex-2,m.endIndex],text:`></${i}>`}],r.push(m)}else if(!this.findMatchingTag()){let m=P(this,u,"unmatched-tag",o?"unmatched closing tag":"unclosed tag");if(o){let x=this.closest("magic-word");x&&Ja.has(x.name)?m.severity="warning":m.suggestions=[{desc:"remove",range:[e,m.endIndex],text:""}]}else{let x=s==null?void 0:s.childNodes;Ya.has(i)&&(x!=null&&x.slice(0,x.indexOf(this)).some(({type:y,name:w})=>y==="html"&&w===i))?m.suggestions=[{desc:"close",range:[e+1,e+1],text:"/"}]:this.closest("heading-title")||(m.severity="warning")}r.push(m)}return r}findMatchingTag(){return Ne(c(this,We),()=>{let{name:e,parentNode:t,closing:r,selfClosing:i}=this,{html:[,s,o]}=this.getAttribute("config"),l=o.includes(e),u=s.includes(e);if(l||u&&i)return this;if(!t)return;let{childNodes:p}=t,d=p.indexOf(this),g=r?p.slice(0,d).reverse():p.slice(d+1),f=[this],{rev:h}=re;for(let m of g)if(!(!m.is("html")||m.name!==e||u&&c(m,Re)))if(c(m,Yt)===r)f.push(m);else{let x=f.pop();if(x===this)return m;b(x,We,[h,m]),b(m,We,[h,x])}for(let m of f)b(m,We,[h,void 0])},e=>{b(this,We,e),e[1]&&e[1]!==this&&b(e[1],We,[re.rev,this])})}print(){return super.print({pre:`<${this.closing?"/":""}${c(this,et)}`,post:`${c(this,Re)?"/":""}>`})}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return Object.assign(r,{closing:this.closing,selfClosing:c(this,Re)}),r}};ci=oe(el),Yt=new WeakMap,Re=new WeakMap,et=new WeakMap,We=new WeakMap,ht=le(ci,0,"HtmlToken",Ys,ht),ae(ci,1,ht)});var eo={};se(eo,{parseHtml:()=>rl});var tl,rl,to=k(()=>{"use strict";ln();Zs();tl=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,rl=(a,n,e)=>{var s;let{html:t}=n;(s=n.htmlElements)!=null||(n.htmlElements=new Set([...t[0],...t[1],...t[2]]));let r=a.split("<"),i=r.shift();for(let o of r){let l=tl.exec(o),u=l==null?void 0:l[2],p=u==null?void 0:u.toLowerCase();if(!l||!n.htmlElements.has(p)){i+=`<${o}`;continue}let[,d,,g="",f,h]=l,{length:m}=e,x=new Ye(g,"html-attrs",p,n,e),y=x.getAttr("itemprop");if(p==="meta"&&(y===void 0||x.getAttr("content")===void 0)||p==="link"&&(y===void 0||x.getAttr("href")===void 0)){i+=`<${o}`,e.length=m;continue}i+=`\0${e.length}x\x7F${h}`,new ht(u,x,d==="/",f==="/>",n,e)}return i}});var Zt,mi=k(()=>{"use strict";tn();W();q();Rt();ln();Zt=class extends _t(1)(S){constructor(n,e,t,r,i=v.getConfig(),s=[],o){super(void 0,i,s,o),this.append(new Ae(e,n,"table-syntax",i,s,{}),new Ye(r,"table-attrs",t,i,s))}}});var Se,jr,Br,hi,er,fi=k(()=>{"use strict";D();ee();W();q();mi();er=class extends Zt{constructor(e,t,r=v.getConfig(),i=[]){var u;let s=/\||\0\d+!\x7F/u.exec(t!=null?t:""),o=s?t.slice(0,s.index):"";/\[\[|-\{/u.test(o)&&(s=null,o="");super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",o,r,i);T(this,Br);T(this,Se,"");T(this,jr);s&&([Vr(this,Se)._]=s);let l=new S(t==null?void 0:t.slice(((u=s==null?void 0:s.index)!=null?u:NaN)+c(this,Se).length),r,i);l.type="td-inner",l.setAttribute("stage",4),this.insertAt(l)}get type(){return"td"}get rowspan(){return this.getAttr("rowspan")}get colspan(){return this.getAttr("colspan")}get subtype(){return A(this,Br,hi).call(this).subtype}afterBuild(){c(this,Se).includes("\0")&&b(this,Se,this.buildFromStr(c(this,Se),0)),super.afterBuild()}toString(e){let{childNodes:[t,r,i]}=this;return t.toString(e)+r.toString(e)+c(this,Se)+i.toString(e)}text(){let{childNodes:[e,t,r]}=this;return e.text()+t.text()+c(this,Se)+r.text()}getGaps(e){return e===1?c(this,Se).length:0}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),i=new j(this,e+this.getRelativeIndex(this.length-1));for(let s of this.lastChild.childNodes)if(s.type==="text"){let{data:o}=s;if(o.includes("|")){let l=o.includes("||"),u=I(s,i,"pipe-like",'additional "|" in a table cell',l?"error":"warning");if(l){let p={caption:"|+",td:"|",th:"!"}[this.subtype];u.fix={range:[u.startIndex,u.endIndex],text:o.replace(/\|\|/gu,`
|
|
20
|
-
${p}`),desc:"newline"}}else
|
|
21
|
-
`)}getAttr(e){let t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}print(){let{childNodes:[e,t,r]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${c(this,
|
|
22
|
-
|}`,e){let t=this.getAttribute("config"),r=this.getAttribute("accum"),i=e?[n]:
|
|
18
|
+
`)}getGaps(){return 1}lint(n=this.getAbsoluteIndex(),e){let t=super.lint(n,e),r=new M(this,n);return this.image?t.push(...this.childNodes.filter(i=>{let s=i.toString().trim();return i.type==="noinclude"&&s&&!s.startsWith("#")}).map(i=>{let s=L(i,r,"invalid-imagemap","invalid link in <imagemap>");return s.suggestions=[{desc:"remove",range:[s.startIndex-1,s.endIndex],text:""},{desc:"comment",range:[s.startIndex,s.startIndex],text:"# "}],s})):t.push(P(this,r,"invalid-imagemap","<imagemap> without an image")),t}print(){return super.print({sep:`
|
|
19
|
+
`})}}});var Sn,Qs=k(()=>{"use strict";H();D();Xe();Sn=class extends he{get type(){return"ext-inner"}lint(n=this.getAbsoluteIndex()){let{name:e,firstChild:{data:t}}=this;if((e==="templatestyles"||e==="section")&&t){let i=P(this,{start:n},"void-ext",w.msg("nothing should be in <$1>",e));return i.fix={range:[n,i.endIndex],text:"",desc:"empty"},[i]}let r=new RegExp(String.raw`<\s*(?:/\s*)${e==="nowiki"?"":"?"}(${e})\b`,"giu");return super.lint(n,r)}}});var Cn={};de(Cn,{NestedToken:()=>gi});var Xa,jr,er,gi,In=k(()=>{"use strict";H();ne();Nr();xn();D();U();ui();Ye();Xa=new Set(["comment","include","arg","template","magic-word"]),gi=class extends S{constructor(e,t,r,i,s=[]){if(typeof t=="boolean"){let o=Symbol("InputboxToken"),{length:l}=s;s.push(o),e&&(e=ut(e,i,s,t)),e&&(e=Pr(e,i,s)),s.splice(l,1)}else e&&(e=e.replace(t,(o,l,g,p,d)=>{let u=`\0${s.length+1}e\x7F`;return new He(l,g,p,d,i,!1,s),u}));e&&(e=e.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(o,l,g)=>(new J(g,i,s),`${l}\0${s.length}n\x7F`)));super(e,i,s);y(this,jr);y(this,er);x(this,jr,[...r]),x(this,er,t)}get type(){return"ext-inner"}lint(e=this.getAbsoluteIndex(),t){let r=new M(this,e),i=c(this,er)?"includeonly":"noinclude",s=typeof c(this,er)=="boolean"?new RegExp(String.raw`^(?:<${i}(?:\s[^>]*)?/?>|</${i}\s*>)$`,"iu"):/^<!--[\s\S]*-->$/u;return[...super.lint(e,t),...this.childNodes.filter(o=>{let{type:l,name:g}=o;if(l==="ext")return!c(this,jr).includes(g);if(Xa.has(l))return!1;let p=o.toString().trim();return p&&!s.test(p)}).map(o=>{let l=L(o,r,"no-ignored",w.msg("invalid content in <$1>",this.name));return l.suggestions=[{desc:"remove",range:[l.startIndex,l.endIndex],text:""},{desc:"comment",range:[l.startIndex,l.endIndex],text:`<!--${o.toString()}-->`}],l})]}};jr=new WeakMap,er=new WeakMap});var Xs,Ys,pi,Ya,He,ui=k(()=>{"use strict";H();ne();D();sn();U();Kn();un();Ss();ri();_s();Ws();Vs();Qs();Xs=(a,n)=>{let e=new Set(a);return e.delete(n),[...e]};Ys=[Ot()];He=class extends(Ya=Ut){get type(){return"ext"}constructor(n,e,t,r,i=w.getConfig(),s=!1,o=[]){var u;let l=n.toLowerCase(),g=new Ze(!e||/^\s/u.test(e)?e:` ${e}`,"ext-attrs",l,i,o),p={...i,ext:Xs(i.ext,l),excludes:[...(u=i.excludes)!=null?u:[]]},d;switch(p.inExt=!0,l){case"tab":p.ext=Xs(p.ext,"tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":l==="poem"&&p.excludes.push("heading"),d=new S(t,p,o);break;case"pre":d=new pn(t,p,o);break;case"dynamicpagelist":d=new Wt(s,t,p,o);break;case"inputbox":p.excludes.push("heading"),d=new Tn(s,t,p,o);break;case"references":{let{NestedToken:h}=(In(),Z(Cn));p.excludes.push("heading"),d=new h(t,s,["ref"],p,o);break}case"choose":{let{NestedToken:h}=(In(),Z(Cn));d=new h(t,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],p,o);break}case"combobox":{let{NestedToken:h}=(In(),Z(Cn));d=new h(t,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],p,o);break}case"gallery":d=new vn(t,p,o);break;case"imagemap":d=new An(t,p,o);break;default:d=new Sn(t,p,o)}d.setAttribute("name",l),d.type==="plain"&&(d.type="ext-inner"),super(n,g,d,r,i,o),this.seal("closed",!0)}lint(n=this.getAbsoluteIndex(),e){let t=super.lint(n,e),r=new M(this,n);return this.name!=="nowiki"&&this.closest("html-attrs,table-attrs")&&t.push(P(this,r,"parsing-order","extension tag in HTML tag attributes")),this.name==="ref"&&this.closest("heading-title")&&t.push(P(this,r,"var-anchor","variable anchor in a section header")),t}};pi=ge(Ya),He=pe(pi,0,"ExtToken",Ys,He),ue(pi,1,He)});var Ks,ci,Ka,ft,Js=k(()=>{"use strict";H();at();D();Xe();Ks=[ve(!1)];ft=class extends(Ka=he){constructor(e,t,r,i){super(e,r,i);re(this,"closed");this.closed=t}get type(){return"comment"}getAttribute(e){return e==="padding"?4:super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){if(this.closed)return[];let t=P(this,{start:e},"unclosed-comment",w.msg("unclosed $1","HTML comment"));return t.suggestions=[{range:[t.endIndex,t.endIndex],text:"-->",desc:"close"}],[t]}toString(e){return e?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"<!--",post:this.closed?"-->":""})}};ci=ge(Ka),ft=pe(ci,0,"CommentToken",Ks,ft),ue(ci,1,ft)});var to={};de(to,{parseCommentAndExt:()=>ut});var eo,Ja,hi,Za,el,tl,Zs,ut,Nr=k(()=>{"use strict";ps();Ye();hs();ui();Js();eo="<onlyinclude>",Ja="</onlyinclude>",{length:hi}=eo,Za=new WeakMap,el=new WeakMap,tl=(a,n)=>{let e=n?Za:el;if(e.has(a))return e.get(a);let t=n?"includeonly":"(?:no|only)include",r=n?"noinclude":"includeonly",i=new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${t}(?:\s[^>]*)?/?>|</${t}\s*>|<(${a.join("|")})(\s[^>]*?)?(?:/>|>([\s\S]*?)</(\1\s*)>)|<(${r})(\s[^>]*?)?(?:/>|>([\s\S]*?)(?:</(${r}\s*)>|$))`,"giu");return e.set(a,i),i},Zs=a=>{let n=a.indexOf(eo);return{i:n,j:a.indexOf(Ja,n+hi)}},ut=(a,n,e,t)=>{if(t){let{i:r,j:i}=Zs(a);if(r!==-1&&i!==-1){let s="",o=l=>{new J(l,n,e),s+=`\0${e.length-1}n\x7F`};for(;r!==-1&&i!==-1;){let l=`\0${e.length}e\x7F`;new nn(a.slice(r+hi,i),n,e),r>0&&o(a.slice(0,r)),s+=l,a=a.slice(i+hi+1),{i:r,j:i}=Zs(a)}return a&&o(a),s}}return a.replace(tl(n.ext,t),(r,i,s,o,l,g,p,d,u)=>{let h=e.length,m="n";if(i)m="e",new He(i,s,o,l,n,g,e);else if(r.startsWith("<!--")){m="c";let f=r.endsWith("-->");new ft(r.slice(4,f?-3:void 0),f,n,e)}else g?new gt(g,p,d,u,n,e):new J(r,n,e);return`\0${h}${m}\x7F`})}});var rl,nl,il,ro,tr,Me,rt,De,mi,sl,bt,no=k(()=>{"use strict";H();ke();ne();sn();U();rl=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),nl=new Set(["b","big","center","cite","code","del","dfn","em","font","i","ins","kbd","mark","pre","q","s","samp","small","strike","strong","sub","sup","tt","u","var"]),il=new Set(["strike","big","center","font","tt"]);ro=[Ot()];bt=class extends(sl=S){constructor(e,t,r,i,s,o){super(void 0,s,o);y(this,tr);y(this,Me);y(this,rt);y(this,De);this.insertAt(t),this.setAttribute("name",e.toLowerCase()),x(this,tr,r),x(this,Me,i),x(this,rt,e)}get type(){return"html"}get selfClosing(){return c(this,Me)}get closing(){return c(this,tr)}toString(e){return`<${this.closing?"/":""}${c(this,rt)}${super.toString(e)}${c(this,Me)?"/":""}>`}text(){let{closing:e}=this,t=c(this,rt)+(e?"":super.text());return`<${e?"/":""}${t}${c(this,Me)?"/":""}>`}getAttribute(e){return e==="padding"?c(this,rt).length+(this.closing?2:1):super.getAttribute(e)}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{name:i,parentNode:s,closing:o,selfClosing:l}=this,g=new M(this,e);if(i==="h1"&&!o){let f=P(this,g,"h1","<h1>");f.suggestions=[{desc:"h2",range:[e+2,e+3],text:"2"}],r.push(f)}if(this.closest("table-attrs")){let f=P(this,g,"parsing-order","HTML tag in table attributes");f.fix={desc:"remove",range:[e,f.endIndex],text:""},r.push(f)}il.has(i)&&r.push(P(this,g,"obsolete-tag","obsolete HTML tag","warning")),(i==="b"||i==="strong")&&this.closest("heading-title")&&r.push(P(this,g,"bold-header","bold in section header","warning"));let{html:[,p,d]}=this.getAttribute("config"),u=d.includes(i),h=p.includes(i);if(o&&(l||u)||l&&(!u&&!h)){let f=P(this,g,"unmatched-tag",o?"tag that is both closing and self-closing":"invalid self-closing tag"),b={desc:"open",range:[e+1,e+2],text:""},T={desc:"no self-closing",range:[f.endIndex-2,f.endIndex-1],text:""};h?f.suggestions=[b,T]:o?f.fix=u?b:T:f.suggestions=[T,{desc:"close",range:[f.endIndex-2,f.endIndex],text:`></${i}>`}],r.push(f)}else if(!this.findMatchingTag()){let f=P(this,g,"unmatched-tag",o?"unmatched closing tag":"unclosed tag");if(o){let b=this.closest("magic-word");b&&rl.has(b.name)?f.severity="warning":f.suggestions=[{desc:"remove",range:[e,f.endIndex],text:""}]}else{let b=s==null?void 0:s.childNodes;nl.has(i)&&(b!=null&&b.slice(0,b.indexOf(this)).some(({type:T,name:C})=>T==="html"&&C===i))?f.suggestions=[{desc:"close",range:[e+1,e+1],text:"/"}]:this.closest("heading-title")||(f.severity="warning")}r.push(f)}return r}findMatchingTag(){return Le(c(this,De),()=>{let{name:e,parentNode:t,closing:r,selfClosing:i}=this,{html:[,s,o]}=this.getAttribute("config"),l=o.includes(e),g=s.includes(e);if(l||g&&i)return this;if(!t)return;let{childNodes:p}=t,d=p.indexOf(this),u=r?p.slice(0,d).reverse():p.slice(d+1),h=[this],{rev:m}=oe;for(let f of u)if(!(!f.is("html")||f.name!==e||g&&c(f,Me)))if(c(f,tr)===r)h.push(f);else{let b=h.pop();if(b===this)return f;x(b,De,[m,f]),x(f,De,[m,b])}for(let f of h)x(f,De,[m,void 0])},e=>{x(this,De,e),e[1]&&e[1]!==this&&x(e[1],De,[oe.rev,this])})}print(){return super.print({pre:`<${this.closing?"/":""}${c(this,rt)}`,post:`${c(this,Me)?"/":""}>`})}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return Object.assign(r,{closing:this.closing,selfClosing:c(this,Me)}),r}};mi=ge(sl),tr=new WeakMap,Me=new WeakMap,rt=new WeakMap,De=new WeakMap,bt=pe(mi,0,"HtmlToken",ro,bt),ue(mi,1,bt)});var io={};de(io,{parseHtml:()=>al});var ol,al,so=k(()=>{"use strict";un();no();ol=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,al=(a,n,e)=>{var s;let{html:t}=n;(s=n.htmlElements)!=null||(n.htmlElements=new Set([...t[0],...t[1],...t[2]]));let r=a.split("<"),i=r.shift();for(let o of r){let l=ol.exec(o),g=l==null?void 0:l[2],p=g==null?void 0:g.toLowerCase();if(!l||!n.htmlElements.has(p)){i+=`<${o}`;continue}let[,d,,u="",h,m]=l,{length:f}=e,b=new Ze(u,"html-attrs",p,n,e),T=b.getAttr("itemprop");if(p==="meta"&&(T===void 0||b.getAttr("content")===void 0)||p==="link"&&(T===void 0||b.getAttr("href")===void 0)){i+=`<${o}`,e.length=f;continue}i+=`\0${e.length}x\x7F${m}`,new bt(g,b,d==="/",h==="/>",n,e)}return i}});var rr,fi=k(()=>{"use strict";sn();D();U();_t();un();rr=class extends Ot(1)(S){constructor(n,e,t,r,i=w.getConfig(),s=[],o){super(void 0,i,s,o),this.append(new we(e,n,"table-syntax",i,s,{}),new Ze(r,"table-attrs",t,i,s))}}});var Ae,_r,qr,bi,nr,xi=k(()=>{"use strict";H();ne();D();U();fi();nr=class extends rr{constructor(e,t,r=w.getConfig(),i=[]){var g;let s=/\||\0\d+!\x7F/u.exec(t!=null?t:""),o=s?t.slice(0,s.index):"";/\[\[|-\{/u.test(o)&&(s=null,o="");super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",o,r,i);y(this,qr);y(this,Ae,"");y(this,_r);s&&([Xr(this,Ae)._]=s);let l=new S(t==null?void 0:t.slice(((g=s==null?void 0:s.index)!=null?g:NaN)+c(this,Ae).length),r,i);l.type="td-inner",l.setAttribute("stage",4),this.insertAt(l)}get type(){return"td"}get rowspan(){return this.getAttr("rowspan")}get colspan(){return this.getAttr("colspan")}get subtype(){return v(this,qr,bi).call(this).subtype}afterBuild(){c(this,Ae).includes("\0")&&x(this,Ae,this.buildFromStr(c(this,Ae),0)),super.afterBuild()}toString(e){let{childNodes:[t,r,i]}=this;return t.toString(e)+r.toString(e)+c(this,Ae)+i.toString(e)}text(){let{childNodes:[e,t,r]}=this;return e.text()+t.text()+c(this,Ae)+r.text()}getGaps(e){return e===1?c(this,Ae).length:0}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),i=new M(this,e+this.getRelativeIndex(this.length-1));for(let s of this.lastChild.childNodes)if(s.type==="text"){let{data:o}=s;if(o.includes("|")){let l=o.includes("||"),g=L(s,i,"pipe-like",'additional "|" in a table cell',l?"error":"warning");if(l){let p={caption:"|+",td:"|",th:"!"}[this.subtype];g.fix={range:[g.startIndex,g.endIndex],text:o.replace(/\|\|/gu,`
|
|
20
|
+
${p}`),desc:"newline"}}else g.suggestions=[{desc:"escape",range:[g.startIndex,g.endIndex],text:o.replace(/\|/gu,"|")}];r.push(g)}}return r}isIndependent(){return this.firstChild.text().startsWith(`
|
|
21
|
+
`)}getAttr(e){let t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}print(){let{childNodes:[e,t,r]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${c(this,Ae)}${r.print()}</span>`}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return Object.assign(r,{subtype:this.subtype,rowspan:this.rowspan,colspan:this.colspan}),r}};Ae=new WeakMap,_r=new WeakMap,qr=new WeakSet,bi=function(){return Le(c(this,_r),()=>{var o;let e=this.firstChild.text(),t=e.slice(-1),r="td";if(t==="!"?r="th":t==="+"&&(r="caption"),this.isIndependent())return{subtype:r};let{previousSibling:i}=this;return{...v(o=i,qr,bi).call(o)}},e=>{x(this,_r,e)})}});var ir,Ti=k(()=>{"use strict";H();fi();xi();ir=class extends rr{lint(n=this.getAbsoluteIndex(),e){let t=super.lint(n,e),r=this.childNodes.find(({type:l})=>l==="table-inter");if(!r)return t;let i=r.childNodes.find(l=>l.text().trim()),s=/^\s*(?:!|\{\{\s*![!-]?\s*\}\})/u;if(!i||s.test(i.toString())||i.is("arg")&&s.test(i.default||""))return t;if(i.is("magic-word"))try{if(i.getPossibleValues().every(l=>s.test(l.text())))return t}catch(l){}let o=L(r,{start:n},"fostered-content","content to be moved out from the table");return o.severity=i.type==="template"?"warning":"error",o.startIndex++,o.startLine++,o.startCol=0,t.push(o),t}getRowCount(){return Number(this.childNodes.some(n=>n instanceof nr&&n.isIndependent()&&!n.firstChild.text().endsWith("+")))}}});var ll,dl,gl,yi,$n,oo=k(()=>{"use strict";H();ke();ne();D();Ti();_t();ll=/^\n[^\S\n]*(?:\|\}|\{\{\s*!\s*\}\}\}|\{\{\s*!\)\s*\}\})$/u,dl=(a,n)=>new Array(a).fill(void 0).map((e,t)=>n(t)),gl=({type:a})=>a==="tr"||a==="table-syntax",yi=class extends Array{},$n=class extends ir{get type(){return"table"}get closed(){return this.lastChild.type==="table-syntax"}constructor(n,e,t,r){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,n,"table",e,t,r,{})}lint(n=this.getAbsoluteIndex(),e){let t=super.lint(n,e),r=new M(this,n);this.closed||t.push(L(this.firstChild,r,"unclosed-table",w.msg("unclosed $1","table")));let i=this.getLayout(),{length:s}=i;if(s>1){let o=1,l=1/0,g=0;for(;g<s;g++){let p=i[g],d=p.length;if(d<o)break;d<l&&(l=d);let u=p.indexOf(p[d-1])+1;if(u>l)break;u>o&&(o=u)}if(g<s){let p=L(this.getNthRow(g),r,"table-layout","inconsistent table layout","warning");p.startIndex++,p.startLine++,p.startCol=0,t.push(p)}}return t}close(n=`
|
|
22
|
+
|}`,e){let t=this.getAttribute("config"),r=this.getAttribute("accum"),i=e?[n]:w.parse(n,this.getAttribute("include"),2,t).childNodes;oe.run(()=>{let s=new we(void 0,ll,"table-syntax",t,r);super.insertAt(s)}),this.lastChild.replaceChildren(...i)}getLayout(n){let e=this.getAllRows(),{length:t}=e,r=new yi(...dl(t,()=>[]));for(let i=0;i<r.length;i++){let s=r[i],o=0,l=0,g;for(let p of e[i].childNodes.slice(2))if(p.type==="td"){if(p.isIndependent()&&(g=p.subtype!=="caption"),g){let d={row:i,column:o},{rowspan:u,colspan:h}=p;for(o++;s[l];)l++;for(let m=i;m<Math.min(i+u,t);m++)for(let f=l;f<l+h;f++)r[m][f]=d;l+=h}}else if(gl(p))break}return r}getAllRows(){return[...super.getRowCount()?[this]:[],...this.childNodes.slice(1).filter(n=>n.type==="tr"&&n.getRowCount()>0)]}getNthRow(n,e,t){let r=super.getRowCount();if(n===0&&r)return this;r&&n--;for(let i of this.childNodes.slice(2)){let{type:s}=i;if(s==="tr"&&i.getRowCount()&&(n--,n<0))return i}}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e);return t.closed=this.closed,t}}});var Nn,ao=k(()=>{"use strict";Ti();Nn=class extends ir{get type(){return"tr"}constructor(n,e,t,r){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,n,"tr",e,t,r)}}});var sr,ki=k(()=>{"use strict";Xe();sr=class extends he{get indent(){return this.innerText.split(":").length-1}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e),{indent:r}=this;return r&&(t.indent=r),t}}});var or,vi=k(()=>{"use strict";ki();or=class extends sr{get type(){return"dd"}}});var go={};de(go,{parseTable:()=>pl});var ul,lo,pl,uo=k(()=>{"use strict";U();oo();ao();xi();vi();ul=a=>a.lastChild.constructor!==S,lo=(a,n)=>a.type==="td"?n.pop():a,pl=({firstChild:{data:a},type:n,name:e},t,r)=>{let i=[],s=a.split(`
|
|
23
23
|
`),o=n==="root"||n==="parameter-value"||n==="ext-inner"&&e==="poem"?"":`
|
|
24
|
-
${s.shift()}`,l,
|
|
25
|
-
${d}${
|
|
26
|
-
${p}`;continue}let
|
|
27
|
-
${p}`,l),i.push(l);continue}let[,
|
|
28
|
-
${d}${
|
|
29
|
-
${d}${
|
|
30
|
-
${d}${y}`,M=F=>{let Q=new er(O,w.slice(L,$==null?void 0:$.index),t,r);return F.insertAt(Q),Q};for(;$;)M(l),{lastIndex:L}=C,[O]=$,$=C.exec(w);i.push(l,M(l))}}return o.slice(1)}});var $n,ao=k(()=>{"use strict";Qe();$n=class extends ge{get type(){return"hr"}}});var lo,ki,ll,ft,go=k(()=>{"use strict";st();Qe();lo=[ve()];ft=class extends(ll=ge){get type(){return"double-underscore"}constructor(n,e,t,r){super(n,t,r)}getAttribute(n){return n==="padding"?2:super.getAttribute(n)}toString(){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}};ki=oe(ll),ft=le(ki,0,"DoubleUnderscoreToken",lo,ft),ae(ki,1,ft)});var uo={};se(uo,{parseHrAndDoubleUnderscore:()=>dl});var dl,po=k(()=>{"use strict";ao();go();ti();dl=({firstChild:{data:a},type:n,name:e},t,r)=>{var l,u,p;let{doubleUnderscore:[i,s,o]}=t;return(l=t.insensitiveDoubleUnderscore)!=null||(t.insensitiveDoubleUnderscore=new Set(i)),(u=t.sensitiveDoubleUnderscore)!=null||(t.sensitiveDoubleUnderscore=new Set(s)),(p=t.regexHrAndDoubleUnderscore)!=null||(t.regexHrAndDoubleUnderscore=new RegExp(`__(${[...i,...s].join("|")})__`,"giu")),n!=="root"&&(n!=="ext-inner"||e!=="poem")&&(a=`\0${a}`),a=a.replace(/^((?:\0\d+[cno]\x7F)*)(-{4,})/gmu,(d,g,f)=>(new $n(f,t,r),`${g}\0${r.length-1}r\x7F`)).replace(t.regexHrAndDoubleUnderscore,(d,g)=>{var x;let f=t.sensitiveDoubleUnderscore.has(g),h=g.toLowerCase(),m=t.insensitiveDoubleUnderscore.has(h);return f||m?(new ft(g,f,t,r),`\0${r.length-1}${m&&((x=o==null?void 0:o[h])!=null?x:h)==="toc"?"u":"n"}\x7F`):d}).replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(d,g,f,h,m)=>{let x=`${g}\0${r.length}h\x7F`;return new Ut(f.length,[h,m],t,r),x}),n==="root"||n==="ext-inner"&&e==="poem"?a:a.slice(1)}});var In,co=k(()=>{"use strict";D();ee();W();Qe();In=class extends ge{get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}text(){let{parentNode:n,innerText:e}=this;return(n==null?void 0:n.type)==="image-parameter"&&n.name!=="caption"?"":e}lint(n=this.getAbsoluteIndex()){let{previousSibling:e,nextSibling:t,bold:r}=this,i=v.msg('lonely "$1"',"'"),s=[],o=new j(this,n),l=(u,p,d)=>[{desc:"escape",range:[u,p],text:"'".repeat(d)},{desc:"remove",range:[u,p],text:""}];if((e==null?void 0:e.type)==="text"&&e.data.endsWith("'")){let u=P(this,o,"lonely-apos",i),{startIndex:p,startLine:d,startCol:g}=u,[,{length:f}]=/(?:^|[^'])('+)$/u.exec(e.data),h=n-f;s.push({...u,startIndex:h,endIndex:p,endLine:d,startCol:g-f,endCol:g,suggestions:l(h,p,f)})}if((t==null?void 0:t.type)==="text"&&t.data.startsWith("'")){let u=P(this,o,"lonely-apos",i),{endIndex:p,endLine:d,endCol:g}=u,[{length:f}]=/^'+/u.exec(t.data),h=p+f;s.push({...u,startIndex:p,endIndex:h,startLine:d,startCol:g,endCol:g+f,suggestions:l(p,h,f)})}if(r&&this.closest("heading-title")){let u=P(this,o,"bold-header","bold in section header","warning");u.suggestions=[{desc:"remove",range:[n,n+3],text:""}],s.push(u)}return s}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e);return Object.assign(t,{bold:this.bold,italic:this.italic}),t}}});var mo={};se(mo,{parseQuotes:()=>vi});var vi,Ai=k(()=>{"use strict";co();vi=(a,n,e,t)=>{var d;let r=a.split(/('{2,})/u),{length:i}=r;if(i===1)return a;let s=0,o=0,l,u,p;for(let g=1;g<i;g+=2){let f=r[g].length;switch(f){case 2:o++;break;case 4:r[g-1]+="'",r[g]="'''";case 3:if(s++,l!==void 0)break;r[g-1].endsWith(" ")?u===void 0&&p===void 0&&(p=g):r[g-1].slice(-2,-1)===" "?l=g:u!=null||(u=g);break;default:r[g-1]+="'".repeat(f-5),r[g]="'''''",o++,s++}}if(o%2===1&&s%2===1){let g=(d=l!=null?l:u)!=null?d:p;g!==void 0&&(r[g]="''",r[g-1]+="'")}for(let g=1;g<i;g+=2)new In(r[g],n,e),r[g]=`\0${e.length-1}q\x7F`;return r.join("")}});var ho={};se(ho,{parseExternalLinks:()=>Si});var Si,wi=k(()=>{"use strict";Y();ai();yn();Si=(a,n,e,t)=>{var r;return(r=n.regexExternalLinks)!=null||(n.regexExternalLinks=new RegExp(String.raw`\[(\0\d+f\x7F|(?:(?:${n.protocol}|//)${je}|\0\d+m\x7F)${Be}(?=[[\]<>"\t${Ie}]|\0\d))([${Ie}]*(?![${Ie}]))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),a.replace(n.regexExternalLinks,(i,s,o,l)=>{let{length:u}=e,p=/&[lg]t;/u.exec(s);return p&&(o="",l=s.slice(p.index)+o+l,s=s.slice(0,p.index)),t?(new Oe(s,"ext-link-url",n,e),`[\0${u}f\x7F${o}${l}]`):(new Kt(s,o,l,n,e),`\0${u}w\x7F`)})}});var Nn,fo=k(()=>{"use strict";Y();Sr();Nn=class extends Fe{get type(){return"category"}get sortkey(){let{childNodes:[,n]}=this;return n&&it(n.text())}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e),{sortkey:r}=this;return r&&(t.sortkey=r),t}}});var bo={};se(bo,{parseLinks:()=>xo});var gl,xo,To=k(()=>{"use strict";W();Ai();wi();oi();ni();fo();gl=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)([\s\S]*)$/u,xo=(a,n,e,t)=>{var o;(o=n.regexLinks)!=null||(n.regexLinks=new RegExp(String.raw`^\s*(?:${n.protocol}|//)`,"iu"));let r=n.inExt?/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]]))?\]\]([\s\S]*)$/u:/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]])?)?\]\]([\s\S]*)$/u,i=a.split("[["),s=i.shift();for(let l=0;l<i.length;l++){let u=!1,p,d,g,f,h=i[l],m=r.exec(h);if(m)[,p,d,g,f]=m,f.startsWith("]")&&(g!=null&&g.includes("["))&&(g+="]",f=f.slice(1));else{let $=gl.exec(h);$&&(u=!0,[,p,d,g]=$)}if(p===void 0||n.regexLinks.test(p)||/\0\d+[exhbru]\x7F/u.test(p)){s+=`[[${h}`;continue}let x=p.trim().startsWith(":");if(x&&u){s+=`[[${h}`;continue}let{ns:y,valid:w}=v.normalizeTitle(p,0,!1,n,!0,!0,!0,!0);if(w){if(u){if(y!==6){s+=`[[${h}`;continue}let $=!1;for(l++;l<i.length;l++){let L=i[l],O=L.split("]]");if(O.length>2){$=!0,g+=`[[${O[0]}]]${O[1]}`,f=O.slice(2).join("]]");break}else if(O.length===2)g+=`[[${O[0]}]]${O[1]}`;else{g+=`[[${L}`;break}}if(g=xo(g,n,e,t),!$){s+=`[[${p}${d}${g}`;continue}}}else{s+=`[[${h}`;continue}g&&(g=vi(g,n,e,t));let C=Xt;x||(y===6?(g&&(g=Si(g,n,e,!0)),C=Vt):y===14&&(C=Nn)),g===void 0&&d&&(g=""),s+=`\0${e.length}l\x7F${f}`,new C(p,g,n,e,d)}return s}});var So={};se(So,{parseMagicLinks:()=>ul});var Ao,yo,ko,vo,ul,wo=k(()=>{"use strict";Y();yn();Ao=String.raw`[${Ie}\t]| |�*160;|�*a0;`,yo=`(?:${Ao})+`,ko=`(?:${Ao}|-)`,vo=String.raw`(?:RFC|PMID)${yo}\d+\b|ISBN${yo}(?:97[89]${ko}?)?(?:\d${ko}?){9}[\dx]\b`,ul=(a,n,e)=>{if(!n.regexMagicLinks)try{n.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\d_])(?:(?:${n.protocol})(${je}${Be})|${vo})`,"giu")}catch(t){n.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${n.protocol})(${je}${Be})|${vo})`,"giu")}return a.replace(n.regexMagicLinks,(t,r,i)=>{let s=r?t.slice(r.length):t;if(i){let o="",l=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(s);l&&(o=s.slice(l.index),s=s.slice(0,l.index));let u=s.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,p=u.exec(s);if(p){let d=1;p[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(s.slice(0,p.index))&&(d=2),o=s.slice(p.index+d)+o,s=s.slice(0,p.index+d)}return o.length>=i.length?t:(new Oe(s,void 0,n,e),`${r}\0${e.length-1}w\x7F${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(s))return t;return new Oe(s,"magic-link",n,e),`${r}\0${e.length-1}i\x7F`})}});var Co,$o=k(()=>{"use strict";Co=(a,n)=>a.startsWith(n)?n.length:[...n].findIndex((e,t)=>e!==a[t])});var En,Io=k(()=>{"use strict";Ti();En=class extends rr{get type(){return"list"}}});var No={};se(No,{parseList:()=>pl});var pl,Eo=k(()=>{"use strict";$o();Io();yi();pl=(a,n,e,t)=>{let r=/^((?:\0\d+[cno]\x7F)*)([;:*#]+\s*)/u.exec(a);if(!r)return n.lastPrefix="",a;let[i,s,o]=r,l=o.replace(/;/gu,":"),u=Co(l,n.lastPrefix),p=(u>1?o.slice(u-1):o).split(/(?=;)/u),d=p[0].startsWith(";"),g=p.length-(d?0:1);if(u>1){let F=o.slice(0,u-1);d?p.unshift(F):p[0]=F+p[0]}n.lastPrefix=l;let f=s+p.map((F,Q)=>`\0${t.length+Q}d\x7F`).join("")+a.slice(i.length);for(let F of p)new En(F,e,t);if(!g)return f;let{html:[h]}=e,m=/:+|-\{|\0\d+[xq]\x7F/gu,x=m,y=x.exec(f),w=0,C=!1,$=!1,L=0,O=(F,Q)=>(new nr(F,e,t),`${f.slice(0,Q)}\0${t.length-1}d\x7F${f.slice(Q+F.length)}`),M=F=>{F?w&&w--:w++};for(;y&&g;){let{0:F,index:Q}=y;if(F==="-{"){if(!L){let{lastIndex:R}=x;x=/-\{|\}-/gu,x.lastIndex=R}L++}else if(F==="}-"){if(L--,!L){let{lastIndex:R}=x;x=m,x.lastIndex=R}}else if(F.endsWith("x\x7F")){let{name:R,closing:H,selfClosing:G}=t[Number(F.slice(1,-2))];(!G||h.includes(R))&&M(H)}else if(F.endsWith("q\x7F")){let{bold:R,italic:H}=t[Number(F.slice(1,-2))];R&&(M(C),C=!C),H&&(M($),$=!$)}else if(w===0){if(F.length>=g)return O(F.slice(0,g),Q);g-=F.length,x.lastIndex=Q+4+String(t.length).length,f=O(F,Q)}y=x.exec(f)}return f}});var Lo,He,Ln,Fo=k(()=>{"use strict";D();ee();q();_e();Lo=new Set(["A","T","R","D","-","H","N"]),Ln=class extends S{constructor(e,t,r=[]){super(void 0,t,r,{});T(this,He);this.append(...e.map(i=>new V(i,"converter-flag",t,r)))}get type(){return"converter-flags"}afterBuild(){b(this,He,this.childNodes.map(e=>e.text().trim())),super.afterBuild()}toString(e){return super.toString(e,";")}text(){return super.text(";")}getGaps(){return 1}getUnknownFlags(){return new Set(c(this,He).filter(e=>/\{{3}[^{}]+\}{3}/u.test(e)))}getVariantFlags(){let e=new Set(this.getAttribute("config").variants);return new Set(c(this,He).filter(t=>e.has(t)))}lint(e=this.getAbsoluteIndex(),t){let r=this.getVariantFlags(),i=this.getUnknownFlags(),s=new Set(c(this,He).filter(d=>Lo.has(d))),o=c(this,He).filter(d=>!d).length,l=c(this,He).length-i.size-o,u=super.lint(e,t);if(r.size===l||s.size===l)return u;let p=new j(this,e);for(let d=0;d<this.length;d++){let g=this.childNodes[d],f=g.text().trim();if(f&&!r.has(f)&&!i.has(f)&&(r.size>0||!s.has(f))){let h=I(g,p,"no-ignored","invalid conversion flag");r.size===0&&Lo.has(f.toUpperCase())?h.fix={range:[h.startIndex,h.endIndex],text:f.toUpperCase(),desc:"uppercase"}:h.suggestions=[{desc:"remove",range:[h.startIndex-(d&&1),h.endIndex],text:""}],u.push(h)}}return u}print(){return super.print({sep:";"})}};He=new WeakMap});var ir,Po=k(()=>{"use strict";W();q();_e();ir=class extends S{get type(){return"converter-rule"}get variant(){var n,e;return(e=(n=this.childNodes[this.length-2])==null?void 0:n.text().trim())!=null?e:""}constructor(n,e=!0,t=v.getConfig(),r=[]){super(void 0,t,r);let i=n.indexOf(":"),s=n.slice(0,i).indexOf("=>"),o=s===-1?n.slice(0,i):n.slice(s+2,i);e&&t.variants.includes(o.trim())?(super.insertAt(new V(o,"converter-rule-variant",t,r)),super.insertAt(new V(n.slice(i+1),"converter-rule-to",t,r)),s!==-1&&super.insertAt(new V(n.slice(0,s),"converter-rule-from",t,r),0)):super.insertAt(new V(n,"converter-rule-to",t,r))}toString(n){let{childNodes:e,firstChild:t,lastChild:r}=this;return e.length===3?`${t.toString(n)}=>${e[1].toString(n)}:${r.toString(n)}`:super.toString(n,":")}text(){let{childNodes:n,firstChild:e,lastChild:t}=this;return n.length===3?`${e.text()}=>${n[1].text()}:${t.text()}`:super.text(":")}getGaps(n){return n===0&&this.length===3?2:1}print(){let{childNodes:n}=this;if(n.length===3){let[e,t,r]=n;return`<span class="wpb-converter-rule">${e.print()}=>${t.print()}:${r.print()}</span>`}return super.print({sep:":"})}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e);return t.variant=this.variant,t}}});var Fn,Ro=k(()=>{"use strict";Y();q();Fo();Po();Fn=class extends S{get type(){return"converter"}constructor(n,e,t,r=[]){super(void 0,t,r),this.append(new Ln(n,t,r));let[i]=e,s=i.includes(":"),o=new ir(i,s,t,r);s&&o.length===1||!s&&e.length===2&&!de(e[1]).trim()?this.insertAt(new ir(e.join(";"),!1,t,r)):this.append(o,...e.slice(1).map(l=>new ir(l,!0,t,r)))}toString(n){let{childNodes:[e,...t]}=this;return`-{${e.toString(n)}${e.length>0?"|":""}${t.map(r=>r.toString(n)).join(";")}}-`}text(){let{childNodes:[n,...e]}=this;return`-{${n.text()}|${ye(e,";")}}-`}getAttribute(n){return n==="padding"?2:super.getAttribute(n)}getGaps(n){return n||this.firstChild.length>0?1:0}print(){let{childNodes:[n,...e]}=this;return`<span class="wpb-converter">-{${n.print()}${n.length>0?"|":""}${qe(e,{sep:";"})}}-</span>`}}});var jo={};se(jo,{parseConverter:()=>cl});var cl,Bo=k(()=>{"use strict";Ro();cl=(a,n,e)=>{var l;(l=n.regexConverter)!=null||(n.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${n.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"u"));let t=/-\{/gu,r=/-\{|\}-/gu,i=[],s=t,o=s.exec(a);for(;o;){let{0:u,index:p}=o;if(u==="}-"){let d=i.pop(),{length:g}=e,f=a.slice(d.index+2,p),h=f.indexOf("|"),[m,x]=h===-1?[[],f]:[f.slice(0,h).split(";"),f.slice(h+1)],y=x.replace(/(&[#a-z\d]+);/giu,"$1"),w=y.split(n.regexConverter).map(C=>C.replace(/\x01/gu,";"));new Fn(m,w,n,e),a=`${a.slice(0,d.index)}\0${g}v\x7F${a.slice(p+2)}`,i.length===0&&(s=t),s.lastIndex=d.index+3+String(g).length}else i.push(o),s=r,s.lastIndex=p+2;o=s.exec(a)}return a}});var Or={};se(Or,{Token:()=>S});var qr,we,U,X,xt,sr,_r,z,qo,_o,Oo,Mo,Do,Wo,Ho,Uo,zo,Go,Vo,Qo,Ci,S,q=k(()=>{"use strict";Y();D();W();Yi();ts();Ci=class Ci extends Kr{constructor(e,t=v.getConfig(),r=[],i){super();T(this,z);T(this,qr,"plain");T(this,we,0);T(this,U);T(this,X);T(this,xt);T(this,sr,!1);T(this,_r);typeof e=="string"&&this.insertAt(e),b(this,U,t),b(this,X,r),r.push(this)}get type(){return c(this,qr)}set type(e){b(this,qr,e)}parseOnce(e=c(this,we),t=!1,r){if(e<c(this,we)||this.length===0||!this.getAttribute("plain"))return this;if(c(this,we)>=11)return this;switch(e){case 0:if(this.type==="root"){c(this,X).pop();let i=A(this,z,qo).call(this);t&&(t=!i)}b(this,xt,t),A(this,z,_o).call(this,t);break;case 1:A(this,z,Oo).call(this);break;case 2:A(this,z,Mo).call(this);break;case 3:A(this,z,Do).call(this);break;case 4:A(this,z,Wo).call(this);break;case 5:A(this,z,Ho).call(this,r);break;case 6:A(this,z,Uo).call(this,r);break;case 7:A(this,z,zo).call(this);break;case 8:A(this,z,Go).call(this);break;case 9:A(this,z,Vo).call(this);break;case 10:A(this,z,Qo).call(this)}if(this.type==="root")for(let i of c(this,X))i==null||i.parseOnce(e,t,r);return Vr(this,we)._++,this}buildFromStr(e,t){let r=e.split(/[\0\x7F]/u).map((i,s)=>{if(s%2===0)return new vr(i);if(isNaN(i.slice(-1)))return c(this,X)[Number(i.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${i}`)});return t===0?r.map(String).join(""):t===1?ye(r):r}build(){b(this,we,11);let{length:e,firstChild:t}=this,r=t==null?void 0:t.toString();if(e===1&&t.type==="text"&&r.includes("\0")&&(this.replaceChildren(...this.buildFromStr(r)),this.normalize(),this.type==="root"))for(let i of c(this,X))i==null||i.build()}afterBuild(){if(this.type==="root")for(let e of c(this,X))e==null||e.afterBuild();b(this,sr,!0)}parse(e=11,t,r){for(e=Math.min(e,11);c(this,we)<e;)this.parseOnce(c(this,we),t,r);return e&&(this.build(),this.afterBuild()),this}getAttribute(e){var t;switch(e){case"plain":return this.constructor===Ci;case"config":return c(this,U);case"include":return(t=c(this,xt))!=null?t:!!c(this.getRootNode(),xt);case"accum":return c(this,X);case"built":return c(this,sr);default:return super.getAttribute(e)}}setAttribute(e,t){switch(e){case"stage":c(this,we)===0&&this.type==="root"&&c(this,X).shift(),b(this,we,t);break;default:super.setAttribute(e,t)}}insertAt(e,t=this.length){let r=typeof e=="string"?new vr(e):e;super.insertAt(r,t);let{type:i}=r;return i==="root"&&(r.type="plain"),r}normalizeTitle(e,t=0,r,i,s,o){return v.normalizeTitle(e,t,c(this,xt),c(this,U),r,i,s,o)}lint(e=this.getAbsoluteIndex(),t){var i;let r=super.lint(e,t);if(this.type==="root"){let s=new Map,o="category,html-attr#id,ext-attr#id,table-attr#id";for(let g of this.querySelectorAll(o)){let f;if(g.type==="category")f=g.name;else{let h=g.getValue();h&&h!==!0&&(f=`#${h}`)}if(f){let h=s.get(f);h?h.add(g):s.set(f,new Set([g]))}}for(let[g,f]of s)if(f.size>1&&!g.startsWith("#mw-customcollapsible-")){let h=!g.startsWith("#"),m=`duplicated ${h?"category":"id"}`,x=h?"error":"warning";r.push(...[...f].map(y=>{let w=P(y,{start:y.getAbsoluteIndex()},"no-duplicate",m,x);return h&&(w.suggestions=[{desc:"remove",range:[w.startIndex,w.endIndex],text:""}]),w}))}let l=/<!--\s*lint-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->/gu,u=this.toString(),p=[],d=l.exec(u);for(;d;){let{1:g,index:f}=d,h=(i=d[2])==null?void 0:i.trim();p.push({line:this.posFromIndex(f).top+(g==="disable-line"?0:1),from:g==="disable"?l.lastIndex:void 0,to:g==="enable"?l.lastIndex:void 0,rules:h?new Set(h.split(",").map(m=>m.trim())):void 0}),d=l.exec(u)}r=r.filter(({rule:g,startLine:f,startIndex:h})=>{let m={pos:0};for(let{line:x,from:y,to:w,rules:C}of p){if(x>f+1)break;if(C&&!C.has(g))continue;if(x===f&&y===void 0&&w===void 0)return!1;y<=h&&y>m.pos?(m.pos=y,m.type="from"):w<=h&&w>m.pos&&(m.pos=w,m.type="to")}return m.type!=="from"})}return r}toString(e,t){return e?super.toString(!0,t):Ne(c(this,_r),()=>super.toString(!1,t),r=>{let i=this.getRootNode();i.type==="root"&&c(i,sr)&&b(this,_r,r)})}};qr=new WeakMap,we=new WeakMap,U=new WeakMap,X=new WeakMap,xt=new WeakMap,sr=new WeakMap,_r=new WeakMap,z=new WeakSet,qo=function(){let{parseRedirect:e}=(as(),J(os)),t=this.firstChild.toString(),r=e(t,c(this,U),c(this,X));return r&&this.setText(r),!!r},_o=function(e){let{parseCommentAndExt:t}=($r(),J(Js));this.setText(t(this.firstChild.toString(),c(this,U),c(this,X),e))},Oo=function(){let{parseBraces:e}=(hn(),J(Fs)),t=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,r=e(t,c(this,U),c(this,X));this.setText(this.type==="root"?r:r.slice(1))},Mo=function(){var t;if((t=c(this,U).excludes)!=null&&t.includes("html"))return;let{parseHtml:e}=(to(),J(eo));this.setText(e(this.firstChild.toString(),c(this,U),c(this,X)))},Do=function(){var t;if((t=c(this,U).excludes)!=null&&t.includes("table"))return;let{parseTable:e}=(oo(),J(so));this.setText(e(this,c(this,U),c(this,X)))},Wo=function(){var t;if((t=c(this,U).excludes)!=null&&t.includes("hr"))return;let{parseHrAndDoubleUnderscore:e}=(po(),J(uo));this.setText(e(this,c(this,U),c(this,X)))},Ho=function(e){let{parseLinks:t}=(To(),J(bo));this.setText(t(this.firstChild.toString(),c(this,U),c(this,X),e))},Uo=function(e){var i;if((i=c(this,U).excludes)!=null&&i.includes("quote"))return;let{parseQuotes:t}=(Ai(),J(mo)),r=this.firstChild.toString().split(`
|
|
31
|
-
`);for(let s=0;s<r.length;s++)r[s]=t(r[s],c(this,
|
|
32
|
-
`))},
|
|
33
|
-
`),o={lastPrefix:""},l=r==="root"||r==="ext-inner"&&i==="poem"?0:1;for(;l<s.length;l++)s[l]=e(s[l],o,c(this,
|
|
34
|
-
`))},Qo=function(){if(c(this,U).variants.length>0){let{parseConverter:e}=(Bo(),J(jo));this.setText(e(this.firstChild.toString(),c(this,U),c(this,X)))}};S=Ci});var re,zt,Un,Yr,ke=k(()=>{"use strict";re={running:!1,run(a){let{running:n}=this;this.running=!0;try{let{Token:e}=(q(),J(Or)),t=a();return t instanceof e&&!t.getAttribute("built")&&t.afterBuild(),this.running=n,t}catch(e){throw this.running=n,e}},rev:0},zt=a=>n=>n.type===a,Un=(a,n,e,t=[])=>{var s,o;let r=a.getChildNodes(),i=r.splice(n,e,...t);for(let l=0;l<t.length;l++){let u=t[l];u.setAttribute("parentNode",a),u.setAttribute("nextSibling",r[n+l+1]),u.setAttribute("previousSibling",r[n+l-1])}return(s=r[n-1])==null||s.setAttribute("nextSibling",r[n]),(o=r[n+t.length])==null||o.setAttribute("previousSibling",r[n+t.length-1]),i},Yr=(a,n)=>{Object.defineProperty(a,"name",{value:n.name})}});var Xo={};se(Xo,{Title:()=>$i});var Mr,Dr,Ce,or,bt,$i,Ko=k(()=>{"use strict";Y();$i=class{constructor(n,e,t,r,i,s){T(this,Mr);T(this,Dr);T(this,Ce);T(this,or);T(this,bt);te(this,"valid");te(this,"encoded",!1);let o=n.trim().startsWith("../");if(i&&n.includes("%"))try{let u=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(n);n=Ge(n),this.encoded=u}catch(u){}if(n=it(n).replace(/[_ ]+/gu," ").trim(),o)b(this,or,0);else{let u=e;n.startsWith(":")&&(u=0,n=n.slice(1).trim());let p=n.split(":");if(p.length>1){let d=p[0].trim().toLowerCase(),g=Object.prototype.hasOwnProperty.call(t.nsid,d)&&t.nsid[d];g&&(u=g,n=p.slice(1).join(":").trim())}b(this,or,u)}let l=n.indexOf("#");if(l!==-1){let u=n.slice(l).trim().slice(1);if(u.includes("%"))try{u=Ge(u)}catch(p){}b(this,bt,u.replace(/ /gu,"_")),n=n.slice(0,l).trim()}this.valid=!!(n||s&&this.ns===0&&c(this,bt)!==void 0)&&it(n)===n&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(o?/^(?:\.\.\/)+(.*)/u.exec(n)[1]:n),this.main=n,b(this,Dr,t.namespaces),b(this,Ce,t.articlePath||"/wiki/$1"),c(this,Ce).includes("$1")||b(this,Ce,c(this,Ce)+`${c(this,Ce).endsWith("/")?"":"/"}$1`),r||Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}})}get ns(){return c(this,or)}get fragment(){return c(this,bt)}get main(){return c(this,Mr)}set main(n){n=n.replace(/_/gu," ").trim(),b(this,Mr,n&&n[0].toUpperCase()+n.slice(1))}get prefix(){let n=c(this,Dr)[this.ns];return n+(n&&":")}get title(){return this.getRedirection()[1]}get extension(){let{main:n}=this,e=n.lastIndexOf(".");return e===-1?void 0:n.slice(e+1).toLowerCase()}getRedirection(){return[!1,(this.prefix+this.main).replace(/ /gu,"_")]}setFragment(n){b(this,bt,n)}getUrl(n){{typeof n=="string"&&(b(this,Ce,n||"/wiki/$1"),c(this,Ce).includes("$1")||b(this,Ce,c(this,Ce)+`${c(this,Ce).endsWith("/")?"":"/"}$1`));let{title:e,fragment:t}=this;return e?c(this,Ce).replace("$1",encodeURIComponent(e)+(t?`#${encodeURIComponent(t)}`:"")):t===void 0?"":`#${encodeURIComponent(t)}`}}};Mr=new WeakMap,Dr=new WeakMap,Ce=new WeakMap,or=new WeakMap,bt=new WeakMap});var oa={};se(oa,{LanguageService:()=>Ii,tasks:()=>ea});var ea,ml,hl,fl,xl,ta,bl,Tl,yl,Jo,zr,ra,ar,ce,Yo,na,Wr,Hr,lr,Pn,Zo,be,tt,Ue,ze,gr,Gr,ur,pr,cr,B,Ur,$e,Ni,ia,Ei,sa,Li,dr,Ii,aa=k(()=>{"use strict";_n();Yn();D();Y();W();ea=new WeakMap,ml=new Set(["ref"]),hl=new Set(["ref","references"]),fl=new Set(["name","extends","follow"]),xl=new Set(["group"]),ta=new Set(["arg-name","template-name","magic-word-name","link-target","parameter-key"]),bl=new Set(["ext","html","attr-key","image-parameter","heading-title","heading",...ta]),Tl=new Set(["text","comment","noinclude","include"]),yl=["ext","html","table"].map(a=>`${a}-attr#style`).join(),Jo=a=>a.every(({type:n})=>Tl.has(n)),zr=(a,n)=>{let{top:e,left:t}=a.posFromIndex(n);return{line:e,character:t}},ra=(a,n,e)=>({start:zr(a,n),end:zr(a,e)}),ar=a=>{let{top:n,left:e,height:t,width:r}=a.getBoundingClientRect();return{start:{line:n,character:e},end:$t(n,e,t,r)}},ce=(a,n,e,{line:t,character:r},i,s)=>[...new Set(a)].map(o=>{var u;let l=(u=s==null?void 0:s(o))==null?void 0:u.description;return{label:o,kind:n,textEdit:{range:{start:{line:t,character:r-e.length},end:{line:t,character:r}},newText:o+(i!=null?i:"")},...l&&{documentation:{kind:"markdown",value:l}}}}),Yo=(a,n,{line:e,character:t})=>{let r=a.indexFromPos(e,t);return a.caretPositionFromIndex(r+Number(/\w/u.test(n.charAt(r))))},na=(a,n,e)=>{let{type:t,parentNode:r={}}=a,{name:i,tag:s}=r;return t==="attr-value"&&n.has(s)&&e.has(i)?a.toString().trim():NaN},Wr=a=>na(a,ml,fl),Hr=a=>na(a,hl,xl),lr=(a,n)=>{let e=a==null?void 0:a.getAttr(n);return e!==!0&&e||!1},Pn=a=>{let{type:n,name:e,parentNode:t}=a;switch(n){case"heading":return a.level;case"heading-title":return t.level;case"parameter-key":return`${t.parentNode.name}|${t.name}`;case"ext":case"html":case"image-parameter":return e;default:return t.name}},Zo=(a,n,e=!1)=>({range:ra(a,...n.range),newText:n.text,title:`${e?"Fix":"Suggestion"}: ${n.desc}`,fix:e}),Ii=class{constructor(n){T(this,B);T(this,be);T(this,tt);T(this,Ue);T(this,ze);T(this,gr);T(this,Gr);T(this,ur);T(this,pr);T(this,cr);te(this,"include",!0);te(this,"data");ea.set(n,this)}destroy(){Object.setPrototypeOf(this,null)}async provideDocumentColors(n,e,t=!0){let r=await A(this,B,$e).call(this,e);return r.querySelectorAll("attr-value,parameter-value,arg-default").reverse().flatMap(({type:i,childNodes:s})=>i!=="attr-value"&&!Jo(s)?[]:s.filter(o=>o.type==="text").reverse().flatMap(o=>{let l=Ui(o.data,t).filter(([,,,p])=>p);if(l.length===0)return[];let u=o.getAbsoluteIndex();return l.map(([p,d,g])=>{let f=n(p);return f.length===4&&{color:{red:f[0]/255,green:f[1]/255,blue:f[2]/255,alpha:f[3]},range:ra(r,u+d,u+g)}}).filter(Boolean)}))}provideColorPresentations(n){let{color:{red:e,green:t,blue:r,alpha:i},range:s}=n,o=`#${hr(e)}${hr(t)}${hr(r)}${i<1?hr(i):""}`;return[{label:o,textEdit:{range:s,newText:o}}]}async provideCompletionItems(n,e){var C,$,L,O,M,F,Q;let{re:t,allTags:r,functions:i,switches:s,protocols:o,params:l,tags:u,ext:p}=A(this,B,sa).call(this),{line:d,character:g}=e,f=n.split(/\r?\n/u,d+1)[d],h=t.exec((C=f==null?void 0:f.slice(0,g))!=null?C:"");if((h==null?void 0:h[1])!==void 0){let R=h[1].startsWith("/");return ce(r,"Class",h[1].slice(R?1:0),e,R&&!(f!=null&&f.slice(g).trim().startsWith(">"))?">":"")}else{if(h!=null&&h[4])return ce(s,"Constant",h[4],e,"",R=>this.data&&A(this,B,Li).call(this,R.slice(2,-2)));if((h==null?void 0:h[5])!==void 0)return ce(o,"Reference",h[5],e)}let m=await A(this,B,$e).call(this,n),x;if(h!=null&&h[2]){x=m.elementFromPoint(h.index+h[2].length-1,d);let R=($=h[3])!=null?$:"";if(h[2]==="{{{")return ce(m.querySelectorAll("arg").filter(E=>E.name&&E!==x).map(({name:E})=>E),"Variable",R,e);let H=R.startsWith(":"),G=H?R.slice(1).trimStart():R;return h[2]==="[["?ce(m.querySelectorAll("link,file,category,redirect-target").filter(E=>E!==x).map(({name:E})=>E),"Folder",G,e):[...ce(i,"Function",R,e,"",E=>this.data&&A(this,B,dr).call(this,E.replace(/^#/u,"").toLowerCase())),...R.startsWith("#")?[]:ce(m.querySelectorAll("template").filter(E=>E!==x).map(E=>{let{name:_}=E;if(H)return _;let{ns:N}=E.getAttribute("title");return N===0?`:${_}`:N===10?_.slice(9):_}),"Folder",G,e)]}let y,w;if((h==null?void 0:h[7])===void 0&&(x=m.elementFromPoint(g,d),{type:y,parentNode:w}=x),(h==null?void 0:h[6])!==void 0||y==="image-parameter"){let R=m.indexFromPos(d,g),H=(O=(L=h==null?void 0:h[6])==null?void 0:L.trimStart())!=null?O:c(this,be).slice(x.getAbsoluteIndex(),R).trimStart(),G=c(this,be).charAt(R)==="=";return[...ce(l,"Property",H,e).filter(({label:E})=>!G||!/[= ]$/u.test(E)),...ce(m.querySelectorAll("image-parameter#width").filter(E=>E!==x).map(E=>E.text()),"Unit",H,e)]}else if((h==null?void 0:h[7])!==void 0||y==="attr-key"){let R=(F=(M=h==null?void 0:h[7])==null?void 0:M.toLowerCase())!=null?F:w.tag,H=(Q=h==null?void 0:h[9])!=null?Q:x.toString().slice(0,g-m.posFromIndex(x.getAbsoluteIndex()).left);if(!u.has(R))return;let G=on[R],E=an[R],_=E&&ce(E,"Field",H,e);return p.includes(R)&&!G?_:[..._!=null?_:[],...R==="meta"||R==="link"?[]:ce(sn,"Property",H,e),...G?ce(G,"Property",H,e):[],...ce(["data-"],"Variable",H,e),...ce(["xmlns:"],"Interface",H,e)]}else if(y==="parameter-key"||y==="parameter-value"&&w.anon){let R=w.parentNode,{type:H,name:G}=R;if(H==="magic-word"&&G!=="invoke")return;let E=m.indexFromPos(d,g),_=c(this,be).slice(x.getAbsoluteIndex(),E).trimStart(),[N,ue]=H==="magic-word"?R.getModule():[];return _?ce(m.querySelectorAll("parameter").filter(ie=>{if(ie===w||ie.anon||ie.parentNode.type!==H||ie.parentNode.name!==G)return!1;if(H==="template")return!0;let[me,pe]=ie.parentNode.getModule();return me===N&&pe===ue}).map(({name:ie})=>ie),"Variable",_,e,y==="parameter-value"?"=":""):void 0}}async provideDiagnostics(n,e=!0){let t=await A(this,B,$e).call(this,n),r=t.lint();return[(e?r:r.filter(({severity:l})=>l==="error")).map(({startLine:l,startCol:u,endLine:p,endCol:d,severity:g,rule:f,message:h,fix:m,suggestions:x})=>({range:{start:{line:l,character:u},end:{line:p,character:d}},severity:g==="error"?1:2,source:"WikiLint",code:f,message:h,data:[...m?[Zo(t,m,!0)]:[],...x?x.map(y=>Zo(t,y)):[]]})),[],[]].flat(2)}async provideFoldingRanges(n){let e=await A(this,B,$e).call(this,n),{length:t}=e.getLines(),r=[],i=new Array(6),s=e.querySelectorAll("heading-title,table,template,magic-word");for(let o of[...s].reverse())o.getRelativeIndex();for(let o of s){let{offsetHeight:l}=o;if(o.type==="heading-title"||l>2){let{top:u}=e.posFromIndex(o.getAbsoluteIndex());if(o.type==="heading-title"){let{level:p}=o.parentNode;for(let d=p-1;d<6;d++){let g=i[d];g!==void 0&&g<u-1&&r.push({startLine:g,endLine:u-1,kind:"region"}),i[d]=void 0}i[p-1]=u+l-1}else r.push({startLine:u,endLine:u+l-2,kind:"region"})}}for(let o of i)o!==void 0&&o<t-1&&r.push({startLine:o,endLine:t-1,kind:"region"});return r}async provideLinks(n){let{articlePath:e,protocol:t}=v.getConfig(),r=e==null?void 0:e.includes("//"),i=new RegExp(`^(?:${t}|//)`,"iu");return(await A(this,B,$e).call(this,n)).querySelectorAll(`magic-link,ext-link-url,free-ext-link,attr-value,image-parameter#link${r?",link-target,template-name,invoke-module":""}`).reverse().map(s=>{let{type:o,parentNode:l,firstChild:u,lastChild:p,childNodes:d,length:g}=s,{name:f,tag:h}=l;if(!(o!=="attr-value"||f==="src"&&["templatestyles","img"].includes(h)||f==="cite"&&["blockquote","del","ins","q"].includes(h))||!Jo(d))return!1;let m=d.filter(x=>x.type==="text").map(({data:x})=>x).join("").trim();if(!m)return!1;try{if(s.is("magic-link")||s.is("ext-link-url")||s.is("free-ext-link"))m=s.getUrl(e);else if(o==="link-target"&&(l.is("link")||l.is("redirect-target")||l.is("category"))){if(m.startsWith("/"))return!1;m=l.link.getUrl(e)}else if(o==="template-name")m=l.getAttribute("title").getUrl(e);else if(["link-target","invoke-module"].includes(o)||o==="attr-value"&&f==="src"&&h==="templatestyles"||o==="image-parameter"&&!i.test(m)){if(!r||m.startsWith("/"))return!1;let x=0;o==="attr-value"?x=10:o==="invoke-module"&&(x=828);let y=v.normalizeTitle(m,x,!1,void 0,!0);if(!y.valid)return!1;m=y.getUrl()}if(typeof m=="string"&&m.startsWith("//")&&(m=`https:${m}`),m=new URL(m).href,o==="image-parameter"){let x=u.getBoundingClientRect(),{top:y,left:w,height:C,width:$}=g===1?x:p.getBoundingClientRect();return{range:{start:{line:x.top,character:x.left},end:$t(y,w,C,$)},target:m}}return{range:ar(s),target:m}}catch(x){return!1}}).filter(Boolean)}async provideReferences(n,e){let t=await A(this,B,$e).call(this,n),{offsetNode:r,offset:i}=Yo(t,c(this,be),e),s=r.type==="text"?r.parentNode:r,o=i===0&&(s.type==="ext-attr-dirty"||s.type==="html-attr-dirty")?s.parentNode.parentNode:s,{type:l}=o,u=Wr(o),p=Hr(o);if(!u&&!p&&!bl.has(l))return;let d=Pn(o),g=t.querySelectorAll(l==="heading-title"?"heading":l).filter(f=>l==="attr-value"?Wr(f)===u||Hr(f)===p:Pn(f)===d).reverse().map(f=>({range:ar(f.type==="parameter-key"?f.parentNode:f)}));return g.length===0?void 0:g}async provideDefinition(n,e){let t=await A(this,B,$e).call(this,n),r=t.elementFromPoint(e.character,e.line),i=r.is("ext")&&r.name==="ref"?r:r.closest("ext#ref"),s=lr(i,"name");if(!s)return;let o=lr(i,"group"),l=t.querySelectorAll("ext#ref").filter(u=>u.innerText&&lr(u,"name")===s&&lr(u,"group")===o).reverse().map(({lastChild:u})=>({range:ar(u)}));return l.length===0?void 0:l}async resolveRenameLocation(n,e){let t=await A(this,B,$e).call(this,n),r=t.elementFromPoint(e.character,e.line),{type:i}=r,s=Wr(r),o=Hr(r);return!s&&!o&&(!ta.has(i)||i==="parameter-key"&&/^[1-9]\d*$/u.test(r.parentNode.name)||i==="link-target"&&!["link","redirect-target"].includes(r.parentNode.type))?void 0:ar(r)}async provideRenameEdits(n,e,t){let r=await A(this,B,$e).call(this,n),i=r.elementFromPoint(e.character,e.line),{type:s}=i,o=Wr(i),l=o&&lr(i.parentNode.parentNode,"group"),u=Hr(i),p=Pn(i),d=r.querySelectorAll(s).filter(g=>{let{type:f}=g.parentNode;return s==="link-target"&&f!=="link"&&f!=="redirect-target"?!1:s==="attr-value"?Hr(g)===u||Wr(g)===o&&lr(g.parentNode.parentNode,"group")===l:Pn(g)===p});return d.length===0?void 0:{changes:{"":d.reverse().map(g=>({range:ar(g),newText:t}))}}}async provideHover(n,e){if(!this.data)return;let t=await A(this,B,$e).call(this,n),{offsetNode:r,offset:i}=Yo(t,c(this,be),e),s=r.type==="text"?r.parentNode:r,{type:o,parentNode:l,length:u,name:p}=s,d,g,f;if(s.is("double-underscore")&&i>0)d=A(this,B,Li).call(this,s.innerText.toLowerCase());else if(o==="magic-word-name")d=A(this,B,dr).call(this,l.name),g=s.toString(!0).trim();else if(s.is("magic-word")&&!s.modifier&&u===1&&(i>0||t.posFromIndex(s.getAbsoluteIndex()).left===e.character))d=A(this,B,dr).call(this,p),g=s.firstChild.toString(!0).trim();else if((s.is("magic-word")||s.is("template"))&&s.modifier&&i>=2&&s.getRelativeIndex(0)>i&&(g=s.modifier.trim().slice(0,-1),d=A(this,B,dr).call(this,g.toLowerCase()),d)){let h=s.getAbsoluteIndex();f={start:zr(t,h+2),end:zr(t,h+s.modifier.trimEnd().length+1)}}return d&&{contents:{kind:"markdown",value:(d.signatures?`${d.signatures.map(h=>`- **{{ ${g}${h.length===0?"**":":** "}${h.map(({label:m,const:x})=>x?m:`*${m}*`).join(" **|** ")} **}}**`).join(`
|
|
24
|
+
${s.shift()}`,l,g=(p,d)=>{if(!d){o+=p;return}let{lastChild:u}=d;if(ul(d)){let h=new S(p,t,r);h.type="table-inter",h.setAttribute("stage",3),d.insertAt(h)}else u.setText(u.toString()+p)};for(let p of s){l=i.pop();let[d]=/^(?:\s|\0\d+[cno]\x7F)*/u.exec(p),u=p.slice(d.length),h=/^(:*)((?:\s|\0\d+[cn]\x7F)*)(\{\||\{(?:\0\d+[cn]\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(u);if(h){for(;l&&l.type!=="td";)l=i.pop();let[,I,A,$,j]=h;I&&new or(I,t,r),g(`
|
|
25
|
+
${d}${I&&`\0${r.length-1}d\x7F`}${A}\0${r.length}b\x7F`,l),i.push(...l?[l]:[],new $n($,j,t,r));continue}else if(!l){o+=`
|
|
26
|
+
${p}`;continue}let m=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(u);if(!m){g(`
|
|
27
|
+
${p}`,l),i.push(l);continue}let[,f,b,T,C]=m;if(f){for(;l.type!=="table";)l=i.pop();l.close(`
|
|
28
|
+
${d}${f}`,!0),g(C,i[i.length-1])}else if(b){l=lo(l,i),l.type==="tr"&&(l=i.pop());let I=new Nn(`
|
|
29
|
+
${d}${b}`,C,t,r);i.push(l,I),l.insertAt(I)}else{l=lo(l,i);let I=T==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu,A=I.exec(C),$=0,j=`
|
|
30
|
+
${d}${T}`,O=F=>{let X=new nr(j,C.slice($,A==null?void 0:A.index),t,r);return F.insertAt(X),X};for(;A;)O(l),{lastIndex:$}=I,[j]=A,A=I.exec(C);i.push(l,O(l))}}return o.slice(1)}});var Ln,po=k(()=>{"use strict";Xe();Ln=class extends he{get type(){return"hr"}}});var co,wi,cl,xt,ho=k(()=>{"use strict";at();Xe();co=[ve()];xt=class extends(cl=he){get type(){return"double-underscore"}constructor(n,e,t,r){var l,g;super(n,t,r);let i=n.toLowerCase(),{doubleUnderscore:[,,s,o]}=t;this.setAttribute("name",(g=e?(l=o==null?void 0:o[n])==null?void 0:l.toLowerCase():s==null?void 0:s[i])!=null?g:i)}getAttribute(n){return n==="padding"?2:super.getAttribute(n)}toString(){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}};wi=ge(cl),xt=pe(wi,0,"DoubleUnderscoreToken",co,xt),ue(wi,1,xt)});var mo={};de(mo,{parseHrAndDoubleUnderscore:()=>hl});var hl,fo=k(()=>{"use strict";po();ho();ni();hl=({firstChild:{data:a},type:n,name:e},t,r)=>{var l,g,p;let{doubleUnderscore:[i,s,o]}=t;return(l=t.insensitiveDoubleUnderscore)!=null||(t.insensitiveDoubleUnderscore=new Set(i)),(g=t.sensitiveDoubleUnderscore)!=null||(t.sensitiveDoubleUnderscore=new Set(s)),(p=t.regexHrAndDoubleUnderscore)!=null||(t.regexHrAndDoubleUnderscore=new RegExp(`__(${[...i,...s].join("|")})__`,"giu")),n!=="root"&&(n!=="ext-inner"||e!=="poem")&&(a=`\0${a}`),a=a.replace(/^((?:\0\d+[cno]\x7F)*)(-{4,})/gmu,(d,u,h)=>(new Ln(h,t,r),`${u}\0${r.length-1}r\x7F`)).replace(t.regexHrAndDoubleUnderscore,(d,u)=>{var b;let h=t.sensitiveDoubleUnderscore.has(u),m=u.toLowerCase(),f=t.insensitiveDoubleUnderscore.has(m);return h||f?(new xt(u,h,t,r),`\0${r.length-1}${f&&((b=o==null?void 0:o[m])!=null?b:m)==="toc"?"u":"n"}\x7F`):d}).replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(d,u,h,m,f)=>{let b=`${u}\0${r.length}h\x7F`;return new Vt(h.length,[m,f],t,r),b}),n==="root"||n==="ext-inner"&&e==="poem"?a:a.slice(1)}});var En,bo=k(()=>{"use strict";H();ne();D();Xe();En=class extends he{get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}text(){let{parentNode:n,innerText:e}=this;return(n==null?void 0:n.type)==="image-parameter"&&n.name!=="caption"?"":e}lint(n=this.getAbsoluteIndex()){let{previousSibling:e,nextSibling:t,bold:r}=this,i=w.msg('lonely "$1"',"'"),s=[],o=new M(this,n),l=(g,p,d)=>[{desc:"escape",range:[g,p],text:"'".repeat(d)},{desc:"remove",range:[g,p],text:""}];if((e==null?void 0:e.type)==="text"&&e.data.endsWith("'")){let g=P(this,o,"lonely-apos",i),{startIndex:p,startLine:d,startCol:u}=g,[,{length:h}]=/(?:^|[^'])('+)$/u.exec(e.data),m=n-h;s.push({...g,startIndex:m,endIndex:p,endLine:d,startCol:u-h,endCol:u,suggestions:l(m,p,h)})}if((t==null?void 0:t.type)==="text"&&t.data.startsWith("'")){let g=P(this,o,"lonely-apos",i),{endIndex:p,endLine:d,endCol:u}=g,[{length:h}]=/^'+/u.exec(t.data),m=p+h;s.push({...g,startIndex:p,endIndex:m,startLine:d,startCol:u,endCol:u+h,suggestions:l(p,m,h)})}if(r&&this.closest("heading-title")){let g=P(this,o,"bold-header","bold in section header","warning");g.suggestions=[{desc:"remove",range:[n,n+3],text:""}],s.push(g)}return s}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e);return Object.assign(t,{bold:this.bold,italic:this.italic}),t}}});var xo={};de(xo,{parseQuotes:()=>Ai});var Ai,Si=k(()=>{"use strict";bo();Ai=(a,n,e,t)=>{var d;let r=a.split(/('{2,})/u),{length:i}=r;if(i===1)return a;let s=0,o=0,l,g,p;for(let u=1;u<i;u+=2){let h=r[u].length;switch(h){case 2:o++;break;case 4:r[u-1]+="'",r[u]="'''";case 3:if(s++,l!==void 0)break;r[u-1].endsWith(" ")?g===void 0&&p===void 0&&(p=u):r[u-1].slice(-2,-1)===" "?l=u:g!=null||(g=u);break;default:r[u-1]+="'".repeat(h-5),r[u]="'''''",o++,s++}}if(o%2===1&&s%2===1){let u=(d=l!=null?l:g)!=null?d:p;u!==void 0&&(r[u]="''",r[u-1]+="'")}for(let u=1;u<i;u+=2)new En(r[u],n,e),r[u]=`\0${e.length-1}q\x7F`;return r.join("")}});var To={};de(To,{parseExternalLinks:()=>Ci});var Ci,Ii=k(()=>{"use strict";ee();di();wn();Ci=(a,n,e,t)=>{var r;return(r=n.regexExternalLinks)!=null||(n.regexExternalLinks=new RegExp(String.raw`\[(\0\d+f\x7F|(?:(?:${n.protocol}|//)${je}|\0\d+m\x7F)${_e}(?=[[\]<>"\t${Ne}]|\0\d))([${Ne}]*(?![${Ne}]))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),a.replace(n.regexExternalLinks,(i,s,o,l)=>{let{length:g}=e,p=/&[lg]t;/u.exec(s);return p&&(o="",l=s.slice(p.index)+o+l,s=s.slice(0,p.index)),t?(new Ue(s,"ext-link-url",n,e),`[\0${g}f\x7F${o}${l}]`):(new Zt(s,o,l,n,e),`\0${g}w\x7F`)})}});var Fn,yo=k(()=>{"use strict";ee();Cr();Fn=class extends Pe{get type(){return"category"}get sortkey(){let{childNodes:[,n]}=this;return n&&ot(n.text())}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e),{sortkey:r}=this;return r&&(t.sortkey=r),t}}});var vo={};de(vo,{parseLinks:()=>ko});var ml,ko,wo=k(()=>{"use strict";D();Si();Ii();li();si();yo();ml=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)([\s\S]*)$/u,ko=(a,n,e,t)=>{var o;(o=n.regexLinks)!=null||(n.regexLinks=new RegExp(String.raw`^\s*(?:${n.protocol}|//)`,"iu"));let r=n.inExt?/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]]))?\]\]([\s\S]*)$/u:/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]])?)?\]\]([\s\S]*)$/u,i=a.split("[["),s=i.shift();for(let l=0;l<i.length;l++){let g=!1,p,d,u,h,m=i[l],f=r.exec(m);if(f)[,p,d,u,h]=f,h.startsWith("]")&&(u!=null&&u.includes("["))&&(u+="]",h=h.slice(1));else{let A=ml.exec(m);A&&(g=!0,[,p,d,u]=A)}if(p===void 0||n.regexLinks.test(p)||/\0\d+[exhbru]\x7F/u.test(p)){s+=`[[${m}`;continue}let b=p.trim().startsWith(":");if(b&&g){s+=`[[${m}`;continue}let{ns:T,valid:C}=w.normalizeTitle(p,0,!1,n,!0,!0,!0,!0);if(C){if(g){if(T!==6){s+=`[[${m}`;continue}let A=!1;for(l++;l<i.length;l++){let $=i[l],j=$.split("]]");if(j.length>2){A=!0,u+=`[[${j[0]}]]${j[1]}`,h=j.slice(2).join("]]");break}else if(j.length===2)u+=`[[${j[0]}]]${j[1]}`;else{u+=`[[${$}`;break}}if(u=ko(u,n,e,t),!A){s+=`[[${p}${d}${u}`;continue}}}else{s+=`[[${m}`;continue}u&&(u=Ai(u,n,e,t));let I=Jt;b||(T===6?(u&&(u=Ci(u,n,e,!0)),I=Yt):T===14&&(I=Fn)),u===void 0&&d&&(u=""),s+=`\0${e.length}l\x7F${h}`,new I(p,u,n,e,d)}return s}});var $o={};de($o,{parseMagicLinks:()=>fl});var Io,Ao,So,Co,fl,No=k(()=>{"use strict";ee();wn();Io=String.raw`[${Ne}\t]| |�*160;|�*a0;`,Ao=`(?:${Io})+`,So=`(?:${Io}|-)`,Co=String.raw`(?:RFC|PMID)${Ao}\d+\b|ISBN${Ao}(?:97[89]${So}?)?(?:\d${So}?){9}[\dx]\b`,fl=(a,n,e)=>{if(!n.regexMagicLinks)try{n.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\d_])(?:(?:${n.protocol})(${je}${_e})|${Co})`,"giu")}catch(t){n.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${n.protocol})(${je}${_e})|${Co})`,"giu")}return a.replace(n.regexMagicLinks,(t,r,i)=>{let s=r?t.slice(r.length):t;if(i){let o="",l=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(s);l&&(o=s.slice(l.index),s=s.slice(0,l.index));let g=s.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,p=g.exec(s);if(p){let d=1;p[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(s.slice(0,p.index))&&(d=2),o=s.slice(p.index+d)+o,s=s.slice(0,p.index+d)}return o.length>=i.length?t:(new Ue(s,void 0,n,e),`${r}\0${e.length-1}w\x7F${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(s))return t;return new Ue(s,"magic-link",n,e),`${r}\0${e.length-1}i\x7F`})}});var Lo,Eo=k(()=>{"use strict";Lo=(a,n)=>a.startsWith(n)?n.length:[...n].findIndex((e,t)=>e!==a[t])});var Pn,Fo=k(()=>{"use strict";ki();Pn=class extends sr{get type(){return"list"}}});var Po={};de(Po,{parseList:()=>bl});var bl,Ro=k(()=>{"use strict";Eo();Fo();vi();bl=(a,n,e,t)=>{let r=/^((?:\0\d+[cno]\x7F)*)([;:*#]+\s*)/u.exec(a);if(!r)return n.lastPrefix="",a;let[i,s,o]=r,l=o.replace(/;/gu,":"),g=Lo(l,n.lastPrefix),p=(g>1?o.slice(g-1):o).split(/(?=;)/u),d=p[0].startsWith(";"),u=p.length-(d?0:1);if(g>1){let F=o.slice(0,g-1);d?p.unshift(F):p[0]=F+p[0]}n.lastPrefix=l;let h=s+p.map((F,X)=>`\0${t.length+X}d\x7F`).join("")+a.slice(i.length);for(let F of p)new Pn(F,e,t);if(!u)return h;let{html:[m]}=e,f=/:+|-\{|\0\d+[xq]\x7F/gu,b=f,T=b.exec(h),C=0,I=!1,A=!1,$=0,j=(F,X)=>(new or(F,e,t),`${h.slice(0,X)}\0${t.length-1}d\x7F${h.slice(X+F.length)}`),O=F=>{F?C&&C--:C++};for(;T&&u;){let{0:F,index:X}=T;if(F==="-{"){if(!$){let{lastIndex:W}=b;b=/-\{|\}-/gu,b.lastIndex=W}$++}else if(F==="}-"){if($--,!$){let{lastIndex:W}=b;b=f,b.lastIndex=W}}else if(F.endsWith("x\x7F")){let{name:W,closing:se,selfClosing:E}=t[Number(F.slice(1,-2))];(!E||m.includes(W))&&O(se)}else if(F.endsWith("q\x7F")){let{bold:W,italic:se}=t[Number(F.slice(1,-2))];W&&(O(I),I=!I),se&&(O(A),A=!A)}else if(C===0){if(F.length>=u)return j(F.slice(0,u),X);u-=F.length,b.lastIndex=X+4+String(t.length).length,h=j(F,X)}T=b.exec(h)}return h}});var Mo,ze,Rn,jo=k(()=>{"use strict";H();ne();U();Be();Mo=new Set(["A","T","R","D","-","H","N"]),Rn=class extends S{constructor(e,t,r=[]){super(void 0,t,r,{});y(this,ze);this.append(...e.map(i=>new Y(i,"converter-flag",t,r)))}get type(){return"converter-flags"}afterBuild(){x(this,ze,this.childNodes.map(e=>e.text().trim())),super.afterBuild()}toString(e){return super.toString(e,";")}text(){return super.text(";")}getGaps(){return 1}getUnknownFlags(){return new Set(c(this,ze).filter(e=>/\{{3}[^{}]+\}{3}/u.test(e)))}getVariantFlags(){let e=new Set(this.getAttribute("config").variants);return new Set(c(this,ze).filter(t=>e.has(t)))}lint(e=this.getAbsoluteIndex(),t){let r=this.getVariantFlags(),i=this.getUnknownFlags(),s=new Set(c(this,ze).filter(d=>Mo.has(d))),o=c(this,ze).filter(d=>!d).length,l=c(this,ze).length-i.size-o,g=super.lint(e,t);if(r.size===l||s.size===l)return g;let p=new M(this,e);for(let d=0;d<this.length;d++){let u=this.childNodes[d],h=u.text().trim();if(h&&!r.has(h)&&!i.has(h)&&(r.size>0||!s.has(h))){let m=L(u,p,"no-ignored","invalid conversion flag");r.size===0&&Mo.has(h.toUpperCase())?m.fix={range:[m.startIndex,m.endIndex],text:h.toUpperCase(),desc:"uppercase"}:m.suggestions=[{desc:"remove",range:[m.startIndex-(d&&1),m.endIndex],text:""}],g.push(m)}}return g}print(){return super.print({sep:";"})}};ze=new WeakMap});var ar,_o=k(()=>{"use strict";D();U();Be();ar=class extends S{get type(){return"converter-rule"}get variant(){var n,e;return(e=(n=this.childNodes[this.length-2])==null?void 0:n.text().trim())!=null?e:""}constructor(n,e=!0,t=w.getConfig(),r=[]){super(void 0,t,r);let i=n.indexOf(":"),s=n.slice(0,i).indexOf("=>"),o=s===-1?n.slice(0,i):n.slice(s+2,i);e&&t.variants.includes(o.trim())?(super.insertAt(new Y(o,"converter-rule-variant",t,r)),super.insertAt(new Y(n.slice(i+1),"converter-rule-to",t,r)),s!==-1&&super.insertAt(new Y(n.slice(0,s),"converter-rule-from",t,r),0)):super.insertAt(new Y(n,"converter-rule-to",t,r))}toString(n){let{childNodes:e,firstChild:t,lastChild:r}=this;return e.length===3?`${t.toString(n)}=>${e[1].toString(n)}:${r.toString(n)}`:super.toString(n,":")}text(){let{childNodes:n,firstChild:e,lastChild:t}=this;return n.length===3?`${e.text()}=>${n[1].text()}:${t.text()}`:super.text(":")}getGaps(n){return n===0&&this.length===3?2:1}print(){let{childNodes:n}=this;if(n.length===3){let[e,t,r]=n;return`<span class="wpb-converter-rule">${e.print()}=>${t.print()}:${r.print()}</span>`}return super.print({sep:":"})}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e);return t.variant=this.variant,t}}});var Mn,qo=k(()=>{"use strict";ee();U();jo();_o();Mn=class extends S{get type(){return"converter"}constructor(n,e,t,r=[]){super(void 0,t,r),this.append(new Rn(n,t,r));let[i]=e,s=i.includes(":"),o=new ar(i,s,t,r);s&&o.length===1||!s&&e.length===2&&!ce(e[1]).trim()?this.insertAt(new ar(e.join(";"),!1,t,r)):this.append(o,...e.slice(1).map(l=>new ar(l,!0,t,r)))}toString(n){let{childNodes:[e,...t]}=this;return`-{${e.toString(n)}${e.length>0?"|":""}${t.map(r=>r.toString(n)).join(";")}}-`}text(){let{childNodes:[n,...e]}=this;return`-{${n.text()}|${ye(e,";")}}-`}getAttribute(n){return n==="padding"?2:super.getAttribute(n)}getGaps(n){return n||this.firstChild.length>0?1:0}print(){let{childNodes:[n,...e]}=this;return`<span class="wpb-converter">-{${n.print()}${n.length>0?"|":""}${qe(e,{sep:";"})}}-</span>`}}});var Bo={};de(Bo,{parseConverter:()=>xl});var xl,Uo=k(()=>{"use strict";qo();xl=(a,n,e)=>{var l;(l=n.regexConverter)!=null||(n.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${n.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"u"));let t=/-\{/gu,r=/-\{|\}-/gu,i=[],s=t,o=s.exec(a);for(;o;){let{0:g,index:p}=o;if(g==="}-"){let d=i.pop(),{length:u}=e,h=a.slice(d.index+2,p),m=h.indexOf("|"),[f,b]=m===-1?[[],h]:[h.slice(0,m).split(";"),h.slice(m+1)],T=b.replace(/(&[#a-z\d]+);/giu,"$1"),C=T.split(n.regexConverter).map(I=>I.replace(/\x01/gu,";"));new Mn(f,C,n,e),a=`${a.slice(0,d.index)}\0${u}v\x7F${a.slice(p+2)}`,i.length===0&&(s=t),s.lastIndex=d.index+3+String(u).length}else i.push(o),s=r,s.lastIndex=p+2;o=s.exec(a)}return a}});var Or={};de(Or,{Token:()=>S});var Br,Se,G,K,Tt,lr,Ur,V,Oo,Ho,Do,zo,Wo,Go,Vo,Qo,Xo,Yo,Ko,Jo,$i,S,U=k(()=>{"use strict";ee();H();D();rs();ss();$i=class $i extends Zr{constructor(e,t=w.getConfig(),r=[],i){super();y(this,V);y(this,Br,"plain");y(this,Se,0);y(this,G);y(this,K);y(this,Tt);y(this,lr,!1);y(this,Ur);typeof e=="string"&&this.insertAt(e),x(this,G,t),x(this,K,r),r.push(this)}get type(){return c(this,Br)}set type(e){x(this,Br,e)}parseOnce(e=c(this,Se),t=!1,r){if(e<c(this,Se)||this.length===0||!this.getAttribute("plain"))return this;if(c(this,Se)>=11)return this;switch(e){case 0:if(this.type==="root"){c(this,K).pop();let i=v(this,V,Oo).call(this);t&&(t=!i)}x(this,Tt,t),v(this,V,Ho).call(this,t);break;case 1:v(this,V,Do).call(this);break;case 2:v(this,V,zo).call(this);break;case 3:v(this,V,Wo).call(this);break;case 4:v(this,V,Go).call(this);break;case 5:v(this,V,Vo).call(this,r);break;case 6:v(this,V,Qo).call(this,r);break;case 7:v(this,V,Xo).call(this);break;case 8:v(this,V,Yo).call(this);break;case 9:v(this,V,Ko).call(this);break;case 10:v(this,V,Jo).call(this)}if(this.type==="root")for(let i of c(this,K))i==null||i.parseOnce(e,t,r);return Xr(this,Se)._++,this}buildFromStr(e,t){let r=e.split(/[\0\x7F]/u).map((i,s)=>{if(s%2===0)return new Ar(i);if(isNaN(i.slice(-1)))return c(this,K)[Number(i.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${i}`)});return t===0?r.map(String).join(""):t===1?ye(r):r}build(){x(this,Se,11);let{length:e,firstChild:t}=this,r=t==null?void 0:t.toString();if(e===1&&t.type==="text"&&r.includes("\0")&&(this.replaceChildren(...this.buildFromStr(r)),this.normalize(),this.type==="root"))for(let i of c(this,K))i==null||i.build()}afterBuild(){if(this.type==="root")for(let e of c(this,K))e==null||e.afterBuild();x(this,lr,!0)}parse(e=11,t,r){for(e=Math.min(e,11);c(this,Se)<e;)this.parseOnce(c(this,Se),t,r);return e&&(this.build(),this.afterBuild()),this}getAttribute(e){var t;switch(e){case"plain":return this.constructor===$i;case"config":return c(this,G);case"include":return(t=c(this,Tt))!=null?t:!!c(this.getRootNode(),Tt);case"accum":return c(this,K);case"built":return c(this,lr);default:return super.getAttribute(e)}}setAttribute(e,t){switch(e){case"stage":c(this,Se)===0&&this.type==="root"&&c(this,K).shift(),x(this,Se,t);break;default:super.setAttribute(e,t)}}insertAt(e,t=this.length){let r=typeof e=="string"?new Ar(e):e;super.insertAt(r,t);let{type:i}=r;return i==="root"&&(r.type="plain"),r}normalizeTitle(e,t=0,r,i,s,o){return w.normalizeTitle(e,t,c(this,Tt),c(this,G),r,i,s,o)}lint(e=this.getAbsoluteIndex(),t){var i;let r=super.lint(e,t);if(this.type==="root"){let s=new Map,o="category,html-attr#id,ext-attr#id,table-attr#id";for(let u of this.querySelectorAll(o)){let h;if(u.type==="category")h=u.name;else{let m=u.getValue();m&&m!==!0&&(h=`#${m}`)}if(h){let m=s.get(h);m?m.add(u):s.set(h,new Set([u]))}}for(let[u,h]of s)if(h.size>1&&!u.startsWith("#mw-customcollapsible-")){let m=!u.startsWith("#"),f=`duplicated ${m?"category":"id"}`,b=m?"error":"warning";r.push(...[...h].map(T=>{let C=P(T,{start:T.getAbsoluteIndex()},"no-duplicate",f,b);return m&&(C.suggestions=[{desc:"remove",range:[C.startIndex,C.endIndex],text:""}]),C}))}let l=/<!--\s*lint-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->/gu,g=this.toString(),p=[],d=l.exec(g);for(;d;){let{1:u,index:h}=d,m=(i=d[2])==null?void 0:i.trim();p.push({line:this.posFromIndex(h).top+(u==="disable-line"?0:1),from:u==="disable"?l.lastIndex:void 0,to:u==="enable"?l.lastIndex:void 0,rules:m?new Set(m.split(",").map(f=>f.trim())):void 0}),d=l.exec(g)}r=r.filter(({rule:u,startLine:h,startIndex:m})=>{let f={pos:0};for(let{line:b,from:T,to:C,rules:I}of p){if(b>h+1)break;if(I&&!I.has(u))continue;if(b===h&&T===void 0&&C===void 0)return!1;T<=m&&T>f.pos?(f.pos=T,f.type="from"):C<=m&&C>f.pos&&(f.pos=C,f.type="to")}return f.type!=="from"})}return r}toString(e,t){return e?super.toString(!0,t):Le(c(this,Ur),()=>super.toString(!1,t),r=>{let i=this.getRootNode();i.type==="root"&&c(i,lr)&&x(this,Ur,r)})}};Br=new WeakMap,Se=new WeakMap,G=new WeakMap,K=new WeakMap,Tt=new WeakMap,lr=new WeakMap,Ur=new WeakMap,V=new WeakSet,Oo=function(){let{parseRedirect:e}=(us(),Z(gs)),t=this.firstChild.toString(),r=e(t,c(this,G),c(this,K));return r&&this.setText(r),!!r},Ho=function(e){let{parseCommentAndExt:t}=(Nr(),Z(to));this.setText(t(this.firstChild.toString(),c(this,G),c(this,K),e))},Do=function(){let{parseBraces:e}=(xn(),Z(js)),t=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,r=e(t,c(this,G),c(this,K));this.setText(this.type==="root"?r:r.slice(1))},zo=function(){var t;if((t=c(this,G).excludes)!=null&&t.includes("html"))return;let{parseHtml:e}=(so(),Z(io));this.setText(e(this.firstChild.toString(),c(this,G),c(this,K)))},Wo=function(){var t;if((t=c(this,G).excludes)!=null&&t.includes("table"))return;let{parseTable:e}=(uo(),Z(go));this.setText(e(this,c(this,G),c(this,K)))},Go=function(){var t;if((t=c(this,G).excludes)!=null&&t.includes("hr"))return;let{parseHrAndDoubleUnderscore:e}=(fo(),Z(mo));this.setText(e(this,c(this,G),c(this,K)))},Vo=function(e){let{parseLinks:t}=(wo(),Z(vo));this.setText(t(this.firstChild.toString(),c(this,G),c(this,K),e))},Qo=function(e){var i;if((i=c(this,G).excludes)!=null&&i.includes("quote"))return;let{parseQuotes:t}=(Si(),Z(xo)),r=this.firstChild.toString().split(`
|
|
31
|
+
`);for(let s=0;s<r.length;s++)r[s]=t(r[s],c(this,G),c(this,K),e);this.setText(r.join(`
|
|
32
|
+
`))},Xo=function(){var t;if((t=c(this,G).excludes)!=null&&t.includes("extLink"))return;let{parseExternalLinks:e}=(Ii(),Z(To));this.setText(e(this.firstChild.toString(),c(this,G),c(this,K)))},Yo=function(){var t;if((t=c(this,G).excludes)!=null&&t.includes("magicLink"))return;let{parseMagicLinks:e}=(No(),Z($o));this.setText(e(this.firstChild.toString(),c(this,G),c(this,K)))},Ko=function(){var g;if((g=c(this,G).excludes)!=null&&g.includes("list"))return;let{parseList:e}=(Ro(),Z(Po)),{firstChild:t,type:r,name:i}=this,s=t.toString().split(`
|
|
33
|
+
`),o={lastPrefix:""},l=r==="root"||r==="ext-inner"&&i==="poem"?0:1;for(;l<s.length;l++)s[l]=e(s[l],o,c(this,G),c(this,K));this.setText(s.join(`
|
|
34
|
+
`))},Jo=function(){if(c(this,G).variants.length>0){let{parseConverter:e}=(Uo(),Z(Bo));this.setText(e(this.firstChild.toString(),c(this,G),c(this,K)))}};S=$i});var oe,Qt,Gn,tn,ke=k(()=>{"use strict";oe={running:!1,run(a){let{running:n}=this;this.running=!0;try{let{Token:e}=(U(),Z(Or)),t=a();return t instanceof e&&!t.getAttribute("built")&&t.afterBuild(),this.running=n,t}catch(e){throw this.running=n,e}},rev:0},Qt=a=>n=>n.type===a,Gn=(a,n,e,t=[])=>{var s,o;let r=a.getChildNodes(),i=r.splice(n,e,...t);for(let l=0;l<t.length;l++){let g=t[l];g.setAttribute("parentNode",a),g.setAttribute("nextSibling",r[n+l+1]),g.setAttribute("previousSibling",r[n+l-1])}return(s=r[n-1])==null||s.setAttribute("nextSibling",r[n]),(o=r[n+t.length])==null||o.setAttribute("previousSibling",r[n+t.length-1]),i},tn=(a,n)=>{Object.defineProperty(a,"name",{value:n.name})}});var Zo={};de(Zo,{Title:()=>Ni});var Hr,Dr,Ce,dr,yt,Ni,ea=k(()=>{"use strict";ee();Ni=class{constructor(n,e,t,r,i,s){y(this,Hr);y(this,Dr);y(this,Ce);y(this,dr);y(this,yt);re(this,"valid");re(this,"encoded",!1);let o=n.trim().startsWith("../");if(i&&n.includes("%"))try{let g=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(n);n=Ve(n),this.encoded=g}catch(g){}if(n=ot(n).replace(/[_ ]+/gu," ").trim(),o)x(this,dr,0);else{let g=e;n.startsWith(":")&&(g=0,n=n.slice(1).trim());let p=n.split(":");if(p.length>1){let d=p[0].trim().toLowerCase(),u=Object.prototype.hasOwnProperty.call(t.nsid,d)&&t.nsid[d];u&&(g=u,n=p.slice(1).join(":").trim())}x(this,dr,g)}let l=n.indexOf("#");if(l!==-1){let g=n.slice(l).trim().slice(1);if(g.includes("%"))try{g=Ve(g)}catch(p){}x(this,yt,g.replace(/ /gu,"_")),n=n.slice(0,l).trim()}this.valid=!!(n||s&&this.ns===0&&c(this,yt)!==void 0)&&ot(n)===n&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(o?/^(?:\.\.\/)+(.*)/u.exec(n)[1]:n),this.main=n,x(this,Dr,t.namespaces),x(this,Ce,t.articlePath||"/wiki/$1"),c(this,Ce).includes("$1")||x(this,Ce,c(this,Ce)+`${c(this,Ce).endsWith("/")?"":"/"}$1`),r||Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}})}get ns(){return c(this,dr)}get fragment(){return c(this,yt)}get main(){return c(this,Hr)}set main(n){n=n.replace(/_/gu," ").trim(),x(this,Hr,n&&n[0].toUpperCase()+n.slice(1))}get prefix(){let n=c(this,Dr)[this.ns];return n+(n&&":")}get title(){return this.getRedirection()[1]}get extension(){let{main:n}=this,e=n.lastIndexOf(".");return e===-1?void 0:n.slice(e+1).toLowerCase()}getRedirection(){return[!1,(this.prefix+this.main).replace(/ /gu,"_")]}setFragment(n){x(this,yt,n)}getUrl(n){{typeof n=="string"&&(x(this,Ce,n||"/wiki/$1"),c(this,Ce).includes("$1")||x(this,Ce,c(this,Ce)+`${c(this,Ce).endsWith("/")?"":"/"}$1`));let{title:e,fragment:t}=this;return e?c(this,Ce).replace("$1",encodeURIComponent(e)+(t?`#${encodeURIComponent(t)}`:"")):t===void 0?"":`#${encodeURIComponent(t)}`}}};Hr=new WeakMap,Dr=new WeakMap,Ce=new WeakMap,dr=new WeakMap,yt=new WeakMap});var ta=Di((sm,Tl)=>{Tl.exports={behaviorSwitches:[{aliases:["notoc"],description:"Hides the table of contents (TOC)."},{aliases:["forcetoc"],description:"Forces the table of contents to appear at its normal position (before the first header, overriding `__NOTOC__`)."},{aliases:["toc"],description:"Places a table of contents at the word's current position (overriding `__NOTOC__`). If this is used multiple times, the table of contents will appear at the first word's position."},{aliases:["noeditsection"],description:"Hides the section edit links beside headings. Use of this in a template will extend the effect to that template, the pages it's included on, and any other templates included on the same page."},{aliases:["newsectionlink"],description:'Adds a link beside the "Edit" tab for adding a new section on a non-talk page.'},{aliases:["nonewsectionlink"],description:'Removes the link beside the "Edit" tab on pages in talk namespaces.'},{aliases:["nogallery"],description:"Used on a category page, replaces thumbnails in the category view with normal links."},{aliases:["hiddencat"],description:"Used on a category page, hides the category from the lists of categories in its members and subcategories (there is an option in the user preferences to show them)."},{aliases:["expectunusedcategory"],description:"Used on a category page, removes the category from Special:UnusedCategories."},{aliases:["nocontentconvert","nocc"],description:"On wikis with language variants, don't perform any content language conversion in article display."},{aliases:["notitleconvert","notc"],description:"On wikis with language variants, don't perform language conversion on the title (all other content is converted)."},{aliases:["index"],description:"Tell search engines to index the page."},{aliases:["noindex"],description:"Tell search engines not to index the page (i.e. do not list in search engines' results)."},{aliases:["staticredirect"],description:`On redirect pages, don't allow MediaWiki to automatically update the link when someone moves a page and checks "Update any redirects that point to the original title".`},{aliases:["expectunusedtemplate"],description:"Used on a template page, removes the page from Special:UnusedTemplates."},{aliases:["noglobal"],description:"Disables the global user page. If present on the central user page, will prevent it from being displayed on remote wikis, and it also determines whether a link to a user page on remote wiki should be red or blue."},{aliases:["disambig"],description:"Identifies a disambiguation page."},{aliases:["archivedtalk"],description:'Hides "reply" links from discussions on archived pages.'},{aliases:["notalk"],description:"Makes a page in a talk namespace not be treated like a talk page."}],parserFunctions:[{aliases:["localurl"],signatures:[[{label:"page name"}],[{label:"page name"},{label:"query string"}]],description:"The relative path to the title."},{aliases:["localurle"],signatures:[[{label:"page name"}],[{label:"page name"},{label:"query string"}]],description:"The percent-encoded relative path to the title."},{aliases:["fullurl"],signatures:[[{label:"page name"}],[{label:"page name"},{label:"query string"}]],description:"A protocol-relative path to the title, which depends on the configuration setting for the local wiki (and so may or may not start with `http(s)://`). This will also resolve [interwiki](https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Interwiki) prefixes. **Note:** Unbracketed (plain) protocol-relative links are not automagically linked."},{aliases:["fullurle"],signatures:[[{label:"page name"}],[{label:"page name"},{label:"query string"}]],description:"A percent-encoded protocol-relative path to the title, which depends on the configuration setting for the local wiki (and so may or may not start with `http(s)://`). This will also resolve [interwiki](https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Interwiki) prefixes. **Note:** Unbracketed (plain) protocol-relative links are not automagically linked."},{aliases:["canonicalurl"],signatures:[[{label:"page name"}],[{label:"page name"},{label:"query string"}]],description:"The absolute path to the title, using the canonical URL. This will also resolve [interwiki](https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Interwiki) prefixes."},{aliases:["canonicalurle"],signatures:[[{label:"page name"}],[{label:"page name"},{label:"query string"}]],description:"The percent-encoded absolute path to the title, using the canonical URL. This will also resolve [interwiki](https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Interwiki) prefixes."},{aliases:["filepath"],signatures:[[{label:"file name"}],[{label:"file name"},{label:"nowiki",const:!0}],[{label:"file name"},{label:"thumbnail size"}]],description:"A protocol-relative path to the full size or thumbnail of a media file."},{aliases:["urlencode"],signatures:[[{label:"string"}],[{label:"string"},{label:"QUERY",const:!0}],[{label:"string"},{label:"WIKI",const:!0}],[{label:"string"},{label:"PATH",const:!0}]],description:`The input encoded for use in URLs.
|
|
35
|
+
|
|
36
|
+
Encoding:
|
|
37
|
+
|code|space|
|
|
38
|
+
|:-:|:-:|
|
|
39
|
+
|*none*|+|
|
|
40
|
+
|QUERY|+|
|
|
41
|
+
|WIKI|_|
|
|
42
|
+
|PATH|%20|`},{aliases:["anchorencode"],signatures:[[{label:"string"}]],description:"The input encoded for use in URL section anchors (after the \u201C#\u201D symbol in a URL)."},{aliases:["ns"],signatures:[[{label:"index"}],[{label:"canonical name or local alias"}]],description:"The current localized name for the [namespace](https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Namespace).\n\nThe main namespace has no name, i.e. `{{ns:0}}` returns an empty string."},{aliases:["nse"],signatures:[[{label:"index"}],[{label:"canonical name or local alias"}]],description:"It returns the current localized name for the [namespace](https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Namespace), but it replaces spaces with underscores, making it usable in external links."},{aliases:["formatnum"],signatures:[[{label:"unformatted number"}],[{label:"formatnum-formatted number"},{label:"R",const:!0}],[{label:"unformatted number"},{label:"NOSEP",const:!0}]],description:"Takes an unformatted number (Arabic, no group separators and `.` as decimal separator) and outputs it in the localized digit script and formatted with decimal and decimal group separators, according to the page language.\n\nThe `|R` parameter can be used to reverse the behavior, for use in mathematical situations: it's reliable and should be used only to deformat numbers which are known to be formatted exactly as formatnum formats them with the wiki's locale.\n\nThe `NOSEP` (\"no separators\") parameter means that no group / decimal separators are changed; formatnum will only transform the digits themselves in languages which don't use the [Hindu\u2013Arabic numeral system](https://en.wikipedia.org/wiki/Hindu%E2%80%93Arabic_numeral_system). `NOSEP` can also prevent non-standard digit groupings you wouldn't expect."},{aliases:["#dateformat","#formatdate"],signatures:[[{label:"date"}],[{label:"date"},{label:"format"}]],description:'Formats an unlinked date based on user "date format" preference, and adds metadata tagging it as a formatted date. For logged-out users and those who have not set a date format in their preferences, dates can be given a default: `mdy`, `dmy`, `ymd`, `ISO 8601` (all case sensitive). If only the month and day are given, only `mdy` and `dmy` are valid. If a format is not specified or is invalid, the input format is used as a default. If the supplied date is not recognized as a valid date (specifically, if it contains any metadata such as from a nested use of these or similar templates), it is rendered unchanged, and no (additional) metadata is generated.'},{aliases:["lc"],signatures:[[{label:"string"}]],description:"The lowercase input."},{aliases:["lcfirst"],signatures:[[{label:"string"}]],description:"The input with the very first character lowercase."},{aliases:["uc"],signatures:[[{label:"string"}]],description:"The uppercase input."},{aliases:["ucfirst"],signatures:[[{label:"string"}]],description:"The input with the very first character uppercase."},{aliases:["padleft"],signatures:[[{label:"string"},{label:"string length"}],[{label:"string"},{label:"string length"},{label:"padding string"}]],description:'Inserts a string of padding characters (character chosen in third parameter; default "0") of a specified length (second parameter) next to a chosen base character or variable (first parameter). The final digits or characters in the base replace the final characters in the padding. The padding string may be truncated if its length does not evenly divide the required number of characters.'},{aliases:["padright"],signatures:[[{label:"string"},{label:"string length"}],[{label:"string"},{label:"string length"},{label:"padding string"}]],description:'Inserts a string of padding characters (character chosen in third parameter; default "0") of a specified length (second parameter) to the right side of a chosen base character or variable (first parameter). The padding string may be truncated if its length does not evenly divide the required number of characters.'},{aliases:["bidi"],signatures:[[{label:"string"}]],description:"Wraps the text in a script-appropriate directionality marker (either left-to-right (U+202A) or right-to-left (U+202B)) and a pop directionality formatting character (U+202C), to ensure directionality safety when using a mix of scripts in running text."},{aliases:["#language"],signatures:[[],[{label:"language code"}],[{label:"language code"},{label:"target language code"}]],description:"The full name of the language for the given [language code](https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Language#Language_code): native name (language autonym) by default, name translated in target language if a target language code is specified. [Extension:CLDR](https://www.mediawiki.org/wiki/Special:MyLanguage/Extension:CLDR) must be installed for the translation to work. If no argument is given, returns the name of the *target language* (for articles, the content language; for messages, the user language)."},{aliases:["#bcp47"],signatures:[[],[{label:"language code"}]],description:"The [IETF BCP-47](https://en.wikipedia.org/wiki/IETF_language_tag) language tag for the given [language code](https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Language#Language_code). If no argument is given, returns the tag of the *target language* (for articles, the content language; for messages, the user language)."},{aliases:["#dir"],signatures:[[],[{label:"language code"}],[{label:"language code"},{label:"bcp47",const:!0}]],description:"The directionality for the given [language code](https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Language#Language_code), either `rtl` or `ltr`. If the optional second argument is `bcp47`, then the first argument is interpreted as a [BCP-47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag). If no argument is given, returns the directionality of the *target language* (for articles, the content language; for messages, the user language)."},{aliases:["plural"],signatures:[[{label:"number"},{label:"singular form"},{label:"plural form"}]],description:"Outputs a plural form appropriate for the given language. For English, the singular form (second parameter) is used if the absolute value of the first parameter is an expression equalling one; and the the plural form (third parameter) is used otherwise. See further documentation [on translatewiki.net](https://translatewiki.net/wiki/Plural#Plural_in_MediaWiki)."},{aliases:["grammar"],signatures:[[{label:"inflection code"},{label:"noun"}]],description:"Outputs the correct inflected form of the given word described by the inflection code after the colon. Grammar transformations are used for inflected languages like Polish. See also [grammar documentation on translatewiki.net](https://translatewiki.net/wiki/Grammar)."},{aliases:["gender"],signatures:[[{label:"username"},{label:"text for every gender"}],[{label:"",const:!0},{label:"male text"},{label:"female text"},{label:"text for unspecified"}],[{label:".",const:!0},{label:"male text"},{label:"female text"},{label:"text for unspecified"}]],description:"A switch for the gender set in Special:Preferences.\n\n**Note:** If 3rd parameter is omitted and user hasn't defined their gender, then `male text` is returned.\n\nA blank username field (`{{GENDER:|`) means the current user, but can be used only in interface messages (MediaWiki namespace).\n\nA dot username (`.`) means the default user gender on this wiki."},{aliases:["int"],signatures:[[{label:"message name"}],[{label:"message name"},{label:"...parameters",rest:!0}]],description:`Internationalizes (translates) the given **int**erface (MediaWiki namespace) message into the user language.
|
|
43
|
+
|
|
44
|
+
You may also use parameters with translations.
|
|
45
|
+
|
|
46
|
+
Parameters are designated in messages with: $1, $2, $3, etc.`},{aliases:["msgnw"],signatures:[[{label:"page name"}]],description:"The unexpanded wikitext is rendered (more or less, for details see [help](https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Templates#Usage))."},{aliases:["#interwikilink"],signatures:[[{label:"link prefix"},{label:"page title"},{label:"link text"}]],description:"Creates an interwiki link."},{aliases:["#interlanguagelink"],signatures:[[{label:"link prefix"},{label:"page title"}]],description:"Creates an interlanguage link."},{aliases:["#special"],signatures:[[{label:"special page name"}]],description:"The localized name for the given canonical Special: page."},{aliases:["#speciale"],signatures:[[{label:"special page name"}]],description:"The localized and URL-encoded name for the given canonical Special: page."},{aliases:["#tag"],signatures:[[{label:"tag name"},{label:"content"},{label:"attribute=value",rest:!0}]],description:"Alias for XML-style MediaWiki parser tags or extension tags. It allows a [pre-save transform of wiki code](https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Tag_extensions#How_do_I_render_wikitext_in_my_extension?) and parser functions within tags before the tag is processed. It also prevents parsing of tags in conditional paths that aren't executed (like in `#if` statements). Content between tags is passed as the first parameter, and any attributes for the tags can be passed as subsequent parameters."},{aliases:["#expr"],signatures:[[{label:"expression"}]],description:"This function evaluates a mathematical expression and returns the calculated value.\n\nWhen evaluating using boolean algebra, zero evaluates to `false`, and any nonzero value, positive or negative, evaluates to `true`.\n\nAn empty input expression returns an empty string. Invalid expressions return one of several error messages, which can be caught using the `#iferror` function.\n\nThe available operators are listed below, in order of precedence:\n|Type|Operators|\n|-|-|\n|Grouping (parenthesis)|`( )`|\n|Numbers|`1234.5` `e` (2.718) `pi` (3.142)|\n| |binary operator `e`, unary `+`, `-`|\n|Unary|`not` `ceil` `trunc` `floor` `abs` `exp` `ln` `sin` `cos` `tan` `acos` `asin` `atan` `sqrt`|\n|Binary|`^`|\n|Binary|`*` `/` `div` `mod` `fmod`|\n|Binary|`+` `-`|\n|Round|`round`|\n|Logic|`=` `!=` `<>` `>` `<` `>=` `<=`|\n|Logic|`and`|\n|Logic|`or`|"},{aliases:["#if"],signatures:[[{label:"test string"},{label:"value if test string is not empty"},{label:"value if test string is empty or only white space"}]],description:"This function evaluates a test string and determines whether or not it is empty. A test string containing only white space is considered to be empty."},{aliases:["#ifeq"],signatures:[[{label:"string 1"},{label:"string 2"},{label:"value if identical"},{label:"value if different"}]],description:`This parser function compares two input strings, determines whether they are identical, and returns one of two strings based on the result. If more comparisons and output strings are required, consider using \`#switch\`.
|
|
47
|
+
|
|
48
|
+
If both strings are valid numerical values, the strings are compared numerically.
|
|
49
|
+
|
|
50
|
+
Otherwise, the comparison is made as text; this comparison is case-sensitive.`},{aliases:["#iferror"],signatures:[[{label:"test string"},{label:"value if error"},{label:"value if correct"}]],description:'This function takes an input string and returns one of two results; the function evaluates to `true` if the input string contains an HTML object with `class="error"`, as generated by other parser functions such as `#expr`, `#time` and `#rel2abs`, template errors such as loops and recursions, and other "failsoft" parser errors.\n\nSome errors may cause a tracking category to be added, using `{{#iferror:}}` will not suppress the addition of the category.'},{aliases:["#ifexpr"],signatures:[[{label:"expression"},{label:"value if true"},{label:"value if false"}]],description:"This function evaluates a mathematical expression and returns one of two strings depending on the boolean value of the result.\n\nThe `expression` input is evaluated exactly as for `#expr`, with the same operators being available. The output is then evaluated as a boolean expression.\n\nAn empty input expression evaluates to `false`.\n\nAn empty or wrong input expression (an error message is treated as an empty string; it is not equal to zero, so we get `value if true`)."},{aliases:["#ifexist"],signatures:[[{label:"page title"},{label:"value if exists"},{label:"value if doesn't exist"}]],description:`**[Expensive]** This function takes an input string, interprets it as a page title, and returns one of two values depending on whether or not the page exists on the local wiki.
|
|
51
|
+
|
|
52
|
+
The function evaluates to \`true\` for [system messages](https://www.mediawiki.org/wiki/Special:MyLanguage/Help:System_message) that have been customized, and for [special pages](https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Special_pages) that are defined by the software.
|
|
53
|
+
|
|
54
|
+
If a page checks a target using \`#ifexist:\`, then that page will appear in the Special:WhatLinksHere list for the target page.
|
|
55
|
+
|
|
56
|
+
\`#ifexist:\` does not work with interwiki links.
|
|
57
|
+
|
|
58
|
+
A page that does not exist and is tested for using #ifexist will end up on the [Wanted Pages](https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:WantedPages).`},{aliases:["#rel2abs"],signatures:[[{label:"path"}],[{label:"path"},{label:"base path"}]],description:"This function converts a relative file path into an absolute filepath.\n\nIf the `base path` is not specified, the full page name of the page will be used instead."},{aliases:["#switch"],signatures:[[{label:"comparison string"},{label:"case=result",rest:!0}]],description:"This function compares one input value against several test cases, returning an associated string if a match is found.\n\nThe default result must be the last parameter and must not contain a raw equals sign (an equals sign without `{{}}`). The default result is returned if no `case` string matches the `comparison string`. If as case matches however, its associated string will be returned.\n\nAlternatively, the default result may be explicitly declared with a `case` string of \"`#default`\". Default results declared in this way may be placed anywhere within the function.\n\nIf the default parameter is omitted and no match is made, no `result` is returned.\n\nIt is possible to have 'fall through' values, where several `case` strings return the same `result` string. This minimizes duplication.\n\nAs with `#ifeq`, the comparison is made numerically if both the comparison string and the case string being tested are numeric; or as a case-sensitive string otherwise.\n\nA `case` string may be empty.\n\nOnce a match is found, subsequent `cases` are ignored."},{aliases:["#time"],signatures:[[{label:"format string"}],[{label:"format string"},{label:"date/time object"}],[{label:"format string"},{label:"date/time object"},{label:"language code"}],[{label:"format string"},{label:"date/time object"},{label:"language code"},{label:"local"}]],description:`This parser function takes a date and/or time (in the Gregorian calendar) and formats it according to the syntax given. A date/time object can be specified; the default is the value of the magic word \`{{CURRENTTIMESTAMP}}\` \u2013 that is, the time the page was last rendered into HTML.
|
|
59
|
+
|
|
60
|
+
Any character in the formatting string that is not recognized is passed through unaltered. There are also two ways to escape characters within the formatting string:
|
|
61
|
+
1. A backslash followed by a formatting character is interpreted as a single literal character.
|
|
62
|
+
2. Characters enclosed in double quotes are considered literal characters, and the quotes are removed.
|
|
63
|
+
|
|
64
|
+
In addition, the digraph \`xx\` is interpreted as a single literal "x".
|
|
65
|
+
|
|
66
|
+
The \`date/time object\` can be in any format accepted by PHP's [strtotime()](https://php.net/function.strtotime) function.
|
|
67
|
+
|
|
68
|
+
The \`language code\` in [ISO 639-3](https://en.wikipedia.org/wiki/ISO_639-3) allows the string to be displayed in the chosen language.
|
|
69
|
+
|
|
70
|
+
The \`local\` parameter specifies if the \`date/time object\` refers to the local timezone or to UTC. This is a boolean parameters: its value is determined by casting the value of the argument (see the [official PHP documentation](https://php.net/language.types.boolean#language.types.boolean.casting) for details on how string are cast to boolean values).`},{aliases:["#timel"],signatures:[[{label:"format string"}],[{label:"format string"},{label:"date/time object"}],[{label:"format string"},{label:"date/time object"},{label:"language code"}]],description:"This function is a syntactic shortcut that operates identically to `{{#time: ... }}` with the `local` parameter set to `true`, so it always uses the preferred time zone of the user or the configured time zone of the wiki."},{aliases:["#timef"],signatures:[[{label:"data/time object"}],[{label:"data/time object"},{label:"format type"}],[{label:"data/time object"},{label:"format type"},{label:"language code"}]],description:'This function formats a date using a standard format for the selected language.\n\nThe format of the `date/time object` is the same as for `#time`. If it is empty, the time when the page was rendered is used.\n\nThe `format type` may be one of:\n\n- `time`: Only the time is shown.\n- `date`: Only the date is shown.\n- `both`: Both the time and date are shown.\n- `pretty`: Only the date is shown, using an abbreviated format which does not include the year. Not all languages support this; if it is not supported, the "date" format is used.\n\nIf the `format type` is not specified, both the time and date will be show, as if `both` were specified.\n\nIf the `language code` is not specified, the page\'s content language is used.'},{aliases:["#timefl"],signatures:[[{label:"data/time object"}],[{label:"data/time object"},{label:"format type"}],[{label:"data/time object"},{label:"format type"},{label:"language code"}]],description:"This function is the same as `#timef` except that it uses the local timezone of the wiki."},{aliases:["#titleparts"],signatures:[[{label:"page name"},{label:"number of segments to return"},{label:"segment to start at"}]],description:'This function separates a page title into segments based on slashes, then returns some of those segments as output.\n\nIf the `number of segments to return` parameter is not specified, it defaults to "0", which returns all the segments from the `segment to start at` to the end (included). If the `segment to start at` parameter is not specified or is "0", it defaults to "1".\n\nNegative values are accepted for both values. Negative values for the `number of segments to return` parameter effectively \'strips\' segments from the end of the string. Negative values for the `first segment to return` translates to "start with this segment counting from the right".'},{aliases:["#len"],signatures:[[{label:"string"}]],description:"The #len function returns the length of the given string."},{aliases:["#pos"],signatures:[[{label:"string"},{label:"search term"},{label:"offset"}]],description:"The #pos function returns the position of a given search term within the string.\n\nThe `offset` parameter, if specified, tells a starting position where this function should begin searching.\n\nIf the `search term` is found, the return value is a zero-based integer of the first position within the `string`.\n\nIf the `search term` is not found, the function returns an empty string."},{aliases:["#rpos"],signatures:[[{label:"string"},{label:"search term"}]],description:"The #rpos function returns the last position of a given search term within the string.\n\nIf the `search term` is found, the return value is a zero-based integer of its last position within the `string`.\n\nIf the `search term` is not found, the function returns -1. "},{aliases:["#sub"],signatures:[[{label:"string"},{label:"start"},{label:"length"}]],description:"The #sub function returns a substring from the given string.\n\nThe `start` parameter, if positive (or zero), specifies a zero-based index of the first character to be returned.\n\nIf the `start` parameter is negative, it specifies how many characters from the end should be returned.\n\nThe `length` parameter, if present and positive, specifies the maximum length of the returned string.\n\nIf the `length` parameter is negative, it specifies how many characters will be omitted from the end of the string."},{aliases:["#count"],signatures:[[{label:"string"},{label:"substring"}]],description:"The #count function returns the number of times a given substring appears within the provided text."},{aliases:["#replace"],signatures:[[{label:"string"},{label:"search term"},{label:"replacement term"}]],description:"The #replace function returns the given string with all occurrences of a search term replaced with a replacement term.\n\nIf the `search term` is unspecified or empty, a single space will be searched for.\n\nIf the `replacement term` is unspecified or empty, all occurrences of the `search term` will be removed from the `string`."},{aliases:["#explode"],signatures:[[{label:"string"},{label:"delimiter"},{label:"position"},{label:"limit"}]],description:"The #explode function splits the given string into pieces and then returns one of the pieces. The pieces are **0-indexed**.\n\nThe `delimiter` parameter specifies a string to be used to divide the `string` into pieces. This `delimiter` string is then not part of any piece, and when two `delimiter` strings are next to each other, they create an empty piece between them. If this parameter is not specified, a single space is used. The `limit` parameter allows you to limit the number of parts that the value is split into, with all remaining text included in the final part.\n\nThe `position` parameter specifies which piece is to be returned. Pieces are counted from 0. If this parameter is not specified, the first piece is used (piece with number 0). When a negative value is used as `position`, the pieces are counted from the end. In this case, piece number -1 means the last piece.\n\nThe return value is the *position*-th piece. If there are fewer pieces than the `position` specifies, an empty string is returned. "},{aliases:["#urldecode"],signatures:[[{label:"value"}]],description:"`#urldecode` converts the escape characters from an '[URL encoded](https://en.wikipedia.org/wiki/URL_encoding)' string back to readable text."},{aliases:["#invoke"],signatures:[[{label:"module name"},{label:"function name"},{label:"args",rest:!0}]],description:"Call a function from a Lua module"},{aliases:["#while"],signatures:[[{label:"",const:!0},{label:"condition"},{label:"block statement"}]],description:"`{{#while}}` performs a loop (i.e. it repeatedly parses a given wiki markup block statement) so long as the condition mark-up evaluates to non-whitespace."},{aliases:["#dowhile"],signatures:[[{label:"",const:!0},{label:"condition"},{label:"block statement"}]],description:"`{{#dowhile}}` performs a loop (i.e. it repeatedly parses a given wiki markup block statement) so long as the condition mark-up evaluates to non-whitespace. The block statement is guaranteed to be parsed and displayed (if it results in displayable text) at least once."},{aliases:["#loop"],signatures:[[{label:"variable name"},{label:"starting value"},{label:"number of loops to be performed"},{label:"block statement"}]],description:"`{{#loop}}` repeatedly parses and displays `block statement` a number of times equal to the absolute value of `number of loops to be performed`. `Starting value` is placed in a variable (accessible by [Variables](https://www.mediawiki.org/wiki/Special:MyLanguage/Extension:Variables) extension's `{{#var:}}` parser function) using the name `variable name`. After each loop, the variable is incremented by one if `number of loops to be performed` is positive, or decremented by one if `number of loops to be performed` is negative."},{aliases:["#forargs"],signatures:[[{label:"prefix"},{label:"key"},{label:"value"},{label:"block statement"}]],description:"`{{#forargs}}` is to be used in templates.\n\nIt takes arguments that are passed to the template and puts them in variables accessible by [Variables](https://www.mediawiki.org/wiki/Special:MyLanguage/Extension:Variables) extension's `{{#var:}}` parser function.\n\nThis function iterates through each argument whose name begins with `prefix`.\n\nWith each iteration it puts the argument name minus `prefix` into `key` as if calling `{{#vardefine: <key> }}`.\n\nIt then takes the value of the argument and puts it into `value` in a similar method.\n\nThe block statement is then expanded.\n\nThe block statement may contain `{{#var: <key> }}` and `{{#var: <value> }}` to access the stored arguments."},{aliases:["#fornumargs"],signatures:[[{label:"key"},{label:"value"},{label:"block statement"}]],description:"`{{#fornumargs}}` performs similarly to `{{#forargs}}` with two major differences: It doesn't take a prefix argument, and it only works on numbered arguments whether they're explicitly numbered or implicitly numbered."},{aliases:["#vardefine"],signatures:[[{label:"variable name"},{label:"value"}]],description:"Assigns the `value` to the (already existing or hereby introduced) variable `variable name`."},{aliases:["#vardefineecho"],signatures:[[{label:"variable name"},{label:"value"}]],description:"Assigns the `value` to the (already existing or hereby introduced) variable `variable name`, and `value` is printed."},{aliases:["#var"],signatures:[[{label:"variable name"}],[{label:"variable name"},{label:"default value"}]],description:`The value of the variable \`variable name\`.
|
|
71
|
+
|
|
72
|
+
If undefined, this produces an empty string; it does not give an error message.
|
|
73
|
+
|
|
74
|
+
It is possible to get a default value for the case that the variable is undefined or void.`},{aliases:["#varexists"],signatures:[[{label:"variable name"}],[{label:"variable name"},{label:"if-value"},{label:"else-value"}]],description:`Returns *1* if the variable is already defined. If the variable is not defined the return value is void.
|
|
75
|
+
|
|
76
|
+
It supports a second and a third parameter to replace these values.`},{aliases:["#var_final"],signatures:[[{label:"variable name"}],[{label:"variable name"},{label:"default value"}]],description:"This function will output the final, last value a variable has at the end of the page rendering. Naturally, the value will be inserted after the parser went over the entire wiki markup, so this function can't be used in other functions, expecting the right value is being used.\n\nThe `default value` will be used if the variable doesn't exist at the final page rendering stage or if its value is an empty string. The default will be expanded right where the function is used, so the parameter will be expanded, even if it won't be needed."},{aliases:["#lst","#section"],signatures:[[{label:"article"},{label:"chapter"}]],description:"Transclude a section called *chapter* from a page called *article*. The target article defines the location of the section."},{aliases:["#lstx","#section-x"],signatures:[[{label:"article"},{label:"chapter"}],[{label:"article"},{label:"chapter"},{label:"replacement text"}]],description:"Transclude a page, but exclude a specified section. Optionally, you may add replacement text to the excluded section. The replacement text will appear in the area where the section is skipped (excluded)."},{aliases:["#lsth","#section-h"],signatures:[[{label:"article"}],[{label:"article"},{label:"section X"}],[{label:"article"},{label:"section X"},{label:"section Y"}]],description:"Transclude the introduction of a page (i.e. the content before the first heading), or the whole content of the first occurrence of the *section X* (which includes all its sub-sections but excludes the heading of *section X* itself), or the content from the first occurrence of *section X* (excluding the heading of *section X* itself) until it reaches the next occurrence of *section Y*. Note that *section Y* acts as a stop point so the transclusion doesn't contain the content of *section Y*."},{aliases:["msg","\u8A0A\u606F","raw","\u539F\u59CB"],signatures:[[{label:"xyz"}]],description:"Even if there is a magic word named `xyz`, use template:xyz unless the template doesn't exist (equivalent to `{{template:xyz}}`). Normally, magic words have priority when there is a conflict."},{aliases:["subst","\u66FF\u63DB","\u66FF\u4EE3"],signatures:[[{label:"xyz"}]],description:"In the wikitext, the tag is substituted by the content (single-level evaluation only), see [Help:Templates](https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Templates#Usage)."},{aliases:["safesubst","\u5B89\u5168\u66FF\u63DB","\u5B89\u5168\u66FF\u4EE3"],signatures:[[{label:"xyz"}]],description:"See [Help:Templates](https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Templates#Usage)."},{aliases:["currentyear"],description:"Year"},{aliases:["localyear"],description:"Year, but using the site's server config"},{aliases:["currentmonth","currentmonth2"],description:"Month (zero-padded number)"},{aliases:["localmonth","localmonth2"],description:"Month (zero-padded number), but using the site's server config"},{aliases:["currentmonth1"],description:"Month (unpadded number)"},{aliases:["localmonth1"],description:"Month (unpadded number), but using the site's server config"},{aliases:["currentmonthname"],description:"Month (name)"},{aliases:["localmonthname"],description:"Month (name), but using the site's server config"},{aliases:["currentmonthnamegen"],description:"Month ([genitive form](https://en.wikipedia.org/wiki/Genitive_case))"},{aliases:["localmonthnamegen"],description:"Month ([genitive form](https://en.wikipedia.org/wiki/Genitive_case)), but using the site's server config"},{aliases:["currentmonthabbrev"],description:"Month (abbreviation)"},{aliases:["localmonthabbrev"],description:"Month (abbreviation), but using the site's server config"},{aliases:["currentday"],description:"Day of the month (unpadded number)"},{aliases:["localday"],description:"Day of the month (unpadded number), but using the site's server config"},{aliases:["currentday2"],description:"Day of the month (zero-padded number)"},{aliases:["localday2"],description:"Day of the month (zero-padded number), but using the site's server config"},{aliases:["currentdow"],description:"Day of the week (unpadded number), 0 (for Sunday) through 6 (for Saturday)"},{aliases:["localdow"],description:"Day of the week (unpadded number), 0 (for Sunday) through 6 (for Saturday), but using the site's server config"},{aliases:["currentdayname"],description:"Day of the week (name)"},{aliases:["localdayname"],description:"Day of the week (name), but using the site's server config"},{aliases:["currenttime"],description:"Time (24-hour HH:mm format)"},{aliases:["localtime"],description:"Time (24-hour HH:mm format), but using the site's server config"},{aliases:["currenthour"],description:"Hour (24-hour zero-padded number)"},{aliases:["localhour"],description:"Hour (24-hour zero-padded number), but using the site's server config"},{aliases:["currentweek"],description:"Week (number)"},{aliases:["localweek"],description:"Week (number), but using the site's server config"},{aliases:["currenttimestamp"],description:"YYYYMMDDHHmmss timestamp"},{aliases:["localtimestamp"],description:"YYYYMMDDHHmmss timestamp, but using the site's server config"},{aliases:["sitename"],description:"The wiki's site name."},{aliases:["server"],description:"Domain URL."},{aliases:["servername"],description:"Subdomain and domain name."},{aliases:["dirmark","directionmark"],description:"Outputs a Unicode directional mark that matches the wiki's default language's direction (`&lrm`; on left-to-right wikis, `&rlm`; on right-to-left wikis), useful in text with multi-directional text. Since 1.19, it depends on the [page content language](https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Language#page-content-lang)."},{aliases:["articlepath"],description:"Relative article path."},{aliases:["scriptpath"],description:"Relative script path."},{aliases:["stylepath"],description:"Relative style path."},{aliases:["currentversion"],description:"The wiki's MediaWiki version."},{aliases:["contentlanguage","contentlang"],description:"The wiki's default interface language."},{aliases:["pageid"],signatures:[[],[{label:"page name"}]],description:`Returns the [page identifier (page ID)](https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Page_ID).
|
|
77
|
+
|
|
78
|
+
**[Expensive]** Returns the page identifier of the specified page.`},{aliases:["pagelanguage"],description:"Returns the language of the current page. The language code that this variable returns can be converted to a language name using `{{#language:...}}`."},{aliases:["protectionlevel"],signatures:[[{label:"action"}],[{label:"action"},{label:"page name"}]],description:`Outputs the protection level (e.g. "autoconfirmed", "sysop") for a given action (e.g. "edit", "move") on the current page. Returns an empty string if not protected.
|
|
79
|
+
|
|
80
|
+
**[Expensive]** Outputs the protection level on the specified page.`},{aliases:["protectionexpiry"],signatures:[[{label:"action"}],[{label:"action"},{label:"page name"}]],description:`Outputs the protection expiry (e.g. "20160418155030", "infinity") for a given action (e.g. "edit", "move") on the current page. Returns "infinity" if not protected.
|
|
81
|
+
|
|
82
|
+
**[Expensive]** Outputs the protection expiry on the specified page.`},{aliases:["cascadingsources"],signatures:[[],[{label:"page name"}]],description:"**[Expensive]** Returns the sources of any cascading protection acting on the current page or the specified page. Pages will not return their own title unless they transclude themselves."},{aliases:["revisionid"],signatures:[[],[{label:"page name"}]],description:"Unique revision ID. It is always empty in preview, thus one can show an error message only in preview. May be disabled in [miser mode (all WMF wikis)](https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:$wgMiserMode) returning `-` instead when not in preview.\n\n**[Expensive]** Unique revision ID of the last revision on the specified page."},{aliases:["revisionday"],signatures:[[],[{label:"page name"}]],description:`Day edit was made (unpadded number).
|
|
83
|
+
|
|
84
|
+
**[Expensive]** Day of edit from the last revision of the specified page.`},{aliases:["revisionday2"],signatures:[[],[{label:"page name"}]],description:`Day edit was made (zero-padded number).
|
|
85
|
+
|
|
86
|
+
**[Expensive]** Day of edit from the last revision of the specified page.`},{aliases:["revisionmonth"],signatures:[[],[{label:"page name"}]],description:`Month edit was made (zero-padded number as of 1.17+, unpadded number in prior versions).
|
|
87
|
+
|
|
88
|
+
**[Expensive]** Month of edit from the last revision of the specified page.`},{aliases:["revisionmonth1"],signatures:[[],[{label:"page name"}]],description:`Month edit was made (unpadded number).
|
|
89
|
+
|
|
90
|
+
**[Expensive]** Month of edit from the last revision of the specified page.`},{aliases:["revisionyear"],signatures:[[],[{label:"page name"}]],description:`Year edit was made.
|
|
91
|
+
|
|
92
|
+
**[Expensive]** Year of edit from the last revision of the specified page.`},{aliases:["revisiontimestamp"],signatures:[[],[{label:"page name"}]],description:`Timestamp as of time of edit.
|
|
93
|
+
|
|
94
|
+
**[Expensive]** Timestamp as of time of edit on the specified page.`},{aliases:["revisionuser"],signatures:[[],[{label:"page name"}]],description:`The username of the user who made the edit in question, or the user previewing an edit.
|
|
95
|
+
|
|
96
|
+
**[Expensive]** The username from the last revision on the specified page.`},{aliases:["revisionsize"],description:"The size (bytes of wikitext) of the viewed revision of the page or preview."},{aliases:["displaytitle"],signatures:[[{label:"title"}],[{label:"title"},{label:"noerror",const:!0}],[{label:"title"},{label:"noreplace",const:!0}]],description:"Format the [display title](https://www.mediawiki.org/wiki/Special:MyLanguage/Display_title) of the current page, which is what is typically shown in a page's title header. The value must be equivalent to the default title: only capitalization changes to certain parts of the title (not all) and replacing spaces with underscores are allowed.\n\nIt can take a second argument of *noerror* or *noreplace* to suppress error messages when multiple displaytitles are used on one page or to make this `displaytitle` do nothing if a `displaytitle` was already specified earlier in the page."},{aliases:["defaultsort","defaultsortkey","defaultcategorysort"],signatures:[[{label:"sortkey"}],[{label:"sortkey"},{label:"noerror",const:!0}],[{label:"sortkey"},{label:"noreplace",const:!0}]],description:"Used for categorizing pages, sets a default [category sort key](https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Categories). It can take a second argument of *noerror* or *noreplace* to suppress error messages when multiple defaultsortkeys are used on one page or to make this `defaultsort` do nothing if a `defaultsort` was already specified earlier in the page."},{aliases:["numberofpages"],signatures:[[],[{label:"R",const:!0}]],description:"Number of wiki pages."},{aliases:["numberofarticles"],signatures:[[],[{label:"R",const:!0}]],description:"Number of pages in [content namespaces](https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Using_custom_namespaces#content-ns) that qualify as articles."},{aliases:["numberoffiles"],signatures:[[],[{label:"R",const:!0}]],description:"Number of uploaded files."},{aliases:["numberofedits"],signatures:[[],[{label:"R",const:!0}]],description:"Number of wiki edits."},{aliases:["numberofusers"],signatures:[[],[{label:"R",const:!0}]],description:"Number of registered users."},{aliases:["numberofadmins"],signatures:[[],[{label:"R",const:!0}]],description:"Number of users in the *sysop* [group](https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:User_rights)."},{aliases:["numberofactiveusers"],signatures:[[],[{label:"R",const:!0}]],description:"Number of active users, based on the criteria used in Special:Statistics."},{aliases:["pagesincategory","pagesincat"],signatures:[[{label:"category name"}],[{label:"category name"},{label:"all",const:!0}],[{label:"category name"},{label:"pages",const:!0}],[{label:"category name"},{label:"subcats",const:!0}],[{label:"category name"},{label:"files",const:!0}]],description:"**[Expensive]** Number of pages (including subcategories and files if no second argument is provided) in the given [category](https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Categories)."},{aliases:["numberingroup","numingroup"],signatures:[[{label:"group name"}],[{label:"group name"},{label:"R",const:!0}]],description:"Number of users in a specific [group](https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:User_rights)."},{aliases:["fullpagename"],signatures:[[],[{label:"page name"}]],description:"Namespace and full page title (including all subpage levels)."},{aliases:["fullpagenamee"],signatures:[[],[{label:"page name"}]],description:"URL encoded namespace and full page title (including all subpage levels)."},{aliases:["pagename"],signatures:[[],[{label:"page name"}]],description:"Full page title (including all subpage levels) without the namespace."},{aliases:["pagenamee"],signatures:[[],[{label:"page name"}]],description:"URL encoded full page title (including all subpage levels) without the namespace."},{aliases:["basepagename"],signatures:[[],[{label:"page name"}]],description:"Page title of the page in the immediately superior [subpage](https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Subpages) level without the namespace."},{aliases:["basepagenamee"],signatures:[[],[{label:"page name"}]],description:"URL encoded page title of the page in the immediately superior [subpage](https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Subpages) level without the namespace."},{aliases:["rootpagename"],signatures:[[],[{label:"page name"}]],description:"Name of the root of the current page."},{aliases:["rootpagenamee"],signatures:[[],[{label:"page name"}]],description:"URL encoded name of the root of the current page."},{aliases:["subpagename"],signatures:[[],[{label:"page name"}]],description:"The [subpage](https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Subpages) title. If no subpage exists the value of `{{PAGENAME}}` is returned."},{aliases:["subpagenamee"],signatures:[[],[{label:"page name"}]],description:"The URL encoded [subpage](https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Subpages) title. If no subpage exists the value of `{{PAGENAME}}` is returned."},{aliases:["subjectpagename","articlepagename"],signatures:[[],[{label:"page name"}]],description:"Full page name of the associated subject (e.g. article or file). Useful on talk pages."},{aliases:["subjectpagenamee","articlepagenamee"],signatures:[[],[{label:"page name"}]],description:"URL encoded full page name of the associated subject (e.g. article or file). Useful on talk pages."},{aliases:["talkpagename"],signatures:[[],[{label:"page name"}]],description:"Full page name of the associated talk page."},{aliases:["talkpagenamee"],signatures:[[],[{label:"page name"}]],description:"URL encoded full page name of the associated talk page."},{aliases:["namespace"],signatures:[[],[{label:"page name"}]],description:"Name of the page's namespace (except for main space)"},{aliases:["namespacee"],signatures:[[],[{label:"page name"}]],description:"URL encoded name of the page's namespace (except for main space)"},{aliases:["namespacenumber"],signatures:[[],[{label:"page name"}]],description:"[ID](https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Namespace#Built-in_namespaces) of the page's namespace"},{aliases:["subjectspace","articlespace"],signatures:[[],[{label:"page name"}]],description:"Name of the associated content namespace"},{aliases:["subjectspacee","articlespacee"],signatures:[[],[{label:"page name"}]],description:"URL encoded name of the associated content namespace"},{aliases:["talkspace"],signatures:[[],[{label:"page name"}]],description:"Name of the associated talk namespace"},{aliases:["talkspacee"],signatures:[[],[{label:"page name"}]],description:"URL encoded name of the associated talk namespace"},{aliases:["!"],description:`Used to include a vertical bar (pipe).
|
|
97
|
+
|
|
98
|
+
See [help](https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Extension:ParserFunctions#Escaping_pipe_characters_in_tables) for further explanation.`},{aliases:["="],description:`Used to include an equal sign.
|
|
99
|
+
|
|
100
|
+
See [help](https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Extension:ParserFunctions#Raw_equal_signs) for further explanation.`},{aliases:["pagesize"],signatures:[[],[{label:"page name"}],[{label:"page name"},{label:"R",const:!0}]],description:"**[Expensive]** Returns the byte size of the specified page."}]}});var ua={};de(ua,{LanguageService:()=>Ei,isAttr:()=>Li,tasks:()=>sa});var sa,yl,kl,vl,wl,oa,Al,Sl,Cl,Li,Il,ra,Vr,aa,gr,me,na,la,zr,Wr,ur,jn,ia,be,nt,We,Ge,cr,Qr,hr,mr,kt,q,Gr,Ie,Fi,da,Pi,ga,Ri,pr,Ei,pa=k(()=>{"use strict";Un();ei();H();ee();D();sa=new WeakMap,yl=new Set(["ref"]),kl=new Set(["ref","references"]),vl=new Set(["name","extends","follow"]),wl=new Set(["group"]),oa=new Set(["arg-name","template-name","link-target","parameter-key"]),Al=new Set(["ext","html","attr-key","image-parameter","heading-title","heading","magic-word-name",...oa]),Sl=new Set(["text","comment","noinclude","include"]),Cl=["ext","html","table"].map(a=>`${a}-attr#style`).join(),Li=({type:a,parentNode:n,length:e,firstChild:t},r)=>a==="attr-value"&&e===1&&t.type==="text"&&(!r||n.name==="style"),Il=a=>a.type==="html-attr"||a.type==="table-attr",ra=a=>a.childNodes.every(({type:n})=>Sl.has(n)),Vr=(a,n)=>{let{top:e,left:t}=a.posFromIndex(n);return{line:e,character:t}},aa=(a,n,e)=>({start:Vr(a,n),end:Vr(a,e)}),gr=a=>{let{top:n,left:e,height:t,width:r}=a.getBoundingClientRect();return{start:{line:n,character:e},end:Lt(n,e,t,r)}},me=(a,n,e,{line:t,character:r},i,s)=>[...new Set(a)].map(o=>{var g;let l=(g=s==null?void 0:s(o))==null?void 0:g.description;return{label:o,kind:n,textEdit:{range:{start:{line:t,character:r-e.length},end:{line:t,character:r}},newText:o+(i!=null?i:"")},...l&&{documentation:{kind:"markdown",value:l}}}}),na=(a,n,{line:e,character:t})=>{let r=a.indexFromPos(e,t);return a.caretPositionFromIndex(r+Number(/\w/u.test(n.charAt(r))))},la=(a,n,e)=>{let{type:t,parentNode:r={}}=a,{name:i,tag:s}=r;return t==="attr-value"&&n.has(s)&&e.has(i)?a.toString().trim():NaN},zr=a=>la(a,yl,vl),Wr=a=>la(a,kl,wl),ur=(a,n)=>{let e=a==null?void 0:a.getAttr(n);return e!==!0&&e||!1},jn=a=>{let{type:n,name:e,parentNode:t}=a;switch(n){case"heading":return a.level;case"heading-title":return t.level;case"parameter-key":return`${t.parentNode.name}|${t.name}`;case"ext":case"html":case"image-parameter":return e;default:return t.name}},ia=(a,n,e=!1)=>({range:aa(a,...n.range),newText:n.text,title:`${e?"Fix":"Suggestion"}: ${n.desc}`,fix:e}),Ei=class{constructor(n){y(this,q);y(this,be);y(this,nt);y(this,We);y(this,Ge);y(this,cr);y(this,Qr);y(this,hr);y(this,mr);y(this,kt);re(this,"include",!0);re(this,"config");re(this,"data");sa.set(n,this),Object.defineProperties(this,{config:{enumerable:!1},data:{value:ta(),enumerable:!1}})}destroy(){Object.setPrototypeOf(this,null)}async provideDocumentColors(n,e,t=!0){let r=await v(this,q,Ie).call(this,e);return r.querySelectorAll("attr-value,parameter-value,arg-default").reverse().flatMap(i=>{let{type:s,childNodes:o}=i;return s!=="attr-value"&&!ra(i)?[]:o.filter(l=>l.type==="text").reverse().flatMap(l=>{let{data:g}=l,p=Qi(g,t).filter(([,,,u])=>u);if(p.length===0)return[];let d=l.getAbsoluteIndex();return p.map(([u,h,m])=>{let f=n(u);return f.length===4&&{color:{red:f[0]/255,green:f[1]/255,blue:f[2]/255,alpha:f[3]},range:aa(r,d+h,d+m)}}).filter(Boolean)})})}provideColorPresentations(n){let{color:{red:e,green:t,blue:r,alpha:i},range:s}=n,o=`#${br(e)}${br(t)}${br(r)}${i<1?br(i):""}`;return[{label:o,textEdit:{range:s,newText:o}}]}async provideCompletionItems(n,e){var $,j,O,F,X,W,se;let{re:t,allTags:r,functions:i,switches:s,protocols:o,params:l,tags:g,ext:p}=v(this,q,ga).call(this),{line:d,character:u}=e,h=n.split(/\r?\n/u,d+1)[d],m=t.exec(($=h==null?void 0:h.slice(0,u))!=null?$:""),[,,f={},b={}]=this.config.doubleUnderscore;if((m==null?void 0:m[1])!==void 0){let E=m[1].startsWith("/");return me(r,"Class",m[1].slice(E?1:0),e,E&&!(h!=null&&h.slice(u).trim().startsWith(">"))?">":"")}else{if(m!=null&&m[4])return me(s,"Constant",m[4],e,"",E=>{if(this.data)return E=E.slice(2,-2),E in f?E=f[E]:E in b&&(E=b[E]),v(this,q,Ri).call(this,E.toLowerCase())});if((m==null?void 0:m[5])!==void 0)return me(o,"Reference",m[5],e)}let T=await v(this,q,Ie).call(this,n),C;if(m!=null&&m[2]){C=T.elementFromPoint(m.index+m[2].length-1,d);let E=(j=m[3])!=null?j:"";if(m[2]==="{{{")return me(T.querySelectorAll("arg").filter(R=>R.name&&R!==C).map(({name:R})=>R),"Variable",E,e);let[_,B]=this.config.parserFunction,N=Array.isArray(B),z=h.charAt(u),le=E.startsWith(":"),Q=le?E.slice(1).trimStart():E;if(m[2]==="[[")return me(T.querySelectorAll("link,file,category,redirect-target").filter(R=>R!==C).map(({name:R})=>R),"Folder",Q,e);let ie=i;return z===":"?ie=i.filter(R=>!R.endsWith("\uFF1A")):z==="\uFF1A"&&(ie=i.filter(R=>R.endsWith("\uFF1A")).map(R=>R.slice(0,-1))),[...me(ie,"Function",E,e,"",R=>{if(this.data)R in _?R=_[R]:!N&&R in B&&(R=B[R]);else return;return v(this,q,pr).call(this,R.toLowerCase())}),...E.startsWith("#")?[]:me(T.querySelectorAll("template").filter(R=>R!==C).map(R=>{let{name:$e}=R;if(le)return $e;let{ns:wt}=R.getAttribute("title");return wt===0?`:${$e}`:wt===10?$e.slice(9):$e}),"Folder",Q,e)]}let I,A;if((m==null?void 0:m[7])===void 0&&(C=T.elementFromPoint(u,d),{type:I,parentNode:A}=C),(m==null?void 0:m[6])!==void 0||I==="image-parameter"){let E=T.indexFromPos(d,u),_=(F=(O=m==null?void 0:m[6])==null?void 0:O.trimStart())!=null?F:c(this,be).slice(C.getAbsoluteIndex(),E).trimStart(),B=c(this,be)[E]==="=";return[...me(l,"Property",_,e).filter(({label:N})=>!B||!/[= ]$/u.test(N)),...me(T.querySelectorAll("image-parameter#width").filter(N=>N!==C).map(N=>N.text()),"Unit",_,e)]}else if((m==null?void 0:m[7])!==void 0||I==="attr-key"){let E=(W=(X=m==null?void 0:m[7])==null?void 0:X.toLowerCase())!=null?W:A.tag,_=(se=m==null?void 0:m[9])!=null?se:C.toString().slice(0,u-T.posFromIndex(C.getAbsoluteIndex()).left);if(!g.has(E))return;let B=dn[E],N=gn[E],z=N&&me(N,"Field",_,e);return p.includes(E)&&!B?z:[...z!=null?z:[],...E==="meta"||E==="link"?[]:me(ln,"Property",_,e),...B?me(B,"Property",_,e):[],...me(["data-"],"Variable",_,e),...me(["xmlns:"],"Interface",_,e)]}else if(I==="parameter-key"||I==="parameter-value"&&A.anon){let E=A.parentNode,{type:_,name:B}=E;if(_==="magic-word"&&B!=="invoke")return;let N=c(this,be).slice(C.getAbsoluteIndex(),T.indexFromPos(d,u)).trimStart(),[z,le]=_==="magic-word"?E.getModule():[];return N?me(T.querySelectorAll("parameter").filter(Q=>{if(Q===A||Q.anon||Q.parentNode.type!==_||Q.parentNode.name!==B)return!1;if(_==="template")return!0;let[ie,R]=Q.parentNode.getModule();return ie===z&&R===le}).map(({name:Q})=>Q),"Variable",N,e,I==="parameter-value"?"=":""):void 0}else if(Li(C)&&Il(A)){let E=Yr.provideValues(A.tag,A.name);if(E.length===0)return;let _=c(this,be).slice(C.getAbsoluteIndex(),T.indexFromPos(d,u)).trimStart();return me(E.map(({name:B})=>B),"Value",_,e)}}async provideDiagnostics(n,e=!0){let t=await v(this,q,Ie).call(this,n),r=t.lint();return[(e?r:r.filter(({severity:l})=>l==="error")).map(({startLine:l,startCol:g,endLine:p,endCol:d,severity:u,rule:h,message:m,fix:f,suggestions:b})=>({range:{start:{line:l,character:g},end:{line:p,character:d}},severity:u==="error"?1:2,source:"WikiLint",code:h,message:m,data:[...f?[ia(t,f,!0)]:[],...b?b.map(T=>ia(t,T)):[]]})),[],[]].flat(2)}async provideFoldingRanges(n){let e=await v(this,q,Ie).call(this,n),{length:t}=e.getLines(),r=[],i=new Array(6),s=e.querySelectorAll("heading-title,table,template,magic-word");for(let o of[...s].reverse())o.getRelativeIndex();for(let o of s){let{offsetHeight:l}=o;if(o.type==="heading-title"||l>2){let{top:g}=e.posFromIndex(o.getAbsoluteIndex());if(o.type==="heading-title"){let{level:p}=o.parentNode;for(let d=p-1;d<6;d++){let u=i[d];u!==void 0&&u<g-1&&r.push({startLine:u,endLine:g-1,kind:"region"}),i[d]=void 0}i[p-1]=g+l-1}else r.push({startLine:g,endLine:g+l-2,kind:"region"})}}for(let o of i)o!==void 0&&o<t-1&&r.push({startLine:o,endLine:t-1,kind:"region"});return r}async provideLinks(n){var s;(s=this.config)!=null||(this.config=w.getConfig());let{articlePath:e,protocol:t}=this.config,r=e==null?void 0:e.includes("//"),i=new RegExp(`^(?:${t}|//)`,"iu");return(await v(this,q,Ie).call(this,n)).querySelectorAll(`magic-link,ext-link-url,free-ext-link,attr-value,image-parameter#link${r?",link-target,template-name,invoke-module,magic-word#filepath,magic-word#widget":""}`).reverse().map(o=>{let l;o.is("magic-word")&&({name:l}=o,o=o.childNodes[1].lastChild);let{type:g,parentNode:p,firstChild:d,lastChild:u,childNodes:h,length:m}=o,{tag:f}=p;if(l!=null||(l=p.name),!(g!=="attr-value"||l==="src"&&["templatestyles","img"].includes(f)||l==="cite"&&["blockquote","del","ins","q"].includes(f))||!ra(o))return!1;let b=h.filter(T=>T.type==="text").map(({data:T})=>T).join("").trim();if(!b)return!1;try{if(o.is("magic-link")||o.is("ext-link-url")||o.is("free-ext-link"))b=o.getUrl(e);else if(g==="link-target"&&(p.is("link")||p.is("redirect-target")||p.is("category"))){if(b.startsWith("/"))return!1;b=p.link.getUrl(e)}else if(g==="template-name")b=p.getAttribute("title").getUrl(e);else if(["link-target","invoke-module","parameter-value"].includes(g)||g==="attr-value"&&l==="src"&&f==="templatestyles"||g==="image-parameter"&&!i.test(b)){if(!r||b.startsWith("/"))return!1;let T=0;switch(g){case"attr-value":T=10;break;case"invoke-module":T=828;break;case"parameter-value":T=l==="filepath"?6:274}let C=w.normalizeTitle(b,T,!1,this.config,!0);if(!C.valid)return!1;b=C.getUrl()}if(typeof b=="string"&&b.startsWith("//")&&(b=`https:${b}`),b=new URL(b).href,g==="image-parameter"){let T=d.getBoundingClientRect(),{top:C,left:I,height:A,width:$}=m===1?T:u.getBoundingClientRect();return{range:{start:{line:T.top,character:T.left},end:Lt(C,I,A,$)},target:b}}return{range:gr(o),target:b}}catch(T){return!1}}).filter(Boolean)}async provideReferences(n,e){let t=await v(this,q,Ie).call(this,n),{offsetNode:r,offset:i}=na(t,c(this,be),e),s=r.type==="text"?r.parentNode:r,o=i===0&&(s.type==="ext-attr-dirty"||s.type==="html-attr-dirty")?s.parentNode.parentNode:s,{type:l}=o,g=zr(o),p=Wr(o);if(!g&&!p&&!Al.has(l))return;let d=jn(o),u=t.querySelectorAll(l==="heading-title"?"heading":l).filter(h=>l==="attr-value"?zr(h)===g||Wr(h)===p:jn(h)===d).reverse().map(h=>({range:gr(h.type==="parameter-key"?h.parentNode:h)}));return u.length===0?void 0:u}async provideDefinition(n,e){let t=await v(this,q,Ie).call(this,n),r=t.elementFromPoint(e.character,e.line),i=r.is("ext")&&r.name==="ref"?r:r.closest("ext#ref"),s=ur(i,"name");if(!s)return;let o=ur(i,"group"),l=t.querySelectorAll("ext#ref").filter(g=>g.innerText&&ur(g,"name")===s&&ur(g,"group")===o).reverse().map(({lastChild:g})=>({range:gr(g)}));return l.length===0?void 0:l}async resolveRenameLocation(n,e){let t=await v(this,q,Ie).call(this,n),r=t.elementFromPoint(e.character,e.line),{type:i}=r,s=zr(r),o=Wr(r);return!s&&!o&&(!oa.has(i)||i==="parameter-key"&&/^[1-9]\d*$/u.test(r.parentNode.name)||i==="link-target"&&!["link","redirect-target"].includes(r.parentNode.type))?void 0:gr(r)}async provideRenameEdits(n,e,t){let r=await v(this,q,Ie).call(this,n),i=r.elementFromPoint(e.character,e.line),{type:s}=i,o=zr(i),l=o&&ur(i.parentNode.parentNode,"group"),g=Wr(i),p=jn(i),d=r.querySelectorAll(s).filter(u=>{let{type:h}=u.parentNode;return s==="link-target"&&h!=="link"&&h!=="redirect-target"?!1:s==="attr-value"?Wr(u)===g||zr(u)===o&&ur(u.parentNode.parentNode,"group")===l:jn(u)===p});return d.length===0?void 0:{changes:{"":d.reverse().map(u=>({range:gr(u),newText:t}))}}}async provideHover(n,e){if(!this.data)return;let t=await v(this,q,Ie).call(this,n),{offsetNode:r,offset:i}=na(t,c(this,be),e);r.type==="text"&&(i+=r.getRelativeIndex(),r=r.parentNode);let{type:s,parentNode:o,length:l,name:g}=r,p,d,u,h;if(r.is("double-underscore")&&i>0)p=v(this,q,Ri).call(this,r.name);else if(s==="magic-word-name")p=v(this,q,pr).call(this,o.name),d=r.toString(!0).trim(),u=o.getAttribute("colon");else if(r.is("magic-word")&&!r.modifier&&l===1&&(i>0||t.posFromIndex(r.getAbsoluteIndex()).left===e.character))p=v(this,q,pr).call(this,g),d=r.firstChild.toString(!0).trim(),u=r.getAttribute("colon");else if((r.is("magic-word")||r.is("template"))&&r.modifier&&i>=2&&r.getRelativeIndex(0)>i&&(d=r.modifier.trim().slice(0,-1),p=v(this,q,pr).call(this,d.toLowerCase()),u=":",p)){let m=r.getAbsoluteIndex();h={start:Vr(t,m+2),end:Vr(t,m+r.modifier.trimEnd().length+1)}}return p&&{contents:{kind:"markdown",value:(p.signatures?`${p.signatures.map(m=>`- **{{ ${d}${m.length===0?"**":`${u}** `}${m.map(({label:f,const:b})=>b?f:`*${f}*`).join(" **|** ")} **}}**`).join(`
|
|
35
101
|
`)}
|
|
36
102
|
|
|
37
|
-
`:"")+
|
|
103
|
+
`:"")+p.description},range:h!=null?h:gr(r)}}async provideSignatureHelp(n,e){if(!this.data)return;let{line:t,character:r}=e,i=n.split(/\r?\n/u,t+1)[t],{lastChild:s}=await v(this,q,da).call(this,`${i.slice(0,r+/^[^{}<]*/u.exec(i.slice(r))[0].length)}}}`);if(!s.is("magic-word")||s.length===1)return;let{name:o,childNodes:l,firstChild:g}=s,p=v(this,q,pr).call(this,o);if(!(p!=null&&p.signatures))return;let d=l.length-1,u=p.signatures.filter(b=>{var T;return(b.length>=d||((T=b[b.length-1])==null?void 0:T.rest))&&b.every(({label:C,const:I},A)=>{var j;let $=I&&A<d&&((j=l[A+1])==null?void 0:j.toString(!0).trim());return!$||C.toLowerCase().includes($.toLowerCase())})});if(u.length===0)return;let h=-1;for(let b=s.getAbsoluteIndex()+s.getAttribute("padding");h<d&&(b+=l[h+1].toString().length+1,!(b>r));h++);let m=g.toString(!0).trim(),f=s.getAttribute("colon");return{signatures:u.map(b=>({label:`{{${m}${b.length===0?"":f}${b.map(({label:T})=>T).join("|")}}}`,parameters:b.map(({label:T,const:C})=>({label:T,...C?{documentation:"Predefined parameter"}:void 0})),...b.length<d?{activeParameter:Math.min(h,b.length-1)}:void 0})),activeParameter:h}}async provideInlayHints(n){let e=[],t=await v(this,q,Ie).call(this,n);for(let r of t.querySelectorAll("template,magic-word#invoke").reverse()){let{type:i,childNodes:s}=r;e.push(...s.slice(i==="template"?1:3).filter(({anon:o})=>o).reverse().map(o=>({position:Vr(t,o.getAbsoluteIndex()),label:`${o.name}=`,kind:2})))}return e}findStyleTokens(){return c(this,cr).querySelectorAll(Cl).filter(({lastChild:n})=>Li(n))}};be=new WeakMap,nt=new WeakMap,We=new WeakMap,Ge=new WeakMap,cr=new WeakMap,Qr=new WeakMap,hr=new WeakMap,mr=new WeakMap,kt=new WeakMap,q=new WeakSet,Gr=function(){return c(this,hr)===this.config&&c(this,mr)===this.include},Ie=async function(n){var e;return n=It(n),!c(this,We)&&v(this,q,Gr).call(this)&&c(this,be)===n?c(this,cr):(x(this,be,n),(e=c(this,We))!=null||x(this,We,v(this,q,Fi).call(this)),c(this,We))},Fi=async function(){var t;(t=this.config)!=null||(this.config=w.getConfig()),x(this,hr,this.config),x(this,mr,this.include);let n=c(this,be),e=await w.partialParse(n,()=>c(this,be),this.include,this.config);return v(this,q,Gr).call(this)&&c(this,be)===n?(x(this,cr,e),x(this,We,void 0),e):(x(this,We,v(this,q,Fi).call(this)),c(this,We))},da=async function(n){var e;return n=It(n),!c(this,Ge)&&v(this,q,Gr).call(this)&&c(this,nt)===n?c(this,Qr):(x(this,nt,n),(e=c(this,Ge))!=null||x(this,Ge,v(this,q,Pi).call(this)),c(this,Ge))},Pi=async function(){var t;(t=this.config)!=null||(this.config=w.getConfig()),x(this,hr,this.config),x(this,mr,this.include);let n=c(this,nt),e=await w.partialParse(n,()=>c(this,nt),this.include,this.config);return v(this,q,Gr).call(this)&&c(this,nt)===n?(x(this,Qr,e),x(this,Ge,void 0),e):(x(this,Ge,v(this,q,Pi).call(this)),c(this,Ge))},ga=function(){var n;if(!c(this,kt)||c(this,kt)[1]!==this.config){(n=this.config)!=null||(this.config=w.getConfig());let{nsid:e,ext:t,html:r,parserFunction:[i,s,...o],doubleUnderscore:l,protocol:g,img:p}=this.config,d=new Set([t,r].flat(2)),u=new RegExp("(?:"+String.raw`<(\/?\w*)`+"|"+String.raw`(\{{2,4}|\[\[)\s*([^|{}<>[\]\s][^|{}<>[\]#]*)?`+"|"+String.raw`(__(?:(?!__)[\p{L}\d_])*)`+"|"+String.raw`(?<!\[)\[([a-z:/]*)`+"|"+String.raw`\[\[\s*(?:${Object.entries(e).filter(([,h])=>h===6).map(([h])=>h).join("|")})\s*:[^[\]{}<>]+\|([^[\]{}<>|=]*)`+"|"+String.raw`<(\w+)(?:\s(?:[^<>{}|=\s]+(?:\s*=\s*(?:[^\s"']\S*|(["']).*?\8))?(?=\s))*)?\s(\w*)`+")$","iu");x(this,kt,[{re:u,ext:t,tags:d,allTags:[...d,"onlyinclude","includeonly","noinclude"],functions:[Object.keys(i),Array.isArray(s)?s:Object.keys(s),o].flat(2),switches:l.slice(0,2).flat().map(h=>`__${h}__`),protocols:g.split("|"),params:Object.keys(p).filter(h=>h.endsWith("$1")||!h.includes("$1")).map(h=>h.replace(/\$1$/u,""))},this.config])}return c(this,kt)[0]},Ri=function(n){return this.data.behaviorSwitches.find(({aliases:e})=>e.includes(n))},pr=function(n){return this.data.parserFunctions.find(({aliases:e})=>e.some(t=>t.replace(/^#/u,"")===n))}});var vt,ca,$l,w,D=k(()=>{Vi();ke();Zi();ee();vt={config:On,i18n:void 0,rules:Gi,getConfig(a){let n=a!=null?a:this.config,{doubleUnderscore:e}=n;for(let t=0;t<2;t++)e.length>t+2&&e[t].length===0&&(e[t]=Object.keys(e[t+2]));return{...On,...n,excludes:[]}},msg(a,n=""){var e,t;return a&&((t=(e=this.i18n)==null?void 0:e[a])!=null?t:a).replace("$1",this.msg(n))},normalizeTitle(a,n=0,e,t=vt.getConfig(),r=!1,i,s=!1,o=!1){let{Title:l}=(ea(),Z(Zo)),g;if(i)g=new l(a,n,t,r,s,o);else{let{Token:p}=(U(),Z(Or));g=oe.run(()=>{let d=new p(a,t);d.type="root",d.parseOnce(0,e).parseOnce();let u=new l(d.toString(),n,t,r,s,o);for(let h of["main","fragment"]){let m=u[h];if(m!=null&&m.includes("\0")){let f=d.buildFromStr(m,1);h==="main"?u.main=f:u.setFragment(f)}}return u})}return g},parse(a,n,e=11,t=vt.getConfig()){if(a=It(a),typeof e!="number"){let s=Array.isArray(e)?e:[e];e=Math.max(...s.map(o=>Wi[o]||11))}let{Token:r}=(U(),Z(Or));return oe.run(()=>{let s=new r(a,t);return s.type="root",s.parse(e,n)})},async partialParse(a,n,e,t=vt.getConfig()){let{Token:r}=(U(),Z(Or)),i=typeof setImmediate=="function"?setImmediate:setTimeout,{running:s}=oe;oe.running=!0;let o=new r(It(a),t);o.type="root";let l=0;return await new Promise(g=>{let p=()=>{n()===a?(l++,i(d,0)):g()},d=()=>{l===12?(o.afterBuild(),g()):(o[l===11?"build":"parseOnce"](l,e),p())};i(d,0)}),oe.running=s,o},createLanguageService(a){var n;{let e=(pa(),Z(ua)),{LanguageService:t,tasks:r}=e;return(n=r.get(a))!=null?n:new t(a)}}},ca={},$l=new Set(["normalizeTitle","parse","createLanguageService"]);for(let a in vt)$l.has(a)||(ca[a]={enumerable:!1});Object.defineProperties(vt,ca);Object.assign(typeof globalThis=="object"?globalThis:self,{Parser:vt});w=vt});D();})();
|
|
38
104
|
//# sourceMappingURL=bundle-lsp.min.js.map
|