wikiparser-node 1.16.1 → 1.16.2

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