wikiparser-node 1.9.2-b → 1.9.3-b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -18
- package/bundle/bundle.min.js +34 -33
- package/extensions/dist/base.js +1 -1
- package/package.json +5 -5
- package/README.en.md +0 -57
package/README.md
CHANGED
|
@@ -4,54 +4,54 @@
|
|
|
4
4
|
|
|
5
5
|
# Other Languages
|
|
6
6
|
|
|
7
|
-
- [
|
|
7
|
+
- [简体中文](./README-%28ZH%29.md)
|
|
8
8
|
|
|
9
|
-
#
|
|
9
|
+
# Introduction
|
|
10
10
|
|
|
11
|
-
WikiParser-Node
|
|
11
|
+
WikiParser-Node is an offline [Wikitext](https://www.mediawiki.org/wiki/Wikitext) parser developed by Bhsd for the [Node.js](https://nodejs.org/) environment. It can parse almost all wiki syntax and generate an [Abstract Syntax Tree (AST)](https://en.wikipedia.org/wiki/Abstract_syntax_tree) ([Try it online](https://bhsd-harry.github.io/wikiparser-node/#editor)). It also allows for easy querying and modification of the AST, and returns the modified wikitext.
|
|
12
12
|
|
|
13
|
-
#
|
|
13
|
+
# Other Versions
|
|
14
14
|
|
|
15
|
-
## Mini (
|
|
15
|
+
## Mini (also known as [WikiLint](https://www.npmjs.com/package/wikilint))
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
This version provides a [CLI](https://en.wikipedia.org/wiki/Command-line_interface), but only retains the parsing functionality and linting functionality. The parsed AST cannot be modified. It is used in the [eslint-plugin-wikitext](https://www.npmjs.com/package/eslint-plugin-wikitext) plugin.
|
|
18
18
|
|
|
19
19
|
## Browser-compatible
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
A browser-compatible version, which can be used for code highlighting or as a linting plugin in conjunction with editors such as [CodeMirror](https://codemirror.net/) and [Monaco](https://microsoft.github.io/monaco-editor/). ([Usage example](https://bhsd-harry.github.io/wikiparser-node))
|
|
22
22
|
|
|
23
|
-
#
|
|
23
|
+
# Installation
|
|
24
24
|
|
|
25
25
|
## Node.js
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
Please install the corresponding version as needed (`WikiParser-Node` or `WikiLint`), for example:
|
|
28
28
|
|
|
29
29
|
```sh
|
|
30
30
|
npm i wikiparser-node
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
or
|
|
34
34
|
|
|
35
35
|
```sh
|
|
36
36
|
npm i wikilint
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
##
|
|
39
|
+
## Browser
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
You can download the code via CDN, for example:
|
|
42
42
|
|
|
43
43
|
```html
|
|
44
|
-
<script src="//cdn.jsdelivr.net/npm/wikiparser-node@browser"></script>
|
|
44
|
+
<script src="//cdn.jsdelivr.net/npm/wikiparser-node@browser/bundle/bundle.min.js"></script>
|
|
45
45
|
```
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
or
|
|
48
48
|
|
|
49
49
|
```html
|
|
50
|
-
<script src="//unpkg.com/wikiparser-node@browser"></script>
|
|
50
|
+
<script src="//unpkg.com/wikiparser-node@browser/bundle/bundle.min.js"></script>
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
For more browser extensions, please refer to the corresponding [documentation](https://github.com/bhsd-harry/wikiparser-node/wiki/Browser-%28EN%29).
|
|
54
54
|
|
|
55
|
-
#
|
|
55
|
+
# Usage
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
Please refer to the [Wiki](https://github.com/bhsd-harry/wikiparser-node/wiki/Home-%28EN%29).
|
package/bundle/bundle.min.js
CHANGED
|
@@ -1,38 +1,39 @@
|
|
|
1
|
-
"use strict";(()=>{var
|
|
2
|
-
`),e=
|
|
3
|
-
`),wn=Vt.length+w-1,Sn=Vt[Vt.length-1],Cn=Vt.length===1?S+Sn.length:Sn.length,Lt={rule:Js[I],message:T.msg('lonely "$1"',I==="h"?ie:I),severity:Nr,startIndex:Ae,endIndex:Be,startLine:wn,endLine:wn,startCol:Cn,endCol:Cn+Te};if(I==="<")Lt.suggestions=[{desc:"escape",range:[Ae,Ae+1],text:"<"}];else if(I==="h"&&!(a==="ext-link-text"||a==="link-text")&&/[\p{L}\d_]/u.test(it||""))Lt.suggestions=[{desc:"whitespace",range:[Ae,Ae],text:" "}];else if(I==="["&&a==="ext-link-text"){let ne=n.getAbsoluteIndex()+n.toString().length;Lt.suggestions=[{desc:"escape",range:[ne,ne+1],text:"]"}]}else if(I==="]"&&f==="free-ext-link"&&Nr==="error"){let ne=e-o.toString().length;Lt.fix={range:[ne,ne],text:"["}}c.push(Lt)}return c}replaceData(e){N(this,Jt,Dn).call(this,e)}print(){return lt(this.data)}};Jt=new WeakSet,Dn=function(e){this.setAttribute("data",e)}});var pe,De=k(()=>{"use strict";be();pe=l=>(i,e)=>{class t extends i{text(){return""}lint(n){return l?[]:super.lint(n)}}return Yt(t,i),t}});var ue,gt=k(()=>{"use strict";j();ue=class extends y{constructor(i,e,t="plain",r,n,s){super(i,r,n,s),this.type=t}lint(){return[]}}});var z,Ee=k(()=>{"use strict";j();z=class extends y{constructor(i,e,t,r,n){super(i,t,r,n),this.type=e}}});var He,ye,je,$e,qt=k(()=>{"use strict";q();Q();Ce();P();j();Ee();$e=class extends y{constructor(e,t,r=T.getConfig(),n=[],s="|"){super(void 0,r,n,{});v(this,He,!0);v(this,ye);v(this,je);if(this.insertAt(new z(e,"link-target",r,n,{})),t!==void 0){let o=new y(t,r,n,{});o.type="link-text",o.setAttribute("stage",10),this.insertAt(o)}C(this,ye,s)}afterBuild(){C(this,je,this.getTitle()),h(this,ye).includes("\0")&&C(this,ye,this.buildFromStr(h(this,ye),0)),this.setAttribute("name",h(this,je).title),super.afterBuild()}setAttribute(e,t){e==="bracket"?C(this,He,t):e==="title"?C(this,je,t):super.setAttribute(e,t)}toString(){let e=super.toString(h(this,ye));return h(this,He)?`[[${e}]]`:e}text(){let e=super.text("|");return h(this,He)?`[[${e}]]`:e}getAttribute(e){return e==="title"?h(this,je):e==="padding"?2:super.getAttribute(e)}getGaps(e){return e===0?h(this,ye).length:1}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{childNodes:[n,s],type:o}=this,{encoded:a,fragment:p}=h(this,je),g=new R(this,e);if(n.childNodes.some(({type:d})=>d==="template")&&r.push($(n,g,"unknown-page","template in an internal link target","warning")),a&&r.push($(n,g,"url-encoding","unnecessary URL encoding in an internal link")),o==="link"||o==="category"){let d=s==null?void 0:s.childNodes.find(c=>c.type==="text"&&c.data.includes("|"));if(d){let c=$(s,g,"pipe-like",'additional "|" in the link text',"warning");c.suggestions=[{desc:"escape",range:[c.startIndex+d.getRelativeIndex(),c.startIndex+d.getRelativeIndex()+d.data.length],text:d.data.replace(/\|/gu,"|")}],r.push(c)}}if(o!=="link"&&o!=="redirect-target"&&p!==void 0){let d=$(n,g,"no-ignored","useless fragment"),c=n.childNodes.find(u=>u.type==="text"&&u.data.includes("#"));c&&(d.fix={range:[d.startIndex+c.getRelativeIndex()+c.data.indexOf("#"),d.endIndex],text:""}),r.push(d)}return r}getTitle(e){return this.normalizeTitle(this.firstChild.text(),0,e,!0,!0)}print(){return super.print(h(this,He)?{pre:"[[",post:"]]",sep:h(this,ye)}:{sep:h(this,ye)})}};He=new WeakMap,ye=new WeakMap,je=new WeakMap});var Y,qe=k(()=>{"use strict";j();Y=class extends y{get innerText(){return this.firstChild.data}constructor(i="",e,t){super(i,e,t)}}});var Vn,qr,eo,D,_e=k(()=>{"use strict";De();qe();Vn=[pe(!0)];D=class extends(eo=Y){constructor(){super(...arguments);x(this,"type","noinclude")}};qr=se(eo),D=ae(qr,0,"NoincludeToken",Vn,D),oe(qr,1,D)});var er,Xn=k(()=>{"use strict";q();P();qt();_e();er=class extends $e{constructor(e,t,r=T.getConfig(),n=[]){super(e,void 0,r,n);x(this,"type","redirect-target");t!==void 0&&this.insertAt(new D(t,r,n))}getTitle(){return this.normalizeTitle(this.firstChild.toString(),0,!0,!0)}text(){return`[[${this.firstChild.toString()}]]`}lint(e=this.getAbsoluteIndex()){let t=super.lint(e,/\]\]/u);if(this.length===2){let r=$(this.lastChild,{start:e},"no-ignored","useless link text");r.startIndex--,r.startCol--,r.fix={range:[r.startIndex,r.endIndex],text:""},t.push(r)}return t}}});var Qn,Oe,pt,_r,to,Ve,Zn=k(()=>{"use strict";De();P();j();gt();Xn();Qn=[pe()];Ve=class extends(to=y){constructor(e,t,r,n,s,o=T.getConfig(),a=[]){super(void 0,o,a);x(this,"type","redirect");v(this,Oe);v(this,pt);C(this,Oe,e),C(this,pt,s);let p=new RegExp(String.raw`^(?:${o.redirection.join("|")})\s*(?::\s*)?$`,"iu");this.append(new ue(t,p,"redirect-syntax",o,a,{}),new er(r,n==null?void 0:n.slice(1),o,a))}getAttribute(e){return e==="padding"?h(this,Oe).length:super.getAttribute(e)}toString(){return h(this,Oe)+super.toString()+h(this,pt)}lint(e=this.getAbsoluteIndex()){return this.lastChild.lint(e+h(this,Oe).length+this.firstChild.toString().length)}print(){return super.print({pre:h(this,Oe),post:h(this,pt)})}};_r=se(to),Oe=new WeakMap,pt=new WeakMap,Ve=ae(_r,0,"RedirectToken",Qn,Ve),oe(_r,1,Ve)});var Kn={};H(Kn,{parseRedirect:()=>ro});var ro,Jn=k(()=>{"use strict";P();Zn();ro=(l,i,e)=>{let t=new RegExp(String.raw`^(\s*)((?:${i.redirection.join("|")})\s*(?::\s*)?)\[\[([^\n|\]]+)(\|.*?)?\]\](\s*)`,"iu"),r=t.exec(l);return r&&T.normalizeTitle(r[3],0,!1,i,!0,!0).valid?(l=`\0${e.length}c\x7F${l.slice(r[0].length)}`,new Ve(...r.slice(1),i,e),l):!1}});var tr,Yn=k(()=>{"use strict";j();tr=class extends y{constructor(){super(...arguments);x(this,"type","onlyinclude")}toString(){return`<onlyinclude>${super.toString()}</onlyinclude>`}getAttribute(e){return e==="padding"?13:e==="plain"||super.getAttribute(e)}print(){return super.print({pre:'<span class="wpb-ext"><onlyinclude></span>',post:'<span class="wpb-ext"></onlyinclude></span>'})}}});var Ge,ut,Or=k(()=>{"use strict";j();ut=class extends y{constructor(e,t,r,n,s,o=[]){super(void 0,s);v(this,Ge);x(this,"closed");x(this,"selfClosing");this.setAttribute("name",e.toLowerCase()),C(this,Ge,[e,n||e]),this.closed=n!=="",this.selfClosing=n===void 0,this.append(t,r);let a=typeof t=="string"?-1:o.indexOf(t);o.splice(a===-1?1/0:a,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(){let{selfClosing:e,firstChild:t,lastChild:r}=this,[n,s]=h(this,Ge);return e?`<${n}${t.toString()}/>`:`<${n}${t.toString()}>${r.toString()}${this.closed?`</${s}>`:""}`}text(){let[e,t]=h(this,Ge);return this.selfClosing?`<${e}${this.firstChild.text()}/>`:`<${e}${super.text(">")}${this.closed?`</${t}>`:""}`}getAttribute(e){return e==="padding"?h(this,Ge)[0].length+1:super.getAttribute(e)}getGaps(){return 1}print(){let[e,t]=h(this,Ge);return super.print(this.selfClosing?{pre:`<${e}`,post:"/>"}:{pre:`<${e}`,sep:">",post:this.closed?`</${t}>`:""})}};Ge=new WeakMap});var ei,Gr,no,Xe,ti=k(()=>{"use strict";q();De();P();Or();ei=[pe()];Xe=class extends(no=ut){constructor(e,t="",r,n,s,o){super(e,t,r!=null?r:"",r===void 0||n!=null?n:"",s,o);x(this,"type","include")}lint(e=this.getAbsoluteIndex()){if(this.closed)return[];let t=E(this,{start:e},"unclosed-comment",T.msg("unclosed $1",`<${this.name}>`));return t.suggestions=[{desc:"close",range:[t.endIndex,t.endIndex],text:`</${this.name}>`}],[t]}};Gr=se(no),Xe=ae(Gr,0,"IncludeToken",ei,Xe),oe(Gr,1,Xe)});var io,Z,ri,ni,nr,zr,ii,_t,oi,ai,li,si,rr,so,oo,ao,ct,K,ce,ht,di=k(()=>{"use strict";q();Q();X();Ce();P();j();Ee();io=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"]),Z=new Set(["align"]),ri=new Set(["cite"]),ni=new Set(["cite","datetime"]),nr=new Set(["width"]),zr=new Set(["axis","align","bgcolor","height","width","valign"]),ii=new Set([...zr,"abbr","headers","scope","rowspan","colspan"]),_t=new Set(["type"]),oi=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),ai=new Set(["clear"]),li=new Set(["bgcolor","align","valign"]),si={div:Z,h1:Z,h2:Z,h3:Z,h4:Z,h5:Z,h6:Z,blockquote:ri,q:ri,p:Z,br:ai,pre:nr,ins:ni,del:ni,ul:_t,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...oi,"border"]),caption:Z,tr:li,td:ii,th:ii,img:new Set(["alt","src","width","height","srcset"]),font:new Set(["size","color","face"]),hr:nr,rt:new Set(["rbspan"]),data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:new Set(["mode","showfilename","caption","perrow","widths","heights","showthumbnails","type"]),poem:new Set(["compact","align"]),categorytree:new Set(["align","hideroot","onlyroot","depth","mode","hideprefix","namespaces","showcount","notranslations"]),combooption:new Set(["name","for","inline","align"])},rr=new Set,so={nowiki:rr,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:rr,inputbox:rr,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:rr,poll:new Set(["id","show-results-before-voting"]),sm2:_t,flashmp3:_t,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"])},oo=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,ao={table:oi,td:new Set([...zr,"scope"]),th:zr,br:ai,caption:Z,div:Z,hr:nr,h1:Z,h2:Z,h3:Z,h4:Z,h5:Z,h6:Z,li:_t,p:Z,pre:nr,tr:li,ul:_t},ht=class extends y{constructor(e,t,r,n="",s,o=[],a=T.getConfig(),p=[]){let g=new z(r,"attr-key",a,p,{}),d;if(r==="title"||t==="img"&&r==="alt")d=new y(s,a,p,{}),d.type="attr-value",d.setAttribute("stage",10);else if(t==="gallery"&&r==="caption"){let c={...a,excludes:[...a.excludes,"quote","extLink","magicLink","list"]};d=new y(s,c,p,{}),d.type="attr-value",d.setAttribute("stage",5)}else if(t==="choose"&&(r==="before"||r==="after")){let c={...a,excludes:[...a.excludes,"heading","html","table","hr","list"]};d=new y(s,c,p,{}),d.type="attr-value",d.setAttribute("stage",1)}else d=new z(s,"attr-value",a,p,{});super(void 0,a,p);v(this,ct);v(this,K);v(this,ce);this.type=e,this.append(g,d),C(this,K,n),C(this,ce,[...o]),C(this,ct,t),this.setAttribute("name",le(r).trim().toLowerCase())}get tag(){return h(this,ct)}get balanced(){return!h(this,K)||h(this,ce)[0]===h(this,ce)[1]}afterBuild(){h(this,K).includes("\0")&&C(this,K,this.buildFromStr(h(this,K),0)),this.parentNode&&C(this,ct,this.parentNode.name),this.setAttribute("name",this.firstChild.text().trim().toLowerCase()),super.afterBuild()}toString(){let[e="",t=""]=h(this,ce);return h(this,K)?super.toString(h(this,K)+e)+t:this.firstChild.toString()}text(){return h(this,K)?`${super.text(`${h(this,K).trim()}"`)}"`:this.firstChild.text()}getGaps(){var e,t;return h(this,K)?h(this,K).length+((t=(e=h(this,ce)[0])==null?void 0:e.length)!=null?t:0):0}lint(e=this.getAbsoluteIndex(),t){var m,f;let r=super.lint(e,t),{balanced:n,firstChild:s,lastChild:o,type:a,name:p,tag:g}=this,d=this.getValue(),c=new R(this,e);if(!n){let b=$(o,c,"unclosed-quote",T.msg("unclosed $1","quotes"),"warning");b.startIndex--,b.startCol--;let L={range:[b.endIndex,b.endIndex],text:h(this,ce)[0]};o.childNodes.some(({type:A,data:w})=>A==="text"&&/\s/u.test(w))?b.suggestions=[{desc:"close",...L}]:b.fix=L,r.push(b)}let u=so[g];if(u&&!u.has(p)||(a==="ext-attr"?g in si:!/\{\{[^{]+\}\}/u.test(p))&&!((m=si[g])!=null&&m.has(p))&&!/^(?:xmlns:[\w:.-]+|data-[^:]*)$/u.test(p)&&(g==="meta"||g==="link"||!io.has(p)))r.push($(s,c,"illegal-attr","illegal attribute name"));else if((f=ao[g])!=null&&f.has(p))r.push($(s,c,"obsolete-attr","obsolete attribute","warning"));else if(p==="style"&&typeof d=="string"&&oo.test(d))r.push($(o,c,"insecure-style","insecure style"));else if(p==="tabindex"&&typeof d=="string"&&d.trim()!=="0"){let b=$(o,c,"illegal-attr","nonzero tabindex");b.suggestions=[{desc:"remove",range:[e,b.endIndex],text:""},{desc:"0 tabindex",range:[b.startIndex,b.endIndex],text:"0"}],r.push(b)}return r}getValue(){if(h(this,K)){let e=this.lastChild.text();return h(this,ce)[1]?e:e[h(this,ce)[0]?"trimEnd":"trim"]()}return this.type==="ext-attr"||""}print(){let[e="",t=""]=h(this,ce);return h(this,K)?super.print({sep:lt(h(this,K))+e,post:t}):super.print()}};ct=new WeakMap,K=new WeakMap,ce=new WeakMap});var ir,gi,lo,ze,sr=k(()=>{"use strict";q();Q();X();P();j();Ee();di();ir=/([^\s/](?:(?!\0\d+~\x7F)[^\s/=])*)(?:((?:\s(?:\s|\0\d+c\x7F)*)?(?:=|\0\d+~\x7F)(?:\s|\0\d+c\x7F)*)(?:(["'])(.*?)(\3|$)|(\S*)))?/gsu,gi=l=>l.slice(0,-1),lo=l=>`${gi(l)}-dirty`,ze=class extends y{constructor(i,e,t,r=T.getConfig(),n=[]){if(super(void 0,r,n,{}),this.type=e,this.setAttribute("name",t),i){ir.lastIndex=0;let s="",o=ir.exec(i),a=0,p=()=>{s&&(super.insertAt(new z(s,lo(e),r,n,{})),s="")};for(;o;){let{index:g,0:d,1:c,2:u,3:m,4:f,5:b,6:L}=o;if(s+=i.slice(a,g),/^(?:[\w:]|\0\d+[t!~{}+-]\x7F)(?:[\w:.-]|\0\d+[t!~{}+-]\x7F)*$/u.test(le(c).trim())){let A=f!=null?f:L,w=[m,b],S=new ht(gi(e),t,c,u,A,w,r,n);p(),super.insertAt(S)}else s+=d;({lastIndex:a}=ir),o=ir.exec(i)}s+=i.slice(a),p()}}afterBuild(){let{parentNode:i}=this;(i==null?void 0:i.type)==="td"&&i.subtype==="caption"&&this.setAttribute("name","caption"),super.afterBuild()}getAttrTokens(i){return this.childNodes.filter(e=>e instanceof ht&&(!i||e.name===i.toLowerCase().trim()))}getAttrToken(i){let e=this.getAttrTokens(i);return e[e.length-1]}getAttr(i){var e;return(e=this.getAttrToken(i))==null?void 0:e.getValue()}lint(i=this.getAbsoluteIndex(),e){let t=super.lint(i,e),{parentNode:r,length:n,childNodes:s}=this,o=new Map,a=new Set,p=new R(this,i);if((r==null?void 0:r.type)==="html"&&r.closing&&this.text().trim()){let g=E(this,p,"no-ignored","attributes of a closing tag");g.fix={range:[i,g.endIndex],text:""},t.push(g)}for(let g=0;g<n;g++){let d=s[g];if(d instanceof z&&d.text().trim()){let c=$(d,p,"no-ignored","containing invalid attribute");c.suggestions=[{desc:"remove",range:[c.startIndex,c.endIndex],text:" "}],t.push(c)}else if(d instanceof ht){let{name:c}=d;o.has(c)?(a.add(c),o.get(c).push(d)):c!=="class"&&o.set(c,[d])}}if(a.size>0)for(let g of a)t.push(...o.get(g).map(d=>$(d,p,"no-duplicate",T.msg("duplicated $1 attribute",g))));return t}print(){return this.toString()?`<span class="wpb-${this.type}">${this.childNodes.map(i=>i.print(i instanceof z?{class:"attr-dirty"}:void 0)).join("")}</span>`:""}}});var pi={};H(pi,{PreToken:()=>Mr});var Mr,ui=k(()=>{"use strict";Ce();P();j();_e();Mr=class extends y{constructor(e,t=T.getConfig(),r=[]){if(e){let n="<nowiki>",s="</nowiki>",{length:o}=n,a=e.indexOf(n),p=e.indexOf(s,a+o),g="";for(;a!==-1&&p!==-1;)new D(n,t,r),new D(s,t,r),g+=`${e.slice(0,a)}\0${r.length-1}c\x7F${e.slice(a+o,p)}\0${r.length}c\x7F`,e=e.slice(p+o+1),a=e.indexOf(n),p=e.indexOf(s,a+o);e=g+e}super(e,t,r,{});x(this,"type","ext-inner");this.setAttribute("stage",10)}getAttribute(e){return e==="plain"||super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*\/\s*(pre)\b/giu)}}});var ci={};H(ci,{ParamTagToken:()=>Ot});var Ot,Wr=k(()=>{"use strict";q();Q();P();j();Ee();Ot=class extends y{constructor(e,t=T.getConfig(),r=[],n={}){super(void 0,t,r,{});x(this,"type","ext-inner");if(e){let s=z;this.append(...e.split(`
|
|
4
|
-
`).map(
|
|
1
|
+
"use strict";(()=>{var Ms=Object.create;var st=Object.defineProperty;var Bn=Object.getOwnPropertyDescriptor;var Ws=Object.getOwnPropertyNames;var Us=Object.prototype.hasOwnProperty;var jn=(a,n)=>(n=Symbol[a])?n:Symbol.for("Symbol."+a),ot=a=>{throw TypeError(a)};var Ds=(a,n,e)=>n in a?st(a,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[n]=e;var Pn=(a,n)=>st(a,"name",{value:n,configurable:!0});var k=(a,n)=>()=>(a&&(n=a(a=0)),n);var Hs=(a,n)=>()=>(n||a((n={exports:{}}).exports,n),n.exports),H=(a,n)=>{for(var e in n)st(a,e,{get:n[e],enumerable:!0})},Vs=(a,n,e,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of Ws(n))!Us.call(a,r)&&r!==e&&st(a,r,{get:()=>n[r],enumerable:!(t=Bn(n,r))||t.enumerable});return a};var O=a=>Vs(st({},"__esModule",{value:!0}),a);var se=a=>{var n;return[,,,Ms((n=a==null?void 0:a[jn("metadata")])!=null?n:null)]},qn=["class","method","getter","setter","accessor","field","value","get","set"],Rt=a=>a!==void 0&&typeof a!="function"?ot("Function expected"):a,Xs=(a,n,e,t,r)=>({kind:qn[a],name:n,metadata:t,addInitializer:i=>e._?ot("Already initialized"):r.push(Rt(i||null))}),oe=(a,n,e,t)=>{for(var r=0,i=a[n>>1],s=i&&i.length;r<s;r++)n&1?i[r].call(e):t=i[r].call(e,t);return t},ae=(a,n,e,t,r,i)=>{var s,o,l,g,p,d=n&7,u=!!(n&8),h=!!(n&16),m=d>3?a.length+1:d?u?1:2:0,x=qn[d+5],b=d>3&&(a[m-1]=[]),E=a[m]||(a[m]=[]),S=d&&(!h&&!u&&(r=r.prototype),d<5&&(d>3||!h)&&Bn(d<4?r:{get[e](){return c(this,i)},set[e](A){return v(this,i,A)}},e));d?h&&d<4&&Pn(i,(d>2?"set ":d>1?"get ":"")+e):Pn(r,e);for(var w=t.length-1;w>=0;w--)g=Xs(d,e,l={},a[3],E),d&&(g.static=u,g.private=h,p=g.access={has:h?A=>Qs(r,A):A=>e in A},d^3&&(p.get=h?A=>(d^1?c:I)(A,r,d^4?i:S.get):A=>A[e]),d>2&&(p.set=h?(A,L)=>v(A,r,L,d^4?i:S.set):(A,L)=>A[e]=L)),o=(0,t[w])(d?d<4?h?i:S[x]:d>4?void 0:{get:S.get,set:S.set}:r,g),l._=1,d^4||o===void 0?Rt(o)&&(d>4?b.unshift(o):d?h?i=o:S[x]=o:r=o):typeof o!="object"||o===null?ot("Object expected"):(Rt(s=o.get)&&(S.get=s),Rt(s=o.set)&&(S.set=s),Rt(s=o.init)&&b.unshift(s));return d||(r[jn("metadata")]=a[3]),S&&st(r,e,S),h?d^4?i:S:r},U=(a,n,e)=>Ds(a,typeof n!="symbol"?n+"":n,e),jr=(a,n,e)=>n.has(a)||ot("Cannot "+e),Qs=(a,n)=>Object(n)!==n?ot('Cannot use the "in" operator on this value'):a.has(n),c=(a,n,e)=>(jr(a,n,"read from private field"),e?e.call(a):n.get(a)),y=(a,n,e)=>n.has(a)?ot("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(a):n.set(a,e),v=(a,n,e,t)=>(jr(a,n,"write to private field"),t?t.call(a,e):n.set(a,e),e),I=(a,n,e)=>(jr(a,n,"access private method"),e);var tr=(a,n,e,t)=>({set _(r){v(a,n,r,e)},get _(){return c(a,n,t)}});var _n,Gn=k(()=>{"use strict";_n=["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"]});var On,Ae,we,at,zn,le,rr,de,Zs,Mn,Wn,Ks,lt,$e,X=k(()=>{"use strict";On=String.raw`[^[\]<>"\0-\x1F\x7F\p{Zs}\uFFFD]`,Ae=String.raw`(?:\[[\da-f:.]+\]|${On})`,we=String.raw`(?:${On}|\0\d+[c!~]\x7F)*`,at=(a,n)=>e=>e.replace(a,n),zn=at(/[\0\x7F]|\r$/gmu,""),le=at(/\0\d+c\x7F/gu,""),rr=at(/[\\{}()|.?*+^$[\]]/gu,String.raw`\$&`),de=(a,n="")=>a.map(e=>typeof e=="string"?e:e.text()).join(n),Zs={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}"},Mn=at(/&(?:#(\d+|x[\da-fA-F]+)|([lLgG][tT]|[lr]brac[ke]));/gu,(a,n,e)=>n?String.fromCodePoint(+((/^x/iu.test(n)?"0":"")+n)):Zs[e.toLowerCase()]),Wn=at(/\n/gu,String.raw`\n`),Ks={"&":"amp","<":"lt",">":"gt"},lt=at(/[&<>]/gu,a=>`&${Ks[a]};`),$e=(a,n={})=>{let{pre:e="",post:t="",sep:r=""}=n;return e+a.map(i=>i.print()).join(r)+t}});var Un=Hs((Vo,Js)=>{Js.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:{},nsid:{file:6,category:14},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","#regex":"regex","#related":"related","#cscore":"cscore"},["!","="],["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 Dn,Se=k(()=>{"use strict";Dn=Un()});var Ue,F,Q=k(()=>{"use strict";F=class{constructor(n,e){y(this,Ue);U(this,"token");U(this,"start");this.token=n,this.start=e}get top(){var n;return(n=c(this,Ue))!=null||v(this,Ue,this.getPosition()),c(this,Ue).top}get left(){var n;return(n=c(this,Ue))!=null||v(this,Ue,this.getPosition()),c(this,Ue).left}getPosition(){return this.token.getRootNode().posFromIndex(this.start)}};Ue=new WeakMap});var Hn,C,$,j=k(()=>{"use strict";Q();R();Hn=a=>(n,e,t,r,i="error")=>{let{start:s}=e,{top:o,left:l}="top"in e?e:new F(n,s),{offsetHeight:g,offsetWidth:p}=n,{startIndex:d,startLine:u,startCol:h}=a(n,s,o,l);return{rule:t,message:f.msg(r),severity:i,startIndex:d,endIndex:d+n.toString().length,startLine:u,endLine:u+g-1,startCol:h,endCol:g===1?h+p:p}},C=Hn((a,n,e,t)=>{let r=a.getRelativeIndex(),{top:i,left:s}=a.parentNode.posFromIndex(r);return{startIndex:n+r,startLine:e+i,startCol:i?s:t+s}}),$=Hn((a,n,e,t)=>({startIndex:n,startLine:e,startCol:t}))});var Vn,Xn,Pt,Bt,qr,dt,_r=k(()=>{"use strict";Vn=a=>{let n=a.split(`
|
|
2
|
+
`),e=n.length;return{height:e,width:n[e-1].length}},Xn=(a,n)=>n.childNodes.slice(0,a).reduce((e,t,r)=>e+t.toString().length+n.getGaps(r),0)+n.getAttribute("padding"),dt=class{constructor(){y(this,Bt);U(this,"childNodes",[]);y(this,Pt)}get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get parentNode(){return c(this,Pt)}get nextSibling(){var e;let n=(e=this.parentNode)==null?void 0:e.childNodes;return n&&n[n.indexOf(this)+1]}get previousSibling(){var e;let n=(e=this.parentNode)==null?void 0:e.childNodes;return n&&n[n.indexOf(this)-1]}get offsetHeight(){return I(this,Bt,qr).call(this).height}get offsetWidth(){return I(this,Bt,qr).call(this).width}getAttribute(n){return n==="padding"?0:this[n]}setAttribute(n,e){n==="parentNode"?v(this,Pt,e):this[n]=e}getRootNode(){let{parentNode:n}=this;for(;n!=null&&n.parentNode;)({parentNode:n}=n);return n!=null?n:this}posFromIndex(n){let e=String(this);if(n>=-e.length&&n<=e.length){let{height:t,width:r}=Vn(e.slice(0,n));return{top:t-1,left:r}}}getGaps(n){return 0}getRelativeIndex(n){if(n===void 0){let{parentNode:e}=this;return e?Xn(e.childNodes.indexOf(this),e):0}return Xn(n,this)}getAbsoluteIndex(){let{parentNode:n}=this;return n?n.getAbsoluteIndex()+this.getRelativeIndex():0}seal(n,e){Object.defineProperty(this,n,{enumerable:!e&&!!this[n],configurable:!0})}};Pt=new WeakMap,Bt=new WeakSet,qr=function(){return Vn(String(this))}});var Gr,Be,Or,zr,nr,Qn=k(()=>{"use strict";X();Te();_r();Gr=a=>{let n=new Set(a.split(",").map(e=>e.trim()));return({type:e})=>n.has(e)},nr=class extends dt{constructor(){super(...arguments);y(this,Be)}get length(){return this.childNodes.length}text(e){return de(this.childNodes,e)}normalize(){let e=[...this.childNodes],t=r=>{e.splice(r,1)};for(let r=e.length-1;r>=0;r--){let{type:i,data:s}=e[r];i!=="text"||this.getGaps(r-1)||s===""&&t(r)}this.setAttribute("childNodes",e)}removeAt(e){return Mr(this,e,1)[0]}insertAt(e,t=this.length){return Mr(this,t,0,[e]),e}closest(e){let t=Gr(e),{parentNode:r}=this;for(;r;){if(t(r))return r;({parentNode:r}=r)}}querySelector(e){let t=Gr(e);return I(this,Be,Or).call(this,t)}querySelectorAll(e){let t=Gr(e);return I(this,Be,zr).call(this,t)}append(...e){for(let t of e)this.insertAt(t)}replaceChildren(...e){for(let t=this.length-1;t>=0;t--)this.removeAt(t);this.append(...e)}setText(e,t=0){t+=t<0?this.length:0;let r=this.childNodes[t],{data:i}=r;return r.replaceData(e),i}toString(e=""){return this.childNodes.map(String).join(e)}lint(e=this.getAbsoluteIndex(),t){let r=[];for(let i=0,s=e+this.getAttribute("padding");i<this.length;i++){let o=this.childNodes[i];r.push(...o.lint(s,t)),s+=o.toString().length+this.getGaps(i)}return r}print(e={}){var t;return this.toString()?`<span class="wpb-${(t=e.class)!=null?t:this.type}">${$e(this.childNodes,e)}</span>`:""}json(e,t=this.getAbsoluteIndex()){let r={...this,type:this.type,range:[t,t+this.toString().length],childNodes:[]};for(let i=0,s=t+this.getAttribute("padding");i<this.length;i++){let o=this.childNodes[i],{length:l}=o.toString();r.childNodes.push(o.type==="text"?{data:o.data,range:[s,s+l]}:o.json(void 0,s)),s+=l+this.getGaps(i)}return r}};Be=new WeakSet,Or=function(e){var t;for(let r of this.childNodes){if(r.type==="text")continue;if(e(r))return r;let i=I(t=r,Be,Or).call(t,e);if(i)return i}},zr=function(e){var r;let t=[];for(let i of this.childNodes)i.type!=="text"&&(e(i)&&t.push(i),t.push(...I(r=i,Be,zr).call(r,e)));return t}});var Zn,Ys,eo,to,ro,no,io,ir,Kn,jt,Jn=k(()=>{"use strict";X();R();_r();Zn=String.raw`<\s*(?:/\s*)?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+`,Ys=new RegExp(String.raw`${Zn}|https?[:/]/+`,"giu"),eo=new RegExp(Zn,"giu"),to=new RegExp(String.raw`^https?://${Ae}${we}\.(?:gif|png|jpg|jpeg)$`,"iu"),ro={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},no={"<":"tag-like","[":"lonely-bracket","{":"lonely-bracket","]":"lonely-bracket","}":"lonely-bracket",h:"lonely-http"},io=["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"],jt=class extends dt{constructor(e){super();y(this,ir);U(this,"data","");Object.defineProperties(this,{childNodes:{enumerable:!1,configurable:!1},data:{value:e}})}get type(){return"text"}toString(){return this.data}text(){return this.data}lint(e=this.getAbsoluteIndex(),t){var P,q,V;let{data:r,parentNode:i,nextSibling:s,previousSibling:o}=this;if(!i)throw new Error("An isolated text node cannot be linted!");let{type:l,name:g,parentNode:p}=i,d=!1;if(l==="attr-value"){let{type:re,name:fe,tag:Re}=p;if(re!=="ext-attr")d=!0;else if(Re==="choose"&&(fe==="before"||fe==="after"))return[]}if(t!=null||(t=l==="free-ext-link"||l==="ext-link-url"||l==="image-parameter"&&g==="link"||d?eo:Ys),r.search(t)===-1)return[];t.lastIndex=0;let u=[],h=s==null?void 0:s.type,m=s==null?void 0:s.name,x=o==null?void 0:o.type,b=this.getRootNode(),{ext:E,html:S}=b.getAttribute("config"),{top:w,left:A}=b.posFromIndex(e),L=new Set(["onlyinclude","noinclude","includeonly",E,S,io].flat(2));for(let re=t.exec(r);re;re=t.exec(r)){let[,fe,Re]=re,{0:ie,index:W}=re;if(Re&&Re!=="]"){let{length:ne}=Re;W+=ne,ie=ie.slice(ne)}let{0:N,length:xe}=ie;if(N==="<"&&!L.has(fe.toLowerCase())||N==="["&&l==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(r.slice(W+1))||h==="ext"&&m==="nowiki"&&((P=s.innerText)!=null&&P.includes("]"))))continue;if(N==="]"&&(W||xe>1))t.lastIndex--;else if(N==="h"&&W===0&&l==="ext-link-text"&&to.test(r))continue;let ye=e+W,Pe=ye+xe,ee=b.toString(),ve=ee[Pe],it=ee[ye-1],Rr=xe>1&&!(N==="<"&&!/[\s/>]/u.test(ve!=null?ve:"")||d&&(N==="["||N==="]"))||N==="{"&&(ve===N||it==="-")||N==="}"&&(it===N||ve==="-")||N==="["&&(ve===N||l==="ext-link-text"||h==="free-ext-link"&&!r.slice(W+1).trim())||N==="]"&&(it===N||x==="free-ext-link"&&!r.slice(0,W).includes("]"))?"error":"warning",Pr=N==="{"||N==="[";if(Rr==="warning"&&(Pr||(N==="]"||N==="}"))){let ne=ro[N],Br=Pr?r.slice(W+1):r.slice(0,W);if(N==="{"&&((q=ne.exec(Br))==null?void 0:q[0])==="}"||N==="}"&&((V=ne.exec(Br))==null?void 0:V[0])==="{")continue;if(!Br.includes(N)){let Rn=Pr?"nextSibling":"previousSibling",We=this[Rn];for(;We&&(We.type!=="text"||!ne.test(We.data));)We=We[Rn];if(We&&ne.exec(We.data)[0]!==N)continue}}let er=r.slice(0,W).split(`
|
|
3
|
+
`),In=er.length+w-1,Ln=er[er.length-1],Fn=er.length===1?A+Ln.length:Ln.length,Ft={rule:no[N],message:f.msg('lonely "$1"',N==="h"?ie:N),severity:Rr,startIndex:ye,endIndex:Pe,startLine:In,endLine:In,startCol:Fn,endCol:Fn+xe};if(N==="<")Ft.suggestions=[{desc:"escape",range:[ye,ye+1],text:"<"}];else if(N==="h"&&!(l==="ext-link-text"||l==="link-text")&&/[\p{L}\d_]/u.test(it||""))Ft.suggestions=[{desc:"whitespace",range:[ye,ye],text:" "}];else if(N==="["&&l==="ext-link-text"){let ne=i.getAbsoluteIndex()+i.toString().length;Ft.suggestions=[{desc:"escape",range:[ne,ne+1],text:"]"}]}else if(N==="]"&&x==="free-ext-link"&&Rr==="error"){let ne=e-o.toString().length;Ft.fix={range:[ne,ne],text:"["}}u.push(Ft)}return u}replaceData(e){I(this,ir,Kn).call(this,e)}print(){return lt(this.data)}};ir=new WeakSet,Kn=function(e){this.setAttribute("data",e)}});var ge,De=k(()=>{"use strict";Te();ge=a=>(n,e)=>{class t extends n{text(){return""}lint(i){return a?[]:super.lint(i)}}return sr(t,n),t}});var qt,pe,gt=k(()=>{"use strict";B();pe=class extends T{constructor(e,t,r,i,s,o){super(e,i,s,o);y(this,qt);v(this,qt,r)}get type(){return c(this,qt)}lint(){return[]}};qt=new WeakMap});var pt,z,Ne=k(()=>{"use strict";B();z=class extends T{constructor(e,t,r,i,s){super(e,r,i,s);y(this,pt);v(this,pt,t)}get type(){return c(this,pt)}set type(e){v(this,pt,e)}};pt=new WeakMap});var He,be,je,Ce,Gt=k(()=>{"use strict";j();Q();Se();R();B();Ne();Ce=class extends T{constructor(e,t,r=f.getConfig(),i=[],s="|"){super(void 0,r,i,{});y(this,He,!0);y(this,be);y(this,je);if(this.insertAt(new z(e,"link-target",r,i,{})),t!==void 0){let o=new T(t,r,i,{});o.type="link-text",o.setAttribute("stage",10),this.insertAt(o)}v(this,be,s)}afterBuild(){v(this,je,this.getTitle()),c(this,be).includes("\0")&&v(this,be,this.buildFromStr(c(this,be),0)),this.setAttribute("name",c(this,je).title),super.afterBuild()}setAttribute(e,t){e==="bracket"?v(this,He,t):e==="title"?v(this,je,t):super.setAttribute(e,t)}toString(){let e=super.toString(c(this,be));return c(this,He)?`[[${e}]]`:e}text(){let e=super.text("|");return c(this,He)?`[[${e}]]`:e}getAttribute(e){return e==="title"?c(this,je):e==="padding"?2:super.getAttribute(e)}getGaps(e){return e===0?c(this,be).length:1}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{childNodes:[i,s],type:o}=this,{encoded:l,fragment:g}=c(this,je),p=new F(this,e);if(i.childNodes.some(({type:d})=>d==="template")&&r.push(C(i,p,"unknown-page","template in an internal link target","warning")),l&&r.push(C(i,p,"url-encoding","unnecessary URL encoding in an internal link")),o==="link"||o==="category"){let d=s==null?void 0:s.childNodes.find(u=>u.type==="text"&&u.data.includes("|"));if(d){let u=C(s,p,"pipe-like",'additional "|" in the link text',"warning");u.suggestions=[{desc:"escape",range:[u.startIndex+d.getRelativeIndex(),u.startIndex+d.getRelativeIndex()+d.data.length],text:d.data.replace(/\|/gu,"|")}],r.push(u)}}if(o!=="link"&&o!=="redirect-target"&&g!==void 0){let d=C(i,p,"no-ignored","useless fragment"),u=i.childNodes.find(h=>h.type==="text"&&h.data.includes("#"));u&&(d.fix={range:[d.startIndex+u.getRelativeIndex()+u.data.indexOf("#"),d.endIndex],text:""}),r.push(d)}return r}getTitle(e){return this.normalizeTitle(this.firstChild.text(),0,e,!0,!0)}print(){return super.print(c(this,He)?{pre:"[[",post:"]]",sep:c(this,be)}:{sep:c(this,be)})}};He=new WeakMap,be=new WeakMap,je=new WeakMap});var Y,qe=k(()=>{"use strict";B();Y=class extends T{get innerText(){return this.firstChild.data}constructor(n="",e,t){super(n,e,t)}}});var Yn,Wr,so,D,_e=k(()=>{"use strict";De();qe();Yn=[ge(!0)];D=class extends(so=Y){get type(){return"noinclude"}};Wr=se(so),D=ae(Wr,0,"NoincludeToken",Yn,D),oe(Wr,1,D)});var or,ei=k(()=>{"use strict";j();R();Gt();_e();or=class extends Ce{get type(){return"redirect-target"}constructor(n,e,t=f.getConfig(),r=[]){super(n,void 0,t,r),e!==void 0&&this.insertAt(new D(e,t,r))}getTitle(){return this.normalizeTitle(this.firstChild.toString(),0,!0,!0)}text(){return`[[${this.firstChild.toString()}]]`}lint(n=this.getAbsoluteIndex()){let e=super.lint(n,/\]\]/u);if(this.length===2){let t=C(this.lastChild,{start:n},"no-ignored","useless link text");t.startIndex--,t.startCol--,t.fix={range:[t.startIndex,t.endIndex],text:""},e.push(t)}return e}}});var ti,Ge,ut,Ur,oo,Ve,ri=k(()=>{"use strict";De();R();B();gt();ei();ti=[ge()];Ve=class extends(oo=T){constructor(e,t,r,i,s,o=f.getConfig(),l=[]){super(void 0,o,l);y(this,Ge);y(this,ut);v(this,Ge,e),v(this,ut,s);let g=new RegExp(String.raw`^(?:${o.redirection.join("|")})\s*(?::\s*)?$`,"iu");this.append(new pe(t,g,"redirect-syntax",o,l,{}),new or(r,i==null?void 0:i.slice(1),o,l))}get type(){return"redirect"}getAttribute(e){return e==="padding"?c(this,Ge).length:super.getAttribute(e)}toString(){return c(this,Ge)+super.toString()+c(this,ut)}lint(e=this.getAbsoluteIndex()){return this.lastChild.lint(e+c(this,Ge).length+this.firstChild.toString().length)}print(){return super.print({pre:c(this,Ge),post:c(this,ut)})}};Ur=se(oo),Ge=new WeakMap,ut=new WeakMap,Ve=ae(Ur,0,"RedirectToken",ti,Ve),oe(Ur,1,Ve)});var ni={};H(ni,{parseRedirect:()=>ao});var ao,ii=k(()=>{"use strict";R();ri();ao=(a,n,e)=>{let t=new RegExp(String.raw`^(\s*)((?:${n.redirection.join("|")})\s*(?::\s*)?)\[\[([^\n|\]]+)(\|.*?)?\]\](\s*)`,"iu"),r=t.exec(a);return r&&f.normalizeTitle(r[3],0,!1,n,!0,!0).valid?(a=`\0${e.length}c\x7F${a.slice(r[0].length)}`,new Ve(...r.slice(1),n,e),a):!1}});var ar,si=k(()=>{"use strict";B();ar=class extends T{get type(){return"onlyinclude"}toString(){return`<onlyinclude>${super.toString()}</onlyinclude>`}getAttribute(n){return n==="padding"?13:n==="plain"||super.getAttribute(n)}print(){return super.print({pre:'<span class="wpb-ext"><onlyinclude></span>',post:'<span class="wpb-ext"></onlyinclude></span>'})}}});var Oe,ct,Dr=k(()=>{"use strict";B();ct=class extends T{constructor(e,t,r,i,s,o=[]){super(void 0,s);y(this,Oe);U(this,"closed");U(this,"selfClosing");this.setAttribute("name",e.toLowerCase()),v(this,Oe,[e,i||e]),this.closed=i!=="",this.selfClosing=i===void 0,this.append(t,r);let l=typeof t=="string"?-1:o.indexOf(t);o.splice(l===-1?1/0:l,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(){let{selfClosing:e,firstChild:t,lastChild:r}=this,[i,s]=c(this,Oe);return e?`<${i}${t.toString()}/>`:`<${i}${t.toString()}>${r.toString()}${this.closed?`</${s}>`:""}`}text(){let[e,t]=c(this,Oe);return this.selfClosing?`<${e}${this.firstChild.text()}/>`:`<${e}${super.text(">")}${this.closed?`</${t}>`:""}`}getAttribute(e){return e==="padding"?c(this,Oe)[0].length+1:super.getAttribute(e)}getGaps(){return 1}print(){let[e,t]=c(this,Oe);return super.print(this.selfClosing?{pre:`<${e}`,post:"/>"}:{pre:`<${e}`,sep:">",post:this.closed?`</${t}>`:""})}};Oe=new WeakMap});var oi,Hr,lo,Xe,ai=k(()=>{"use strict";j();De();R();Dr();oi=[ge()];Xe=class extends(lo=ct){get type(){return"include"}constructor(n,e="",t,r,i,s){super(n,e,t!=null?t:"",t===void 0||r!=null?r:"",i,s)}lint(n=this.getAbsoluteIndex()){if(this.closed)return[];let e=$(this,{start:n},"unclosed-comment",f.msg("unclosed $1",`<${this.name}>`));return e.suggestions=[{desc:"close",range:[e.endIndex,e.endIndex],text:`</${this.name}>`}],[e]}};Hr=se(lo),Xe=ae(Hr,0,"IncludeToken",oi,Xe),oe(Hr,1,Xe)});var go,Z,li,di,dr,Vr,gi,Ot,ui,ci,hi,pi,lr,po,uo,co,zt,ht,K,ue,mt,mi=k(()=>{"use strict";j();Q();X();Se();R();B();Ne();go=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"]),Z=new Set(["align"]),li=new Set(["cite"]),di=new Set(["cite","datetime"]),dr=new Set(["width"]),Vr=new Set(["axis","align","bgcolor","height","width","valign"]),gi=new Set([...Vr,"abbr","headers","scope","rowspan","colspan"]),Ot=new Set(["type"]),ui=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),ci=new Set(["clear"]),hi=new Set(["bgcolor","align","valign"]),pi={div:Z,h1:Z,h2:Z,h3:Z,h4:Z,h5:Z,h6:Z,blockquote:li,q:li,p:Z,br:ci,pre:dr,ins:di,del:di,ul:Ot,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...ui,"border"]),caption:Z,tr:hi,td:gi,th:gi,img:new Set(["alt","src","width","height","srcset"]),font:new Set(["size","color","face"]),hr:dr,rt:new Set(["rbspan"]),data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:new Set(["mode","showfilename","caption","perrow","widths","heights","showthumbnails","type"]),poem:new Set(["compact","align"]),categorytree:new Set(["align","hideroot","onlyroot","depth","mode","hideprefix","namespaces","showcount","notranslations"]),combooption:new Set(["name","for","inline","align"])},lr=new Set,po={nowiki:lr,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:lr,inputbox:lr,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:lr,poll:new Set(["id","show-results-before-voting"]),sm2:Ot,flashmp3:Ot,score:new Set(["line_width_inches","lang","override_midi","raw","note-language","override_audio","override_ogg","sound","vorbis"]),seo:new Set(["title","title_mode","title_separator","keywords","description","robots","google_bot","image","image_width","image_height","image_alt","type","site_name","locale","section","author","published_time","twitter_site"]),tab:new Set(["nested","name","index","class","block","inline","openname","closename","collapsed","dropdown","style","bgcolor","container","id","title"]),tabs:new Set(["plain","class","container","id","title","style"]),combobox:new Set(["placeholder","value","id","class","text","dropdown","style"])},uo=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,co={table:ui,td:new Set([...Vr,"scope"]),th:Vr,br:ci,caption:Z,div:Z,hr:dr,h1:Z,h2:Z,h3:Z,h4:Z,h5:Z,h6:Z,li:Ot,p:Z,pre:dr,tr:hi,ul:Ot},mt=class extends T{constructor(e,t,r,i="",s,o=[],l=f.getConfig(),g=[]){let p=new z(r,"attr-key",l,g,{}),d;if(r==="title"||t==="img"&&r==="alt")d=new T(s,l,g,{}),d.type="attr-value",d.setAttribute("stage",10);else if(t==="gallery"&&r==="caption"){let u={...l,excludes:[...l.excludes,"quote","extLink","magicLink","list"]};d=new T(s,u,g,{}),d.type="attr-value",d.setAttribute("stage",5)}else if(t==="choose"&&(r==="before"||r==="after")){let u={...l,excludes:[...l.excludes,"heading","html","table","hr","list"]};d=new T(s,u,g,{}),d.type="attr-value",d.setAttribute("stage",1)}else d=new z(s,"attr-value",l,g,{});super(void 0,l,g);y(this,zt);y(this,ht);y(this,K);y(this,ue);v(this,zt,e),this.append(p,d),v(this,K,i),v(this,ue,[...o]),v(this,ht,t),this.setAttribute("name",le(r).trim().toLowerCase())}get type(){return c(this,zt)}get tag(){return c(this,ht)}get balanced(){return!c(this,K)||c(this,ue)[0]===c(this,ue)[1]}afterBuild(){c(this,K).includes("\0")&&v(this,K,this.buildFromStr(c(this,K),0)),this.parentNode&&v(this,ht,this.parentNode.name),this.setAttribute("name",this.firstChild.text().trim().toLowerCase()),super.afterBuild()}toString(){let[e="",t=""]=c(this,ue);return c(this,K)?super.toString(c(this,K)+e)+t:this.firstChild.toString()}text(){return c(this,K)?`${super.text(`${c(this,K).trim()}"`)}"`:this.firstChild.text()}getGaps(){var e,t;return c(this,K)?c(this,K).length+((t=(e=c(this,ue)[0])==null?void 0:e.length)!=null?t:0):0}lint(e=this.getAbsoluteIndex(),t){var m,x;let r=super.lint(e,t),{balanced:i,firstChild:s,lastChild:o,type:l,name:g,tag:p}=this,d=this.getValue(),u=new F(this,e);if(!i){let b=C(o,u,"unclosed-quote",f.msg("unclosed $1","quotes"),"warning");b.startIndex--,b.startCol--;let E={range:[b.endIndex,b.endIndex],text:c(this,ue)[0]};o.childNodes.some(({type:S,data:w})=>S==="text"&&/\s/u.test(w))?b.suggestions=[{desc:"close",...E}]:b.fix=E,r.push(b)}let h=po[p];if(h&&!h.has(g)||(l==="ext-attr"?p in pi:!/\{\{[^{]+\}\}/u.test(g))&&!((m=pi[p])!=null&&m.has(g))&&!/^(?:xmlns:[\w:.-]+|data-[^:]*)$/u.test(g)&&(p==="meta"||p==="link"||!go.has(g)))r.push(C(s,u,"illegal-attr","illegal attribute name"));else if((x=co[p])!=null&&x.has(g))r.push(C(s,u,"obsolete-attr","obsolete attribute","warning"));else if(g==="style"&&typeof d=="string"&&uo.test(d))r.push(C(o,u,"insecure-style","insecure style"));else if(g==="tabindex"&&typeof d=="string"&&d.trim()!=="0"){let b=C(o,u,"illegal-attr","nonzero tabindex");b.suggestions=[{desc:"remove",range:[e,b.endIndex],text:""},{desc:"0 tabindex",range:[b.startIndex,b.endIndex],text:"0"}],r.push(b)}return r}getValue(){if(c(this,K)){let e=this.lastChild.text();return c(this,ue)[1]?e:e[c(this,ue)[0]?"trimEnd":"trim"]()}return this.type==="ext-attr"||""}print(){let[e="",t=""]=c(this,ue);return c(this,K)?super.print({sep:lt(c(this,K))+e,post:t}):super.print()}};zt=new WeakMap,ht=new WeakMap,K=new WeakMap,ue=new WeakMap});var gr,fi,ho,Mt,ze,pr=k(()=>{"use strict";j();Q();X();R();B();Ne();mi();gr=/([^\s/](?:(?!\0\d+~\x7F)[^\s/=])*)(?:((?:\s(?:\s|\0\d+c\x7F)*)?(?:=|\0\d+~\x7F)(?:\s|\0\d+c\x7F)*)(?:(["'])(.*?)(\3|$)|(\S*)))?/gsu,fi=a=>a.slice(0,-1),ho=a=>`${fi(a)}-dirty`,ze=class extends T{constructor(e,t,r,i=f.getConfig(),s=[]){super(void 0,i,s,{});y(this,Mt);if(v(this,Mt,t),this.setAttribute("name",r),e){gr.lastIndex=0;let o="",l=gr.exec(e),g=0,p=()=>{o&&(super.insertAt(new z(o,ho(t),i,s,{})),o="")};for(;l;){let{index:d,0:u,1:h,2:m,3:x,4:b,5:E,6:S}=l;if(o+=e.slice(g,d),/^(?:[\w:]|\0\d+[t!~{}+-]\x7F)(?:[\w:.-]|\0\d+[t!~{}+-]\x7F)*$/u.test(le(h).trim())){let w=b!=null?b:S,A=[x,E],L=new mt(fi(t),r,h,m,w,A,i,s);p(),super.insertAt(L)}else o+=u;({lastIndex:g}=gr),l=gr.exec(e)}o+=e.slice(g),p()}}get type(){return c(this,Mt)}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 mt&&(!e||t.name===e.toLowerCase().trim()))}getAttrToken(e){let t=this.getAttrTokens(e);return t[t.length-1]}getAttr(e){var t;return(t=this.getAttrToken(e))==null?void 0:t.getValue()}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{parentNode:i,length:s,childNodes:o}=this,l=new Map,g=new Set,p=new F(this,e);if((i==null?void 0:i.type)==="html"&&i.closing&&this.text().trim()){let d=$(this,p,"no-ignored","attributes of a closing tag");d.fix={range:[e,d.endIndex],text:""},r.push(d)}for(let d=0;d<s;d++){let u=o[d];if(u instanceof z&&u.text().trim()){let h=C(u,p,"no-ignored","containing invalid attribute");h.suggestions=[{desc:"remove",range:[h.startIndex,h.endIndex],text:" "}],r.push(h)}else if(u instanceof mt){let{name:h}=u;l.has(h)?(g.add(h),l.get(h).push(u)):h!=="class"&&l.set(h,[u])}}if(g.size>0)for(let d of g)r.push(...l.get(d).map(u=>C(u,p,"no-duplicate",f.msg("duplicated $1 attribute",d))));return r}print(){return this.toString()?`<span class="wpb-${this.type}">${this.childNodes.map(e=>e.print(e instanceof z?{class:"attr-dirty"}:void 0)).join("")}</span>`:""}};Mt=new WeakMap});var xi={};H(xi,{PreToken:()=>Xr});var Xr,Ti=k(()=>{"use strict";Se();R();B();_e();Xr=class extends T{get type(){return"ext-inner"}constructor(n,e=f.getConfig(),t=[]){if(n){let r="<nowiki>",i="</nowiki>",{length:s}=r,o=n.indexOf(r),l=n.indexOf(i,o+s),g="";for(;o!==-1&&l!==-1;)new D(r,e,t),new D(i,e,t),g+=`${n.slice(0,o)}\0${t.length-1}c\x7F${n.slice(o+s,l)}\0${t.length}c\x7F`,n=n.slice(l+s+1),o=n.indexOf(r),l=n.indexOf(i,o+s);n=g+n}super(n,e,t,{}),this.setAttribute("stage",10)}getAttribute(n){return n==="plain"||super.getAttribute(n)}lint(n=this.getAbsoluteIndex()){return super.lint(n,/<\s*\/\s*(pre)\b/giu)}}});var bi={};H(bi,{ParamTagToken:()=>Wt});var Wt,Qr=k(()=>{"use strict";j();Q();R();B();Ne();Wt=class extends T{get type(){return"ext-inner"}constructor(n,e=f.getConfig(),t=[],r={}){if(super(void 0,e,t,{}),n){let i=z;this.append(...n.split(`
|
|
4
|
+
`).map(s=>new i(s,"param-line",e,t,{})))}}toString(){return super.toString(`
|
|
5
5
|
`)}text(){return super.text(`
|
|
6
|
-
`)}getGaps(){return 1}lint(
|
|
7
|
-
`})}}});var
|
|
8
|
-
`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},
|
|
9
|
-
`,index:
|
|
10
|
-
`){d=w+1;let{pos:
|
|
11
|
-
)`:""}(\s*)$`,"u")]),
|
|
12
|
-
`))!=null?
|
|
6
|
+
`)}getGaps(){return 1}lint(n=this.getAbsoluteIndex()){let e=new F(this,n);return this.childNodes.filter(t=>{let{childNodes:r}=t,i=r.findIndex(({type:o})=>o!=="text"),s=(i>=0?r.slice(0,i).map(String).join(""):t.toString()).trim();return s&&!(i>=0?/^[a-z]+(?:\[\])?\s*(?:=|$)/iu:/^[a-z]+(?:\[\])?\s*=/iu).test(s)}).map(t=>{let r=C(t,e,"no-ignored",f.msg("invalid parameter of <$1>",this.name));return r.suggestions=[{desc:"remove",range:[r.startIndex,r.endIndex],text:""}],r})}print(){return super.print({sep:`
|
|
7
|
+
`})}}});var Ut,ft,ur,xt,Zr=k(()=>{"use strict";j();Q();R();B();gt();xt=class extends T{constructor(e,t,r=f.getConfig(),i=[]){super(void 0,r,i);y(this,ft);y(this,Ut);v(this,Ut,e);let s=new T(t[0],r,i);s.type="heading-title",s.setAttribute("stage",2);let o=new pe(t[1],/^[^\S\n]*$/u,"heading-trail",r,i,{});this.append(s,o)}get type(){return"heading"}get level(){return c(this,Ut)}toString(){let e=c(this,ft,ur);return e+this.firstChild.toString()+e+this.lastChild.toString()}text(){let e=c(this,ft,ur);return e+this.firstChild.text()+e}getAttribute(e){return e==="padding"?this.level:super.getAttribute(e)}getGaps(){return this.level}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{firstChild:i,level:s}=this,o=i.toString(),l=i.childNodes.filter(u=>u.type==="quote"),g=l.filter(({bold:u})=>u),p=l.filter(({italic:u})=>u),d=new F(this,e);return this.level===1&&r.push(C(i,d,"h1","<h1>")),(o.startsWith("=")||o.endsWith("="))&&r.push(C(i,d,"unbalanced-header",f.msg("unbalanced $1 in a section header",'"="'))),this.closest("html-attrs, table-attrs")&&r.push($(this,d,"parsing-order","section header in a HTML tag")),g.length%2&&r.push(C(g[g.length-1],{...d,start:e+s,left:d.left+s},"format-leakage",f.msg("unbalanced $1 in a section header","bold apostrophes"))),p.length%2&&r.push(C(p[p.length-1],{start:e+s},"format-leakage",f.msg("unbalanced $1 in a section header","italic apostrophes"))),r}print(){let e=c(this,ft,ur);return super.print({pre:e,sep:e})}json(){let e=super.json();return e.level=this.level,e}};Ut=new WeakMap,ft=new WeakSet,ur=function(){return"=".repeat(this.level)}});var mo,fo,cr,ki=k(()=>{"use strict";X();j();R();B();mo=a=>a.text().replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),fo=new RegExp(`https?://${Ae}${we}$`,"iu"),cr=class extends T{get type(){return"parameter"}get anon(){return this.firstChild.length===0}constructor(n,e,t=f.getConfig(),r=[]){super(void 0,t,r);let i=new T(typeof n=="number"?void 0:n,t,r,{}),s=new T(e,t,r);i.type="parameter-key",s.type="parameter-value",s.setAttribute("stage",2),this.append(i,s)}afterBuild(){if(!this.anon){let{parentNode:n,firstChild:e}=this,t=mo(e);this.setAttribute("name",t),n&&n.getArgs(t,!1,!1).add(this)}super.afterBuild()}toString(){return this.anon?this.lastChild.toString():super.toString("=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(n=this.getAbsoluteIndex(),e){var s;let t=super.lint(n,e),{firstChild:r}=this,i=(s=fo.exec(r.text()))==null?void 0:s[0];if(i&&new URL(i).search){let o=C(r,{start:n},"unescaped","unescaped query string in an anonymous parameter");o.startIndex=o.endIndex,o.startLine=o.endLine,o.startCol=o.endCol,o.endIndex++,o.endCol++,o.fix={range:[o.startIndex,o.endIndex],text:"{{=}}"},t.push(o)}return t}print(){return super.print({sep:this.anon?"":"="})}json(){let n=super.json();return n.anon=this.anon,n}}});var xo,Ht,Qe,Ze,Tt,yi,vi,Dt,Ai=k(()=>{"use strict";X();j();Q();Te();Se();R();B();ki();Ne();gt();xo=new Set(["pageid","articlepath","server","servername","scriptpath","stylepath"]),Dt=class extends T{constructor(e,t,r=f.getConfig(),i=[]){var u,h;super(void 0,r,i,{});y(this,Tt);U(this,"modifier","");y(this,Ht,"template");y(this,Qe,!1);y(this,Ze,new Map);let{parserFunction:[s,o]}=r,l=(u=/^(?:\s|\0\d+c\x7F)*\0\d+s\x7F/u.exec(e))==null?void 0:u[0];if(l)this.setAttribute("modifier",l),e=e.slice(l.length);else if(e.includes(":")){let[m,...x]=e.split(":"),[b]=/^(?:\s|\0\d+c\x7F)*/u.exec((h=x[0])!=null?h:"");this.setModifier(`${m}:${b}`)&&(e=x.join(":").slice(b.length))}let g=e.includes(":");if(g||t.length===0&&!c(this,Qe)){let[m,...x]=e.split(":"),b=le(m),E=b[x.length>0?"trimStart":"trim"](),S=E.toLowerCase(),w=s[S],A=o.includes(E);if(A||xo.has(w)||g&&w){this.setAttribute("name",w!=null?w:S),v(this,Ht,"magic-word");let P=new RegExp(String.raw`^\s*${E}\s*$`,A?"u":"iu"),q=new pe(m,P,"magic-word-name",r,i,{});if(super.insertAt(q),x.length>0&&t.unshift([x.join(":")]),this.name==="invoke")for(let V=0;V<2;V++){let re=t.shift();if(!re)break;let fe=new z(re.join("="),`invoke-${V?"function":"module"}`,r,i);super.insertAt(fe)}}}if(this.type==="template"){let m=le(e).trim();if(!this.normalizeTitle(m,10,!0).valid)throw i.pop(),new SyntaxError("Invalid template name");let x=new z(e,"template-name",r,i,{});super.insertAt(x)}let p=this.isTemplate(),d=1;for(let m=0;m<t.length;m++){let x=t[m];!p&&!(this.name==="switch"&&m>0)&&(x[0]=x.join("="),x.length=1),x.length===1&&(x.unshift(d),d++),this.insertAt(new cr(...x,r,i))}this.seal("modifier")}get type(){return c(this,Ht)}setModifier(e){let{parserFunction:[,,t,r]}=this.getAttribute("config"),i=le(e).trim();if(e&&!i.endsWith(":"))return!1;let s=i.slice(0,-1).toLowerCase(),o=t.includes(s),l=r.includes(s);return c(this,Qe)&&o||!c(this,Qe)&&(l||e==="")||(ke.running||this.length>1)&&(o||l||e==="")?(this.setAttribute("modifier",e),v(this,Qe,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()}toString(){return`{{${this.modifier}${this.type==="magic-word"?`${this.firstChild.toString()}${this.length===1?"":":"}${this.childNodes.slice(1).map(String).join("|")}`:super.toString("|")}}}`}text(){let{childNodes:e,length:t,firstChild:r,modifier:i,type:s,name:o}=this;return s==="magic-word"&&o==="vardefine"?"":`{{${i}${s==="magic-word"?r.text()+(t===1?"":":")+de(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 r=super.lint(e,t),{type:i,childNodes:s,length:o}=this,l=new F(this,e);if(!this.isTemplate())return r;let g=I(this,Tt,yi).call(this);if(g.fragment!==void 0){let d=s[i==="template"?0:1],u=C(d,l,"no-ignored","useless fragment"),h=d.childNodes.find(m=>m.type==="text"&&m.data.includes("#"));h&&(u.fix={range:[u.startIndex+h.getRelativeIndex()+h.data.indexOf("#"),u.endIndex],text:""}),r.push(u)}if(g.valid||r.push(C(s[1],l,"invalid-invoke","illegal module name")),i==="magic-word"&&o===2)return r.push($(this,l,"invalid-invoke","missing module function")),r;let p=this.getDuplicatedArgs().filter(([,d])=>!d[0].querySelector("ext"));return p.length>0&&r.push(...p.flatMap(([,d])=>d).map(d=>C(d,l,"no-duplicate","duplicated parameter"))),r}insertAt(e,t=this.length){return super.insertAt(e,t),e.anon?I(this,Tt,vi).call(this,e):e.name&&this.getArgs(e.name,!1,!1).add(e),e}getAllArgs(){return this.childNodes.filter(Ke("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:e})=>e)}getArgs(e,t,r=!0){let i=String(e).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),s;return c(this,Ze).has(i)?s=c(this,Ze).get(i):(s=new Set(this.getAllArgs().filter(({name:o})=>i===o)),c(this,Ze).set(i,s)),s}getDuplicatedArgs(){return[...c(this,Ze)].filter(([,{size:e}])=>e>1).map(([e,t])=>[e,[...t]])}getPossibleValues(){let{type:e,name:t,childNodes:r}=this;if(e==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let i;switch(t){case"if":case"ifexist":case"ifexpr":case"iferror":i=2;break;case"ifeq":i=3;break;default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}let s=r.slice(i,i+2).map(({childNodes:[,o]})=>o);for(let o=0;o<s.length;){let{length:l,0:g}=s[o].childNodes.filter(p=>p.text().trim());if(l===0)s.splice(o,1);else if(l>1||g.type!=="magic-word")o++;else try{let p=g.getPossibleValues();s.splice(o,1,...p),o+=p.length}catch(p){o++}}return s}print(){let{childNodes:e,length:t,firstChild:r,modifier:i,type:s}=this;return`<span class="wpb-${s}">{{${lt(i)}${s==="magic-word"?r.print()+(t===1?"":":")+$e(e.slice(1),{sep:"|"}):$e(e,{sep:"|"})}}}</span>`}};Ht=new WeakMap,Qe=new WeakMap,Ze=new WeakMap,Tt=new WeakSet,yi=function(){let e=this.type==="template",t=this.childNodes[e?0:1];return this.normalizeTitle(t.text(),e?10:828)},vi=function(e){let t=this.getAnonArgs(),r=typeof e!="number";for(let i=r?t.indexOf(e):e-1;i<t.length;i++){let s=t[i],{name:o}=s,l=String(i+1);o!==l&&(s.setAttribute("name",l),this.getArgs(l,!1,!1).add(s))}}});var wi,Kr,To,Je,Si=k(()=>{"use strict";De();B();wi=[ge(!0)];Je=class extends(To=T){get type(){return"hidden"}};Kr=se(To),Je=ae(Kr,0,"HiddenToken",wi,Je),oe(Kr,1,Je)});var hr,Ci=k(()=>{"use strict";X();j();Q();R();B();Ne();Si();hr=class extends T{get type(){return"arg"}get default(){var n,e;return(e=(n=this.childNodes[1])==null?void 0:n.text())!=null?e:!1}constructor(n,e=f.getConfig(),t=[]){super(void 0,e,t,{});for(let r=0;r<n.length;r++)if(r===0){let i=new z(n[r],"arg-name",e,t,{});super.insertAt(i)}else if(r>1){let i=new Je(n[r],e,t);super.insertAt(i)}else{let i=new T(n[r],e,t);i.type="arg-default",i.setAttribute("stage",2),super.insertAt(i)}}toString(){return`{{{${super.toString("|")}}}}`}text(){return`{{{${de(this.childNodes.slice(0,2),"|")}}}}`}getAttribute(n){return n==="padding"?3:super.getAttribute(n)}getGaps(){return 1}lint(n=this.getAbsoluteIndex(),e){let{childNodes:[t,r,...i]}=this;if(!this.getAttribute("include")){let o=$(this,{start:n},"no-arg","unexpected template argument");return r&&(o.fix={range:[n,o.endIndex],text:r.text()}),[o]}let s=t.lint(n+3,e);if(r&&s.push(...r.lint(n+4+t.toString().length,e)),i.length>0){let o=new F(this,n);s.push(...i.map(l=>{let g=C(l,o,"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 s}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(){let n=super.json();return n.default=this.default,n}}});var $i={};H($i,{parseBraces:()=>Jr});var bo,mr,ko,Jr,Yr=k(()=>{"use strict";X();Zr();Ai();Ci();bo={"=":`
|
|
8
|
+
`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},mr=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"]]),ko=new RegExp(String.raw`\{\{\s*(${[...mr.keys()].map(rr).join("|")})\s*\}\}(?!\})`,"gu"),Jr=(a,n,e)=>{var u,h,m,x,b,E;let t=String.raw`${(u=n.excludes)!=null&&u.includes("heading")?"":String.raw`^(\0\d+c\x7F)*={1,6}|`}\[\[|-\{(?!\{)`,r=String.raw`|\{{2,}`,{parserFunction:[,,,i]}=n,s=[];a=a.replace(ko,(S,w)=>(new Dt(S.slice(2,-2),[],n,e),`\0${e.length-2}${mr.get(w)}\x7F`));let o=a.lastIndexOf("}}")-a.length,l=o+a.length!==-1,g=new RegExp(t+(l?r:""),"gmu"),p=g.exec(a),d;for(;p||d!==void 0&&d<=a.length&&((m=(h=s[s.length-1])==null?void 0:h[0])!=null&&m.startsWith("="));){if(p!=null&&p[1]){let[,{length:W}]=p;p[0]=p[0].slice(W),p.index+=W}let{0:S,index:w}=p!=null?p:{0:`
|
|
9
|
+
`,index:a.length},A=(x=s.pop())!=null?x:{},{0:L,index:P,parts:q,findEqual:V,pos:re}=A,fe=S==="="&&V,Re=W=>{q[q.length-1].push(W.slice(re,w))};if(S==="]]"||S==="}-")d=w+2;else if(S===`
|
|
10
|
+
`){d=w+1;let{pos:W,findEqual:N}=(b=s[s.length-1])!=null?b:{};if(W===void 0||N||le(a.slice(W,P))!==""){let xe=/^(={1,6})(.+)\1((?:\s|\0\d+c\x7F)*)$/u.exec(a.slice(P,w));xe&&(a=`${a.slice(0,P)}\0${e.length}h\x7F${a.slice(w)}`,d=P+4+String(e.length).length,new xt(xe[1].length,xe.slice(2),n,e))}}else if(S==="|"||fe)d=w+1,Re(a),S==="|"&&q.push([]),A.pos=d,A.findEqual=S==="|",s.push(A);else if(S.startsWith("}}")){let W=S.slice(0,Math.min(L.length,3)),N=L.length-W.length,{length:xe}=e;d=w+W.length,Re(a);let ye=!1,Pe="t";if(W.length===3){let ee=q.map(it=>it.join("=")),ve=ee.length>1&&le(ee[1]).trim();new hr(ee,n,e),ve&&ve.endsWith(":")&&i.includes(ve.slice(0,-1).toLowerCase())&&(Pe="s")}else try{new Dt(q[0][0],q.slice(1),n,e);let ee=le(q[0][0]).trim();mr.has(ee)?Pe=mr.get(ee):/^(?:filepath|(?:full|canonical)urle?):.|^server$/iu.test(ee)?Pe="m":/^#vardefine:./iu.test(ee)&&(Pe="c")}catch(ee){if(ee instanceof SyntaxError&&ee.message==="Invalid template name")ye=!0;else throw ee}ye||(a=`${a.slice(0,P+N)}\0${xe}${Pe}\x7F${a.slice(d)}`,d=P+N+3+String(xe).length,N>1?s.push({0:L.slice(0,N),index:P,pos:P+N,parts:[[]]}):N===1&&a[P-1]==="-"&&s.push({0:"-{",index:P-1,pos:P+1,parts:[[]]}))}else d=w+S.length,S.startsWith("{")&&(p.pos=d,p.parts=[[]]),s.push(..."0"in A?[A]:[],p);let ie=s[s.length-1];if(l&&o+a.length<d)for(l=!1;(E=ie==null?void 0:ie[0])!=null&&E.startsWith("{");)s.pop(),ie=s[s.length-1];g=new RegExp(t+(l?r:"")+(ie?`|${bo[ie[0][0]]}${ie.findEqual?"|=":""}`:""),"gmu"),g.lastIndex=d,p=g.exec(a)}return a}});var Ni={};H(Ni,{InputboxToken:()=>en});var en,Ei=k(()=>{"use strict";Yr();R();Qr();en=class extends Wt{constructor(n,e=f.getConfig(),t=[]){let r=Symbol("InputboxToken"),{length:i}=t;t.push(r),n&&(n=Jr(n,e,t)),t.splice(i,1),super(n,e,t,{})}}});var Ii,tn,yo,Ee,rn=k(()=>{"use strict";j();De();R();qe();Ii=[ge()];Ee=class extends(yo=Y){constructor(e,t=!0,r,i){super(e,r,i);U(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=$(this,{start:e},"unclosed-comment",f.msg("unclosed $1","HTML comment"));return t.fix={range:[t.endIndex,t.endIndex],text:"-->"},[t]}toString(){return`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"<!--",post:this.closed?"-->":""})}};tn=se(yo),Ee=ae(tn,0,"CommentToken",Ii,Ee),oe(tn,1,Ee)});var fr={};H(fr,{NestedToken:()=>nn});var nn,xr=k(()=>{"use strict";j();Q();R();B();sn();_e();rn();nn=class extends T{get type(){return"ext-inner"}constructor(n,e,t,r=f.getConfig(),i=[]){n=n==null?void 0:n.replace(e,(s,o,l,g,p)=>{let d=`\0${i.length+1}${o?"e":"c"}\x7F`;if(o)new bt(o,l,g,p,r,i);else{let u=s.endsWith("-->");new Ee(s.slice(4,u?-3:void 0),u,r,i)}return d}).replace(/(^|\0\d+[ce]\x7F)([^\0]+)(?=$|\0\d+[ce]\x7F)/gu,(s,o,l)=>(new D(l,r,i),`${o}\0${i.length}c\x7F`)),super(n,r,i,{})}lint(n=this.getAbsoluteIndex(),e){let t=new F(this,n);return[...super.lint(n,e),...this.childNodes.filter(r=>{if(r.type==="ext"||r.type==="comment")return!1;let i=r.toString().trim();return i&&!/^<!--.*-->$/su.test(i)}).map(r=>{let i=C(r,t,"no-ignored",f.msg("invalid content in <$1>",this.name));return i.suggestions=[{desc:"remove",range:[i.startIndex,i.endIndex],text:""},{desc:"comment",range:[i.startIndex,i.startIndex],text:`<!--${r.toString()}-->`}],i})]}}});function Li(a,n,e,t,r){n=n.trim();let i=n.replace(/\0\d+t\x7F/gu,"").trim();switch(a){case"width":return!i||/^(?:\d+x?|\d*x\d+)(?:\s*px)?$/u.test(i);case"link":{if(!i||new RegExp(String.raw`^(?:(?:${e.protocol}|//)${Ae}|\0\d+m\x7F)${we}$`,"iu").test(i))return n;i.startsWith("[[")&&i.endsWith("]]")&&(i=i.slice(2,-2));let o=f.normalizeTitle(i,0,!1,e,t,!0,!0);return o.valid&&o}case"lang":return(r==="svg"||r==="svgz")&&!/[^a-z\d-]/u.test(i);case"alt":case"class":case"manualthumb":return!0;case"page":return(r==="djvu"||r==="djv"||r==="pdf")&&Number(i)>0;default:return!!i&&!isNaN(i)}}var vo,te,br,Fi,Tr,Ri=k(()=>{"use strict";X();j();R();B();vo=new Set(["alt","link","lang","page","caption"]);Tr=class extends T{constructor(e,t,r=f.getConfig(),i){var n=(...Gd)=>(super(...Gd),y(this,br),y(this,te,""),this);var g;let s,o=Object.entries(r.img).map(([p,d])=>[p,d,new RegExp(String.raw`^(\s*(?!\s))${p.replace("$1","(.*)")}${p.endsWith("$1")?`(?=$|
|
|
11
|
+
)`:""}(\s*)$`,"u")]),l=o.find(([,p,d])=>(s=d.exec(e),s&&(s.length!==4||Li(p,s[2],r,!0,t)!==!1)));if(l&&s){s.length===3?(n(void 0,r,i),v(this,te,e)):(n(s[2],r,i,{}),v(this,te,s[1]+l[0]+s[3])),this.setAttribute("name",l[1]);return}n(e,{...r,excludes:[...(g=r.excludes)!=null?g:[],"list"]},i),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get type(){return"image-parameter"}get link(){return this.name==="link"?Li("link",super.text(),this.getAttribute("config")):void 0}afterBuild(){var e;((e=this.parentNode)==null?void 0:e.type)==="gallery-image"&&!vo.has(this.name)&&this.setAttribute("name","invalid"),super.afterBuild()}toString(){return c(this,te)?c(this,te).replace("$1",super.toString()):super.toString()}text(){return c(this,te)?c(this,te).replace("$1",super.text()).trim():super.text().trim()}getAttribute(e){return e==="plain"?this.name==="caption":e==="padding"?Math.max(0,c(this,te).indexOf("$1")):super.getAttribute(e)}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{link:i,name:s}=this;if(s==="invalid"){let o=$(this,{start:e},"invalid-gallery","invalid gallery image parameter");o.fix={range:[e,e+o.endIndex],text:""},r.push(o)}else typeof i=="object"&&i.encoded&&r.push($(this,{start:e},"url-encoding","unnecessary URL encoding in an internal link"));return r}getValue(){return this.name==="invalid"?this.text():I(this,br,Fi).call(this)||super.text()}print(){return c(this,te)?`<span class="wpb-image-parameter">${c(this,te).replace("$1",`<span class="wpb-image-caption">${$e(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}};te=new WeakMap,br=new WeakSet,Fi=function(){return c(this,te)&&!c(this,te).includes("$1")}});var on,an,ln,Ao,kt,kr,yt,dn=k(()=>{"use strict";X();j();Q();R();Gt();Ri();on=new Set(["manualthumb","frameless","framed","thumbnail"]),an=new Set(["left","right","center","none"]),ln=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),Ao=(a,n,e,t)=>{if(t===void 0)return[];let r=new RegExp(`${[a,n,e].map(rr).join("|")}`,"gu"),i=[],s=r.exec(t),o=0,l=0;for(;s;){let{0:g,index:p}=s;g!==e?o+=g===a?1:-1:o===0&&(i.push(t.slice(l,p)),{lastIndex:l}=r),s=r.exec(t)}return i.push(t.slice(l)),i},yt=class extends Ce{constructor(e,t,r=f.getConfig(),i=[],s="|"){super(e,void 0,r,i,s);y(this,kt);let{extension:o}=this.getTitle(!0);this.append(...Ao("-{","}-","|",t).map(l=>new Tr(l,o,r,i)))}get type(){return"file"}get extension(){return this.getTitle().extension}lint(e=this.getAbsoluteIndex(),t){var u;let r=super.lint(e,t),i=this.getAllArgs().filter(({childNodes:h})=>{let m=h.filter(x=>x.text().trim());return m.length!==1||m[0].type!=="arg"}),s=[...new Set(i.map(({name:h})=>h))].filter(h=>h!=="invalid"),o=s.filter(h=>on.has(h)),l=s.filter(h=>an.has(h)),g=s.filter(h=>ln.has(h)),p=new F(this,e);if(this.closest("ext-link-text")&&((u=this.getValue("link"))==null?void 0:u.trim())!==""&&r.push($(this,p,"nested-link","internal link in an external link")),i.length===s.length&&o.length<2&&l.length<2&&g.length<2)return r;let d=(h,m)=>x=>C(x,p,"no-duplicate",f.msg(`${h} image $1 parameter`,m));for(let h of s){let m=i.filter(({name:x})=>x===h);h==="caption"&&(m=[...m.slice(0,-1).filter(x=>x.text()),...m.slice(-1)]),m.length>1&&r.push(...m.map(d("duplicated",h)))}return o.length>1&&r.push(...i.filter(({name:h})=>on.has(h)).map(d("conflicting","frame"))),l.length>1&&r.push(...i.filter(({name:h})=>an.has(h)).map(d("conflicting","horizontal-alignment"))),g.length>1&&r.push(...i.filter(({name:h})=>ln.has(h)).map(d("conflicting","vertical-alignment"))),r}getAllArgs(){return this.childNodes.slice(1)}getArgs(e){return this.getAllArgs().filter(({name:t})=>e===t)}getFrameArgs(){return I(this,kt,kr).call(this,on,"frame")}getHorizAlignArgs(){return I(this,kt,kr).call(this,an,"horizontal-align")}getVertAlignArgs(){return I(this,kt,kr).call(this,ln,"vertical-align")}getArg(e){let t=this.getArgs(e);return t[t.length-1]}getValue(e){var t;return(t=this.getArg(e))==null?void 0:t.getValue()}};kt=new WeakSet,kr=function(e,t){return this.getAllArgs().filter(({name:i})=>e.has(i))}});var vt,gn=k(()=>{"use strict";j();Se();R();B();dn();vt=class extends yt{constructor(e,t,r,i=f.getConfig(),s=[]){let o;if(r!==void 0){let{length:l}=s;o=new T(r,i,s);for(let g=1;g<11;g++)o.parseOnce();s.splice(l,1)}super(t,o==null?void 0:o.toString(),i,s);U(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 r=super.lint(e,t),{ns:i,interwiki:s}=this.getAttribute("title");return(s||i!==6)&&r.push($(this,{start:e},"invalid-gallery","invalid gallery image")),r}}});var Bi={};H(Bi,{GalleryToken:()=>pn});var yr,Pi,pn,ji=k(()=>{"use strict";R();B();gn();_e();pn=class extends T{constructor(e,t=f.getConfig(),r=[]){var i;super(void 0,t,r,{});y(this,yr);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 D(s,t,r):s);continue}let[,l,g]=o;I(this,yr,Pi).call(this,l)?super.insertAt(new vt("gallery",l,g,t,r)):super.insertAt(new D(s,t,r))}}get type(){return"ext-inner"}toString(){return super.toString(`
|
|
13
13
|
`)}text(){return super.text(`
|
|
14
14
|
`).replace(/\n\s*\n/gu,`
|
|
15
|
-
`)}getGaps(){return 1}lint(e=this.getAbsoluteIndex(),t){let{top:r,left:
|
|
16
|
-
`})}};
|
|
17
|
-
`),
|
|
18
|
-
`),
|
|
15
|
+
`)}getGaps(){return 1}lint(e=this.getAbsoluteIndex(),t){let{top:r,left:i}=this.getRootNode().posFromIndex(e),s=[];for(let o=0;o<this.length;o++){let l=this.childNodes[o],g=l.toString(),{length:p}=g,d=g.trim(),u=r+o,h=o?0:i;l.type==="noinclude"&&d&&!/^<!--.*-->$/u.test(d)?s.push({rule:"no-ignored",message:f.msg("invalid content in <$1>","gallery"),severity:d.startsWith("|")?"warning":"error",startIndex:e,endIndex:e+p,startLine:u,endLine:u,startCol:h,endCol:h+p,suggestions:[{desc:"remove",range:[e,e+p],text:""},{desc:"comment",range:[e,e+p],text:`<!--${g}-->`}]}):l.type!=="noinclude"&&l.type!=="text"&&s.push(...l.lint(e,t)),e+=p+1}return s}print(){return super.print({sep:`
|
|
16
|
+
`})}};yr=new WeakSet,Pi=function(e){return this.normalizeTitle(e,6,!0,!0).valid}});var At,un=k(()=>{"use strict";j();Gt();At=class extends Ce{get type(){return"link"}lint(n=this.getAbsoluteIndex(),e){let t=super.lint(n,e);return this.closest("ext-link-text")&&t.push($(this,{start:n},"nested-link","internal link in an external link")),t}}});var wo,So,Vt,Ie,vr=k(()=>{"use strict";j();Q();X();R();B();wo=String.raw`(?:[\p{Zs}\t]| |�*160;|&#[xX]0*[aA]0;)`,So=new RegExp(`${wo}+`,"gu"),Ie=class extends T{constructor(e,t="free-ext-link",r=f.getConfig(),i){super(e,r,i,{});y(this,Vt);v(this,Vt,t)}get type(){return c(this,Vt)}get link(){let e={"!":"|","=":"="},t=de(this.childNodes.map(r=>{let{type:i,name:s}=r;return i==="magic-word"&&String(s)in e?e[s]:r}));return this.type==="magic-link"&&(t=t.replace(So," "),t.startsWith("ISBN")&&(t=`ISBN ${t.slice(5).replace(/[- ]/gu,"").replace(/x$/u,"X")}`)),t}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),i=new F(this,e);if(this.type==="magic-link"){let{link:p}=this;if(p.startsWith("ISBN")){let d=[...p.slice(5)].map(u=>u==="X"?10:Number(u));(d.length===10&&d.reduce((u,h,m)=>u+h*(10-m),0)%11||d.length===13&&(d[12]===10||d.reduce((u,h,m)=>u+h*(m%2?3:1),0)%10))&&r.push($(this,i,"invalid-isbn","invalid ISBN"))}return r}let s=this.type==="ext-link-url",o=s?String.raw`\|+`:"[\uFF0C\uFF1B\u3002\uFF1A\uFF01\uFF1F\uFF08\uFF09]+",l=new RegExp(o,"u"),g=new RegExp(o,"gu");for(let p of this.childNodes){let{type:d,data:u}=p;if(d!=="text"||!l.test(u))continue;let h=C(p,i,"unterminated-url","","warning");g.lastIndex=0;for(let m=g.exec(u);m;m=g.exec(u)){let{index:x,0:b}=m,E=u.slice(0,x).split(`
|
|
17
|
+
`),S=E.length,w=E[S-1].length,A=h.startIndex+x,L=h.startLine+S-1,P=S===1?h.startCol+w:w,q={...h,message:f.msg("$1 in URL",s?'"|"':"full-width punctuation"),startIndex:A,endIndex:A+b.length,startLine:L,endLine:L,startCol:P,endCol:P+b.length};s?b.length===1&&(q.suggestions=[{desc:"whitespace",range:[A,A+1],text:" "}]):q.suggestions=[{desc:"whitespace",range:[A,A],text:" "},{desc:"escape",range:[A,q.endIndex],text:encodeURI(b)}],r.push(q)}}return r}};Vt=new WeakMap});var Le,wt,cn=k(()=>{"use strict";Se();j();R();B();vr();wt=class extends T{constructor(e,t="",r="",i=f.getConfig(),s=[]){super(void 0,i,s,{});y(this,Le);let o=e&&/\0\d+f\x7F/u.test(e)?s[Number(e.slice(1,-2))]:new Ie(e,"ext-link-url",i,s);if(this.insertAt(o),v(this,Le,t),r){let l=new T(r,i,s,{});l.type="ext-link-text",l.setAttribute("stage",10),this.insertAt(l)}}get type(){return"ext-link"}toString(){return this.length===1?`[${super.toString()}${c(this,Le)}]`:`[${super.toString(c(this,Le))}]`}text(){return`[${super.text(" ")}]`}getAttribute(e){return e==="padding"?1:super.getAttribute(e)}getGaps(){return c(this,Le).length}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t);return this.length===1&&this.closest("heading-title")&&r.push($(this,{start:e},"var-anchor","variable anchor in a section header")),r}print(){return super.print(this.length===1?{pre:"[",post:`${c(this,Le)}]`}:{pre:"[",sep:c(this,Le),post:"]"})}};Le=new WeakMap});var Xt,qi=k(()=>{"use strict";R();B();_e();un();cn();Xt=class extends T{get type(){return"imagemap-link"}constructor(n,e,t,r=f.getConfig(),i=[]){super(void 0,r,i),this.append(n,e.length===2?new At(...e,r,i):new wt(...e,r,i),new D(t,r,i))}}});var _i={};H(_i,{ImagemapToken:()=>hn});var hn,Gi=k(()=>{"use strict";j();Q();Te();R();B();_e();gn();qi();hn=class extends T{get type(){return"ext-inner"}get image(){return this.childNodes.find(Ke("imagemap-image"))}constructor(n,e=f.getConfig(),t=[]){if(super(void 0,e,t,{}),!n)return;let r=n.split(`
|
|
18
|
+
`),i=new Set(e.protocol.split("|")),s=D,o=!0,l=!1;for(let g of r){let p=g.trim();if(!(l||!p||p.startsWith("#"))){if(o){let[d,...u]=g.split("|"),h=this.normalizeTitle(d,0,!0);if(h.valid&&!h.interwiki&&h.ns===6){let m=new vt("imagemap",d,u.length>0?u.join("|"):void 0,e,t);super.insertAt(m),o=!1;continue}else l=!0}else if(g.trim().split(/[\t ]/u)[0]==="desc"){super.insertAt(g);continue}else if(g.includes("[")){let d=g.indexOf("["),u=g.slice(d),h=/^\[\[([^|]+)(?:\|([^\]]+))?\]\][\w\s]*$/u.exec(u);if(h){if(this.normalizeTitle(h[1],0,!0,!1,!0).valid){super.insertAt(new Xt(g.slice(0,d),h.slice(1),u.slice(u.indexOf("]]")+2),e,t));continue}}else if(i.has(u.slice(1,u.indexOf(":")+1))||i.has(u.slice(1,u.indexOf("//")+2))){let m=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(u);if(m){super.insertAt(new Xt(g.slice(0,d),m.slice(1),u.slice(u.indexOf("]")+1),e,t));continue}}}}super.insertAt(new s(g,e,t))}}toString(){return super.toString(`
|
|
19
19
|
`)}text(){return super.text(`
|
|
20
20
|
`).replace(/\n{2,}/gu,`
|
|
21
|
-
`)}getGaps(){return 1}lint(
|
|
22
|
-
`})}}});var
|
|
23
|
-
${
|
|
24
|
-
`)}getAttr(e){let t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}print(){let{childNodes:[e,t,r]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${
|
|
25
|
-
|}`,
|
|
26
|
-
`),o=
|
|
27
|
-
${s.shift()}`,
|
|
28
|
-
${
|
|
29
|
-
${d}`;continue}let
|
|
30
|
-
${d}`,
|
|
31
|
-
${
|
|
32
|
-
${
|
|
33
|
-
${c}${A}`,V=re=>{let xe=new Ye(W,w.slice(F,B==null?void 0:B.index),t,r);return re.insertAt(xe),xe};for(;B;)V(a),{lastIndex:F}=S,[W]=B,B=S.exec(w);n.push(a,V(a))}}return o.slice(1)}});var kr,Ji=k(()=>{"use strict";qe();kr=class extends Y{constructor(){super(...arguments);x(this,"type","hr")}}});var Yi,xn,Io,tt,es=k(()=>{"use strict";De();qe();Yi=[pe(!0)];tt=class extends(Io=Y){constructor(e,t,r,n){super(e,r,n);x(this,"type","double-underscore")}getAttribute(e){return e==="padding"?2:super.getAttribute(e)}toString(){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}};xn=se(Io),tt=ae(xn,0,"DoubleUnderscoreToken",Yi,tt),oe(xn,1,tt)});var ts={};H(ts,{parseHrAndDoubleUnderscore:()=>Lo});var Lo,rs=k(()=>{"use strict";Ji();es();Ur();Lo=({firstChild:{data:l},type:i,name:e},t,r)=>{let{doubleUnderscore:n}=t,s=new Set(n[0]),o=new Set(n[1]);return i!=="root"&&(i!=="ext-inner"||e!=="poem")&&(l=`\0${l}`),l=l.replace(/^((?:\0\d+c\x7F)*)(-{4,})/gmu,(a,p,g)=>(new kr(g,t,r),`${p}\0${r.length-1}r\x7F`)).replace(new RegExp(`__(${[...n[0],...n[1]].join("|")})__`,"giu"),(a,p)=>{let g=o.has(p);return g||s.has(p.toLowerCase())?(new tt(p,g,t,r),`\0${r.length-1}u\x7F`):a}).replace(/^((?:\0\d+c\x7F)*)(={1,6})(.+)\2((?:[^\S\n]|\0\d+c\x7F)*)$/gmu,(a,p,g,d,c)=>{let u=`${p}\0${r.length}h\x7F`;return new ft(g.length,[d,c],t,r),u}),i==="root"||i==="ext-inner"&&e==="poem"?l:l.slice(1)}});var Ar,ns=k(()=>{"use strict";q();Q();P();qe();Ar=class extends Y{constructor(){super(...arguments);x(this,"type","quote")}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}lint(e=this.getAbsoluteIndex()){let{previousSibling:t,nextSibling:r,bold:n}=this,s=T.msg('lonely "$1"',"'"),o=[],a=new R(this,e),p,g=(d,c,u)=>({desc:"escape",range:[d,c],text:"'".repeat(u)});if((t==null?void 0:t.type)==="text"&&t.data.endsWith("'")){p=E(this,a,"lonely-apos",s);let{startIndex:d,startLine:c,startCol:u}=p,[,{length:m}]=/(?:^|[^'])('+)$/u.exec(t.data),f=e-m;o.push({...p,startIndex:f,endIndex:d,startCol:u-m,endLine:c,endCol:u,suggestions:[g(f,d,m)]})}if((r==null?void 0:r.type)==="text"&&r.data.startsWith("'")){p!=null||(p=E(this,a,"lonely-apos",s));let{endIndex:d,endLine:c,endCol:u}=p,[{length:m}]=/^'+/u.exec(r.data),f=d+m;o.push({...p,startIndex:d,endIndex:f,startLine:c,startCol:u,endCol:u+m,suggestions:[g(d,f,m)]})}return n&&this.closest("heading-title")&&o.push(E(this,a,"bold-header","bold in section header","warning")),o}json(){let e=super.json();return Object.assign(e,{bold:this.bold,italic:this.italic}),e}}});var is={};H(is,{parseQuotes:()=>Tn});var Tn,bn=k(()=>{"use strict";ns();Tn=(l,i,e)=>{var g;let t=l.split(/('{2,})/u),{length:r}=t;if(r===1)return l;let n=0,s=0,o,a,p;for(let d=1;d<r;d+=2){let c=t[d].length;switch(c){case 2:s++;break;case 4:t[d-1]+="'",t[d]="'''";case 3:if(n++,o!==void 0)break;t[d-1].endsWith(" ")?a===void 0&&p===void 0&&(p=d):t[d-1].slice(-2,-1)===" "?o=d:a!=null||(a=d);break;default:t[d-1]+="'".repeat(c-5),t[d]="'''''",s++,n++}}if(s%2===1&&n%2===1){let d=(g=o!=null?o:a)!=null?g:p;d!==void 0&&(t[d]="''",t[d-1]+="'")}for(let d=1;d<r;d+=2)new Ar(t[d],i,e),t[d]=`\0${e.length-1}q\x7F`;return t.join("")}});var ss={};H(ss,{parseExternalLinks:()=>yn});var yn,kn=k(()=>{"use strict";X();an();xr();yn=(l,i,e,t)=>{let r=new RegExp(String.raw`\[(\0\d+f\x7F|(?:(?:${i.protocol}|//)${we}|\0\d+m\x7F)${Se}(?=[[\]<>"\t\p{Zs}]|\0\d))(\p{Zs}*(?!\p{Zs}))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu");return l.replace(r,(n,s,o,a)=>{let{length:p}=e,g=/&[lg]t;/u.exec(s);return g&&(s=s.slice(0,g.index),o="",a=s.slice(g.index)+o+a),t?(new Le(s,"ext-link-url",i,e),`[\0${p}f\x7F${o}${a}]`):(new vt(s,o,a,i,e),`\0${p}w\x7F`)})}});var vr,os=k(()=>{"use strict";qt();vr=class extends $e{constructor(){super(...arguments);x(this,"type","category")}}});var ls={};H(ls,{parseLinks:()=>as});var as,ds=k(()=>{"use strict";P();bn();kn();on();rn();os();as=(l,i,e)=>{let t=i.inExt?/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)(.*?[^\]]))?\]\](.*)$/su:/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)(.*?[^\]])?)?\]\](.*)$/su,r=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)(.*)$/su,n=new RegExp(String.raw`^\s*(?:${i.protocol}|//)`,"iu"),s=l.split("[["),o=s.shift();for(let a=0;a<s.length;a++){let p=!1,g,d,c,u,m=s[a],f=t.exec(m);if(f)[,g,d,c,u]=f,u.startsWith("]")&&(c!=null&&c.includes("["))&&(c+="]",u=u.slice(1));else{let F=r.exec(m);F&&(p=!0,[,g,d,c]=F)}if(g===void 0||n.test(g)||/\0\d+[exhbru]\x7F/u.test(g)){o+=`[[${m}`;continue}let b=g.trim().startsWith(":");if(b&&p){o+=`[[${m}`;continue}let L=T.normalizeTitle(g,0,!1,i,!0,!0,!0),{ns:A,valid:w,interwiki:S}=L;if(w){if(p){if(S||A!==6){o+=`[[${m}`;continue}let F=!1;for(a++;a<s.length;a++){let W=s[a],V=W.split("]]");if(V.length>2){F=!0,c+=`[[${V[0]}]]${V[1]}`,u=V.slice(2).join("]]");break}else if(V.length===2)c+=`[[${V[0]}]]${V[1]}`;else{c+=`[[${W}`;break}}if(c=as(c,i,e),!F){o+=`[[${g}${d}${c}`;continue}}}else{o+=`[[${m}`;continue}c&&(c=Tn(c,i,e));let B=At;b||(!S&&A===6?(c&&(c=yn(c,i,e,!0)),B=yt):!S&&A===14&&(B=vr)),c===void 0&&d&&(c=""),o+=`\0${e.length}l\x7F${u}`,new B(g,c,i,e,d)}return o}});var gs={};H(gs,{parseMagicLinks:()=>Po});var Fo,Ro,Po,ps=k(()=>{"use strict";X();xr();Fo=/[^,;\\.:!?)][,;\\.:!?)]+$/u,Ro=/[^,;\\.:!?][,;\\.:!?]+$/u,Po=(l,i,e)=>{let t=String.raw`[\p{Zs}\t]| |�*160;|�*a0;`,r=`(?:${t}|-)`,n=new RegExp(String.raw`(^|[^\p{L}\d_])(?:(?:${i.protocol})(${we}${Se})|(?:RFC|PMID)(?:${t})+\d+\b|ISBN(?:${t})+(?:97[89]${r}?)?(?:\d${r}?){9}[\dx]\b)`,"giu");return l.replace(n,(s,o,a)=>{let p=o?s.slice(o.length):s;if(a){let g="",d=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(p);d&&(g=p.slice(d.index),p=p.slice(0,d.index));let c=p.includes("(")?Ro:Fo,u=c.exec(p);if(u){let m=1;u[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(p.slice(0,u.index))&&(m=2),g=p.slice(u.index+m)+g,p=p.slice(0,u.index+m)}return g.length>=a.length?s:(new Le(p,void 0,i,e),`${o}\0${e.length-1}w\x7F${g}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(p))return s;return new Le(p,"magic-link",i,e),`${o}\0${e.length-1}i\x7F`})}});var wr,us=k(()=>{"use strict";mn();wr=class extends $t{constructor(){super(...arguments);x(this,"type","list")}}});var cs={};H(cs,{parseList:()=>Bo});var Bo,hs=k(()=>{"use strict";us();fn();Bo=(l,i,e)=>{let t=/^((?:\0\d+c\x7F)*)([;:*#]+)/u.exec(l);if(!t)return l;let[r,n,s]=t,o=`${n}\0${e.length}d\x7F${l.slice(r.length)}`,a=s.split(";").length-1;if(new wr(s,i,e),!a)return o;let{html:[p]}=i,g=/:+|-\{|\0\d+[xq]\x7F/gu,d=g,c=d.exec(o),u=0,m=!1,f=!1,b=0,L=(w,S)=>(new Nt(w,i,e),`${o.slice(0,S)}\0${e.length-1}d\x7F${o.slice(S+w.length)}`),A=w=>{w?u&&u--:u++};for(;c&&a;){let{0:w,index:S}=c;if(w==="-{"){if(!b){let{lastIndex:B}=d;d=/-\{|\}-/gu,d.lastIndex=B}b++}else if(w==="}-"){if(b--,!b){let{lastIndex:B}=d;d=g,d.lastIndex=B}}else if(w.endsWith("x\x7F")){let{name:B,closing:F,selfClosing:W}=e[Number(w.slice(1,-2))];(!W||p.includes(B))&&A(F)}else if(w.endsWith("q\x7F")){let{bold:B,italic:F}=e[Number(w.slice(1,-2))];B&&(A(m),m=!m),F&&(A(f),f=!f)}else if(u===0){if(w.length>=a)return L(w.slice(0,a),S);a-=w.length,d.lastIndex=S+4+String(e.length).length,o=L(w,S)}c=d.exec(o)}return o}});var ms,Re,Sr,fs=k(()=>{"use strict";q();Q();P();j();Ee();ms=new Set(["A","T","R","D","-","H","N"]),Sr=class extends y{constructor(e,t=T.getConfig(),r=[]){super(void 0,t,r,{});x(this,"type","converter-flags");v(this,Re);this.append(...e.map(n=>new z(n,"converter-flag",t,r)))}afterBuild(){C(this,Re,this.childNodes.map(e=>e.text().trim())),super.afterBuild()}toString(){return super.toString(";")}text(){return super.text(";")}getGaps(){return 1}getUnknownFlags(){return new Set(h(this,Re).filter(e=>/\{{3}[^{}]+\}{3}/u.test(e)))}getVariantFlags(){let e=new Set(this.getAttribute("config").variants);return new Set(h(this,Re).filter(t=>e.has(t)))}lint(e=this.getAbsoluteIndex(),t){let r=this.getVariantFlags(),n=this.getUnknownFlags(),s=new Set(h(this,Re).filter(u=>ms.has(u))),o=h(this,Re).filter(u=>!u).length,a=h(this,Re).length-n.size-o,p=super.lint(e,t);if(r.size===a||s.size===a)return p;let g=new R(this,e),{childNodes:d,length:c}=this;for(let u=0;u<c;u++){let m=d[u],f=m.text().trim();if(f&&!r.has(f)&&!n.has(f)&&(r.size>0||!s.has(f))){let b=$(m,g,"no-ignored","invalid conversion flag");r.size===0&&ms.has(f.toUpperCase())?b.fix={range:[b.startIndex,b.endIndex],text:f.toUpperCase()}:b.suggestions=[{desc:"remove",range:[b.startIndex,b.endIndex],text:""}],p.push(b)}}return p}print(){return super.print({sep:";"})}};Re=new WeakMap});var Et,xs=k(()=>{"use strict";P();j();Ee();Et=class extends y{constructor(e,t=!0,r=T.getConfig(),n=[]){super(void 0,r,n);x(this,"type","converter-rule");let s=e.indexOf(":"),o=e.slice(0,s).indexOf("=>"),a=o===-1?e.slice(0,s):e.slice(o+2,s);t&&r.variants.includes(a.trim())?(super.insertAt(new z(a,"converter-rule-variant",r,n)),super.insertAt(new z(e.slice(s+1),"converter-rule-to",r,n)),o!==-1&&super.insertAt(new z(e.slice(0,o),"converter-rule-from",r,n),0)):super.insertAt(new z(e,"converter-rule-to",r,n))}toString(){let{childNodes:e}=this;if(e.length===3){let[t,r,n]=e;return`${t.toString()}=>${r.toString()}:${n.toString()}`}return super.toString(":")}text(){let{childNodes:e}=this;if(e.length===3){let[t,r,n]=e;return`${t.text()}=>${r.text()}:${n.text()}`}return super.text(":")}getGaps(e){return e===0&&this.length===3?2:1}print(){let{childNodes:e}=this;if(e.length===3){let[t,r,n]=e;return`<span class="wpb-converter-rule">${t.print()}=>${r.print()}:${n.print()}</span>`}return super.print({sep:":"})}}});var Cr,Ts=k(()=>{"use strict";X();P();j();fs();xs();Cr=class extends y{constructor(e,t,r=T.getConfig(),n=[]){super(void 0,r,n);x(this,"type","converter");this.append(new Sr(e,r,n));let[s]=t,o=s.includes(":"),a=new Et(s,o,r,n);o&&a.length===1?this.insertAt(new Et(t.join(";"),!1,r,n)):this.append(a,...t.slice(1).map(p=>new Et(p,!0,r,n)))}toString(){let{childNodes:[e,...t]}=this;return`-{${e.toString()}${e.length>0?"|":""}${t.map(String).join(";")}}-`}text(){let{childNodes:[e,...t]}=this;return`-{${e.text()}|${de(t,";")}}-`}getAttribute(e){return e==="padding"?2:super.getAttribute(e)}getGaps(e){return e||this.firstChild.length>0?1:0}print(){let{childNodes:[e,...t]}=this;return`<span class="wpb-converter">-{${e.print()}${e.length>0?"|":""}${Ne(t,{sep:";"})}}-</span>`}}});var bs={};H(bs,{parseConverter:()=>jo});var jo,ys=k(()=>{"use strict";Ts();jo=(l,i,e)=>{let t=`(?:${i.variants.join("|")})`,r=/-\{/gu,n=/-\{|\}-/gu,s=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*${t}\s*:|(?:\s|\0\d+c\x7F)*$)`,"u"),o=[],a=r,p=a.exec(l);for(;p;){let{0:g,index:d}=p;if(g==="}-"){let c=o.pop(),{length:u}=e,m=l.slice(c.index+2,d),f=m.indexOf("|"),[b,L]=f===-1?[[],m]:[m.slice(0,f).split(";"),m.slice(f+1)],A=L.replace(/(&[#a-z\d]+);/giu,"$1"),w=A.split(s).map(S=>S.replace(/\x01/gu,";"));new Cr(b,w,i,e),l=`${l.slice(0,c.index)}\0${u}v\x7F${l.slice(d+2)}`,o.length===0&&(a=r),a.lastIndex=c.index+3+String(u).length}else o.push(p),a=n,a.lastIndex=d+2;p=a.exec(l)}return l}});var $r={};H($r,{Token:()=>y});var fe,_,M,rt,It,Ut,O,ks,As,vs,ws,Ss,Cs,$s,Ns,Es,Is,Ls,Fs,An,y,j=k(()=>{"use strict";X();Ce();be();q();P();Wn();Hn();An=class An extends Kt{constructor(e,t=T.getConfig(),r=[],n){super();v(this,O);x(this,"type","plain");v(this,fe,0);v(this,_);v(this,M);v(this,rt);v(this,It,!1);v(this,Ut);typeof e=="string"&&this.insertAt(e),C(this,_,t),C(this,M,r),r.push(this)}parseOnce(e=h(this,fe),t=!1){if(e<h(this,fe)||!this.getAttribute("plain")||this.length===0)return this;if(h(this,fe)>=11)return this;switch(e){case 0:if(this.type==="root"){h(this,M).shift();let r=N(this,O,ks).call(this);t&&(t=!r)}C(this,rt,t),N(this,O,As).call(this,t);break;case 1:N(this,O,vs).call(this);break;case 2:N(this,O,ws).call(this);break;case 3:N(this,O,Ss).call(this);break;case 4:N(this,O,Cs).call(this);break;case 5:N(this,O,$s).call(this);break;case 6:N(this,O,Ns).call(this);break;case 7:N(this,O,Es).call(this);break;case 8:N(this,O,Is).call(this);break;case 9:N(this,O,Ls).call(this);break;case 10:N(this,O,Fs).call(this)}if(this.type==="root")for(let r of h(this,M))r.parseOnce(e,t);return Xt(this,fe)._++,this}buildFromStr(e,t){let r=e.split(/[\0\x7F]/u).map((n,s)=>{if(s%2===0)return new Bt(n);if(isNaN(n.slice(-1)))return h(this,M)[Number(n.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${n}`)});return t===0?r.map(String).join(""):t===1?de(r):r}build(){C(this,fe,11);let{length:e,firstChild:t}=this,r=String(t);if(e===1&&t.type==="text"&&r.includes("\0")&&(this.replaceChildren(...this.buildFromStr(r)),this.normalize(),this.type==="root"))for(let n of h(this,M))n.build()}afterBuild(){if(this.type==="root")for(let e of h(this,M))e.afterBuild();C(this,It,!0)}parse(e=11,t){for(e=Math.min(e,11);h(this,fe)<e;)this.parseOnce(h(this,fe),t);return e&&(this.build(),this.afterBuild()),this}getAttribute(e){var t;switch(e){case"plain":return this.constructor===An;case"config":return h(this,_);case"include":return(t=h(this,rt))!=null?t:!!h(this.getRootNode(),rt);case"accum":return h(this,M);case"built":return h(this,It);default:return super.getAttribute(e)}}setAttribute(e,t){switch(e){case"stage":h(this,fe)===0&&this.type==="root"&&h(this,M).shift(),C(this,fe,t);break;default:super.setAttribute(e,t)}}insertAt(e,t=this.length){let r=typeof e=="string"?new Bt(e):e;return super.insertAt(r,t),r.type==="root"&&(r.type="plain"),r}normalizeTitle(e,t=0,r,n,s){return T.normalizeTitle(e,t,h(this,rt),h(this,_),r,n,s)}lint(e=this.getAbsoluteIndex(),t){var n;let r=super.lint(e,t);if(this.type==="root"){let s={};for(let u of this.querySelectorAll("category")){let m=s[u.name];m?m.add(u):s[u.name]=new Set([u])}for(let u of Object.values(s))u.size>1&&r.push(...[...u].map(m=>{let f=E(m,{start:m.getAbsoluteIndex()},"no-duplicate","duplicated category");return f.suggestions=[{desc:"remove",range:[f.startIndex,f.endIndex],text:""}],f}));let o=/<!--\s*lint-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->/gu,a=this.toString(),p=[],g=o.exec(a),d=0,c=0;for(;g;){let{1:u,index:m}=g,f=(n=g[2])==null?void 0:n.trim();c+=a.slice(d,m).split(`
|
|
34
|
-
`).length-1,d=m,
|
|
35
|
-
`);for(let
|
|
36
|
-
`))},
|
|
37
|
-
`),r=this.type==="root"||this.type==="ext-inner"&&this.name==="poem"?0:1;for(;r<t.length;r++)t[r]=e(t[r],
|
|
38
|
-
`))},
|
|
21
|
+
`)}getGaps(){return 1}lint(n=this.getAbsoluteIndex(),e){let t=super.lint(n,e),r=new F(this,n);return this.image?t.push(...this.childNodes.filter(i=>{let s=i.toString().trim();return i.type==="noinclude"&&s&&!s.startsWith("#")}).map(i=>C(i,r,"invalid-imagemap","invalid link in <imagemap>"))):t.push($(this,r,"invalid-imagemap","<imagemap> without an image")),t}print(){return super.print({sep:`
|
|
22
|
+
`})}}});var Oi={};H(Oi,{NowikiToken:()=>mn});var mn,zi=k(()=>{"use strict";j();R();qe();mn=class extends Y{get type(){return"ext-inner"}lint(n=this.getAbsoluteIndex()){let{name:e,firstChild:{data:t}}=this;if((e==="templatestyles"||e==="section")&&t){let r=$(this,{start:n},"void-ext",f.msg("nothing should be in <$1>",e));return r.fix={range:[n-1,r.endIndex+e.length+3],text:"/>"},[r]}return super.lint(n,new RegExp(String.raw`<\s*(?:/\s*)${e==="nowiki"?"":"?"}(${e})\b`,"giu"))}}});var Mi,bt,sn=k(()=>{"use strict";j();Q();R();B();Dr();pr();Mi=(a,n)=>{let e=new Set(a);return e.delete(n),[...e]},bt=class extends ct{get type(){return"ext"}constructor(n,e,t,r,i=f.getConfig(),s=[]){var d;let o=n.toLowerCase(),l=new ze(!e||e.trimStart()!==e?e:` ${e}`,"ext-attrs",o,i,s),g={...i,ext:Mi(i.ext,o),excludes:[...(d=i.excludes)!=null?d:[]]},p;switch(g.inExt=!0,o){case"tab":g.ext=Mi(g.ext,"tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":o==="poem"&&g.excludes.push("heading"),p=new T(t,g,s);break;case"pre":{let{PreToken:u}=(Ti(),O(xi));p=new u(t,g,s);break}case"dynamicpagelist":{let{ParamTagToken:u}=(Qr(),O(bi));p=new u(t,g,s);break}case"inputbox":{g.excludes.push("heading");let{InputboxToken:u}=(Ei(),O(Ni));p=new u(t,g,s);break}case"references":{let{NestedToken:u}=(xr(),O(fr));p=new u(t,/<!--.*?(?:-->|$)|<(ref)(\s[^>]*)?>(.*?)<\/(ref\s*)>/gisu,["ref"],g,s);break}case"choose":{let{NestedToken:u}=(xr(),O(fr));p=new u(t,/<(option|choicetemplate)(\s[^>]*)?>(.*?)<\/(\1)>/gsu,["option","choicetemplate"],g,s);break}case"combobox":{let{NestedToken:u}=(xr(),O(fr));p=new u(t,/<(combooption)(\s[^>]*)?>(.*?)<\/(combooption\s*)>/gisu,["combooption"],g,s);break}case"gallery":{let{GalleryToken:u}=(ji(),O(Bi));p=new u(t,g,s);break}case"imagemap":{let{ImagemapToken:u}=(Gi(),O(_i));p=new u(t,g,s);break}default:{let{NowikiToken:u}=(zi(),O(Oi));p=new u(t,g,s)}}p.setAttribute("name",o),p.type==="plain"&&(p.type="ext-inner"),super(n,l,p,r,i,s),this.seal("closed",!0)}lint(n=this.getAbsoluteIndex(),e){let t=super.lint(n,e),r=new F(this,n);return this.name!=="nowiki"&&this.closest("html-attrs, table-attrs")&&t.push($(this,r,"parsing-order","extension tag in HTML tag attributes")),this.name==="ref"&&this.closest("heading-title")&&t.push($(this,r,"var-anchor","variable anchor in a section header")),t}}});var Wi={};H(Wi,{parseCommentAndExt:()=>Co});var Co,Ui=k(()=>{"use strict";si();_e();ai();sn();rn();Co=(a,n,e,t)=>{let r="<onlyinclude>",i="</onlyinclude>",{length:s}=r,o=()=>{let u=a.indexOf(r);return{i:u,j:a.indexOf(i,u+s)}};if(t){let{i:u,j:h}=o();if(u!==-1&&h!==-1){let m="",x=b=>{new D(b,n,e),m+=`\0${e.length-1}c\x7F`};for(;u!==-1&&h!==-1;){let b=`\0${e.length}e\x7F`;new ar(a.slice(u+s,h),n,e),u>0&&x(a.slice(0,u)),m+=b,a=a.slice(h+s+1),{i:u,j:h}=o()}return a&&x(a),m}}let l=n.ext.join("|"),g=t?"includeonly":"(?:no|only)include",p=t?"noinclude":"includeonly",d=new RegExp(String.raw`<!--.*?(?:-->|$)|<${g}(?:\s[^>]*)?/?>|</${g}\s*>|<(${l})(\s[^>]*?)?(?:/>|>(.*?)</(\1\s*)>)|<(${p})(\s[^>]*?)?(?:/>|>(.*?)(?:</(${p}\s*)>|$))`,"gisu");return a.replace(d,(u,h,m,x,b,E,S,w,A)=>{let L=`\0${e.length}${h?"e":"c"}\x7F`;if(h)new bt(h,m,x,b,n,e);else if(u.startsWith("<!--")){let P=u.endsWith("-->");new Ee(u.slice(4,P?-3:void 0),P,n,e)}else E?new Xe(E,S,w,A,n,e):new D(u,n,e);return L})}});var $o,No,Eo,St,ce,Me,Ar,Di=k(()=>{"use strict";j();Q();X();B();$o=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),No=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"]),Eo=new Set(["strike","big","center","font","tt"]),Ar=class extends T{constructor(e,t,r,i,s,o){super(void 0,s,o);y(this,St);y(this,ce);y(this,Me);this.insertAt(t),this.setAttribute("name",e.toLowerCase()),v(this,St,r),v(this,ce,i),v(this,Me,e)}get type(){return"html"}get selfClosing(){return c(this,ce)}get closing(){return c(this,St)}toString(){return`<${this.closing?"/":""}${c(this,Me)}${super.toString()}${c(this,ce)?"/":""}>`}text(){let{closing:e}=this,t=c(this,Me)+(e?"":super.text());return`<${e?"/":""}${t}${c(this,ce)?"/":""}>`}getAttribute(e){return e==="padding"?c(this,Me).length+(this.closing?2:1):super.getAttribute(e)}lint(e=this.getAbsoluteIndex(),t){var s;let r=super.lint(e,t),i=new F(this,e);this.name==="h1"&&!this.closing&&r.push($(this,i,"h1","<h1>")),this.closest("table-attrs")&&r.push($(this,i,"parsing-order","HTML tag in table attributes"));try{this.findMatchingTag()}catch(o){if(o instanceof SyntaxError){let{message:l}=o,g=l.split(":")[0].toLowerCase(),p=$(this,i,"unmatched-tag",g);if(g==="unclosed tag"&&!this.closest("heading-title"))if(No.has(this.name)){let d=(s=this.parentNode)==null?void 0:s.childNodes,u=d==null?void 0:d.indexOf(this);d!=null&&d.slice(0,u).some(({type:h,name:m})=>h==="html"&&m===this.name)||(p.severity="warning")}else p.severity="warning";else if(g==="unmatched closing tag"){let d=this.closest("magic-word");d&&$o.has(d.name)?p.severity="warning":p.suggestions=[{desc:"remove",range:[e,p.endIndex],text:""}]}else if(g==="tag that is both closing and self-closing"){let{html:[,,d]}=this.getAttribute("config");d.includes(this.name)&&(p.fix={range:[e+1,e+2],text:""})}r.push(p)}}return Eo.has(this.name)&&r.push($(this,i,"obsolete-tag","obsolete HTML tag","warning")),(this.name==="b"||this.name==="strong")&&this.closest("heading-title")&&r.push($(this,i,"bold-header","bold in section header","warning")),r}findMatchingTag(){let{html:[e,t,r]}=this.getAttribute("config"),{name:i,parentNode:s,closing:o}=this,l=Wn(this.toString());if(o&&(c(this,ce)||r.includes(i)))throw new SyntaxError(`Tag that is both closing and self-closing: ${l}`);if(r.includes(i)||c(this,ce)&&t.includes(i))return this;if(c(this,ce)&&e.includes(i))throw new SyntaxError(`Invalid self-closing tag: ${l}`);if(!s)return;let{childNodes:g}=s,p=g.indexOf(this),d=(o?g.slice(0,p).reverse():g.slice(p+1)).filter(h=>h.type==="html"&&h.name===i),u=o?-1:1;for(let h of d)if(c(h,St)?u--:u++,u===0)return h;throw new SyntaxError(`${o?"Unmatched closing":"Unclosed"} tag: ${l}`)}print(){return super.print({pre:`<${this.closing?"/":""}${c(this,Me)}`,post:`${c(this,ce)?"/":""}>`})}json(){let e=super.json();return Object.assign(e,{closing:this.closing,selfClosing:c(this,ce)}),e}};St=new WeakMap,ce=new WeakMap,Me=new WeakMap});var Hi={};H(Hi,{parseHtml:()=>Io});var Io,Vi=k(()=>{"use strict";pr();Di();Io=(a,n,e)=>{let t=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,{html:r}=n,i=new Set([...r[0],...r[1],...r[2]]),s=a.split("<"),o=s.shift();for(let l of s){let g=t.exec(l),p=g==null?void 0:g[2],d=p==null?void 0:p.toLowerCase();if(!g||!i.has(d)){o+=`<${l}`;continue}let[,u,,h="",m,x]=g,{length:b}=e,E=new ze(h,"html-attrs",d,n,e),S=E.getAttr("itemprop");if(d==="meta"&&(S===void 0||E.getAttr("content")===void 0)||d==="link"&&(S===void 0||E.getAttr("href")===void 0)){o+=`<${l}`,e.length=b;continue}o+=`\0${e.length}x\x7F${x}`,new Ar(p,E,u==="/",m==="/>",n,e)}return o}});var Xi,Zi=k(()=>{"use strict";Te();Xi=(a=0)=>(n,e)=>{var r,Qi;class t extends n{constructor(){super(...arguments);y(this,r)}getAttr(l){return c(this,r,Qi).getAttr(l)}}return r=new WeakSet,Qi=function(){return this.childNodes[a]},sr(t,n),t}});var Ct,fn=k(()=>{"use strict";Zi();R();B();gt();pr();Ct=class extends Xi(1)(T){constructor(n,e,t,r,i=f.getConfig(),s=[],o={}){super(void 0,i,s,o),this.append(new pe(e,n,"table-syntax",i,s,{}),new ze(r,"table-attrs",t,i,s))}}});var he,Qt,et,xn,Ki,Ye,Tn=k(()=>{"use strict";j();Q();Se();Te();R();B();fn();Ye=class extends Ct{constructor(e,t,r=f.getConfig(),i=[]){var g;let s=/\||\0\d+!\x7F/u.exec(t!=null?t:""),o=s?t.slice(0,s.index):"";/\[\[|-\{/u.test(o)&&(s=null,o="");super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",o,r,i);y(this,et);y(this,he,"");y(this,Qt);s&&([tr(this,he)._]=s);let l=new T(t==null?void 0:t.slice(((g=s==null?void 0:s.index)!=null?g:NaN)+c(this,he).length),r,i);l.type="td-inner",l.setAttribute("stage",4),this.insertAt(l)}get type(){return"td"}get rowspan(){return this.getAttr("rowspan")}get colspan(){return this.getAttr("colspan")}get subtype(){return I(this,et,xn).call(this).subtype}afterBuild(){c(this,he).includes("\0")&&v(this,he,this.buildFromStr(c(this,he),0)),super.afterBuild()}toString(){let{childNodes:[e,t,r]}=this;return e.toString()+t.toString()+c(this,he)+r.toString()}text(){let{childNodes:[e,t,r]}=this;return e.text()+t.text()+c(this,he)+r.text()}getGaps(e){return e===1?c(this,he).length:0}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),i=new F(this,e+this.getRelativeIndex(this.length-1));for(let s of this.lastChild.childNodes)if(s.type==="text"){let{data:o}=s;if(o.includes("|")){let l=o.includes("||"),g=C(s,i,"pipe-like",'additional "|" in a table cell',l?"error":"warning");if(l){let p={caption:"|+",td:"|",th:"!"}[this.subtype];g.fix={range:[g.startIndex,g.endIndex],text:o.replace(/\|\|/gu,`
|
|
23
|
+
${p}`)}}else g.suggestions=[{desc:"escape",range:[g.startIndex,g.endIndex],text:o.replace(/\|/gu,"|")}];r.push(g)}}return r}isIndependent(){return this.firstChild.text().startsWith(`
|
|
24
|
+
`)}getAttr(e){let t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}print(){let{childNodes:[e,t,r]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${c(this,he)}${r.print()}</span>`}json(){let e=super.json();return e.subtype=this.subtype,e}};he=new WeakMap,Qt=new WeakMap,et=new WeakSet,xn=function(){var t;let{rev:e}=ke;return(t=c(this,Qt))!=null||v(this,Qt,[e,I(this,et,Ki).call(this)]),c(this,Qt)[1]},Ki=function(){var o;let e=this.firstChild.text(),t=e.slice(-1),r="td";if(t==="!"?r="th":t==="+"&&(r="caption"),this.isIndependent())return{subtype:r};let{previousSibling:i}=this;return{...I(o=i,et,xn).call(o)}}});var $t,bn=k(()=>{"use strict";j();Te();fn();Tn();$t=class extends Ct{lint(n=this.getAbsoluteIndex(),e){let t=super.lint(n,e),r=this.childNodes.find(({type:p})=>p==="table-inter");if(!r)return t;let i=r.childNodes.find(p=>p.text().trim()),s=/^\s*(?:!|\{\{\s*![!-]?\s*\}\})/u,o=Ke("arg"),l=Ke("magic-word");if(!i||s.test(i.toString())||o(i)&&s.test(i.default||""))return t;if(l(i))try{if(i.getPossibleValues().every(p=>s.test(p.text())))return t}catch(p){}let g=C(r,{start:n},"fostered-content","content to be moved out from the table");return g.severity=i.type==="template"?"warning":"error",g.startIndex++,g.startLine++,g.startCol=0,t.push(g),t}getRowCount(){return Number(this.childNodes.some(n=>n instanceof Ye&&n.isIndependent()&&!n.firstChild.text().endsWith("+")))}getNthCol(n,e){let t=0;for(let r of this.childNodes.slice(2))if(r instanceof Ye&&(r.isIndependent()&&(t=+(r.subtype!=="caption")),n-=t,n<0))return r}}});var Lo,Fo,kn,wr,Ji=k(()=>{"use strict";j();Q();Te();R();bn();gt();Lo=/^\n[^\S\n]*(?:\|\}|\{\{\s*!\s*\}\}\}|\{\{\s*!\)\s*\}\})$/u,Fo=({type:a})=>a==="tr"||a==="table-syntax",kn=class extends Array{},wr=class extends $t{get type(){return"table"}get closed(){return this.lastChild.type==="table-syntax"}constructor(n,e,t,r){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,n,"table",e,t,r,{})}lint(n=this.getAbsoluteIndex(),e){let t=super.lint(n,e),r=new F(this,n);this.closed||t.push(C(this.firstChild,r,"unclosed-table",f.msg("unclosed $1","table")));let i=this.getLayout(),{length:s}=i;if(s>1){let o=1,l=1/0,g=0;for(;g<s;g++){let p=i[g],d=p.length;if(d<o)break;d<l&&(l=d);let u=p.indexOf(p[d-1])+1;if(u>l)break;u>o&&(o=u)}if(g<s){let p=C(this.getNthRow(g),r,"table-layout","inconsistent table layout","warning");p.startIndex++,p.startLine++,p.startCol=0,t.push(p)}}return t}close(n=`
|
|
25
|
+
|}`,e){let t=this.getAttribute("config"),r=this.getAttribute("accum"),i=e?[n]:f.parse(n,this.getAttribute("include"),2,t).childNodes;ke.run(()=>{let s=new pe(void 0,Lo,"table-syntax",t,r,{});super.insertAt(s)}),this.lastChild.replaceChildren(...i)}getLayout(n){let e=this.getAllRows(),{length:t}=e,r=new kn(...Yi(t,()=>[]));for(let i=0;i<t;i++){let s=r[i],o=0,l=0,g;for(let p of e[i].childNodes.slice(2))if(p.type==="td"){if(p.isIndependent()&&(g=p.subtype!=="caption"),g){let d={row:i,column:o},{rowspan:u,colspan:h}=p;for(o++;s[l];)l++;for(let m=i;m<Math.min(i+u,t);m++)for(let x=l;x<l+h;x++)r[m][x]=d;l+=h}}else if(Fo(p))break}return r}getAllRows(){return[...super.getRowCount()?[this]:[],...this.childNodes.slice(1).filter(n=>n.type==="tr"&&n.getRowCount()>0)]}getNthCell(n){var t;let e=n;return e&&((t=this.getNthRow(e.row,!1,!1))==null?void 0:t.getNthCol(e.column))}getNthRow(n,e,t){let r=super.getRowCount();if(n===0&&r)return this;r&&n--;for(let i of this.childNodes.slice(2))if(i.type==="tr"&&i.getRowCount()&&(n--,n<0))return i}json(){let n=super.json();return n.closed=this.closed,n}}});var Sr,es=k(()=>{"use strict";bn();Sr=class extends $t{get type(){return"tr"}constructor(n,e,t,r){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,n,"tr",e,t,r,{})}}});var Nt,yn=k(()=>{"use strict";qe();Nt=class extends Y{}});var Et,vn=k(()=>{"use strict";yn();Et=class extends Nt{get type(){return"dd"}}});var ts={};H(ts,{parseTable:()=>Po});var Ro,Po,rs=k(()=>{"use strict";B();Ji();es();Tn();vn();Ro=a=>a.lastChild.constructor!==T,Po=({firstChild:{data:a},type:n,name:e},t,r)=>{let i=[],s=a.split(`
|
|
26
|
+
`),o=n==="root"||n==="parameter-value"||n==="ext-inner"&&e==="poem"?"":`
|
|
27
|
+
${s.shift()}`,l,g=(d,u)=>{if(!u){o+=d;return}let{lastChild:h}=u;if(Ro(u)){let m=new T(d,t,r);m.type="table-inter",m.setAttribute("stage",3),u.insertAt(m)}else h.setText(h.toString()+d)},p=()=>l.type==="td"?i.pop():l;for(let d of s){l=i.pop();let[u]=/^(?:\s|\0\d+c\x7F)*/u.exec(d),h=d.slice(u.length),m=/^(:*)((?:\s|\0\d+c\x7F)*)(\{\||\{(?:\0\d+c\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(h);if(m){for(;l&&l.type!=="td";)l=i.pop();let[,A,L,P,q]=m;A&&new Et(A,t,r),g(`
|
|
28
|
+
${u}${A&&`\0${r.length-1}d\x7F`}${L}\0${r.length}b\x7F`,l),i.push(...l?[l]:[],new wr(P,q,t,r));continue}else if(!l){o+=`
|
|
29
|
+
${d}`;continue}let x=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(h);if(!x){g(`
|
|
30
|
+
${d}`,l),i.push(l);continue}let[,b,E,S,w]=x;if(b){for(;l.type!=="table";)l=i.pop();l.close(`
|
|
31
|
+
${u}${b}`,!0),g(w,i[i.length-1])}else if(E){l=p(),l.type==="tr"&&(l=i.pop());let A=new Sr(`
|
|
32
|
+
${u}${E}`,w,t,r);i.push(l,A),l.insertAt(A)}else{l=p();let A=S==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu,L=A.exec(w),P=0,q=`
|
|
33
|
+
${u}${S}`,V=re=>{let fe=new Ye(q,w.slice(P,L==null?void 0:L.index),t,r);return re.insertAt(fe),fe};for(;L;)V(l),{lastIndex:P}=A,[q]=L,L=A.exec(w);i.push(l,V(l))}}return o.slice(1)}});var Cr,ns=k(()=>{"use strict";qe();Cr=class extends Y{get type(){return"hr"}}});var is,An,Bo,tt,ss=k(()=>{"use strict";De();qe();is=[ge(!0)];tt=class extends(Bo=Y){get type(){return"double-underscore"}constructor(n,e,t,r){super(n,t,r)}getAttribute(n){return n==="padding"?2:super.getAttribute(n)}toString(){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}};An=se(Bo),tt=ae(An,0,"DoubleUnderscoreToken",is,tt),oe(An,1,tt)});var os={};H(os,{parseHrAndDoubleUnderscore:()=>jo});var jo,as=k(()=>{"use strict";ns();ss();Zr();jo=({firstChild:{data:a},type:n,name:e},t,r)=>{let{doubleUnderscore:i}=t,s=new Set(i[0]),o=new Set(i[1]);return n!=="root"&&(n!=="ext-inner"||e!=="poem")&&(a=`\0${a}`),a=a.replace(/^((?:\0\d+c\x7F)*)(-{4,})/gmu,(l,g,p)=>(new Cr(p,t,r),`${g}\0${r.length-1}r\x7F`)).replace(new RegExp(`__(${[...i[0],...i[1]].join("|")})__`,"giu"),(l,g)=>{let p=o.has(g);return p||s.has(g.toLowerCase())?(new tt(g,p,t,r),`\0${r.length-1}u\x7F`):l}).replace(/^((?:\0\d+c\x7F)*)(={1,6})(.+)\2((?:[^\S\n]|\0\d+c\x7F)*)$/gmu,(l,g,p,d,u)=>{let h=`${g}\0${r.length}h\x7F`;return new xt(p.length,[d,u],t,r),h}),n==="root"||n==="ext-inner"&&e==="poem"?a:a.slice(1)}});var $r,ls=k(()=>{"use strict";j();Q();R();qe();$r=class extends Y{get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}lint(n=this.getAbsoluteIndex()){let{previousSibling:e,nextSibling:t,bold:r}=this,i=f.msg('lonely "$1"',"'"),s=[],o=new F(this,n),l,g=(p,d,u)=>({desc:"escape",range:[p,d],text:"'".repeat(u)});if((e==null?void 0:e.type)==="text"&&e.data.endsWith("'")){l=$(this,o,"lonely-apos",i);let{startIndex:p,startLine:d,startCol:u}=l,[,{length:h}]=/(?:^|[^'])('+)$/u.exec(e.data),m=n-h;s.push({...l,startIndex:m,endIndex:p,startCol:u-h,endLine:d,endCol:u,suggestions:[g(m,p,h)]})}if((t==null?void 0:t.type)==="text"&&t.data.startsWith("'")){l!=null||(l=$(this,o,"lonely-apos",i));let{endIndex:p,endLine:d,endCol:u}=l,[{length:h}]=/^'+/u.exec(t.data),m=p+h;s.push({...l,startIndex:p,endIndex:m,startLine:d,startCol:u,endCol:u+h,suggestions:[g(p,m,h)]})}return r&&this.closest("heading-title")&&s.push($(this,o,"bold-header","bold in section header","warning")),s}json(){let n=super.json();return Object.assign(n,{bold:this.bold,italic:this.italic}),n}}});var ds={};H(ds,{parseQuotes:()=>wn});var wn,Sn=k(()=>{"use strict";ls();wn=(a,n,e)=>{var p;let t=a.split(/('{2,})/u),{length:r}=t;if(r===1)return a;let i=0,s=0,o,l,g;for(let d=1;d<r;d+=2){let u=t[d].length;switch(u){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&&g===void 0&&(g=d):t[d-1].slice(-2,-1)===" "?o=d:l!=null||(l=d);break;default:t[d-1]+="'".repeat(u-5),t[d]="'''''",s++,i++}}if(s%2===1&&i%2===1){let d=(p=o!=null?o:l)!=null?p:g;d!==void 0&&(t[d]="''",t[d-1]+="'")}for(let d=1;d<r;d+=2)new $r(t[d],n,e),t[d]=`\0${e.length-1}q\x7F`;return t.join("")}});var gs={};H(gs,{parseExternalLinks:()=>Cn});var Cn,$n=k(()=>{"use strict";X();cn();vr();Cn=(a,n,e,t)=>{let r=new RegExp(String.raw`\[(\0\d+f\x7F|(?:(?:${n.protocol}|//)${Ae}|\0\d+m\x7F)${we}(?=[[\]<>"\t\p{Zs}]|\0\d))(\p{Zs}*(?!\p{Zs}))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu");return a.replace(r,(i,s,o,l)=>{let{length:g}=e,p=/&[lg]t;/u.exec(s);return p&&(s=s.slice(0,p.index),o="",l=s.slice(p.index)+o+l),t?(new Ie(s,"ext-link-url",n,e),`[\0${g}f\x7F${o}${l}]`):(new wt(s,o,l,n,e),`\0${g}w\x7F`)})}});var Nr,ps=k(()=>{"use strict";Gt();Nr=class extends Ce{get type(){return"category"}}});var cs={};H(cs,{parseLinks:()=>us});var us,hs=k(()=>{"use strict";R();Sn();$n();un();dn();ps();us=(a,n,e)=>{let t=n.inExt?/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)(.*?[^\]]))?\]\](.*)$/su:/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)(.*?[^\]])?)?\]\](.*)$/su,r=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)(.*)$/su,i=new RegExp(String.raw`^\s*(?:${n.protocol}|//)`,"iu"),s=a.split("[["),o=s.shift();for(let l=0;l<s.length;l++){let g=!1,p,d,u,h,m=s[l],x=t.exec(m);if(x)[,p,d,u,h]=x,h.startsWith("]")&&(u!=null&&u.includes("["))&&(u+="]",h=h.slice(1));else{let P=r.exec(m);P&&(g=!0,[,p,d,u]=P)}if(p===void 0||i.test(p)||/\0\d+[exhbru]\x7F/u.test(p)){o+=`[[${m}`;continue}let b=p.trim().startsWith(":");if(b&&g){o+=`[[${m}`;continue}let E=f.normalizeTitle(p,0,!1,n,!0,!0,!0),{ns:S,valid:w,interwiki:A}=E;if(w){if(g){if(A||S!==6){o+=`[[${m}`;continue}let P=!1;for(l++;l<s.length;l++){let q=s[l],V=q.split("]]");if(V.length>2){P=!0,u+=`[[${V[0]}]]${V[1]}`,h=V.slice(2).join("]]");break}else if(V.length===2)u+=`[[${V[0]}]]${V[1]}`;else{u+=`[[${q}`;break}}if(u=us(u,n,e),!P){o+=`[[${p}${d}${u}`;continue}}}else{o+=`[[${m}`;continue}u&&(u=wn(u,n,e));let L=At;b||(!A&&S===6?(u&&(u=Cn(u,n,e,!0)),L=yt):!A&&S===14&&(L=Nr)),u===void 0&&d&&(u=""),o+=`\0${e.length}l\x7F${h}`,new L(p,u,n,e,d)}return o}});var ms={};H(ms,{parseMagicLinks:()=>Go});var qo,_o,Go,fs=k(()=>{"use strict";X();vr();qo=/[^,;\\.:!?)][,;\\.:!?)]+$/u,_o=/[^,;\\.:!?][,;\\.:!?]+$/u,Go=(a,n,e)=>{let t=String.raw`[\p{Zs}\t]| |�*160;|�*a0;`,r=`(?:${t}|-)`,i=new RegExp(String.raw`(^|[^\p{L}\d_])(?:(?:${n.protocol})(${Ae}${we})|(?:RFC|PMID)(?:${t})+\d+\b|ISBN(?:${t})+(?:97[89]${r}?)?(?:\d${r}?){9}[\dx]\b)`,"giu");return a.replace(i,(s,o,l)=>{let g=o?s.slice(o.length):s;if(l){let p="",d=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(g);d&&(p=g.slice(d.index),g=g.slice(0,d.index));let u=g.includes("(")?_o:qo,h=u.exec(g);if(h){let m=1;h[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(g.slice(0,h.index))&&(m=2),p=g.slice(h.index+m)+p,g=g.slice(0,h.index+m)}return p.length>=l.length?s:(new Ie(g,void 0,n,e),`${o}\0${e.length-1}w\x7F${p}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(g))return s;return new Ie(g,"magic-link",n,e),`${o}\0${e.length-1}i\x7F`})}});var Er,xs=k(()=>{"use strict";yn();Er=class extends Nt{get type(){return"list"}}});var Ts={};H(Ts,{parseList:()=>Oo});var Oo,bs=k(()=>{"use strict";xs();vn();Oo=(a,n,e)=>{let t=/^((?:\0\d+c\x7F)*)([;:*#]+)/u.exec(a);if(!t)return a;let[r,i,s]=t,o=`${i}\0${e.length}d\x7F${a.slice(r.length)}`,l=s.split(";").length-1;if(new Er(s,n,e),!l)return o;let{html:[g]}=n,p=/:+|-\{|\0\d+[xq]\x7F/gu,d=p,u=d.exec(o),h=0,m=!1,x=!1,b=0,E=(w,A)=>(new Et(w,n,e),`${o.slice(0,A)}\0${e.length-1}d\x7F${o.slice(A+w.length)}`),S=w=>{w?h&&h--:h++};for(;u&&l;){let{0:w,index:A}=u;if(w==="-{"){if(!b){let{lastIndex:L}=d;d=/-\{|\}-/gu,d.lastIndex=L}b++}else if(w==="}-"){if(b--,!b){let{lastIndex:L}=d;d=p,d.lastIndex=L}}else if(w.endsWith("x\x7F")){let{name:L,closing:P,selfClosing:q}=e[Number(w.slice(1,-2))];(!q||g.includes(L))&&S(P)}else if(w.endsWith("q\x7F")){let{bold:L,italic:P}=e[Number(w.slice(1,-2))];L&&(S(m),m=!m),P&&(S(x),x=!x)}else if(h===0){if(w.length>=l)return E(w.slice(0,l),A);l-=w.length,d.lastIndex=A+4+String(e.length).length,o=E(w,A)}u=d.exec(o)}return o}});var ks,Fe,Ir,ys=k(()=>{"use strict";j();Q();R();B();Ne();ks=new Set(["A","T","R","D","-","H","N"]),Ir=class extends T{constructor(e,t=f.getConfig(),r=[]){super(void 0,t,r,{});y(this,Fe);this.append(...e.map(i=>new z(i,"converter-flag",t,r)))}get type(){return"converter-flags"}afterBuild(){v(this,Fe,this.childNodes.map(e=>e.text().trim())),super.afterBuild()}toString(){return super.toString(";")}text(){return super.text(";")}getGaps(){return 1}getUnknownFlags(){return new Set(c(this,Fe).filter(e=>/\{{3}[^{}]+\}{3}/u.test(e)))}getVariantFlags(){let e=new Set(this.getAttribute("config").variants);return new Set(c(this,Fe).filter(t=>e.has(t)))}lint(e=this.getAbsoluteIndex(),t){let r=this.getVariantFlags(),i=this.getUnknownFlags(),s=new Set(c(this,Fe).filter(h=>ks.has(h))),o=c(this,Fe).filter(h=>!h).length,l=c(this,Fe).length-i.size-o,g=super.lint(e,t);if(r.size===l||s.size===l)return g;let p=new F(this,e),{childNodes:d,length:u}=this;for(let h=0;h<u;h++){let m=d[h],x=m.text().trim();if(x&&!r.has(x)&&!i.has(x)&&(r.size>0||!s.has(x))){let b=C(m,p,"no-ignored","invalid conversion flag");r.size===0&&ks.has(x.toUpperCase())?b.fix={range:[b.startIndex,b.endIndex],text:x.toUpperCase()}:b.suggestions=[{desc:"remove",range:[b.startIndex,b.endIndex],text:""}],g.push(b)}}return g}print(){return super.print({sep:";"})}};Fe=new WeakMap});var It,vs=k(()=>{"use strict";R();B();Ne();It=class extends T{get type(){return"converter-rule"}constructor(n,e=!0,t=f.getConfig(),r=[]){super(void 0,t,r);let i=n.indexOf(":"),s=n.slice(0,i).indexOf("=>"),o=s===-1?n.slice(0,i):n.slice(s+2,i);e&&t.variants.includes(o.trim())?(super.insertAt(new z(o,"converter-rule-variant",t,r)),super.insertAt(new z(n.slice(i+1),"converter-rule-to",t,r)),s!==-1&&super.insertAt(new z(n.slice(0,s),"converter-rule-from",t,r),0)):super.insertAt(new z(n,"converter-rule-to",t,r))}toString(){let{childNodes:n}=this;if(n.length===3){let[e,t,r]=n;return`${e.toString()}=>${t.toString()}:${r.toString()}`}return super.toString(":")}text(){let{childNodes:n}=this;if(n.length===3){let[e,t,r]=n;return`${e.text()}=>${t.text()}:${r.text()}`}return super.text(":")}getGaps(n){return n===0&&this.length===3?2:1}print(){let{childNodes:n}=this;if(n.length===3){let[e,t,r]=n;return`<span class="wpb-converter-rule">${e.print()}=>${t.print()}:${r.print()}</span>`}return super.print({sep:":"})}}});var Lr,As=k(()=>{"use strict";X();R();B();ys();vs();Lr=class extends T{get type(){return"converter"}constructor(n,e,t=f.getConfig(),r=[]){super(void 0,t,r),this.append(new Ir(n,t,r));let[i]=e,s=i.includes(":"),o=new It(i,s,t,r);s&&o.length===1?this.insertAt(new It(e.join(";"),!1,t,r)):this.append(o,...e.slice(1).map(l=>new It(l,!0,t,r)))}toString(){let{childNodes:[n,...e]}=this;return`-{${n.toString()}${n.length>0?"|":""}${e.map(String).join(";")}}-`}text(){let{childNodes:[n,...e]}=this;return`-{${n.text()}|${de(e,";")}}-`}getAttribute(n){return n==="padding"?2:super.getAttribute(n)}getGaps(n){return n||this.firstChild.length>0?1:0}print(){let{childNodes:[n,...e]}=this;return`<span class="wpb-converter">-{${n.print()}${n.length>0?"|":""}${$e(e,{sep:";"})}}-</span>`}}});var ws={};H(ws,{parseConverter:()=>zo});var zo,Ss=k(()=>{"use strict";As();zo=(a,n,e)=>{let t=`(?:${n.variants.join("|")})`,r=/-\{/gu,i=/-\{|\}-/gu,s=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*${t}\s*:|(?:\s|\0\d+c\x7F)*$)`,"u"),o=[],l=r,g=l.exec(a);for(;g;){let{0:p,index:d}=g;if(p==="}-"){let u=o.pop(),{length:h}=e,m=a.slice(u.index+2,d),x=m.indexOf("|"),[b,E]=x===-1?[[],m]:[m.slice(0,x).split(";"),m.slice(x+1)],S=E.replace(/(&[#a-z\d]+);/giu,"$1"),w=S.split(s).map(A=>A.replace(/\x01/gu,";"));new Lr(b,w,n,e),a=`${a.slice(0,u.index)}\0${h}v\x7F${a.slice(d+2)}`,o.length===0&&(l=r),l.lastIndex=u.index+3+String(h).length}else o.push(g),l=i,l.lastIndex=d+2;g=l.exec(a)}return a}});var Fr={};H(Fr,{Token:()=>T});var Zt,me,_,M,rt,Lt,Kt,G,Cs,$s,Ns,Es,Is,Ls,Fs,Rs,Ps,Bs,js,qs,Nn,T,B=k(()=>{"use strict";X();Se();Te();j();R();Qn();Jn();Nn=class Nn extends nr{constructor(e,t=f.getConfig(),r=[],i){super();y(this,G);y(this,Zt,"plain");y(this,me,0);y(this,_);y(this,M);y(this,rt);y(this,Lt,!1);y(this,Kt);typeof e=="string"&&this.insertAt(e),v(this,_,t),v(this,M,r),r.push(this)}get type(){return c(this,Zt)}set type(e){v(this,Zt,e)}parseOnce(e=c(this,me),t=!1){if(e<c(this,me)||!this.getAttribute("plain")||this.length===0)return this;if(c(this,me)>=11)return this;switch(e){case 0:if(this.type==="root"){c(this,M).shift();let r=I(this,G,Cs).call(this);t&&(t=!r)}v(this,rt,t),I(this,G,$s).call(this,t);break;case 1:I(this,G,Ns).call(this);break;case 2:I(this,G,Es).call(this);break;case 3:I(this,G,Is).call(this);break;case 4:I(this,G,Ls).call(this);break;case 5:I(this,G,Fs).call(this);break;case 6:I(this,G,Rs).call(this);break;case 7:I(this,G,Ps).call(this);break;case 8:I(this,G,Bs).call(this);break;case 9:I(this,G,js).call(this);break;case 10:I(this,G,qs).call(this)}if(this.type==="root")for(let r of c(this,M))r.parseOnce(e,t);return tr(this,me)._++,this}buildFromStr(e,t){let r=e.split(/[\0\x7F]/u).map((i,s)=>{if(s%2===0)return new jt(i);if(isNaN(i.slice(-1)))return c(this,M)[Number(i.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${i}`)});return t===0?r.map(String).join(""):t===1?de(r):r}build(){v(this,me,11);let{length:e,firstChild:t}=this,r=String(t);if(e===1&&t.type==="text"&&r.includes("\0")&&(this.replaceChildren(...this.buildFromStr(r)),this.normalize(),this.type==="root"))for(let i of c(this,M))i.build()}afterBuild(){if(this.type==="root")for(let e of c(this,M))e.afterBuild();v(this,Lt,!0)}parse(e=11,t){for(e=Math.min(e,11);c(this,me)<e;)this.parseOnce(c(this,me),t);return e&&(this.build(),this.afterBuild()),this}getAttribute(e){var t;switch(e){case"plain":return this.constructor===Nn;case"config":return c(this,_);case"include":return(t=c(this,rt))!=null?t:!!c(this.getRootNode(),rt);case"accum":return c(this,M);case"built":return c(this,Lt);default:return super.getAttribute(e)}}setAttribute(e,t){switch(e){case"stage":c(this,me)===0&&this.type==="root"&&c(this,M).shift(),v(this,me,t);break;default:super.setAttribute(e,t)}}insertAt(e,t=this.length){let r=typeof e=="string"?new jt(e):e;return super.insertAt(r,t),r.type==="root"&&(r.type="plain"),r}normalizeTitle(e,t=0,r,i,s){return f.normalizeTitle(e,t,c(this,rt),c(this,_),r,i,s)}lint(e=this.getAbsoluteIndex(),t){var i;let r=super.lint(e,t);if(this.type==="root"){let s={};for(let h of this.querySelectorAll("category")){let m=s[h.name];m?m.add(h):s[h.name]=new Set([h])}for(let h of Object.values(s))h.size>1&&r.push(...[...h].map(m=>{let x=$(m,{start:m.getAbsoluteIndex()},"no-duplicate","duplicated category");return x.suggestions=[{desc:"remove",range:[x.startIndex,x.endIndex],text:""}],x}));let o=/<!--\s*lint-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->/gu,l=this.toString(),g=[],p=o.exec(l),d=0,u=0;for(;p;){let{1:h,index:m}=p,x=(i=p[2])==null?void 0:i.trim();u+=l.slice(d,m).split(`
|
|
34
|
+
`).length-1,d=m,g.push({line:u+(h==="disable-line"?0:1),from:h==="disable"?o.lastIndex:void 0,to:h==="enable"?o.lastIndex:void 0,rules:x?new Set(x.split(",").map(b=>b.trim())):void 0}),p=o.exec(l)}r=r.filter(({rule:h,startLine:m,startIndex:x})=>{let b={pos:0};for(let{line:E,from:S,to:w,rules:A}of g){if(E>m+1)break;if(A&&!A.has(h))continue;if(E===m&&S===void 0&&w===void 0)return!1;S<=x&&S>b.pos?(b.pos=S,b.type="from"):w<=x&&w>b.pos&&(b.pos=w,b.type="to")}return b.type!=="from"})}return r}toString(e){var i;let{rev:t}=ke,r=this.getRootNode();return r.type==="root"&&c(r,Lt)?((i=c(this,Kt))!=null||v(this,Kt,[t,super.toString(e)]),c(this,Kt)[1]):super.toString(e)}};Zt=new WeakMap,me=new WeakMap,_=new WeakMap,M=new WeakMap,rt=new WeakMap,Lt=new WeakMap,Kt=new WeakMap,G=new WeakSet,Cs=function(){let{parseRedirect:e}=(ii(),O(ni)),t=this.firstChild.toString(),r=e(t,c(this,_),c(this,M));return r&&this.setText(r),!!r},$s=function(e){let{parseCommentAndExt:t}=(Ui(),O(Wi));this.setText(t(this.firstChild.toString(),c(this,_),c(this,M),e))},Ns=function(){let{parseBraces:e}=(Yr(),O($i)),t=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,r=e(t,c(this,_),c(this,M));this.setText(this.type==="root"?r:r.slice(1))},Es=function(){var t;if((t=c(this,_).excludes)!=null&&t.includes("html"))return;let{parseHtml:e}=(Vi(),O(Hi));this.setText(e(this.firstChild.toString(),c(this,_),c(this,M)))},Is=function(){var t;if((t=c(this,_).excludes)!=null&&t.includes("table"))return;let{parseTable:e}=(rs(),O(ts));this.setText(e(this,c(this,_),c(this,M)))},Ls=function(){var t;if((t=c(this,_).excludes)!=null&&t.includes("hr"))return;let{parseHrAndDoubleUnderscore:e}=(as(),O(os));this.setText(e(this,c(this,_),c(this,M)))},Fs=function(){let{parseLinks:e}=(hs(),O(cs));this.setText(e(this.firstChild.toString(),c(this,_),c(this,M)))},Rs=function(){var r;if((r=c(this,_).excludes)!=null&&r.includes("quote"))return;let{parseQuotes:e}=(Sn(),O(ds)),t=this.firstChild.toString().split(`
|
|
35
|
+
`);for(let i=0;i<t.length;i++)t[i]=e(t[i],c(this,_),c(this,M));this.setText(t.join(`
|
|
36
|
+
`))},Ps=function(){var t;if((t=c(this,_).excludes)!=null&&t.includes("extLink"))return;let{parseExternalLinks:e}=($n(),O(gs));this.setText(e(this.firstChild.toString(),c(this,_),c(this,M)))},Bs=function(){var t;if((t=c(this,_).excludes)!=null&&t.includes("magicLink"))return;let{parseMagicLinks:e}=(fs(),O(ms));this.setText(e(this.firstChild.toString(),c(this,_),c(this,M)))},js=function(){var i;if((i=c(this,_).excludes)!=null&&i.includes("list"))return;let{parseList:e}=(bs(),O(Ts)),t=this.firstChild.toString().split(`
|
|
37
|
+
`),r=this.type==="root"||this.type==="ext-inner"&&this.name==="poem"?0:1;for(;r<t.length;r++)t[r]=e(t[r],c(this,_),c(this,M));this.setText(t.join(`
|
|
38
|
+
`))},qs=function(){if(c(this,_).variants.length>0){let{parseConverter:e}=(Ss(),O(ws));this.setText(e(this.firstChild.toString(),c(this,_),c(this,M)))}};T=Nn});var ke,Ke,Mr,Yi,sr,Te=k(()=>{"use strict";ke={running:!1,run(a){let{running:n}=this;this.running=!0;try{let{Token:e}=(B(),O(Fr)),t=a();return t instanceof e&&!t.getAttribute("built")&&t.afterBuild(),this.running=n,t}catch(e){throw this.running=n,e}},rev:0},Ke=a=>n=>n.type===a,Mr=(a,n,e,t=[])=>{let r=[...a.childNodes],i=r.splice(n,e,...t);a.setAttribute("childNodes",r);for(let s of t)s.setAttribute("parentNode",a);return i},Yi=(a,n)=>new Array(a).fill(void 0).map((e,t)=>n(t)),sr=(a,n)=>{Object.defineProperty(a,"name",{value:n.name})}});var Gs={};H(Gs,{Title:()=>En});var _s,Jt,Yt,En,Os=k(()=>{"use strict";X();_s=a=>decodeURIComponent(a.replace(/%(?![\da-f]{2})/giu,"%25")),En=class{constructor(n,e,t,r,i){y(this,Jt);y(this,Yt);U(this,"ns");U(this,"fragment");U(this,"interwiki","");U(this,"valid");U(this,"encoded",!1);let s=n.trim().startsWith("../");if(n=Mn(n),r&&n.includes("%"))try{let l=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(n);n=_s(n),this.encoded=l}catch(l){}if(n=n.replace(/_/gu," ").trim(),s)this.ns=0;else{let l=e;n.startsWith(":")&&(l=0,n=n.slice(1).trim());let g=n.split(":");if(g.length>1){let p=t.nsid[g[0].trim().toLowerCase()];p&&(l=p,n=g.slice(1).join(":").trim())}this.ns=l}let o=n.indexOf("#");if(o!==-1){let l=n.slice(o+1).trimEnd();if(l.includes("%"))try{l=_s(l)}catch(g){}this.fragment=l,n=n.slice(0,o).trim()}this.valid=!!(n||this.interwiki||i&&this.ns===0&&this.fragment!==void 0)&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(s?/^(?:\.\.\/)+(.*)/u.exec(n)[1]:n),this.main=n,Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}}),v(this,Yt,t.namespaces)}get main(){return c(this,Jt)}set main(n){n=n.replace(/_/gu," ").trim(),v(this,Jt,n&&n[0].toUpperCase()+n.slice(1))}get prefix(){let n=c(this,Yt)[this.ns];return n+(n&&":")}get title(){return(this.interwiki+(this.interwiki&&":")+this.prefix+this.main).replace(/ /gu,"_")}get extension(){let{main:n}=this,e=n.lastIndexOf(".");return e===-1?void 0:n.slice(e+1).toLowerCase()}toString(){return`${this.title}${this.fragment===void 0?"":`#${this.fragment}`}`}};Jt=new WeakMap,Yt=new WeakMap});var nt,zs,Mo,f,R=k(()=>{Gn();Te();Se();X();nt={i18n:void 0,rules:_n,getConfig(){return{...Dn,...this.config,excludes:[]}},msg(a,n=""){var e,t;return a&&((t=(e=this.i18n)==null?void 0:e[a])!=null?t:a).replace("$1",this.msg(n))},normalizeTitle(a,n=0,e,t=nt.getConfig(),r,i=!1,s=!1){let{Title:o}=(Os(),O(Gs));if(r)return new o(a,n,t,i,s);let{Token:l}=(B(),O(Fr));return ke.run(()=>{let g=new l(a,t);g.type="root",g.parseOnce(0,e).parseOnce();let p=new o(g.toString(),n,t,i,s);for(let d of["main","fragment"]){let u=p[d];u!=null&&u.includes("\0")&&(p[d]=g.buildFromStr(u,1))}return p})},parse(a,n,e=11,t=nt.getConfig()){a=zn(a);let{Token:r}=(B(),O(Fr));return ke.run(()=>{let s=new r(a,t);return s.type="root",s.parse(e,n)})}},zs={},Mo=new Set(["normalizeTitle","parse"]);for(let a in nt)Mo.has(a)||(zs[a]={enumerable:!1});Object.defineProperties(nt,zs);typeof self=="object"?Object.assign(self,{Parser:nt}):typeof globalThis=="object"&&Object.assign(globalThis,{Parser:nt});f=nt});R();})();
|
|
39
|
+
//# sourceMappingURL=bundle.min.js.map
|
package/extensions/dist/base.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
const workerJS = () => {
|
|
3
|
-
importScripts('https://testingcf.jsdelivr.net/npm/wikiparser-node@1.9.
|
|
3
|
+
importScripts('https://testingcf.jsdelivr.net/npm/wikiparser-node@1.9.3-b/bundle/bundle.min.js');
|
|
4
4
|
const entities = { '&': 'amp', '<': 'lt', '>': 'gt' };
|
|
5
5
|
self.onmessage = ({ data }) => {
|
|
6
6
|
const [command, qid, wikitext, include, stage] = data;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wikiparser-node",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.3-b",
|
|
4
4
|
"description": "A Node.js parser for MediaWiki markup with AST",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mediawiki",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"prepublishOnly": "npm run build",
|
|
37
|
-
"build:core": "esbuild index.ts --bundle --minify --target=es2018 --outfile=bundle/bundle.min.js && eslint --no-eslintrc -c .eslintrc.browser.json bundle/bundle.min.js",
|
|
37
|
+
"build:core": "esbuild index.ts --bundle --minify --target=es2018 --sourcemap --outfile=bundle/bundle.min.js && eslint --no-eslintrc -c .eslintrc.browser.json bundle/bundle.min.js",
|
|
38
38
|
"build:ext": "bash build-ext.sh",
|
|
39
39
|
"build:test": "npm run build:core && tsc --project tsconfig.dist.json",
|
|
40
40
|
"build": "npm run build:core && npm run build:ext",
|
|
@@ -45,11 +45,11 @@
|
|
|
45
45
|
"lint:css": "stylelint extensions/*.css",
|
|
46
46
|
"lint": "npm run lint:ts && npm run lint:json && npm run lint:css",
|
|
47
47
|
"server": "npm run test:end; http-server .. -c-1 --cors &",
|
|
48
|
-
"test": " node dist/test/test.js",
|
|
49
|
-
"test:parser": "node dist/test/parserTests.js",
|
|
48
|
+
"test": " node --enable-source-maps dist/test/test.js",
|
|
49
|
+
"test:parser": "node --enable-source-maps dist/test/parserTests.js",
|
|
50
50
|
"test:server": "npm run build && bash sed.sh -i 's|importScripts.*|importScripts(\"http://127.0.0.1:8080/wikiparser-node/bundle/bundle.min.js\");|' extensions/dist/base.js; npm run server",
|
|
51
51
|
"test:end": "pkill -x http-server",
|
|
52
|
-
"test:real": "node dist/test/real.js"
|
|
52
|
+
"test:real": "node --enable-source-maps dist/test/real.js"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
55
|
"@bhsd/codemirror-mediawiki": "^2.14.0",
|
package/README.en.md
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
[](https://www.npmjs.com/package/wikiparser-node)
|
|
2
|
-
[](https://github.com/bhsd-harry/wikiparser-node/actions/workflows/codeql.yml)
|
|
3
|
-
[](https://github.com/bhsd-harry/wikiparser-node/actions/workflows/node.js.yml)
|
|
4
|
-
|
|
5
|
-
# Other Languages
|
|
6
|
-
|
|
7
|
-
- [简体中文](./README.md)
|
|
8
|
-
|
|
9
|
-
# Introduction
|
|
10
|
-
|
|
11
|
-
WikiParser-Node is an offline [Wikitext](https://www.mediawiki.org/wiki/Wikitext) parser developed by Bhsd for the [Node.js](https://nodejs.org/) environment. It can parse almost all wiki syntax and generate an [Abstract Syntax Tree (AST)](https://en.wikipedia.org/wiki/Abstract_syntax_tree) ([Try it online](https://bhsd-harry.github.io/wikiparser-node/#editor)). It also allows for easy querying and modification of the AST, and returns the modified wikitext.
|
|
12
|
-
|
|
13
|
-
# Other Versions
|
|
14
|
-
|
|
15
|
-
## Mini (also known as [WikiLint](https://www.npmjs.com/package/wikilint))
|
|
16
|
-
|
|
17
|
-
This version provides a [CLI](https://en.wikipedia.org/wiki/Command-line_interface), but only retains the parsing functionality and linting functionality. The parsed AST cannot be modified. It is used in the [eslint-plugin-wikitext](https://www.npmjs.com/package/eslint-plugin-wikitext) plugin.
|
|
18
|
-
|
|
19
|
-
## Browser-compatible
|
|
20
|
-
|
|
21
|
-
A browser-compatible version, which can be used for code highlighting or as a linting plugin in conjunction with editors such as [CodeMirror](https://codemirror.net/) and [Monaco](https://microsoft.github.io/monaco-editor/). ([Usage example](https://bhsd-harry.github.io/wikiparser-node))
|
|
22
|
-
|
|
23
|
-
# Installation
|
|
24
|
-
|
|
25
|
-
## Node.js
|
|
26
|
-
|
|
27
|
-
Please install the corresponding version as needed (`WikiParser-Node` or `WikiLint`), for example:
|
|
28
|
-
|
|
29
|
-
```sh
|
|
30
|
-
npm i wikiparser-node
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
or
|
|
34
|
-
|
|
35
|
-
```sh
|
|
36
|
-
npm i wikilint
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
## Browser
|
|
40
|
-
|
|
41
|
-
You can download the code via CDN, for example:
|
|
42
|
-
|
|
43
|
-
```html
|
|
44
|
-
<script src="//cdn.jsdelivr.net/npm/wikiparser-node@browser/bundle/bundle.min.js"></script>
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
or
|
|
48
|
-
|
|
49
|
-
```html
|
|
50
|
-
<script src="//unpkg.com/wikiparser-node@browser/bundle/bundle.min.js"></script>
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
For more browser extensions, please refer to the corresponding [documentation](https://github.com/bhsd-harry/wikiparser-node/wiki/Browser-%28EN%29).
|
|
54
|
-
|
|
55
|
-
# Usage
|
|
56
|
-
|
|
57
|
-
Please refer to the [Wiki](https://github.com/bhsd-harry/wikiparser-node/wiki/Home-%28EN%29).
|