wikiparser-node 1.16.2 → 1.16.3
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.lsp.js +38 -0
- package/bundle/bundle.min.js +35 -0
- package/extensions/dist/base.js +286 -0
- package/extensions/dist/codejar.js +56 -0
- package/extensions/dist/editor.js +159 -0
- package/extensions/dist/highlight.js +30 -0
- package/extensions/dist/lint.js +79 -0
- package/extensions/dist/lsp.js +74 -0
- package/extensions/dist/test-page.js +89 -0
- package/extensions/editor.css +59 -0
- package/extensions/es7/base.js +1 -1
- package/extensions/ui.css +162 -0
- package/package.json +2 -2
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";(()=>{var Xo=Object.create;var mt=Object.defineProperty;var Ci=Object.getOwnPropertyDescriptor;var Ko=Object.getOwnPropertyNames;var Jo=Object.prototype.hasOwnProperty;var $i=(a,r)=>(r=Symbol[a])?r:Symbol.for("Symbol."+a),ht=a=>{throw TypeError(a)};var Ni=(a,r,e)=>r in a?mt(a,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[r]=e;var wi=(a,r)=>mt(a,"name",{value:r,configurable:!0});var A=(a,r)=>()=>(a&&(r=a(a=0)),r);var Zo=(a,r)=>()=>(r||a((r={exports:{}}).exports,r),r.exports),ie=(a,r)=>{for(var e in r)mt(a,e,{get:r[e],enumerable:!0})},Yo=(a,r,e,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of Ko(r))!Jo.call(a,n)&&n!==e&&mt(a,n,{get:()=>r[n],enumerable:!(t=Ci(r,n))||t.enumerable});return a};var Z=a=>Yo(mt({},"__esModule",{value:!0}),a);var ue=a=>{var r;return[,,,Xo((r=a==null?void 0:a[$i("metadata")])!=null?r:null)]},Ii=["class","method","getter","setter","accessor","field","value","get","set"],Yt=a=>a!==void 0&&typeof a!="function"?ht("Function expected"):a,ea=(a,r,e,t,n)=>({kind:Ii[a],name:r,metadata:t,addInitializer:i=>e._?ht("Already initialized"):n.push(Yt(i||null))}),ta=(a,r)=>Ni(r,$i("metadata"),a[3]),pe=(a,r,e,t)=>{for(var n=0,i=a[r>>1],s=i&&i.length;n<s;n++)r&1?i[n].call(e):t=i[n].call(e,t);return t},ce=(a,r,e,t,n,i)=>{var s,o,l,u,g,d=r&7,c=!!(r&8),p=!!(r&16),h=d>3?a.length+1:d?c?1:2:0,f=Ii[d+5],k=d>3&&(a[h-1]=[]),x=a[h]||(a[h]=[]),v=d&&(!p&&!c&&(n=n.prototype),d<5&&(d>3||!p)&&Ci(d<4?n:{get[e](){return m(this,i)},set[e](I){return y(this,i,I)}},e));d?p&&d<4&&wi(i,(d>2?"set ":d>1?"get ":"")+e):wi(n,e);for(var C=t.length-1;C>=0;C--)u=ea(d,e,l={},a[3],x),d&&(u.static=c,u.private=p,g=u.access={has:p?I=>ra(n,I):I=>e in I},d^3&&(g.get=p?I=>(d^1?m:w)(I,n,d^4?i:v.get):I=>I[e]),d>2&&(g.set=p?(I,N)=>y(I,n,N,d^4?i:v.set):(I,N)=>I[e]=N)),o=(0,t[C])(d?d<4?p?i:v[f]:d>4?void 0:{get:v.get,set:v.set}:n,u),l._=1,d^4||o===void 0?Yt(o)&&(d>4?k.unshift(o):d?p?i=o:v[f]=o:n=o):typeof o!="object"||o===null?ht("Object expected"):(Yt(s=o.get)&&(v.get=s),Yt(s=o.set)&&(v.set=s),Yt(s=o.init)&&k.unshift(s));return d||ta(a,n),v&&mt(n,e,v),p?d^4?i:v:n},te=(a,r,e)=>Ni(a,typeof r!="symbol"?r+"":r,e),Sn=(a,r,e)=>r.has(a)||ht("Cannot "+e),ra=(a,r)=>Object(r)!==r?ht('Cannot use the "in" operator on this value'):a.has(r),m=(a,r,e)=>(Sn(a,r,"read from private field"),e?e.call(a):r.get(a)),T=(a,r,e)=>r.has(a)?ht("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(a):r.set(a,e),y=(a,r,e,t)=>(Sn(a,r,"write to private field"),t?t.call(a,e):r.set(a,e),e),w=(a,r,e)=>(Sn(a,r,"access private method"),e);var Fr=(a,r,e,t)=>({set _(n){y(a,r,n,e)},get _(){return m(a,r,t)}});var Ei,Li,Fi=A(()=>{"use strict";Ei=(()=>{let a={redirect:1,onlyinclude:1,noinclude:1,include:1,comment:1,ext:1,arg:2,"magic-word":2,template:2,heading:2,html:3,table:4,hr:5,"double-underscore":5,link:6,category:6,file:6,quote:7,"ext-link":8,"free-ext-link":9,"magic-link":9,list:10,dd:10,converter:11};return Object.setPrototypeOf(a,null),a})(),Li=(()=>{let a=["bold-header","format-leakage","fostered-content","h1","illegal-attr","insecure-style","invalid-gallery","invalid-imagemap","invalid-invoke","invalid-isbn","lonely-apos","lonely-bracket","lonely-http","nested-link","no-arg","no-duplicate","no-ignored","obsolete-attr","obsolete-tag","parsing-order","pipe-like","table-layout","tag-like","unbalanced-header","unclosed-comment","unclosed-quote","unclosed-table","unescaped","unknown-page","unmatched-tag","unterminated-url","url-encoding","var-anchor","void-ext"];return Object.freeze(a),a})()});var Me,er,Pi,wn=A(()=>{"use strict";Me=a=>decodeURIComponent(a.replace(/%(?![\da-f]{2})/giu,"%25")),er=a=>Math.round(a*255).toString(16).padStart(2,"0"),Pi=(a,r=!0)=>{let e=String.raw`#(?:[\da-f]{3,4}|(?:[\da-f]{2}){3,4})(?![\p{L}\d_])`,t=String.raw`(?:\d*\.)?\d+%?`,n=String.raw`(?:\d*\.)?\d+(?:deg|grad|rad|turn)?`,i=String.raw`rgba?\(\s*(?:${String.raw`${new Array(3).fill(t).join(String.raw`\s+`)}(?:\s*\/\s*${t})?`}|${String.raw`${new Array(3).fill(t).join(String.raw`\s*,\s*`)}(?:\s*,\s*${t})?`})\s*\)`,s=String.raw`hsla?\(\s*(?:${String.raw`${n}\s+${t}\s+${t}(?:\s*\/\s*${t})?`}|${String.raw`${n}${String.raw`\s*,\s*(?:\d*\.)?\d+%`.repeat(2)}(?:\s*,\s*${t})?`})\s*\)`,o=new RegExp(String.raw`(^|[^\p{L}\d_])(${e}|${i}|${s})`,"giu"),l=new RegExp(String.raw`(^|[^\p{L}\d_])(${e}|${i})`,"giu"),u=[],g=r?o:l;g.lastIndex=0;let d=g.exec(a),c=0;for(;d;){let p=d.index+d[1].length;p>c&&u.push([a.slice(c,p),c,p,!1]),{lastIndex:c}=g,u.push([d[2],p,c,a.charAt(p-1)!=="&"||!/^#\d+$/u.test(d[2])]),d=g.exec(a)}return a.length>c&&u.push([a.slice(c),c,a.length,!1]),u}});var ye,Ri,Ie,Ee,Ye,Bi,se,ji,me,na,ia,tr,qi,Oi,sa,oa,ft,Le,Y=A(()=>{"use strict";wn();ye=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,Ri=String.raw`[^[\]<>"\0-\x1F\x7F${ye}\uFFFD]`,Ie=String.raw`(?:\[[\da-f:.]+\]|${Ri})`,Ee=String.raw`(?:${Ri}|\0\d+[cn!~]\x7F)*`,Ye=(a,r)=>e=>e.replace(a,r),Bi=Ye(/[\0\x7F]|\r$/gmu,""),se=Ye(/\0\d+[cn]\x7F/gu,""),ji=Ye(/[\\{}()|.?*+^$[\]]/gu,String.raw`\$&`),me=(a,r="")=>a.map(e=>typeof e=="string"?e:e.text()).join(r),na={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},ia=Ye(/&(?:#(\d+|[Xx][\da-fA-F]+)|([lg]t|[LG]T|[lr]brac[ke]|nbsp|amp|AMP|quot|QUOT));/gu,(a,r,e)=>r?String.fromCodePoint(+((/^x/iu.test(r)?"0":"")+r)):na[e.toLowerCase()]),tr=a=>ia(a),qi=Ye(/&#(\d+|x[\da-f]+);/giu,(a,r)=>String.fromCodePoint(+((/^x/iu.test(r)?"0":"")+r))),Oi=Ye(/\n/gu,String.raw`\n`),sa={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},oa=a=>Ye(a,r=>`&${sa[r]};`),ft=oa(/[&<>]/gu),Le=(a,r={})=>{let{pre:e="",post:t="",sep:n=""}=r;return e+a.map(i=>i.print()).join(n)+t}});var Di=Zo((ol,aa)=>{aa.exports={ext:[],html:[["b","bdi","del","i","ins","u","font","big","small","sub","sup","h1","h2","h3","h4","h5","h6","cite","code","em","s","strike","strong","tt","var","div","center","blockquote","ol","ul","dl","table","caption","pre","ruby","rb","rp","rt","rtc","p","span","abbr","dfn","kbd","samp","data","time","mark","tr","td","th","q","bdo"],["li","dt","dd"],["br","wbr","hr","meta","link"]],namespaces:{"0":"","6":"File","10":"Template","14":"Category","828":"Module"},nsid:{"":0,file:6,template:10,category:14,module:828},variable:["!","=","pageid","articlepath","server","servername","scriptpath","stylepath"],parserFunction:[{"#language":"language","#special":"special","#speciale":"speciale","#tag":"tag","#formatdate":"formatdate","#dateformat":"formatdate","#invoke":"invoke","#while":"while","#dowhile":"dowhile","#loop":"loop","#forargs":"forargs","#fornumargs":"fornumargs","#if":"if","#ifeq":"ifeq","#switch":"switch","#ifexist":"ifexist","#ifexpr":"ifexpr","#iferror":"iferror","#time":"time","#timel":"timel","#expr":"expr","#rel2abs":"rel2abs","#titleparts":"titleparts","#categorytree":"categorytree","#urldecode":"urldecode","#choose":"choose","#var":"var","#varexists":"varexists","#var_final":"var_final","#vardefine":"vardefine","#vardefineecho":"vardefineecho","#widget":"widget","#related":"related","#cscore":"cscore","#regex":"regex","#regex_var":"regex_var","#regexquote":"regexquote","#regexall":"regexall","#len":"len","#pos":"pos","#rpos":"rpos","#sub":"sub","#count":"count","#replace":"replace","#explode":"explode","#tab":"tab","#seo":"seo","#babel":"babel","#commaseparatedlist":"commaseparatedlist","#coordinates":"coordinates","#lst":"lst","#lsth":"lsth","#lstx":"lstx","#assessment":"assessment","#mentor":"mentor","#property":"property","#target":"target","#section":"section","#section-x":"section-x","#section-h":"section-h","#statements":"statements"},{"!":"!","=":"=","#FORMAL":"formal","#bcp47":"bcp47","#dir":"dir","#interwikilink":"interwikilink","#interlanguagelink":"interlanguagelink","#timef":"timef","#timefl":"timefl"},["msg","raw"],["subst","safesubst"]],doubleUnderscore:[[],[]],protocol:"bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|matrix:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|worldwind://|xmpp:",interwiki:[],img:{},redirection:["#redirect"],variants:[]}});var Cn,_i=A(()=>{"use strict";Cn=Di()});var rr,xt,nr,ir,$n,L,ee=A(()=>{"use strict";L=class{constructor(r,e){T(this,ir);T(this,rr);T(this,xt);T(this,nr);y(this,rr,r),y(this,xt,e)}get start(){return m(this,xt)}get top(){return w(this,ir,$n).call(this).top}get left(){return w(this,ir,$n).call(this).left}};rr=new WeakMap,xt=new WeakMap,nr=new WeakMap,ir=new WeakSet,$n=function(){var r;return(r=m(this,nr))!=null||y(this,nr,m(this,rr).getRootNode().posFromIndex(m(this,xt))),m(this,nr)}});var bt,Mi,$,E,We,M=A(()=>{"use strict";we();ee();P();bt=(a,r,e,t)=>({line:a+e-1,character:(e===1?r:0)+t}),Mi=a=>(r,e,t,n,i="error")=>{let{start:s}=e,{top:o,left:l}=e instanceof L?e:new L(r,s),{offsetHeight:u,offsetWidth:g}=r,{startIndex:d,startLine:c,startCol:p}=a(r,s,o,l),{line:h,character:f}=bt(c,p,u,g);return{rule:t,message:b.msg(n),severity:i,startIndex:d,endIndex:d+r.toString().length,startLine:c,endLine:h,startCol:p,endCol:f}},$=Mi((a,r,e,t)=>{let n=a.getRelativeIndex(),{top:i,left:s}=a.parentNode.posFromIndex(n);return{startIndex:r+n,startLine:e+i,startCol:i?s:t+s}}),E=Mi((a,r,e,t)=>({startIndex:r,startLine:e,startCol:t})),We=(a,r,e)=>{if(a)return a[1];let t=r();return e([Fe.rev,t]),t}});var la,Pr,Wi=A(()=>{"use strict";la=(a,r,e)=>{let[t,...n]=a.split("#");return(!t||t===r)&&n.every(i=>i===e)},Pr=(a,r,e)=>({type:t,name:n})=>a.split(",").some(i=>la(i.trim(),t,n))});var Hi,sr,Tt,yt,or,ar,lr,kt,Rr,vt,Nn=A(()=>{"use strict";M();Hi=(a,r)=>r.childNodes.slice(0,a).reduce((e,t,n)=>e+t.toString().length+r.getGaps(n),0)+r.getAttribute("padding"),vt=class{constructor(){T(this,kt);te(this,"childNodes",[]);T(this,sr);T(this,Tt);T(this,yt);T(this,or);T(this,ar);T(this,lr)}get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get parentNode(){return m(this,sr)}get nextSibling(){return m(this,Tt)}get previousSibling(){return m(this,yt)}get offsetHeight(){return w(this,kt,Rr).call(this).height}get offsetWidth(){return w(this,kt,Rr).call(this).width}getAttribute(r){return r==="padding"?0:this[r]}setAttribute(r,e){switch(r){case"parentNode":y(this,sr,e),e||(y(this,Tt,void 0),y(this,yt,void 0));break;case"nextSibling":y(this,Tt,e);break;case"previousSibling":y(this,yt,e);break;default:this[r]=e}}getRootNode(){return We(m(this,ar),()=>{var r,e;return(e=(r=this.parentNode)==null?void 0:r.getRootNode())!=null?e:this},r=>{let[,e]=r;e.type==="root"&&e.getAttribute("built")&&y(this,ar,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=t.findIndex(([,,i])=>r<=i);return{top:n,left:r-t[n][1]}}}getGaps(r){return 0}getRelativeIndex(r){if(r===void 0){let{parentNode:e}=this;return e?Hi(e.childNodes.indexOf(this),e):0}return Hi(r,this)}getAbsoluteIndex(){return We(m(this,lr),()=>{let{parentNode:r}=this;return r?r.getAbsoluteIndex()+this.getRelativeIndex():0},r=>{y(this,lr,r)})}getBoundingClientRect(){return{...w(this,kt,Rr).call(this),...this.getRootNode().posFromIndex(this.getAbsoluteIndex())}}seal(r,e){Object.defineProperty(this,r,{enumerable:!e&&!!this[r],configurable:!0})}is(r){return this.type===r}getLines(){return We(m(this,or),()=>{let r=[],e=0;for(let t of String(this).split(`
|
|
2
|
+
`)){let n=e+t.length;r.push([t,e,n]),e=n+1}return r},r=>{y(this,or,r)})}};sr=new WeakMap,Tt=new WeakMap,yt=new WeakMap,or=new WeakMap,ar=new WeakMap,lr=new WeakMap,kt=new WeakSet,Rr=function(){let r=this.getLines(),e=r[r.length-1];return{height:r.length,width:e[2]-e[1]}}});var He,In,En,At,Fn=A(()=>{"use strict";Y();we();Wi();Nn();At=class extends vt{constructor(){super(...arguments);T(this,He)}get length(){return this.childNodes.length}text(e){return me(this.childNodes,e)}normalize(){let e=[...this.childNodes],t=n=>{var i,s;e.splice(n,1),(i=e[n-1])==null||i.setAttribute("nextSibling",e[n]),(s=e[n])==null||s.setAttribute("previousSibling",e[n-1])};for(let n=e.length-1;n>=0;n--){let{type:i,data:s}=e[n];i!=="text"||e.length===1||this.getGaps(n-(n&&1))||s===""&&t(n)}this.setAttribute("childNodes",e)}removeAt(e){return Ln(this,e,1)[0]}insertAt(e,t=this.length){return Ln(this,t,0,[e]),e}closest(e){let t=Pr(e,this),{parentNode:n}=this;for(;n;){if(t(n))return n;({parentNode:n}=n)}}querySelector(e){let t=Pr(e,this);return w(this,He,In).call(this,t)}querySelectorAll(e){let t=Pr(e,this);return w(this,He,En).call(this,t)}append(...e){for(let t of e)this.insertAt(t)}replaceChildren(...e){for(let t=this.length-1;t>=0;t--)this.removeAt(t);this.append(...e)}setText(e,t=0){t+=t<0?this.length:0;let n=this.childNodes[t],{data:i}=n;return n.replaceData(e),i}toString(e,t=""){return this.childNodes.map(n=>n.toString(e)).join(t)}lint(e=this.getAbsoluteIndex(),t){let n=[];for(let i=0,s=e+this.getAttribute("padding");i<this.length;i++){let o=this.childNodes[i];n.push(...o.lint(s,t)),s+=o.toString().length+this.getGaps(i)}return n}print(e={}){let t=e.class;return this.toString()?(t===""?"":`<span class="wpb-${t!=null?t:this.type}">`)+Le(this.childNodes,e)+(t===""?"":"</span>"):""}json(e,t=this.getAbsoluteIndex()){let n={...this,type:this.type,range:[t,t+this.toString().length],childNodes:[]};for(let i=0,s=t+this.getAttribute("padding");i<this.length;i++){let o=this.childNodes[i],{length:l}=o.toString();n.childNodes.push(o.type==="text"?{data:o.data,range:[s,s+l]}:o.json(void 0,s)),s+=l+this.getGaps(i)}return n}};He=new WeakSet,In=function(e){var t;for(let n of this.childNodes){if(n.type==="text")continue;if(e(n))return n;let i=w(t=n,He,In).call(t,e);if(i)return i}},En=function(e){var n;let t=[];for(let i of this.childNodes)i.type!=="text"&&(e(i)&&t.push(i),t.push(...w(n=i,He,En).call(n,e)));return t}});var Pn,zi,da,ga,ua,pa,ca,ma,Rn,Br,Gi,dr,Ui=A(()=>{"use strict";Y();M();P();Nn();Pn=String.raw`[${ye}\t]*`,zi=String.raw`<\s*(?:/\s*)?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|(?:rfc|pmid)(?=[-::]?${Pn}\d)|isbn(?=[-::]?${Pn}(?:\d(?:${Pn}|-)){6})`,da=new RegExp(String.raw`${zi}|https?[:/]/+`,"giu"),ga=new RegExp(zi,"giu"),ua=new Set(["attr-value","ext-link-text","link-text"]),pa={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},ca={"<":"tag-like","[":"lonely-bracket","{":"lonely-bracket","]":"lonely-bracket","}":"lonely-bracket",h:"lonely-http",r:"lonely-http",p:"lonely-http",i:"lonely-http"},ma=["html","head","style","title","body","a","audio","img","video","embed","iframe","object","canvas","script","col","colgroup","tbody","tfoot","thead","button","input","label","option","select","textarea"];try{Rn=new RegExp(String.raw`[\p{L}\d_]`,"u")}catch(a){Rn=/\w/u}dr=class extends vt{constructor(e){super();T(this,Br);te(this,"data","");Object.defineProperties(this,{childNodes:{enumerable:!1,configurable:!1},data:{value:e}})}get type(){return"text"}toString(e){var t;return e&&!((t=this.parentNode)!=null&&t.getAttribute("built"))?se(this.data):this.data}text(){return this.data}lint(e=this.getAbsoluteIndex(),t){var H,q,V;if(t===!1)return[];let{data:n,parentNode:i,nextSibling:s,previousSibling:o}=this;if(!i)throw new Error("An isolated text node cannot be linted!");let{type:l,name:u,parentNode:g}=i,d=!1;if(l==="attr-value"){let{type:F,name:D,tag:W}=g;if(F!=="ext-attr")d=!0;else if(W==="choose"&&(D==="before"||D==="after"))return[]}if(t!=null||(t=l==="free-ext-link"||l==="ext-link-url"||l==="ext-link-text"||l==="image-parameter"&&u==="link"||d?ga:da),n.search(t)===-1)return[];t.lastIndex=0;let c=[],p=s==null?void 0:s.type,h=s==null?void 0:s.name,f=o==null?void 0:o.type,k=this.getRootNode(),x=k.toString(),{ext:v,html:C}=k.getAttribute("config"),{top:I,left:N}=k.posFromIndex(e),O=new Set(["onlyinclude","noinclude","includeonly",...v,...C[0],...C[1],...C[2],...ma]);for(let F=t.exec(n);F;F=t.exec(n)){let[,D,W]=F,{index:_}=F,Q=F[0].toLowerCase();if(W&&W!=="]"){let{length:de}=W;_+=de,Q=Q.slice(de)}let{0:R,length:Se}=Q,re=R==="r"||R==="p"||R==="i";if(R==="<"&&!O.has(D.toLowerCase())||R==="["&&l==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(n.slice(_+1))||s!=null&&s.is("ext")&&h==="nowiki"&&((H=s.innerText)!=null&&H.includes("]")))||re&&(!i.getAttribute("plain")||ua.has(l)))continue;R==="]"&&(_||Se>1)&&t.lastIndex--;let ge=e+_,Je=ge+Se,_e=x[Je],Lr=x[ge-1],kn=Se>1&&!(R==="<"&&!/[\s/>]/u.test(_e!=null?_e:"")||d&&(R==="["||R==="]")||re&&l==="parameter-value")||R==="{"&&(_e===R||Lr==="-")||R==="}"&&(Lr===R||_e==="-")||R==="["&&(_e===R||l==="ext-link-text"||p==="free-ext-link"&&!n.slice(_+1).trim())||R==="]"&&(Lr===R||f==="free-ext-link"&&!n.slice(0,_).includes("]"))?"error":"warning",vn=R==="{"||R==="[";if(kn==="warning"&&(vn||(R==="]"||R==="}"))){let de=pa[R],An=vn?n.slice(_+1):n.slice(0,_);if(R==="{"&&((q=de.exec(An))==null?void 0:q[0])==="}"||R==="}"&&((V=de.exec(An))==null?void 0:V[0])==="{")continue;if(!An.includes(R)){let Si=vn?"nextSibling":"previousSibling",Ze=this[Si];for(;Ze&&(Ze.type!=="text"||!de.test(Ze.data));)Ze=Ze[Si];if(Ze&&de.exec(Ze.data)[0]!==R)continue}}re&&(Q=Q.toUpperCase());let ki=this.posFromIndex(_),{line:vi,character:Ai}=bt(I,N,ki.top+1,ki.left),ct={rule:ca[R],message:b.msg('lonely "$1"',re||R==="h"?Q:R),severity:kn,startIndex:ge,endIndex:Je,startLine:vi,endLine:vi,startCol:Ai,endCol:Ai+Se};if(R==="<")ct.suggestions=[{desc:"escape",range:[ge,ge+1],text:"<"}];else if(R==="h"&&l!=="link-text"&&Rn.test(Lr||""))ct.suggestions=[{desc:"whitespace",range:[ge,ge],text:" "}];else if(R==="["&&l==="ext-link-text"){let de=i.getAbsoluteIndex()+i.toString().length;ct.suggestions=[{desc:"escape",range:[de,de+1],text:"]"}]}else if(R==="]"&&f==="free-ext-link"&&kn==="error"){let de=e-o.toString().length;ct.fix={range:[de,de],text:"[",desc:"left bracket"}}else re&&(ct.suggestions=[...F[0]===Q?[]:[{desc:"uppercase",range:[ge,Je],text:Q}],..._e===":"||_e==="\uFF1A"?[{desc:"whitespace",range:[Je,Je+1],text:" "}]:[]]);c.push(ct)}return c}replaceData(e){w(this,Br,Gi).call(this,e)}print(){return ft(this.data)}};Br=new WeakSet,Gi=function(e){this.setAttribute("data",e)}});var he,et=A(()=>{"use strict";we();he=(a=!0,r=!0)=>(e,t)=>{class n extends e{text(){return""}lint(s){return a?[]:super.lint(s)}}return jr(n,e),n}});var gr,fe,St=A(()=>{"use strict";j();fe=class extends S{constructor(e,t,n,i,s,o){super(e,i,s,o);T(this,gr);y(this,gr,n)}get type(){return m(this,gr)}lint(e=this.getAbsoluteIndex()){return super.lint(e,!1)}};gr=new WeakMap});var wt,U,Pe=A(()=>{"use strict";j();U=class extends S{constructor(e,t,n,i,s){super(e,n,i,s);T(this,wt);y(this,wt,t)}get type(){return m(this,wt)}set type(e){y(this,wt,e)}};wt=new WeakMap});var ha,tt,ke,ze,Ce,ur=A(()=>{"use strict";M();Y();ee();P();j();Pe();ha=a=>a==="redirect-target"||a==="link",Ce=class extends S{constructor(e,t,n=b.getConfig(),i=[],s="|"){super(void 0,n,i,{});T(this,tt,!0);T(this,ke);T(this,ze);if(this.insertAt(new U(e,"link-target",n,i,{})),t!==void 0){let o=new S(t,n,i,{});o.type="link-text",o.setAttribute("stage",10),this.insertAt(o)}y(this,ke,s)}afterBuild(){y(this,ze,this.getTitle()),m(this,ke).includes("\0")&&y(this,ke,this.buildFromStr(m(this,ke),0)),this.setAttribute("name",m(this,ze).title),super.afterBuild()}setAttribute(e,t){e==="bracket"?y(this,tt,t):e==="title"?y(this,ze,t):super.setAttribute(e,t)}toString(e){let t=super.toString(e,m(this,ke));return m(this,tt)?`[[${t}]]`:t}text(){let e=super.text("|");return m(this,tt)?`[[${e}]]`:e}getAttribute(e){return e==="title"?m(this,ze):e==="padding"?2:super.getAttribute(e)}getGaps(e){return e===0?m(this,ke).length:1}lint(e=this.getAbsoluteIndex(),t){let n=super.lint(e,t),{childNodes:[i,s],type:o}=this,{encoded:l,fragment:u}=m(this,ze),g=new L(this,e);if(i.childNodes.some(({type:d})=>d==="template")&&n.push($(i,g,"unknown-page","template in an internal link target","warning")),l){let d=$(i,g,"url-encoding","unnecessary URL encoding in an internal link");d.suggestions=[{desc:"decode",range:[d.startIndex,d.endIndex],text:Me(i.text())}],n.push(d)}if(o==="link"||o==="category"){let d=s==null?void 0:s.childNodes.find(c=>c.type==="text"&&c.data.includes("|"));if(d){let c=$(s,g,"pipe-like",'additional "|" in the link text',"warning"),p=c.startIndex+d.getRelativeIndex();c.suggestions=[{desc:"escape",range:[p,p+d.data.length],text:d.data.replace(/\|/gu,"|")}],n.push(c)}}if(u!==void 0&&!ha(o)){let d=$(i,g,"no-ignored","useless fragment"),c=i.childNodes.find(p=>p.type==="text"&&p.data.includes("#"));c&&(d.fix={range:[d.startIndex+c.getRelativeIndex()+c.data.indexOf("#"),d.endIndex],text:"",desc:"remove"}),n.push(d)}return n}getTitle(e){return this.normalizeTitle(this.firstChild.toString(!0),0,e,!0,!0)}print(){return super.print(m(this,tt)?{pre:"[[",post:"]]",sep:m(this,ke)}:{sep:m(this,ke)})}};tt=new WeakMap,ke=new WeakMap,ze=new WeakMap});var oe,Ge=A(()=>{"use strict";j();oe=class extends S{get innerText(){return this.firstChild.data}constructor(r="",e,t){super(r,e,t)}}});var Vi,Bn,fa,K,Ue=A(()=>{"use strict";et();Ge();Vi=[he()];K=class extends(fa=oe){get type(){return"noinclude"}toString(r){return r?"":super.toString()}};Bn=ue(fa),K=ce(Bn,0,"NoincludeToken",Vi,K),pe(Bn,1,K)});var qr,Qi=A(()=>{"use strict";M();ur();Ue();qr=class extends Ce{get type(){return"redirect-target"}constructor(r,e,t,n){super(r,void 0,t,n),e!==void 0&&this.insertAt(new K(e,t,n))}getTitle(){return this.normalizeTitle(this.firstChild.toString(),0,!0,!0)}lint(r=this.getAbsoluteIndex()){let e=super.lint(r,!1);if(this.length===2){let t=$(this.lastChild,{start:r},"no-ignored","useless link text");t.startIndex--,t.startCol--,t.fix={range:[t.startIndex,t.endIndex],text:"",desc:"remove"},e.push(t)}return e}}});var Xi,Ve,Ct,jn,xa,rt,Ki=A(()=>{"use strict";et();P();j();St();Qi();Xi=[he(!1,!1)];rt=class extends(xa=S){constructor(e,t,n,i,s,o=b.getConfig(),l=[]){super(void 0,o,l);T(this,Ve);T(this,Ct);y(this,Ve,e),y(this,Ct,s);let u=new RegExp(String.raw`^(?:${o.redirection.join("|")})\s*(?::\s*)?$`,"iu");this.append(new fe(t,u,"redirect-syntax",o,l,{}),new qr(n,i==null?void 0:i.slice(1),o,l))}get type(){return"redirect"}getAttribute(e){return e==="padding"?m(this,Ve).length:super.getAttribute(e)}toString(e){return m(this,Ve)+super.toString(e)+m(this,Ct)}lint(e=this.getAbsoluteIndex()){return this.lastChild.lint(e+m(this,Ve).length+this.firstChild.toString().length)}print(){return super.print({pre:m(this,Ve),post:m(this,Ct)})}};jn=ue(xa),Ve=new WeakMap,Ct=new WeakMap,rt=ce(jn,0,"RedirectToken",Xi,rt),pe(jn,1,rt)});var Ji={};ie(Ji,{parseRedirect:()=>ba});var ba,Zi=A(()=>{"use strict";P();Ki();ba=(a,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(a);return t&&b.normalizeTitle(t[3],0,!1,r,!0,!0).valid?(a=`\0${e.length}o\x7F${a.slice(t[0].length)}`,new rt(...t.slice(1),r,e),a):!1}});var Or,Yi=A(()=>{"use strict";j();Or=class extends S{get type(){return"onlyinclude"}toString(r){return`<onlyinclude>${super.toString(r)}</onlyinclude>`}getAttribute(r){return r==="padding"?13:r==="plain"||super.getAttribute(r)}print(){return super.print({pre:'<span class="wpb-ext"><onlyinclude></span>',post:'<span class="wpb-ext"></onlyinclude></span>'})}}});var Qe,$t,qn=A(()=>{"use strict";j();$t=class extends S{constructor(e,t,n,i,s,o=[]){super(void 0,s);T(this,Qe);te(this,"closed");te(this,"selfClosing");this.setAttribute("name",e.toLowerCase()),y(this,Qe,[e,i||e]),this.closed=i!=="",this.selfClosing=i===void 0,this.append(t,n);let l=typeof t=="string"?-1:o.indexOf(t);o.splice(l===-1?1/0:l,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(e){let{selfClosing:t,firstChild:n,lastChild:i}=this,[s,o]=m(this,Qe);return t?`<${s}${n.toString(e)}/>`:`<${s}${n.toString(e)}>${i.toString(e)}${this.closed?`</${o}>`:""}`}text(){let[e,t]=m(this,Qe);return this.selfClosing?`<${e}${this.firstChild.text()}/>`:`<${e}${super.text(">")}${this.closed?`</${t}>`:""}`}getAttribute(e){return e==="padding"?m(this,Qe)[0].length+1:super.getAttribute(e)}getGaps(){return 1}print(){let[e,t]=m(this,Qe);return super.print(this.selfClosing?{pre:`<${e}`,post:"/>"}:{pre:`<${e}`,sep:">",post:this.closed?`</${t}>`:""})}};Qe=new WeakMap});var es,On,Ta,nt,ts=A(()=>{"use strict";M();ee();et();P();qn();es=[he(!1)];nt=class extends(Ta=$t){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 L(this,r);if(t.data.trim()){let o=$(t,s,"no-ignored","useless attribute","warning");o.suggestions=[{desc:"remove",range:[o.startIndex,o.endIndex],text:""}],e.push(o)}if(!n){let o=E(this,s,"unclosed-comment",b.msg("unclosed $1",`<${i}>`));o.suggestions=[{desc:"close",range:[o.endIndex,o.endIndex],text:`</${i}>`}],e.push(o)}return e}};On=ue(Ta),nt=ce(On,0,"IncludeToken",es,nt),pe(On,1,nt)});var J,rs,ns,_r,Dn,is,Nt,ss,os,as,Dr,Mr,Wr,Hr,ls,_n=A(()=>{"use strict";J=new Set(["align"]),rs=new Set(["cite"]),ns=new Set(["cite","datetime"]),_r=new Set(["width"]),Dn=new Set(["axis","align","bgcolor","height","width","valign"]),is=new Set([...Dn,"abbr","headers","scope","rowspan","colspan"]),Nt=new Set(["type"]),ss=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),os=new Set(["clear"]),as=new Set(["bgcolor","align","valign"]),Dr=new Set,Mr=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"]),Wr={div:J,h1:J,h2:J,h3:J,h4:J,h5:J,h6:J,blockquote:rs,q:rs,p:J,br:os,pre:_r,ins:ns,del:ns,ul:Nt,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...ss,"border"]),caption:J,tr:as,td:is,th:is,img:new Set(["alt","src","width","height","srcset"]),font:new Set(["size","color","face"]),hr:_r,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:Nt,poem:J,categorytree:J,combooption:J},Hr={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:Dr,indicator:new Set(["name"]),langconvert:new Set(["from","to"]),ref:new Set(["group","name","extends","follow","dir"]),references:new Set(["group","responsive"]),charinsert:new Set(["label"]),choose:new Set(["uncached","before","after"]),option:new Set(["weight"]),imagemap:Dr,inputbox:Dr,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:Dr,poll:new Set(["id","show-results-before-voting"]),sm2:Nt,flashmp3:Nt,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"])},ls={table:ss,td:new Set([...Dn,"scope"]),th:Dn,br:os,caption:J,div:J,hr:_r,h1:J,h2:J,h3:J,h4:J,h5:J,h6:J,li:Nt,p:J,pre:_r,tr:as,ul:Nt}});var ya,pr,It,ne,$e,Et,ds=A(()=>{"use strict";M();Y();_n();ee();P();j();Pe();ya=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,Et=class extends S{constructor(e,t,n,i="",s,o=[],l=b.getConfig(),u=[]){let g=new U(n,"attr-key",l,u),d;if(n==="title"||t==="img"&&n==="alt")d=new S(s,l,u,{}),d.type="attr-value",d.setAttribute("stage",10);else if(t==="gallery"&&n==="caption"||t==="choose"&&(n==="before"||n==="after")){let c={...l,excludes:[...l.excludes,"heading","html","table","hr","list"]};d=new S(s,c,u,{}),d.type="attr-value",d.setAttribute("stage",1)}else d=new U(s,"attr-value",l,u,{});super(void 0,l,u);T(this,pr);T(this,It);T(this,ne);T(this,$e);y(this,pr,e),this.append(g,d),y(this,ne,i),y(this,$e,[...o]),y(this,It,t),this.setAttribute("name",se(n).trim().toLowerCase())}get type(){return m(this,pr)}get tag(){return m(this,It)}get balanced(){return!m(this,ne)||m(this,$e)[0]===m(this,$e)[1]}afterBuild(){m(this,ne).includes("\0")&&y(this,ne,this.buildFromStr(m(this,ne),0)),this.parentNode&&y(this,It,this.parentNode.name),this.setAttribute("name",this.firstChild.toString(!0).trim().toLowerCase()),super.afterBuild()}toString(e){let[t="",n=""]=m(this,$e);return m(this,ne)?super.toString(e,m(this,ne)+t)+n:this.firstChild.toString(e)}text(){return m(this,ne)?`${super.text(`${m(this,ne).trim()}"`)}"`:this.firstChild.text()}getGaps(){var e,t;return m(this,ne)?m(this,ne).length+((t=(e=m(this,$e)[0])==null?void 0:e.length)!=null?t:0):0}lint(e=this.getAbsoluteIndex(),t){var k;let n=super.lint(e,t),{balanced:i,firstChild:s,lastChild:o,type:l,name:u,tag:g}=this,d=this.getValue(),c=new L(this,e);if(!i){let x=$(o,c,"unclosed-quote",b.msg("unclosed $1","quotes"),"warning");x.startIndex--,x.startCol--,x.suggestions=[{range:[x.endIndex,x.endIndex],text:m(this,$e)[0],desc:"close"}],n.push(x)}let p=Hr[g],h=Wr[g],{length:f}=this.toString();if(!(p!=null&&p.has(u))&&!(h!=null&&h.has(u))&&(l==="ext-attr"?p||h:!/\{\{[^{]+\}\}/u.test(u))&&(l==="ext-attr"&&!h||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(u)&&(g==="meta"||g==="link"||!Mr.has(u)))){let x=$(s,c,"illegal-attr","illegal attribute name");x.suggestions=[{desc:"remove",range:[e,e+f],text:""}],n.push(x)}else if((k=ls[g])!=null&&k.has(u))n.push($(s,c,"obsolete-attr","obsolete attribute","warning"));else if(u==="style"&&typeof d=="string"&&ya.test(d))n.push($(o,c,"insecure-style","insecure style"));else if(u==="tabindex"&&typeof d=="string"&&d!=="0"){let x=$(o,c,"illegal-attr","nonzero tabindex");x.suggestions=[{desc:"remove",range:[e,e+f],text:""},{desc:"0 tabindex",range:[x.startIndex,x.endIndex],text:"0"}],n.push(x)}return n}getValue(){return m(this,ne)?this.lastChild.text().trim():this.type==="ext-attr"||""}print(){let[e="",t=""]=m(this,$e);return m(this,ne)?super.print({sep:ft(m(this,ne))+e,post:t}):super.print()}};pr=new WeakMap,It=new WeakMap,ne=new WeakMap,$e=new WeakMap});var gs,ka,Mn,cr,Xe,zr=A(()=>{"use strict";M();Y();ee();P();j();Pe();ds();gs=a=>a.slice(0,-1),ka=a=>`${gs(a)}-dirty`;try{Mn=new RegExp(String.raw`[\p{L}\d]`,"u")}catch(a){Mn=/[^\W_]/u}Xe=class extends S{constructor(e,t,n,i=b.getConfig(),s=[]){super(void 0,i,s,{});T(this,cr);if(y(this,cr,t),this.setAttribute("name",n),e){let o=/([^\s/](?:(?!\0\d+~\x7F)[^\s/=])*)(?:((?:\s(?:\s|\0\d+[cn]\x7F)*)?(?:=|\0\d+~\x7F)(?:\s|\0\d+[cn]\x7F)*)(?:(["'])([\s\S]*?)(\3|$)|(\S*)))?/gu,l="",u=o.exec(e),g=0,d=()=>{l&&(super.insertAt(new U(l,ka(t),i,s,{})),l="")};for(;u;){let{index:c,0:p,1:h,2:f,3:k,4:x,5:v,6:C}=u;if(l+=e.slice(g,c),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(se(h).trim())){let I=x!=null?x:C,N=[k,v],O=new Et(gs(t),n,h,f,I,N,i,s);d(),super.insertAt(O)}else l+=p;({lastIndex:g}=o),u=o.exec(e)}l+=e.slice(g),d()}}get type(){return m(this,cr)}afterBuild(){let{parentNode:e}=this;(e==null?void 0:e.type)==="td"&&e.subtype==="caption"&&this.setAttribute("name","caption"),super.afterBuild()}getAttrTokens(e){return this.childNodes.filter(t=>t instanceof Et&&(!e||t.name===e.toLowerCase().trim()))}getAttrToken(e){let t=this.getAttrTokens(e);return t[t.length-1]}getAttr(e){var t;return(t=this.getAttrToken(e))==null?void 0:t.getValue()}lint(e=this.getAbsoluteIndex(),t){let n=super.lint(e,t),{parentNode:i,childNodes:s}=this,o=new Map,l=new Set,u=new L(this,e);if((i==null?void 0:i.type)==="html"&&i.closing&&this.text().trim()){let g=E(this,u,"no-ignored","attributes of a closing tag"),d=i.getAbsoluteIndex();g.suggestions=[{desc:"remove",range:[e,g.endIndex],text:""},{desc:"open",range:[d+1,d+2],text:""}],n.push(g)}for(let g of s)if(g instanceof Et){let{name:d}=g;o.has(d)?(l.add(d),o.get(d).push(g)):o.set(d,[g])}else{let d=g.text().trim();if(d){let c=$(g,u,"no-ignored","containing invalid attribute",Mn.test(d)?"error":"warning");c.suggestions=[{desc:"remove",range:[c.startIndex,c.endIndex],text:" "}],n.push(c)}}if(l.size>0)for(let g of l){let d=o.get(g).map(c=>{let p=c.getValue();return[c,p===!0?"":p]});n.push(...d.map(([c,p],h)=>{let f=$(c,u,"no-duplicate",b.msg("duplicated $1 attribute",g)),k={desc:"remove",range:[f.startIndex,f.endIndex],text:""};return!p||d.slice(0,h).some(([,x])=>x===p)?f.fix=k:f.suggestions=[k],f}))}return n}print(){return this.toString()?`<span class="wpb-${this.type}">${this.childNodes.map(e=>e.print(e instanceof U?{class:e.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}};cr=new WeakMap});var Gr,us=A(()=>{"use strict";P();j();Ue();Gr=class extends S{get type(){return"ext-inner"}constructor(r,e=b.getConfig(),t=[]){if(r){let n=/<nowiki>/giu,i=/<\/nowiki>/giu,{length:s}=n.source,o=n.exec(r);o&&(i.lastIndex=o.index+s);let l=i.exec(r),u=0,g="";for(;o&&l;)new K(o[0],e,t),new K(l[0],e,t),g+=`${r.slice(u,o.index)}\0${t.length-1}n\x7F${r.slice(o.index+s,l.index)}\0${t.length}n\x7F`,u=l.index+s+1,n.lastIndex=u,o=n.exec(r),o&&(i.lastIndex=o.index+s),l=i.exec(r);r=g+r.slice(u)}super(r,e,t,{}),this.setAttribute("stage",10)}getAttribute(r){return r==="plain"||super.getAttribute(r)}lint(r=this.getAbsoluteIndex()){return super.lint(r,/<\s*\/\s*(pre)\b/giu)}}});var Lt,Wn=A(()=>{"use strict";M();ee();mr();P();j();Pe();Lt=class extends S{get type(){return"ext-inner"}constructor(r,e,t=b.getConfig(),n=[],i){if(super(void 0,t,n,{}),e){let s=U;this.append(...e.split(`
|
|
3
|
+
`).map(o=>i?o:it(o,t,n,r)).map(o=>new s(o,"param-line",t,n,{})))}n.splice(n.indexOf(this),1),n.push(this)}toString(r){return super.toString(r,`
|
|
4
|
+
`)}text(){return super.text(`
|
|
5
|
+
`)}getGaps(){return 1}lint(r=this.getAbsoluteIndex()){let e=new L(this,r),t=b.msg("invalid parameter of <$1>",this.name),n=[];for(let i of this.childNodes){let s=i.childNodes.filter(({type:o})=>o!=="comment"&&o!=="include"&&o!=="noinclude");if(s.some(({type:o})=>o==="ext"))n.push($(i,e,"no-ignored",t));else{let o=s.findIndex(({type:u})=>u!=="text"),l=s.slice(0,o===-1?void 0:o).map(String).join("");if(l&&!(o===-1?/^[a-z]+(?:\[\])?\s*=/iu:/^[a-z]+(?:\[\])?\s*(?:=|$)/iu).test(l)){let u=$(i,e,"no-ignored",t);u.suggestions=[{desc:"remove",range:[u.startIndex,u.endIndex],text:""}],n.push(u)}else n.push(...i.lint(r,!1))}r+=i.toString().length+1}return n}print(){return super.print({sep:`
|
|
6
|
+
`})}}});var hr,Ft,Ur,Pt,Hn=A(()=>{"use strict";M();we();ee();P();j();St();Pt=class extends S{constructor(e,t,n=b.getConfig(),i=[]){super(void 0,n,i);T(this,Ft);T(this,hr);y(this,hr,e);let s=new S(t[0],n,i);s.type="heading-title",s.setAttribute("stage",2);let o=new fe(t[1],/^\s*$/u,"heading-trail",n,i,{});this.append(s,o)}get type(){return"heading"}get level(){return m(this,hr)}toString(e){let t=m(this,Ft,Ur);return t+this.firstChild.toString(e)+t+this.lastChild.toString(e)}text(){let e=m(this,Ft,Ur);return e+this.firstChild.text()+e}getAttribute(e){return e==="padding"?this.level:super.getAttribute(e)}getGaps(){return this.level}lint(e=this.getAbsoluteIndex(),t){let n=super.lint(e,t),{firstChild:i,level:s}=this,o=i.toString(),l=o.startsWith("="),u=l||o.endsWith("="),g=i.childNodes.filter(Rt("quote")),d=g.filter(({bold:f})=>f),c=g.filter(({italic:f})=>f),p=new L(this,e);if(this.level===1){let f=$(i,p,"h1","<h1>");u||(f.suggestions=[{desc:"h2",range:[f.startIndex,f.endIndex],text:`=${o}=`}]),n.push(f)}if(u){let f=$(i,p,"unbalanced-header",b.msg("unbalanced $1 in a section header",'"="'));if(o!=="=")if(l){let[k]=/^=+/u.exec(o);f.suggestions=[{desc:`h${s}`,range:[f.startIndex,f.startIndex+k.length],text:""},{desc:`h${s+k.length}`,range:[f.endIndex,f.endIndex],text:k}]}else{let k=/[^=](=+)$/u.exec(o)[1];f.suggestions=[{desc:`h${s}`,range:[f.endIndex-k.length,f.endIndex],text:""},{desc:`h${s+k.length}`,range:[f.startIndex,f.startIndex],text:k}]}n.push(f)}this.closest("html-attrs,table-attrs")&&n.push(E(this,p,"parsing-order","section header in a HTML tag"));let h=this.getRootNode().toString();if(d.length%2){let f=$(d[d.length-1],{...p,start:e+s,left:p.left+s},"format-leakage",b.msg("unbalanced $1 in a section header","bold apostrophes")),k=e+s+o.length;h.slice(f.endIndex,k).trim()?f.suggestions=[{desc:"close",range:[k,k],text:"'''"}]:f.fix={desc:"remove",range:[f.startIndex,f.endIndex],text:""},n.push(f)}if(c.length%2){let f=$(c[c.length-1],{start:e+s},"format-leakage",b.msg("unbalanced $1 in a section header","italic apostrophes")),k=e+s+o.length;f.fix=h.slice(f.endIndex,k).trim()?{desc:"close",range:[k,k],text:"''"}:{desc:"remove",range:[f.startIndex,f.endIndex],text:""},n.push(f)}return n}print(){let e=m(this,Ft,Ur);return super.print({pre:e,sep:e})}json(){let e=super.json();return e.level=this.level,e}};hr=new WeakMap,Ft=new WeakSet,Ur=function(){return"=".repeat(this.level)}});var va,Vr,ps=A(()=>{"use strict";Y();M();P();j();va=new RegExp(`https?://${Ie}${Ee}$`,"iu"),Vr=class extends S{get type(){return"parameter"}get anon(){return this.firstChild.length===0}constructor(r,e,t=b.getConfig(),n=[]){super(void 0,t,n);let i=new S(typeof r=="number"?void 0:r,t,n,{}),s=new S(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 s;let t=super.lint(r,e),{firstChild:n}=this,i=(s=va.exec(n.text()))==null?void 0:s[0];if(i&&new URL(i).search){let o=$(n,{start:r},"unescaped","unescaped query string in an anonymous parameter");o.startIndex=o.endIndex,o.startLine=o.endLine,o.startCol=o.endCol,o.endIndex++,o.endCol++,o.fix={range:[o.startIndex,o.endIndex],text:"{{=}}",desc:"escape"},t.push(o)}return t}print(){return super.print({sep:this.anon?"":"="})}json(){let r=super.json();return r.anon=this.anon,r}}});var xr,st,ot,at,zn,cs,fr,ms=A(()=>{"use strict";Y();M();we();ee();P();j();ps();Pe();St();fr=class extends S{constructor(e,t,n=b.getConfig(),i=[]){var f,k;let s,o=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(e);o&&(s=Number(o[1]),e=e.replace(`\0${s}h\x7F`,i[s].toString().replace(/^\n/u,"")));super(void 0,n,i,{});T(this,at);te(this,"modifier","");T(this,xr,"template");T(this,st,!1);T(this,ot,new Map);let{parserFunction:[l,u],variable:g}=n,d=(f=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(e))==null?void 0:f[0];if(d)this.setAttribute("modifier",d),e=e.slice(d.length);else if(e.includes(":")){let[x,...v]=e.split(":"),[C]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((k=v[0])!=null?k:"");this.setModifier(`${x}:${C}`)&&(e=v.join(":").slice(C.length))}let c=e.includes(":");if(c||t.length===0&&!m(this,st)){let x=e.indexOf(":"),v=x===-1?e:e.slice(0,x),C=x===-1?void 0:e.slice(x+1),I=se(v),N=I[C===void 0?"trim":"trimStart"](),O=N.toLowerCase(),H=Array.isArray(u),q=H?u.includes(N):Object.prototype.hasOwnProperty.call(u,N),V=!H&&q?u[N]:Object.prototype.hasOwnProperty.call(l,O)&&l[O];if(H&&q||g.includes(V)||c&&V){this.setAttribute("name",V||O.replace(/^#/u,"")),y(this,xr,"magic-word");let D=new RegExp(String.raw`^\s*${N}\s*$`,q?"u":"iu"),W=new fe(v,D,"magic-word-name",n,i,{});if(super.insertAt(W),C!==void 0&&t.unshift([C]),this.name==="invoke")for(let _=0;_<2;_++){let Q=t.shift();if(!Q)break;let R=new U(Q.join("="),`invoke-${_?"function":"module"}`,n,i);super.insertAt(R)}}}if(this.type==="template"){let x=se(e).trim();if(!this.normalizeTitle(x,10,!0).valid)throw i.pop(),new SyntaxError("Invalid template name");let v=new U(e,"template-name",n,i,{});super.insertAt(v)}typeof s=="number"&&(i[s]=void 0);let p=this.isTemplate(),h=1;for(let[x,v]of t.entries())p||this.name==="switch"&&x>0||this.name==="tag"&&x>1||(v[0]=v.join("="),v.length=1),v.length===1&&(v.unshift(h),h++),this.insertAt(new Vr(...v,n,i));this.seal("modifier")}get type(){return m(this,xr)}setModifier(e){let{parserFunction:[,,t,n]}=this.getAttribute("config"),i=se(e).trim();if(e&&!i.endsWith(":"))return!1;let s=i.slice(0,-1).toLowerCase(),o=t.includes(s),l=n.includes(s);return m(this,st)&&o||!m(this,st)&&(l||e==="")||(Fe.running||this.length>1)&&(o||l||e==="")?(this.setAttribute("modifier",e),y(this,st,o),!!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"&&this.setAttribute("name",w(this,at,zn).call(this).title)}toString(e){return`{{${this.modifier}${this.type==="magic-word"?this.firstChild.toString(e)+(this.length===1?"":":")+this.childNodes.slice(1).map(t=>t.toString(e)).join("|"):super.toString(e,"|")}}}`}text(){let{childNodes:e,length:t,firstChild:n,modifier:i,type:s,name:o}=this;return s==="magic-word"&&o==="vardefine"?"":`{{${i}${s==="magic-word"?n.text()+(t===1?"":":")+me(e.slice(1),"|"):super.text("|")}}}`}getAttribute(e){switch(e){case"padding":return this.modifier.length+2;default:return super.getAttribute(e)}}getGaps(){return 1}lint(e=this.getAbsoluteIndex(),t){let n=super.lint(e,t);if(!this.isTemplate())return n;let{type:i,childNodes:s,length:o}=this,l=new L(this,e),u=i==="magic-word";if(u&&!w(this,at,zn).call(this).valid)n.push($(s[1],l,"invalid-invoke","illegal module name"));else{let d=s[u?1:0],c=d.childNodes.find(p=>p.type==="text"&&tr(p.data).includes("#"));if(c){let p=$(d,l,"no-ignored","useless fragment");p.fix={range:[p.startIndex+c.getRelativeIndex()+c.data.indexOf("#"),p.endIndex],text:"",desc:"remove"},n.push(p)}}if(u&&o===2)return n.push(E(this,l,"invalid-invoke","missing module function")),n;let g=this.getDuplicatedArgs().filter(([,d])=>!d[0].querySelector("ext"));if(g.length>0)for(let[,d]of g)n.push(...d.map(c=>{let p=$(c,l,"no-duplicate","duplicated parameter");return p.suggestions=[{desc:"remove",range:[p.startIndex-1,p.endIndex],text:""}],p}));return n}insertAt(e,t=this.length){return super.insertAt(e,t),e.anon?w(this,at,cs).call(this,e):e.name&&this.getArgs(e.name,!1,!1).add(e),e}getAllArgs(){return this.childNodes.filter(Rt("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,ot).has(i)?s=m(this,ot).get(i):(s=new Set(this.getAllArgs().filter(({name:o})=>i===o)),m(this,ot).set(i,s)),s}getDuplicatedArgs(){return[...m(this,ot)].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;switch(t){case"if":case"ifexist":case"ifexpr":case"iferror":i=2;break;case"ifeq":i=3;break;default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}let s=n.slice(i,i+2).map(({childNodes:[,o]})=>o);for(let o=0;o<s.length;){let{length:l,0:u}=s[o].childNodes.filter(g=>g.text().trim());if(l===0)s.splice(o,1);else if(l>1||u.type!=="magic-word")o++;else try{let g=u.getPossibleValues();s.splice(o,1,...g),o+=g.length}catch(g){o++}}return s}print(){let{childNodes:e,length:t,firstChild:n,modifier:i,type:s}=this;return`<span class="wpb-${s}">{{${ft(i)}${s==="magic-word"?n.print()+(t===1?"":":")+Le(e.slice(1),{sep:"|"}):Le(e,{sep:"|"})}}}</span>`}};xr=new WeakMap,st=new WeakMap,ot=new WeakMap,at=new WeakSet,zn=function(){let e=this.type==="template",t=this.childNodes[e?0:1];return this.normalizeTitle(t.toString(!0),e?10:828)},cs=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:o}=s,l=String(i+1);o!==l&&(s.setAttribute("name",l),this.getArgs(l,!1,!1).add(s))}}});var hs,Gn,Aa,lt,fs=A(()=>{"use strict";et();j();hs=[he()];lt=class extends(Aa=S){get type(){return"hidden"}};Gn=ue(Aa),lt=ce(Gn,0,"HiddenToken",hs,lt),pe(Gn,1,lt)});var Xr,xs,Qr,bs=A(()=>{"use strict";Y();M();ee();P();j();Pe();fs();Qr=class extends S{constructor(e,t=b.getConfig(),n=[]){super(void 0,t,n,{});T(this,Xr);for(let[i,s]of e.entries())if(i===0){let o=new U(s,"arg-name",t,n,{});super.insertAt(o)}else if(i>1){let o=new lt(s,t,n);super.insertAt(o)}else{let o=new S(s,t,n);o.type="arg-default",o.setAttribute("stage",2),super.insertAt(o)}}get type(){return"arg"}get default(){var e,t;return(t=(e=this.childNodes[1])==null?void 0:e.text())!=null?t:!1}toString(e){return`{{{${super.toString(e,"|")}}}}`}text(){return`{{{${me(this.childNodes.slice(0,2),"|")}}}}`}getAttribute(e){return e==="padding"?3:super.getAttribute(e)}getGaps(){return 1}afterBuild(){w(this,Xr,xs).call(this),super.afterBuild()}lint(e=this.getAbsoluteIndex(),t){let{childNodes:[n,i,...s]}=this;if(!this.getAttribute("include")){let l=E(this,{start:e},"no-arg","unexpected template argument");return i&&(l.suggestions=[{range:[e,l.endIndex],text:i.text(),desc:"expand"}]),[l]}let o=n.lint(e+3,t);if(i&&o.push(...i.lint(e+4+n.toString().length,t)),s.length>0){let l=new L(this,e);o.push(...s.map(u=>{let g=$(u,l,"no-ignored","invisible content inside triple braces");return g.startIndex--,g.startCol--,g.suggestions=[{desc:"remove",range:[g.startIndex,g.endIndex],text:""},{desc:"escape",range:[g.startIndex,g.startIndex+1],text:"{{!}}"}],g}))}return o}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}};Xr=new WeakSet,xs=function(){this.setAttribute("name",this.firstChild.toString(!0).trim())}});var ys={};ie(ys,{parseBraces:()=>br});var Sa,Ts,Un,wa,br,Kr=A(()=>{"use strict";Y();Hn();ms();bs();Sa={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},Ts=String.raw`|\{{2,}`,Un=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),wa=/\{\{\s*([^\s\0<>[\]{}|_#&%:.]+)\s*\}\}(?!\})/gu,br=(a,r,e)=>{var d,c,p,h,f,k;let t=String.raw`${(d=r.excludes)!=null&&d.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,n]}=r,i=[];a=a.replace(wa,(x,v)=>{var C;return new fr(x.slice(2,-2),[],r,e),`\0${e.length-2}${(C=Un.get(v.toLowerCase()))!=null?C:"t"}\x7F`});let s=a.lastIndexOf("}}")-a.length,o=s+a.length!==-1,l=new RegExp(t+(o?Ts:""),"gmu"),u=l.exec(a),g;for(;u||g!==void 0&&g<=a.length&&((p=(c=i[i.length-1])==null?void 0:c[0])!=null&&p.startsWith("="));){if(u!=null&&u[1]){let[,{length:W}]=u;u[0]=u[0].slice(W),u.index+=W}let{0:x,index:v}=u!=null?u:{0:`
|
|
7
|
+
`,index:a.length},C=(h=i.pop())!=null?h:{},{0:I,index:N,parts:O,findEqual:H,pos:q}=C,V=x==="="&&H,F=W=>{O[O.length-1].push(W.slice(q,v))};if(x==="]]"||x==="}-")g=v+2;else if(x===`
|
|
8
|
+
`){g=v+1;let{pos:W,findEqual:_}=(f=i[i.length-1])!=null?f:{};if(W===void 0||_||se(a.slice(W,N))!==""){let Q=/^(={1,6})(.+)\1((?:\s|\0\d+[cn]\x7F)*)$/u.exec(a.slice(N,v));Q&&(a=`${a.slice(0,N)}\0${e.length}h\x7F${a.slice(v)}`,g=N+4+String(e.length).length,new Pt(Q[1].length,Q.slice(2),r,e))}}else if(x==="|"||V)g=v+1,F(a),x==="|"&&O.push([]),C.pos=g,C.findEqual=x==="|",i.push(C);else if(x.startsWith("}}")){let W=x.slice(0,Math.min(I.length,3)),_=I.length-W.length,{length:Q}=e;g=v+W.length,F(a);let R=!1,Se="t";if(W.length===3){let re=O.map(Je=>Je.join("=")),ge=re.length>1&&se(re[1]).trim();new Qr(re,r,e),ge&&ge.endsWith(":")&&n.includes(ge.slice(0,-1).toLowerCase())&&(Se="s")}else try{new fr(O[0][0],O.slice(1),r,e);let re=se(O[0][0]).trim();Un.has(re.toLowerCase())?Se=Un.get(re.toLowerCase()):/^(?:filepath|(?:full|canonical)urle?):./iu.test(re)?Se="m":/^#vardefine:./iu.test(re)&&(Se="n")}catch(re){if(re instanceof SyntaxError&&re.message==="Invalid template name")R=!0;else throw re}R||(a=`${a.slice(0,N+_)}\0${Q}${Se}\x7F${a.slice(g)}`,g=N+_+3+String(Q).length,_>1?i.push({0:I.slice(0,_),index:N,pos:N+_,parts:[[]]}):_===1&&a[N-1]==="-"&&i.push({0:"-{",index:N-1,pos:N+1,parts:[[]]}))}else g=v+x.length,x.startsWith("{")&&(u.pos=g,u.parts=[[]]),i.push(..."0"in C?[C]:[],u);let D=i[i.length-1];if(o&&s+a.length<g)for(o=!1;(k=D==null?void 0:D[0])!=null&&k.startsWith("{");)i.pop(),D=i[i.length-1];l=new RegExp(t+(o?Ts:"")+(D?`|${Sa[D[0][0]]}${D.findEqual?"|=":""}`:""),"gmu"),l.lastIndex=g,u=l.exec(a)}return a}});var Jr,ks=A(()=>{"use strict";mr();Kr();P();Wn();Jr=class extends Lt{constructor(r,e,t=b.getConfig(),n=[]){let i=Symbol("InputboxToken"),{length:s}=n;n.push(i),e&&(e=it(e,t,n,r)),e&&(e=br(e,t,n)),n.splice(s,1),super(r,e,t,n,{})}}});function vs(a,r,e,t,n){r=r.trim();let i=r.replace(a==="link"?/\0\d+[tq]\x7F/gu:/\0\d+t\x7F/gu,"").trim();switch(a){case"width":return!i&&!!r||/^(?:\d+x?|\d*x\d+)(?:\s*px)?$/u.test(i);case"link":{if(!i)return r;let s=new RegExp(String.raw`^(?:${e.protocol}|//|\0\d+m\x7F)`,"iu"),o=new RegExp(String.raw`^(?:(?:${e.protocol}|//)${Ie}|\0\d+m\x7F)${Ee}$`,"iu");if(s.test(i))return o.test(i)&&r;i.startsWith("[[")&&i.endsWith("]]")&&(i=i.slice(2,-2));let l=b.normalizeTitle(i,0,!1,e,t,!0,!0);return l.valid&&l}case"lang":return(n==="svg"||n==="svgz")&&!/[^a-z\d-]/u.test(i);case"alt":case"class":case"manualthumb":return!0;case"page":return(n==="djvu"||n==="djv"||n==="pdf")&&Number(i)>0;default:return!!i&&!isNaN(i)}}var Ca,le,Yr,As,Zr,Ss=A(()=>{"use strict";Y();M();P();j();Ca=new Set(["alt","link","lang","page","caption"]);Zr=class extends S{constructor(e,t,n=b.getConfig(),i){var r=(...Kg)=>(super(...Kg),T(this,Yr),T(this,le,""),this);var u;let s,o=Object.entries(n.img).map(([g,d])=>{let c=new RegExp(String.raw`^(\s*(?!\s))${g.replace("$1","(.*)")}${g.endsWith("$1")?`(?=$|
|
|
9
|
+
)`:""}(\s*)$`,"u");return[g,d,c]}),l=o.find(([,g,d])=>(s=d.exec(e),s&&(s.length!==4||vs(g,s[2],n,!0,t)!==!1)));if(l&&s){s.length===3?(r(void 0,n,i),y(this,le,e)):(r(s[2],n,i,{}),y(this,le,s[1]+l[0]+s[3])),this.setAttribute("name",l[1]);return}r(e,{...n,excludes:[...(u=n.excludes)!=null?u:[],"list"]},i),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get type(){return"image-parameter"}get link(){return this.name==="link"?vs("link",super.text(),this.getAttribute("config")):void 0}afterBuild(){var e;((e=this.parentNode)==null?void 0:e.type)==="gallery-image"&&!Ca.has(this.name)&&this.setAttribute("name","invalid"),super.afterBuild()}toString(e){return m(this,le)?m(this,le).replace("$1",super.toString(e)):super.toString(e)}text(){return m(this,le)?m(this,le).replace("$1",super.text()).trim():super.text().trim()}getAttribute(e){return e==="plain"?this.name==="caption":e==="padding"?Math.max(0,m(this,le).indexOf("$1")):super.getAttribute(e)}lint(e=this.getAbsoluteIndex(),t){let n=super.lint(e,t),{link:i,name:s}=this;if(s==="invalid"){let o=E(this,{start:e},"invalid-gallery","invalid image parameter");o.fix={range:[e-1,o.endIndex],text:"",desc:"remove"},n.push(o)}else if(typeof i=="object"&&i.encoded){let o=E(this,{start:e},"url-encoding","unnecessary URL encoding in an internal link");o.suggestions=[{desc:"decode",range:[e,o.endIndex],text:Me(this.text())}],n.push(o)}return n}getValue(){return this.name==="invalid"?this.text():w(this,Yr,As).call(this)||super.text()}print(){return m(this,le)?`<span class="wpb-image-parameter">${m(this,le).replace("$1",`<span class="wpb-image-caption">${Le(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}};le=new WeakMap,Yr=new WeakSet,As=function(){return m(this,le)&&!m(this,le).includes("$1")}});var ws,Cs,$s,$a,Bt,Vn=A(()=>{"use strict";Y();M();ee();P();ur();Ss();ws=new Map([["manualthumb","Thumb"],["frameless","Frameless"],["framed","Frame"],["thumbnail","Thumb"]]),Cs=new Set(["left","right","center","none"]),$s=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),$a=(a,r,e,t)=>{if(t===void 0)return[];let n=new RegExp(`${[a,r,e].map(ji).join("|")}`,"gu"),i=[],s=n.exec(t),o=0,l=0;for(;s;){let{0:u,index:g}=s;u!==e?o+=u===a?1:-1:o===0&&(i.push(t.slice(l,g)),{lastIndex:l}=n),s=n.exec(t)}return i.push(t.slice(l)),i},Bt=class extends Ce{get type(){return"file"}get extension(){return this.getTitle().extension}constructor(r,e,t=b.getConfig(),n=[],i="|"){super(r,void 0,t,n,i);let{extension:s}=this.getTitle(!0);this.append(...$a("-{","}-","|",e).map(o=>new Zr(o,s,t,n)))}lint(r=this.getAbsoluteIndex(),e){var p;let t=super.lint(r,e),n=this.getAllArgs().filter(({childNodes:h})=>{let f=h.filter(k=>k.text().trim());return f.length!==1||f[0].type!=="arg"}),i=[...new Set(n.map(({name:h})=>h))],s=i.filter(h=>ws.has(h)),o=i.filter(h=>Cs.has(h)),l=i.filter(h=>$s.has(h)),[u]=s,g=u==="framed"||u==="manualthumb",d=new L(this,r);if(this.closest("ext-link-text")&&((p=this.getValue("link"))==null?void 0:p.trim())!==""&&t.push(E(this,d,"nested-link","internal link in an external link")),g)for(let h of n.filter(({name:f})=>f==="width")){let f=$(h,d,"invalid-gallery","invalid image parameter");f.fix={range:[f.startIndex-1,f.endIndex],text:"",desc:"remove"},t.push(f)}if(n.length===i.length&&s.length<2&&o.length<2&&l.length<2)return t;let c=(h,f)=>k=>{let x=$(k,d,"no-duplicate",b.msg(`${h} image $1 parameter`,f));return x.suggestions=[{desc:"remove",range:[x.startIndex-1,x.endIndex],text:""}],x};for(let h of i){if(h==="invalid"||h==="width"&&g)continue;let f=n.filter(({name:k})=>k===h);h==="caption"&&(f=[...f.slice(0,-1).filter(k=>k.text()),...f.slice(-1)]),f.length>1&&t.push(...f.map(c("duplicated",h)))}return s.length>1&&t.push(...n.filter(({name:h})=>ws.has(h)).map(c("conflicting","frame"))),o.length>1&&t.push(...n.filter(({name:h})=>Cs.has(h)).map(c("conflicting","horizontal-alignment"))),l.length>1&&t.push(...n.filter(({name:h})=>$s.has(h)).map(c("conflicting","vertical-alignment"))),t}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()}}});var jt,Qn=A(()=>{"use strict";M();P();j();Vn();jt=class extends Bt{constructor(e,t,n,i=b.getConfig(),s=[]){let o;if(n!==void 0){let{length:l}=s;o=new S(n,i,s);for(let u=1;u<11;u++)o.parseOnce();s.splice(l,1)}super(t,o==null?void 0:o.toString(),i,s);te(this,"privateType","imagemap-image");this.setAttribute("bracket",!1),this.privateType=`${e}-image`,this.seal("privateType",!0)}get type(){return this.privateType}getTitle(){let e=this.type==="imagemap-image";return this.normalizeTitle(this.firstChild.toString(),e?0:6,!0,!e)}getAttribute(e){return e==="padding"?0:super.getAttribute(e)}lint(e=this.getAbsoluteIndex(),t){let n=super.lint(e,t),{ns:i,interwiki:s}=this.getAttribute("title");if(s||i!==6){let o=E(this,{start:e},"invalid-gallery","invalid gallery image");o.suggestions=[{desc:"prefix",range:[e,e],text:"File:"}],n.push(o)}return n}}});var tn,Ns,en,Is=A(()=>{"use strict";P();j();Qn();Ue();en=class extends S{constructor(e,t=b.getConfig(),n=[]){var i;super(void 0,t,n,{});T(this,tn);for(let s of(i=e==null?void 0:e.split(`
|
|
10
|
+
`))!=null?i:[]){let o=/^([^|]+)(?:\|(.*))?/u.exec(s);if(!o){super.insertAt(s.trim()?new K(s,t,n):s);continue}let[,l,u]=o;w(this,tn,Ns).call(this,l)?super.insertAt(new jt("gallery",l,u,t,n)):super.insertAt(new K(s,t,n))}}get type(){return"ext-inner"}toString(e){return super.toString(e,`
|
|
11
|
+
`)}text(){return super.text(`
|
|
12
|
+
`).replace(/\n\s*\n/gu,`
|
|
13
|
+
`)}getGaps(){return 1}lint(e=this.getAbsoluteIndex(),t){let{top:n,left:i}=this.getRootNode().posFromIndex(e),s=[];for(let[o,l]of this.childNodes.entries()){let u=l.toString(),{length:g}=u,d=u.trim(),c=n+o,p=o?0:i;if(l.type==="noinclude"&&d&&!/^<!--.*-->$/u.test(d)){let h=e+g;s.push({rule:"no-ignored",message:b.msg("invalid content in <$1>","gallery"),severity:d.startsWith("|")?"warning":"error",startIndex:e,endIndex:h,startLine:c,endLine:c,startCol:p,endCol:p+g,suggestions:[{desc:"remove",range:[e,h],text:""},{desc:"comment",range:[e,h],text:`<!--${u}-->`}]})}else l.type!=="noinclude"&&l.type!=="text"&&s.push(...l.lint(e,t));e+=g+1}return s}print(){return super.print({sep:`
|
|
14
|
+
`})}};tn=new WeakSet,Ns=function(e){return this.normalizeTitle(e,6,!0,!0).valid}});var qt,Xn=A(()=>{"use strict";M();ur();qt=class extends Ce{get type(){return"link"}lint(r=this.getAbsoluteIndex(),e){let t=super.lint(r,e);return this.closest("ext-link-text")&&t.push(E(this,{start:r},"nested-link","internal link in an external link")),t}}});var Na,Ia,Tr,Re,rn=A(()=>{"use strict";M();Y();ee();P();j();Na=String.raw`(?:[${ye}\t]| |�*160;|&#[xX]0*[aA]0;)`,Ia=new RegExp(`${Na}+`,"gu"),Re=class extends S{constructor(e,t="free-ext-link",n=b.getConfig(),i){super(e,n,i,{});T(this,Tr);y(this,Tr,t)}get type(){return m(this,Tr)}get innerText(){let e=new Map([["!","|"],["=","="]]),t=me(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(Ia," ")),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:qi(e)}lint(e=this.getAbsoluteIndex(),t){let n=super.lint(e,t),i=new L(this,e);if(this.type==="magic-link"){let{link:u}=this;if(u.startsWith("ISBN")){let g=[...u.slice(5)].map(d=>d==="X"?10:Number(d));(g.length===10&&g.reduce((d,c,p)=>d+c*(10-p),0)%11||g.length===13&&(g[12]===10||g.reduce((d,c,p)=>d+c*(p%2?3:1),0)%10))&&n.push(E(this,i,"invalid-isbn","invalid ISBN"))}return n}let s=this.type==="ext-link-url",o=s?/\|/u:/[,;。:!?()]+/u,l=this.childNodes.find(u=>u.type==="text"&&o.test(u.data));if(l){let{data:u}=l,g=$(l,i,"unterminated-url",b.msg("$1 in URL",s?'"|"':"full-width punctuation"),"warning"),{index:d,0:c}=o.exec(u),p=g.startIndex+d;g.suggestions=s?[{desc:"whitespace",range:[p,p+1],text:" "}]:[{desc:"whitespace",range:[p,p],text:" "},{desc:"escape",range:[p,p+c.length],text:encodeURI(c)}],n.push(g)}return n}};Tr=new WeakMap});var Be,Ot,Kn=A(()=>{"use strict";M();P();j();rn();Ot=class extends S{constructor(e,t="",n="",i=b.getConfig(),s=[]){super(void 0,i,s,{});T(this,Be);let o=e&&/^\0\d+f\x7F$/u.test(e)?s[Number(e.slice(1,-2))]:new Re(e,"ext-link-url",i,s);if(this.insertAt(o),y(this,Be,t),n){let l=new S(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,Be)}]`:`[${super.toString(e,m(this,Be))}]`}text(){return`[${super.text(" ")}]`}getAttribute(e){return e==="padding"?1:super.getAttribute(e)}getGaps(){return m(this,Be).length}lint(e=this.getAbsoluteIndex(),t){let n=super.lint(e,t);return this.length===1&&this.closest("heading-title")&&n.push(E(this,{start:e},"var-anchor","variable anchor in a section header")),n}print(){return super.print(this.length===1?{pre:"[",post:`${m(this,Be)}]`}:{pre:"[",sep:m(this,Be),post:"]"})}};Be=new WeakMap});var yr,Es=A(()=>{"use strict";P();j();Ue();Xn();Kn();yr=class extends S{get type(){return"imagemap-link"}constructor(r,e,t,n=b.getConfig(),i=[]){super(void 0,n,i),this.append(r,e.length===2?new qt(...e,n,i):new Ot(...e,n,i),new K(t,n,i))}}});var nn,Ls=A(()=>{"use strict";M();we();ee();P();j();Ue();Qn();Es();nn=class extends S{get type(){return"ext-inner"}get image(){return this.childNodes.find(Rt("imagemap-image"))}constructor(r,e=b.getConfig(),t=[]){if(super(void 0,e,t,{}),!r)return;let n=r.split(`
|
|
15
|
+
`),i=new Set(e.protocol.split("|")),s=K,o=!0,l=!1;for(let u of n){let g=u.trim();if(!(l||!g||g.startsWith("#"))){if(o){let d=u.indexOf("|"),c=d===-1?u:u.slice(0,d),p=this.normalizeTitle(c,0,!0);if(p.valid&&!p.interwiki&&p.ns===6){let h=new jt("imagemap",c,d===-1?void 0:u.slice(d+1),e,t);super.insertAt(h),o=!1;continue}else l=!0}else if(u.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(u);continue}else if(u.includes("[")){let d=u.indexOf("["),c=u.slice(d),p=/^\[\[([^|]+)(?:\|([^\]]+))?\]\][\w\s]*$/u.exec(c);if(p){if(this.normalizeTitle(p[1],0,!0,!1,!0).valid){super.insertAt(new yr(u.slice(0,d),p.slice(1),c.slice(c.indexOf("]]")+2),e,t));continue}}else if(i.has(c.slice(1,c.indexOf(":")+1))||i.has(c.slice(1,c.indexOf("//")+2))){let h=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(c);if(h){super.insertAt(new yr(u.slice(0,d),h.slice(1),c.slice(c.indexOf("]")+1),e,t));continue}}}}super.insertAt(new s(u,e,t))}}toString(r){return super.toString(r,`
|
|
16
|
+
`)}text(){return super.text(`
|
|
17
|
+
`).replace(/\n{2,}/gu,`
|
|
18
|
+
`)}getGaps(){return 1}lint(r=this.getAbsoluteIndex(),e){let t=super.lint(r,e),n=new L(this,r);return this.image?t.push(...this.childNodes.filter(i=>{let s=i.toString().trim();return i.type==="noinclude"&&s&&!s.startsWith("#")}).map(i=>{let s=$(i,n,"invalid-imagemap","invalid link in <imagemap>");return s.suggestions=[{desc:"remove",range:[s.startIndex-1,s.endIndex],text:""},{desc:"comment",range:[s.startIndex,s.startIndex],text:"# "}],s})):t.push(E(this,n,"invalid-imagemap","<imagemap> without an image")),t}print(){return super.print({sep:`
|
|
19
|
+
`})}}});var sn,Fs=A(()=>{"use strict";M();P();Ge();sn=class extends oe{get type(){return"ext-inner"}lint(r=this.getAbsoluteIndex()){let{name:e,firstChild:{data:t}}=this;if((e==="templatestyles"||e==="section")&&t){let i=E(this,{start:r},"void-ext",b.msg("nothing should be in <$1>",e));return i.fix={range:[r,i.endIndex],text:"",desc:"empty"},[i]}let n=new RegExp(String.raw`<\s*(?:/\s*)${e==="nowiki"?"":"?"}(${e})\b`,"giu");return super.lint(r,n)}}});var on={};ie(on,{NestedToken:()=>Jn});var Ea,kr,Dt,Jn,an=A(()=>{"use strict";M();ee();mr();Kr();P();j();Zn();Ue();Ea=new Set(["comment","include","arg","template","magic-word"]),Jn=class extends S{constructor(e,t,n,i=b.getConfig(),s=[]){if(typeof t=="boolean"){let o=Symbol("InputboxToken"),{length:l}=s;s.push(o),e&&(e=it(e,i,s,t)),e&&(e=br(e,i,s)),s.splice(l,1)}else e&&(e=e.replace(t,(o,l,u,g,d)=>{let c=`\0${s.length+1}e\x7F`;return new _t(l,u,g,d,i,!1,s),c}));e&&(e=e.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(o,l,u)=>(new K(u,i,s),`${l}\0${s.length}n\x7F`)));super(e,i,s);T(this,kr);T(this,Dt);y(this,kr,[...n]),y(this,Dt,t)}get type(){return"ext-inner"}lint(e=this.getAbsoluteIndex(),t){let n=new L(this,e),i=m(this,Dt)?"includeonly":"noinclude",s=typeof m(this,Dt)=="boolean"?new RegExp(String.raw`^(?:<${i}(?:\s[^>]*)?/?>|</${i}\s*>)$`,"iu"):/^<!--[\s\S]*-->$/u;return[...super.lint(e,t),...this.childNodes.filter(o=>{if(o.type==="ext")return!m(this,kr).includes(o.name);if(Ea.has(o.type))return!1;let l=o.toString().trim();return l&&!s.test(l)}).map(o=>{let l=$(o,n,"no-ignored",b.msg("invalid content in <$1>",this.name));return l.suggestions=[{desc:"remove",range:[l.startIndex,l.endIndex],text:""},{desc:"comment",range:[l.startIndex,l.endIndex],text:`<!--${o.toString()}-->`}],l})]}};kr=new WeakMap,Dt=new WeakMap});var Ps,_t,Zn=A(()=>{"use strict";M();ee();P();j();qn();zr();us();Wn();ks();Is();Ls();Fs();Ps=(a,r)=>{let e=new Set(a);return e.delete(r),[...e]},_t=class extends $t{get type(){return"ext"}constructor(r,e,t,n,i=b.getConfig(),s=!1,o=[]){var c;let l=r.toLowerCase(),u=new Xe(!e||/^\s/u.test(e)?e:` ${e}`,"ext-attrs",l,i,o),g={...i,ext:Ps(i.ext,l),excludes:[...(c=i.excludes)!=null?c:[]]},d;switch(g.inExt=!0,l){case"tab":g.ext=Ps(g.ext,"tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":l==="poem"&&g.excludes.push("heading"),d=new S(t,g,o);break;case"pre":d=new Gr(t,g,o);break;case"dynamicpagelist":d=new Lt(s,t,g,o);break;case"inputbox":g.excludes.push("heading"),d=new Jr(s,t,g,o);break;case"references":{let{NestedToken:p}=(an(),Z(on));g.excludes.push("heading"),d=new p(t,s,["ref"],g,o);break}case"choose":{let{NestedToken:p}=(an(),Z(on));d=new p(t,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],g,o);break}case"combobox":{let{NestedToken:p}=(an(),Z(on));d=new p(t,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],g,o);break}case"gallery":d=new en(t,g,o);break;case"imagemap":d=new nn(t,g,o);break;default:d=new sn(t,g,o)}d.setAttribute("name",l),d.type==="plain"&&(d.type="ext-inner"),super(r,u,d,n,i,o),this.seal("closed",!0)}lint(r=this.getAbsoluteIndex(),e){let t=super.lint(r,e),n=new L(this,r);return this.name!=="nowiki"&&this.closest("html-attrs,table-attrs")&&t.push(E(this,n,"parsing-order","extension tag in HTML tag attributes")),this.name==="ref"&&this.closest("heading-title")&&t.push(E(this,n,"var-anchor","variable anchor in a section header")),t}}});var Rs,Yn,La,dt,Bs=A(()=>{"use strict";M();et();P();Ge();Rs=[he(!1)];dt=class extends(La=oe){constructor(e,t,n,i){super(e,n,i);te(this,"closed");this.closed=t}get type(){return"comment"}getAttribute(e){return e==="padding"?4:super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){if(this.closed)return[];let t=E(this,{start:e},"unclosed-comment",b.msg("unclosed $1","HTML comment"));return t.suggestions=[{range:[t.endIndex,t.endIndex],text:"-->",desc:"close"}],[t]}toString(e){return e?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"<!--",post:this.closed?"-->":""})}};Yn=ue(La),dt=ce(Yn,0,"CommentToken",Rs,dt),pe(Yn,1,dt)});var Os={};ie(Os,{parseCommentAndExt:()=>it});var qs,Fa,ei,js,it,mr=A(()=>{"use strict";Yi();Ue();ts();Zn();Bs();qs="<onlyinclude>",Fa="</onlyinclude>",{length:ei}=qs,js=a=>{let r=a.indexOf(qs);return{i:r,j:a.indexOf(Fa,r+ei)}},it=(a,r,e,t)=>{if(t){let{i:l,j:u}=js(a);if(l!==-1&&u!==-1){let g="",d=c=>{new K(c,r,e),g+=`\0${e.length-1}n\x7F`};for(;l!==-1&&u!==-1;){let c=`\0${e.length}e\x7F`;new Or(a.slice(l+ei,u),r,e),l>0&&d(a.slice(0,l)),g+=c,a=a.slice(u+ei+1),{i:l,j:u}=js(a)}return a&&d(a),g}}let n=r.ext.join("|"),i=t?"includeonly":"(?:no|only)include",s=t?"noinclude":"includeonly",o=new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${i}(?:\s[^>]*)?/?>|</${i}\s*>|<(${n})(\s[^>]*?)?(?:/>|>([\s\S]*?)</(\1\s*)>)|<(${s})(\s[^>]*?)?(?:/>|>([\s\S]*?)(?:</(${s}\s*)>|$))`,"giu");return a.replace(o,(l,u,g,d,c,p,h,f,k)=>{let x=e.length,v="n";if(u)v="e",new _t(u,g,d,c,r,p,e);else if(l.startsWith("<!--")){v="c";let C=l.endsWith("-->");new dt(l.slice(4,C?-3:void 0),C,r,e)}else p?new nt(p,h,f,k,r,e):new K(l,r,e);return`\0${x}${v}\x7F`})}});var Pa,Ra,Ba,Mt,xe,Ke,ln,Ds=A(()=>{"use strict";M();Y();ee();j();Pa=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),Ra=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"]),Ba=new Set(["strike","big","center","font","tt"]),ln=class extends S{constructor(e,t,n,i,s,o){super(void 0,s,o);T(this,Mt);T(this,xe);T(this,Ke);this.insertAt(t),this.setAttribute("name",e.toLowerCase()),y(this,Mt,n),y(this,xe,i),y(this,Ke,e)}get type(){return"html"}get selfClosing(){return m(this,xe)}get closing(){return m(this,Mt)}toString(e){return`<${this.closing?"/":""}${m(this,Ke)}${super.toString(e)}${m(this,xe)?"/":""}>`}text(){let{closing:e}=this,t=m(this,Ke)+(e?"":super.text());return`<${e?"/":""}${t}${m(this,xe)?"/":""}>`}getAttribute(e){return e==="padding"?m(this,Ke).length+(this.closing?2:1):super.getAttribute(e)}lint(e=this.getAbsoluteIndex(),t){var s;let n=super.lint(e,t),i=new L(this,e);if(this.name==="h1"&&!this.closing){let o=E(this,i,"h1","<h1>");o.suggestions=[{desc:"h2",range:[e+2,e+3],text:"2"}],n.push(o)}if(this.closest("table-attrs")){let o=E(this,i,"parsing-order","HTML tag in table attributes");o.fix={desc:"remove",range:[e,o.endIndex],text:""},n.push(o)}try{this.findMatchingTag()}catch(o){if(o instanceof SyntaxError){let{message:l}=o,u=l.split(":",1)[0].toLowerCase(),g=E(this,i,"unmatched-tag",u),d={desc:"no self-closing",range:[g.endIndex-2,g.endIndex-1],text:""};switch(u){case"unclosed tag":{let c=(s=this.parentNode)==null?void 0:s.childNodes;Ra.has(this.name)&&(c!=null&&c.slice(0,c.indexOf(this)).some(({type:p,name:h})=>p==="html"&&h===this.name))?g.suggestions=[{desc:"close",range:[e+1,e+1],text:"/"}]:this.closest("heading-title")||(g.severity="warning");break}case"unmatched closing tag":{let c=this.closest("magic-word");c&&Pa.has(c.name)?g.severity="warning":g.suggestions=[{desc:"remove",range:[e,g.endIndex],text:""}];break}case"tag that is both closing and self-closing":{let{html:[c,,p]}=this.getAttribute("config"),h={desc:"open",range:[e+1,e+2],text:""};p.includes(this.name)?g.fix=h:c.includes(this.name)?g.fix=d:g.suggestions=[h,d];break}case"invalid self-closing tag":g.suggestions=[d,{desc:"close",range:[g.endIndex-2,g.endIndex],text:`></${this.name}>`}]}n.push(g)}}return Ba.has(this.name)&&n.push(E(this,i,"obsolete-tag","obsolete HTML tag","warning")),(this.name==="b"||this.name==="strong")&&this.closest("heading-title")&&n.push(E(this,i,"bold-header","bold in section header","warning")),n}findMatchingTag(){let{html:[e,t,n]}=this.getAttribute("config"),{name:i,parentNode:s,closing:o}=this,l=Oi(this.toString());if(o&&(m(this,xe)||n.includes(i)))throw new SyntaxError(`Tag that is both closing and self-closing: ${l}`);if(n.includes(i)||m(this,xe)&&t.includes(i))return this;if(m(this,xe)&&e.includes(i))throw new SyntaxError(`Invalid self-closing tag: ${l}`);if(!s)return;let{childNodes:u}=s,g=u.indexOf(this),d=o?u.slice(0,g).reverse():u.slice(g+1),c=o?-1:1;for(let p of d)if(!(!p.is("html")||p.name!==i)&&(m(p,Mt)?c--:c++,c===0))return p;throw new SyntaxError(`${o?"Unmatched closing":"Unclosed"} tag: ${l}`)}print(){return super.print({pre:`<${this.closing?"/":""}${m(this,Ke)}`,post:`${m(this,xe)?"/":""}>`})}json(){let e=super.json();return Object.assign(e,{closing:this.closing,selfClosing:m(this,xe)}),e}};Mt=new WeakMap,xe=new WeakMap,Ke=new WeakMap});var _s={};ie(_s,{parseHtml:()=>qa});var ja,qa,Ms=A(()=>{"use strict";zr();Ds();ja=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,qa=(a,r,e)=>{var s;let{html:t}=r;(s=r.htmlElements)!=null||(r.htmlElements=new Set([...t[0],...t[1],...t[2]]));let n=a.split("<"),i=n.shift();for(let o of n){let l=ja.exec(o),u=l==null?void 0:l[2],g=u==null?void 0:u.toLowerCase();if(!l||!r.htmlElements.has(g)){i+=`<${o}`;continue}let[,d,,c="",p,h]=l,{length:f}=e,k=new Xe(c,"html-attrs",g,r,e),x=k.getAttr("itemprop");if(g==="meta"&&(x===void 0||k.getAttr("content")===void 0)||g==="link"&&(x===void 0||k.getAttr("href")===void 0)){i+=`<${o}`,e.length=f;continue}i+=`\0${e.length}x\x7F${h}`,new ln(u,k,d==="/",p==="/>",r,e)}return i}});var Ws,zs=A(()=>{"use strict";we();Ws=(a=0)=>(r,e)=>{var n,Hs;class t extends r{constructor(){super(...arguments);T(this,n)}getAttr(l){return m(this,n,Hs).getAttr(l)}}return n=new WeakSet,Hs=function(){return this.childNodes[a]},jr(t,r),t}});var Wt,ti=A(()=>{"use strict";zs();P();j();St();zr();Wt=class extends Ws(1)(S){constructor(r,e,t,n,i=b.getConfig(),s=[],o){super(void 0,i,s,o),this.append(new fe(e,r,"table-syntax",i,s,{}),new Xe(n,"table-attrs",t,i,s))}}});var be,vr,Ar,ri,gt,ni=A(()=>{"use strict";M();ee();P();j();ti();gt=class extends Wt{constructor(e,t,n=b.getConfig(),i=[]){var u;let s=/\||\0\d+!\x7F/u.exec(t!=null?t:""),o=s?t.slice(0,s.index):"";/\[\[|-\{/u.test(o)&&(s=null,o="");super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",o,n,i);T(this,Ar);T(this,be,"");T(this,vr);s&&([Fr(this,be)._]=s);let l=new S(t==null?void 0:t.slice(((u=s==null?void 0:s.index)!=null?u:NaN)+m(this,be).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 w(this,Ar,ri).call(this).subtype}afterBuild(){m(this,be).includes("\0")&&y(this,be,this.buildFromStr(m(this,be),0)),super.afterBuild()}toString(e){let{childNodes:[t,n,i]}=this;return t.toString(e)+n.toString(e)+m(this,be)+i.toString(e)}text(){let{childNodes:[e,t,n]}=this;return e.text()+t.text()+m(this,be)+n.text()}getGaps(e){return e===1?m(this,be).length:0}lint(e=this.getAbsoluteIndex(),t){let n=super.lint(e,t),i=new L(this,e+this.getRelativeIndex(this.length-1));for(let s of this.lastChild.childNodes)if(s.type==="text"){let{data:o}=s;if(o.includes("|")){let l=o.includes("||"),u=$(s,i,"pipe-like",'additional "|" in a table cell',l?"error":"warning");if(l){let g={caption:"|+",td:"|",th:"!"}[this.subtype];u.fix={range:[u.startIndex,u.endIndex],text:o.replace(/\|\|/gu,`
|
|
20
|
+
${g}`),desc:"newline"}}else u.suggestions=[{desc:"escape",range:[u.startIndex,u.endIndex],text:o.replace(/\|/gu,"|")}];n.push(u)}}return n}isIndependent(){return this.firstChild.text().startsWith(`
|
|
21
|
+
`)}getAttr(e){let t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}print(){let{childNodes:[e,t,n]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${m(this,be)}${n.print()}</span>`}json(){let e=super.json();return e.subtype=this.subtype,e}};be=new WeakMap,vr=new WeakMap,Ar=new WeakSet,ri=function(){return We(m(this,vr),()=>{var o;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{...w(o=i,Ar,ri).call(o)}},e=>{y(this,vr,e)})}});var Ht,ii=A(()=>{"use strict";M();ti();ni();Ht=class extends Wt{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=n.childNodes.find(l=>l.text().trim()),s=/^\s*(?:!|\{\{\s*![!-]?\s*\}\})/u;if(!i||s.test(i.toString())||i.is("arg")&&s.test(i.default||""))return t;if(i.is("magic-word"))try{if(i.getPossibleValues().every(l=>s.test(l.text())))return t}catch(l){}let o=$(n,{start:r},"fostered-content","content to be moved out from the table");return o.severity=i.type==="template"?"warning":"error",o.startIndex++,o.startLine++,o.startCol=0,t.push(o),t}getRowCount(){return Number(this.childNodes.some(r=>r instanceof gt&&r.isIndependent()&&!r.firstChild.text().endsWith("+")))}getNthCol(r,e){let t=0;for(let n of this.childNodes.slice(2))if(n instanceof gt&&(n.isIndependent()&&(t=+(n.subtype!=="caption")),r-=t,r<0))return n}}});var Oa,Da,_a,si,dn,Gs=A(()=>{"use strict";M();we();ee();P();ii();St();Oa=/^\n[^\S\n]*(?:\|\}|\{\{\s*!\s*\}\}\}|\{\{\s*!\)\s*\}\})$/u,Da=(a,r)=>new Array(a).fill(void 0).map((e,t)=>r(t)),_a=({type:a})=>a==="tr"||a==="table-syntax",si=class extends Array{},dn=class extends Ht{get type(){return"table"}get closed(){return this.lastChild.type==="table-syntax"}constructor(r,e,t,n){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,r,"table",e,t,n,{})}lint(r=this.getAbsoluteIndex(),e){let t=super.lint(r,e),n=new L(this,r);this.closed||t.push($(this.firstChild,n,"unclosed-table",b.msg("unclosed $1","table")));let i=this.getLayout(),{length:s}=i;if(s>1){let o=1,l=1/0,u=0;for(;u<s;u++){let g=i[u],d=g.length;if(d<o)break;d<l&&(l=d);let c=g.indexOf(g[d-1])+1;if(c>l)break;c>o&&(o=c)}if(u<s){let g=$(this.getNthRow(u),n,"table-layout","inconsistent table layout","warning");g.startIndex++,g.startLine++,g.startCol=0,t.push(g)}}return t}close(r=`
|
|
22
|
+
|}`,e){let t=this.getAttribute("config"),n=this.getAttribute("accum"),i=e?[r]:b.parse(r,this.getAttribute("include"),2,t).childNodes;Fe.run(()=>{let s=new fe(void 0,Oa,"table-syntax",t,n,{});super.insertAt(s)}),this.lastChild.replaceChildren(...i)}getLayout(r){let e=this.getAllRows(),{length:t}=e,n=new si(...Da(t,()=>[]));for(let[i,s]of n.entries()){let o=0,l=0,u;for(let g of e[i].childNodes.slice(2))if(g.type==="td"){if(g.isIndependent()&&(u=g.subtype!=="caption"),u){let d={row:i,column:o},{rowspan:c,colspan:p}=g;for(o++;s[l];)l++;for(let h=i;h<Math.min(i+c,t);h++)for(let f=l;f<l+p;f++)n[h][f]=d;l+=p}}else if(_a(g))break}return n}getAllRows(){return[...super.getRowCount()?[this]:[],...this.childNodes.slice(1).filter(r=>r.type==="tr"&&r.getRowCount()>0)]}getNthCell(r){var t;let e=r;return e&&((t=this.getNthRow(e.row,!1,!1))==null?void 0:t.getNthCol(e.column))}getNthRow(r,e,t){let n=super.getRowCount();if(r===0&&n)return this;n&&r--;for(let i of this.childNodes.slice(2))if(i.type==="tr"&&i.getRowCount()&&(r--,r<0))return i}json(){let r=super.json();return r.closed=this.closed,r}}});var gn,Us=A(()=>{"use strict";ii();gn=class extends Ht{get type(){return"tr"}constructor(r,e,t,n){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,r,"tr",e,t,n,{})}}});var zt,oi=A(()=>{"use strict";Ge();zt=class extends oe{}});var Gt,ai=A(()=>{"use strict";oi();Gt=class extends zt{get type(){return"dd"}}});var Qs={};ie(Qs,{parseTable:()=>Wa});var Ma,Vs,Wa,Xs=A(()=>{"use strict";j();Gs();Us();ni();ai();Ma=a=>a.lastChild.constructor!==S,Vs=(a,r)=>a.type==="td"?r.pop():a,Wa=({firstChild:{data:a},type:r,name:e},t,n)=>{let i=[],s=a.split(`
|
|
23
|
+
`),o=r==="root"||r==="parameter-value"||r==="ext-inner"&&e==="poem"?"":`
|
|
24
|
+
${s.shift()}`,l,u=(g,d)=>{if(!d){o+=g;return}let{lastChild:c}=d;if(Ma(d)){let p=new S(g,t,n);p.type="table-inter",p.setAttribute("stage",3),d.insertAt(p)}else c.setText(c.toString()+g)};for(let g of s){l=i.pop();let[d]=/^(?:\s|\0\d+[cno]\x7F)*/u.exec(g),c=g.slice(d.length),p=/^(:*)((?:\s|\0\d+[cn]\x7F)*)(\{\||\{(?:\0\d+[cn]\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(c);if(p){for(;l&&l.type!=="td";)l=i.pop();let[,C,I,N,O]=p;C&&new Gt(C,t,n),u(`
|
|
25
|
+
${d}${C&&`\0${n.length-1}d\x7F`}${I}\0${n.length}b\x7F`,l),i.push(...l?[l]:[],new dn(N,O,t,n));continue}else if(!l){o+=`
|
|
26
|
+
${g}`;continue}let h=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(c);if(!h){u(`
|
|
27
|
+
${g}`,l),i.push(l);continue}let[,f,k,x,v]=h;if(f){for(;l.type!=="table";)l=i.pop();l.close(`
|
|
28
|
+
${d}${f}`,!0),u(v,i[i.length-1])}else if(k){l=Vs(l,i),l.type==="tr"&&(l=i.pop());let C=new gn(`
|
|
29
|
+
${d}${k}`,v,t,n);i.push(l,C),l.insertAt(C)}else{l=Vs(l,i);let C=x==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu,I=C.exec(v),N=0,O=`
|
|
30
|
+
${d}${x}`,H=q=>{let V=new gt(O,v.slice(N,I==null?void 0:I.index),t,n);return q.insertAt(V),V};for(;I;)H(l),{lastIndex:N}=C,[O]=I,I=C.exec(v);i.push(l,H(l))}}return o.slice(1)}});var un,Ks=A(()=>{"use strict";Ge();un=class extends oe{get type(){return"hr"}}});var Js,li,Ha,ut,Zs=A(()=>{"use strict";et();P();Ge();Js=[he()];ut=class extends(Ha=oe){get type(){return"double-underscore"}constructor(r,e,t=b.getConfig(),n){super(r,t,n)}getAttribute(r){return r==="padding"?2:super.getAttribute(r)}toString(){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}};li=ue(Ha),ut=ce(li,0,"DoubleUnderscoreToken",Js,ut),pe(li,1,ut)});var Ys={};ie(Ys,{parseHrAndDoubleUnderscore:()=>za});var za,eo=A(()=>{"use strict";Ks();Zs();Hn();za=({firstChild:{data:a},type:r,name:e},t,n)=>{var l,u,g;let{doubleUnderscore:[i,s,o]}=t;return(l=t.insensitiveDoubleUnderscore)!=null||(t.insensitiveDoubleUnderscore=new Set(i)),(u=t.sensitiveDoubleUnderscore)!=null||(t.sensitiveDoubleUnderscore=new Set(s)),(g=t.regexHrAndDoubleUnderscore)!=null||(t.regexHrAndDoubleUnderscore=new RegExp(`__(${[...i,...s].join("|")})__`,"giu")),r!=="root"&&(r!=="ext-inner"||e!=="poem")&&(a=`\0${a}`),a=a.replace(/^((?:\0\d+[cno]\x7F)*)(-{4,})/gmu,(d,c,p)=>(new un(p,t,n),`${c}\0${n.length-1}r\x7F`)).replace(t.regexHrAndDoubleUnderscore,(d,c)=>{var k;let p=t.sensitiveDoubleUnderscore.has(c),h=c.toLowerCase(),f=t.insensitiveDoubleUnderscore.has(h);return p||f?(new ut(c,p,t,n),`\0${n.length-1}${f&&((k=o==null?void 0:o[h])!=null?k:h)==="toc"?"u":"n"}\x7F`):d}).replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(d,c,p,h,f)=>{let k=`${c}\0${n.length}h\x7F`;return new Pt(p.length,[h,f],t,n),k}),r==="root"||r==="ext-inner"&&e==="poem"?a:a.slice(1)}});var pn,to=A(()=>{"use strict";M();ee();P();Ge();pn=class extends oe{get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}text(){let{parentNode:r,innerText:e}=this;return(r==null?void 0:r.type)==="image-parameter"&&r.name!=="caption"?"":e}lint(r=this.getAbsoluteIndex()){let{previousSibling:e,nextSibling:t,bold:n}=this,i=b.msg('lonely "$1"',"'"),s=[],o=new L(this,r),l=(u,g,d)=>[{desc:"escape",range:[u,g],text:"'".repeat(d)},{desc:"remove",range:[u,g],text:""}];if((e==null?void 0:e.type)==="text"&&e.data.endsWith("'")){let u=E(this,o,"lonely-apos",i),{startIndex:g,startLine:d,startCol:c}=u,[,{length:p}]=/(?:^|[^'])('+)$/u.exec(e.data),h=r-p;s.push({...u,startIndex:h,endIndex:g,endLine:d,startCol:c-p,endCol:c,suggestions:l(h,g,p)})}if((t==null?void 0:t.type)==="text"&&t.data.startsWith("'")){let u=E(this,o,"lonely-apos",i),{endIndex:g,endLine:d,endCol:c}=u,[{length:p}]=/^'+/u.exec(t.data),h=g+p;s.push({...u,startIndex:g,endIndex:h,startLine:d,startCol:c,endCol:c+p,suggestions:l(g,h,p)})}if(n&&this.closest("heading-title")){let u=E(this,o,"bold-header","bold in section header","warning");u.suggestions=[{desc:"remove",range:[r,r+3],text:""}],s.push(u)}return s}json(){let r=super.json();return Object.assign(r,{bold:this.bold,italic:this.italic}),r}}});var ro={};ie(ro,{parseQuotes:()=>di});var di,gi=A(()=>{"use strict";to();di=(a,r,e)=>{var g;let t=a.split(/('{2,})/u),{length:n}=t;if(n===1)return a;let i=0,s=0,o,l,u;for(let d=1;d<n;d+=2){let c=t[d].length;switch(c){case 2:s++;break;case 4:t[d-1]+="'",t[d]="'''";case 3:if(i++,o!==void 0)break;t[d-1].endsWith(" ")?l===void 0&&u===void 0&&(u=d):t[d-1].slice(-2,-1)===" "?o=d:l!=null||(l=d);break;default:t[d-1]+="'".repeat(c-5),t[d]="'''''",s++,i++}}if(s%2===1&&i%2===1){let d=(g=o!=null?o:l)!=null?g:u;d!==void 0&&(t[d]="''",t[d-1]+="'")}for(let d=1;d<n;d+=2)new pn(t[d],r,e),t[d]=`\0${e.length-1}q\x7F`;return t.join("")}});var no={};ie(no,{parseExternalLinks:()=>ui});var ui,pi=A(()=>{"use strict";Y();Kn();rn();ui=(a,r,e,t)=>{var n;return(n=r.regexExternalLinks)!=null||(r.regexExternalLinks=new RegExp(String.raw`\[(\0\d+f\x7F|(?:(?:${r.protocol}|//)${Ie}|\0\d+m\x7F)${Ee}(?=[[\]<>"\t${ye}]|\0\d))([${ye}]*(?![${ye}]))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),a.replace(r.regexExternalLinks,(i,s,o,l)=>{let{length:u}=e,g=/&[lg]t;/u.exec(s);return g&&(o="",l=s.slice(g.index)+o+l,s=s.slice(0,g.index)),t?(new Re(s,"ext-link-url",r,e),`[\0${u}f\x7F${o}${l}]`):(new Ot(s,o,l,r,e),`\0${u}w\x7F`)})}});var cn,io=A(()=>{"use strict";ur();cn=class extends Ce{get type(){return"category"}}});var oo={};ie(oo,{parseLinks:()=>so});var Ga,so,ao=A(()=>{"use strict";P();gi();pi();Xn();Vn();io();Ga=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)([\s\S]*)$/u,so=(a,r,e)=>{var s;(s=r.regexLinks)!=null||(r.regexLinks=new RegExp(String.raw`^\s*(?:${r.protocol}|//)`,"iu"));let t=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,n=a.split("[["),i=n.shift();for(let o=0;o<n.length;o++){let l=!1,u,g,d,c,p=n[o],h=t.exec(p);if(h)[,u,g,d,c]=h,c.startsWith("]")&&(d!=null&&d.includes("["))&&(d+="]",c=c.slice(1));else{let N=Ga.exec(p);N&&(l=!0,[,u,g,d]=N)}if(u===void 0||r.regexLinks.test(u)||/\0\d+[exhbru]\x7F/u.test(u)){i+=`[[${p}`;continue}let f=u.trim().startsWith(":");if(f&&l){i+=`[[${p}`;continue}let k=b.normalizeTitle(u,0,!1,r,!0,!0,!0),{ns:x,valid:v,interwiki:C}=k;if(v){if(l){if(C||x!==6){i+=`[[${p}`;continue}let N=!1;for(o++;o<n.length;o++){let O=n[o],H=O.split("]]");if(H.length>2){N=!0,d+=`[[${H[0]}]]${H[1]}`,c=H.slice(2).join("]]");break}else if(H.length===2)d+=`[[${H[0]}]]${H[1]}`;else{d+=`[[${O}`;break}}if(d=so(d,r,e),!N){i+=`[[${u}${g}${d}`;continue}}}else{i+=`[[${p}`;continue}d&&(d=di(d,r,e));let I=qt;f||(!C&&x===6?(d&&(d=ui(d,r,e,!0)),I=Bt):!C&&x===14&&(I=cn)),d===void 0&&g&&(d=""),i+=`\0${e.length}l\x7F${c}`,new I(u,d,r,e,g)}return i}});var co={};ie(co,{parseMagicLinks:()=>Ua});var po,lo,go,uo,Ua,mo=A(()=>{"use strict";Y();rn();po=String.raw`[${ye}\t]| |�*160;|�*a0;`,lo=`(?:${po})+`,go=`(?:${po}|-)`,uo=String.raw`(?:RFC|PMID)${lo}\d+\b|ISBN${lo}(?:97[89]${go}?)?(?:\d${go}?){9}[\dx]\b`,Ua=(a,r,e)=>{if(!r.regexMagicLinks)try{r.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\d_])(?:(?:${r.protocol})(${Ie}${Ee})|${uo})`,"giu")}catch(t){r.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${r.protocol})(${Ie}${Ee})|${uo})`,"giu")}return a.replace(r.regexMagicLinks,(t,n,i)=>{let s=n?t.slice(n.length):t;if(i){let o="",l=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(s);l&&(o=s.slice(l.index),s=s.slice(0,l.index));let u=s.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,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),o=s.slice(g.index+d)+o,s=s.slice(0,g.index+d)}return o.length>=i.length?t:(new Re(s,void 0,r,e),`${n}\0${e.length-1}w\x7F${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(s))return t;return new Re(s,"magic-link",r,e),`${n}\0${e.length-1}i\x7F`})}});var ho,fo=A(()=>{"use strict";ho=(a,r)=>a.startsWith(r)?r.length:[...r].findIndex((e,t)=>e!==a[t])});var mn,xo=A(()=>{"use strict";oi();mn=class extends zt{get type(){return"list"}}});var bo={};ie(bo,{parseList:()=>Va});var Va,To=A(()=>{"use strict";fo();xo();ai();Va=(a,r,e,t)=>{let n=/^((?:\0\d+[cno]\x7F)*)([;:*#]+\s*)/u.exec(a);if(!n)return r.lastPrefix="",a;let[i,s,o]=n,l=o.replace(/;/gu,":"),u=ho(l,r.lastPrefix),g=(u>1?o.slice(u-1):o).split(/(?=;)/u),d=g[0].startsWith(";"),c=g.length-(d?0:1);if(u>1){let q=o.slice(0,u-1);d?g.unshift(q):g[0]=q+g[0]}r.lastPrefix=l;let p=s+g.map((q,V)=>`\0${t.length+V}d\x7F`).join("")+a.slice(i.length);for(let q of g)new mn(q,e,t);if(!c)return p;let{html:[h]}=e,f=/:+|-\{|\0\d+[xq]\x7F/gu,k=f,x=k.exec(p),v=0,C=!1,I=!1,N=0,O=(q,V)=>(new Gt(q,e,t),`${p.slice(0,V)}\0${t.length-1}d\x7F${p.slice(V+q.length)}`),H=q=>{q?v&&v--:v++};for(;x&&c;){let{0:q,index:V}=x;if(q==="-{"){if(!N){let{lastIndex:F}=k;k=/-\{|\}-/gu,k.lastIndex=F}N++}else if(q==="}-"){if(N--,!N){let{lastIndex:F}=k;k=f,k.lastIndex=F}}else if(q.endsWith("x\x7F")){let{name:F,closing:D,selfClosing:W}=t[Number(q.slice(1,-2))];(!W||h.includes(F))&&H(D)}else if(q.endsWith("q\x7F")){let{bold:F,italic:D}=t[Number(q.slice(1,-2))];F&&(H(C),C=!C),D&&(H(I),I=!I)}else if(v===0){if(q.length>=c)return O(q.slice(0,c),V);c-=q.length,k.lastIndex=V+4+String(t.length).length,p=O(q,V)}x=k.exec(p)}return p}});var yo,je,hn,ko=A(()=>{"use strict";M();ee();P();j();Pe();yo=new Set(["A","T","R","D","-","H","N"]),hn=class extends S{constructor(e,t=b.getConfig(),n=[]){super(void 0,t,n,{});T(this,je);this.append(...e.map(i=>new U(i,"converter-flag",t,n)))}get type(){return"converter-flags"}afterBuild(){y(this,je,this.childNodes.map(e=>e.text().trim())),super.afterBuild()}toString(e){return super.toString(e,";")}text(){return super.text(";")}getGaps(){return 1}getUnknownFlags(){return new Set(m(this,je).filter(e=>/\{{3}[^{}]+\}{3}/u.test(e)))}getVariantFlags(){let e=new Set(this.getAttribute("config").variants);return new Set(m(this,je).filter(t=>e.has(t)))}lint(e=this.getAbsoluteIndex(),t){let n=this.getVariantFlags(),i=this.getUnknownFlags(),s=new Set(m(this,je).filter(d=>yo.has(d))),o=m(this,je).filter(d=>!d).length,l=m(this,je).length-i.size-o,u=super.lint(e,t);if(n.size===l||s.size===l)return u;let g=new L(this,e);for(let[d,c]of this.childNodes.entries()){let p=c.text().trim();if(p&&!n.has(p)&&!i.has(p)&&(n.size>0||!s.has(p))){let h=$(c,g,"no-ignored","invalid conversion flag");n.size===0&&yo.has(p.toUpperCase())?h.fix={range:[h.startIndex,h.endIndex],text:p.toUpperCase(),desc:"uppercase"}:h.suggestions=[{desc:"remove",range:[h.startIndex-(d&&1),h.endIndex],text:""}],u.push(h)}}return u}print(){return super.print({sep:";"})}};je=new WeakMap});var Ut,vo=A(()=>{"use strict";P();j();Pe();Ut=class extends S{get type(){return"converter-rule"}constructor(r,e=!0,t=b.getConfig(),n=[]){super(void 0,t,n);let i=r.indexOf(":"),s=r.slice(0,i).indexOf("=>"),o=s===-1?r.slice(0,i):r.slice(s+2,i);e&&t.variants.includes(o.trim())?(super.insertAt(new U(o,"converter-rule-variant",t,n)),super.insertAt(new U(r.slice(i+1),"converter-rule-to",t,n)),s!==-1&&super.insertAt(new U(r.slice(0,s),"converter-rule-from",t,n),0)):super.insertAt(new U(r,"converter-rule-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(){let{childNodes:r}=this;if(r.length===3){let[e,t,n]=r;return`<span class="wpb-converter-rule">${e.print()}=>${t.print()}:${n.print()}</span>`}return super.print({sep:":"})}}});var fn,Ao=A(()=>{"use strict";Y();P();j();ko();vo();fn=class extends S{get type(){return"converter"}constructor(r,e,t=b.getConfig(),n=[]){super(void 0,t,n),this.append(new hn(r,t,n));let[i]=e,s=i.includes(":"),o=new Ut(i,s,t,n);s&&o.length===1||!s&&e.length===2&&!se(e[1]).trim()?this.insertAt(new Ut(e.join(";"),!1,t,n)):this.append(o,...e.slice(1).map(l=>new Ut(l,!0,t,n)))}toString(r){let{childNodes:[e,...t]}=this;return`-{${e.toString(r)}${e.length>0?"|":""}${t.map(n=>n.toString(r)).join(";")}}-`}text(){let{childNodes:[r,...e]}=this;return`-{${r.text()}|${me(e,";")}}-`}getAttribute(r){return r==="padding"?2:super.getAttribute(r)}getGaps(r){return r||this.firstChild.length>0?1:0}print(){let{childNodes:[r,...e]}=this;return`<span class="wpb-converter">-{${r.print()}${r.length>0?"|":""}${Le(e,{sep:";"})}}-</span>`}}});var So={};ie(So,{parseConverter:()=>Qa});var Qa,wo=A(()=>{"use strict";Ao();Qa=(a,r,e)=>{var l;(l=r.regexConverter)!=null||(r.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${r.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"u"));let t=/-\{/gu,n=/-\{|\}-/gu,i=[],s=t,o=s.exec(a);for(;o;){let{0:u,index:g}=o;if(u==="}-"){let d=i.pop(),{length:c}=e,p=a.slice(d.index+2,g),h=p.indexOf("|"),[f,k]=h===-1?[[],p]:[p.slice(0,h).split(";"),p.slice(h+1)],x=k.replace(/(&[#a-z\d]+);/giu,"$1"),v=x.split(r.regexConverter).map(C=>C.replace(/\x01/gu,";"));new fn(f,v,r,e),a=`${a.slice(0,d.index)}\0${c}v\x7F${a.slice(g+2)}`,i.length===0&&(s=t),s.lastIndex=d.index+3+String(c).length}else i.push(o),s=n,s.lastIndex=g+2;o=s.exec(a)}return a}});var xn={};ie(xn,{Token:()=>S});var Sr,Te,z,X,pt,Vt,wr,G,Co,$o,No,Io,Eo,Lo,Fo,Po,Ro,Bo,jo,qo,ci,S,j=A(()=>{"use strict";Y();M();P();Fn();Ui();ci=class ci extends At{constructor(e,t=b.getConfig(),n=[],i){super();T(this,G);T(this,Sr,"plain");T(this,Te,0);T(this,z);T(this,X);T(this,pt);T(this,Vt,!1);T(this,wr);typeof e=="string"&&this.insertAt(e),y(this,z,t),y(this,X,n),n.push(this)}get type(){return m(this,Sr)}set type(e){y(this,Sr,e)}parseOnce(e=m(this,Te),t=!1){if(e<m(this,Te)||this.length===0||!this.getAttribute("plain"))return this;if(m(this,Te)>=11)return this;switch(e){case 0:if(this.type==="root"){m(this,X).pop();let n=w(this,G,Co).call(this);t&&(t=!n)}y(this,pt,t),w(this,G,$o).call(this,t);break;case 1:w(this,G,No).call(this);break;case 2:w(this,G,Io).call(this);break;case 3:w(this,G,Eo).call(this);break;case 4:w(this,G,Lo).call(this);break;case 5:w(this,G,Fo).call(this);break;case 6:w(this,G,Po).call(this);break;case 7:w(this,G,Ro).call(this);break;case 8:w(this,G,Bo).call(this);break;case 9:w(this,G,jo).call(this);break;case 10:w(this,G,qo).call(this)}if(this.type==="root")for(let n of m(this,X))n==null||n.parseOnce(e,t);return Fr(this,Te)._++,this}buildFromStr(e,t){let n=e.split(/[\0\x7F]/u).map((i,s)=>{if(s%2===0)return new dr(i);if(isNaN(i.slice(-1)))return m(this,X)[Number(i.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${i}`)});return t===0?n.map(String).join(""):t===1?me(n):n}build(){y(this,Te,11);let{length:e,firstChild:t}=this,n=t==null?void 0:t.toString();if(e===1&&t.type==="text"&&n.includes("\0")&&(this.replaceChildren(...this.buildFromStr(n)),this.normalize(),this.type==="root"))for(let i of m(this,X))i==null||i.build()}afterBuild(){if(this.type==="root")for(let e of m(this,X))e==null||e.afterBuild();y(this,Vt,!0)}parse(e=11,t){for(e=Math.min(e,11);m(this,Te)<e;)this.parseOnce(m(this,Te),t);return e&&(this.build(),this.afterBuild()),this}getAttribute(e){var t;switch(e){case"plain":return this.constructor===ci;case"config":return m(this,z);case"include":return(t=m(this,pt))!=null?t:!!m(this.getRootNode(),pt);case"accum":return m(this,X);case"built":return m(this,Vt);default:return super.getAttribute(e)}}setAttribute(e,t){switch(e){case"stage":m(this,Te)===0&&this.type==="root"&&m(this,X).shift(),y(this,Te,t);break;default:super.setAttribute(e,t)}}insertAt(e,t=this.length){let n=typeof e=="string"?new dr(e):e;return super.insertAt(n,t),n.type==="root"&&(n.type="plain"),n}normalizeTitle(e,t=0,n,i,s){return b.normalizeTitle(e,t,m(this,pt),m(this,z),n,i,s)}lint(e=this.getAbsoluteIndex(),t){var i;let n=super.lint(e,t);if(this.type==="root"){let s=new Map,o="category,html-attr#id,ext-attr#id,table-attr#id";for(let c of this.querySelectorAll(o)){let p;if(c.type==="category")p=c.name;else{let h=c.getValue();h&&h!==!0&&(p=`#${h}`)}if(p){let h=s.get(p);h?h.add(c):s.set(p,new Set([c]))}}for(let[c,p]of s)if(p.size>1&&!c.startsWith("#mw-customcollapsible-")){let h=!c.startsWith("#"),f=`duplicated ${h?"category":"id"}`,k=h?"error":"warning";n.push(...[...p].map(x=>{let v=E(x,{start:x.getAbsoluteIndex()},"no-duplicate",f,k);return h&&(v.suggestions=[{desc:"remove",range:[v.startIndex,v.endIndex],text:""}]),v}))}let l=/<!--\s*lint-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->/gu,u=this.toString(),g=[],d=l.exec(u);for(;d;){let{1:c,index:p}=d,h=(i=d[2])==null?void 0:i.trim();g.push({line:this.posFromIndex(p).top+(c==="disable-line"?0:1),from:c==="disable"?l.lastIndex:void 0,to:c==="enable"?l.lastIndex:void 0,rules:h?new Set(h.split(",").map(f=>f.trim())):void 0}),d=l.exec(u)}n=n.filter(({rule:c,startLine:p,startIndex:h})=>{let f={pos:0};for(let{line:k,from:x,to:v,rules:C}of g){if(k>p+1)break;if(C&&!C.has(c))continue;if(k===p&&x===void 0&&v===void 0)return!1;x<=h&&x>f.pos?(f.pos=x,f.type="from"):v<=h&&v>f.pos&&(f.pos=v,f.type="to")}return f.type!=="from"})}return n}toString(e,t){return e?super.toString(!0,t):We(m(this,wr),()=>super.toString(!1,t),n=>{let i=this.getRootNode();i.type==="root"&&m(i,Vt)&&y(this,wr,n)})}caretPositionFromIndex(e){{if(e===void 0)return;let{length:t}=this.toString();if(e>t||e<-t)return;e+=e<0?t:0;let n=this,i=0,s=0;for(;n.type!=="text";){let{childNodes:o}=n;i+=n.getAttribute("padding");for(let l=0;i<e&&l<o.length;l++){let u=o[l],g=u.toString().length;if(i+=g,i>=e){n=u,i-=g,s=i;break}i+=n.getGaps(l)}if(n.childNodes===o)return{offsetNode:n,offset:e-s}}return{offsetNode:n,offset:e-s}}}elementFromIndex(e){var t;{let n=(t=this.caretPositionFromIndex(e))==null?void 0:t.offsetNode;return(n==null?void 0:n.type)==="text"?n.parentNode:n}}elementFromPoint(e,t){return this.elementFromIndex(this.indexFromPos(t,e))}};Sr=new WeakMap,Te=new WeakMap,z=new WeakMap,X=new WeakMap,pt=new WeakMap,Vt=new WeakMap,wr=new WeakMap,G=new WeakSet,Co=function(){let{parseRedirect:e}=(Zi(),Z(Ji)),t=this.firstChild.toString(),n=e(t,m(this,z),m(this,X));return n&&this.setText(n),!!n},$o=function(e){let{parseCommentAndExt:t}=(mr(),Z(Os));this.setText(t(this.firstChild.toString(),m(this,z),m(this,X),e))},No=function(){let{parseBraces:e}=(Kr(),Z(ys)),t=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,n=e(t,m(this,z),m(this,X));this.setText(this.type==="root"?n:n.slice(1))},Io=function(){var t;if((t=m(this,z).excludes)!=null&&t.includes("html"))return;let{parseHtml:e}=(Ms(),Z(_s));this.setText(e(this.firstChild.toString(),m(this,z),m(this,X)))},Eo=function(){var t;if((t=m(this,z).excludes)!=null&&t.includes("table"))return;let{parseTable:e}=(Xs(),Z(Qs));this.setText(e(this,m(this,z),m(this,X)))},Lo=function(){var t;if((t=m(this,z).excludes)!=null&&t.includes("hr"))return;let{parseHrAndDoubleUnderscore:e}=(eo(),Z(Ys));this.setText(e(this,m(this,z),m(this,X)))},Fo=function(){let{parseLinks:e}=(ao(),Z(oo));this.setText(e(this.firstChild.toString(),m(this,z),m(this,X)))},Po=function(){var n;if((n=m(this,z).excludes)!=null&&n.includes("quote"))return;let{parseQuotes:e}=(gi(),Z(ro)),t=this.firstChild.toString().split(`
|
|
31
|
+
`);for(let i=0;i<t.length;i++)t[i]=e(t[i],m(this,z),m(this,X));this.setText(t.join(`
|
|
32
|
+
`))},Ro=function(){var t;if((t=m(this,z).excludes)!=null&&t.includes("extLink"))return;let{parseExternalLinks:e}=(pi(),Z(no));this.setText(e(this.firstChild.toString(),m(this,z),m(this,X)))},Bo=function(){var t;if((t=m(this,z).excludes)!=null&&t.includes("magicLink"))return;let{parseMagicLinks:e}=(mo(),Z(co));this.setText(e(this.firstChild.toString(),m(this,z),m(this,X)))},jo=function(){var s;if((s=m(this,z).excludes)!=null&&s.includes("list"))return;let{parseList:e}=(To(),Z(bo)),t=this.firstChild.toString().split(`
|
|
33
|
+
`),n={lastPrefix:""},i=this.type==="root"||this.type==="ext-inner"&&this.name==="poem"?0:1;for(;i<t.length;i++)t[i]=e(t[i],n,m(this,z),m(this,X));this.setText(t.join(`
|
|
34
|
+
`))},qo=function(){if(m(this,z).variants.length>0){let{parseConverter:e}=(wo(),Z(So));this.setText(e(this.firstChild.toString(),m(this,z),m(this,X)))}};S=ci});var Fe,Rt,Ln,jr,we=A(()=>{"use strict";Fe={running:!1,run(a){let{running:r}=this;this.running=!0;try{let{Token:e}=(j(),Z(xn)),t=a();return t instanceof e&&!t.getAttribute("built")&&t.afterBuild(),this.running=r,t}catch(e){throw this.running=r,e}},rev:0},Rt=a=>r=>r.type===a,Ln=(a,r,e,t=[])=>{var o,l;let{childNodes:n}=a,i=Object.isFrozen(n)?[...n]:n,s=i.splice(r,e,...t);for(let u=0;u<t.length;u++){let g=t[u];g.setAttribute("parentNode",a),g.setAttribute("nextSibling",i[r+u+1]),g.setAttribute("previousSibling",i[r+u-1])}return(o=i[r-1])==null||o.setAttribute("nextSibling",i[r]),(l=i[r+t.length])==null||l.setAttribute("previousSibling",i[r+t.length-1]),s},jr=(a,r)=>{Object.defineProperty(a,"name",{value:r.name})}});var Oo={};ie(Oo,{Title:()=>mi});var Cr,$r,Qt,qe,mi,Do=A(()=>{"use strict";Y();mi=class{constructor(r,e,t,n,i){T(this,Cr);T(this,$r);T(this,Qt);T(this,qe);te(this,"interwiki","");te(this,"valid");te(this,"encoded",!1);let s=r.trim().startsWith("../");if(n&&r.includes("%"))try{let l=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(r);r=Me(r),this.encoded=l}catch(l){}if(r=tr(r).replace(/[_ ]+/gu," ").trim(),s)y(this,Qt,0);else{let l=e;r.startsWith(":")&&(l=0,r=r.slice(1).trim());let u=r.split(":");if(u.length>1){let g=u[0].trim().toLowerCase(),d=Object.prototype.hasOwnProperty.call(t.nsid,g)&&t.nsid[g];d&&(l=d,r=u.slice(1).join(":").trim())}y(this,Qt,l)}let o=r.indexOf("#");if(o!==-1){let l=r.slice(o).trim().slice(1);if(l.includes("%"))try{l=Me(l)}catch(u){}y(this,qe,l.replace(/ /gu,"_")),r=r.slice(0,o).trim()}this.valid=!!(r||this.interwiki||i&&this.ns===0&&m(this,qe)!==void 0)&&tr(r)===r&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(s?/^(?:\.\.\/)+(.*)/u.exec(r)[1]:r),this.main=r,Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}}),y(this,$r,t.namespaces)}get ns(){return m(this,Qt)}get fragment(){return m(this,qe)}get main(){return m(this,Cr)}set main(r){r=r.replace(/_/gu," ").trim(),y(this,Cr,r&&r[0].toUpperCase()+r.slice(1))}get prefix(){let r=m(this,$r)[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()}toString(r){return(r?this.title.replace(/_/gu," "):this.title)+(m(this,qe)===void 0?"":`#${m(this,qe)}`)}getRedirection(){return[!1,(this.interwiki+(this.interwiki&&":")+this.prefix+this.main).replace(/ /gu,"_")]}setFragment(r){y(this,qe,r)}};Cr=new WeakMap,$r=new WeakMap,Qt=new WeakMap,qe=new WeakMap});var Uo={};ie(Uo,{LanguageService:()=>bi,tasks:()=>Wo});var Wo,Xa,Ka,Ja,Za,_o,xi,hi,Nr,ae,Mo,fi,Ho,Ir,bn,Tn,Oe,De,Er,Xt,Kt,Jt,B,Ae,Ti,Ne,zo,Go,yn,yi,bi,Vo=A(()=>{"use strict";wn();_n();M();P();Fn();Wo=new WeakMap,Xa=new Set(["ref"]),Ka=new Set(["ref","references"]),Ja=new Set(["name","extends","follow"]),Za=new Set(["group"]),_o=a=>a.every(({type:r})=>["text","comment","noinclude","include"].includes(r)),xi=(a,r)=>{let{top:e,left:t}=a.posFromIndex(r);return{line:e,character:t}},hi=(a,r,e)=>({start:xi(a,r),end:xi(a,e)}),Nr=a=>{let{top:r,left:e,height:t,width:n}=a.getBoundingClientRect();return{start:{line:r,character:e},end:bt(r,e,t,n)}},ae=(a,r,e,{line:t,character:n})=>[...new Set(a)].map(i=>({label:i,kind:r,textEdit:{range:{start:{line:t,character:n-e.length},end:{line:t,character:n}},newText:i}})),Mo=(a,r)=>{let{title:e,fragment:t,valid:n}=b.normalizeTitle(a,r),{articlePath:i}=b.getConfig();if(n){if(!i)throw new Error("Article path is not set.")}else throw new RangeError("Invalid page name.");let s=encodeURIComponent(e)+(t===void 0?"":`#${encodeURIComponent(t)}`);return i.includes("$1")?i.replace("$1",s):i+(i.endsWith("/")?"":"/")+s},fi=(a,r)=>{let{line:e,character:t}=r,n=a.indexFromPos(e,t),i=Number(/[\w!#]/u.test(a.toString().charAt(n)));return a.elementFromIndex(n+i)},Ho=(a,r,e)=>{let{type:t,parentNode:n={}}=a,{name:i,tag:s}=n;return t==="attr-value"&&r.has(s)&&e.has(i)?a.toString().trim():NaN},Ir=a=>Ho(a,Xa,Ja),bn=a=>Ho(a,Ka,Za),Tn=a=>{let{type:r,name:e,parentNode:t}=a;switch(r){case"heading":return a.level;case"heading-title":return t.level;case"parameter-key":return`${t.parentNode.name}|${t.name}`;case"ext":case"html":case"image-parameter":return e;default:return t.name}},bi=class{constructor(r){T(this,B);T(this,Oe);T(this,De);T(this,Er);T(this,Xt);T(this,Kt);T(this,Jt);te(this,"data");Wo.set(r,this)}destroy(){Object.setPrototypeOf(this,null)}async provideDocumentColors(r,e,t=!0){w(this,B,Ne).call(this);let n=await w(this,B,Ae).call(this,e);return n.querySelectorAll("attr-value,parameter-value,arg-default").flatMap(({type:i,childNodes:s})=>i!=="attr-value"&&!_o(s)?[]:s.filter(o=>o.type==="text").flatMap(o=>{let l=Pi(o.data,t).filter(([,,,g])=>g);if(l.length===0)return[];let u=o.getAbsoluteIndex();return l.map(([g,d,c])=>{let p=r(g);return p.length===4&&{color:{red:p[0]/255,green:p[1]/255,blue:p[2]/255,alpha:p[3]},range:hi(n,u+d,u+c)}}).filter(Boolean)}))}provideColorPresentations({color:{red:r,green:e,blue:t,alpha:n},range:i}){let s=`#${er(r)}${er(e)}${er(t)}${n<1?er(n):""}`;return[{label:s,textEdit:{range:i,newText:s}}]}async provideCompletionItems(r,e){var v,C,I,N,O,H,q,V;w(this,B,Ne).call(this);let{re:t,allTags:n,functions:i,switches:s,protocols:o,params:l,tags:u,ext:g}=w(this,B,zo).call(this),{line:d,character:c}=e,p=t.exec((C=(v=r.split(/\r?\n/u,d+1)[d])==null?void 0:v.slice(0,c))!=null?C:"");if((p==null?void 0:p[1])!==void 0)return ae(n,"Class",p[1],e);if(p!=null&&p[4])return ae(s,"Constant",p[4],e);if((p==null?void 0:p[5])!==void 0)return ae(o,"Reference",p[5],e);let h=await w(this,B,Ae).call(this,r);if(p!=null&&p[2]){let F=(I=p[3])!=null?I:"";if(p[2]==="{{{")return ae(h.querySelectorAll("arg").map(({name:_})=>_).filter(Boolean),"Variable",F,e);let D=F.startsWith(":"),W=D?F.slice(1).trimStart():F;return p[2]==="[["?ae(h.querySelectorAll("link,file,category,redirect-target").map(({name:_})=>_),"Folder",W,e):[...ae(i,"Function",F,e),...F.startsWith("#")?[]:ae(h.querySelectorAll("template").map(({name:_})=>D?_:_.replace(/^Template:/u,"")),"Folder",W,e)]}let f=h.elementFromPoint(c,d),{type:k,parentNode:x}=f;if((p==null?void 0:p[6])!==void 0||k==="image-parameter"){let F=(O=(N=p==null?void 0:p[6])==null?void 0:N.trimStart())!=null?O:m(this,Oe).slice(f.getAbsoluteIndex(),h.indexFromPos(e.line,e.character)).trimStart();return[...ae(l,"Property",F,e),...ae(h.querySelectorAll("image-parameter#width").map(D=>D.text()),"Unit",F,e)]}else if((p==null?void 0:p[7])!==void 0||k==="attr-key"){let F=(q=(H=p==null?void 0:p[7])==null?void 0:H.toLowerCase())!=null?q:x.tag,D=(V=p==null?void 0:p[9])!=null?V:f.toString();if(!u.has(F))return;let W=Wr[F],_=Hr[F],Q=_&&ae(_,"Field",D,e);return g.includes(F)&&!W?Q:[...Q!=null?Q:[],...F==="meta"||F==="link"?[]:ae(Mr,"Property",D,e),...W?ae(W,"Property",D,e):[],...ae(["data-"],"Variable",D,e),...ae(["xmlns:"],"Interface",D,e)]}else if((k==="parameter-key"||k==="parameter-value"&&x.anon)&&x.parentNode.type==="template"){let F=f.toString().trimStart();return F?ae(h.querySelectorAll("parameter").filter(({anon:D,parentNode:W})=>!D&&W.type==="template"&&W.name===x.parentNode.name).map(({name:D})=>D),"Variable",F,e):void 0}}async provideDiagnostics(r,e=!0){w(this,B,Ne).call(this);let t=await w(this,B,Ae).call(this,r),n=t.lint();return(e?n:n.filter(({severity:i})=>i==="error")).map(({startLine:i,startCol:s,endLine:o,endCol:l,severity:u,rule:g,message:d,fix:c,suggestions:p})=>({range:{start:{line:i,character:s},end:{line:o,character:l}},severity:u==="error"?1:2,source:"WikiLint",code:g,message:d,data:[...c?[{range:hi(t,...c.range),newText:c.text,title:`Fix: ${c.desc}`,fix:!0}]:[],...p?p.map(({range:h,text:f,desc:k})=>({range:hi(t,...h),newText:f,title:`Suggestion: ${k}`,fix:!1})):[]]}))}async provideFoldingRanges(r){return w(this,B,Go).call(this,r)}async provideLinks(r){w(this,B,Ne).call(this);let e=new RegExp(`^(?:${b.getConfig().protocol}|//)`,"iu");return(await w(this,B,Ae).call(this,r)).querySelectorAll("link-target,template-name,invoke-module,magic-link,ext-link-url,free-ext-link,attr-value,image-parameter#link").flatMap(n=>{let{type:i,parentNode:s,firstChild:o,lastChild:l,childNodes:u}=n,{name:g,tag:d}=s;if(!(i!=="attr-value"||g==="src"&&["templatestyles","img"].includes(d)||g==="cite"&&["blockquote","del","ins","q"].includes(d))||!_o(u))return[];let c=i==="image-parameter"?At.prototype.toString.call(n,!0).trim():n.toString(!0).trim();try{if(i==="magic-link")c.startsWith("ISBN")?c=Mo(`Special:Booksources/${c.slice(4).replace(/[\p{Zs}\t-]/gu,"")}`):c=c.startsWith("RFC")?`https://tools.ietf.org/html/rfc${c.slice(3).trim()}`:`https://pubmed.ncbi.nlm.nih.gov/${c.slice(4).trim()}`;else if(["link-target","template-name","invoke-module"].includes(i)||i==="attr-value"&&g==="src"&&d==="templatestyles"||i==="image-parameter"&&!e.test(c)){if(c.startsWith("/"))return[];let p=0;i==="template-name"||i==="attr-value"?p=10:i==="invoke-module"&&(p=828),c=Mo(c,p)}if(c.startsWith("//")&&(c=`https:${c}`),c=new URL(c).href,i==="image-parameter"){let p=o.getBoundingClientRect(),{top:h,left:f,height:k,width:x}=l.getBoundingClientRect();return[{range:{start:{line:p.top,character:p.left},end:bt(h,f,k,x)},target:c}]}return[{range:Nr(n),target:c}]}catch(p){return[]}})}async provideReferences(r,e){return w(this,B,yn).call(this,r,e,0)}async provideDefinition(r,e){return w(this,B,yn).call(this,r,e,1)}async resolveRenameLocation(r,e){return w(this,B,yn).call(this,r,e,2)}async provideRenameEdits(r,e,t){w(this,B,Ne).call(this);let n=await w(this,B,Ae).call(this,r),i=fi(n,e),{type:s}=i,o=Ir(i),l=bn(i),u=Tn(i),g=n.querySelectorAll(s).filter(d=>{let{type:c}=d.parentNode;return s==="link-target"&&c!=="link"&&c!=="redirect-target"?!1:s==="attr-value"?Ir(d)===o||bn(d)===l:Tn(d)===u});if(g.length!==0)return{changes:{"":g.map(d=>({range:Nr(d),newText:t}))}}}async provideHover(r,e){if(!this.data)return;w(this,B,Ne).call(this);let t=fi(await w(this,B,Ae).call(this,r),e),n,i;return t.is("double-underscore")?n=this.data.behaviorSwitches.find(({aliases:s})=>s.includes(t.innerText.toLowerCase())):t.type==="magic-word-name"&&(n=w(this,B,yi).call(this,t.parentNode.name),i=t.text().trim()),n&&{contents:{kind:"markdown",value:(n.signatures?`${n.signatures.map(s=>`- **{{ ${i}${s.length===0?"**":":** "}${s.map(({label:o,const:l})=>l?o:`*${o}*`).join(" **|** ")} **}}**`).join(`
|
|
35
|
+
`)}
|
|
36
|
+
|
|
37
|
+
`:"")+n.description},range:Nr(t)}}async provideSignatureHelp(r,e){if(this.data){if(m(this,Oe)!==void 0&&!m(this,Jt))throw new Error("This is a regular language server!")}else return;y(this,Jt,!0);let{line:t,character:n}=e,i=r.split(/\r?\n/u,t+1)[t],{lastChild:s}=await w(this,B,Ae).call(this,`${i.slice(0,n+/^[^{}<]*/u.exec(i.slice(n))[0].length)}}}`),{type:o,name:l,childNodes:u,firstChild:g}=s;if(o!=="magic-word")return;let d=w(this,B,yi).call(this,l);if(!(d!=null&&d.signatures))return;let c=g.text().trim(),p=u.length-1,h=s.getAbsoluteIndex(),f=u.findIndex(x=>x.getRelativeIndex()>n-h)-2;return f===-3&&(f=p-1),{signatures:d.signatures.filter(x=>{var v;return(x.length>=p||((v=x[x.length-1])==null?void 0:v.rest))&&x.every(({label:C,const:I},N)=>{var H;let O=I&&N<p&&((H=u[N+1])==null?void 0:H.text().trim());return!O||C.startsWith(O)||C.startsWith(O.toLowerCase())})}).map(x=>({label:`{{${c}${x.length===0?"":":"}${x.map(({label:v})=>v).join("|")}}}`,parameters:x.map(({label:v,const:C})=>({label:v,...C?{documentation:"Predefined parameter"}:void 0})),...x.length<p?{activeParameter:Math.min(f,x.length-1)}:void 0})),activeParameter:f}}async provideInlayHints(r){w(this,B,Ne).call(this);let e=[],t=await w(this,B,Ae).call(this,r);for(let n of t.querySelectorAll("template,magic-word#invoke")){let{type:i,childNodes:s}=n;e.push(...s.slice(i==="template"?1:3).filter(({anon:o})=>o).map(o=>({position:xi(t,o.getAbsoluteIndex()),label:`${o.name}=`,kind:2})))}return e}};Oe=new WeakMap,De=new WeakMap,Er=new WeakMap,Xt=new WeakMap,Kt=new WeakMap,Jt=new WeakMap,B=new WeakSet,Ae=async function(r){var e;return r=r.replace(/\r$/gmu,""),m(this,Oe)===r&&m(this,Xt)===b.config&&!m(this,De)?m(this,Er):(y(this,Oe,r),(e=m(this,De))!=null||y(this,De,w(this,B,Ti).call(this)),m(this,De))},Ti=async function(){return new Promise(r=>{(typeof setImmediate=="function"?setImmediate:setTimeout)(()=>{let e=b.getConfig();y(this,Xt,b.config);let t=m(this,Oe),n=b.parse(t,!0,void 0,e);if(m(this,Oe)===t&&m(this,Xt)===b.config){y(this,Er,n),y(this,De,void 0),r(n);return}y(this,De,w(this,B,Ti).call(this)),r(m(this,De))},0)})},Ne=function(){if(m(this,Jt))throw new Error("This is a signature language server!")},zo=function(){if(!m(this,Kt)){let{nsid:r,ext:e,html:t,parserFunction:[n,i,...s],doubleUnderscore:o,protocol:l,img:u}=b.getConfig(),g=new Set([e,t].flat(2)),d=new RegExp("(?:"+String.raw`<\/?(\w*)`+"|"+String.raw`(\{{2,4}|\[\[)\s*([^|{}<>[\]\s][^|{}<>[\]#]*)?`+"|"+String.raw`(__(?:(?!__)[\p{L}\d_])*)`+"|"+String.raw`(?<!\[)\[([a-z:/]*)`+"|"+String.raw`\[\[\s*(?:${Object.entries(r).filter(([,c])=>c===6).map(([c])=>c).join("|")})\s*:[^[\]{}<>]+\|([^[\]{}<>|=]*)`+"|"+String.raw`<(\w+)(?:\s(?:[^<>{}|=\s]+(?:\s*=\s*(?:[^\s"']\S*|(["']).*?\8))?(?=\s))*)?\s(\w*)`+")$","iu");y(this,Kt,{re:d,ext:e,tags:g,allTags:[...g,"onlyinclude","includeonly","noinclude"],functions:[Object.keys(n),Array.isArray(i)?i:Object.keys(i),s].flat(2),switches:o.slice(0,2).flat().map(c=>`__${c}__`),protocols:l.split("|"),params:Object.keys(u).filter(c=>c.endsWith("$1")||!c.includes("$1")).map(c=>c.replace(/\$1$/u,""))})}return m(this,Kt)},Go=async function(r,e=!0){w(this,B,Ne).call(this);let t=[],n=[],i=await w(this,B,Ae).call(this,r),s=i.getLines(),{length:o}=s,l=new Array(6),u=i.querySelectorAll(e?"heading-title,table,template,magic-word":"heading-title");for(let g of u){let{top:d,height:c}=g.getBoundingClientRect();if(g.type==="heading-title"){let{level:p}=g.parentNode;if(e){for(let h=p-1;h<6;h++){let f=l[h];f!==void 0&&f<d-1&&t.push({startLine:f,endLine:d-1,kind:"region"}),l[h]=void 0}l[p-1]=d+c-1}}else e&&c>2&&t.push({startLine:d,endLine:d+c-2,kind:"region"})}if(e)for(let g of l)g!==void 0&&g<o-1&&t.push({startLine:g,endLine:o-1,kind:"region"});return e?t:n},yn=async function(r,e,t){w(this,B,Ne).call(this);let n=["arg-name","template-name","magic-word-name","link-target","parameter-key"],i=["ext","html","attr-key","image-parameter","heading-title","heading",...n],s=await w(this,B,Ae).call(this,r),o=fi(s,e),{type:l}=o,u=Ir(o),g=bn(o);if(t===2&&l==="parameter-key"&&/^[1-9]\d*$/u.test(o.parentNode.name)||!u&&(t===1||!g&&(t===0?!i.includes(l):!n.includes(l)||l==="link-target"&&!["link","redirect-target"].includes(o.parentNode.type))))return;if(t===2)return Nr(o);let d=Tn(o),c=s.querySelectorAll(l==="heading-title"?"heading":l).filter(p=>{let{name:h,parentNode:f}=p.parentNode;return t===1?Ir(p)===u&&h==="name"&&f.parentNode.innerText:l==="attr-value"?Ir(p)===u||bn(p)===g:Tn(p)===d}).map(p=>({range:Nr(p.type==="parameter-key"?p.parentNode:p)}));return c.length===0?void 0:c},yi=function(r){return this.data.parserFunctions.find(({aliases:e})=>e.some(t=>t.replace(/^#/u,"")===r))}});var Zt,Qo,Ya,b,P=A(()=>{Fi();we();_i();Y();Zt={config:Cn,i18n:void 0,rules:Li,getConfig(){let{doubleUnderscore:a}=this.config;for(let r=0;r<2;r++)a.length>r+2&&a[r].length===0&&(a[r]=Object.keys(a[r+2]));return{...Cn,...this.config,excludes:[]}},msg(a,r=""){var e,t;return a&&((t=(e=this.i18n)==null?void 0:e[a])!=null?t:a).replace("$1",this.msg(r))},normalizeTitle(a,r=0,e,t=Zt.getConfig(),n,i=!1,s=!1){let{Title:o}=(Do(),Z(Oo)),l;if(n)l=new o(a,r,t,i,s);else{let{Token:u}=(j(),Z(xn));l=Fe.run(()=>{let g=new u(a,t);g.type="root",g.parseOnce(0,e).parseOnce();let d=new o(g.toString(),r,t,i,s);for(let c of["main","fragment"]){let p=d[c];if(p!=null&&p.includes("\0")){let h=g.buildFromStr(p,1);c==="main"?d.main=h:d.setFragment(h)}}return d})}return l},parse(a,r,e=11,t=Zt.getConfig()){if(a=Bi(a),typeof e!="number"){let s=Array.isArray(e)?e:[e];e=Math.max(...s.map(o=>Ei[o]||11))}let{Token:n}=(j(),Z(xn));return Fe.run(()=>{let s=new n(a,t);return s.type="root",s.parse(e,r)})},createLanguageService(a){var n;let r;r=(Vo(),Z(Uo));let{LanguageService:e,tasks:t}=r;return(n=t.get(a))!=null?n:new e(a)}},Qo={},Ya=new Set(["normalizeTitle","parse","createLanguageService"]);for(let a in Zt)Ya.has(a)||(Qo[a]={enumerable:!1});Object.defineProperties(Zt,Qo);Object.assign(typeof globalThis=="object"?globalThis:self,{Parser:Zt});b=Zt});P();})();
|
|
38
|
+
//# sourceMappingURL=bundle.lsp.js.map
|