wikiparser-node 1.35.2 → 1.36.0
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/bundle/bundle-es8.min.js +22 -22
- package/bundle/bundle-lsp.min.js +20 -20
- package/bundle/bundle.min.js +19 -19
- package/dist/addon/transclude.js +1 -1
- package/dist/bin/config.js +1 -1
- package/dist/index.js +25 -11
- package/dist/lib/lintConfig.js +0 -2
- package/dist/lib/node.d.ts +1 -1
- package/dist/lib/title.js +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/nowiki/comment.d.ts +1 -1
- package/dist/src/parameter.d.ts +1 -1
- package/dist/src/tagPair/include.d.ts +1 -1
- package/dist/src/transclude.d.ts +21 -13
- package/dist/src/transclude.js +63 -30
- package/extensions/dist/base.js +1 -1
- package/package.json +15 -14
package/bundle/bundle-es8.min.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
"use strict";(()=>{var eo=Object.create;var vt=Object.defineProperty,$d=Object.defineProperties,to=Object.getOwnPropertyDescriptor,Id=Object.getOwnPropertyDescriptors,Fd=Object.getOwnPropertyNames,Cn=Object.getOwnPropertySymbols,Rd=Object.getPrototypeOf,
|
|
2
|
-
`)){let n=e+t.length;r.push([t,e,n]),e=n+1}return r},Ti=o=>o&&Number(o[1]),Md=(o,r)=>{var n;let e,t=i=>{e!=null||(e=$n(o));let s=e.findIndex(([,,a])=>i<=a)+1;return{line:s,column:i-e[s-1][1]+1}};for(let i of r){let{line:s,column:a,from:l,to:u}=i;l==null?s?(e!=null||(e=$n(o)),(n=i.column)!=null||(i.column=1),i.from=e[s-1][1]+(i.column-1)):(i.from=0,i.line=1,i.column=1):(!s||!a)&&Object.assign(i,t(l)),u!==void 0&&({line:i.endLine,column:i.endColumn}=t(u)),i.position=i.from}return r},co=(o,r)=>{if(r||o.trim())try{JSON.parse(o)}catch(e){let{message:t}=e,n=Ti(/\bline (\d+)/u.exec(t)),i=Ti(/\bcolumn (\d+)/u.exec(t)),s=Ti(/\bposition (\d+)/u.exec(t));return Md(o,[{message:t,line:n,column:i,from:s,severity:"error"}])}return[]}});var qr,Zt,_r,Wr,ki,W,se=w(()=>{"use strict";W=class{constructor(r,e){S(this,Wr);S(this,qr);S(this,Zt);S(this,_r);C(this,qr,r),C(this,Zt,e)}get start(){return m(this,Zt)}get top(){return I(this,Wr,ki).call(this).top}get left(){return I(this,Wr,ki).call(this).left}};qr=new WeakMap,Zt=new WeakMap,_r=new WeakMap,Wr=new WeakSet,ki=function(){var r;return(r=m(this,_r))!=null||C(this,_r,m(this,qr).getRootNode().posFromIndex(m(this,Zt))),m(this,_r)}});var Ud,zd,In,vi,mo,j,F,me,er,O,Fn,Le,Rn,Pn,Bn,st,Ge,jn,je,ho,z=w(()=>{"use strict";ze();Se();se();D();Ud=new Set(["tr","td","th","caption"]),zd=new Set(["Template:!!","Template:!-"]),In=o=>{let r=o.childNodes.find(e=>e.text().trim());if(!r||r.type==="text"&&r.data.trim().startsWith("!")||r.is("magic-word")&&r.name==="!"||r.is("template")&&zd.has(r.name)||r.is("html")&&Ud.has(r.name))return!1;if(r.is("arg"))return r.length>1&&In(r.childNodes[1]);if(r.is("magic-word"))try{let e=r.getPossibleValues().map(In);return e.includes(2)?2:e.includes(1)&&1}catch(e){}return r.is("template")||r.is("magic-word")&&r.name==="invoke"?1:2},vi=(o,r,e,t)=>({line:o+e-1,character:(e===1?r:0)+t}),mo=o=>(r,e,t,n,i="error")=>{let{start:s}=e,{top:a,left:l}=e instanceof W?e:new W(r,s),{offsetHeight:u,offsetWidth:g}=r,{startIndex:d,startLine:p,startCol:c}=o(r,s,a,l),{line:f,character:h}=vi(p,c,u,g);return{rule:t,message:v.msg(n),severity:i,startIndex:d,endIndex:d+r.toString().length,startLine:p,endLine:f,startCol:c,endCol:h}},j=mo((o,r,e,t)=>{let n=o.getRelativeIndex(),{top:i,left:s}=o.parentNode.posFromIndex(n);return{startIndex:r+n,startLine:e+i,startCol:i?s:t+s}}),F=mo((o,r,e,t)=>({startIndex:r,startLine:e,startCol:t})),me=(o,r,e,t=0)=>({desc:v.msg(r),range:[o.startIndex+t,o.endIndex],text:e}),er=(o,r,e)=>({desc:v.msg(r),range:[o,o],text:e}),O=(o,r=0,e="")=>typeof o=="number"?{desc:v.msg("remove"),range:[o,o+r],text:e}:me(o,"remove",e,r),Fn=(o,r)=>me(o,"decode",At(r.text().replace(/%(?=21|3[ce]|5[bd]|7[b-d])/giu,"%25"))),Le=(o,r,e=0)=>({desc:v.msg("close"),range:[o+e,o],text:r}),Rn=o=>({desc:v.msg("open"),range:[o+1,o+2],text:""}),Pn=(o,r)=>me(o,"comment",`<!--${r}-->`),Bn=(o,r)=>me(o,"uppercase",r.toUpperCase()),st=(o,r=0)=>({desc:v.msg("whitespace"),range:[o,o+r],text:" "}),Ge=(o,r,e=1)=>({desc:v.msg("escape"),range:[o,o+e],text:r.repeat(e)}),jn=(o,r)=>({desc:v.msg("escape"),range:[o,o+r.length],text:r.replace(/\|/gu,"|")}),je=(o,r,e,t)=>{if(o&&(t||v.viewOnly&&o[0]===oe.rev))return o[1];let n=r();return(t||v.viewOnly)&&e([oe.rev,n]),n},ho=(o,r)=>o==="ol"&&r==="type"?["1","a","A","i","I"]:o==="th"&&r==="scope"?["row","col","rowgroup","colgroup"]:r==="dir"?["ltr","rtl","auto"]:r==="aria-hidden"?["true","false"]:[]});var Gd,On,Ai=w(()=>{"use strict";Gd=o=>{if(o.includes("#")){let r=o.indexOf("#"),e=o.slice(0,r),t=o.slice(r+1);return(n,i)=>(r===0||n===e)&&i===t}return r=>r===o},On=(o,r,e)=>{if(o=o.trim(),!o)return(()=>!0);let t=o.split(",").map(n=>n.trim()).filter(n=>n!=="").map(Gd);return(({type:n,name:i})=>t.some(s=>s(n,i)))}});var xo=io(($u,bo)=>{bo.exports=function(o,r,e,t,n){var i,s;if(t===void 0)t=0;else if(t=t|0,t<0||t>=o.length)throw new RangeError("invalid lower bound");if(n===void 0)n=o.length-1;else if(n=n|0,n<t||n>=o.length)throw new RangeError("invalid upper bound");for(;t<=n;)if(i=t+(n-t>>>1),s=+e(o[i],r,i,o),s<0)t=i+1;else if(s>0)n=i-1;else return i;return~t}});var yo,To,ko=w(()=>{"use strict";yo=Pd(xo()),To=(o,r,e)=>{let t=(0,yo.default)(o,r,e);return t<0?~t:t}});var tr,qn=w(()=>{"use strict";z();tr=(o=!0)=>r=>{let e=new WeakMap;return function(...t){return je(e.get(this),()=>r.apply(this,t),n=>{e.set(this,n)},o)}}});var vo,Ao=w(()=>{"use strict";vo=o=>{class r extends o{get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get offsetHeight(){return this.getDimension().height}get offsetWidth(){return this.getDimension().width}}return r}});var So,Co,Mr,rr,nr,Ur,ir,sr,Dr,Oe,Si=w(()=>{"use strict";ze();ko();z();Se();qn();Ao();D();Co=[vo],So=[tr(!1)];Oe=class{constructor(){R(Dr,5,this);ce(this,"childNodes",[]);S(this,Mr);S(this,rr);S(this,nr);S(this,Ur);S(this,ir);S(this,sr,{})}get parentNode(){return m(this,Mr)}get nextSibling(){return m(this,rr)}get previousSibling(){return m(this,nr)}getChildNodes(){let{childNodes:r}=this;return Object.isFrozen(r)?[...r]:r}getAttribute(r){return r==="padding"?0:this[r]}setAttribute(r,e){switch(r){case"parentNode":C(this,Mr,e),e||(C(this,rr,void 0),C(this,nr,void 0));break;case"nextSibling":C(this,rr,e);break;case"previousSibling":C(this,nr,e);break;case"aIndex":v.viewOnly&&C(this,ir,[oe.rev,e]);break;default:this[r]=e}}getRootNode(){return je(m(this,Ur),()=>{var r,e;return(e=(r=this.parentNode)==null?void 0:r.getRootNode())!=null?e:this},r=>{let[,e]=r;e.type==="root"&&C(this,Ur,r)})}indexFromPos(r,e){{if(r<0||e<0)return;let t=this.getLines();if(r>=t.length)return;let[,n,i]=t[r],s=n+e;return s>i?void 0:s}}posFromIndex(r){{let{length:e}=String(this);if(r+=r<0?e:0,r>=0&&r<=e){let t=this.getLines(),n=To(t,r,([,,i],s)=>i-s);return{top:n,left:r-t[n][1]}}return}}getDimension(){{let r=this.getLines(),e=r[r.length-1];return{height:r.length,width:e[2]-e[1]}}}getGaps(r){return 0}getRelativeIndex(r){if(r===void 0){let{parentNode:e}=this;return e?e.getRelativeIndex(e.childNodes.indexOf(this)):0}return je(m(this,sr)[r],()=>{let{childNodes:e}=this,t=r+(r<0?e.length:0),n=this.getAttribute("padding");for(let i=0;i<t;i++)v.viewOnly&&(m(this,sr)[i]=[oe.rev,n]),n+=e[i].toString().length+this.getGaps(i);return n},e=>{m(this,sr)[r]=e})}getAbsoluteIndex(){return je(m(this,ir),()=>{let{parentNode:r}=this;return r?r.getAbsoluteIndex()+this.getRelativeIndex():0},r=>{C(this,ir,r)})}getBoundingClientRect(){this.lspError("AstNode.getBoundingClientRect")}is(r){return this.type===r}getLines(){return $n(String(this))}seal(r,e){}lspError(r){throw new Error(`${r} method is only available in the LSP version!`)}};Dr=B(null),Mr=new WeakMap,rr=new WeakMap,nr=new WeakMap,Ur=new WeakMap,ir=new WeakMap,sr=new WeakMap,P(Dr,1,"getLines",So,Oe),Oe=P(Dr,0,"AstNode",Co,Oe),R(Dr,1,Oe)});var wo,Eo=w(()=>{"use strict";Ai();wo=o=>{var r,Ci;{class t extends o{constructor(){super(...arguments);S(this,r)}getElementBy(s){let a=[...this.childNodes].reverse();for(;a.length>0;){let l=a.pop(),{type:u,childNodes:g}=l;if(u!=="text"){if(s(l))return l;for(let d=g.length-1;d>=0;d--)a.push(g[d])}}}querySelector(s){return this.getElementBy(I(this,r,Ci).call(this,s))}getElementsBy(s){let a=[...this.childNodes].reverse(),l=[];for(;a.length>0;){let u=a.pop(),{type:g,childNodes:d}=u;if(g!=="text"){s(u)&&l.push(u);for(let p=d.length-1;p>=0;p--)a.push(d[p])}}return l}querySelectorAll(s){return this.getElementsBy(I(this,r,Ci).call(this,s))}escape(){}}return r=new WeakSet,Ci=function(s){return On(s,this)},t}}});var Lo,wi,Hd,St,No=w(()=>{"use strict";ae();Se();Ai();Si();Eo();Lo=[wo];St=class extends(Hd=Oe){get length(){return this.childNodes.length}text(r){return Ee(this.childNodes,r)}removeAt(r){this.lspError("AstElement.removeAt")}insertAt(r,e=this.length){return _n(this,e,0,[r]),r}closest(r){let e=On(r,this),{parentNode:t}=this;for(;t;){if(e(t))return t;({parentNode:t}=t)}}isInside(r){var e;return((e=this.closest(`${r},ext`))==null?void 0:e.type)===r}append(...r){this.safeAppend(r)}safeAppend(r){for(let e of r)this.insertAt(e)}safeReplaceChildren(r){}setText(r,e=0){e+=e<0?this.length:0;let t=this.childNodes[e],{data:n}=t;return t.replaceData(r),n}toString(r,e=""){return this.childNodes.map(t=>t.toString(r)).join(e)}caretPositionFromIndex(r){this.lspError("AstElement.caretPositionFromIndex")}elementFromIndex(r){this.lspError("AstElement.elementFromIndex")}elementFromPoint(r,e){this.lspError("AstElement.elementFromPoint")}lint(r=this.getAbsoluteIndex(),e){{let t=[];for(let n=0,i=r+this.getAttribute("padding");n<this.length;n++){let s=this.childNodes[n];s.setAttribute("aIndex",i);let a=s.lint(i,e);a.length>0&&Array.prototype.push.apply(t,a),i+=s.toString().length+this.getGaps(n)}return t}}print(r={}){}json(r,e=1/0,t=this.getAbsoluteIndex()){}};wi=B(Hd),St=P(wi,0,"AstElement",Lo,St),R(wi,1,St)});var Ei,Io,Vd,Qd,Xd,Jd,$o,Kd,Wn,Fo,zr,Ro=w(()=>{"use strict";ae();z();D();Si();Ei=String.raw`[${Ie}\t]*`,Io=String.raw`<(?:/[^\S\n]*)?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|\n={2,}`,Vd=new RegExp(String.raw`${Io}|\bhttps?[:/]/+|\b(?:rfc|pmid)(?=[-::]?${Ei}\d)|\bisbn(?=[-::]?${Ei}(?:\d(?:${Ei}|-)){6})`,"giu"),Qd=new RegExp(Io,"giu"),Xd=new Set(["attr-value","ext-link-text","link-text"]),Jd={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},$o=new Set(["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"]),Kd=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch(o){return/\w/u}})(),zr=class extends Oe{constructor(e){super();S(this,Wn);ce(this,"data","");this.data=e}get type(){return"text"}toString(e){var t;return e&&!((t=this.parentNode)!=null&&t.getAttribute("built"))?re(this.data):this.data}text(){return this.data}lint(e=this.getAbsoluteIndex(),t){var n,i,s;{if(t===!1)return[];let{data:a,parentNode:l,nextSibling:u,previousSibling:g}=this;if(!l)throw new Error("An isolated text node cannot be linted!");let{type:d,parentNode:p}=l;if(d==="attr-value"){let{name:_,tag:U}=p;if(U==="ref"&&(_==="name"||_==="follow")||_==="group"&&(U==="ref"||U==="references")||U==="choose"&&(_==="before"||_==="after"))return[]}if(t!=null||(t=l.isPlain()&&!Xd.has(d)?Vd:Qd),a.search(t)===-1)return[];t.lastIndex=0;let c=[],f=u==null?void 0:u.type,h=u==null?void 0:u.name,x=g==null?void 0:g.type,T=this.getRootNode(),b=T.toString(),{ext:y,html:k,variants:A}=T.getAttribute("config"),{top:N,left:E}=T.posFromIndex(e),{lintConfig:$}=v,H=$.rules["tag-like"],q=typeof H=="object"&&H[1]?new Set(Object.keys(H[1]).filter(_=>_!=="invalid"&&_!=="disallowed")):new Set,K=new Set(["onlyinclude","noinclude","includeonly",...y,...k[0],...k[1],...k[2],...q,...$.getSeverity("tag-like","disallowed")?$o:[]]);for(let _=t.exec(a);_;_=t.exec(a)){let{index:U,0:M}=_,[,be,Jt]=_,bt=M==="["&&d==="ext-link-text";if(Jt&&Jt!=="]"){let{length:ie}=Jt;U+=ie,M=M.slice(ie)}else{if(M.startsWith("<")&&!K.has(be.toLowerCase())||bt&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(a.slice(U+1))||u!=null&&u.is("ext")&&h==="nowiki"&&((n=u.innerText)!=null&&n.includes("]"))))continue;M.startsWith(`
|
|
3
|
-
==`)&&(U++,M=M.slice(1))}M=M.toLowerCase();let[Y]=M,xt=M==="rfc"||M==="pmid"||M==="isbn"
|
|
4
|
-
`,U),we=
|
|
5
|
-
`),$e!==-1));)we=we.nextSibling;if(!we)continue;We=we.data.slice(0,$e)}else We=a.slice(U+it,ie);if(!/(?:^|[^=])=+\s*(?:\S\s*)?$/u.test(We))continue;ie===-1?(yt=we.getAbsoluteIndex()+We.length,{top:An,left:Sn}=T.posFromIndex(yt)):(yt+=We.length,it+=We.length)}let kt={rule:fe,message:v.msg(Y==="="?"header-like":"lonely",xt||Y==="h"||fi||ci?M:Y),severity:Pe,startIndex:Kt,endIndex:yt,startLine:Ks,endLine:An!=null?An:Ks,startCol:Ys,endCol:Sn!=null?Sn:Ys+it};if($.computeEditInfo)if(Y==="<")kt.suggestions=[Ge(Kt,"<")];else if(Y==="h"&&d!=="link-text"&&Kd.test(ui||""))kt.suggestions=[st(Kt)];else if(bt){let ie=l.getAbsoluteIndex()+l.toString().length;kt.suggestions=[Ge(ie,"]")]}else if(M==="]"&&Xs){let ie=e-g.toString().length;kt.suggestions=[er(ie,"left-bracket","[")]}else xt&&(kt.suggestions=[..._[0]===M?[]:[Bn(kt,M)],...Tt===":"||Tt===":"?[st(yt,1)]:[]]);c.push(kt)}return c}}replaceData(e){I(this,Wn,Fo).call(this,e)}splitText(e){this.lspError("AstText.splitText")}escape(){}print(){}};Wn=new WeakSet,Fo=function(e){this.setAttribute("data",e)}});var ve,ot=w(()=>{"use strict";ve=(o=!0,r=!0)=>e=>{class t extends e{text(){return""}lint(i){return o?[]:super.lint(i)}}return t}});var Q,xe=w(()=>{"use strict";Q=o=>{}});var Gr,he,at=w(()=>{"use strict";G();he=class extends L{constructor(e,t,n,i,s){super(e,n,i,s);S(this,Gr);C(this,Gr,t)}get type(){return m(this,Gr)}lint(e=this.getAbsoluteIndex()){return super.lint(e,!1)}};Gr=new WeakMap});var ue,qe=w(()=>{"use strict";ue=({length:o})=>r=>{class e extends r{getAttribute(n){return n==="padding"?o:super.getAttribute(n)}}return e}});var or,pe,lt=w(()=>{"use strict";G();pe=class extends L{constructor(e,t,n,i,s){super(e,n,i,s);S(this,or);C(this,or,t)}get type(){return m(this,or)}set type(e){C(this,or,e)}getAttribute(e){var t;return e==="invalid"?this.type==="converter-flag"&&!!((t=this.parentNode)!=null&&t.isInvalidFlag(this)):super.getAttribute(e)}};or=new WeakMap});var Po,ar,He,dt,Dn,Bo,Li,Yd,ye,lr=w(()=>{"use strict";z();Se();se();qe();xe();D();G();lt();Po=[Q,ue("[[")];ye=class extends(Yd=L){constructor(e,t,n,i=[],s="|"){super(void 0,n,i,{});S(this,Dn);S(this,ar,!0);S(this,He);S(this,dt);if(this.insertAt(new pe(e,"link-target",n,i,{})),t!==void 0){let a=new L(t,n,i,{});a.type="link-text",a.setAttribute("stage",10),this.insertAt(a)}C(this,He,s)}get link(){}get fragment(){}afterBuild(){C(this,dt,this.getTitle()),m(this,He).includes("\0")&&C(this,He,this.buildFromStr(m(this,He),0)),I(this,Dn,Bo).call(this),super.afterBuild()}setAttribute(e,t){e==="bracket"?C(this,ar,t):e==="title"?C(this,dt,t):super.setAttribute(e,t)}toString(e){let t=super.toString(e,m(this,He));return m(this,ar)?`[[${t}]]`:t}text(){let e=super.text("|");return m(this,ar)?`[[${e}]]`:e}getAttribute(e){return e==="title"?m(this,dt):super.getAttribute(e)}getGaps(e){return e===0?m(this,He).length:1}lint(e=this.getAbsoluteIndex(),t){{let n=super.lint(e,t),{childNodes:[i,s],type:a}=this,{encoded:l,fragment:u}=m(this,dt),{lintConfig:g}=v,{computeEditInfo:d,fix:p}=g,c=new W(this,e),f="unknown-page",h=g.getSeverity(f);if(h&&i.childNodes.some(({type:x})=>x==="template")&&n.push(j(i,c,f,"template-in-link",h)),f="url-encoding",h=g.getSeverity(f),h&&l){let x=j(i,c,f,"unnecessary-encoding",h);(d||p)&&(x.fix=Fn(x,i)),n.push(x)}if(f="pipe-like",h=g.getSeverity(f,"link"),h&&(a==="link"||a==="category")){let x=s==null?void 0:s.childNodes.findIndex(b=>b.type==="text"&&b.data.includes("|")),T=s==null?void 0:s.childNodes[x];if(T){let b=j(s,c,f,"pipe-in-link",h);if(d){let y=b.startIndex+s.getRelativeIndex(x);b.suggestions=[jn(y,T.data)]}n.push(b)}}if(f="no-ignored",h=g.getSeverity(f,"fragment"),h&&u!==void 0&&!jo(a)){let x=j(i,c,f,"useless-fragment",h);if(d||p){let T=i.childNodes.findIndex(y=>y.type==="text"&&y.data.includes("#")),b=i.childNodes[T];b&&(x.fix=O(x,i.getRelativeIndex(T)+b.data.indexOf("#")))}n.push(x)}return n}}getTitle(e,t){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:t,temporary:e,decode:!0,selfLink:!0})}print(){}json(e,t,n=this.getAbsoluteIndex()){}};Li=B(Yd),ar=new WeakMap,He=new WeakMap,dt=new WeakMap,Dn=new WeakSet,Bo=function(){this.type!=="ext-inner"&&this.setAttribute("name",m(this,dt).title)},ye=P(Li,0,"LinkBaseToken",Po,ye),R(Li,1,ye)});var Oo,Ni,Zd,le,gt=w(()=>{"use strict";xe();G();Oo=[Q];le=class extends(Zd=L){get innerText(){return this.firstChild.data}constructor(r="",e,t){super(r,e,t)}};Ni=B(Zd),le=P(Ni,0,"NowikiBaseToken",Oo,le),R(Ni,1,le)});var qo,$i,eg,de,Ct=w(()=>{"use strict";z();ot();D();gt();qo=[ve(!1)];de=class extends(eg=le){get type(){return"noinclude"}toString(r){return r?"":super.toString()}lint(r=this.getAbsoluteIndex()){{let{lintConfig:e}=v,t="no-ignored",n=e.getSeverity(t,"include");if(n){let{innerText:i}=this,s=/^<(includeonly|(?:no|only)include)\s+(?:[^\s>/]|\/(?!>))[^>]*>$/iu.exec(i);if(s){let a=F(this,{start:r},t,"useless-attribute",n),{computeEditInfo:l}=e,u=s[1].length+1,g=i.endsWith("/>")?2:1;return a.startIndex+=u,a.startCol+=u,a.endIndex-=g,a.endCol-=g,l&&(a.suggestions=[O(a)]),[a]}}return[]}}};$i=B(eg),de=P($i,0,"NoincludeToken",qo,de),R($i,1,de)});var Mn,_o=w(()=>{"use strict";z();D();lr();Ct();Mn=class extends ye{get type(){return"redirect-target"}constructor(r,e,t,n){super(r,void 0,t,n),e!==void 0&&this.insertAt(new de(e,t,n))}getTitle(){return this.normalizeTitle(this.firstChild.toString(),0,{halfParsed:!0,decode:!0,page:""})}lint(r=this.getAbsoluteIndex()){{let e=super.lint(r,!1),t="no-ignored",{lintConfig:n}=v,i=n.getSeverity(t,"redirect");if(i&&this.length===2){let s=j(this.lastChild,{start:r},t,"useless-link-text",i);s.startIndex--,s.startCol--,(n.computeEditInfo||n.fix)&&(s.fix=O(s)),e.push(s)}return e}}}});var Wo,Et,Hr,Ii,tg,wt,Do=w(()=>{"use strict";ot();xe();G();at();_o();Wo=[ve(!1,!1),Q];wt=class extends(tg=L){constructor(e,t,n,i,s,a,l=[]){super(void 0,a,l);S(this,Et);S(this,Hr);C(this,Et,e),C(this,Hr,s),this.append(new he(t,"redirect-syntax",a,l),new Mn(n,i==null?void 0:i.slice(1),a,l))}get type(){return"redirect"}getAttribute(e){return e==="padding"?m(this,Et).length:super.getAttribute(e)}toString(e){return m(this,Et)+super.toString(e)+m(this,Hr)}lint(e=this.getAbsoluteIndex()){{let t=e+m(this,Et).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",t),this.lastChild.lint(t)}}print(){}};Ii=B(tg),Et=new WeakMap,Hr=new WeakMap,wt=P(Ii,0,"RedirectToken",Wo,wt),R(Ii,1,wt)});var Mo={};Z(Mo,{parseRedirect:()=>rg});var rg,Uo=w(()=>{"use strict";D();Do();rg=(o,r,e)=>{var n;(n=r.regexRedirect)!=null||(r.regexRedirect=new RegExp(String.raw`^(\s*)((?:${r.redirection.join("|")})\s*(?::\s*)?)\[\[([^\n|\]]+)(\|.*?)?\]\](\s*)`,"iu"));let t=r.regexRedirect.exec(o);return t&&v.normalizeTitle(t[3],0,!1,r,{halfParsed:!0,temporary:!0,decode:!0,page:""}).valid?(o=`\0${e.length}o${o.slice(t[0].length)}`,new wt(...t.slice(1),r,e),o):!1}});var zo,Fi,ng,Lt,Go=w(()=>{"use strict";qe();xe();G();zo=[Q,ue("<onlyinclude>")];Lt=class extends(ng=L){get type(){return"onlyinclude"}toString(r){return`<onlyinclude>${super.toString(r)}</onlyinclude>`}isPlain(){return!0}print(){}};Fi=B(ng),Lt=P(Fi,0,"OnlyincludeToken",zo,Lt),R(Fi,1,Lt)});var ut,Vr=w(()=>{"use strict";ut=(o=1)=>r=>{class e extends r{getGaps(){return o}}return e}});var Ho,Nt,pt,Ri,ig,Fe,Un=w(()=>{"use strict";Vr();xe();G();Ho=[ut(),Q];Fe=class extends(ig=L){constructor(e,t,n,i,s,a=[]){super(void 0,s);S(this,Nt);S(this,pt);ce(this,"closed");this.setAttribute("name",e.toLowerCase()),C(this,Nt,[e,i||e]),this.closed=i!=="",C(this,pt,i===void 0),this.append(t,n);let l=typeof t=="string"?-1:a.indexOf(t);a.splice(l===-1?1/0:l,0,this)}get innerText(){return m(this,pt)?void 0:this.lastChild.text()}get selfClosing(){return m(this,pt)}toString(e){let{firstChild:t,lastChild:n}=this,[i,s]=m(this,Nt);return m(this,pt)?`<${i}${t.toString(e)}/>`:`<${i}${t.toString(e)}>${n.toString(e)}${this.closed?`</${s}>`:""}`}text(){let[e,t]=m(this,Nt);return m(this,pt)?`<${e}${this.firstChild.text()}/>`:`<${e}${super.text(">")}${this.closed?`</${t}>`:""}`}getAttribute(e){return e==="padding"?m(this,Nt)[0].length+1:super.getAttribute(e)}print(){}json(e,t,n=this.getAbsoluteIndex()){}};Ri=B(ig),Nt=new WeakMap,pt=new WeakMap,Fe=P(Ri,0,"TagPairToken",Ho,Fe),R(Ri,1,Fe)});var Vo,Pi,sg,$t,Qo=w(()=>{"use strict";z();se();ot();D();Un();Vo=[ve(!1)];$t=class extends(sg=Fe){get type(){return"include"}constructor(r,e="",t,n,i,s){super(r,e,t!=null?t:"",t===void 0||n!=null?n:"",i,s)}toString(r){return r?"":super.toString()}lint(r=this.getAbsoluteIndex()){{let e=[],{firstChild:t,closed:n,name:i}=this,s=new W(this,r),a=["no-ignored","unclosed-comment"],{lintConfig:l}=v,{computeEditInfo:u}=l,g=a.map(d=>l.getSeverity(d,"include"));if(g[0]&&t.data.trim()){let d=j(t,s,a[0],"useless-attribute",g[0]);u&&(d.suggestions=[O(d)]),e.push(d)}if(g[1]&&!n){let d=F(this,s,a[1],v.msg("unclosed",`<${i}>`),g[1]);u&&(d.suggestions=[Le(d.endIndex,`</${i}>`)]),e.push(d)}return e}}};Pi=B(sg),$t=P(Pi,0,"IncludeToken",Vo,$t),R(Pi,1,$t)});var dr,zn=w(()=>{"use strict";dr=(o=0)=>r=>{var e,Xo;{class n extends r{constructor(){super(...arguments);S(this,e)}hasAttr(a){this.lspError("AttributesParent.hasAttr")}getAttr(a){return I(this,e,Xo).call(this).getAttr(a)}}return e=new WeakSet,Xo=function(){return this.childNodes[o]},n}}});var ne,Jo,Ko,Gn,ji,Yo,Hn,ra,na,ia,Bi,Zo,ea,ta,It,sa,oa,aa,la,da,Oi=w(()=>{"use strict";ne=new Set(["align"]),Jo=new Set(["cite"]),Ko=new Set(["cite","datetime"]),Gn=new Set(["width"]),ji=new Set(["axis","align","bgcolor","height","width","valign"]),Yo=new Set([...ji,"abbr","headers","scope","rowspan","colspan"]),Hn=new Set(["type"]),ra=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),na=new Set(["clear"]),ia=new Set(["bgcolor","align","valign"]),Bi=new Set(["id","qid","forcemathmode","type","display"]),Zo=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),ea=new Set(["weight"]),ta=new Set(["width","height","zoom","latitude","longitude","align","mapstyle","lang","alt","text"]),It=new Set,sa=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"]),oa={div:ne,h1:ne,h2:ne,h3:ne,h4:ne,h5:ne,h6:ne,blockquote:Jo,q:Jo,p:ne,br:na,pre:Gn,ins:Ko,del:Ko,ul:Hn,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...ra,"border"]),caption:ne,tr:ia,td:Yo,th:Yo,font:new Set(["size","color","face"]),hr:Gn,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:Hn,poem:ne,categorytree:ne,combooption:ne,img:new Set(["alt","src","width","height","loading","srcset"])},aa={pre:new Set(["format"]),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:It,indicator:new Set(["name"]),langconvert:new Set(["from","to"]),ref:new Set(["group","name","follow","dir","details"]),references:new Set(["group","responsive"]),charinsert:new Set(["label"]),choose:new Set(["uncached","before","after"]),option:ea,choicetemplate:ea,imagemap:It,inputbox:It,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:It,poll:new Set(["id","show-results-before-voting"]),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"]),math:new Set([...Bi,"chem"]),chem:Bi,ce:Bi,hiero:It,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:Zo,syntaxhighlight:Zo,templatedata:It,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:It,mapframe:new Set([...ta,"frameless"]),maplink:new Set([...ta,"class"]),rss:new Set(["template","templatename","max","highlight","filter","filterout","reverse","date","item-max-length"]),"page-collection":new Set(["lang","name","description","end-date"])},la={table:ra,td:new Set([...ji,"scope"]),th:ji,br:na,caption:ne,div:ne,hr:Gn,h1:ne,h2:ne,h3:ne,h4:ne,h5:ne,h6:ne,li:Hn,p:ne,pre:Gn,tr:ia,ul:Hn},da={dynamicpagelist:["category","notcategory","namespace","count","offset","imagewidth","imageheight","imagesperrow","mode","gallerycaption","galleryshowfilesize","galleryshowfilename","order","ordermethod","redirects","stablepages","qualitypages","suppresserrors","addfirstcategorydate","shownamespace","ignoresubpages","googlehack","nofollow"],inputbox:["preloadparams[]","type","width","preload","preloadtitle","page","editintro","useve","usedt","summary","nosummary","minor","break","default","placeholder","bgcolor","buttonlabel","searchbuttonlabel","fulltextbutton","namespaces","labeltext","hidden","id","inline","prefix","dir","searchengine","searchtype","searchfilter","tour","arialabel"]}});var og,ag,lg,dg,Qr,gr,Te,Ve,Ft,ga,qi,ur,ua=w(()=>{"use strict";z();ae();Oi();se();D();G();lt();og=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,ag=/(?:^|\s|\*\/)(?:java|vb)script(?:\W|$)/iu,lg=new Set(["ext","arg","magic-word","template"]),dg=new Set(["about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),ur=class extends L{constructor(e,t,n,i,s,a="",l,u=[]){let g=new pe(n,"attr-key",s,u),d;if(n==="title"||t==="img"&&n==="alt")d=new L(l,s,u,{}),d.type="attr-value",d.setAttribute("stage",10);else if(t==="gallery"&&n==="caption"||t==="ref"&&n==="details"||(t==="mapframe"||t==="maplink")&&n==="text"||t==="choose"&&(n==="before"||n==="after")){let p=ge(V({},s),{excludes:[...s.excludes,"heading","html","table","hr","list"]});d=new L(l,p,u,{}),d.type="attr-value",d.setAttribute("stage",1)}else d=new pe(l,"attr-value",s,u,{});super(void 0,s,u);S(this,Ft);S(this,Qr);S(this,gr);S(this,Te);S(this,Ve);C(this,Qr,e),this.append(g,d),C(this,Te,a),C(this,Ve,[...i]),C(this,gr,t),this.setAttribute("name",Ue(re(n)))}get type(){return m(this,Qr)}get tag(){return m(this,gr)}get balanced(){return!m(this,Te)||m(this,Ve)[0]===m(this,Ve)[1]}afterBuild(){m(this,Te).includes("\0")&&C(this,Te,this.buildFromStr(m(this,Te),0)),this.parentNode&&C(this,gr,this.parentNode.name),I(this,Ft,ga).call(this),super.afterBuild()}toString(e){let[t="",n=""]=m(this,Ve);return m(this,Te)?super.toString(e,m(this,Te)+t)+n:this.firstChild.toString(e)}text(){return m(this,Te)?`${super.text(`${m(this,Te).trim()}"`)}"`:this.firstChild.text()}getGaps(){var e,t;return m(this,Te)?m(this,Te).length+((t=(e=m(this,Ve)[0])==null?void 0:e.length)!=null?t:0):0}lint(e=this.getAbsoluteIndex(),t){var n;{let i=super.lint(e,t),{balanced:s,firstChild:a,lastChild:l,name:u,tag:g}=this,d=new W(this,e),p=["unclosed-quote","obsolete-attr"],{lintConfig:c}=v,f=p.map(x=>c.getSeverity(x,u));if(f[0]&&!s){let x=j(l,d,p[0],"unclosed-quotes",f[0]);x.startIndex--,x.startCol--,c.computeEditInfo&&(x.suggestions=[Le(x.endIndex,m(this,Ve)[0])]),i.push(x)}let h=I(this,Ft,qi).call(this,e,d);return h&&i.push(h),f[1]&&((n=la[g])!=null&&n.has(u))&&i.push(j(a,d,p[1],"obsolete-attribute",f[1])),i}}getValue(){return m(this,Te)?this.lastChild.text().trim():this.type==="ext-attr"||""}escape(){}getAttribute(e){return e==="invalid"?I(this,Ft,qi).call(this):super.getAttribute(e)}print(){}json(e,t,n=this.getAbsoluteIndex()){}};Qr=new WeakMap,gr=new WeakMap,Te=new WeakMap,Ve=new WeakMap,Ft=new WeakSet,ga=function(){this.setAttribute("name",Ue(this.firstChild.text()))},qi=function(e,t){let{firstChild:n,lastChild:i,type:s,name:a,tag:l,parentNode:u}=this,g=!i.childNodes.some(({type:b})=>lg.has(b)),d=this.getValue(),p=aa[l],c=oa[l],{length:f}=this.toString(),h="illegal-attr",x,T;if({lintConfig:x}=v,{computeEditInfo:T}=x,!(p!=null&&p.has(a))&&!(c!=null&&c.has(a))&&(s==="ext-attr"?p||c:!/\{\{[^{]+\}\}/u.test(a))&&(s==="ext-attr"&&!c||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(a)&&(l==="meta"||l==="link"||!sa.has(a)))||(a==="itemtype"||a==="itemid"||a==="itemref")&&!(u!=null&&u.hasAttr("itemscope"))){if(e===void 0)return!0;{let b=x.getSeverity(h,"unknown");if(b){let y=j(n,t,h,"illegal-attribute-name",b);return T&&(y.suggestions=[O(e,f)]),y}}}else if(a==="style"&&typeof d=="string"&&og.test(d)){if(e===void 0)return!0;{h="insecure-style";let b=x.getSeverity(h);return b&&j(i,t,h,"insecure-style",b)}}else if(a==="tabindex"&&typeof d=="string"&&d!=="0"){if(e===void 0)return!0;{let b=x.getSeverity(h,"tabindex");if(b){let y=j(i,t,h,"nonzero-tabindex",b);return T&&(y.suggestions=[O(e,f),me(y,"0 tabindex","0")]),y}}}else if(typeof d=="string"&&((/^xmlns:[\w:.-]+$/u.test(a)||dg.has(a))&&ag.test(d)||g&&(a==="href"||l==="img"&&a==="src")&&!new RegExp(String.raw`^(?:${this.getAttribute("config").protocol}|//)\S+$`,"iu").test(d))){if(e===void 0)return!0;{let b=x.getSeverity(h,"value");return b&&j(i,t,h,"illegal-attribute-value",b)}}else if(g&&s!=="ext-attr"){let b=ho(l,a),y=String(d).toLowerCase();if(b.length>0&&b.every(k=>k!==y)){if(e===void 0)return!0;{let k=x.getSeverity(h,"value");return k&&j(i,t,h,"illegal-attribute-value",k)}}}return!1}});var pa,gg,ug,Xr,Jr,_i,ft,Vn=w(()=>{"use strict";z();ae();se();D();G();lt();ua();pa=o=>o.slice(0,-1),gg=o=>`${pa(o)}-dirty`,ug=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch(o){return/[^\W_]/u}})(),ft=class extends L{constructor(e,t,n,i,s=[]){super(void 0,i,s,{});S(this,Jr);S(this,Xr);if(C(this,Xr,t),this.setAttribute("name",n),e){let a=/([^\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=a.exec(e),g=0,d=()=>{l&&(super.insertAt(new pe(l,gg(t),i,s,{})),l="")};for(;u;){let{index:p,0:c,1:f,2:h,3:x,4:T,5:b,6:y}=u;if(l+=e.slice(g,p),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(re(f).trim())){let k=T!=null?T:y,A=[x,b],N=new ur(pa(t),n,f,A,i,h,k,s);d(),super.insertAt(N)}else l+=c;({lastIndex:g}=a),u=a.exec(e)}l+=e.slice(g),d()}}get type(){return m(this,Xr)}afterBuild(){let{parentNode:e}=this;e!=null&&e.is("td")&&this.setAttribute("name",e.subtype),super.afterBuild()}getAttrTokens(e){return this.childNodes.filter(t=>t instanceof ur&&(!e||t.name===Ue(e)))}hasAttr(e){return this.getAttrTokens(e).length>0}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 n=super.lint(e,t),{parentNode:i,childNodes:s}=this,a=new Map,l=new Set,u=new W(this,e),g=["no-ignored","no-duplicate"],{lintConfig:d}=v,{computeEditInfo:p,fix:c}=d,f=["closingTag","invalidAttributes","nonWordAttributes"].map(x=>d.getSeverity(g[0],x));if(f[0]&&I(this,Jr,_i).call(this)){let x=F(this,u,g[0],"attributes-of-closing-tag",f[0]);if(p){let T=i.getAbsoluteIndex();x.suggestions=[O(x),Rn(T)]}n.push(x)}for(let x of s)if(x instanceof ur){let{name:T}=x;a.has(T)?(l.add(T),a.get(T).push(x)):a.set(T,[x])}else{let T=x.text().trim(),b=f[ug.test(T)?1:2];if(T&&b){let y=j(x,u,g[0],"invalid-attribute",b);p&&(y.suggestions=[O(y,0," ")]),n.push(y)}}let h=d.getSeverity(g[1],"attribute");if(h&&l.size>0)for(let x of l){let T=a.get(x).map(b=>{let y=b.getValue();return[b,y===!0?"":y]});Array.prototype.push.apply(n,T.map(([b,y],k)=>{let A=j(b,u,g[1],v.msg("duplicate-attribute",x),h);if(p||c){let N=O(A);!y||T.slice(0,k).some(([,E])=>E===y)?A.fix=N:p&&(A.suggestions=[N])}return A}))}return n}}escape(){}getAttribute(e){return e==="invalid"?I(this,Jr,_i).call(this):super.getAttribute(e)}print(){}};Xr=new WeakMap,Jr=new WeakSet,_i=function(){let{parentNode:e}=this;return(e==null?void 0:e.type)==="html"&&e.closing&&this.text().trim()!==""}});var fa={};Z(fa,{PreToken:()=>Wi});var Wi,ca=w(()=>{"use strict";G();Ct();Wi=class extends L{get type(){return"ext-inner"}constructor(r,e,t=[]){if(r){let n=/<nowiki>/giu,i=/<\/nowiki>/giu,{length:s}=n.source,a=n.exec(r);a&&(i.lastIndex=a.index+s);let l=i.exec(r),u=0,g="";for(;a&&l;)new de(a[0],e,t,!0),new de(l[0],e,t,!0),g+=`${r.slice(u,a.index)}\0${t.length-1}n${r.slice(a.index+s,l.index)}\0${t.length}n`,u=l.index+s+1,n.lastIndex=u,a=n.exec(r),a&&(i.lastIndex=a.index+s),l=i.exec(r);r=g+r.slice(u)}super(r,e,t,{}),this.setAttribute("stage",10)}isPlain(){return!0}lint(r=this.getAbsoluteIndex()){return super.lint(r,/<\s*\/\s*(pre)\b/giu)}}});var ct,Qn=w(()=>{"use strict";G();ct=class extends L{get type(){return"ext-inner"}toString(r){return super.toString(r,`
|
|
1
|
+
"use strict";(()=>{var eo=Object.create;var vt=Object.defineProperty,$d=Object.defineProperties,to=Object.getOwnPropertyDescriptor,Id=Object.getOwnPropertyDescriptors,Fd=Object.getOwnPropertyNames,Cn=Object.getOwnPropertySymbols,Rd=Object.getPrototypeOf,hi=Object.prototype.hasOwnProperty,ro=Object.prototype.propertyIsEnumerable;var no=(o,r)=>(r=Symbol[o])?r:Symbol.for("Symbol."+o),Yt=o=>{throw TypeError(o)};var wn=(o,r,e)=>r in o?vt(o,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):o[r]=e,V=(o,r)=>{for(var e in r||(r={}))hi.call(r,e)&&wn(o,e,r[e]);if(Cn)for(var e of Cn(r))ro.call(r,e)&&wn(o,e,r[e]);return o},ge=(o,r)=>$d(o,Id(r)),Zs=(o,r)=>vt(o,"name",{value:r,configurable:!0});var bi=(o,r)=>{var e={};for(var t in o)hi.call(o,t)&&r.indexOf(t)<0&&(e[t]=o[t]);if(o!=null&&Cn)for(var t of Cn(o))r.indexOf(t)<0&&ro.call(o,t)&&(e[t]=o[t]);return e};var w=(o,r)=>()=>(o&&(r=o(o=0)),r);var io=(o,r)=>()=>(r||o((r={exports:{}}).exports,r),r.exports),Z=(o,r)=>{for(var e in r)vt(o,e,{get:r[e],enumerable:!0})},so=(o,r,e,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of Fd(r))!hi.call(o,n)&&n!==e&&vt(o,n,{get:()=>r[n],enumerable:!(t=to(r,n))||t.enumerable});return o};var Pd=(o,r,e)=>(e=o!=null?eo(Rd(o)):{},so(r||!o||!o.__esModule?vt(e,"default",{value:o,enumerable:!0}):e,o)),X=o=>so(vt({},"__esModule",{value:!0}),o);var B=o=>{var r;return[,,,eo((r=o==null?void 0:o[no("metadata")])!=null?r:null)]},oo=["class","method","getter","setter","accessor","field","value","get","set"],Ir=o=>o!==void 0&&typeof o!="function"?Yt("Function expected"):o,Bd=(o,r,e,t,n)=>({kind:oo[o],name:r,metadata:t,addInitializer:i=>e._?Yt("Already initialized"):n.push(Ir(i||null))}),Fr=(o,r)=>wn(r,no("metadata"),o[3]),R=(o,r,e,t)=>{for(var n=0,i=o[r>>1],s=i&&i.length;n<s;n++)r&1?i[n].call(e):t=i[n].call(e,t);return t},P=(o,r,e,t,n,i)=>{var s,a,l,p,g,d=r&7,u=!!(r&8),c=!!(r&16),f=d>3?o.length+1:d?u?1:2:0,h=oo[d+5],x=d>3&&(o[f-1]=[]),T=o[f]||(o[f]=[]),b=d&&(!c&&!u&&(n=n.prototype),d<5&&(d>3||!c)&&to(d<4?n:{get[e](){return m(this,i)},set[e](k){return C(this,i,k)}},e));d?c&&d<4&&Zs(i,(d>2?"set ":d>1?"get ":"")+e):Zs(n,e);for(var y=t.length-1;y>=0;y--)p=Bd(d,e,l={},o[3],T),d&&(p.static=u,p.private=c,g=p.access={has:c?k=>jd(n,k):k=>e in k},d^3&&(g.get=c?k=>(d^1?m:I)(k,n,d^4?i:b.get):k=>k[e]),d>2&&(g.set=c?(k,A)=>C(k,n,A,d^4?i:b.set):(k,A)=>k[e]=A)),a=(0,t[y])(d?d<4?c?i:b[h]:d>4?void 0:{get:b.get,set:b.set}:n,p),l._=1,d^4||a===void 0?Ir(a)&&(d>4?x.unshift(a):d?c?i=a:b[h]=a:n=a):typeof a!="object"||a===null?Yt("Object expected"):(Ir(s=a.get)&&(b.get=s),Ir(s=a.set)&&(b.set=s),Ir(s=a.init)&&x.unshift(s));return d||Fr(o,n),b&&vt(n,e,b),c?d^4?i:b:n},ce=(o,r,e)=>wn(o,typeof r!="symbol"?r+"":r,e),xi=(o,r,e)=>r.has(o)||Yt("Cannot "+e),jd=(o,r)=>Object(r)!==r?Yt('Cannot use the "in" operator on this value'):o.has(r),m=(o,r,e)=>(xi(o,r,"read from private field"),e?e.call(o):r.get(o)),S=(o,r,e)=>r.has(o)?Yt("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(o):r.set(o,e),C=(o,r,e,t)=>(xi(o,r,"write to private field"),t?t.call(o,e):r.set(o,e),e),I=(o,r,e)=>(xi(o,r,"access private method"),e);var En=(o,r,e,t)=>({set _(n){C(o,r,n,e)},get _(){return m(o,r,t)}});var ao,Rr,yi=w(()=>{"use strict";ao=(()=>{let o={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(o,null),o})(),Rr=(()=>{let o=["arg-in-ext","bold-header","format-leakage","fostered-content","h1","illegal-attr","insecure-style","invalid-gallery","invalid-imagemap","invalid-invoke","invalid-isbn","invalid-json","invalid-url","lonely-apos","lonely-bracket","lonely-http","nested-link","no-arg","no-duplicate","no-ignored","obsolete-attr","obsolete-tag","parsing-order","pipe-like","syntax-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(o),o})()});function ke(o,r,e){return e===1?o.replace(/\0(\d+)g\x7F/gu,(t,n)=>ke(String(r[n]),r,2)):e===2?o.replace(/\0(\d+)n\x7F/gu,(t,n)=>String(r[n])):o.replace(/\0(\d+)\x7F/gu,(t,n)=>r[n])}var Ie,lo,De,Me,Ue,Pr,go,re,Ee,Od,qd,Ln,Br,po,_d,Wd,bp,ae=w(()=>{"use strict";Ie=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,lo=String.raw`[^[\]<>"\0-\x1F\x7F${Ie}\uFFFD]`,De=String.raw`(?:\[[\da-f:.]+\]|${lo})`,Me=String.raw`(?:${lo}|\0\d+[cn!~]\x7F)*`,Ue=o=>o.trim().toLowerCase();Pr=(o,r)=>e=>e.replace(o,r),go=Pr(/[\0\x7F]|\r$/gmu,""),re=Pr(/\0\d+[cn]\x7F/gu,""),Ee=(o,r="")=>o.map(e=>typeof e=="string"?e:e.text()).join(r),Od={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},qd=Pr(/&(?:#(\d+|[Xx][\da-fA-F]+)|([lg]t|[LG]T|[lr]brac[ke]|nbsp|amp|AMP|quot|QUOT));/gu,(o,r,e)=>r?String.fromCodePoint(+((/^x/iu.test(r)?"0":"")+r)):Od[e.toLowerCase()]),Br=o=>(Ln!=null||(Ln=qd),Ln(o)),po=Pr(/&#(\d+|x[\da-f]+);/giu,(o,r)=>String.fromCodePoint(+((/^x/iu.test(r)?"0":"")+r))),_d={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},Wd=(o=/[&<>"{}[\]|]/gu)=>Pr(o,r=>`&${_d[r]};`),bp=Wd(/[&<>]/gu)});var uo=io((yp,Dd)=>{Dd.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:[{msgnw:"msgnw",pageid:"pageid",articlepath:"articlepath",server:"server",servername:"servername",scriptpath:"scriptpath",stylepath:"stylepath","#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","#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","#translation":"translation","#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","#useliquidthreads":"useliquidthreads","#lqtpagelimit":"lqtpagelimit","#avatar":"avatar","#img":"img","#chart":"chart"},{"!":"!","=":"=","#FORMAL":"formal","#bcp47":"bcp47","#dir":"dir","#interwikilink":"interwikilink","#interlanguagelink":"interlanguagelink","#contentmodel":"contentmodel","#isbn":"isbn","#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:|wikipedia://|worldwind://|xmpp:",interwiki:[],img:{},redirection:["#redirect"],variants:[]}});var fo,jr,Ti,Nn=w(()=>{"use strict";fo=new Set(["alt","link","lang","page","caption"]),jr=new Set(["tiff","tif","png","gif","jpg","jpeg","webp","xcf","pdf","svg","djvu"]),Ti=uo()});function Be(o){let r=new Map,e=new WeakMap;return t=>{let n=typeof t=="string"?r:e;if(n.has(t)){let s=n.get(t);return s.lastIndex=0,s}let i=o(t);return n.set(t,i),i}}var At,$n,ki,Md,co,ze=w(()=>{"use strict";At=o=>decodeURIComponent(o.replace(/%(?![\da-f]{2})/giu,"%25"));$n=o=>{let r=[],e=0;for(let t of o.split(`
|
|
2
|
+
`)){let n=e+t.length;r.push([t,e,n]),e=n+1}return r},ki=o=>o&&Number(o[1]),Md=(o,r)=>{var n;let e,t=i=>{e!=null||(e=$n(o));let s=e.findIndex(([,,a])=>i<=a)+1;return{line:s,column:i-e[s-1][1]+1}};for(let i of r){let{line:s,column:a,from:l,to:p}=i;l==null?s?(e!=null||(e=$n(o)),(n=i.column)!=null||(i.column=1),i.from=e[s-1][1]+(i.column-1)):(i.from=0,i.line=1,i.column=1):(!s||!a)&&Object.assign(i,t(l)),p!==void 0&&({line:i.endLine,column:i.endColumn}=t(p)),i.position=i.from}return r},co=(o,r)=>{if(r||o.trim())try{JSON.parse(o)}catch(e){let{message:t}=e,n=ki(/\bline (\d+)/u.exec(t)),i=ki(/\bcolumn (\d+)/u.exec(t)),s=ki(/\bposition (\d+)/u.exec(t));return Md(o,[{message:t,line:n,column:i,from:s,severity:"error"}])}return[]}});var Or,Zt,qr,_r,vi,W,se=w(()=>{"use strict";W=class{constructor(r,e){S(this,_r);S(this,Or);S(this,Zt);S(this,qr);C(this,Or,r),C(this,Zt,e)}get start(){return m(this,Zt)}get top(){return I(this,_r,vi).call(this).top}get left(){return I(this,_r,vi).call(this).left}};Or=new WeakMap,Zt=new WeakMap,qr=new WeakMap,_r=new WeakSet,vi=function(){var r;return(r=m(this,qr))!=null||C(this,qr,m(this,Or).getRootNode().posFromIndex(m(this,Zt))),m(this,qr)}});var Ud,zd,In,Ai,mo,j,F,me,er,O,Fn,Le,Rn,Pn,Bn,st,Ge,jn,je,ho,z=w(()=>{"use strict";ze();Se();se();D();Ud=new Set(["tr","td","th","caption"]),zd=new Set(["Template:!!","Template:!-"]),In=o=>{let r=o.childNodes.find(e=>e.text().trim());if(!r||r.type==="text"&&r.data.trim().startsWith("!")||r.is("magic-word")&&r.name==="!"||r.is("template")&&zd.has(r.name)||r.is("html")&&Ud.has(r.name))return!1;if(r.is("arg"))return r.length>1&&In(r.childNodes[1]);if(r.is("magic-word"))try{let e=r.getPossibleValues().map(In);return e.includes(2)?2:e.includes(1)&&1}catch(e){}return r.is("template")||r.is("magic-word")&&r.name==="invoke"?1:2},Ai=(o,r,e,t)=>({line:o+e-1,character:(e===1?r:0)+t}),mo=o=>(r,e,t,n,i="error")=>{let{start:s}=e,{top:a,left:l}=e instanceof W?e:new W(r,s),{offsetHeight:p,offsetWidth:g}=r,{startIndex:d,startLine:u,startCol:c}=o(r,s,a,l),{line:f,character:h}=Ai(u,c,p,g);return{rule:t,message:v.msg(n),severity:i,startIndex:d,endIndex:d+r.toString().length,startLine:u,endLine:f,startCol:c,endCol:h}},j=mo((o,r,e,t)=>{let n=o.getRelativeIndex(),{top:i,left:s}=o.parentNode.posFromIndex(n);return{startIndex:r+n,startLine:e+i,startCol:i?s:t+s}}),F=mo((o,r,e,t)=>({startIndex:r,startLine:e,startCol:t})),me=(o,r,e,t=0)=>({desc:v.msg(r),range:[o.startIndex+t,o.endIndex],text:e}),er=(o,r,e)=>({desc:v.msg(r),range:[o,o],text:e}),O=(o,r=0,e="")=>typeof o=="number"?{desc:v.msg("remove"),range:[o,o+r],text:e}:me(o,"remove",e,r),Fn=(o,r)=>me(o,"decode",At(r.text().replace(/%(?=21|3[ce]|5[bd]|7[b-d])/giu,"%25"))),Le=(o,r,e=0)=>({desc:v.msg("close"),range:[o+e,o],text:r}),Rn=o=>({desc:v.msg("open"),range:[o+1,o+2],text:""}),Pn=(o,r)=>me(o,"comment",`<!--${r}-->`),Bn=(o,r)=>me(o,"uppercase",r.toUpperCase()),st=(o,r=0)=>({desc:v.msg("whitespace"),range:[o,o+r],text:" "}),Ge=(o,r,e=1)=>({desc:v.msg("escape"),range:[o,o+e],text:r.repeat(e)}),jn=(o,r)=>({desc:v.msg("escape"),range:[o,o+r.length],text:r.replace(/\|/gu,"|")}),je=(o,r,e,t)=>{if(o&&(t||v.viewOnly&&o[0]===oe.rev))return o[1];let n=r();return(t||v.viewOnly)&&e([oe.rev,n]),n},ho=(o,r)=>o==="ol"&&r==="type"?["1","a","A","i","I"]:o==="th"&&r==="scope"?["row","col","rowgroup","colgroup"]:r==="dir"?["ltr","rtl","auto"]:r==="aria-hidden"?["true","false"]:[]});var Gd,On,Si=w(()=>{"use strict";Gd=o=>{if(o.includes("#")){let r=o.indexOf("#"),e=o.slice(0,r),t=o.slice(r+1);return(n,i)=>(r===0||n===e)&&i===t}return r=>r===o},On=(o,r,e)=>{if(o=o.trim(),!o)return(()=>!0);let t=o.split(",").map(n=>n.trim()).filter(n=>n!=="").map(Gd);return(({type:n,name:i})=>t.some(s=>s(n,i)))}});var xo=io((Ip,bo)=>{bo.exports=function(o,r,e,t,n){var i,s;if(t===void 0)t=0;else if(t=t|0,t<0||t>=o.length)throw new RangeError("invalid lower bound");if(n===void 0)n=o.length-1;else if(n=n|0,n<t||n>=o.length)throw new RangeError("invalid upper bound");for(;t<=n;)if(i=t+(n-t>>>1),s=+e(o[i],r,i,o),s<0)t=i+1;else if(s>0)n=i-1;else return i;return~t}});var yo,To,ko=w(()=>{"use strict";yo=Pd(xo()),To=(o,r,e)=>{let t=(0,yo.default)(o,r,e);return t<0?~t:t}});var tr,qn=w(()=>{"use strict";z();tr=(o=!0)=>r=>{let e=new WeakMap;return function(...t){return je(e.get(this),()=>r.apply(this,t),n=>{e.set(this,n)},o)}}});var vo,Ao=w(()=>{"use strict";vo=o=>{class r extends o{get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get offsetHeight(){return this.getDimension().height}get offsetWidth(){return this.getDimension().width}}return r}});var So,Co,Dr,rr,nr,Mr,ir,sr,Wr,Oe,Ci=w(()=>{"use strict";ze();ko();z();Se();qn();Ao();D();Co=[vo],So=[tr(!1)];Oe=class{constructor(){R(Wr,5,this);ce(this,"childNodes",[]);S(this,Dr);S(this,rr);S(this,nr);S(this,Mr);S(this,ir);S(this,sr,{})}get parentNode(){return m(this,Dr)}get nextSibling(){return m(this,rr)}get previousSibling(){return m(this,nr)}getChildNodes(){let{childNodes:r}=this;return Object.isFrozen(r)?[...r]:r}getAttribute(r){return r==="padding"?0:this[r]}setAttribute(r,e){switch(r){case"parentNode":C(this,Dr,e),e||(C(this,rr,void 0),C(this,nr,void 0));break;case"nextSibling":C(this,rr,e);break;case"previousSibling":C(this,nr,e);break;case"aIndex":v.viewOnly&&C(this,ir,[oe.rev,e]);break;default:this[r]=e}}getRootNode(){return je(m(this,Mr),()=>{var r,e;return(e=(r=this.parentNode)==null?void 0:r.getRootNode())!=null?e:this},r=>{let[,e]=r;e.type==="root"&&C(this,Mr,r)})}indexFromPos(r,e){{if(r<0||e<0)return;let t=this.getLines();if(r>=t.length)return;let[,n,i]=t[r],s=n+e;return s>i?void 0:s}}posFromIndex(r){{let{length:e}=String(this);if(r+=r<0?e:0,r>=0&&r<=e){let t=this.getLines(),n=To(t,r,([,,i],s)=>i-s);return{top:n,left:r-t[n][1]}}return}}getDimension(){{let r=this.getLines(),e=r[r.length-1];return{height:r.length,width:e[2]-e[1]}}}getGaps(r){return 0}getRelativeIndex(r){if(r===void 0){let{parentNode:e}=this;return e?e.getRelativeIndex(e.childNodes.indexOf(this)):0}return je(m(this,sr)[r],()=>{let{childNodes:e}=this,t=r+(r<0?e.length:0),n=this.getAttribute("padding");for(let i=0;i<t;i++)v.viewOnly&&(m(this,sr)[i]=[oe.rev,n]),n+=e[i].toString().length+this.getGaps(i);return n},e=>{m(this,sr)[r]=e})}getAbsoluteIndex(){return je(m(this,ir),()=>{let{parentNode:r}=this;return r?r.getAbsoluteIndex()+this.getRelativeIndex():0},r=>{C(this,ir,r)})}getBoundingClientRect(){this.lspError("AstNode.getBoundingClientRect")}is(r){return this.type===r}getLines(){return $n(String(this))}seal(r,e){}lspError(r){throw new Error(`${r} method is only available in the LSP version!`)}};Wr=B(null),Dr=new WeakMap,rr=new WeakMap,nr=new WeakMap,Mr=new WeakMap,ir=new WeakMap,sr=new WeakMap,P(Wr,1,"getLines",So,Oe),Oe=P(Wr,0,"AstNode",Co,Oe),R(Wr,1,Oe)});var wo,Eo=w(()=>{"use strict";Si();wo=o=>{var r,wi;{class t extends o{constructor(){super(...arguments);S(this,r)}getElementBy(s){let a=[...this.childNodes].reverse();for(;a.length>0;){let l=a.pop(),{type:p,childNodes:g}=l;if(p!=="text"){if(s(l))return l;for(let d=g.length-1;d>=0;d--)a.push(g[d])}}}querySelector(s){return this.getElementBy(I(this,r,wi).call(this,s))}getElementsBy(s){let a=[...this.childNodes].reverse(),l=[];for(;a.length>0;){let p=a.pop(),{type:g,childNodes:d}=p;if(g!=="text"){s(p)&&l.push(p);for(let u=d.length-1;u>=0;u--)a.push(d[u])}}return l}querySelectorAll(s){return this.getElementsBy(I(this,r,wi).call(this,s))}escape(){}}return r=new WeakSet,wi=function(s){return On(s,this)},t}}});var Lo,Ei,Hd,St,No=w(()=>{"use strict";ae();Se();Si();Ci();Eo();Lo=[wo];St=class extends(Hd=Oe){get length(){return this.childNodes.length}text(r){return Ee(this.childNodes,r)}removeAt(r){this.lspError("AstElement.removeAt")}insertAt(r,e=this.length){return _n(this,e,0,[r]),r}closest(r){let e=On(r,this),{parentNode:t}=this;for(;t;){if(e(t))return t;({parentNode:t}=t)}}isInside(r){var e;return((e=this.closest(`${r},ext`))==null?void 0:e.type)===r}append(...r){this.safeAppend(r)}safeAppend(r){for(let e of r)this.insertAt(e)}safeReplaceChildren(r){}setText(r,e=0){e+=e<0?this.length:0;let t=this.childNodes[e],{data:n}=t;return t.replaceData(r),n}toString(r,e=""){return this.childNodes.map(t=>t.toString(r)).join(e)}caretPositionFromIndex(r){this.lspError("AstElement.caretPositionFromIndex")}elementFromIndex(r){this.lspError("AstElement.elementFromIndex")}elementFromPoint(r,e){this.lspError("AstElement.elementFromPoint")}lint(r=this.getAbsoluteIndex(),e){{let t=[];for(let n=0,i=r+this.getAttribute("padding");n<this.length;n++){let s=this.childNodes[n];s.setAttribute("aIndex",i);let a=s.lint(i,e);a.length>0&&Array.prototype.push.apply(t,a),i+=s.toString().length+this.getGaps(n)}return t}}print(r={}){}json(r,e=1/0,t=this.getAbsoluteIndex()){}};Ei=B(Hd),St=P(Ei,0,"AstElement",Lo,St),R(Ei,1,St)});var Li,Io,Vd,Qd,Xd,Jd,$o,Kd,Wn,Fo,Ur,Ro=w(()=>{"use strict";ae();z();D();Ci();Li=String.raw`[${Ie}\t]*`,Io=String.raw`<(?:/[^\S\n]*)?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|\n={2,}`,Vd=new RegExp(String.raw`${Io}|\bhttps?[:/]/+|\b(?:rfc|pmid)(?=[-::]?${Li}\d)|\bisbn(?=[-::]?${Li}(?:\d(?:${Li}|-)){6})`,"giu"),Qd=new RegExp(Io,"giu"),Xd=new Set(["attr-value","ext-link-text","link-text"]),Jd={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},$o=new Set(["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"]),Kd=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch(o){return/\w/u}})(),Ur=class extends Oe{constructor(e){super();S(this,Wn);ce(this,"data","");this.data=e}get type(){return"text"}toString(e){var t;return e&&!((t=this.parentNode)!=null&&t.getAttribute("built"))?re(this.data):this.data}text(){return this.data}lint(e=this.getAbsoluteIndex(),t){var n,i,s;{if(t===!1)return[];let{data:a,parentNode:l,nextSibling:p,previousSibling:g}=this;if(!l)throw new Error("An isolated text node cannot be linted!");let{type:d,parentNode:u}=l;if(d==="attr-value"){let{name:_,tag:U}=u;if(U==="ref"&&(_==="name"||_==="follow")||_==="group"&&(U==="ref"||U==="references")||U==="choose"&&(_==="before"||_==="after"))return[]}if(t!=null||(t=l.isPlain()&&!Xd.has(d)?Vd:Qd),a.search(t)===-1)return[];t.lastIndex=0;let c=[],f=p==null?void 0:p.type,h=p==null?void 0:p.name,x=g==null?void 0:g.type,T=this.getRootNode(),b=T.toString(),{ext:y,html:k,variants:A}=T.getAttribute("config"),{top:N,left:E}=T.posFromIndex(e),{lintConfig:$}=v,H=$.rules["tag-like"],q=typeof H=="object"&&H[1]?new Set(Object.keys(H[1]).filter(_=>_!=="invalid"&&_!=="disallowed")):new Set,K=new Set(["onlyinclude","noinclude","includeonly",...y,...k[0],...k[1],...k[2],...q,...$.getSeverity("tag-like","disallowed")?$o:[]]);for(let _=t.exec(a);_;_=t.exec(a)){let{index:U,0:M}=_,[,be,Jt]=_,bt=M==="["&&d==="ext-link-text";if(Jt&&Jt!=="]"){let{length:ie}=Jt;U+=ie,M=M.slice(ie)}else{if(M.startsWith("<")&&!K.has(be.toLowerCase())||bt&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(a.slice(U+1))||p!=null&&p.is("ext")&&h==="nowiki"&&((n=p.innerText)!=null&&n.includes("]"))))continue;M.startsWith(`
|
|
3
|
+
==`)&&(U++,M=M.slice(1))}M=M.toLowerCase();let[Y]=M,xt=M==="rfc"||M==="pmid"||M==="isbn",$r=Y==="{",gi=Y==="}",Qs=Y==="[",pi=Y==="]",{length:it}=M;pi&&(U||it>1)&&t.lastIndex--;let Kt=e+U,yt=Kt+it,fe,Pe,An,Sn,Tt=b[yt],ui=b[Kt-1],fi=$r||Qs,ci=M==="{"&&ui==="-"&&A.length>0,mi=M==="}"&&Tt==="-"&&A.length>0,Xs=Qs&&f==="free-ext-link"&&!a.slice(U+1).trim()||pi&&x==="free-ext-link"&&!a.slice(0,U).includes("]");if(xt)fe="lonely-http",M=M.toUpperCase(),Pe=$.getSeverity(fe,M);else if(Y==="<"){fe="tag-like";let ie;/^<\/?\s/u.test(M)||!/[\s/>]/u.test(Tt!=null?Tt:"")?ie="invalid":q.has(be)?ie=be:$o.has(be)&&!y.includes(be)&&(ie="disallowed"),Pe=$.getSeverity(fe,ie)}else if(Y==="=")fe="syntax-like",Pe=$.getSeverity(fe,"heading");else if(ci||mi)fe="lonely-bracket",Pe=$.getSeverity(fe,"converter"),ci&&U>0?(M="-{",U--,Kt--,it=2):mi&&U<a.length-1&&(M="}-",yt++,it=2);else if(Xs)fe="lonely-bracket",Pe=$.getSeverity(fe,"extLink");else if(fi||gi||pi)if(fe="lonely-bracket",it>1||$r&&Tt===Y||gi&&ui===Y)Pe=$.getSeverity(fe,"double");else{if(!bt){let ie=Jd[Y],we=fi?a.slice(U+1):a.slice(0,U);if($r&&((i=ie.exec(we))==null?void 0:i[0])==="}"||gi&&((s=ie.exec(we))==null?void 0:s[0])==="{")continue;if(!we.includes(Y)){let We=fi?"nextSibling":"previousSibling",$e=this[We];for(;$e&&($e.type!=="text"||!ie.test($e.data));)$e=$e[We];if($e&&ie.exec($e.data)[0]!==Y)continue}}Pe=$.getSeverity(fe,"single")}else fe="lonely-http",Pe=$.getSeverity(fe);if(!Pe)continue;let Js=this.posFromIndex(U),{line:Ks,character:Ys}=Ai(N,E,Js.top+1,Js.left);if(Y==="="){let ie=a.indexOf(`
|
|
4
|
+
`,U),we=p,We;if(ie===-1){let $e=0;for(;we&&!(we.type==="text"&&($e=we.data.indexOf(`
|
|
5
|
+
`),$e!==-1));)we=we.nextSibling;if(!we)continue;We=we.data.slice(0,$e)}else We=a.slice(U+it,ie);if(!/(?:^|[^=])=+\s*(?:\S\s*)?$/u.test(We))continue;ie===-1?(yt=we.getAbsoluteIndex()+We.length,{top:An,left:Sn}=T.posFromIndex(yt)):(yt+=We.length,it+=We.length)}let kt={rule:fe,message:v.msg(Y==="="?"header-like":"lonely",xt||Y==="h"||ci||mi?M:Y),severity:Pe,startIndex:Kt,endIndex:yt,startLine:Ks,endLine:An!=null?An:Ks,startCol:Ys,endCol:Sn!=null?Sn:Ys+it};if($.computeEditInfo)if(Y==="<")kt.suggestions=[Ge(Kt,"<")];else if(Y==="h"&&d!=="link-text"&&Kd.test(ui||""))kt.suggestions=[st(Kt)];else if(bt){let ie=l.getAbsoluteIndex()+l.toString().length;kt.suggestions=[Ge(ie,"]")]}else if(M==="]"&&Xs){let ie=e-g.toString().length;kt.suggestions=[er(ie,"left-bracket","[")]}else xt&&(kt.suggestions=[..._[0]===M?[]:[Bn(kt,M)],...Tt===":"||Tt===":"?[st(yt,1)]:[]]);c.push(kt)}return c}}replaceData(e){I(this,Wn,Fo).call(this,e)}splitText(e){this.lspError("AstText.splitText")}escape(){}print(){}};Wn=new WeakSet,Fo=function(e){this.setAttribute("data",e)}});var ve,ot=w(()=>{"use strict";ve=(o=!0,r=!0)=>e=>{class t extends e{text(){return""}lint(i){return o?[]:super.lint(i)}}return t}});var Q,xe=w(()=>{"use strict";Q=o=>{}});var zr,he,at=w(()=>{"use strict";G();he=class extends L{constructor(e,t,n,i,s){super(e,n,i,s);S(this,zr);C(this,zr,t)}get type(){return m(this,zr)}lint(e=this.getAbsoluteIndex()){return super.lint(e,!1)}};zr=new WeakMap});var pe,qe=w(()=>{"use strict";pe=({length:o})=>r=>{class e extends r{getAttribute(n){return n==="padding"?o:super.getAttribute(n)}}return e}});var or,ue,lt=w(()=>{"use strict";G();ue=class extends L{constructor(e,t,n,i,s){super(e,n,i,s);S(this,or);C(this,or,t)}get type(){return m(this,or)}set type(e){C(this,or,e)}getAttribute(e){var t;return e==="invalid"?this.type==="converter-flag"&&!!((t=this.parentNode)!=null&&t.isInvalidFlag(this)):super.getAttribute(e)}};or=new WeakMap});var Po,ar,He,dt,Dn,Bo,Ni,Yd,ye,lr=w(()=>{"use strict";z();Se();se();qe();xe();D();G();lt();Po=[Q,pe("[[")];ye=class extends(Yd=L){constructor(e,t,n,i=[],s="|"){super(void 0,n,i,{});S(this,Dn);S(this,ar,!0);S(this,He);S(this,dt);if(this.insertAt(new ue(e,"link-target",n,i,{})),t!==void 0){let a=new L(t,n,i,{});a.type="link-text",a.setAttribute("stage",10),this.insertAt(a)}C(this,He,s)}get link(){}get fragment(){}afterBuild(){C(this,dt,this.getTitle()),m(this,He).includes("\0")&&C(this,He,this.buildFromStr(m(this,He),0)),I(this,Dn,Bo).call(this),super.afterBuild()}setAttribute(e,t){e==="bracket"?C(this,ar,t):e==="title"?C(this,dt,t):super.setAttribute(e,t)}toString(e){let t=super.toString(e,m(this,He));return m(this,ar)?`[[${t}]]`:t}text(){let e=super.text("|");return m(this,ar)?`[[${e}]]`:e}getAttribute(e){return e==="title"?m(this,dt):super.getAttribute(e)}getGaps(e){return e===0?m(this,He).length:1}lint(e=this.getAbsoluteIndex(),t){{let n=super.lint(e,t),{childNodes:[i,s],type:a}=this,{encoded:l,fragment:p}=m(this,dt),{lintConfig:g}=v,{computeEditInfo:d,fix:u}=g,c=new W(this,e),f="unknown-page",h=g.getSeverity(f);if(h&&i.childNodes.some(({type:x})=>x==="template")&&n.push(j(i,c,f,"template-in-link",h)),f="url-encoding",h=g.getSeverity(f),h&&l){let x=j(i,c,f,"unnecessary-encoding",h);(d||u)&&(x.fix=Fn(x,i)),n.push(x)}if(f="pipe-like",h=g.getSeverity(f,"link"),h&&(a==="link"||a==="category")){let x=s==null?void 0:s.childNodes.findIndex(b=>b.type==="text"&&b.data.includes("|")),T=s==null?void 0:s.childNodes[x];if(T){let b=j(s,c,f,"pipe-in-link",h);if(d){let y=b.startIndex+s.getRelativeIndex(x);b.suggestions=[jn(y,T.data)]}n.push(b)}}if(f="no-ignored",h=g.getSeverity(f,"fragment"),h&&p!==void 0&&!jo(a)){let x=j(i,c,f,"useless-fragment",h);if(d||u){let T=i.childNodes.findIndex(y=>y.type==="text"&&y.data.includes("#")),b=i.childNodes[T];b&&(x.fix=O(x,i.getRelativeIndex(T)+b.data.indexOf("#")))}n.push(x)}return n}}getTitle(e,t){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:t,temporary:e,decode:!0,selfLink:!0})}print(){}json(e,t,n=this.getAbsoluteIndex()){}};Ni=B(Yd),ar=new WeakMap,He=new WeakMap,dt=new WeakMap,Dn=new WeakSet,Bo=function(){this.type!=="ext-inner"&&this.setAttribute("name",m(this,dt).title)},ye=P(Ni,0,"LinkBaseToken",Po,ye),R(Ni,1,ye)});var Oo,$i,Zd,le,gt=w(()=>{"use strict";xe();G();Oo=[Q];le=class extends(Zd=L){get innerText(){return this.firstChild.data}constructor(r="",e,t){super(r,e,t)}};$i=B(Zd),le=P($i,0,"NowikiBaseToken",Oo,le),R($i,1,le)});var qo,Ii,eg,de,Ct=w(()=>{"use strict";z();ot();D();gt();qo=[ve(!1)];de=class extends(eg=le){get type(){return"noinclude"}toString(r){return r?"":super.toString()}lint(r=this.getAbsoluteIndex()){{let{lintConfig:e}=v,t="no-ignored",n=e.getSeverity(t,"include");if(n){let{innerText:i}=this,s=/^<(includeonly|(?:no|only)include)\s+(?:[^\s>/]|\/(?!>))[^>]*>$/iu.exec(i);if(s){let a=F(this,{start:r},t,"useless-attribute",n),{computeEditInfo:l}=e,p=s[1].length+1,g=i.endsWith("/>")?2:1;return a.startIndex+=p,a.startCol+=p,a.endIndex-=g,a.endCol-=g,l&&(a.suggestions=[O(a)]),[a]}}return[]}}};Ii=B(eg),de=P(Ii,0,"NoincludeToken",qo,de),R(Ii,1,de)});var Mn,_o=w(()=>{"use strict";z();D();lr();Ct();Mn=class extends ye{get type(){return"redirect-target"}constructor(r,e,t,n){super(r,void 0,t,n),e!==void 0&&this.insertAt(new de(e,t,n))}getTitle(){return this.normalizeTitle(this.firstChild.toString(),0,{halfParsed:!0,decode:!0,page:""})}lint(r=this.getAbsoluteIndex()){{let e=super.lint(r,!1),t="no-ignored",{lintConfig:n}=v,i=n.getSeverity(t,"redirect");if(i&&this.length===2){let s=j(this.lastChild,{start:r},t,"useless-link-text",i);s.startIndex--,s.startCol--,(n.computeEditInfo||n.fix)&&(s.fix=O(s)),e.push(s)}return e}}}});var Wo,Et,Gr,Fi,tg,wt,Do=w(()=>{"use strict";ot();xe();G();at();_o();Wo=[ve(!1,!1),Q];wt=class extends(tg=L){constructor(e,t,n,i,s,a,l=[]){super(void 0,a,l);S(this,Et);S(this,Gr);C(this,Et,e),C(this,Gr,s),this.append(new he(t,"redirect-syntax",a,l),new Mn(n,i==null?void 0:i.slice(1),a,l))}get type(){return"redirect"}getAttribute(e){return e==="padding"?m(this,Et).length:super.getAttribute(e)}toString(e){return m(this,Et)+super.toString(e)+m(this,Gr)}lint(e=this.getAbsoluteIndex()){{let t=e+m(this,Et).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",t),this.lastChild.lint(t)}}print(){}};Fi=B(tg),Et=new WeakMap,Gr=new WeakMap,wt=P(Fi,0,"RedirectToken",Wo,wt),R(Fi,1,wt)});var Mo={};Z(Mo,{parseRedirect:()=>rg});var rg,Uo=w(()=>{"use strict";D();Do();rg=(o,r,e)=>{var n;(n=r.regexRedirect)!=null||(r.regexRedirect=new RegExp(String.raw`^(\s*)((?:${r.redirection.join("|")})\s*(?::\s*)?)\[\[([^\n|\]]+)(\|.*?)?\]\](\s*)`,"iu"));let t=r.regexRedirect.exec(o);return t&&v.normalizeTitle(t[3],0,!1,r,{halfParsed:!0,temporary:!0,decode:!0,page:""}).valid?(o=`\0${e.length}o${o.slice(t[0].length)}`,new wt(...t.slice(1),r,e),o):!1}});var zo,Ri,ng,Lt,Go=w(()=>{"use strict";qe();xe();G();zo=[Q,pe("<onlyinclude>")];Lt=class extends(ng=L){get type(){return"onlyinclude"}toString(r){return`<onlyinclude>${super.toString(r)}</onlyinclude>`}isPlain(){return!0}print(){}};Ri=B(ng),Lt=P(Ri,0,"OnlyincludeToken",zo,Lt),R(Ri,1,Lt)});var pt,Hr=w(()=>{"use strict";pt=(o=1)=>r=>{class e extends r{getGaps(){return o}}return e}});var Ho,Nt,ut,Pi,ig,Fe,Un=w(()=>{"use strict";Hr();xe();G();Ho=[pt(),Q];Fe=class extends(ig=L){constructor(e,t,n,i,s,a=[]){super(void 0,s);S(this,Nt);S(this,ut);ce(this,"closed");this.setAttribute("name",e.toLowerCase()),C(this,Nt,[e,i||e]),this.closed=i!=="",C(this,ut,i===void 0),this.append(t,n);let l=typeof t=="string"?-1:a.indexOf(t);a.splice(l===-1?1/0:l,0,this)}get innerText(){return m(this,ut)?void 0:this.lastChild.text()}get selfClosing(){return m(this,ut)}toString(e){let{firstChild:t,lastChild:n}=this,[i,s]=m(this,Nt);return m(this,ut)?`<${i}${t.toString(e)}/>`:`<${i}${t.toString(e)}>${n.toString(e)}${this.closed?`</${s}>`:""}`}text(){let[e,t]=m(this,Nt);return m(this,ut)?`<${e}${this.firstChild.text()}/>`:`<${e}${super.text(">")}${this.closed?`</${t}>`:""}`}getAttribute(e){return e==="padding"?m(this,Nt)[0].length+1:super.getAttribute(e)}print(){}json(e,t,n=this.getAbsoluteIndex()){}};Pi=B(ig),Nt=new WeakMap,ut=new WeakMap,Fe=P(Pi,0,"TagPairToken",Ho,Fe),R(Pi,1,Fe)});var Vo,Bi,sg,$t,Qo=w(()=>{"use strict";z();se();ot();D();Un();Vo=[ve(!1)];$t=class extends(sg=Fe){get type(){return"include"}constructor(r,e="",t,n,i,s){super(r,e,t!=null?t:"",t===void 0||n!=null?n:"",i,s)}toString(r){return r?"":super.toString()}lint(r=this.getAbsoluteIndex()){{let e=[],{firstChild:t,closed:n,name:i}=this,s=new W(this,r),a=["no-ignored","unclosed-comment"],{lintConfig:l}=v,{computeEditInfo:p}=l,g=a.map(d=>l.getSeverity(d,"include"));if(g[0]&&t.data.trim()){let d=j(t,s,a[0],"useless-attribute",g[0]);p&&(d.suggestions=[O(d)]),e.push(d)}if(g[1]&&!n){let d=F(this,s,a[1],v.msg("unclosed",`<${i}>`),g[1]);p&&(d.suggestions=[Le(d.endIndex,`</${i}>`)]),e.push(d)}return e}}};Bi=B(sg),$t=P(Bi,0,"IncludeToken",Vo,$t),R(Bi,1,$t)});var dr,zn=w(()=>{"use strict";dr=(o=0)=>r=>{var e,Xo;{class n extends r{constructor(){super(...arguments);S(this,e)}hasAttr(a){this.lspError("AttributesParent.hasAttr")}getAttr(a){return I(this,e,Xo).call(this).getAttr(a)}}return e=new WeakSet,Xo=function(){return this.childNodes[o]},n}}});var ne,Jo,Ko,Gn,Oi,Yo,Hn,ra,na,ia,ji,Zo,ea,ta,It,sa,oa,aa,la,da,qi=w(()=>{"use strict";ne=new Set(["align"]),Jo=new Set(["cite"]),Ko=new Set(["cite","datetime"]),Gn=new Set(["width"]),Oi=new Set(["axis","align","bgcolor","height","width","valign"]),Yo=new Set([...Oi,"abbr","headers","scope","rowspan","colspan"]),Hn=new Set(["type"]),ra=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),na=new Set(["clear"]),ia=new Set(["bgcolor","align","valign"]),ji=new Set(["id","qid","forcemathmode","type","display"]),Zo=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),ea=new Set(["weight"]),ta=new Set(["width","height","zoom","latitude","longitude","align","mapstyle","lang","alt","text"]),It=new Set,sa=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"]),oa={div:ne,h1:ne,h2:ne,h3:ne,h4:ne,h5:ne,h6:ne,blockquote:Jo,q:Jo,p:ne,br:na,pre:Gn,ins:Ko,del:Ko,ul:Hn,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...ra,"border"]),caption:ne,tr:ia,td:Yo,th:Yo,font:new Set(["size","color","face"]),hr:Gn,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:Hn,poem:ne,categorytree:ne,combooption:ne,img:new Set(["alt","src","width","height","loading","srcset"])},aa={pre:new Set(["format"]),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:It,indicator:new Set(["name"]),langconvert:new Set(["from","to"]),ref:new Set(["group","name","follow","dir","details"]),references:new Set(["group","responsive"]),charinsert:new Set(["label"]),choose:new Set(["uncached","before","after"]),option:ea,choicetemplate:ea,imagemap:It,inputbox:It,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:It,poll:new Set(["id","show-results-before-voting"]),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"]),math:new Set([...ji,"chem"]),chem:ji,ce:ji,hiero:It,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:Zo,syntaxhighlight:Zo,templatedata:It,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:It,mapframe:new Set([...ta,"frameless"]),maplink:new Set([...ta,"class"]),rss:new Set(["template","templatename","max","highlight","filter","filterout","reverse","date","item-max-length"]),"page-collection":new Set(["lang","name","description","end-date"])},la={table:ra,td:new Set([...Oi,"scope"]),th:Oi,br:na,caption:ne,div:ne,hr:Gn,h1:ne,h2:ne,h3:ne,h4:ne,h5:ne,h6:ne,li:Hn,p:ne,pre:Gn,tr:ia,ul:Hn},da={dynamicpagelist:["category","notcategory","namespace","count","offset","imagewidth","imageheight","imagesperrow","mode","gallerycaption","galleryshowfilesize","galleryshowfilename","order","ordermethod","redirects","stablepages","qualitypages","suppresserrors","addfirstcategorydate","shownamespace","ignoresubpages","googlehack","nofollow"],inputbox:["preloadparams[]","type","width","preload","preloadtitle","page","editintro","useve","usedt","summary","nosummary","minor","break","default","placeholder","bgcolor","buttonlabel","searchbuttonlabel","fulltextbutton","namespaces","labeltext","hidden","id","inline","prefix","dir","searchengine","searchtype","searchfilter","tour","arialabel"]}});var og,ag,lg,dg,Vr,gr,Te,Ve,Ft,ga,_i,pr,pa=w(()=>{"use strict";z();ae();qi();se();D();G();lt();og=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,ag=/(?:^|\s|\*\/)(?:java|vb)script(?:\W|$)/iu,lg=new Set(["ext","arg","magic-word","template"]),dg=new Set(["about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),pr=class extends L{constructor(e,t,n,i,s,a="",l,p=[]){let g=new ue(n,"attr-key",s,p),d;if(n==="title"||t==="img"&&n==="alt")d=new L(l,s,p,{}),d.type="attr-value",d.setAttribute("stage",10);else if(t==="gallery"&&n==="caption"||t==="ref"&&n==="details"||(t==="mapframe"||t==="maplink")&&n==="text"||t==="choose"&&(n==="before"||n==="after")){let u=ge(V({},s),{excludes:[...s.excludes,"heading","html","table","hr","list"]});d=new L(l,u,p,{}),d.type="attr-value",d.setAttribute("stage",1)}else d=new ue(l,"attr-value",s,p,{});super(void 0,s,p);S(this,Ft);S(this,Vr);S(this,gr);S(this,Te);S(this,Ve);C(this,Vr,e),this.append(g,d),C(this,Te,a),C(this,Ve,[...i]),C(this,gr,t),this.setAttribute("name",Ue(re(n)))}get type(){return m(this,Vr)}get tag(){return m(this,gr)}get balanced(){return!m(this,Te)||m(this,Ve)[0]===m(this,Ve)[1]}afterBuild(){m(this,Te).includes("\0")&&C(this,Te,this.buildFromStr(m(this,Te),0)),this.parentNode&&C(this,gr,this.parentNode.name),I(this,Ft,ga).call(this),super.afterBuild()}toString(e){let[t="",n=""]=m(this,Ve);return m(this,Te)?super.toString(e,m(this,Te)+t)+n:this.firstChild.toString(e)}text(){return m(this,Te)?`${super.text(`${m(this,Te).trim()}"`)}"`:this.firstChild.text()}getGaps(){var e,t;return m(this,Te)?m(this,Te).length+((t=(e=m(this,Ve)[0])==null?void 0:e.length)!=null?t:0):0}lint(e=this.getAbsoluteIndex(),t){var n;{let i=super.lint(e,t),{balanced:s,firstChild:a,lastChild:l,name:p,tag:g}=this,d=new W(this,e),u=["unclosed-quote","obsolete-attr"],{lintConfig:c}=v,f=u.map(x=>c.getSeverity(x,p));if(f[0]&&!s){let x=j(l,d,u[0],"unclosed-quotes",f[0]);x.startIndex--,x.startCol--,c.computeEditInfo&&(x.suggestions=[Le(x.endIndex,m(this,Ve)[0])]),i.push(x)}let h=I(this,Ft,_i).call(this,e,d);return h&&i.push(h),f[1]&&((n=la[g])!=null&&n.has(p))&&i.push(j(a,d,u[1],"obsolete-attribute",f[1])),i}}getValue(){return m(this,Te)?this.lastChild.text().trim():this.type==="ext-attr"||""}escape(){}getAttribute(e){return e==="invalid"?I(this,Ft,_i).call(this):super.getAttribute(e)}print(){}json(e,t,n=this.getAbsoluteIndex()){}};Vr=new WeakMap,gr=new WeakMap,Te=new WeakMap,Ve=new WeakMap,Ft=new WeakSet,ga=function(){this.setAttribute("name",Ue(this.firstChild.text()))},_i=function(e,t){let{firstChild:n,lastChild:i,type:s,name:a,tag:l,parentNode:p}=this,g=!i.childNodes.some(({type:b})=>lg.has(b)),d=this.getValue(),u=aa[l],c=oa[l],{length:f}=this.toString(),h="illegal-attr",x,T;if({lintConfig:x}=v,{computeEditInfo:T}=x,!(u!=null&&u.has(a))&&!(c!=null&&c.has(a))&&(s==="ext-attr"?u||c:!/\{\{[^{]+\}\}/u.test(a))&&(s==="ext-attr"&&!c||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(a)&&(l==="meta"||l==="link"||!sa.has(a)))||(a==="itemtype"||a==="itemid"||a==="itemref")&&!(p!=null&&p.hasAttr("itemscope"))){if(e===void 0)return!0;{let b=x.getSeverity(h,"unknown");if(b){let y=j(n,t,h,"illegal-attribute-name",b);return T&&(y.suggestions=[O(e,f)]),y}}}else if(a==="style"&&typeof d=="string"&&og.test(d)){if(e===void 0)return!0;{h="insecure-style";let b=x.getSeverity(h);return b&&j(i,t,h,"insecure-style",b)}}else if(a==="tabindex"&&typeof d=="string"&&d!=="0"){if(e===void 0)return!0;{let b=x.getSeverity(h,"tabindex");if(b){let y=j(i,t,h,"nonzero-tabindex",b);return T&&(y.suggestions=[O(e,f),me(y,"0 tabindex","0")]),y}}}else if(typeof d=="string"&&((/^xmlns:[\w:.-]+$/u.test(a)||dg.has(a))&&ag.test(d)||g&&(a==="href"||l==="img"&&a==="src")&&!new RegExp(String.raw`^(?:${this.getAttribute("config").protocol}|//)\S+$`,"iu").test(d))){if(e===void 0)return!0;{let b=x.getSeverity(h,"value");return b&&j(i,t,h,"illegal-attribute-value",b)}}else if(g&&s!=="ext-attr"){let b=ho(l,a),y=String(d).toLowerCase();if(b.length>0&&b.every(k=>k!==y)){if(e===void 0)return!0;{let k=x.getSeverity(h,"value");return k&&j(i,t,h,"illegal-attribute-value",k)}}}return!1}});var ua,gg,pg,Qr,Xr,Wi,ft,Vn=w(()=>{"use strict";z();ae();se();D();G();lt();pa();ua=o=>o.slice(0,-1),gg=o=>`${ua(o)}-dirty`,pg=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch(o){return/[^\W_]/u}})(),ft=class extends L{constructor(e,t,n,i,s=[]){super(void 0,i,s,{});S(this,Xr);S(this,Qr);if(C(this,Qr,t),this.setAttribute("name",n),e){let a=/([^\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="",p=a.exec(e),g=0,d=()=>{l&&(super.insertAt(new ue(l,gg(t),i,s,{})),l="")};for(;p;){let{index:u,0:c,1:f,2:h,3:x,4:T,5:b,6:y}=p;if(l+=e.slice(g,u),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(re(f).trim())){let k=T!=null?T:y,A=[x,b],N=new pr(ua(t),n,f,A,i,h,k,s);d(),super.insertAt(N)}else l+=c;({lastIndex:g}=a),p=a.exec(e)}l+=e.slice(g),d()}}get type(){return m(this,Qr)}afterBuild(){let{parentNode:e}=this;e!=null&&e.is("td")&&this.setAttribute("name",e.subtype),super.afterBuild()}getAttrTokens(e){return this.childNodes.filter(t=>t instanceof pr&&(!e||t.name===Ue(e)))}hasAttr(e){return this.getAttrTokens(e).length>0}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 n=super.lint(e,t),{parentNode:i,childNodes:s}=this,a=new Map,l=new Set,p=new W(this,e),g=["no-ignored","no-duplicate"],{lintConfig:d}=v,{computeEditInfo:u,fix:c}=d,f=["closingTag","invalidAttributes","nonWordAttributes"].map(x=>d.getSeverity(g[0],x));if(f[0]&&I(this,Xr,Wi).call(this)){let x=F(this,p,g[0],"attributes-of-closing-tag",f[0]);if(u){let T=i.getAbsoluteIndex();x.suggestions=[O(x),Rn(T)]}n.push(x)}for(let x of s)if(x instanceof pr){let{name:T}=x;a.has(T)?(l.add(T),a.get(T).push(x)):a.set(T,[x])}else{let T=x.text().trim(),b=f[pg.test(T)?1:2];if(T&&b){let y=j(x,p,g[0],"invalid-attribute",b);u&&(y.suggestions=[O(y,0," ")]),n.push(y)}}let h=d.getSeverity(g[1],"attribute");if(h&&l.size>0)for(let x of l){let T=a.get(x).map(b=>{let y=b.getValue();return[b,y===!0?"":y]});Array.prototype.push.apply(n,T.map(([b,y],k)=>{let A=j(b,p,g[1],v.msg("duplicate-attribute",x),h);if(u||c){let N=O(A);!y||T.slice(0,k).some(([,E])=>E===y)?A.fix=N:u&&(A.suggestions=[N])}return A}))}return n}}escape(){}getAttribute(e){return e==="invalid"?I(this,Xr,Wi).call(this):super.getAttribute(e)}print(){}};Qr=new WeakMap,Xr=new WeakSet,Wi=function(){let{parentNode:e}=this;return(e==null?void 0:e.type)==="html"&&e.closing&&this.text().trim()!==""}});var fa={};Z(fa,{PreToken:()=>Di});var Di,ca=w(()=>{"use strict";G();Ct();Di=class extends L{get type(){return"ext-inner"}constructor(r,e,t=[]){if(r){let n=/<nowiki>/giu,i=/<\/nowiki>/giu,{length:s}=n.source,a=n.exec(r);a&&(i.lastIndex=a.index+s);let l=i.exec(r),p=0,g="";for(;a&&l;)new de(a[0],e,t,!0),new de(l[0],e,t,!0),g+=`${r.slice(p,a.index)}\0${t.length-1}n${r.slice(a.index+s,l.index)}\0${t.length}n`,p=l.index+s+1,n.lastIndex=p,a=n.exec(r),a&&(i.lastIndex=a.index+s),l=i.exec(r);r=g+r.slice(p)}super(r,e,t,{}),this.setAttribute("stage",10)}isPlain(){return!0}lint(r=this.getAbsoluteIndex()){return super.lint(r,/<\s*\/\s*(pre)\b/giu)}}});var ct,Qn=w(()=>{"use strict";G();ct=class extends L{get type(){return"ext-inner"}toString(r){return super.toString(r,`
|
|
6
6
|
`)}text(){return super.text(`
|
|
7
7
|
`).replace(/\n\s*\n/gu,`
|
|
8
|
-
`)}getGaps(){return 1}print(){}}});var Xn,ma=w(()=>{"use strict";z();
|
|
9
|
-
`).map(a=>s?a:Rt(a,n,i,e)).map(a=>new Xn(r,a,n,i,{}))),i.splice(i.indexOf(this),1),i.push(this)}}});var ba,Zr,en,Ui,Mi,pg,Qe,zi=w(()=>{"use strict";z();Se();se();xe();D();G();at();ba=[Q];Qe=class extends(pg=L){constructor(e,t,n,i=[]){super(void 0,n,i);S(this,en);S(this,Zr);C(this,Zr,e);let s=new L(t[0],n,i);s.type="heading-title",s.setAttribute("stage",2);let a=new he(t[1],"heading-trail",n,i);this.append(s,a)}get type(){return"heading"}get level(){return m(this,Zr)}toString(e){let t=I(this,en,Ui).call(this);return t+this.firstChild.toString(e)+t+this.lastChild.toString(e)}text(){let e=I(this,en,Ui).call(this);return e+this.firstChild.text()+e}getAttribute(e){return e==="invalid"?this.inHtmlAttrs()===2:e==="padding"?this.level:super.getAttribute(e)}getGaps(){return this.level}lint(e=this.getAbsoluteIndex(),t){{let n=super.lint(e,t),{firstChild:i,level:s}=this,a=i.toString(),l=a.startsWith("="),u=l||a.endsWith("="),g=new W(this,e),d=this.inHtmlAttrs(),p=["h1","unbalanced-header","format-leakage"],{lintConfig:c}=v,{computeEditInfo:f,fix:h}=c,x=p.map(T=>c.getSeverity(T,"apostrophe"));if(x[0]&&this.level===1){let T=j(i,g,p[0],"<h1>",x[0]);f&&!u&&(T.suggestions=[me(T,"h2",`=${a}=`)]),n.push(T)}if(x[1]&&u){let T=v.msg("unbalanced-in-section-header",'"="'),b=j(i,g,p[1],T,x[1]);if(!(!f||a==="="))if(l){let[y]=/^=+/u.exec(a),k=s+y.length;b.suggestions=[{desc:`h${s}`,range:[b.startIndex,b.startIndex+y.length],text:""}],k<7&&b.suggestions.push({desc:`h${k}`,range:[b.endIndex,b.endIndex],text:y})}else{let y=/[^=](=+)$/u.exec(a)[1],k=s+y.length;b.suggestions=[{desc:`h${s}`,range:[b.endIndex-y.length,b.endIndex],text:""}],k<7&&b.suggestions.push({desc:`h${k}`,range:[b.startIndex,b.startIndex],text:y})}n.push(b)}if(d){let T="parsing-order",b=c.getSeverity(T,d===2?"heading":"templateInTable");b&&n.push(F(this,g,T,"header-in-html",b))}if(x[2]){let T=this.getRootNode().toString(),b=i.childNodes.filter(pr("quote")),y=b.filter(({bold:A})=>A),k=b.filter(({italic:A})=>A);if(y.length%2){let A=j(y[y.length-1],ge(V({},g),{start:e+s,left:g.left+s}),p[2],v.msg("unbalanced-in-section-header","bold-apostrophes"),x[2]);if(f||h){let N=e+s+a.length,E=O(A);T.slice(A.endIndex,N).trim()?f&&(A.suggestions=[E,Le(N,"'''")]):y.length===1&&k.length===0?A.fix=E:f&&(A.suggestions=[E])}n.push(A)}if(k.length%2){let A=j(k[k.length-1],{start:e+s},p[2],v.msg("unbalanced-in-section-header","italic-apostrophes"),x[2]);if(f||h){let N=e+s+a.length;T.slice(A.endIndex,N).trim()?f&&(A.suggestions=[Le(N,"''")]):k.length===1&&y.length===0?A.fix=O(A):f&&(A.suggestions=[O(A)])}n.push(A)}}return n}}print(){}json(e,t,n=this.getAbsoluteIndex()){}};Mi=B(pg),Zr=new WeakMap,en=new WeakSet,Ui=function(){return"=".repeat(this.level)},Qe=P(Mi,0,"HeadingToken",ba,Qe),R(Mi,1,Qe)});var fg,Jn,xa=w(()=>{"use strict";ae();z();D();G();fg=new RegExp(`https?://${De}${Me}$`,"iu"),Jn=class extends L{get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){}constructor(r,e,t,n=[]){super(void 0,t,n);let i=new L(typeof r=="number"?void 0:r,t,n,{}),s=new L(e,t,n);i.type="parameter-key",i.setAttribute("stage",2),s.type="parameter-value",s.setAttribute("stage",2),this.append(i,s)}trimName(r,e=!0){let t=(typeof r=="string"?r:r.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:r,firstChild:e}=this,t=this.trimName(e);r&&r.getArgs(t,!1,!1).add(this)}super.afterBuild()}toString(r){return this.anon?this.lastChild.toString(r):super.toString(r,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(r=this.getAbsoluteIndex(),e){var t;{let n=super.lint(r,e),i="unescaped",{lintConfig:s}=v,a=s.getSeverity(i);if(a){let{firstChild:l}=this,u=(t=fg.exec(l.text()))==null?void 0:t[0];try{if(u&&new URL(u).search){let g=j(l,{start:r},i,"unescaped-query",a);g.startIndex=g.endIndex,g.startLine=g.endLine,g.startCol=g.endCol,g.endIndex++,g.endCol++,(s.computeEditInfo||s.fix)&&(g.fix=Ge(g.startIndex,"{{=}}")),n.push(g)}}catch(g){}}return n}}print(){}json(r,e,t=this.getAbsoluteIndex()){}}});var ya,tn,Pt,fr,Bt,cr,jt,Hi,Ta,Gi,cg,mt,ka=w(()=>{"use strict";ae();z();Se();se();Vr();xe();D();G();xa();lt();at();ya=[Q,ut()];mt=class extends(cg=L){constructor(e,t,n,i=[]){var T,b;let s,a=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(e);a&&(s=Number(a[1]),e=e.replace(`\0${s}h`,i[s].toString().replace(/^\n/u,"")));super(void 0,n,i,{});S(this,jt);ce(this,"modifier","");S(this,tn,"template");S(this,Pt,":");S(this,fr,!1);S(this,Bt,new Map);S(this,cr);let{parserFunction:l,variable:u,functionHook:g}=n,d=(T=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(e))==null?void 0:T[0];if(d)this.setAttribute("modifier",d),e=e.slice(d.length);else if(e.includes(":")){let[y,...k]=e.split(":"),[A]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((b=k[0])!=null?b:"");this.setModifier(`${y}:${A}`)&&(e=k.join(":").slice(A.length))}let p=e.search(/[::]/u),c=e[p]===":",f=p!==-1;if(f||t.length===0&&!m(this,fr)){let y=f?e.slice(0,p):e,k=f&&e.slice(p+1),A=re(y),N=f?A.slice(A.search(/\S/u))+(c?":":""):A.trim(),[,E,$]=va(N,l),H=!("functionHook"in n)||g.includes($),q=u.includes($);if(f?$&&H:q){this.setAttribute("name",$),C(this,tn,"magic-word"),c&&C(this,Pt,":");let K=new he(y,"magic-word-name",n,i);if(super.insertAt(K),k!==!1&&t.unshift([k]),this.name==="invoke")for(let _=0;_<2;_++){let U=t.shift();if(!U)break;let M=new pe(U.join("="),`invoke-${_?"function":"module"}`,n,i);super.insertAt(M)}}}if(this.type==="template"){let y=re(e).trim();if(!this.normalizeTitle(y,10,{halfParsed:!0,temporary:!0}).valid)throw i.pop(),new SyntaxError("Invalid template name");let k=new pe(e,"template-name",n,i,{});super.insertAt(k)}typeof s=="number"&&(i[s]=void 0);let h=this.isTemplate(),x=1;for(let y=0;y<t.length;y++){let k=t[y];h||this.name==="switch"&&y>0||this.name==="tag"&&y>1||(k[0]=k.join("="),k.length=1),k.length===1&&(k.unshift(x),x++),this.insertAt(new Jn(...k,n,i))}this.seal("modifier")}get type(){return m(this,tn)}get module(){}get function(){}setModifier(e){let[,,t,n]=this.getAttribute("config").parserFunction,i=re(e).trim();if(e&&!i.endsWith(":"))return!1;let s=i.slice(0,-1).toLowerCase(),a=t.includes(s),l=n.includes(s);return(m(this,fr)?a:l||!e)||(oe.running||this.length>1)&&(a||l||!e)?(this.setAttribute("modifier",e),C(this,fr,a),!!e):!1}isTemplate(){return this.type==="template"||this.name==="invoke"}afterBuild(){this.modifier.includes("\0")&&this.setAttribute("modifier",this.buildFromStr(this.modifier,0)),super.afterBuild(),this.isTemplate()&&this.type==="template"&&(C(this,cr,I(this,jt,Hi).call(this)),this.setAttribute("name",m(this,cr).title))}toString(e){let{childNodes:t,length:n,firstChild:i,modifier:s,type:a}=this;return`{{${s}${a==="magic-word"?i.toString(e)+(n===1?"":m(this,Pt))+t.slice(1).map(l=>l.toString(e)).join("|"):super.toString(e,"|")}}}`}text(){let{childNodes:e,length:t,firstChild:n,modifier:i,type:s,name:a}=this;return s==="magic-word"&&a==="vardefine"?"":`{{${i}${s==="magic-word"?n.text()+(t===1?"":m(this,Pt))+Ee(e.slice(1),"|"):super.text("|")}}}`}getAttribute(e){switch(e){case"padding":return this.modifier.length+2;case"title":return m(this,cr);case"colon":return m(this,Pt);default:return super.getAttribute(e)}}lint(e=this.getAbsoluteIndex(),t){{let n=super.lint(e,t);if(!this.isTemplate())return n;let{type:i,childNodes:s,length:a}=this,l=new W(this,e),{lintConfig:u}=v,{computeEditInfo:g}=u,d=i==="magic-word",p="no-ignored",c=u.getSeverity(p,"fragment");if(d&&!I(this,jt,Hi).call(this).valid)p="invalid-invoke",c=u.getSeverity(p,"name"),c&&n.push(j(s[1],l,p,"illegal-module",c));else if(c){let f=s[d?1:0],h=f.childNodes.findIndex(T=>T.type==="text"&&jr(T.data).includes("#")),x=f.childNodes[h];if(x){let T=j(f,l,p,"useless-fragment",c);g&&(T.suggestions=[O(T,f.getRelativeIndex(h)+x.data.indexOf("#"))]),n.push(T)}}if(p="invalid-invoke",c=u.getSeverity(p,"function"),c&&d&&a===2)return n.push(F(this,l,p,"missing-function",c)),n;if(p="no-duplicate",c=u.getSeverity(p,"parameter"),c){let f=this.getDuplicatedArgs().filter(([,x])=>!x[0].querySelector("ext")),h="duplicate-parameter";for(let[,x]of f)Array.prototype.push.apply(n,x.map(T=>{let b=j(T,l,p,h,c);return g&&(b.suggestions=[O(b,-1)]),b}))}return n}}insertAt(e,t=this.length){return super.insertAt(e,t),e.anon?I(this,jt,Ta).call(this,e):e.name&&this.getArgs(e.name,!1,!1).add(e),e}getAllArgs(){return this.childNodes.filter(pr("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:e})=>e)}getArgs(e,t,n=!0){let i=String(e).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),s;return m(this,Bt).has(i)?s=m(this,Bt).get(i):(s=new Set(this.getAllArgs().filter(({name:a})=>i===a)),m(this,Bt).set(i,s)),s}getDuplicatedArgs(){return[...m(this,Bt)].filter(([,{size:e}])=>e>1).map(([e,t])=>[e,[...t]])}getPossibleValues(){let{type:e,name:t,childNodes:n}=this;if(e==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let i,s;switch(t){case"if":case"ifexist":case"ifexpr":case"iferror":i=2;break;case"ifeq":i=3;break;case"switch":{let a=n.slice(2),l=a[a.length-1];s=[...a.filter(({anon:u})=>!u),...l!=null&&l.anon?[l]:[]].map(({lastChild:u})=>u);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}s!=null||(s=n.slice(i,i+2).map(({lastChild:a})=>a));for(let a=0;a<s.length;){let{length:l,0:u}=s[a].childNodes.filter(g=>g.text().trim());if(l===0)s.splice(a,1);else if(l>1||!u.is("magic-word"))a++;else try{let g=u.getPossibleValues();Array.prototype.splice.apply(s,[a,1,...g]),a+=g.length}catch(g){a++}}return s}print(){}};Gi=B(cg),tn=new WeakMap,Pt=new WeakMap,fr=new WeakMap,Bt=new WeakMap,cr=new WeakMap,jt=new WeakSet,Hi=function(){let e=this.type==="template";return this.normalizeTitle((e?"":"Module:")+re(this.childNodes[e?0:1].text()),10,V({temporary:!0},!e&&{page:""}))},Ta=function(e){let t=this.getAnonArgs(),n=typeof e!="number";for(let i=n?t.indexOf(e):e-1;i<t.length;i++){let s=t[i],{name:a}=s,l=String(i+1);(a!==l||s===e)&&(s.setAttribute("name",l),this.getArgs(l,!1,!1).add(s))}},mt=P(Gi,0,"TranscludeToken",ya,mt),R(Gi,1,mt)});var Aa,Vi,mg,Ot,Sa=w(()=>{"use strict";ot();xe();G();Aa=[ve(),Q];Ot=class extends(mg=L){get type(){return"hidden"}getAttribute(r){return r==="invalid"||super.getAttribute(r)}};Vi=B(mg),Ot=P(Vi,0,"HiddenToken",Aa,Ot),R(Vi,1,Ot)});var Ca,Xi,hg,Qi,bg,qt,wa=w(()=>{"use strict";ae();z();se();qe();Vr();xe();D();G();lt();Sa();Ca=[Q,ue("{{{"),ut()];qt=class extends(bg=L){constructor(e,t,n=[]){super(void 0,t,n,{});S(this,Xi);for(let i=0;i<e.length;i++){let s=e[i];if(i===0){let a=new pe(s,"arg-name",t,n,{});super.insertAt(a)}else if(i>1){let a=new Ot(s,t,n);super.insertAt(a)}else{let a=new L(s,t,n);a.type="arg-default",a.setAttribute("stage",2),super.insertAt(a)}}}get type(){return"arg"}get default(){}toString(e){return`{{{${super.toString(e,"|")}}}}`}text(){return`{{{${Ee(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){super.afterBuild()}lint(e=this.getAbsoluteIndex(),t){{let[n,i,...s]=this.childNodes;n.setAttribute("aIndex",e+3);let a=n.lint(e+3,t);if(i){let f=e+4+n.toString().length;i.setAttribute("aIndex",f);let h=i.lint(f,t);h.length>0&&Array.prototype.push.apply(a,h)}let l=["no-ignored","no-arg"],{lintConfig:u}=v,{computeEditInfo:g}=u,d=new W(this,e),p=l.map(f=>u.getSeverity(f,"arg"));if(p[0]&&s.length>0&&Array.prototype.push.apply(a,s.map(f=>{let h=j(f,d,l[0],"invisible-triple-braces",p[0]);return h.startIndex--,h.startCol--,g&&(h.suggestions=[O(h),Ge(h.startIndex,"{{!}}")]),h})),p[1]&&!this.getAttribute("include")){let f=F(this,d,l[1],"unexpected-argument",p[1]);g&&i&&(f.suggestions=[me(f,"expand",i.text())]),a.push(f)}let c=this.closest("ext");if(c){let f="arg-in-ext",h=u.getSeverity(f,c.name);h&&a.push(F(this,d,f,"argument-in-ext",h))}return a}}print(){}json(e,t,n=this.getAbsoluteIndex()){}};Qi=B(bg),Xi=new WeakSet,hg=function(){},qt=P(Qi,0,"ArgToken",Ca,qt),R(Qi,1,qt)});var Ra={};Z(Ra,{parseBraces:()=>rn});var xg,Ea,Ji,La,Na,$a,Fa,Ia,rn,Kn=w(()=>{"use strict";ze();ae();zi();ka();wa();xg={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},Ea=String.raw`\[(?!\[)`,Ji=String.raw`\n(?![=\0])`,La=String.raw`|\{{2,}`,Na=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),$a=Be(o=>new RegExp(o,"gmu"));Fa=new RegExp(String.raw`\{\{((?:[^\n{}[]|${Ea}|${Ji})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${Ji})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${Ea}|${Ji})*\}-`,"gu");Ia=o=>{let r=Ue(re(o));return Na.has(r)?Na.get(r):/^(?:filepath|(?:full|canonical)urle?):./u.test(r)?"m":/^#vardefine:./u.test(r)?"n":"t"},rn=(o,r,e)=>{var f,h,x,T,b;let t=String.raw`${r.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,[,,,n]=r.parserFunction,i=[],s=[],a=(y,k,A,N)=>{k[k.length-1].push(ke(y.slice(A,N),s))},l;do l!==void 0&&(o=l),l=o.replace(Fa,(y,k,A)=>{if(k!==void 0||typeof A=="string")try{let{length:N}=e,E=(k!=null?k:A).split("|");return new mt(ke(E[0],s),E.slice(1).map($=>{let H=$.indexOf("=");return(H===-1?[$]:[$.slice(0,H),$.slice(H+1)]).map(q=>ke(q,s))}),r,e),`\0${N}${Ia(E[0])}`}catch(N){if(!(N instanceof SyntaxError)||N.message!=="Invalid template name")throw N}return s.push(ke(y,s)),`\0${s.length-1}`});while(l!==o);o=l;let u=o.lastIndexOf("}}")-o.length,g=u+o.length!==-1,d=$a(t+(g?La:"")),p=d.exec(o),c;for(;p||c!==void 0&&c<=o.length&&((h=(f=i[i.length-1])==null?void 0:f[0])!=null&&h.startsWith("="));){if(p!=null&&p[1]){let[,{length:U}]=p;p[0]=p[0].slice(U),p.index+=U}let{0:y,index:k}=p!=null?p:{0:`
|
|
8
|
+
`)}getGaps(){return 1}print(){}}});var Xn,ma=w(()=>{"use strict";z();qi();D();G();Xn=class extends L{get type(){return"param-line"}constructor(r,e,t,n,i){super(e,t,n,i),this.setAttribute("name",r)}lint(r=this.getAbsoluteIndex()){{let e="no-ignored",{lintConfig:t}=v,{name:n,childNodes:i}=this,s=t.getSeverity(e,n);if(!s)return[];let a=v.msg("invalid-parameter",n);if(i.some(({type:u})=>u==="ext"))return[F(this,{start:r},e,a,s)];let l=i.filter(({type:u})=>u!=="comment"&&u!=="include"&&u!=="noinclude"),p=n==="inputbox",g=p?l.findIndex(({type:u})=>u!=="text"):-1,d=l.slice(0,g===-1?void 0:g).map(String).join("").trim();if(d){p&&(d=d.toLowerCase());let u=d.indexOf("="),c=d.slice(0,u===-1?void 0:u).trim(),f=da[n];if(u===-1?g===-1||!f.some(h=>h.startsWith(c)):!f.includes(c)){let h=F(this,{start:r},e,a,s);return t.computeEditInfo&&(h.suggestions=[O(h)]),[h]}}return super.lint(r,!1)}}}});var ha={};Z(ha,{ParamTagToken:()=>Jr});var Jr,Mi=w(()=>{"use strict";Kr();Qn();ma();Jr=class extends ct{constructor(r,e,t,n,i=[],s){super(void 0,n,i,{}),t&&this.safeAppend(t.split(`
|
|
9
|
+
`).map(a=>s?a:Rt(a,n,i,e)).map(a=>new Xn(r,a,n,i,{}))),i.splice(i.indexOf(this),1),i.push(this)}}});var ba,Yr,Zr,zi,Ui,ug,Qe,Gi=w(()=>{"use strict";z();Se();se();xe();D();G();at();ba=[Q];Qe=class extends(ug=L){constructor(e,t,n,i=[]){super(void 0,n,i);S(this,Zr);S(this,Yr);C(this,Yr,e);let s=new L(t[0],n,i);s.type="heading-title",s.setAttribute("stage",2);let a=new he(t[1],"heading-trail",n,i);this.append(s,a)}get type(){return"heading"}get level(){return m(this,Yr)}toString(e){let t=I(this,Zr,zi).call(this);return t+this.firstChild.toString(e)+t+this.lastChild.toString(e)}text(){let e=I(this,Zr,zi).call(this);return e+this.firstChild.text()+e}getAttribute(e){return e==="invalid"?this.inHtmlAttrs()===2:e==="padding"?this.level:super.getAttribute(e)}getGaps(){return this.level}lint(e=this.getAbsoluteIndex(),t){{let n=super.lint(e,t),{firstChild:i,level:s}=this,a=i.toString(),l=a.startsWith("="),p=l||a.endsWith("="),g=new W(this,e),d=this.inHtmlAttrs(),u=["h1","unbalanced-header","format-leakage"],{lintConfig:c}=v,{computeEditInfo:f,fix:h}=c,x=u.map(T=>c.getSeverity(T,"apostrophe"));if(x[0]&&this.level===1){let T=j(i,g,u[0],"<h1>",x[0]);f&&!p&&(T.suggestions=[me(T,"h2",`=${a}=`)]),n.push(T)}if(x[1]&&p){let T=v.msg("unbalanced-in-section-header",'"="'),b=j(i,g,u[1],T,x[1]);if(!(!f||a==="="))if(l){let[y]=/^=+/u.exec(a),k=s+y.length;b.suggestions=[{desc:`h${s}`,range:[b.startIndex,b.startIndex+y.length],text:""}],k<7&&b.suggestions.push({desc:`h${k}`,range:[b.endIndex,b.endIndex],text:y})}else{let y=/[^=](=+)$/u.exec(a)[1],k=s+y.length;b.suggestions=[{desc:`h${s}`,range:[b.endIndex-y.length,b.endIndex],text:""}],k<7&&b.suggestions.push({desc:`h${k}`,range:[b.startIndex,b.startIndex],text:y})}n.push(b)}if(d){let T="parsing-order",b=c.getSeverity(T,d===2?"heading":"templateInTable");b&&n.push(F(this,g,T,"header-in-html",b))}if(x[2]){let T=this.getRootNode().toString(),b=i.childNodes.filter(Jn("quote")),y=b.filter(({bold:A})=>A),k=b.filter(({italic:A})=>A);if(y.length%2){let A=j(y[y.length-1],ge(V({},g),{start:e+s,left:g.left+s}),u[2],v.msg("unbalanced-in-section-header","bold-apostrophes"),x[2]);if(f||h){let N=e+s+a.length,E=O(A);T.slice(A.endIndex,N).trim()?f&&(A.suggestions=[E,Le(N,"'''")]):y.length===1&&k.length===0?A.fix=E:f&&(A.suggestions=[E])}n.push(A)}if(k.length%2){let A=j(k[k.length-1],{start:e+s},u[2],v.msg("unbalanced-in-section-header","italic-apostrophes"),x[2]);if(f||h){let N=e+s+a.length;T.slice(A.endIndex,N).trim()?f&&(A.suggestions=[Le(N,"''")]):k.length===1&&y.length===0?A.fix=O(A):f&&(A.suggestions=[O(A)])}n.push(A)}}return n}}print(){}json(e,t,n=this.getAbsoluteIndex()){}};Ui=B(ug),Yr=new WeakMap,Zr=new WeakSet,zi=function(){return"=".repeat(this.level)},Qe=P(Ui,0,"HeadingToken",ba,Qe),R(Ui,1,Qe)});var fg,Kn,xa=w(()=>{"use strict";ae();z();D();G();fg=new RegExp(`https?://${De}${Me}$`,"iu"),Kn=class extends L{get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){}constructor(r,e,t,n=[]){super(void 0,t,n);let i=new L(typeof r=="number"?void 0:r,t,n,{}),s=new L(e,t,n);i.type="parameter-key",i.setAttribute("stage",2),s.type="parameter-value",s.setAttribute("stage",2),this.append(i,s)}trimName(r,e=!0){let t=(typeof r=="string"?r:r.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:r,firstChild:e}=this,t=this.trimName(e);r&&r.getArgs(t,!1,!1).add(this)}super.afterBuild()}toString(r){return this.anon?this.lastChild.toString(r):super.toString(r,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(r=this.getAbsoluteIndex(),e){var t;{let n=super.lint(r,e),i="unescaped",{lintConfig:s}=v,a=s.getSeverity(i);if(a){let{firstChild:l}=this,p=(t=fg.exec(l.text()))==null?void 0:t[0];try{if(p&&new URL(p).search){let g=j(l,{start:r},i,"unescaped-query",a);g.startIndex=g.endIndex,g.startLine=g.endLine,g.startCol=g.endCol,g.endIndex++,g.endCol++,(s.computeEditInfo||s.fix)&&(g.fix=Ge(g.startIndex,"{{=}}")),n.push(g)}}catch(g){}}return n}}print(){}json(r,e,t=this.getAbsoluteIndex()){}}});var ya,en,Pt,ur,Bt,tn,fr,jt,Vi,Ta,Hi,cg,mt,ka=w(()=>{"use strict";ae();z();Se();se();Hr();xe();D();G();xa();lt();at();ya=[Q,pt()];mt=class extends(cg=L){constructor(e,t,n,i=[]){var T,b;let s,a=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(e);a&&(s=Number(a[1]),e=e.replace(`\0${s}h`,i[s].toString().replace(/^\n/u,"")));super(void 0,n,i,{});S(this,jt);ce(this,"modifier","");S(this,en,"template");S(this,Pt,":");S(this,ur,!1);S(this,Bt,new Map);S(this,tn,0);S(this,fr);let{parserFunction:l,variable:p,functionHook:g}=n,d=(T=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(e))==null?void 0:T[0];if(d)this.setAttribute("modifier",d),e=e.slice(d.length);else if(e.includes(":")){let[y,...k]=e.split(":"),[A]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((b=k[0])!=null?b:"");this.setModifier(`${y}:${A}`)&&(e=k.join(":").slice(A.length))}let u=e.search(/[::]/u),c=e[u]===":",f=u!==-1;if(f||t.length===0&&!m(this,ur)){let y=f?e.slice(0,u):e,k=f&&e.slice(u+1),A=re(y),N=f?A.slice(A.search(/\S/u))+(c?":":""):A.trim(),[,E,$]=va(N,l),H=!("functionHook"in n)||g.includes($),q=p.includes($);if(f?$&&H:q){this.setAttribute("name",$),C(this,en,"magic-word"),c&&C(this,Pt,":");let K=new he(y,"magic-word-name",n,i);if(super.insertAt(K),k!==!1&&t.unshift([k]),this.name==="invoke")for(let _=0;_<2;_++){let U=t.shift();if(!U)break;let M=new ue(U.join("="),`invoke-${_?"function":"module"}`,n,i);super.insertAt(M)}}}if(this.type==="template"){let y=re(e).trim();if(!this.normalizeTitle(y,10,{halfParsed:!0,temporary:!0}).valid)throw i.pop(),new SyntaxError("Invalid template name");let k=new ue(e,"template-name",n,i,{});super.insertAt(k)}typeof s=="number"&&(i[s]=void 0);let h=this.isTemplate(),x=1;for(let y=0;y<t.length;y++){let k=t[y];h||this.name==="switch"&&y>0||this.name==="tag"&&y>1||(k[0]=k.join("="),k.length=1),k.length===1&&(k.unshift(x),x++),this.insertAt(new Kn(...k,n,i))}this.seal("modifier")}get type(){return m(this,en)}get module(){}get function(){}setModifier(e){let[,,t,n]=this.getAttribute("config").parserFunction,i=re(e).trim();if(e&&!i.endsWith(":"))return!1;let s=i.slice(0,-1).toLowerCase(),a=t.includes(s),l=n.includes(s);return(m(this,ur)?a:l||!e)||(oe.running||this.length>1)&&(a||l||!e)?(this.setAttribute("modifier",e),C(this,ur,a),!!e):!1}isTemplate(){return this.type==="template"||this.name==="invoke"}afterBuild(){this.modifier.includes("\0")&&this.setAttribute("modifier",this.buildFromStr(this.modifier,0)),super.afterBuild(),this.isTemplate()&&this.type==="template"&&(C(this,fr,I(this,jt,Vi).call(this)),this.setAttribute("name",m(this,fr).title))}toString(e){let{childNodes:t,length:n,firstChild:i,modifier:s,type:a}=this;return`{{${s}${a==="magic-word"?i.toString(e)+(n===1?"":m(this,Pt))+t.slice(1).map(l=>l.toString(e)).join("|"):super.toString(e,"|")}}}`}text(){let{childNodes:e,length:t,firstChild:n,modifier:i,type:s,name:a}=this;return s==="magic-word"&&a==="vardefine"?"":`{{${i}${s==="magic-word"?n.text()+(t===1?"":m(this,Pt))+Ee(e.slice(1),"|"):super.text("|")}}}`}getAttribute(e){switch(e){case"padding":return this.modifier.length+2;case"title":return m(this,fr);case"colon":return m(this,Pt);default:return super.getAttribute(e)}}lint(e=this.getAbsoluteIndex(),t){{let n=super.lint(e,t);if(!this.isTemplate())return n;let{type:i,childNodes:s,length:a}=this,l=new W(this,e),{lintConfig:p}=v,{computeEditInfo:g}=p,d=i==="magic-word",u="no-ignored",c=p.getSeverity(u,"fragment");if(d&&!I(this,jt,Vi).call(this).valid)u="invalid-invoke",c=p.getSeverity(u,"name"),c&&n.push(j(s[1],l,u,"illegal-module",c));else if(c){let f=s[d?1:0],h=f.childNodes.findIndex(T=>T.type==="text"&&Br(T.data).includes("#")),x=f.childNodes[h];if(x){let T=j(f,l,u,"useless-fragment",c);g&&(T.suggestions=[O(T,f.getRelativeIndex(h)+x.data.indexOf("#"))]),n.push(T)}}if(u="invalid-invoke",c=p.getSeverity(u,"function"),c&&d&&a===2)return n.push(F(this,l,u,"missing-function",c)),n;if(u="no-duplicate",c=p.getSeverity(u,"parameter"),c){let f=this.getDuplicatedArgs().filter(([,x])=>!x[0].querySelector("ext")),h="duplicate-parameter";for(let[,x]of f)Array.prototype.push.apply(n,x.map(T=>{let b=j(T,l,u,h,c);return g&&(b.suggestions=[O(b,-1)]),b}))}return n}}insertAt(e,t=this.length){return super.insertAt(e,t),e.anon?I(this,jt,Ta).call(this,e):e.name&&this.getArgs(e.name,!1,!1).add(e),e}getArgs(e,t,n=!0,i=!0){let s=String(e).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),a;return m(this,Bt).has(s)?a=m(this,Bt).get(s):(a=new Set,m(this,Bt).set(s,a)),a}getDuplicatedArgs(){return[...m(this,Bt)].filter(([,{size:e}])=>e>1).map(([e,t])=>[e,[...t]])}getPossibleValues(){let{type:e,name:t,childNodes:n}=this;if(e==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let i,s;switch(t){case"if":case"ifexist":case"ifexpr":case"iferror":i=2;break;case"ifeq":i=3;break;case"switch":{let a=n.slice(2),l=a[a.length-1];s=[...a.filter(({anon:p})=>!p),...l!=null&&l.anon?[l]:[]].map(({lastChild:p})=>p);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}s!=null||(s=n.slice(i,i+2).map(({lastChild:a})=>a));for(let a=0;a<s.length;){let{length:l,0:p}=s[a].childNodes.filter(g=>g.text().trim());if(l===0)s.splice(a,1);else if(l>1||!p.is("magic-word"))a++;else try{let g=p.getPossibleValues();Array.prototype.splice.apply(s,[a,1,...g]),a+=g.length}catch(g){a++}}return s}print(){}};Hi=B(cg),en=new WeakMap,Pt=new WeakMap,ur=new WeakMap,Bt=new WeakMap,tn=new WeakMap,fr=new WeakMap,jt=new WeakSet,Vi=function(){let e=this.type==="template";return this.normalizeTitle((e?"":"Module:")+re(this.childNodes[e?0:1].text()),10,V({temporary:!0},!e&&{page:""}))},Ta=function(e,t){C(this,tn,m(this,tn)+1);let n;n=m(this,tn)-1;let i=e,s=String(n+1);i.setAttribute("name",s),this.getArgs(s,!1,!1).add(i)},mt=P(Hi,0,"TranscludeToken",ya,mt),R(Hi,1,mt)});var Aa,Qi,mg,Ot,Sa=w(()=>{"use strict";ot();xe();G();Aa=[ve(),Q];Ot=class extends(mg=L){get type(){return"hidden"}getAttribute(r){return r==="invalid"||super.getAttribute(r)}};Qi=B(mg),Ot=P(Qi,0,"HiddenToken",Aa,Ot),R(Qi,1,Ot)});var Ca,Ji,hg,Xi,bg,qt,wa=w(()=>{"use strict";ae();z();se();qe();Hr();xe();D();G();lt();Sa();Ca=[Q,pe("{{{"),pt()];qt=class extends(bg=L){constructor(e,t,n=[]){super(void 0,t,n,{});S(this,Ji);for(let i=0;i<e.length;i++){let s=e[i];if(i===0){let a=new ue(s,"arg-name",t,n,{});super.insertAt(a)}else if(i>1){let a=new Ot(s,t,n);super.insertAt(a)}else{let a=new L(s,t,n);a.type="arg-default",a.setAttribute("stage",2),super.insertAt(a)}}}get type(){return"arg"}get default(){}toString(e){return`{{{${super.toString(e,"|")}}}}`}text(){return`{{{${Ee(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){super.afterBuild()}lint(e=this.getAbsoluteIndex(),t){{let[n,i,...s]=this.childNodes;n.setAttribute("aIndex",e+3);let a=n.lint(e+3,t);if(i){let f=e+4+n.toString().length;i.setAttribute("aIndex",f);let h=i.lint(f,t);h.length>0&&Array.prototype.push.apply(a,h)}let l=["no-ignored","no-arg"],{lintConfig:p}=v,{computeEditInfo:g}=p,d=new W(this,e),u=l.map(f=>p.getSeverity(f,"arg"));if(u[0]&&s.length>0&&Array.prototype.push.apply(a,s.map(f=>{let h=j(f,d,l[0],"invisible-triple-braces",u[0]);return h.startIndex--,h.startCol--,g&&(h.suggestions=[O(h),Ge(h.startIndex,"{{!}}")]),h})),u[1]&&!this.getAttribute("include")){let f=F(this,d,l[1],"unexpected-argument",u[1]);g&&i&&(f.suggestions=[me(f,"expand",i.text())]),a.push(f)}let c=this.closest("ext");if(c){let f="arg-in-ext",h=p.getSeverity(f,c.name);h&&a.push(F(this,d,f,"argument-in-ext",h))}return a}}print(){}json(e,t,n=this.getAbsoluteIndex()){}};Xi=B(bg),Ji=new WeakSet,hg=function(){},qt=P(Xi,0,"ArgToken",Ca,qt),R(Xi,1,qt)});var Ra={};Z(Ra,{parseBraces:()=>rn});var xg,Ea,Ki,La,Na,$a,Fa,Ia,rn,Yn=w(()=>{"use strict";ze();ae();Gi();ka();wa();xg={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},Ea=String.raw`\[(?!\[)`,Ki=String.raw`\n(?![=\0])`,La=String.raw`|\{{2,}`,Na=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),$a=Be(o=>new RegExp(o,"gmu"));Fa=new RegExp(String.raw`\{\{((?:[^\n{}[]|${Ea}|${Ki})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${Ki})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${Ea}|${Ki})*\}-`,"gu");Ia=o=>{let r=Ue(re(o));return Na.has(r)?Na.get(r):/^(?:filepath|(?:full|canonical)urle?):./u.test(r)?"m":/^#vardefine:./u.test(r)?"n":"t"},rn=(o,r,e)=>{var f,h,x,T,b;let t=String.raw`${r.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,[,,,n]=r.parserFunction,i=[],s=[],a=(y,k,A,N)=>{k[k.length-1].push(ke(y.slice(A,N),s))},l;do l!==void 0&&(o=l),l=o.replace(Fa,(y,k,A)=>{if(k!==void 0||typeof A=="string")try{let{length:N}=e,E=(k!=null?k:A).split("|");return new mt(ke(E[0],s),E.slice(1).map($=>{let H=$.indexOf("=");return(H===-1?[$]:[$.slice(0,H),$.slice(H+1)]).map(q=>ke(q,s))}),r,e),`\0${N}${Ia(E[0])}`}catch(N){if(!(N instanceof SyntaxError)||N.message!=="Invalid template name")throw N}return s.push(ke(y,s)),`\0${s.length-1}`});while(l!==o);o=l;let p=o.lastIndexOf("}}")-o.length,g=p+o.length!==-1,d=$a(t+(g?La:"")),u=d.exec(o),c;for(;u||c!==void 0&&c<=o.length&&((h=(f=i[i.length-1])==null?void 0:f[0])!=null&&h.startsWith("="));){if(u!=null&&u[1]){let[,{length:U}]=u;u[0]=u[0].slice(U),u.index+=U}let{0:y,index:k}=u!=null?u:{0:`
|
|
10
10
|
`,index:o.length},A=(x=i.pop())!=null?x:{},{0:N,index:E,parts:$,findEqual:H,pos:q}=A,K=y==="="&&H;if(y==="]]"||y==="}-")c=k+2;else if(y===`
|
|
11
11
|
`){c=k+1;let{pos:U,findEqual:M}=(T=i[i.length-1])!=null?T:{};if(U===void 0||M||re(o.slice(U,E))!==""){let be=/^(={1,6})(.+)\1((?:\s|\0\d+[cn]\x7F)*)$/u.exec(o.slice(E,k));be&&(be[2]=ke(be[2],s),be[2].includes(`
|
|
12
|
-
`)||(o=`${o.slice(0,E)}\0${e.length}h${o.slice(k)}`,c=E+4+String(e.length).length,new Qe(be[1].length,be.slice(2),r,e)))}}else if(y==="|"||K)c=k+1,a(o,$,q,k),y==="|"&&$.push([]),A.pos=c,A.findEqual=y==="|",i.push(A);else if(y.startsWith("}}")){let U=y.slice(0,Math.min(N.length,3)),M=N.length-U.length,{length:be}=e;c=k+U.length,a(o,$,q,k);let Jt=!1,bt="t";if(U.length===3){let Y=$.map(
|
|
13
|
-
)`:""}(\s*)$`,"u")),Sg=o=>{if(o)o.startsWith("//")&&(o=`https:${o}`);else return o;return new URL(o).href};ja=[Q];_t=class extends(Cg=L){constructor(e,t,n,i,s){var r=(...
|
|
14
|
-
`))!=null?i:[]){let a=/^([^|]+)(?:\|(.*))?/u.exec(s);if(!a){super.insertAt(s.trim()?new Wt(s,t,n):s);continue}let[,l,
|
|
15
|
-
`),i=new Set(e.protocol.split("|")),s=!0,a=!1;for(let l of n){let u=l.trim();if(!(a||!u||u.startsWith("#"))){if(s){let g=l.indexOf("|"),d=g===-1?l:l.slice(0,g),p=this.normalizeTitle(d,0,{halfParsed:!0,temporary:!0,page:""});if(p.valid&&p.ns===6){let c=new Je("imagemap",d,g===-1?void 0:l.slice(g+1),e,t);super.insertAt(c),s=!1;continue}else a=!0}else if(l.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(l);continue}else if(l.includes("[")){let g=l.indexOf("["),d=l.slice(g),p=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(d);if(p){if(this.normalizeTitle(p[1],0,{halfParsed:!0,temporary:!0,selfLink:!0,page:""}).valid){super.insertAt(new dn(l.slice(0,g),p.slice(1),d.slice(d.indexOf("]]")+2),e,t));continue}}else if(d.startsWith("[//")||i.has(d.slice(1,d.indexOf(":")+1))||i.has(d.slice(1,d.indexOf("//")+2))){let c=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(d);if(c){super.insertAt(new dn(l.slice(0,g),c.slice(1),d.slice(d.indexOf("]")+1),e,t));continue}}}}super.insertAt(new Wt(l,e,t))}}lint(r=this.getAbsoluteIndex(),e){{let t=super.lint(r,e),n=new W(this,r),{childNodes:i,image:s}=this,a="invalid-imagemap",{lintConfig:l}=v,u=l.getSeverity(a,s?"link":"image");return u&&(s?Array.prototype.push.apply(t,i.filter(g=>{let d=g.toString().trim();return g.is("noinclude")&&d&&!d.startsWith("#")}).map(g=>{let d=j(g,n,a,"invalid-imagemap-link",u);return l.computeEditInfo&&(d.suggestions=[O(d,-1),me(d,"comment","# ")]),d})):t.push(F(this,n,a,"imagemap-without-image",u))),t}}getAttribute(r){return r==="invalid"?!this.image:super.getAttribute(r)}}});var Ka,fs,Pg,Ze,cs=w(()=>{"use strict";z();ot();qe();D();gt();Ka=[ve(!1),ue("<!--")];Ze=class extends(Pg=le){constructor(e,t,n,i){super(e,n,i);ce(this,"closed");this.closed=t}get type(){return"comment"}lint(e=this.getAbsoluteIndex()){{if(this.closed)return[];let t="unclosed-comment",{lintConfig:n}=v,i=n.getSeverity(t);if(!i)return[];let s=F(this,{start:e},t,"unclosed-comment",i);return n.computeEditInfo&&(s.suggestions=[Le(s.endIndex,"-->")]),[s]}}toString(e){return e?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){}};fs=B(Pg),Ze=P(fs,0,"CommentToken",Ka,Ze),R(fs,1,Ze)});var Ya={};Z(Ya,{CommentedToken:()=>ms});var ms,Za=w(()=>{"use strict";G();cs();ms=class extends L{get type(){return"ext-inner"}constructor(r,e,t=[]){if(super(void 0,e,t,{AstText:":",CommentToken:":"}),r){let n=r.indexOf("<!--"),i=n!==-1&&r.indexOf("-->",n+4),s=0;for(;i!==!1&&i!==-1;)n>s&&this.insertAt(r.slice(s,n)),this.insertAt(new Ze(r.slice(n+4,i),!0,e,t)),s=i+3,n=r.indexOf("<!--",s),i=n!==-1&&r.indexOf("-->",n+4);s<r.length&&this.insertAt(r.slice(s))}}lint(r=this.getAbsoluteIndex()){return super.lint(r,new RegExp(String.raw`<\s*(?:\/\s*)?(${this.name})\b`,"giu"))}}});var tl={};Z(tl,{CategorytreeToken:()=>xr});var el,hs,Bg,xr,rl=w(()=>{"use strict";z();qe();D();lr();el=[ue("")];xr=class extends(Bg=ye){get type(){return"ext-inner"}constructor(r,e,t,n=[]){super(r,e,t,n),this.setAttribute("bracket",!1)}getTitle(){let r=this.firstChild.toString().trim(),e={halfParsed:!0},t=this.normalizeTitle(r,14,e);return t.valid&&t.ns===14?t:this.normalizeTitle(`Category:${r}`,0,e)}lint(r=this.getAbsoluteIndex()){{let e="no-ignored",t=v.lintConfig.getSeverity(e,"categorytree");if(t){let{link:n}=this;if(!n.valid||n.ns!==14)return[F(this,{start:r},e,"invalid-category",t)]}return super.lint(r,!1)}}};hs=B(Bg),xr=P(hs,0,"CategorytreeToken",el,xr),R(hs,1,xr)});var nl={};Z(nl,{NowikiToken:()=>bs});var jg,Og,gn,xs,bs,il=w(()=>{"use strict";ze();z();se();D();gt();jg=Be(o=>new RegExp(String.raw`<\s*(?:/\s*)${o==="nowiki"?"":"?"}(${o})\b`,"giu")),Og=new Set(["languages","section","templatestyles"]),bs=class extends le{constructor(){super(...arguments);S(this,gn)}get type(){return"ext-inner"}lint(e=this.getAbsoluteIndex()){{let{name:t,innerText:n}=this,{lintConfig:i}=v,s="void-ext",a=i.getSeverity(s,t);if(a&&I(this,gn,xs).call(this)){let l=F(this,{start:e},s,v.msg("nothing-in",t),a);return i.computeEditInfo&&(l.suggestions=[O(l)]),[l]}{s="invalid-json";let l=i.getSeverity(s);if(t==="templatedata"&&l)return co(n).map(({message:u,from:g,to:d=g,line:p,endLine:c=p,column:f,endColumn:h=f})=>{a=l;let x=new W(this,e);return{rule:s,message:u,severity:a,startIndex:e+g,endIndex:e+d,startLine:x.top+p-1,endLine:x.top+c-1,startCol:(p>1?0:x.left)+f-1,endCol:(c>1?0:x.left)+h-1}}).filter(u=>u!==!1)}return super.lint(e,jg(t))}}getAttribute(e){return e==="invalid"?I(this,gn,xs).call(this):super.getAttribute(e)}};gn=new WeakSet,xs=function(){let{name:e,firstChild:{data:t}}=this;return Og.has(e)&&!!t}});var sl,ys,qg,Xe,Zi=w(()=>{"use strict";z();se();D();zn();G();Un();Vn();sl=[dr()];Xe=class extends(qg=Fe){get type(){return"ext"}constructor(r,e,t,n,i=v.getConfig(),s=!1,a=[]){let l=r.toLowerCase(),u=new ft(!e||/^\s/u.test(e)?e:` ${e}`,"ext-attrs",l,i,a),g=ge(V({},i),{ext:i.ext.filter(p=>p!==l),excludes:[...i.excludes],inExt:!0}),d;switch(l){case"pre":if(u.getAttr("format")!=="wikitext"){let{PreToken:p}=(ca(),X(fa));d=new p(t,g,a);break}case"indicator":case"poem":case"ref":case"option":case"combooption":case"tab":case"tabs":case"poll":case"seo":case"langconvert":case"phonos":l==="poem"?g.excludes.push("heading"):l==="tab"&&(g.ext=g.ext.filter(p=>p!=="tabs")),d=new L(t,g,a);break;case"dynamicpagelist":{let{ParamTagToken:p}=(Di(),X(ha));d=new p(l,s,t,g,a);break}case"inputbox":{let{InputboxToken:p}=(Ba(),X(Pa));d=new p(l,s,t,g,a);break}case"references":{let{NestedToken:p}=(Zn(),X(Yn));g.excludes.push("heading"),d=new p(t,s,["ref"],g,a);break}case"choose":{let{NestedToken:p}=(Zn(),X(Yn));d=new p(t,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],g,a);break}case"combobox":{let{NestedToken:p}=(Zn(),X(Yn));d=new p(t,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],g,a);break}case"gallery":{let{GalleryToken:p}=(Ha(),X(Ga));d=new p(t,g,a);break}case"imagemap":{let{ImagemapToken:p}=(Ja(),X(Xa));d=new p(t,g,a);break}case"hiero":{let{CommentedToken:p}=(Za(),X(Ya));d=new p(t,g,a);break}case"categorytree":{let{CategorytreeToken:p}=(rl(),X(tl));d=new p(t,void 0,g,a);break}default:{let{NowikiToken:p}=(il(),X(nl));d=new p(t,g,a)}}d.setAttribute("name",l),d.type==="plain"&&(d.type="ext-inner"),super(r,u,d,n,i,a),this.seal("closed",!0)}lint(r=this.getAbsoluteIndex(),e){{let t=super.lint(r,e),{lintConfig:n}=v,i=new W(this,r);if(this.name!=="nowiki"){let s=this.inHtmlAttrs(),a="parsing-order",l=s&&n.getSeverity(a,s===2?"ext":"templateInTable");l&&t.push(F(this,i,a,"ext-in-html",l))}if(this.name==="ref"){let s="var-anchor",a=n.getSeverity(s,"ref");a&&this.closest("heading-title")&&t.push(F(this,i,s,"variable-anchor",a)),s="nested-link",a=n.getSeverity(s,"ref"),a&&this.closest("link-text,ext-link-text")&&t.push(F(this,i,s,"ref-in-link",a))}return t}}};ys=B(qg),Xe=P(ys,0,"ExtToken",sl,Xe),R(ys,1,Xe)});var ht,Mt,et,yr,Ts=w(()=>{"use strict";z();Se();G();D();yr=class extends L{constructor(e,t,n,i,s){super(void 0,i,s);S(this,ht);S(this,Mt);S(this,et);this.insertAt(t),C(this,ht,n),C(this,Mt,e)}get closing(){return m(this,ht)}toString(e){return`<${m(this,ht)?"/":""}${m(this,Mt)}${super.toString(e)}${this.selfClosing?"/":""}>`}text(e=""){let{closing:t}=this;return`<${t&&!e?"/":""}${m(this,Mt)}${t?"":super.text()}${e}>`}getAttribute(e){return e==="padding"?m(this,Mt).length+(m(this,ht)?2:1):super.getAttribute(e)}findMatchingTag(){return je(m(this,et),()=>{let{type:e,name:t,parentNode:n,closing:i,selfClosing:s}=this,a=!1,l=!1;if(e==="html"){let[,f,h]=this.getAttribute("config").html;a=h.includes(t),l=f.includes(t)}if(a||l&&s)return this;if(!n)return;let{childNodes:u}=n,g=u.indexOf(this),d=i?u.slice(0,g).reverse():u.slice(g+1),p=[this],{rev:c}=oe;for(let f of d)if(!(!f.is(e)||e==="html"&&(f.name!==t||l&&f.selfClosing)))if(m(f,ht)===i){if(e==="tvar")return;p.push(f)}else{let h=p.pop();if(h===this)return f;v.viewOnly&&(C(h,et,[c,f]),C(f,et,[c,h]))}if(v.viewOnly)for(let f of p)C(f,et,[c,void 0])},e=>{C(this,et,e),e[1]&&e[1]!==this&&C(e[1],et,[oe.rev,this])})}print(){}json(e,t,n=this.getAbsoluteIndex()){}};ht=new WeakMap,Mt=new WeakMap,et=new WeakMap});var ol,ks,_g,_e,al=w(()=>{"use strict";ot();xe();Ts();at();ol=[ve(),Q];_e=class extends(_g=yr){get type(){return"tvar"}constructor(r,e,t,n,i){let s=new he(e,"tvar-name",n,i);super(r,s,t,n,i)}};ks=B(_g),_e=P(ks,0,"TvarToken",ol,_e),R(ks,1,_e)});var ll={};Z(ll,{TranslateToken:()=>vs});var As,Wg,vs,dl=w(()=>{"use strict";G();Un();at();al();vs=class extends Fe{constructor(e,t,n,i=[]){let s=new he(e,"translate-attr",n,i);t=t==null?void 0:t.replace(/<tvar(\|[^>]+)>([\s\S]*?)<\/>/gu,(l,u,g)=>(new _e("tvar",u,!1,n,i),new _e("","",!0,n,i),`\0${i.length-2}n${g}\0${i.length}n`)).replace(/<(tvar)(\s+name\s*=(?:\s*(?:(["'])[\s\S]*?\3|[^"'\s>]+))?\s*)>([\s\S]*?)<\/(tvar)(\s*)>/giu,(l,u,g,d,p,c,f)=>(new _e(u,g,!1,n,i),new _e(c,f,!0,n,i),`\0${i.length-2}n${p}\0${i.length}n`));let a=new L(t,n,i);a.type="translate-inner";super("translate",s,a,"translate",n,i);S(this,As);this.seal("closed",!0)}get type(){return"translate"}get selfClosing(){return!1}toString(e){return e?this.lastChild.toString(!0):super.toString()}text(){return this.lastChild.text()}print(){}};As=new WeakSet,Wg=function(){}});var pl={};Z(pl,{parseCommentAndExt:()=>Rt});var ul,Dg,Ss,Mg,gl,Rt,Yr=w(()=>{"use strict";ze();ae();Go();Ct();Qo();Zi();cs();ul="<onlyinclude>",Dg="</onlyinclude>",{length:Ss}=ul,Mg=[!1,!0].map(o=>{let r=o?"includeonly":"(?:no|only)include",e=o?"noinclude":"includeonly";return Be(t=>new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${r}(?:\s[^>]*)?/?>|</${r}\s*>|<(${t})(\s[^>]*?)?(?:/>|>([\s\S]*?)</(${"\\1"}\s*)>)|<(${e})(\s[^>]*?)?(?:/>|>([\s\S]*?)(?:</(${e}\s*)>|$))`,"giu"))}),gl=o=>{let r=o.indexOf(ul);return{i:r,j:o.indexOf(Dg,r+Ss)}},Rt=(o,r,e,t)=>{if(t){let{i:l,j:u}=gl(o);if(l!==-1&&u!==-1){let g="",d=p=>{new de(p,r,e),g+=`\0${e.length-1}n`};for(;l!==-1&&u!==-1;){let p=`\0${e.length}g`;new Lt(o.slice(l+Ss,u),r,e),l>0&&d(o.slice(0,l)),g+=p,o=o.slice(u+Ss+1),{i:l,j:u}=gl(o)}return o&&d(o),g}}let{ext:n}=r,i=n,s=r;if(n.includes("translate")){let{TranslateToken:l}=(dl(),X(ll)),u=[];i=n.filter(g=>g!=="translate"&&g!=="tvar"),s=ge(V({},r),{ext:i}),o=o.replace(/<nowiki>[\s\S]*?<\/nowiki>/giu,g=>(u.push(g),`\0${u.length-1}`)).replace(/<translate( nowrap)?>([\s\S]*?)<\/translate>/gu,(g,d,p)=>{let c=e.length;return new l(d,p&&ke(p,u),s,e),`\0${c}g`}),o=ke(o,u)}let a=Mg[t?1:0](i.join("|"));return a.lastIndex=0,a.test(o)?o.replace(a,(l,u,g,d,p,c,f,h,x)=>{let T=e.length,b="n";if(u)b="e",new Xe(u,g,d,p,s,c,e);else if(l.startsWith("<!--")){b="c";let y=l.endsWith("-->");new Ze(ke(l,e,1).slice(4,y?-3:void 0),y,r,e)}else c?new $t(c,f&&ke(f,e,1),h&&ke(h,e,1),x,r,e):new de(l,r,e,!0);return`\0${T}${b}`}):o}});var Ug,zg,Gg,fl,un,Cs,Hg,Ut,cl=w(()=>{"use strict";z();se();zn();D();Ts();Ug=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),zg=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"]),Gg=new Set(["strike","big","center","font","tt"]);fl=[dr()];Ut=class extends(Hg=yr){constructor(e,t,n,i,s,a){super(e,t,n,s,a);S(this,un);this.setAttribute("name",e.toLowerCase()),C(this,un,i)}get type(){return"html"}get selfClosing(){return m(this,un)}text(){let{closing:e,selfClosing:t,name:n}=this,[,,i]=this.getAttribute("config").html;return i.includes(n)?e&&n!=="br"?"":super.text("/"):super.text(t&&!e?"/":"")}lint(e=this.getAbsoluteIndex(),t){{let n=super.lint(e,t),{name:i,parentNode:s,closing:a,selfClosing:l}=this,u=new W(this,e),{lintConfig:g}=v,{computeEditInfo:d,fix:p}=g,c=this.inTableAttrs(),f="h1",h=g.getSeverity(f,"html");if(h&&i==="h1"&&!a){let A=F(this,u,f,"<h1>",h);d&&(A.suggestions=[{desc:"h2",range:[e+2,e+3],text:"2"}]),n.push(A)}if(f="parsing-order",h=c&&g.getSeverity(f,c===2?"html":"templateInTable"),h){let A=F(this,u,f,"html-in-table",h);d&&c===2&&(A.suggestions=[O(A)]),n.push(A)}if(f="obsolete-tag",h=g.getSeverity(f,i),h&&Gg.has(i)&&n.push(F(this,u,f,"obsolete-tag",h)),f="bold-header",h=g.getSeverity(f,i),h&&(i==="b"||i==="strong")&&this.isInside("heading-title")){let A=F(this,u,f,"bold-in-header",h);d&&(A.suggestions=[O(A)]),n.push(A)}let[,x,T]=this.getAttribute("config").html,b=T.includes(i),y=x.includes(i),k=!b&&!y;if(f="unmatched-tag",a&&(l||b)||l&&k){if(h=g.getSeverity(f,a?"both":"selfClosing"),h){let A=F(this,u,f,a?"closing-and-self-closing":"invalid-self-closing",h);if(d||p){let N=Rn(e),E={desc:v.msg("no-self-closing"),range:[A.endIndex-2,A.endIndex-1],text:""};y?d&&(A.suggestions=[N,E]):a?A.fix=b?N:E:d&&(A.suggestions=[E,Le(A.endIndex,`></${i}>`,-2)])}n.push(A)}}else if(!this.findMatchingTag()){let A=F(this,u,f,a?"unmatched-closing":"unclosed-tag"),N=this.closest("magic-word");if(N&&Ug.has(N.name))h=g.getSeverity(f,"conditional");else if(a)h=g.getSeverity(f,"closing"),A.suggestions=[O(A)];else{h=g.getSeverity(f,"opening");let E=s==null?void 0:s.childNodes;zg.has(i)&&(E!=null&&E.slice(0,E.indexOf(this)).some($=>$.is("html")&&$.name===i&&!$.findMatchingTag())&&(A.suggestions=[Le(e+1,"/")]),this.isInside("heading-title")&&(A.rule="format-leakage",h=g.getSeverity("format-leakage",i)))}h&&(A.severity=h,n.push(A))}return n}}getAttribute(e){return e==="invalid"?this.inTableAttrs()===2:super.getAttribute(e)}json(e,t,n=this.getAbsoluteIndex()){}};Cs=B(Hg),un=new WeakMap,Ut=P(Cs,0,"HtmlToken",fl,Ut),R(Cs,1,Ut)});var ml={};Z(ml,{parseHtml:()=>Qg});var Vg,Qg,hl=w(()=>{"use strict";Vn();cl();Vg=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,Qg=(o,r,e)=>{var s;let{html:t}=r;(s=r.htmlElements)!=null||(r.htmlElements=new Set([...t[0],...t[1],...t[2]]));let n=o.split("<"),i=n.shift();for(let a of n){let l=Vg.exec(a),u=l==null?void 0:l[2],g=u==null?void 0:u.toLowerCase();if(!l||!r.htmlElements.has(g)){i+=`<${a}`;continue}let[,d,,p="",c,f]=l,{length:h}=e,x=new ft(p,"html-attrs",g,r,e),T=x.hasAttr("itemprop");if(g==="meta"&&!(T&&x.hasAttr("content"))||g==="link"&&!(T&&x.hasAttr("href"))){i+=`<${a}`,e.length=h;continue}i+=`\0${e.length}x${f}`,new Ut(u,x,d==="/",c==="/>",r,e)}return i}});var bl,ws,Xg,tt,Es=w(()=>{"use strict";zn();G();at();Vn();bl=[dr(1)];tt=class extends(Xg=L){constructor(r,e,t,n,i,s=[],a){super(void 0,i,s,a),this.append(new he(e,"table-syntax",i,s),new ft(n,"table-attrs",t,i,s))}escape(){}};ws=B(Xg),tt=P(ws,0,"TableBaseToken",bl,tt),R(ws,1,tt)});var xl,yl,Re,Ls,Tr,pn,zt,Ns=w(()=>{"use strict";z();se();qn();D();G();Es();zt=class extends(yl=tt,xl=[tr(!1)],yl){constructor(e,t,n,i=[]){var u;let s=/\||\0\d+!\x7F/u.exec(t!=null?t:""),a=s?t.slice(0,s.index):"";/\[\[|-\{/u.test(a)&&(s=null,a="");super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",a,n,i);R(Ls,5,this);S(this,Tr);S(this,Re,"");s&&([En(this,Re)._]=s);let l=new L(t==null?void 0:t.slice(((u=s==null?void 0:s.index)!=null?u:NaN)+m(this,Re).length),n,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 I(this,Tr,pn).call(this).subtype}afterBuild(){m(this,Re).includes("\0")&&C(this,Re,this.buildFromStr(m(this,Re),0)),super.afterBuild()}toString(e){let[t,n,i]=this.childNodes;return t.toString(e)+n.toString(e)+m(this,Re)+i.toString(e)}text(){let[e,t,n]=this.childNodes;return e.text()+t.text()+m(this,Re)+n.text()}getGaps(e){return e===1?m(this,Re).length:0}lint(e=this.getAbsoluteIndex(),t){{let n=super.lint(e,t),i=new W(this,e+this.getRelativeIndex(this.length-1)),s="pipe-like",{lintConfig:a}=v,{computeEditInfo:l,fix:u}=a,g=["td","double"].map(d=>a.getSeverity(s,d));for(let d of this.lastChild.childNodes)if(d.type==="text"){let{data:p}=d;if(p.includes("|")){let c=p.includes("||"),f=g[c?1:0];if(f){let h=j(d,i,s,"pipe-in-table",f);if(l||u)if(c){let x={caption:"|+",td:"|",th:"!"}[this.subtype];h.fix=me(h,"newline",p.replace(/\|\|/gu,`
|
|
16
|
-
${x}`))}else l&&(h.suggestions=[jn(h.startIndex,
|
|
17
|
-
`)}getAttr(e){{let t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}}escape(){}print(){}json(e,t,n=this.getAbsoluteIndex()){}};
|
|
18
|
-
|}`,t){oe.run(()=>{let n=new he(t?e:void 0,"table-syntax",this.getAttribute("config"),this.getAttribute("accum"));super.insertAt(n)})}getLayout(e){{let t=this.getAllRows(),{length:n}=t,i=
|
|
12
|
+
`)||(o=`${o.slice(0,E)}\0${e.length}h${o.slice(k)}`,c=E+4+String(e.length).length,new Qe(be[1].length,be.slice(2),r,e)))}}else if(y==="|"||K)c=k+1,a(o,$,q,k),y==="|"&&$.push([]),A.pos=c,A.findEqual=y==="|",i.push(A);else if(y.startsWith("}}")){let U=y.slice(0,Math.min(N.length,3)),M=N.length-U.length,{length:be}=e;c=k+U.length,a(o,$,q,k);let Jt=!1,bt="t";if(U.length===3){let Y=$.map($r=>$r.join("=")),xt=Y.length>1&&re(Y[1]).trim();new qt(Y,r,e),xt&&xt.endsWith(":")&&n.includes(xt.slice(0,-1).toLowerCase())&&(bt="s")}else try{new mt($[0][0],$.slice(1),r,e),bt=Ia($[0][0])}catch(Y){if(!(Y instanceof SyntaxError&&Y.message==="Invalid template name"))throw Y;Jt=!0}Jt||(o=`${o.slice(0,E+M)}\0${be}${bt}${o.slice(c)}`,c=E+M+3+String(be).length,M>1?i.push({0:N.slice(0,M),index:E,pos:E+M,parts:[[]]}):M===1&&o[E-1]==="-"&&i.push({0:"-{",index:E-1,pos:E+1,parts:[[]]}))}else c=k+y.length,y.startsWith("{")&&(u.pos=c,u.parts=[[]]),i.push(..."0"in A?[A]:[],u);let _=i[i.length-1];if(g&&p+o.length<c)for(g=!1;(b=_==null?void 0:_[0])!=null&&b.startsWith("{");)i.pop(),_=i[i.length-1];d=$a(t+(g?La:"")+(_?`|${xg[_[0][0]]}${_.findEqual?"|=":""}`:"")),d.lastIndex=c,u=d.exec(o)}return ke(o,s)}});var Pa={};Z(Pa,{InputboxToken:()=>Yi});var Yi,Ba=w(()=>{"use strict";Kr();Yn();Mi();Yi=class extends Jr{constructor(r,e,t,n,i=[]){let s=Symbol("InputboxToken"),a=n.excludes.includes("heading")?n:ge(V({},n),{excludes:[...n.excludes,"heading"]}),{length:l}=i;i.push(s),t&&(t=Rt(t,a,i,e)),t&&(t=rn(t,a,i)),i.splice(l,1),super(r,e,t,a,i,{})}}});var Zn={};Z(Zn,{NestedToken:()=>Zi});var yg,Tg,nn,cr,Zi,ei=w(()=>{"use strict";z();se();Kr();Yn();D();G();es();Ct();yg=new Set(["comment","include","arg","template","magic-word"]),Tg=[!1,!0].map(o=>{let r=o?"includeonly":"noinclude";return new RegExp(String.raw`^(?:<${r}(?:\s[^>]*)?/?>|</${r}\s*>)$`,"iu")}),Zi=class extends L{constructor(e,t,n,i,s=[]){if(typeof t=="boolean"){let a=Symbol("NestedToken"),{length:l}=s;s.push(a),e&&(e=Rt(e,i,s,t)),e&&(e=rn(e,i,s)),s.splice(l,1)}else e&&(e=e.replace(t,(a,l,p,g,d)=>{let u=`\0${s.length+1}e`;return new Xe(l,p,g,d,i,!1,s),u}));e&&(e=e.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(a,l,p)=>(new de(p,i,s),`${l}\0${s.length}n`)));super(e,i,s);S(this,nn);S(this,cr);C(this,nn,[...n]),C(this,cr,t)}get type(){return"ext-inner"}lint(e=this.getAbsoluteIndex(),t){{let n=super.lint(e,t),i="no-ignored",{lintConfig:s}=v,a=s.getSeverity(i,this.name);if(!a)return n;let l=new W(this,e),p=typeof m(this,cr)=="boolean"?Tg[m(this,cr)?1:0]:/^<!--[\s\S]*-->$/u;return[...n,...this.childNodes.filter(g=>{let{type:d,name:u}=g;if(d==="ext")return!m(this,nn).includes(u);if(yg.has(d))return!1;let c=g.toString().trim();return c&&!p.test(c)}).map(g=>{let d=j(g,l,i,v.msg("invalid-content",this.name),a);return s.computeEditInfo&&(d.suggestions=[O(d),Pn(d,g.toString())]),d})]}}};nn=new WeakMap,cr=new WeakMap});function ts(o,r,e,t,n){r=re(r).trim();let i=r.replace(o==="link"?/\0\d+[tq]\x7F/gu:/\0\d+t\x7F/gu,"").trim();switch(o){case"width":return!i&&!!r||/^(?:\d+x?|\d*x\d+)(?:\s*px)?$/u.test(i);case"link":{let s=t==="gallery-image";if(i){if(kg(e.protocol).test(i))return vg(e.protocol).test(i)?r:s;i.startsWith("[[")&&i.endsWith("]]")&&(i=i.slice(2,-2))}else return r;let a=v.normalizeTitle(i,0,!1,e,{halfParsed:n,decode:!0,selfLink:!0,page:""});return a.valid?a:s}case"lang":return(t==="svg"||t==="svgz")&&!/[^a-z\d-]/u.test(i);case"alt":case"class":case"manualthumb":return!0;case"page":return(t==="djvu"||t==="djv"||t==="pdf")&&Number(i)>0;default:return!!i&&!isNaN(i)}}var kg,vg,Ag,Sg,ja,Ne,ti,Oa,rs,Cg,_t,qa=w(()=>{"use strict";ze();ae();z();Nn();Se();xe();D();G();kg=Be(o=>new RegExp(String.raw`^(?:${o}|//|\0\d+m\x7F)`,"iu")),vg=Be(o=>new RegExp(String.raw`^(?:(?:${o}|//)${De}|\0\d+m\x7F)${Me}$`,"iu")),Ag=Be(o=>new RegExp(String.raw`^(\s*(?!\s))${o.replace("$1","(.*)")}${o.endsWith("$1")?`(?=$|
|
|
13
|
+
)`:""}(\s*)$`,"u")),Sg=o=>{if(o)o.startsWith("//")&&(o=`https:${o}`);else return o;return new URL(o).href};ja=[Q];_t=class extends(Cg=L){constructor(e,t,n,i,s){var r=(...bm)=>(super(...bm),S(this,ti),S(this,Ne,""),this);let a,l=Object.entries(i.img).map(([g,d])=>[g,d,Ag(g)]),p=l.find(([,g,d])=>(a=d.exec(e),a&&(a.length!==4||ts(g,a[2],i,g==="link"?n:t,!0)!==!1)));if(p&&a){a.length===3?(r(void 0,i,s),C(this,Ne,e)):(r(a[2],i,s,{}),C(this,Ne,a[1]+p[0]+a[3])),this.setAttribute("name",p[1]),p[1]==="alt"&&this.setAttribute("stage",10);return}r(e,i.excludes.includes("list")?i:ge(V({},i),{excludes:[...i.excludes,"list"]}),s),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get type(){return"image-parameter"}get thumb(){return this.name==="manualthumb"?this.normalizeTitle(`File:${super.text().trim()}`,6,{page:""}):void 0}get link(){{if(this.name!=="link")return;let e=super.text().trim();return oe.run(()=>{var s;let t=this.getAttribute("config"),n=new L(e,t);if(n.parseOnce(0,this.getAttribute("include")).parseOnce(),/^\0\d+m\x7F/u.test(n.firstChild.toString()))return e;let i=ts("link",e,t,(s=this.parentNode)==null?void 0:s.type);return i===!0?void 0:i},v)}}afterBuild(){var e;(e=this.parentNode)!=null&&e.is("gallery-image")&&!fo.has(this.name)&&this.setAttribute("name","invalid"),super.afterBuild()}toString(e){return m(this,Ne)?m(this,Ne).replace("$1",super.toString(e)):super.toString(e)}text(){return m(this,Ne)?m(this,Ne).replace("$1",super.text()).trim():super.text().trim()}isPlain(){return this.name==="caption"||this.name==="alt"}getAttribute(e){return e==="invalid"?this.name==="invalid":e==="padding"?Math.max(0,m(this,Ne).indexOf("$1")):super.getAttribute(e)}lint(e=this.getAbsoluteIndex(),t){var n;{let i=super.lint(e,t),{lintConfig:s}=v,{computeEditInfo:a,fix:l}=s,{link:p,name:g}=this,d=g==="width"&&this.getValue();if(g==="invalid"||d&&d.endsWith("px")){let u="invalid-gallery",c=s.getSeverity(u,"parameter");if(c){let f=F(this,{start:e},u,"invalid-image-parameter",c);(a||l)&&(f.fix=d?O(f,0,d):O(f,-1)),i.push(f)}}else if(g==="link"){if(p===void 0){let u="invalid-gallery",c=s.getSeverity(u,"link");if(c){let f=F(this,{start:e},u,"invalid-gallery-link",c);if(a){let h=super.toString(),x=h.indexOf("|"),T=h.slice(0,x).trim();x!==-1&&!/[<{]/u.test(T)&&typeof ts("link",T,this.getAttribute("config"),(n=this.parentNode)==null?void 0:n.type)=="string"&&(f.suggestions=[st(e+this.getRelativeIndex(0)+x)])}i.push(f)}}else if(typeof p=="string"){let u="invalid-url",c=s.getSeverity(u);if(c&&!this.querySelector("magic-word"))try{Sg(p)}catch(f){i.push(F(this,{start:e},u,"invalid-url",c))}}else if(p.encoded){let u="url-encoding",c=s.getSeverity(u,"file");if(c){let f=F(this,{start:e},u,"unnecessary-encoding",c);(a||l)&&(f.fix=Fn(f,this)),i.push(f)}}}else if(g==="manualthumb"){let u="invalid-gallery",c=s.getSeverity(u,"thumb");if(c&&!this.querySelector("arg,magic-word,template")){let{valid:f,ns:h,extension:x}=this.thumb;(!f||h!==6||!jr.has(x))&&i.push(F(this,{start:e},u,"invalid-thumb",c))}}return i}}getValue(){return this.name==="invalid"?this.text():I(this,ti,Oa).call(this)||super.text()}print(){}};rs=B(Cg),Ne=new WeakMap,ti=new WeakSet,Oa=function(){return m(this,Ne)&&!m(this,Ne).includes("$1")},_t=P(rs,0,"ImageParameterToken",ja,_t),R(rs,1,_t)});var _a,wg,Eg,Wa,Da,Lg,Ma,mr,ns=w(()=>{"use strict";z();Nn();se();D();lr();qa();_a=new Map([["manualthumb","Thumb"],["frameless","Frameless"],["framed","Frame"],["thumbnail","Thumb"]]),wg=new Set(["arg"]),Eg=new Set(["template","magic-word"]),Wa=new Set(["left","right","center","none"]),Da=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),Lg=o=>{if(o===void 0)return[];let r=/-\{|\}-|\|/gu,e=[],t=r.exec(o),n=0,i=0;for(;t;){let{0:s,index:a}=t;s!=="|"?n+=s==="-{"?1:-1:n===0&&(e.push(o.slice(i,a)),{lastIndex:i}=r),t=r.exec(o)}return e.push(o.slice(i)),e},Ma=(o,r)=>o.filter(({childNodes:e})=>!e.some(t=>t.text().trim()&&r.has(t.type))),mr=class extends ye{get type(){return"file"}get extension(){}constructor(r,e,t,n=[],i="|",s){super(r,void 0,t,n,i);let{extension:a}=this.getTitle(!0,!0);this.safeAppend(Lg(e).map(l=>new _t(l,a,s,t,n)))}lint(r=this.getAbsoluteIndex(),e){var t;{let n=super.lint(r,e),i=Ma(this.getAllArgs(),wg),s=[...new Set(i.map(({name:E})=>E))],a=s.filter(E=>_a.has(E)),l=s.filter(E=>Wa.has(E)),p=s.filter(E=>Da.has(E)),[g]=a,d=g==="framed"||g==="manualthumb",u=new W(this,r),{lintConfig:c}=v,{computeEditInfo:f,fix:h}=c,{ns:x,extension:T}=this.getAttribute("title"),{firstChild:b}=this,y="nested-link",k=c.getSeverity(y,"file");if(k&&jr.has(T)&&this.isInside("ext-link-text")&&((t=this.getValue("link"))==null?void 0:t.trim())!==""){let E=F(this,u,y,"link-in-extlink",k);if(f||h){let $=this.getArg("link");if($){let H=r+$.getRelativeIndex();E.fix={desc:v.msg("delink"),range:[H,H+$.toString().length],text:"link="}}else E.fix=er(E.endIndex-2,"delink","|link=")}n.push(E)}if(y="invalid-gallery",k=c.getSeverity(y,"extension"),k&&x===6&&!T&&!b.querySelector("arg,magic-word,template")&&n.push(F(this,u,y,"missing-extension",k)),k=c.getSeverity(y,"parameter"),k&&d)for(let E of i.filter(({name:$})=>$==="width")){let $=j(E,u,y,"invalid-image-parameter",k);(f||h)&&($.fix=O($,-1)),n.push($)}if(i.length===s.length&&a.length<2&&l.length<2&&p.length<2)return n;y="no-duplicate";let A=["unknownImageParameter","imageParameter"].map(E=>c.getSeverity(y,E)),N=(E,$,H,q=!0)=>E.map(K=>{if(k=A[Number(typeof q=="function"?q(K):q)],!k)return!1;let _=j(K,u,y,v.msg(`${$}-image-parameter`,H),k);return f&&(_.suggestions=[O(_,-1)]),_}).filter(K=>K!==!1);for(let E of s){if(E==="invalid"||E==="width"&&d)continue;let $=E==="caption",H=i.filter(({name:q})=>q===E);if($&&(H=[...H.slice(0,-1).filter(q=>q.text()),...H.slice(-1)]),H.length>1){let q=!$||!T||jr.has(T);if($&&q){let K=Ma(H,Eg);q=K.length>1&&(_=>K.includes(_))}Array.prototype.push.apply(n,N(H,"duplicate",E,q))}}return a.length>1&&Array.prototype.push.apply(n,N(i.filter(({name:E})=>_a.has(E)),"conflicting","frame")),l.length>1&&Array.prototype.push.apply(n,N(i.filter(({name:E})=>Wa.has(E)),"conflicting","horizontal-alignment")),p.length>1&&Array.prototype.push.apply(n,N(i.filter(({name:E})=>Da.has(E)),"conflicting","vertical-alignment")),n}}getAllArgs(){return this.childNodes.slice(1)}getArgs(r){return this.getAllArgs().filter(({name:e})=>r===e)}getArg(r){{let e=this.getArgs(r);return e[r==="manualthumb"?0:e.length-1]}}getValue(r){var e;return(e=this.getArg(r))==null?void 0:e.getValue()}json(r,e,t=this.getAbsoluteIndex()){}}});var Ua,sn,ss,is,Ng,Je,os=w(()=>{"use strict";z();qe();D();G();ns();Ua=[pe("")];Je=class extends(Ng=mr){constructor(e,t,n,i,s=[]){let a;if(n!==void 0){let{length:p}=s;a=new L(n,i,s);for(let g=0;g<10;g++)a.parseOnce();s.splice(p,1)}let l=`${e}-image`;super(t,a==null?void 0:a.firstChild.toString(),i,s,void 0,l);S(this,sn);ce(this,"privateType","imagemap-image");this.setAttribute("bracket",!1),this.privateType=l,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,{halfParsed:!0,temporary:e,decode:!t,page:""})}lint(e=this.getAbsoluteIndex(),t){{let n=super.lint(e,t),i="invalid-gallery",{lintConfig:s}=v,a=s.getSeverity(i,"image");if(a&&I(this,sn,ss).call(this)){let l=F(this,{start:e},i,"invalid-gallery",a);s.computeEditInfo&&(l.suggestions=[er(e,"prefix","File:")]),n.push(l)}return n}}getAttribute(e){return e==="invalid"?I(this,sn,ss).call(this):super.getAttribute(e)}};is=B(Ng),sn=new WeakSet,ss=function(){return this.getAttribute("title").ns!==6},Je=P(is,0,"GalleryImageToken",Ua,Je),R(is,1,Je)});var Wt,as=w(()=>{"use strict";Ct();Wt=class extends de{}});var Ga={};Z(Ga,{GalleryToken:()=>ls});var on,za,$g,ls,Ha=w(()=>{"use strict";z();D();Qn();os();as();ls=class extends ct{constructor(e,t,n=[]){var i;super(void 0,t,n,{});S(this,on);for(let s of(i=e==null?void 0:e.split(`
|
|
14
|
+
`))!=null?i:[]){let a=/^([^|]+)(?:\|(.*))?/u.exec(s);if(!a){super.insertAt(s.trim()?new Wt(s,t,n):s);continue}let[,l,p]=a;I(this,on,za).call(this,l)?super.insertAt(new Je("gallery",l,p,t,n)):super.insertAt(new Wt(s,t,n))}}get widths(){}get heights(){}lint(e=this.getAbsoluteIndex(),t){{let{top:n,left:i}=this.getRootNode().posFromIndex(e),s=[],a="no-ignored",{lintConfig:l}=v,p=["Image","NoImage","Comment"].map(g=>l.getSeverity(a,`gallery${g}`));for(let g=0;g<this.length;g++){let d=this.childNodes[g],u=d.toString(),{length:c}=u,f=u.trim(),{type:h}=d,x=n+g,T=g?0:i;if(d.setAttribute("aIndex",e),h==="noinclude"&&f&&!/^<!--.*-->$/u.test(f)){let[b]=p;if(f.startsWith("|")?[,b]=p:(f.startsWith("<!--")||f.endsWith("-->"))&&([,,b]=p),b){let y=e+c,k={rule:a,message:v.msg("invalid-content","gallery"),severity:b,startIndex:e,endIndex:y,startLine:x,endLine:x,startCol:T,endCol:T+c};l.computeEditInfo&&(k.suggestions=[O(k),Pn(k,u)]),s.push(k)}}else if(h!=="noinclude"&&h!=="text"){let b=d.lint(e,t);b.length>0&&Array.prototype.push.apply(s,b)}e+=c+1}return s}}json(e,t,n=this.getAbsoluteIndex()){}};on=new WeakSet,za=function(e){return this.normalizeTitle(e,6,{halfParsed:!0,temporary:!0,decode:!0,page:""}).valid},$g=function(e){}});var hr,ds=w(()=>{"use strict";ze();z();D();lr();hr=class extends ye{get type(){return"link"}get innerText(){return this.length>1?this.lastChild.text():At(this.firstChild.text().replace(/^\s*:?/u,""))}lint(r=this.getAbsoluteIndex(),e){{let t=super.lint(r,e),n="nested-link",{lintConfig:i}=v,s=i.getSeverity(n);if(s&&this.isInside("ext-link-text")){let a=F(this,{start:r},n,"link-in-extlink",s);(i.computeEditInfo||i.fix)&&(a.fix=me(a,"delink",this.innerText)),t.push(a)}return t}}}});var Ig,Fg,an,ln,gs,Ke,ri=w(()=>{"use strict";z();ae();se();D();G();Ig=String.raw`(?:[${Ie}\t]| |�*160;|&#[xX]0*[aA]0;)`,Fg=new RegExp(`${Ig}+`,"gu"),Ke=class extends L{constructor(e,t="free-ext-link",n=v.getConfig(),i){super(e,n,i,{});S(this,ln);S(this,an);C(this,an,t)}get type(){return m(this,an)}get innerText(){let e=new Map([["!","|"],["=","="]]),t=Ee(this.childNodes.map(n=>{let{type:i}=n,s=String(n.name);return i==="magic-word"&&e.has(s)?e.get(s):n}));return this.type==="magic-link"&&(t=t.replace(Fg," ")),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:po(e).replace(/\n/gu,"%0A")}lint(e=this.getAbsoluteIndex(),t){{let n=super.lint(e,t),i=new W(this,e),{lintConfig:s}=v,{type:a,childNodes:l}=this;if(a==="magic-link"){let u="invalid-isbn",c=s.getSeverity(u);return c&&I(this,ln,gs).call(this)&&n.push(F(this,i,u,"invalid-isbn",c)),n}let p="invalid-url",g=s.getSeverity(p);if(g&&!this.querySelector("magic-word"))try{this.getUrl()}catch(u){n.push(F(this,i,p,"invalid-url",g))}let d=a==="ext-link-url";if(p="unterminated-url",g=s.getSeverity(p,d?"pipe":"punctuation"),g){let u=d?/\|/u:/[,;。:!?()]+/u,c=l.find(f=>f.type==="text"&&u.test(f.data));if(c){let{data:f}=c,h=j(c,i,p,v.msg("in-url",d?'"|"':"full-width-punctuation"),g);if(s.computeEditInfo){let{index:x,0:T}=u.exec(f),b=h.startIndex+x;h.suggestions=d?[st(b,1)]:[st(b),{desc:v.msg("encode"),range:[b,b+T.length],text:encodeURI(T)}]}n.push(h)}}return n}}getUrl(e){this.lspError("MagicLinkToken.getUrl")}getAttribute(e){return e==="invalid"?I(this,ln,gs).call(this):super.getAttribute(e)}};an=new WeakMap,ln=new WeakSet,gs=function(){if(this.type==="magic-link"){let{link:e}=this;if(e.startsWith("ISBN")){let t=[...e.slice(5)].map(n=>n==="X"?10:Number(n));return t.length===10?t.reduce((n,i,s)=>n+i*(10-s),0)%11!==0:t.length===13&&(t[12]===10||t.reduce((n,i,s)=>n+i*(s%2?3:1),0)%10!==0)}}return!1}});var Va,Dt,ps,Rg,Ye,us=w(()=>{"use strict";z();qe();D();G();ri();Va=[pe("[")];Ye=class extends(Rg=L){constructor(e,t="",n="",i,s=[]){super(void 0,i,s,{});S(this,Dt);let a=e&&/^\0\d+f\x7F$/u.test(e)?s[Number(e.slice(1,-2))]:new Ke(e,"ext-link-url",i,s);if(this.insertAt(a),C(this,Dt,t),n){let l=new L(n,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)}${m(this,Dt)}]`:`[${super.toString(e,m(this,Dt))}]`}text(){return`[${super.text(" ")}]`}getGaps(){return m(this,Dt).length}lint(e=this.getAbsoluteIndex(),t){{let n=super.lint(e,t),i="var-anchor",s=v.lintConfig.getSeverity(i,"extLink");return s&&this.length===1&&this.isInside("heading-title")&&n.push(F(this,{start:e},i,"variable-anchor",s)),n}}print(){}};ps=B(Rg),Dt=new WeakMap,Ye=P(ps,0,"ExtLinkToken",Va,Ye),R(ps,1,Ye)});var dn,Qa=w(()=>{"use strict";G();Ct();ds();us();dn=class extends L{get type(){return"imagemap-link"}constructor(r,e,t,n,i=[]){super(void 0,n,i),this.append(r,e.length===2?new hr(...e,n,i):new Ye(...e,n,i),new de(t,n,i))}}});var Xa={};Z(Xa,{ImagemapToken:()=>fs});var fs,Ja=w(()=>{"use strict";z();Se();se();D();Qn();as();os();Qa();fs=class extends ct{get image(){return this.childNodes.find(Jn("imagemap-image"))}constructor(r,e=v.getConfig(),t=[]){if(super(void 0,e,t,{}),!r)return;let n=r.split(`
|
|
15
|
+
`),i=new Set(e.protocol.split("|")),s=!0,a=!1;for(let l of n){let p=l.trim();if(!(a||!p||p.startsWith("#"))){if(s){let g=l.indexOf("|"),d=g===-1?l:l.slice(0,g),u=this.normalizeTitle(d,0,{halfParsed:!0,temporary:!0,page:""});if(u.valid&&u.ns===6){let c=new Je("imagemap",d,g===-1?void 0:l.slice(g+1),e,t);super.insertAt(c),s=!1;continue}else a=!0}else if(l.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(l);continue}else if(l.includes("[")){let g=l.indexOf("["),d=l.slice(g),u=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(d);if(u){if(this.normalizeTitle(u[1],0,{halfParsed:!0,temporary:!0,selfLink:!0,page:""}).valid){super.insertAt(new dn(l.slice(0,g),u.slice(1),d.slice(d.indexOf("]]")+2),e,t));continue}}else if(d.startsWith("[//")||i.has(d.slice(1,d.indexOf(":")+1))||i.has(d.slice(1,d.indexOf("//")+2))){let c=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(d);if(c){super.insertAt(new dn(l.slice(0,g),c.slice(1),d.slice(d.indexOf("]")+1),e,t));continue}}}}super.insertAt(new Wt(l,e,t))}}lint(r=this.getAbsoluteIndex(),e){{let t=super.lint(r,e),n=new W(this,r),{childNodes:i,image:s}=this,a="invalid-imagemap",{lintConfig:l}=v,p=l.getSeverity(a,s?"link":"image");return p&&(s?Array.prototype.push.apply(t,i.filter(g=>{let d=g.toString().trim();return g.is("noinclude")&&d&&!d.startsWith("#")}).map(g=>{let d=j(g,n,a,"invalid-imagemap-link",p);return l.computeEditInfo&&(d.suggestions=[O(d,-1),me(d,"comment","# ")]),d})):t.push(F(this,n,a,"imagemap-without-image",p))),t}}getAttribute(r){return r==="invalid"?!this.image:super.getAttribute(r)}}});var Ka,cs,Pg,Ze,ms=w(()=>{"use strict";z();ot();qe();D();gt();Ka=[ve(!1),pe("<!--")];Ze=class extends(Pg=le){constructor(e,t,n,i){super(e,n,i);ce(this,"closed");this.closed=t}get type(){return"comment"}lint(e=this.getAbsoluteIndex()){{if(this.closed)return[];let t="unclosed-comment",{lintConfig:n}=v,i=n.getSeverity(t);if(!i)return[];let s=F(this,{start:e},t,"unclosed-comment",i);return n.computeEditInfo&&(s.suggestions=[Le(s.endIndex,"-->")]),[s]}}toString(e){return e?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){}};cs=B(Pg),Ze=P(cs,0,"CommentToken",Ka,Ze),R(cs,1,Ze)});var Ya={};Z(Ya,{CommentedToken:()=>hs});var hs,Za=w(()=>{"use strict";G();ms();hs=class extends L{get type(){return"ext-inner"}constructor(r,e,t=[]){if(super(void 0,e,t,{AstText:":",CommentToken:":"}),r){let n=r.indexOf("<!--"),i=n!==-1&&r.indexOf("-->",n+4),s=0;for(;i!==!1&&i!==-1;)n>s&&this.insertAt(r.slice(s,n)),this.insertAt(new Ze(r.slice(n+4,i),!0,e,t)),s=i+3,n=r.indexOf("<!--",s),i=n!==-1&&r.indexOf("-->",n+4);s<r.length&&this.insertAt(r.slice(s))}}lint(r=this.getAbsoluteIndex()){return super.lint(r,new RegExp(String.raw`<\s*(?:\/\s*)?(${this.name})\b`,"giu"))}}});var tl={};Z(tl,{CategorytreeToken:()=>br});var el,bs,Bg,br,rl=w(()=>{"use strict";z();qe();D();lr();el=[pe("")];br=class extends(Bg=ye){get type(){return"ext-inner"}constructor(r,e,t,n=[]){super(r,e,t,n),this.setAttribute("bracket",!1)}getTitle(){let r=this.firstChild.toString().trim(),e={halfParsed:!0},t=this.normalizeTitle(r,14,e);return t.valid&&t.ns===14?t:this.normalizeTitle(`Category:${r}`,0,e)}lint(r=this.getAbsoluteIndex()){{let e="no-ignored",t=v.lintConfig.getSeverity(e,"categorytree");if(t){let{link:n}=this;if(!n.valid||n.ns!==14)return[F(this,{start:r},e,"invalid-category",t)]}return super.lint(r,!1)}}};bs=B(Bg),br=P(bs,0,"CategorytreeToken",el,br),R(bs,1,br)});var nl={};Z(nl,{NowikiToken:()=>xs});var jg,Og,gn,ys,xs,il=w(()=>{"use strict";ze();z();se();D();gt();jg=Be(o=>new RegExp(String.raw`<\s*(?:/\s*)${o==="nowiki"?"":"?"}(${o})\b`,"giu")),Og=new Set(["languages","section","templatestyles"]),xs=class extends le{constructor(){super(...arguments);S(this,gn)}get type(){return"ext-inner"}lint(e=this.getAbsoluteIndex()){{let{name:t,innerText:n}=this,{lintConfig:i}=v,s="void-ext",a=i.getSeverity(s,t);if(a&&I(this,gn,ys).call(this)){let l=F(this,{start:e},s,v.msg("nothing-in",t),a);return i.computeEditInfo&&(l.suggestions=[O(l)]),[l]}{s="invalid-json";let l=i.getSeverity(s);if(t==="templatedata"&&l)return co(n).map(({message:p,from:g,to:d=g,line:u,endLine:c=u,column:f,endColumn:h=f})=>{a=l;let x=new W(this,e);return{rule:s,message:p,severity:a,startIndex:e+g,endIndex:e+d,startLine:x.top+u-1,endLine:x.top+c-1,startCol:(u>1?0:x.left)+f-1,endCol:(c>1?0:x.left)+h-1}}).filter(p=>p!==!1)}return super.lint(e,jg(t))}}getAttribute(e){return e==="invalid"?I(this,gn,ys).call(this):super.getAttribute(e)}};gn=new WeakSet,ys=function(){let{name:e,firstChild:{data:t}}=this;return Og.has(e)&&!!t}});var sl,Ts,qg,Xe,es=w(()=>{"use strict";z();se();D();zn();G();Un();Vn();sl=[dr()];Xe=class extends(qg=Fe){get type(){return"ext"}constructor(r,e,t,n,i=v.getConfig(),s=!1,a=[]){let l=r.toLowerCase(),p=new ft(!e||/^\s/u.test(e)?e:` ${e}`,"ext-attrs",l,i,a),g=ge(V({},i),{ext:i.ext.filter(u=>u!==l),excludes:[...i.excludes],inExt:!0}),d;switch(l){case"pre":if(p.getAttr("format")!=="wikitext"){let{PreToken:u}=(ca(),X(fa));d=new u(t,g,a);break}case"indicator":case"poem":case"ref":case"option":case"combooption":case"tab":case"tabs":case"poll":case"seo":case"langconvert":case"phonos":l==="poem"?g.excludes.push("heading"):l==="tab"&&(g.ext=g.ext.filter(u=>u!=="tabs")),d=new L(t,g,a);break;case"dynamicpagelist":{let{ParamTagToken:u}=(Mi(),X(ha));d=new u(l,s,t,g,a);break}case"inputbox":{let{InputboxToken:u}=(Ba(),X(Pa));d=new u(l,s,t,g,a);break}case"references":{let{NestedToken:u}=(ei(),X(Zn));g.excludes.push("heading"),d=new u(t,s,["ref"],g,a);break}case"choose":{let{NestedToken:u}=(ei(),X(Zn));d=new u(t,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],g,a);break}case"combobox":{let{NestedToken:u}=(ei(),X(Zn));d=new u(t,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],g,a);break}case"gallery":{let{GalleryToken:u}=(Ha(),X(Ga));d=new u(t,g,a);break}case"imagemap":{let{ImagemapToken:u}=(Ja(),X(Xa));d=new u(t,g,a);break}case"hiero":{let{CommentedToken:u}=(Za(),X(Ya));d=new u(t,g,a);break}case"categorytree":{let{CategorytreeToken:u}=(rl(),X(tl));d=new u(t,void 0,g,a);break}default:{let{NowikiToken:u}=(il(),X(nl));d=new u(t,g,a)}}d.setAttribute("name",l),d.type==="plain"&&(d.type="ext-inner"),super(r,p,d,n,i,a),this.seal("closed",!0)}lint(r=this.getAbsoluteIndex(),e){{let t=super.lint(r,e),{lintConfig:n}=v,i=new W(this,r);if(this.name!=="nowiki"){let s=this.inHtmlAttrs(),a="parsing-order",l=s&&n.getSeverity(a,s===2?"ext":"templateInTable");l&&t.push(F(this,i,a,"ext-in-html",l))}if(this.name==="ref"){let s="var-anchor",a=n.getSeverity(s,"ref");a&&this.closest("heading-title")&&t.push(F(this,i,s,"variable-anchor",a)),s="nested-link",a=n.getSeverity(s,"ref"),a&&this.closest("link-text,ext-link-text")&&t.push(F(this,i,s,"ref-in-link",a))}return t}}};Ts=B(qg),Xe=P(Ts,0,"ExtToken",sl,Xe),R(Ts,1,Xe)});var ht,Mt,et,xr,ks=w(()=>{"use strict";z();Se();G();D();xr=class extends L{constructor(e,t,n,i,s){super(void 0,i,s);S(this,ht);S(this,Mt);S(this,et);this.insertAt(t),C(this,ht,n),C(this,Mt,e)}get closing(){return m(this,ht)}toString(e){return`<${m(this,ht)?"/":""}${m(this,Mt)}${super.toString(e)}${this.selfClosing?"/":""}>`}text(e=""){let{closing:t}=this;return`<${t&&!e?"/":""}${m(this,Mt)}${t?"":super.text()}${e}>`}getAttribute(e){return e==="padding"?m(this,Mt).length+(m(this,ht)?2:1):super.getAttribute(e)}findMatchingTag(){return je(m(this,et),()=>{let{type:e,name:t,parentNode:n,closing:i,selfClosing:s}=this,a=!1,l=!1;if(e==="html"){let[,f,h]=this.getAttribute("config").html;a=h.includes(t),l=f.includes(t)}if(a||l&&s)return this;if(!n)return;let{childNodes:p}=n,g=p.indexOf(this),d=i?p.slice(0,g).reverse():p.slice(g+1),u=[this],{rev:c}=oe;for(let f of d)if(!(!f.is(e)||e==="html"&&(f.name!==t||l&&f.selfClosing)))if(m(f,ht)===i){if(e==="tvar")return;u.push(f)}else{let h=u.pop();if(h===this)return f;v.viewOnly&&(C(h,et,[c,f]),C(f,et,[c,h]))}if(v.viewOnly)for(let f of u)C(f,et,[c,void 0])},e=>{C(this,et,e),e[1]&&e[1]!==this&&C(e[1],et,[oe.rev,this])})}print(){}json(e,t,n=this.getAbsoluteIndex()){}};ht=new WeakMap,Mt=new WeakMap,et=new WeakMap});var ol,vs,_g,_e,al=w(()=>{"use strict";ot();xe();ks();at();ol=[ve(),Q];_e=class extends(_g=xr){get type(){return"tvar"}constructor(r,e,t,n,i){let s=new he(e,"tvar-name",n,i);super(r,s,t,n,i)}};vs=B(_g),_e=P(vs,0,"TvarToken",ol,_e),R(vs,1,_e)});var ll={};Z(ll,{TranslateToken:()=>As});var Ss,Wg,As,dl=w(()=>{"use strict";G();Un();at();al();As=class extends Fe{constructor(e,t,n,i=[]){let s=new he(e,"translate-attr",n,i);t=t==null?void 0:t.replace(/<tvar(\|[^>]+)>([\s\S]*?)<\/>/gu,(l,p,g)=>(new _e("tvar",p,!1,n,i),new _e("","",!0,n,i),`\0${i.length-2}n${g}\0${i.length}n`)).replace(/<(tvar)(\s+name\s*=(?:\s*(?:(["'])[\s\S]*?\3|[^"'\s>]+))?\s*)>([\s\S]*?)<\/(tvar)(\s*)>/giu,(l,p,g,d,u,c,f)=>(new _e(p,g,!1,n,i),new _e(c,f,!0,n,i),`\0${i.length-2}n${u}\0${i.length}n`));let a=new L(t,n,i);a.type="translate-inner";super("translate",s,a,"translate",n,i);S(this,Ss);this.seal("closed",!0)}get type(){return"translate"}get selfClosing(){return!1}toString(e){return e?this.lastChild.toString(!0):super.toString()}text(){return this.lastChild.text()}print(){}};Ss=new WeakSet,Wg=function(){}});var ul={};Z(ul,{parseCommentAndExt:()=>Rt});var pl,Dg,Cs,Mg,gl,Rt,Kr=w(()=>{"use strict";ze();ae();Go();Ct();Qo();es();ms();pl="<onlyinclude>",Dg="</onlyinclude>",{length:Cs}=pl,Mg=[!1,!0].map(o=>{let r=o?"includeonly":"(?:no|only)include",e=o?"noinclude":"includeonly";return Be(t=>new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${r}(?:\s[^>]*)?/?>|</${r}\s*>|<(${t})(\s[^>]*?)?(?:/>|>([\s\S]*?)</(${"\\1"}\s*)>)|<(${e})(\s[^>]*?)?(?:/>|>([\s\S]*?)(?:</(${e}\s*)>|$))`,"giu"))}),gl=o=>{let r=o.indexOf(pl);return{i:r,j:o.indexOf(Dg,r+Cs)}},Rt=(o,r,e,t)=>{if(t){let{i:l,j:p}=gl(o);if(l!==-1&&p!==-1){let g="",d=u=>{new de(u,r,e),g+=`\0${e.length-1}n`};for(;l!==-1&&p!==-1;){let u=`\0${e.length}g`;new Lt(o.slice(l+Cs,p),r,e),l>0&&d(o.slice(0,l)),g+=u,o=o.slice(p+Cs+1),{i:l,j:p}=gl(o)}return o&&d(o),g}}let{ext:n}=r,i=n,s=r;if(n.includes("translate")){let{TranslateToken:l}=(dl(),X(ll)),p=[];i=n.filter(g=>g!=="translate"&&g!=="tvar"),s=ge(V({},r),{ext:i}),o=o.replace(/<nowiki>[\s\S]*?<\/nowiki>/giu,g=>(p.push(g),`\0${p.length-1}`)).replace(/<translate( nowrap)?>([\s\S]*?)<\/translate>/gu,(g,d,u)=>{let c=e.length;return new l(d,u&&ke(u,p),s,e),`\0${c}g`}),o=ke(o,p)}let a=Mg[t?1:0](i.join("|"));return a.lastIndex=0,a.test(o)?o.replace(a,(l,p,g,d,u,c,f,h,x)=>{let T=e.length,b="n";if(p)b="e",new Xe(p,g,d,u,s,c,e);else if(l.startsWith("<!--")){b="c";let y=l.endsWith("-->");new Ze(ke(l,e,1).slice(4,y?-3:void 0),y,r,e)}else c?new $t(c,f&&ke(f,e,1),h&&ke(h,e,1),x,r,e):new de(l,r,e,!0);return`\0${T}${b}`}):o}});var Ug,zg,Gg,fl,pn,ws,Hg,Ut,cl=w(()=>{"use strict";z();se();zn();D();ks();Ug=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),zg=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"]),Gg=new Set(["strike","big","center","font","tt"]);fl=[dr()];Ut=class extends(Hg=xr){constructor(e,t,n,i,s,a){super(e,t,n,s,a);S(this,pn);this.setAttribute("name",e.toLowerCase()),C(this,pn,i)}get type(){return"html"}get selfClosing(){return m(this,pn)}text(){let{closing:e,selfClosing:t,name:n}=this,[,,i]=this.getAttribute("config").html;return i.includes(n)?e&&n!=="br"?"":super.text("/"):super.text(t&&!e?"/":"")}lint(e=this.getAbsoluteIndex(),t){{let n=super.lint(e,t),{name:i,parentNode:s,closing:a,selfClosing:l}=this,p=new W(this,e),{lintConfig:g}=v,{computeEditInfo:d,fix:u}=g,c=this.inTableAttrs(),f="h1",h=g.getSeverity(f,"html");if(h&&i==="h1"&&!a){let A=F(this,p,f,"<h1>",h);d&&(A.suggestions=[{desc:"h2",range:[e+2,e+3],text:"2"}]),n.push(A)}if(f="parsing-order",h=c&&g.getSeverity(f,c===2?"html":"templateInTable"),h){let A=F(this,p,f,"html-in-table",h);d&&c===2&&(A.suggestions=[O(A)]),n.push(A)}if(f="obsolete-tag",h=g.getSeverity(f,i),h&&Gg.has(i)&&n.push(F(this,p,f,"obsolete-tag",h)),f="bold-header",h=g.getSeverity(f,i),h&&(i==="b"||i==="strong")&&this.isInside("heading-title")){let A=F(this,p,f,"bold-in-header",h);d&&(A.suggestions=[O(A)]),n.push(A)}let[,x,T]=this.getAttribute("config").html,b=T.includes(i),y=x.includes(i),k=!b&&!y;if(f="unmatched-tag",a&&(l||b)||l&&k){if(h=g.getSeverity(f,a?"both":"selfClosing"),h){let A=F(this,p,f,a?"closing-and-self-closing":"invalid-self-closing",h);if(d||u){let N=Rn(e),E={desc:v.msg("no-self-closing"),range:[A.endIndex-2,A.endIndex-1],text:""};y?d&&(A.suggestions=[N,E]):a?A.fix=b?N:E:d&&(A.suggestions=[E,Le(A.endIndex,`></${i}>`,-2)])}n.push(A)}}else if(!this.findMatchingTag()){let A=F(this,p,f,a?"unmatched-closing":"unclosed-tag"),N=this.closest("magic-word");if(N&&Ug.has(N.name))h=g.getSeverity(f,"conditional");else if(a)h=g.getSeverity(f,"closing"),A.suggestions=[O(A)];else{h=g.getSeverity(f,"opening");let E=s==null?void 0:s.childNodes;zg.has(i)&&(E!=null&&E.slice(0,E.indexOf(this)).some($=>$.is("html")&&$.name===i&&!$.findMatchingTag())&&(A.suggestions=[Le(e+1,"/")]),this.isInside("heading-title")&&(A.rule="format-leakage",h=g.getSeverity("format-leakage",i)))}h&&(A.severity=h,n.push(A))}return n}}getAttribute(e){return e==="invalid"?this.inTableAttrs()===2:super.getAttribute(e)}json(e,t,n=this.getAbsoluteIndex()){}};ws=B(Hg),pn=new WeakMap,Ut=P(ws,0,"HtmlToken",fl,Ut),R(ws,1,Ut)});var ml={};Z(ml,{parseHtml:()=>Qg});var Vg,Qg,hl=w(()=>{"use strict";Vn();cl();Vg=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,Qg=(o,r,e)=>{var s;let{html:t}=r;(s=r.htmlElements)!=null||(r.htmlElements=new Set([...t[0],...t[1],...t[2]]));let n=o.split("<"),i=n.shift();for(let a of n){let l=Vg.exec(a),p=l==null?void 0:l[2],g=p==null?void 0:p.toLowerCase();if(!l||!r.htmlElements.has(g)){i+=`<${a}`;continue}let[,d,,u="",c,f]=l,{length:h}=e,x=new ft(u,"html-attrs",g,r,e),T=x.hasAttr("itemprop");if(g==="meta"&&!(T&&x.hasAttr("content"))||g==="link"&&!(T&&x.hasAttr("href"))){i+=`<${a}`,e.length=h;continue}i+=`\0${e.length}x${f}`,new Ut(p,x,d==="/",c==="/>",r,e)}return i}});var bl,Es,Xg,tt,Ls=w(()=>{"use strict";zn();G();at();Vn();bl=[dr(1)];tt=class extends(Xg=L){constructor(r,e,t,n,i,s=[],a){super(void 0,i,s,a),this.append(new he(e,"table-syntax",i,s),new ft(n,"table-attrs",t,i,s))}escape(){}};Es=B(Xg),tt=P(Es,0,"TableBaseToken",bl,tt),R(Es,1,tt)});var xl,yl,Re,Ns,yr,un,zt,$s=w(()=>{"use strict";z();se();qn();D();G();Ls();zt=class extends(yl=tt,xl=[tr(!1)],yl){constructor(e,t,n,i=[]){var p;let s=/\||\0\d+!\x7F/u.exec(t!=null?t:""),a=s?t.slice(0,s.index):"";/\[\[|-\{/u.test(a)&&(s=null,a="");super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",a,n,i);R(Ns,5,this);S(this,yr);S(this,Re,"");s&&([En(this,Re)._]=s);let l=new L(t==null?void 0:t.slice(((p=s==null?void 0:s.index)!=null?p:NaN)+m(this,Re).length),n,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 I(this,yr,un).call(this).subtype}afterBuild(){m(this,Re).includes("\0")&&C(this,Re,this.buildFromStr(m(this,Re),0)),super.afterBuild()}toString(e){let[t,n,i]=this.childNodes;return t.toString(e)+n.toString(e)+m(this,Re)+i.toString(e)}text(){let[e,t,n]=this.childNodes;return e.text()+t.text()+m(this,Re)+n.text()}getGaps(e){return e===1?m(this,Re).length:0}lint(e=this.getAbsoluteIndex(),t){{let n=super.lint(e,t),i=new W(this,e+this.getRelativeIndex(this.length-1)),s="pipe-like",{lintConfig:a}=v,{computeEditInfo:l,fix:p}=a,g=["td","double"].map(d=>a.getSeverity(s,d));for(let d of this.lastChild.childNodes)if(d.type==="text"){let{data:u}=d;if(u.includes("|")){let c=u.includes("||"),f=g[c?1:0];if(f){let h=j(d,i,s,"pipe-in-table",f);if(l||p)if(c){let x={caption:"|+",td:"|",th:"!"}[this.subtype];h.fix=me(h,"newline",u.replace(/\|\|/gu,`
|
|
16
|
+
${x}`))}else l&&(h.suggestions=[jn(h.startIndex,u)]);n.push(h)}}}return n}}isIndependent(){return this.firstChild.text().startsWith(`
|
|
17
|
+
`)}getAttr(e){{let t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}}escape(){}print(){}json(e,t,n=this.getAbsoluteIndex()){}};Ns=B(yl),Re=new WeakMap,yr=new WeakSet,un=function(){var a;let e=this.firstChild.text(),t=e.slice(-1),n="td";if(t==="!"?n="th":t==="+"&&(n="caption"),this.isIndependent())return{subtype:n};let{previousSibling:i}=this;return V({},I(a=i,yr,un).call(a))},un=P(Ns,17,"#getSyntax",xl,yr,un),Fr(Ns,zt)});var Tr,Is=w(()=>{"use strict";z();D();Ls();$s();Tr=class extends tt{lint(r=this.getAbsoluteIndex(),e){{let t=super.lint(r,e),n=this.childNodes.find(({type:l})=>l==="table-inter");if(!n)return t;let i=In(n),s="fostered-content",a=i&&v.lintConfig.getSeverity(s,i===2?void 0:"transclusion");if(a){let l=j(n,{start:r},s,"content-outside-table",a);l.startIndex++,l.startLine++,l.startCol=0,t.push(l)}return t}}getRowCount(){return Number(this.childNodes.some(r=>r instanceof zt&&r.isIndependent()&&!r.firstChild.text().endsWith("+")))}}});var Rs,Tl,kl,Fs,kr,vl=w(()=>{"use strict";z();Se();se();qn();D();Is();at();Rs=class extends Array{},kr=class extends(kl=Tr,Tl=[tr(!1)],kl){constructor(e,t,n,i){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,e,"table",t,n,i,{});R(Fs,5,this)}get type(){return"table"}get closed(){return this.lastChild.is("table-syntax")}lint(e=this.getAbsoluteIndex(),t){{let n=super.lint(e,t),i=new W(this,e),s=["unclosed-table","table-layout"],a=s.map(l=>v.lintConfig.getSeverity(l));if(a[0]&&!this.closed&&n.push(j(this.firstChild,i,s[0],"unclosed-table",a[0])),a[1]){let l=this.getLayout(),{length:p}=l;if(p>1){let g=1,d=1/0,u=0;for(;u<p;u++){let c=l[u],f=c.length;if(f<g)break;f<d&&(d=f);let h=c.indexOf(c[f-1])+1;if(h>d)break;h>g&&(g=h)}if(u<p){let c=this.getNthRow(u),f=j(c,i,s[1],"inconsistent-table",a[1]);f.startIndex++,f.startLine++,f.startCol=0,n.push(f)}}}return n}}close(e=`
|
|
18
|
+
|}`,t){oe.run(()=>{let n=new he(t?e:void 0,"table-syntax",this.getAttribute("config"),this.getAttribute("accum"));super.insertAt(n)})}getLayout(e){{let t=this.getAllRows(),{length:n}=t,i=Rs.from(Sl(n,()=>[]));for(let s=0;s<i.length;s++){let a=i[s],l=0,p=0,g;for(let d of t[s].childNodes.slice(2))if(d.is("td")){if(d.isIndependent()&&(g=d.subtype!=="caption"),g){let u={row:s,column:l},{rowspan:c,colspan:f}=d;for(l++;a[p];)p++;for(let h=s;h<Math.min(s+c,n);h++)for(let x=p;x<p+f;x++)i[h][x]=u;p+=f}}else if(Al(d))break}return i}}getAllRows(){return[...super.getRowCount()?[this]:[],...this.childNodes.slice(1).filter(e=>e.is("tr")&&e.getRowCount()>0)]}getNthRow(e,t,n){{let i=super.getRowCount();if(e===0&&i)return this;i&&e--;for(let s of this.childNodes.slice(2)){let{type:a}=s;if(a==="tr"&&s.getRowCount()&&(e--,e<0))return s}return}}json(e,t,n=this.getAbsoluteIndex()){}};Fs=B(kl),P(Fs,1,"getLayout",Tl,kr),Fr(Fs,kr)});var ni,Cl=w(()=>{"use strict";Is();ni=class extends Tr{get type(){return"tr"}constructor(r,e,t,n){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,r,"tr",e,t,n)}}});var vr,Ps=w(()=>{"use strict";gt();vr=class extends le{get indent(){}json(r,e,t=this.getAbsoluteIndex()){}}});var Ar,Bs=w(()=>{"use strict";Ps();Ar=class extends vr{get type(){return"dd"}}});var El={};Z(El,{parseTable:()=>Kg});var Jg,wl,Kg,Ll=w(()=>{"use strict";G();vl();Cl();$s();Bs();Jg=o=>o.lastChild.constructor!==L,wl=(o,r)=>o.is("td")?r.pop():o,Kg=({firstChild:{data:o},type:r,name:e},t,n)=>{let i=[],s=o.split(`
|
|
19
19
|
`),a=r==="root"||r==="parameter-value"||r==="ext-inner"&&e==="poem"?"":`
|
|
20
|
-
${s.shift()}`,l,
|
|
21
|
-
${d}${y&&`\0${n.length-1}d`}${k}\0${n.length}b`,l),i.push(...l?[l]:[],new
|
|
22
|
-
${g}`;continue}let f=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(
|
|
20
|
+
${s.shift()}`,l,p=(g,d)=>{if(!d){a+=g;return}let{lastChild:u}=d;if(Jg(d)){let c=new L(g,t,n);c.type="table-inter",c.setAttribute("stage",3),d.insertAt(c)}else u.setText(u.toString()+g)};for(let g of s){l=i.pop();let[d]=/^(?:\s|\0\d+[cno]\x7F)*/u.exec(g),u=g.slice(d.length),c=/^(:*)((?:\s|\0\d+[cn]\x7F)*)(\{\||\{(?:\0\d+[cn]\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(u);if(c){for(;l&&!l.is("td");)l=i.pop();let[,y,k,A,N]=c;y&&new Ar(y,t,n),p(`
|
|
21
|
+
${d}${y&&`\0${n.length-1}d`}${k}\0${n.length}b`,l),i.push(...l?[l]:[],new kr(A,N,t,n));continue}else if(!l){a+=`
|
|
22
|
+
${g}`;continue}let f=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(u);if(!f){p(`
|
|
23
23
|
${g}`,l),i.push(l);continue}let[,h,x,T,b]=f;if(h){for(;!l.is("table");)l=i.pop();l.close(`
|
|
24
|
-
${d}${h}`,!0),
|
|
24
|
+
${d}${h}`,!0),p(b,i[i.length-1])}else if(x){l=wl(l,i),l.is("tr")&&(l=i.pop());let y=new ni(`
|
|
25
25
|
${d}${x}`,b,t,n);i.push(l,y),l.insertAt(y)}else{l=wl(l,i);let y=T==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu,k=y.exec(b),A=0,N=`
|
|
26
|
-
${d}${T}`,E=$=>{let H=new zt(N,b.slice(A,k==null?void 0:k.index),t,n);return $.insertAt(H),H};for(;k;)E(l),{lastIndex:A}=y,[N]=k,k=y.exec(b);i.push(l,E(l))}}return a.slice(1)}});var fn,Nl=w(()=>{"use strict";fn=o=>!/^_{2}.+_{2}$/u.test(o)});var
|
|
27
|
-
`)&&(T=re(c).trim());let{ns:y,valid:k}=v.normalizeTitle(T,0,!1,r,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0,page:t});if(k){if(g){if(y!==6){a+=`[[${h}`;continue}let N=!1;for(u++;u<s.length;u++){let E=s[u],$=E.split("]]");if($.length>2){N=!0,c+=`[[${$[0]}]]${$[1]}`,f=$.slice(2).join("]]");break}else if($.length===2)c+=`[[${$[0]}]]${$[1]}`;else{c+=`[[${E}`;break}}if(c=_l(c,r,e,t,n),!N){a+=`[[${d}${p}${c}`;continue}}}else{a+=`[[${h}`;continue}c&&(c=js(c,r,e,n));let A=br;b||(y===6?(c&&(c=qs(c,r,e,!0)),A=hr):y===14&&(A=si)),c===void 0&&p&&(c=""),a+=`\0${e.length}l${f}`,new A(d,c,r,e,p)}return a}});var Hl={};Z(Hl,{parseMagicLinks:()=>tu});var Gl,Ml,Ul,zl,tu,Vl=w(()=>{"use strict";ae();ti();Gl=String.raw`[${Ie}\t]| |�*160;|�*a0;`,Ml=`(?:${Gl})+`,Ul=`(?:${Gl}|-)`,zl=String.raw`(?:RFC|PMID)${Ml}\d+\b|ISBN${Ml}(?:97[89]${Ul}?)?(?:\d${Ul}?){9}[\dx]\b`,tu=(o,r,e)=>{if(!r.regexMagicLinks)try{r.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${r.protocol})(${De}${Me})|${zl})`,"giu")}catch(t){r.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${r.protocol})(${De}${Me})|${zl})`,"giu")}return o.replace(r.regexMagicLinks,(t,n,i)=>{let s=n?t.slice(n.length):t;if(i){let a="",l=/&(?:[lg]t|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(s);l&&(a=s.slice(l.index),s=s.slice(0,l.index));let u=s.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,g=u.exec(s);if(g){let d=1;g[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(s.slice(0,g.index))&&(d=2),a=s.slice(g.index+d)+a,s=s.slice(0,g.index+d)}return a.length>=i.length?t:(new Ke(s,void 0,r,e),`${n}\0${e.length-1}w${a}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(s))return t;return new Ke(s,"magic-link",r,e),`${n}\0${e.length-1}i`})}});var Ql,Xl=w(()=>{"use strict";Ql=(o,r)=>o.startsWith(r)?r.length:[...r].findIndex((e,t)=>e!==o[t])});var ru,oi,Jl=w(()=>{"use strict";z();D();Rs();ru=new Set(["link","category","file"]),oi=class extends Ar{get type(){return"list"}lint(r=this.getAbsoluteIndex()){var e;{let t="syntax-like",n=v.lintConfig.getSeverity(t,"redirect"),{innerText:i}=this;if(n&&i==="#"){let{nextSibling:s}=this;if((s==null?void 0:s.type)==="text"&&ru.has((e=s.nextSibling)==null?void 0:e.type)&&new RegExp(String.raw`^(?:${this.getAttribute("config").redirection.join("|")})\s*(?::\s*)?$`,"iu").test(`#${s.data}`)){let l=F(s,{start:r+1},t,"redirect-like",n);return l.startIndex--,l.startCol--,l.endIndex+=2,l.endCol+=2,[l]}}return[]}}}});var Kl={};Z(Kl,{parseList:()=>nu});var nu,Yl=w(()=>{"use strict";Xl();Jl();Ps();nu=(o,r,e,t)=>{let n=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(o);if(!n)return r.lastPrefix="",o;let[i,s,a,l]=n,u=a.replace(/;/gu,":"),g=Ql(u,r.lastPrefix),d=((g>1?a.slice(g-1):a)+l).split(/(?=;)/u),p=d[0].startsWith(";"),c=d.length-(p?0:1);if(g>1){let q=a.slice(0,g-1);if(p){let K=q.split(/(?=;)/u);d.unshift(...K),c+=q.includes(";")?K.length:0}else d[0]=q+d[0]}r.lastPrefix=u;let f=s+d.map((q,K)=>`\0${t.length+K}d`).join("")+o.slice(i.length);for(let q of d)new oi(q,e,t);if(!c)return f;let[h,,x]=e.html,T=/:+|-\{|\0\d+[xq]\x7F/gu,b=T,y=b.exec(f),k=0,A=!1,N=!1,E=0,$=(q,K)=>(new Sr(q,e,t),`${f.slice(0,K)}\0${t.length-1}d${f.slice(K+q.length)}`),H=q=>{q?k&&k--:k++};for(;y&&c;){let{0:q,index:K}=y;if(q==="-{"){if(!E){let{lastIndex:_}=b;b=/-\{|\}-/gu,b.lastIndex=_}E++}else if(q==="}-"){if(E--,!E){let{lastIndex:_}=b;b=T,b.lastIndex=_}}else if(q.endsWith("x")){let{name:_,closing:U,selfClosing:M}=t[Number(q.slice(1,-2))];(h.includes(_)||!M&&!x.includes(_))&&H(U)}else if(q.endsWith("q")){let{bold:_,italic:U}=t[Number(q.slice(1,-2))];_&&(H(A),A=!A),U&&(H(N),N=!N)}else if(k===0){if(q.length>=c)return $(q.slice(0,c),K);c-=q.length,b.lastIndex=K+4+String(t.length).length,f=$(q,K)}y=b.exec(f)}return f}});var Zl,ed,rt,Ws,iu,Ht,td=w(()=>{"use strict";z();se();Vr();xe();D();G();lt();Zl=new Set(["A","T","R","D","-","H","N"]);ed=[ut(),Q];Ht=class extends(iu=L){constructor(e,t,n=[]){super(void 0,t,n,{});S(this,rt);this.safeAppend(e.map(i=>new pe(i,"converter-flag",t,n)))}get type(){return"converter-flags"}afterBuild(){C(this,rt,this.childNodes.map(e=>e.text().trim())),super.afterBuild()}toString(e){return super.toString(e,";")}text(){return super.text(";")}getUnknownFlags(){return new Set(m(this,rt).filter(e=>/\{{3}[^{}]+\}{3}/u.test(e)))}getVariantFlags(){let e=new Set(this.getAttribute("config").variants);return new Set(m(this,rt).filter(t=>e.has(t)))}isInvalidFlag(e,t,n,i){return!!e&&!t.has(e)&&!n.has(e)&&(t.size>0||!i.has(e))}lint(e=this.getAbsoluteIndex(),t){{let n=this.getVariantFlags(),i=this.getUnknownFlags(),s=new Set(m(this,rt).filter(h=>Zl.has(h))),a=m(this,rt).filter(h=>!h).length,l=m(this,rt).length-i.size-a,{lintConfig:u}=v,{computeEditInfo:g,fix:d}=u,p=super.lint(e,t);if(n.size===l||s.size===l)return p;let c="no-ignored",f=u.getSeverity(c,"conversionFlag");if(f){let h=new W(this,e);for(let x=0;x<this.length;x++){let T=this.childNodes[x],b=T.text().trim();if(this.isInvalidFlag(b,n,i,s)){let y=j(T,h,c,"invalid-conversion-flag",f);(g||d)&&(n.size===0&&Zl.has(b.toUpperCase())?y.fix=Bn(y,b):g&&(y.suggestions=[O(y,x&&-1)])),p.push(y)}}}return p}}print(){}};Ws=B(iu),rt=new WeakMap,Ht=P(Ws,0,"ConverterFlagsToken",ed,Ht),R(Ws,1,Ht)});var Ds,rd,Ms,su,nt,nd=w(()=>{"use strict";xe();D();G();lt();Ds=(o,r,e,t)=>{let n=new L(o,e,t);return n.type=`converter-rule-${r}`,n.setAttribute("stage",11),n};rd=[Q];nt=class extends(su=L){get type(){return"converter-rule"}get variant(){}constructor(r,e=!0,t=v.getConfig(),n=[]){super(void 0,t,n,{});let i=r.indexOf(":"),s=r.slice(0,i).indexOf("=>"),a=s===-1?r.slice(0,i):r.slice(s+2,i);e&&t.variants.includes(a.trim().toLowerCase())?(super.insertAt(new pe(a,"converter-rule-variant",t,n)),super.insertAt(Ds(r.slice(i+1),"to",t,n)),s!==-1&&super.insertAt(Ds(r.slice(0,s),"from",t,n),0)):super.insertAt(Ds(r,"to",t,n))}toString(r){let{childNodes:e,firstChild:t,lastChild:n}=this;return e.length===3?`${t.toString(r)}=>${e[1].toString(r)}:${n.toString(r)}`:super.toString(r,":")}text(){let{childNodes:r,firstChild:e,lastChild:t}=this;return r.length===3?`${e.text()}=>${r[1].text()}:${t.text()}`:super.text(":")}getGaps(r){return r===0&&this.length===3?2:1}print(){}json(r,e,t=this.getAbsoluteIndex()){}};Ms=B(su),nt=P(Ms,0,"ConverterRuleToken",rd,nt),R(Ms,1,nt)});var id,Us,ou,Vt,sd=w(()=>{"use strict";ae();qe();xe();G();td();nd();id=[Q,ue("-{")];Vt=class extends(ou=L){get type(){return"converter"}constructor(r,e,t,n=[]){super(void 0,t,n),this.insertAt(new Ht(r,t,n));let[i]=e,s=i.includes(":"),a=new nt(i,s,t,n);(s?a.length===1:e.length===2&&!re(e[1]).trim())?this.insertAt(new nt(e.join(";"),!1,t,n)):this.safeAppend([a,...e.slice(1).map(l=>new nt(l,!0,t,n))])}toString(r){let[e,...t]=this.childNodes;return`-{${e.toString(r)}${e.length>0?"|":""}${t.map(n=>n.toString(r)).join(";")}}-`}text(){let[r,...e]=this.childNodes;return`-{${r.text()}|${Ee(e,";")}}-`}getGaps(r){return r||this.firstChild.length>0?1:0}print(){}};Us=B(ou),Vt=P(Us,0,"ConverterToken",id,Vt),R(Us,1,Vt)});var od={};Z(od,{parseConverter:()=>au});var au,ad=w(()=>{"use strict";sd();au=(o,r,e)=>{var l;(l=r.regexConverter)!=null||(r.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${r.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"iu"));let t=/-\{/gu,n=/-\{|\}-/gu,i=[],s=t,a=s.exec(o);for(;a;){let{0:u,index:g}=a;if(u==="}-"){let d=i.pop(),{length:p}=e,c=o.slice(d.index+2,g),f=c.indexOf("|"),[h,x]=f===-1?[[],c]:[c.slice(0,f).split(";"),c.slice(f+1)],T=x.replace(/(&[#a-z\d]+);/giu,"$1"),b=T.split(r.regexConverter).map(y=>y.replace(/\x01/gu,";"));new Vt(h,b,r,e),o=`${o.slice(0,d.index)}\0${p}v${o.slice(g+2)}`,i.length===0&&(s=t),s.lastIndex=d.index+3+String(p).length}else i.push(a),s=n,s.lastIndex=g+2;a=s.exec(o)}return o}});var ai={};Z(ai,{Token:()=>L});var lu,mn,Ce,ee,te,wr,Er,hn,Lr,J,ld,dd,gd,ud,pd,fd,cd,md,hd,bd,xd,yd,zs,L,G=w(()=>{"use strict";ae();z();Se();D();No();Ro();lu=["category","html-attr#id,ext-attr#id,table-attr#id"],zs=class zs extends St{constructor(e,t=v.getConfig(),n=[],i){super();S(this,J);S(this,mn,"plain");S(this,Ce,0);S(this,ee);S(this,te);S(this,wr);S(this,Er,!1);S(this,hn);S(this,Lr);typeof e=="string"&&this.insertAt(e),C(this,ee,t),C(this,te,n),n.push(this)}get type(){return m(this,mn)}set type(e){C(this,mn,e)}get pageName(){return m(this.getRootNode(),Lr)}set pageName(e){if(e){let t=this.normalizeTitle(e,0,{temporary:!0,page:""});C(this,Lr,t.valid?t.title:void 0)}else C(this,Lr,e===""?"":void 0)}parseOnce(e=m(this,Ce),t=!1,n){if(e<m(this,Ce)||this.length!==1||!this.isPlain())return this;if(m(this,Ce)>=11)return this;switch(e){case 0:if(this.type==="root"){m(this,te).pop();let i=I(this,J,ld).call(this);t&&(t=!i)}C(this,wr,t),I(this,J,dd).call(this,t);break;case 1:I(this,J,gd).call(this);break;case 2:I(this,J,ud).call(this);break;case 3:I(this,J,pd).call(this);break;case 4:I(this,J,fd).call(this);break;case 5:I(this,J,cd).call(this,n);break;case 6:I(this,J,md).call(this,n);break;case 7:I(this,J,hd).call(this);break;case 8:I(this,J,bd).call(this);break;case 9:I(this,J,xd).call(this);break;case 10:I(this,J,yd).call(this)}if(this.type==="root")for(let i of m(this,te))i==null||i.parseOnce(e,t,n);return En(this,Ce)._++,this}buildFromStr(e,t){let n=e.split(/[\0\x7F]/u).map((i,s)=>{if(s%2===0)return i&&new zr(i);let a=Number(i.slice(0,-1));return m(this,te)[a]}).filter(i=>i!=="");return t===0?n.map(String).join(""):t===1?Ee(n):n}build(){C(this,Ce,11);let{length:e,firstChild:t}=this,n=t==null?void 0:t.toString();if(e===1&&t.type==="text"&&n.includes("\0")&&(_n(this,0,1,this.buildFromStr(n)),this.type==="root"))for(let i of m(this,te))i==null||i.build()}afterBuild(){if(this.type==="root")for(let e of m(this,te))e==null||e.afterBuild();C(this,Er,!0)}parse(e=11,t,n){for(e=Math.min(e,11);m(this,Ce)<e;)this.parseOnce(m(this,Ce),t,n);return e&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===zs}getAttribute(e){var t;switch(e){case"config":return m(this,ee);case"include":return(t=m(this,wr))!=null?t:!!m(this.getRootNode(),wr);case"accum":return m(this,te);case"built":return m(this,Er);case"stage":return m(this,Ce);default:return super.getAttribute(e)}}setAttribute(e,t){e==="stage"?(m(this,Ce)===0&&this.type==="root"&&m(this,te).shift(),C(this,Ce,t)):super.setAttribute(e,t)}insertAt(e,t=this.length){let n=typeof e=="string"?new zr(e):e,{length:i}=this;t+=t<0?i:0,super.insertAt(n,t);let{type:s}=n;return s==="root"&&(n.type="plain"),n}normalizeTitle(e,t=0,n){return v.normalizeTitle(e,t,this.getAttribute("include"),m(this,ee),V({page:this.pageName},n))}inTableAttrs(){var e;return this.isInside("table-attrs")&&((e=this.closest("table-attrs,arg,parameter"))!=null&&e.is("table-attrs")?2:1)}inHtmlAttrs(){return this.isInside("html-attrs")?2:this.inTableAttrs()}lint(e=this.getAbsoluteIndex(),t){var n;{let{lintConfig:i}=v,{computeEditInfo:s,fix:a,ignoreDisables:l,configurationComment:u}=i,g=super.lint(e,t);if(this.type==="root"){let d=new Map,p="no-duplicate",c=["category","id"].map(x=>i.getSeverity(p,x)),f=this.toString(),h=lu.filter((x,T)=>c[T]).join();if(h){for(let x of this.querySelectorAll(h)){let T;if(x.is("category"))T=x.name;else{let b=x.getValue();b&&b!==!0&&(T=`#${b}`)}if(T){let b=d.get(T);b?b.add(x):d.set(T,new Set([x]))}}for(let[x,T]of d)if(T.size>1&&!x.startsWith("#mw-customcollapsible-")){let b=!x.startsWith("#"),y=`duplicate-${b?"category":"id"}`,k=c[b?0:1];g.push(...[...T].map(A=>{let N=F(A,{start:A.getAbsoluteIndex()},p,y,k);return s&&b&&(N.suggestions=[O(N)]),N}))}}if(!l){let x=new RegExp(String.raw`<!--\s*${u}-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->`,"gu"),T=[],b=x.exec(f);for(;b;){let{1:y,index:k}=b,A=(n=b[2])==null?void 0:n.trim(),N;(y==="disable-line"||y==="disable-next-line")&&(N=this.posFromIndex(k).top+(y==="disable-line"?0:1)),T.push({line:N,from:y==="disable"?x.lastIndex:void 0,to:y==="enable"?x.lastIndex:void 0,rules:A?new Set(A.split(",").map(E=>E.trim())):void 0}),b=x.exec(f)}g=g.filter(({rule:y,startLine:k,startIndex:A})=>{let N={pos:0};for(let{line:E,from:$,to:H,rules:q}of T){if(E&&E>k+1)break;if(q&&!q.has(y))continue;if(E===k)return!1;$<=A&&$>N.pos?(N.pos=$,N.type="from"):H<=A&&H>N.pos&&(N.pos=H,N.type="to")}return N.type!=="from"})}if(a&&g.some(({fix:x})=>x)){let x=g.map(({fix:y})=>y).filter(y=>y!==void 0).sort(({range:[y,k]},{range:[A,N]})=>k===N?A-y:N-k),T=1/0,b=f;for(let{range:[y,k],text:A}of x)k<=T&&(b=b.slice(0,y)+A+b.slice(k),T=y);Object.assign(g,{output:b})}if(!s)for(let x of g)delete x.fix,delete x.suggestions}return g}}toString(e,t){return e?super.toString(!0,t):je(m(this,hn),()=>super.toString(!1,t),n=>{let i=this.getRootNode();i.type==="root"&&m(i,Er)&&C(this,hn,n)})}};mn=new WeakMap,Ce=new WeakMap,ee=new WeakMap,te=new WeakMap,wr=new WeakMap,Er=new WeakMap,hn=new WeakMap,Lr=new WeakMap,J=new WeakSet,ld=function(){let{parseRedirect:e}=(Uo(),X(Mo)),t=this.firstChild.toString(),n=e(t,m(this,ee),m(this,te));return n!==!1&&this.setText(n),!!n},dd=function(e){let{parseCommentAndExt:t}=(Yr(),X(pl));this.setText(t(this.firstChild.toString(),m(this,ee),m(this,te),e))},gd=function(){let{parseBraces:e}=(Kn(),X(Ra)),t=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,n=e(t,m(this,ee),m(this,te));this.setText(this.type==="root"?n:n.slice(1))},ud=function(){if(m(this,ee).excludes.includes("html"))return;let{parseHtml:e}=(hl(),X(ml));this.setText(e(this.firstChild.toString(),m(this,ee),m(this,te)))},pd=function(){if(m(this,ee).excludes.includes("table"))return;let{parseTable:e}=(Ll(),X(El));this.setText(e(this,m(this,ee),m(this,te)))},fd=function(){if(m(this,ee).excludes.includes("hr"))return;let{parseHrAndDoubleUnderscore:e}=(Pl(),X(Rl));this.setText(e(this,m(this,ee),m(this,te)))},cd=function(e){let{parseLinks:t}=(Dl(),X(Wl));this.setText(t(this.firstChild.toString(),m(this,ee),m(this,te),this.pageName,e))},md=function(e){let{parseQuotes:t}=(Os(),X(jl)),n=this.firstChild.toString().split(`
|
|
26
|
+
${d}${T}`,E=$=>{let H=new zt(N,b.slice(A,k==null?void 0:k.index),t,n);return $.insertAt(H),H};for(;k;)E(l),{lastIndex:A}=y,[N]=k,k=y.exec(b);i.push(l,E(l))}}return a.slice(1)}});var fn,Nl=w(()=>{"use strict";fn=o=>!/^_{2}.+_{2}$/u.test(o)});var ii,$l=w(()=>{"use strict";gt();ii=class extends le{get type(){return"hr"}}});var Il,cn,js,Yg,Gt,Fl=w(()=>{"use strict";ot();qe();gt();Il=[ve(),pe("__")];Gt=class extends(Yg=le){constructor(e,t,n,i,s){var g,d;super(e,i,s);S(this,cn);let a=e.toLowerCase(),[,,l,p]=i.doubleUnderscore;this.setAttribute("name",(d=t?(g=p==null?void 0:p[e])==null?void 0:g.toLowerCase():l==null?void 0:l[a])!=null?d:a),C(this,cn,n)}get type(){return"double-underscore"}toString(){let e=m(this,cn)?"__":"__";return e+this.innerText+e}print(){}};js=B(Yg),cn=new WeakMap,Gt=P(js,0,"DoubleUnderscoreToken",Il,Gt),R(js,1,Gt)});var Rl={};Z(Rl,{parseHrAndDoubleUnderscore:()=>Zg});var Zg,Pl=w(()=>{"use strict";Nl();$l();Fl();Gi();Zg=({firstChild:{data:o},type:r,name:e},t,n)=>{var p,g,d;let[i,s,a]=t.doubleUnderscore,l=[...i,...s];return(p=t.insensitiveDoubleUnderscore)!=null||(t.insensitiveDoubleUnderscore=new Set(i.filter(fn))),(g=t.sensitiveDoubleUnderscore)!=null||(t.sensitiveDoubleUnderscore=new Set(s.filter(fn))),(d=t.regexHrAndDoubleUnderscore)!=null||(t.regexHrAndDoubleUnderscore=new RegExp(String.raw`^((?:\0\d+[cno]\x7F)*)(-{4,})|__(${l.filter(fn).join("|")})__|_{2}(${l.filter(u=>!fn(u)).map(u=>u.slice(2,-2)).join("|")})_{2}`,"gimu")),r!=="root"&&(r!=="ext-inner"||e!=="poem")&&(o=`\0${o}`),o=o.replace(t.regexHrAndDoubleUnderscore,(u,c,f,h,x)=>{var A;if(f)return new ii(f,t,n),`${c}\0${n.length-1}r`;let T=h!=null?h:x,b=t.sensitiveDoubleUnderscore.has(T),y=T.toLowerCase(),k=t.insensitiveDoubleUnderscore.has(y);return b||k?(new Gt(T,b,!!x,t,n),`\0${n.length-1}${k&&((A=a==null?void 0:a[y])!=null?A:y)==="toc"?"u":"n"}`):u}),t.excludes.includes("heading")||(o=o.replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(u,c,f,h,x)=>{let T=`${c}\0${n.length}h`;return new Qe(f.length,[h,x],t,n),T})),r==="root"||r==="ext-inner"&&e==="poem"?o:o.slice(1)}});var Sr,si,Bl=w(()=>{"use strict";z();se();D();gt();si=class extends le{constructor(e,t,n,i){super(e,n,i);S(this,Sr);C(this,Sr,t)}get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}get closing(){return V(V({},this.bold?{bold:m(this,Sr).bold}:void 0),this.italic?{italic:m(this,Sr).italic}:void 0)}text(){let{parentNode:e,innerText:t}=this;return e!=null&&e.is("image-parameter")&&e.name!=="caption"?"":t}lint(e=this.getAbsoluteIndex()){{let{previousSibling:t,bold:n,closing:i}=this,s=(t==null?void 0:t.type)==="text"?t.data:void 0,a=[],l=new W(this,e),p=["lonely-apos","bold-header"],{lintConfig:g}=v,{computeEditInfo:d}=g,u=[void 0,"word"].map(f=>g.getSeverity(p[0],f)),c=g.getSeverity(p[1]);if(s!=null&&s.endsWith("'")){let f=u[(i.bold||i.italic)&&/[a-z\d]'$/iu.test(s)?1:0];if(f){let h=F(this,l,p[0],v.msg("lonely","'"),f),{startLine:x,startCol:T}=h,[,{length:b}]=/(?:^|[^'])('+)$/u.exec(s),y=e-b,k=ge(V({},h),{startIndex:y,endIndex:e,endLine:x,startCol:T-b,endCol:T});d&&n&&(k.suggestions=[Ge(y,"'",b),O(k)]),a.push(k)}}if(c&&n&&this.isInside("heading-title")){let f=F(this,l,p[1],"bold-in-header",c);d&&(f.suggestions=[O(f)]),a.push(f)}return a}}json(e,t,n=this.getAbsoluteIndex()){}};Sr=new WeakMap});var jl={};Z(jl,{parseQuotes:()=>Os});var Os,qs=w(()=>{"use strict";Bl();Os=(o,r,e,t)=>{var c;let n=o.split(/('{2,})/u),{length:i}=n;if(i===1)return o;let s=0,a=0,l,p,g;for(let f=1;f<i;f+=2){let h=n[f].length;switch(h){case 2:a++;break;case 4:n[f-1]+="'",n[f]="'''";case 3:if(s++,l!==void 0)break;n[f-1].endsWith(" ")?p===void 0&&g===void 0&&(g=f):n[f-1].slice(-2,-1)===" "?l=f:p!=null||(p=f);break;default:n[f-1]+="'".repeat(h-5),n[f]="'''''",a++,s++}}if(a%2===1&&s%2===1){let f=(c=l!=null?l:p)!=null?c:g;f!==void 0&&(n[f]="''",n[f-1]+="'")}let d=!1,u=!1;for(let f=1;f<i;f+=2){let h=n[f].length,x=h!==2,T=h!==3,b=new si(n[f],{bold:x&&!!d,italic:T&&!!u},r,e);x&&(d=!d&&b),T&&(u=!u&&b),n[f]=`\0${e.length-1}q`}return n.join("")}});var Ol={};Z(Ol,{parseExternalLinks:()=>_s});var _s,Ws=w(()=>{"use strict";ae();us();ri();_s=(o,r,e,t)=>{var n;return(n=r.regexExternalLinks)!=null||(r.regexExternalLinks=new RegExp(String.raw`\[((?:\0\d+[cn]\x7F)*(?:\0\d+f\x7F|(?:(?:${r.protocol}|//)${De}|\0\d+m\x7F)${Me}(?=[[\]<>"\t${Ie}]|\0\d)))([${Ie}]*(?![${Ie}]))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),o.replace(r.regexExternalLinks,(i,s,a,l)=>{let{length:p}=e,g=/&[lg]t;/u.exec(s);return g&&(a="",l=s.slice(g.index)+a+l,s=s.slice(0,g.index)),t?(new Ke(s,"ext-link-url",r,e),`[\0${p}f${a}${l}]`):(new Ye(s,a,l,r,e),`\0${p}w`)})}});var oi,ql=w(()=>{"use strict";lr();oi=class extends ye{get type(){return"category"}get sortkey(){}json(r,e,t=this.getAbsoluteIndex()){}}});var Wl={};Z(Wl,{parseLinks:()=>_l});var ep,_l,Dl=w(()=>{"use strict";ae();D();qs();Ws();ds();ns();ql();ep=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)([\s\S]*)$/u,_l=(o,r,e,t,n)=>{var l;(l=r.regexLinks)!=null||(r.regexLinks=new RegExp(String.raw`^\s*(?:${r.protocol}|//)`,"iu"));let i=r.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,s=o.split("[["),a=s.shift();for(let p=0;p<s.length;p++){let g=!1,d,u,c,f,h=s[p],x=i.exec(h);if(x)[,d,u,c,f]=x,f.startsWith("]")&&(c!=null&&c.includes("["))&&(c+="]",f=f.slice(1));else{let N=ep.exec(h);N&&(g=!0,[,d,u,c]=N)}if(d===void 0||r.regexLinks.test(d)||/\0\d+[exhbru]\x7F/u.test(d)){a+=`[[${h}`;continue}let T=re(d).trim(),b=T.startsWith(":");if(b&&g){a+=`[[${h}`;continue}else!T&&c&&!c.includes(`
|
|
27
|
+
`)&&(T=re(c).trim());let{ns:y,valid:k}=v.normalizeTitle(T,0,!1,r,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0,page:t});if(k){if(g){if(y!==6){a+=`[[${h}`;continue}let N=!1;for(p++;p<s.length;p++){let E=s[p],$=E.split("]]");if($.length>2){N=!0,c+=`[[${$[0]}]]${$[1]}`,f=$.slice(2).join("]]");break}else if($.length===2)c+=`[[${$[0]}]]${$[1]}`;else{c+=`[[${E}`;break}}if(c=_l(c,r,e,t,n),!N){a+=`[[${d}${u}${c}`;continue}}}else{a+=`[[${h}`;continue}c&&(c=Os(c,r,e,n));let A=hr;b||(y===6?(c&&(c=_s(c,r,e,!0)),A=mr):y===14&&(A=oi)),c===void 0&&u&&(c=""),a+=`\0${e.length}l${f}`,new A(d,c,r,e,u)}return a}});var Hl={};Z(Hl,{parseMagicLinks:()=>tp});var Gl,Ml,Ul,zl,tp,Vl=w(()=>{"use strict";ae();ri();Gl=String.raw`[${Ie}\t]| |�*160;|�*a0;`,Ml=`(?:${Gl})+`,Ul=`(?:${Gl}|-)`,zl=String.raw`(?:RFC|PMID)${Ml}\d+\b|ISBN${Ml}(?:97[89]${Ul}?)?(?:\d${Ul}?){9}[\dx]\b`,tp=(o,r,e)=>{if(!r.regexMagicLinks)try{r.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${r.protocol})(${De}${Me})|${zl})`,"giu")}catch(t){r.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${r.protocol})(${De}${Me})|${zl})`,"giu")}return o.replace(r.regexMagicLinks,(t,n,i)=>{let s=n?t.slice(n.length):t;if(i){let a="",l=/&(?:[lg]t|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(s);l&&(a=s.slice(l.index),s=s.slice(0,l.index));let p=s.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,g=p.exec(s);if(g){let d=1;g[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(s.slice(0,g.index))&&(d=2),a=s.slice(g.index+d)+a,s=s.slice(0,g.index+d)}return a.length>=i.length?t:(new Ke(s,void 0,r,e),`${n}\0${e.length-1}w${a}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(s))return t;return new Ke(s,"magic-link",r,e),`${n}\0${e.length-1}i`})}});var Ql,Xl=w(()=>{"use strict";Ql=(o,r)=>o.startsWith(r)?r.length:[...r].findIndex((e,t)=>e!==o[t])});var rp,ai,Jl=w(()=>{"use strict";z();D();Ps();rp=new Set(["link","category","file"]),ai=class extends vr{get type(){return"list"}lint(r=this.getAbsoluteIndex()){var e;{let t="syntax-like",n=v.lintConfig.getSeverity(t,"redirect"),{innerText:i}=this;if(n&&i==="#"){let{nextSibling:s}=this;if((s==null?void 0:s.type)==="text"&&rp.has((e=s.nextSibling)==null?void 0:e.type)&&new RegExp(String.raw`^(?:${this.getAttribute("config").redirection.join("|")})\s*(?::\s*)?$`,"iu").test(`#${s.data}`)){let l=F(s,{start:r+1},t,"redirect-like",n);return l.startIndex--,l.startCol--,l.endIndex+=2,l.endCol+=2,[l]}}return[]}}}});var Kl={};Z(Kl,{parseList:()=>np});var np,Yl=w(()=>{"use strict";Xl();Jl();Bs();np=(o,r,e,t)=>{let n=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(o);if(!n)return r.lastPrefix="",o;let[i,s,a,l]=n,p=a.replace(/;/gu,":"),g=Ql(p,r.lastPrefix),d=((g>1?a.slice(g-1):a)+l).split(/(?=;)/u),u=d[0].startsWith(";"),c=d.length-(u?0:1);if(g>1){let q=a.slice(0,g-1);if(u){let K=q.split(/(?=;)/u);d.unshift(...K),c+=q.includes(";")?K.length:0}else d[0]=q+d[0]}r.lastPrefix=p;let f=s+d.map((q,K)=>`\0${t.length+K}d`).join("")+o.slice(i.length);for(let q of d)new ai(q,e,t);if(!c)return f;let[h,,x]=e.html,T=/:+|-\{|\0\d+[xq]\x7F/gu,b=T,y=b.exec(f),k=0,A=!1,N=!1,E=0,$=(q,K)=>(new Ar(q,e,t),`${f.slice(0,K)}\0${t.length-1}d${f.slice(K+q.length)}`),H=q=>{q?k&&k--:k++};for(;y&&c;){let{0:q,index:K}=y;if(q==="-{"){if(!E){let{lastIndex:_}=b;b=/-\{|\}-/gu,b.lastIndex=_}E++}else if(q==="}-"){if(E--,!E){let{lastIndex:_}=b;b=T,b.lastIndex=_}}else if(q.endsWith("x")){let{name:_,closing:U,selfClosing:M}=t[Number(q.slice(1,-2))];(h.includes(_)||!M&&!x.includes(_))&&H(U)}else if(q.endsWith("q")){let{bold:_,italic:U}=t[Number(q.slice(1,-2))];_&&(H(A),A=!A),U&&(H(N),N=!N)}else if(k===0){if(q.length>=c)return $(q.slice(0,c),K);c-=q.length,b.lastIndex=K+4+String(t.length).length,f=$(q,K)}y=b.exec(f)}return f}});var Zl,ed,rt,Ds,ip,Ht,td=w(()=>{"use strict";z();se();Hr();xe();D();G();lt();Zl=new Set(["A","T","R","D","-","H","N"]);ed=[pt(),Q];Ht=class extends(ip=L){constructor(e,t,n=[]){super(void 0,t,n,{});S(this,rt);this.safeAppend(e.map(i=>new ue(i,"converter-flag",t,n)))}get type(){return"converter-flags"}afterBuild(){C(this,rt,this.childNodes.map(e=>e.text().trim())),super.afterBuild()}toString(e){return super.toString(e,";")}text(){return super.text(";")}getUnknownFlags(){return new Set(m(this,rt).filter(e=>/\{{3}[^{}]+\}{3}/u.test(e)))}getVariantFlags(){let e=new Set(this.getAttribute("config").variants);return new Set(m(this,rt).filter(t=>e.has(t)))}isInvalidFlag(e,t,n,i){return!!e&&!t.has(e)&&!n.has(e)&&(t.size>0||!i.has(e))}lint(e=this.getAbsoluteIndex(),t){{let n=this.getVariantFlags(),i=this.getUnknownFlags(),s=new Set(m(this,rt).filter(h=>Zl.has(h))),a=m(this,rt).filter(h=>!h).length,l=m(this,rt).length-i.size-a,{lintConfig:p}=v,{computeEditInfo:g,fix:d}=p,u=super.lint(e,t);if(n.size===l||s.size===l)return u;let c="no-ignored",f=p.getSeverity(c,"conversionFlag");if(f){let h=new W(this,e);for(let x=0;x<this.length;x++){let T=this.childNodes[x],b=T.text().trim();if(this.isInvalidFlag(b,n,i,s)){let y=j(T,h,c,"invalid-conversion-flag",f);(g||d)&&(n.size===0&&Zl.has(b.toUpperCase())?y.fix=Bn(y,b):g&&(y.suggestions=[O(y,x&&-1)])),u.push(y)}}}return u}}print(){}};Ds=B(ip),rt=new WeakMap,Ht=P(Ds,0,"ConverterFlagsToken",ed,Ht),R(Ds,1,Ht)});var Ms,rd,Us,sp,nt,nd=w(()=>{"use strict";xe();D();G();lt();Ms=(o,r,e,t)=>{let n=new L(o,e,t);return n.type=`converter-rule-${r}`,n.setAttribute("stage",11),n};rd=[Q];nt=class extends(sp=L){get type(){return"converter-rule"}get variant(){}constructor(r,e=!0,t=v.getConfig(),n=[]){super(void 0,t,n,{});let i=r.indexOf(":"),s=r.slice(0,i).indexOf("=>"),a=s===-1?r.slice(0,i):r.slice(s+2,i);e&&t.variants.includes(a.trim().toLowerCase())?(super.insertAt(new ue(a,"converter-rule-variant",t,n)),super.insertAt(Ms(r.slice(i+1),"to",t,n)),s!==-1&&super.insertAt(Ms(r.slice(0,s),"from",t,n),0)):super.insertAt(Ms(r,"to",t,n))}toString(r){let{childNodes:e,firstChild:t,lastChild:n}=this;return e.length===3?`${t.toString(r)}=>${e[1].toString(r)}:${n.toString(r)}`:super.toString(r,":")}text(){let{childNodes:r,firstChild:e,lastChild:t}=this;return r.length===3?`${e.text()}=>${r[1].text()}:${t.text()}`:super.text(":")}getGaps(r){return r===0&&this.length===3?2:1}print(){}json(r,e,t=this.getAbsoluteIndex()){}};Us=B(sp),nt=P(Us,0,"ConverterRuleToken",rd,nt),R(Us,1,nt)});var id,zs,op,Vt,sd=w(()=>{"use strict";ae();qe();xe();G();td();nd();id=[Q,pe("-{")];Vt=class extends(op=L){get type(){return"converter"}constructor(r,e,t,n=[]){super(void 0,t,n),this.insertAt(new Ht(r,t,n));let[i]=e,s=i.includes(":"),a=new nt(i,s,t,n);(s?a.length===1:e.length===2&&!re(e[1]).trim())?this.insertAt(new nt(e.join(";"),!1,t,n)):this.safeAppend([a,...e.slice(1).map(l=>new nt(l,!0,t,n))])}toString(r){let[e,...t]=this.childNodes;return`-{${e.toString(r)}${e.length>0?"|":""}${t.map(n=>n.toString(r)).join(";")}}-`}text(){let[r,...e]=this.childNodes;return`-{${r.text()}|${Ee(e,";")}}-`}getGaps(r){return r||this.firstChild.length>0?1:0}print(){}};zs=B(op),Vt=P(zs,0,"ConverterToken",id,Vt),R(zs,1,Vt)});var od={};Z(od,{parseConverter:()=>ap});var ap,ad=w(()=>{"use strict";sd();ap=(o,r,e)=>{var l;(l=r.regexConverter)!=null||(r.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${r.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"iu"));let t=/-\{/gu,n=/-\{|\}-/gu,i=[],s=t,a=s.exec(o);for(;a;){let{0:p,index:g}=a;if(p==="}-"){let d=i.pop(),{length:u}=e,c=o.slice(d.index+2,g),f=c.indexOf("|"),[h,x]=f===-1?[[],c]:[c.slice(0,f).split(";"),c.slice(f+1)],T=x.replace(/(&[#a-z\d]+);/giu,"$1"),b=T.split(r.regexConverter).map(y=>y.replace(/\x01/gu,";"));new Vt(h,b,r,e),o=`${o.slice(0,d.index)}\0${u}v${o.slice(g+2)}`,i.length===0&&(s=t),s.lastIndex=d.index+3+String(u).length}else i.push(a),s=n,s.lastIndex=g+2;a=s.exec(o)}return o}});var li={};Z(li,{Token:()=>L});var lp,mn,Ce,ee,te,Cr,wr,hn,Er,J,ld,dd,gd,pd,ud,fd,cd,md,hd,bd,xd,yd,Gs,L,G=w(()=>{"use strict";ae();z();Se();D();No();Ro();lp=["category","html-attr#id,ext-attr#id,table-attr#id"],Gs=class Gs extends St{constructor(e,t=v.getConfig(),n=[],i){super();S(this,J);S(this,mn,"plain");S(this,Ce,0);S(this,ee);S(this,te);S(this,Cr);S(this,wr,!1);S(this,hn);S(this,Er);typeof e=="string"&&this.insertAt(e),C(this,ee,t),C(this,te,n),n.push(this)}get type(){return m(this,mn)}set type(e){C(this,mn,e)}get pageName(){return m(this.getRootNode(),Er)}set pageName(e){if(e){let t=this.normalizeTitle(e,0,{temporary:!0,page:""});C(this,Er,t.valid?t.title:void 0)}else C(this,Er,e===""?"":void 0)}parseOnce(e=m(this,Ce),t=!1,n){if(e<m(this,Ce)||this.length!==1||!this.isPlain())return this;if(m(this,Ce)>=11)return this;switch(e){case 0:if(this.type==="root"){m(this,te).pop();let i=I(this,J,ld).call(this);t&&(t=!i)}C(this,Cr,t),I(this,J,dd).call(this,t);break;case 1:I(this,J,gd).call(this);break;case 2:I(this,J,pd).call(this);break;case 3:I(this,J,ud).call(this);break;case 4:I(this,J,fd).call(this);break;case 5:I(this,J,cd).call(this,n);break;case 6:I(this,J,md).call(this,n);break;case 7:I(this,J,hd).call(this);break;case 8:I(this,J,bd).call(this);break;case 9:I(this,J,xd).call(this);break;case 10:I(this,J,yd).call(this)}if(this.type==="root")for(let i of m(this,te))i==null||i.parseOnce(e,t,n);return En(this,Ce)._++,this}buildFromStr(e,t){let n=e.split(/[\0\x7F]/u).map((i,s)=>{if(s%2===0)return i&&new Ur(i);let a=Number(i.slice(0,-1));return m(this,te)[a]}).filter(i=>i!=="");return t===0?n.map(String).join(""):t===1?Ee(n):n}build(){C(this,Ce,11);let{length:e,firstChild:t}=this,n=t==null?void 0:t.toString();if(e===1&&t.type==="text"&&n.includes("\0")&&(_n(this,0,1,this.buildFromStr(n)),this.type==="root"))for(let i of m(this,te))i==null||i.build()}afterBuild(){if(this.type==="root")for(let e of m(this,te))e==null||e.afterBuild();C(this,wr,!0)}parse(e=11,t,n){for(e=Math.min(e,11);m(this,Ce)<e;)this.parseOnce(m(this,Ce),t,n);return e&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===Gs}getAttribute(e){var t;switch(e){case"config":return m(this,ee);case"include":return(t=m(this,Cr))!=null?t:!!m(this.getRootNode(),Cr);case"accum":return m(this,te);case"built":return m(this,wr);case"stage":return m(this,Ce);default:return super.getAttribute(e)}}setAttribute(e,t){e==="stage"?(m(this,Ce)===0&&this.type==="root"&&m(this,te).shift(),C(this,Ce,t)):super.setAttribute(e,t)}insertAt(e,t=this.length){let n=typeof e=="string"?new Ur(e):e,{length:i}=this;t+=t<0?i:0,super.insertAt(n,t);let{type:s}=n;return s==="root"&&(n.type="plain"),n}normalizeTitle(e,t=0,n){return v.normalizeTitle(e,t,this.getAttribute("include"),m(this,ee),V({page:this.pageName},n))}inTableAttrs(){var e;return this.isInside("table-attrs")&&((e=this.closest("table-attrs,arg,parameter"))!=null&&e.is("table-attrs")?2:1)}inHtmlAttrs(){return this.isInside("html-attrs")?2:this.inTableAttrs()}lint(e=this.getAbsoluteIndex(),t){var n;{let{lintConfig:i}=v,{computeEditInfo:s,fix:a,ignoreDisables:l,configurationComment:p}=i,g=super.lint(e,t);if(this.type==="root"){let d=new Map,u="no-duplicate",c=["category","id"].map(x=>i.getSeverity(u,x)),f=this.toString(),h=lp.filter((x,T)=>c[T]).join();if(h){for(let x of this.querySelectorAll(h)){let T;if(x.is("category"))T=x.name;else{let b=x.getValue();b&&b!==!0&&(T=`#${b}`)}if(T){let b=d.get(T);b?b.add(x):d.set(T,new Set([x]))}}for(let[x,T]of d)if(T.size>1&&!x.startsWith("#mw-customcollapsible-")){let b=!x.startsWith("#"),y=`duplicate-${b?"category":"id"}`,k=c[b?0:1];g.push(...[...T].map(A=>{let N=F(A,{start:A.getAbsoluteIndex()},u,y,k);return s&&b&&(N.suggestions=[O(N)]),N}))}}if(!l){let x=new RegExp(String.raw`<!--\s*${p}-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->`,"gu"),T=[],b=x.exec(f);for(;b;){let{1:y,index:k}=b,A=(n=b[2])==null?void 0:n.trim(),N;(y==="disable-line"||y==="disable-next-line")&&(N=this.posFromIndex(k).top+(y==="disable-line"?0:1)),T.push({line:N,from:y==="disable"?x.lastIndex:void 0,to:y==="enable"?x.lastIndex:void 0,rules:A?new Set(A.split(",").map(E=>E.trim())):void 0}),b=x.exec(f)}g=g.filter(({rule:y,startLine:k,startIndex:A})=>{let N={pos:0};for(let{line:E,from:$,to:H,rules:q}of T){if(E&&E>k+1)break;if(q&&!q.has(y))continue;if(E===k)return!1;$<=A&&$>N.pos?(N.pos=$,N.type="from"):H<=A&&H>N.pos&&(N.pos=H,N.type="to")}return N.type!=="from"})}if(a&&g.some(({fix:x})=>x)){let x=g.map(({fix:y})=>y).filter(y=>y!==void 0).sort(({range:[y,k]},{range:[A,N]})=>k===N?A-y:N-k),T=1/0,b=f;for(let{range:[y,k],text:A}of x)k<=T&&(b=b.slice(0,y)+A+b.slice(k),T=y);Object.assign(g,{output:b})}if(!s)for(let x of g)delete x.fix,delete x.suggestions}return g}}toString(e,t){return e?super.toString(!0,t):je(m(this,hn),()=>super.toString(!1,t),n=>{let i=this.getRootNode();i.type==="root"&&m(i,wr)&&C(this,hn,n)})}};mn=new WeakMap,Ce=new WeakMap,ee=new WeakMap,te=new WeakMap,Cr=new WeakMap,wr=new WeakMap,hn=new WeakMap,Er=new WeakMap,J=new WeakSet,ld=function(){let{parseRedirect:e}=(Uo(),X(Mo)),t=this.firstChild.toString(),n=e(t,m(this,ee),m(this,te));return n!==!1&&this.setText(n),!!n},dd=function(e){let{parseCommentAndExt:t}=(Kr(),X(ul));this.setText(t(this.firstChild.toString(),m(this,ee),m(this,te),e))},gd=function(){let{parseBraces:e}=(Yn(),X(Ra)),t=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,n=e(t,m(this,ee),m(this,te));this.setText(this.type==="root"?n:n.slice(1))},pd=function(){if(m(this,ee).excludes.includes("html"))return;let{parseHtml:e}=(hl(),X(ml));this.setText(e(this.firstChild.toString(),m(this,ee),m(this,te)))},ud=function(){if(m(this,ee).excludes.includes("table"))return;let{parseTable:e}=(Ll(),X(El));this.setText(e(this,m(this,ee),m(this,te)))},fd=function(){if(m(this,ee).excludes.includes("hr"))return;let{parseHrAndDoubleUnderscore:e}=(Pl(),X(Rl));this.setText(e(this,m(this,ee),m(this,te)))},cd=function(e){let{parseLinks:t}=(Dl(),X(Wl));this.setText(t(this.firstChild.toString(),m(this,ee),m(this,te),this.pageName,e))},md=function(e){let{parseQuotes:t}=(qs(),X(jl)),n=this.firstChild.toString().split(`
|
|
28
28
|
`);for(let i=0;i<n.length;i++)n[i]=t(n[i],m(this,ee),m(this,te),e);this.setText(n.join(`
|
|
29
|
-
`))},hd=function(){let{parseExternalLinks:e}=(
|
|
29
|
+
`))},hd=function(){let{parseExternalLinks:e}=(Ws(),X(Ol));this.setText(e(this.firstChild.toString(),m(this,ee),m(this,te)))},bd=function(){let{parseMagicLinks:e}=(Vl(),X(Hl));this.setText(e(this.firstChild.toString(),m(this,ee),m(this,te)))},xd=function(){if(m(this,ee).excludes.includes("list"))return;let{parseList:e}=(Yl(),X(Kl)),{firstChild:t,type:n,name:i}=this,s=t.toString().split(`
|
|
30
30
|
`),a={lastPrefix:""},l=n==="root"||n==="ext-inner"&&i==="poem"?0:1;for(;l<s.length;l++)s[l]=e(s[l],a,m(this,ee),m(this,te));this.setText(s.join(`
|
|
31
|
-
`))},yd=function(){if(m(this,ee).variants.length>0){let{parseConverter:e}=(ad(),X(od));this.setText(e(this.firstChild.toString(),m(this,ee),m(this,te)))}};L=
|
|
31
|
+
`))},yd=function(){if(m(this,ee).variants.length>0){let{parseConverter:e}=(ad(),X(od));this.setText(e(this.firstChild.toString(),m(this,ee),m(this,te)))}};L=Gs});var oe,Jn,Al,jo,_n,va,Sl,Se=w(()=>{"use strict";oe={running:!1,run(o,r){let{running:e}=this;this.running=!0;let t=r==null?void 0:r.internal;r&&(r.internal=!0);let n=()=>{this.running=e,r&&(r.internal=t)};try{let{Token:i}=(G(),X(li)),s=o();return s instanceof i&&!s.getAttribute("built")&&s.afterBuild(),n(),s}catch(i){throw n(),i}},internal(o,r){let{internal:e}=r;r.internal=!0;let t=o();return r.internal=e,t},rev:0},Jn=o=>r=>r.type===o,Al=({type:o})=>o==="tr"||o==="table-syntax",jo=o=>o==="redirect-target"||o==="link",_n=(o,r,e,t=[])=>{var s,a;let n=o.getChildNodes(),i;n.length===e?(i=n,n=t):i=Array.prototype.splice.apply(n,[r,e,...t]);for(let l=0;l<t.length;l++){let p=t[l];p.setAttribute("parentNode",o),p.setAttribute("nextSibling",n[r+l+1]),p.setAttribute("previousSibling",n[r+l-1])}return(s=n[r-1])==null||s.setAttribute("nextSibling",n[r]),(a=n[r+t.length])==null||a.setAttribute("previousSibling",n[r+t.length-1]),n===t&&o.setAttribute("childNodes",n),i},va=(o,r)=>{let e=o.toLowerCase(),[t,n]=r,i=Object.prototype.hasOwnProperty.call(n,o);return[e,i,i?n[o]:Object.prototype.hasOwnProperty.call(t,e)&&t[e]]},Sl=(o,r)=>Array.from({length:o},(e,t)=>r(t))});var bn,dp,Td,kd,gp,vd,pp,Hs,Lr,xn,Ad=w(()=>{"use strict";yi();bn=new Map([[0,!1],[1,"warning"],[2,"error"],[!1,!1],["off",!1],["warning","warning"],["error","error"]]),dp={"arg-in-ext":1,"bold-header":[1,{}],"format-leakage":[1,{}],"fostered-content":[1,{}],h1:[1,{}],"illegal-attr":[2,{}],"insecure-style":2,"invalid-gallery":[2,{parameter:1}],"invalid-imagemap":[2,{}],"invalid-invoke":[2,{}],"invalid-isbn":2,"invalid-json":[2,{duplicate:1}],"invalid-url":1,"lonely-apos":[1,{}],"lonely-bracket":[1,{extLink:2}],"lonely-http":[1,{}],"nested-link":[2,{}],"no-arg":1,"no-duplicate":[2,{category:1,id:1,unknownImageParameter:1}],"no-ignored":[2,{fragment:1,galleryComment:1,galleryNoImage:1,include:1,nonWordAttributes:1,redirect:1}],"obsolete-attr":1,"obsolete-tag":1,"parsing-order":[2,{templateInTable:1}],"pipe-like":[1,{double:2}],"syntax-like":[2,{}],"table-layout":1,"tag-like":[2,{disallowed:1,invalid:1}],"unbalanced-header":2,"unclosed-comment":[1,{}],"unclosed-quote":1,"unclosed-table":2,unescaped:2,"unknown-page":1,"unmatched-tag":[1,{both:2,selfClosing:2}],"unterminated-url":[1,{}],"url-encoding":[1,{}],"var-anchor":[1,{}],"void-ext":[2,{}]},Td={configurationComment:"lint",ignoreDisables:!1,fix:!0,computeEditInfo:!0},kd=o=>bn.has(o),gp=o=>kd(o)||Array.isArray(o)&&kd(o[0])&&(o.length===1||typeof o[1]=="object"),vd=(o,r,e)=>{if(!Rr.includes(r))throw new RangeError(`Unknown lint rule: ${r}`);if(e===void 0)return!1;if(gp(e))return o[r]=e,!0;throw new RangeError(`Invalid lint config for ${r}: ${JSON.stringify(e)}`)},pp=typeof structuredClone=="function"?structuredClone:o=>JSON.parse(JSON.stringify(o)),Hs=class{constructor(r){if(Object.assign(this,pp(dp)),!!r)for(let[e,t]of Object.entries(r))vd(this,e,t)}getSeverity(r,e){var n,i;let t=this[r];return typeof t!="object"?bn.get(t):e&&(i=bn.get((n=t[1])==null?void 0:n[e]))!=null?i:bn.get(t[0])}},xn=class{constructor(r){S(this,Lr);if(Object.assign(this,Td),r&&!("rules"in r)&&Object.keys(r).some(t=>Rr.includes(t)))this.rules=r;else{let e=r!=null?r:{},{rules:t}=e,n=bi(e,["rules"]);this.rules=t;for(let[i,s]of Object.entries(n))s!==void 0&&Object.prototype.hasOwnProperty.call(Td,i)&&(this[i]=s)}}get rules(){return m(this,Lr)}set rules(r){C(this,Lr,new Proxy(new Hs(r),{set:vd,deleteProperty(){return!1}}))}getSeverity(r,e){return m(this,Lr).getSeverity(r,e)}};Lr=new WeakMap});var Sd,Tn,kn,Qt,Nr,Xt,di,Cd,yn,wd=w(()=>{"use strict";ze();ae();Sd=o=>{let[,{length:r},e]=/^((?:\.\.\/)*)([\s\S]*)/u.exec(o);return[r/3,e]},yn=class{constructor(r,e,t,{temporary:n,decode:i,selfLink:s,page:a}={}){S(this,di);S(this,Tn);S(this,kn);S(this,Qt);S(this,Nr);S(this,Xt);ce(this,"page");ce(this,"valid");ce(this,"encoded",!1);this.page=a;let l=r.trim(),p=l.startsWith("../");if(i&&r.includes("%"))try{let c=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(r);r=At(r),this.encoded=c}catch(c){}if(r=Br(r).replace(/[_ ]+/gu," ").trim(),p||a&&l.startsWith("/"))C(this,Nr,0);else{let c=e;r.startsWith(":")&&(c=0,r=r.slice(1).trim());let f=r.split(":");if(f.length>1){let h=Ue(f[0]),x=Object.prototype.hasOwnProperty.call(t.nsid,h)&&t.nsid[h];x&&(c=x,r=f.slice(1).join(":").trim())}C(this,Nr,c)}let g=r.indexOf("#");if(g!==-1){let c=r.slice(g).trim().slice(1);if(c.includes("%"))try{c=At(c)}catch(f){}C(this,Xt,c.replace(/ /gu,"_")),r=r.slice(0,g).trim()}let[d,u]=p?Sd(r):[0,r];this.valid=!!(r||s&&this.ns===0&&m(this,Xt)!==void 0)&&Br(r)===r&&(d===0||a===void 0||a.split("/",d+1).length>d)&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(u),this.main=r,C(this,kn,t.namespaces),C(this,Qt,t.articlePath||"/wiki/$1"),m(this,Qt).includes("$1")||C(this,Qt,m(this,Qt)+`${m(this,Qt).endsWith("/")?"":"/"}$1`)}get ns(){return m(this,Nr)}get fragment(){return m(this,Xt)}get main(){return m(this,Tn)}set main(r){r=r.replace(/_/gu," ").trim(),C(this,Tn,r&&r[0].toUpperCase()+r.slice(1))}get prefix(){let r=m(this,kn)[this.ns];return r+(r&&":")}get title(){return this.getRedirection()[1]}get extension(){let{main:r}=this,e=r.lastIndexOf(".");return e===-1?void 0:r.slice(e+1).toLowerCase()}getRedirection(){let{prefix:r}=this,e=r;return I(this,di,Cd).call(this,e)}setFragment(r){C(this,Xt,r)}getUrl(r){throw new Error("Title.getUrl method is only available in the LSP version!")}};Tn=new WeakMap,kn=new WeakMap,Qt=new WeakMap,Nr=new WeakMap,Xt=new WeakMap,di=new WeakSet,Cd=function(r){var t,n;let e=(r+this.main).replace(/ /gu,"_");if(e.startsWith("/"))e=((t=this.page)!=null?t:"")+e.replace(/(.)\/$/u,"$1");else if(e.startsWith("../")&&((n=this.page)!=null&&n.includes("/"))){let[i,s]=Sd(e),a=this.page.split("/");a.length>i&&(e=a.slice(0,-i).join("/")+(s&&"/")+s)}return[!1,e]}});var Vs,Ed,Ld,fp,vn,Nd,cp,v,D=w(()=>{yi();Se();Nn();ae();Ad();wd();Vs=!0,Ed=new xn,fp=(o,r,e)=>typeof o=="string"?[!!r,e,o]:[!!o,r,e],vn={config:Ti,get rules(){return Rr},get i18n(){return V(V({},void 0),Ld)},set i18n(o){Ld=o},get lintConfig(){return Ed},set lintConfig(o){Ed=new xn(o)},get viewOnly(){return Vs},set viewOnly(o){Vs&&!o&&oe.rev++,Vs=o},internal:!1,getConfig(o){let r=o!=null?o:this.config,{doubleUnderscore:e,ext:t,parserFunction:n,variable:i}=r;for(let s=0;s<2;s++)e.length>s+2&&e[s].length===0&&(e[s]=Object.keys(e[s+2]));return t.includes("translate")&&!i.includes("translationlanguage")&&(i.push("translationlanguage"),n[1].TRANSLATIONLANGUAGE="translationlanguage"),ge(V(V({},Ti),r),{excludes:[]})},msg(o,r=""){var e;return o&&((e=this.i18n[o])!=null?e:o).replace("$1",this.msg(r))},normalizeTitle(o,r=0,e,t=vn.getConfig(),n){let i;if(n!=null&&n.halfParsed)i=new yn(o,r,t,n);else{let{Token:s}=(G(),X(li));i=oe.run(()=>{let a=new s(o,t);a.type="root",a.pageName=n==null?void 0:n.page,a.parseOnce(0,e).parseOnce();let l=new yn(a.firstChild.toString(),r,t,n);a.build();for(let p of["main","fragment"]){let g=l[p];if(g!=null&&g.includes("\0")){let d=a.buildFromStr(g,1);p==="main"?l.main=d:l.setFragment(d)}}return l},this)}return i},parse(o,r,e,t,n){o=go(o);let i,s,a,l;typeof r=="string"?(i=!!e,s=t,a=n,l=r):(i=!!r,s=e,a=t,l=n),s!=null||(s=11),a!=null||(a=this.getConfig());let p;typeof s!="number"&&(p=Array.isArray(s)?s:[s],s=Math.max(...p.map(u=>ao[u]||11)));let{Token:g}=(G(),X(li));return oe.run(()=>{let u=new g(o,a);return u.type="root",u.pageName=l,u.parse(s,i)})},parseWithRef(o,r,e,t=r.getAttribute("include")){return this.parse(o,t,e,r.getAttribute("config"),r.pageName)},createLanguageService(o={}){},lint(o,r,e,t){{let[n,i,s]=fp(r,e,t);return oe.internal(()=>this.parse(o,n,void 0,i,s).lint(),this)}},print(o,r,e,t){}},Nd={},cp=new Set(["lintConfig","normalizeTitle","parse","createLanguageService"]);for(let o of Object.keys(vn))cp.has(o)||(Nd[o]={enumerable:!1});Object.defineProperties(vn,Nd);Object.assign(typeof globalThis=="object"?globalThis:self,{Parser:vn});v=vn});D();})();
|