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