wikiparser-node 1.20.3 → 1.21.1
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 +34 -7
- package/bundle/bundle-es8.min.js +28 -0
- package/bundle/bundle-lsp.min.js +24 -24
- package/bundle/bundle.min.js +24 -24
- package/config/default.json +1 -0
- package/config/enwiki.json +114 -112
- package/config/jawiki.json +9 -2
- package/config/llwiki.json +199 -199
- package/config/minimum.json +1 -0
- package/config/moegirl.json +1 -0
- package/config/zhwiki.json +361 -359
- package/dist/addon/token.js +13 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -1
- package/dist/lib/attributes.js +1 -2
- package/dist/lib/element.js +7 -4
- package/dist/lib/node.d.ts +3 -1
- package/dist/lib/text.js +1 -1
- package/dist/lib/title.js +2 -1
- package/dist/parser/list.js +2 -2
- package/dist/src/atom.js +10 -0
- package/dist/src/attribute.js +48 -15
- package/dist/src/attributes.js +18 -8
- package/dist/src/converterFlags.js +13 -4
- package/dist/src/heading.js +14 -6
- package/dist/src/hidden.js +6 -0
- package/dist/src/html.js +11 -4
- package/dist/src/imageParameter.js +6 -1
- package/dist/src/imagemap.js +5 -0
- package/dist/src/index.js +26 -1
- package/dist/src/link/galleryImage.d.ts +1 -0
- package/dist/src/link/galleryImage.js +16 -5
- package/dist/src/magicLink.js +24 -10
- package/dist/src/nowiki/index.d.ts +1 -0
- package/dist/src/nowiki/index.js +12 -2
- package/dist/src/table/index.js +1 -1
- package/dist/src/table/trBase.d.ts +1 -1
- package/dist/src/table/trBase.js +1 -29
- package/dist/src/tagPair/ext.js +5 -2
- package/dist/src/transclude.d.ts +2 -0
- package/dist/src/transclude.js +10 -1
- package/dist/util/lint.js +30 -1
- package/extensions/dist/base.js +63 -28
- package/extensions/dist/codejar.js +1 -1
- package/extensions/dist/lsp.js +14 -14
- package/extensions/typings.d.ts +3 -3
- package/extensions/ui.css +1 -1
- package/package.json +10 -14
- package/bundle/bundle-es7.min.js +0 -28
package/README.md
CHANGED
|
@@ -87,17 +87,44 @@ A full database dump (`*.xml.bz2`) scan of Chinese Wikipedia's ~3.5 million arti
|
|
|
87
87
|
## Parser
|
|
88
88
|
|
|
89
89
|
1. Memory leaks may occur in rare cases.
|
|
90
|
+
1. Invalid page names with unicode characters are treated like valid ones ([Example](http://bhsd-harry.github.io/wikiparser-node/tests.html#Render%20invalid%20page%20names%20as%20plain%20text%20(T53090))).
|
|
90
91
|
1. Preformatted text with a leading space is only processed by [`Token.prototype.toHtml`](https://github.com/bhsd-harry/wikiparser-node/wiki/Token-%28EN%29#tohtml).
|
|
91
|
-
1. Invalid page name with unicode characters ([Example](http://bhsd-harry.github.io/wikiparser-node/tests.html#Render%20invalid%20page%20names%20as%20plain%20text%20(T53090))).
|
|
92
92
|
|
|
93
93
|
## HTML conversion
|
|
94
94
|
|
|
95
|
+
### Extension
|
|
96
|
+
|
|
95
97
|
1. Many extensions are not supported, such as `<indicator>` and `<ref>`.
|
|
98
|
+
|
|
99
|
+
### Transclusion
|
|
100
|
+
|
|
96
101
|
1. Most parser functions are not supported.
|
|
97
|
-
1.
|
|
102
|
+
1. Transclusion of a subpage is not supported ([Example](http://bhsd-harry.github.io/wikiparser-node/tests.html#T2561%3A%20%7B%7B%2FSubpage%7D%7D)).
|
|
103
|
+
|
|
104
|
+
### Heading
|
|
105
|
+
|
|
106
|
+
1. The table of contents (TOC) is not supported.
|
|
107
|
+
|
|
108
|
+
### HTML tag
|
|
109
|
+
|
|
110
|
+
1. Style sanitization is sometimes different ([Example](http://bhsd-harry.github.io/wikiparser-node/tests.html#CSS%20safety%20test%20(all%20browsers)%3A%20vertical%20tab%20(T57332%20%2F%20CVE-2013-4567))).
|
|
111
|
+
1. Empty `id` attributes are not removed ([Example](http://bhsd-harry.github.io/wikiparser-node/tests.html#Sanitizer%3A%20Validating%20the%20contents%20of%20the%20id%20attribute%2C%20empty%20attribute%20syntax%20(T6515))).
|
|
112
|
+
|
|
113
|
+
### Table
|
|
114
|
+
|
|
115
|
+
1. When the entire table content is fostered, the table does not have an empty `<td>` ([Example](http://bhsd-harry.github.io/wikiparser-node/tests.html#Templates%3A%20Wiki%20Tables%3A%204.%20Templated%20tags%2C%20no%20content)).
|
|
116
|
+
1. Missing newline between the fostered content and the table ([Example](http://bhsd-harry.github.io/wikiparser-node/tests.html#Templates%3A%20Wiki%20Tables%3A%201a.%20Fostering%20of%20entire%20template%20content)).
|
|
117
|
+
|
|
118
|
+
### Link
|
|
119
|
+
|
|
98
120
|
1. Link trail is not supported ([Example](https://bhsd-harry.github.io/wikiparser-node/tests.html#1.%20Interaction%20of%20linktrail%20and%20template%20encapsulation)).
|
|
99
|
-
1.
|
|
100
|
-
1.
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
121
|
+
1. Links to a subpage without a slash are not supported ([Example](http://bhsd-harry.github.io/wikiparser-node/tests.html#Subpage%20noslash%20link)).
|
|
122
|
+
1. Block elements inside a link should break it into multiple links ([Example](http://bhsd-harry.github.io/wikiparser-node/tests.html#%3Cpre%3E%20inside%20a%20link)).
|
|
123
|
+
|
|
124
|
+
### External link
|
|
125
|
+
|
|
126
|
+
1. No percent-encoding in displayed free external links ([Example](http://bhsd-harry.github.io/wikiparser-node/tests.html#Parsoid%3A%20pipe%20in%20transclusion%20parameter)).
|
|
127
|
+
|
|
128
|
+
### Block element
|
|
129
|
+
|
|
130
|
+
1. Incomplete `<p>` wrapping when there are block elements (e.g., [`<pre>`](http://bhsd-harry.github.io/wikiparser-node/tests.html#%3Cpre%3E%20inside%20a%20link), [`<div>`](http://bhsd-harry.github.io/wikiparser-node/tests.html#Templates%3A%20Scopes%20should%20not%20be%20expanded%20unnecessarily) or even [closing tags](http://bhsd-harry.github.io/wikiparser-node/tests.html#Non-word%20characters%20don't%20terminate%20tag%20names%20(T19663%2C%20T42670%2C%20T54022))).
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";(()=>{var Ua=Object.create;var Ot=Object.defineProperty,Wa=Object.defineProperties,es=Object.getOwnPropertyDescriptor,Ha=Object.getOwnPropertyDescriptors,Ga=Object.getOwnPropertyNames,Yi=Object.getOwnPropertySymbols;var ts=Object.prototype.hasOwnProperty,Va=Object.prototype.propertyIsEnumerable;var rs=(a,n)=>(n=Symbol[a])?n:Symbol.for("Symbol."+a),qt=a=>{throw TypeError(a)};var en=(a,n,e)=>n in a?Ot(a,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[n]=e,X=(a,n)=>{for(var e in n||(n={}))ts.call(n,e)&&en(a,e,n[e]);if(Yi)for(var e of Yi(n))Va.call(n,e)&&en(a,e,n[e]);return a},oe=(a,n)=>Wa(a,Ha(n)),Zi=(a,n)=>Ot(a,"name",{value:n,configurable:!0});var k=(a,n)=>()=>(a&&(n=a(a=0)),n);var Xa=(a,n)=>()=>(n||a((n={exports:{}}).exports,n),n.exports),te=(a,n)=>{for(var e in n)Ot(a,e,{get:n[e],enumerable:!0})},Qa=(a,n,e,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of Ga(n))!ts.call(a,r)&&r!==e&&Ot(a,r,{get:()=>n[r],enumerable:!(t=es(n,r))||t.enumerable});return a};var U=a=>Qa(Ot({},"__esModule",{value:!0}),a);var R=a=>{var n;return[,,,Ua((n=a==null?void 0:a[rs("metadata")])!=null?n:null)]},ns=["class","method","getter","setter","accessor","field","value","get","set"],kr=a=>a!==void 0&&typeof a!="function"?qt("Function expected"):a,Ka=(a,n,e,t,r)=>({kind:ns[a],name:n,metadata:t,addInitializer:i=>e._?qt("Already initialized"):r.push(kr(i||null))}),Ja=(a,n)=>en(n,rs("metadata"),a[3]),P=(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},j=(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=ns[d+5],f=d>3&&(a[m-1]=[]),b=a[m]||(a[m]=[]),v=d&&(!h&&!u&&(r=r.prototype),d<5&&(d>3||!h)&&es(d<4?r:{get[e](){return c(this,i)},set[e](w){return y(this,i,w)}},e));d?h&&d<4&&Zi(i,(d>2?"set ":d>1?"get ":"")+e):Zi(r,e);for(var C=t.length-1;C>=0;C--)g=Ka(d,e,l={},a[3],b),d&&(g.static=u,g.private=h,p=g.access={has:h?w=>Ya(r,w):w=>e in w},d^3&&(p.get=h?w=>(d^1?c:S)(w,r,d^4?i:v.get):w=>w[e]),d>2&&(p.set=h?(w,I)=>y(w,r,I,d^4?i:v.set):(w,I)=>w[e]=I)),o=(0,t[C])(d?d<4?h?i:v[x]:d>4?void 0:{get:v.get,set:v.set}:r,g),l._=1,d^4||o===void 0?kr(o)&&(d>4?f.unshift(o):d?h?i=o:v[x]=o:r=o):typeof o!="object"||o===null?qt("Object expected"):(kr(s=o.get)&&(v.get=s),kr(s=o.set)&&(v.set=s),kr(s=o.init)&&f.unshift(s));return d||Ja(a,r),v&&Ot(r,e,v),h?d^4?i:v:r},ge=(a,n,e)=>en(a,typeof n!="symbol"?n+"":n,e),Rn=(a,n,e)=>n.has(a)||qt("Cannot "+e),Ya=(a,n)=>Object(n)!==n?qt('Cannot use the "in" operator on this value'):a.has(n),c=(a,n,e)=>(Rn(a,n,"read from private field"),e?e.call(a):n.get(a)),T=(a,n,e)=>n.has(a)?qt("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(a):n.set(a,e),y=(a,n,e,t)=>(Rn(a,n,"write to private field"),t?t.call(a,e):n.set(a,e),e),S=(a,n,e)=>(Rn(a,n,"access private method"),e);var tn=(a,n,e,t)=>({set _(r){y(a,n,r,e)},get _(){return c(a,n,t)}});var is,ss,os=k(()=>{"use strict";is=(()=>{let a={redirect:1,onlyinclude:1,noinclude:1,include:1,comment:1,ext:1,arg:2,"magic-word":2,template:2,heading:2,html:3,table:4,hr:5,"double-underscore":5,link:6,category:6,file:6,quote:7,"ext-link":8,"free-ext-link":9,"magic-link":9,list:10,dd:10,converter:11,"list-range":11};return Object.setPrototypeOf(a,null),a})(),ss=(()=>{let a=["bold-header","format-leakage","fostered-content","h1","illegal-attr","insecure-style","invalid-gallery","invalid-imagemap","invalid-invoke","invalid-isbn","lonely-apos","lonely-bracket","lonely-http","nested-link","no-arg","no-duplicate","no-ignored","obsolete-attr","obsolete-tag","parsing-order","pipe-like","table-layout","tag-like","unbalanced-header","unclosed-comment","unclosed-quote","unclosed-table","unescaped","unknown-page","unmatched-tag","unterminated-url","url-encoding","var-anchor","void-ext"];return Object.freeze(a),a})()});function Ee(a){return n=>{let e=new(typeof n=="string"?Map:WeakMap);if(e.has(n)){let r=e.get(n);return r.lastIndex=0,r}let t=a(n);return e.set(n,t),t}}var et,_t=k(()=>{"use strict";et=a=>decodeURIComponent(a.replace(/%(?![\da-f]{2})/giu,"%25"))});var Se,as,Oe,qe,_e,Le,ht,ls,ae,kd,ke,Za,el,mt,ds,vd,tl,rl,Mt,Me,ie=k(()=>{"use strict";_t();Se=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,as=String.raw`[^[\]<>"\0-\x1F\x7F${Se}\uFFFD]`,Oe=String.raw`(?:\[[\da-f:.]+\]|${as})`,qe=String.raw`(?:${as}|\0\d+[cn!~]\x7F)*`,_e=a=>a.trim().toLowerCase(),Le=(a,n)=>a.replace(/\0(\d+)\x7F/gu,(e,t)=>n[t]),ht=(a,n)=>e=>e.replace(a,n),ls=ht(/[\0\x7F]|\r$/gmu,""),ae=ht(/\0\d+[cn]\x7F/gu,""),kd=ht(/[\\{}()|.?*+^$[\]]/gu,String.raw`\$&`),ke=(a,n="")=>a.map(e=>typeof e=="string"?e:e.text()).join(n),Za={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},el=ht(/&(?:#(\d+|[Xx][\da-fA-F]+)|([lg]t|[LG]T|[lr]brac[ke]|nbsp|amp|AMP|quot|QUOT));/gu,(a,n,e)=>n?String.fromCodePoint(+((/^x/iu.test(n)?"0":"")+n)):Za[e.toLowerCase()]),mt=a=>el(a),ds=ht(/&#(\d+|x[\da-f]+);/giu,(a,n)=>String.fromCodePoint(+((/^x/iu.test(n)?"0":"")+n))),vd=ht(/\n/gu,String.raw`\n`),tl={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},rl=a=>ht(a,n=>`&${tl[n]};`),Mt=rl(/[&<>]/gu),Me=(a,n={})=>{let{pre:e="",post:t="",sep:r=""}=n;return e+a.map(i=>i.print()).join(r)+t}});var gs=Xa((Sd,nl)=>{nl.exports={ext:[],html:[["b","bdi","del","i","ins","u","font","big","small","sub","sup","h1","h2","h3","h4","h5","h6","cite","code","em","s","strike","strong","tt","var","div","center","blockquote","ol","ul","dl","table","caption","pre","ruby","rb","rp","rt","rtc","p","span","abbr","dfn","kbd","samp","data","time","mark","tr","td","th","q","bdo"],["li","dt","dd"],["br","wbr","hr","meta","link"]],namespaces:{"0":"","6":"File","10":"Template","14":"Category","828":"Module"},nsid:{"":0,file:6,template:10,category:14,module:828},functionHook:["msgnw"],variable:["!","=","pageid","articlepath","server","servername","scriptpath","stylepath"],parserFunction:[{msgnw:"msgnw",pageid:"pageid",articlepath:"articlepath",server:"server",servername:"servername",scriptpath:"scriptpath",stylepath:"stylepath","#urlencode":"urlencode","#language":"language","#special":"special","#speciale":"speciale","#tag":"tag","#formatdate":"formatdate","#dateformat":"formatdate","#invoke":"invoke","#while":"while","#dowhile":"dowhile","#loop":"loop","#forargs":"forargs","#fornumargs":"fornumargs","#if":"if","#ifeq":"ifeq","#switch":"switch","#ifexist":"ifexist","#ifexpr":"ifexpr","#iferror":"iferror","#time":"time","#timel":"timel","#expr":"expr","#rel2abs":"rel2abs","#titleparts":"titleparts","#categorytree":"categorytree","#urldecode":"urldecode","#choose":"choose","#var":"var","#varexists":"varexists","#var_final":"var_final","#vardefine":"vardefine","#vardefineecho":"vardefineecho","#widget":"widget","#related":"related","#cscore":"cscore","#regex":"regex","#regex_var":"regex_var","#regexquote":"regexquote","#regexall":"regexall","#len":"len","#pos":"pos","#rpos":"rpos","#sub":"sub","#count":"count","#rmatch":"rmatch","#rreplace":"rreplace","#replace":"replace","#rsplit":"rsplit","#explode":"explode","#tab":"tab","#seo":"seo","#babel":"babel","#translation":"translation","#commaseparatedlist":"commaseparatedlist","#coordinates":"coordinates","#lst":"lst","#lsth":"lsth","#lstx":"lstx","#assessment":"assessment","#mentor":"mentor","#property":"property","#target":"target","#section":"lst","#section-x":"lstx","#section-h":"lsth","#statements":"statements","#useliquidthreads":"useliquidthreads","#lqtpagelimit":"lqtpagelimit","#chart":"chart"},{"!":"!","=":"=","#FORMAL":"formal","#bcp47":"bcp47","#dir":"dir","#interwikilink":"interwikilink","#interlanguagelink":"interlanguagelink","#timef":"timef","#timefl":"timefl"},["msg","raw"],["subst","safesubst"]],doubleUnderscore:[[],[]],protocol:"bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|matrix:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|worldwind://|xmpp:",interwiki:[],img:{},redirection:["#redirect"],variants:[]}});var Pn,ps=k(()=>{"use strict";Pn=gs()});var vr,zt,Ar,wr,jn,L,se=k(()=>{"use strict";L=class{constructor(n,e){T(this,wr);T(this,vr);T(this,zt);T(this,Ar);y(this,vr,n),y(this,zt,e)}get start(){return c(this,zt)}get top(){return S(this,wr,jn).call(this).top}get left(){return S(this,wr,jn).call(this).left}};vr=new WeakMap,zt=new WeakMap,Ar=new WeakMap,wr=new WeakSet,jn=function(){var n;return(n=c(this,Ar))!=null||y(this,Ar,c(this,vr).getRootNode().posFromIndex(c(this,zt))),c(this,Ar)}});var il,sl,Dt,Bn,us,N,E,Ce,cs,M=k(()=>{"use strict";pe();se();W();il=new Set(["tr","td","th","caption"]),sl=new Set(["Template:!!","Template:!-"]),Dt=a=>{let n=a.childNodes.find(e=>e.text().trim());if(!n||n.type==="text"&&n.data.trim().startsWith("!")||n.type==="magic-word"&&n.name==="!"||n.type==="template"&&sl.has(n.name)||n.is("html")&&il.has(n.name))return!1;if(n.is("arg"))return n.length>1&&Dt(n.childNodes[1]);if(n.is("magic-word"))try{let e=n.getPossibleValues().map(Dt);return e.includes("error")?"error":e.includes("warning")&&"warning"}catch(e){}return n.type==="template"||n.type==="magic-word"&&n.name==="invoke"?"warning":"error"},Bn=(a,n,e,t)=>({line:a+e-1,character:(e===1?n:0)+t}),us=a=>(n,e,t,r,i="error")=>{let{start:s}=e,{top:o,left:l}=e instanceof L?e:new L(n,s),{offsetHeight:g,offsetWidth:p}=n,{startIndex:d,startLine:u,startCol:h}=a(n,s,o,l),{line:m,character:x}=Bn(u,h,g,p);return{rule:t,message:$.msg(r),severity:i,startIndex:d,endIndex:d+n.toString().length,startLine:u,endLine:m,startCol:h,endCol:x}},N=us((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}}),E=us((a,n,e,t)=>({startIndex:n,startLine:e,startCol:t})),Ce=(a,n,e)=>{if(a&&$.viewOnly&&a[0]===le.rev)return a[1];let t=n();return $.viewOnly&&e([le.rev,t]),t},cs=(a,n)=>a==="ol"&&n==="type"?["1","a","A","i","I"]:a==="th"&&n==="scope"?["row","col","rowgroup","colgroup"]:n==="dir"?["ltr","rtl","auto"]:n==="aria-hidden"?["true","false"]:[]});var ol,rn,hs=k(()=>{"use strict";ol=(a,n,e)=>{if(a.includes("#")){let[t,...r]=a.split("#");return(!t||t===n)&&r.every(i=>i===e)}return!a||a===n},rn=(a,n,e)=>({type:t,name:r})=>a.split(",").some(i=>ol(i.trim(),t,r))});var Sr,Ut,Wt,Cr,$r,Ht,Gt,Nr,On,Vt,qn=k(()=>{"use strict";M();pe();W();Vt=class{constructor(){T(this,Nr);ge(this,"childNodes",[]);T(this,Sr);T(this,Ut);T(this,Wt);T(this,Cr);T(this,$r);T(this,Ht);T(this,Gt,{})}get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get parentNode(){return c(this,Sr)}get nextSibling(){return c(this,Ut)}get previousSibling(){return c(this,Wt)}get offsetHeight(){return S(this,Nr,On).call(this).height}get offsetWidth(){return S(this,Nr,On).call(this).width}getChildNodes(){let{childNodes:n}=this;return Object.isFrozen(n)?[...n]:n}getAttribute(n){return n==="padding"?0:this[n]}setAttribute(n,e){switch(n){case"parentNode":y(this,Sr,e),e||(y(this,Ut,void 0),y(this,Wt,void 0));break;case"nextSibling":y(this,Ut,e);break;case"previousSibling":y(this,Wt,e);break;case"aIndex":$.viewOnly&&y(this,Ht,[le.rev,e]);break;default:this[n]=e}}getRootNode(){return Ce(c(this,$r),()=>{var n,e;return(e=(n=this.parentNode)==null?void 0:n.getRootNode())!=null?e:this},n=>{let[,e]=n;e.type==="root"&&y(this,$r,n)})}indexFromPos(n,e){}posFromIndex(n){let{length:e}=String(this);if(n+=n<0?e:0,n>=0&&n<=e){let t=this.getLines(),r=t.findIndex(([,,i])=>n<=i);return{top:r,left:n-t[r][1]}}}getGaps(n){return 0}getRelativeIndex(n){if(n===void 0){let{parentNode:e}=this;return e?e.getRelativeIndex(e.childNodes.indexOf(this)):0}return Ce(c(this,Gt)[n],()=>{let{childNodes:e}=this,t=n+(n<0?e.length:0),r=this.getAttribute("padding");for(let i=0;i<t;i++)$.viewOnly&&(c(this,Gt)[i]=[le.rev,r]),r+=e[i].toString().length+this.getGaps(i);return r},e=>{c(this,Gt)[n]=e})}getAbsoluteIndex(){return Ce(c(this,Ht),()=>{let{parentNode:n}=this;return n?n.getAbsoluteIndex()+this.getRelativeIndex():0},n=>{y(this,Ht,n)})}getBoundingClientRect(){}is(n){return this.type===n}getLines(){return Ce(c(this,Cr),()=>{let n=[],e=0;for(let t of String(this).split(`
|
|
2
|
+
`)){let r=e+t.length;n.push([t,e,r]),e=r+1}return n},n=>{y(this,Cr,n)})}seal(n,e){Object.defineProperty(this,n,{enumerable:!e&&!!this[n],configurable:!0})}};Sr=new WeakMap,Ut=new WeakMap,Wt=new WeakMap,Cr=new WeakMap,$r=new WeakMap,Ht=new WeakMap,Gt=new WeakMap,Nr=new WeakSet,On=function(){let n=this.getLines(),e=n[n.length-1];return{height:n.length,width:e[2]-e[1]}}});var tt,_n,Mn,nn,ms=k(()=>{"use strict";ie();pe();hs();qn();nn=class extends Vt{constructor(){super(...arguments);T(this,tt)}get length(){return this.childNodes.length}text(e){return ke(this.childNodes,e)}normalize(){let e=this.getChildNodes(),t=r=>{var i,s;e.splice(r,1),(i=e[r-1])==null||i.setAttribute("nextSibling",e[r]),(s=e[r])==null||s.setAttribute("previousSibling",e[r-1])};for(let r=e.length-1;r>=0;r--){let{type:i,data:s}=e[r];i!=="text"||e.length===1||this.getGaps(r-(r&&1))||s===""&&t(r)}this.setAttribute("childNodes",e)}removeAt(e){return Ir(this,e,1)[0]}insertAt(e,t=this.length){return Ir(this,t,0,[e]),e}closest(e){let t=rn(e,this),{parentNode:r}=this;for(;r;){if(t(r))return r;({parentNode:r}=r)}}querySelector(e){let t=rn(e,this);return S(this,tt,_n).call(this,t)}querySelectorAll(e){let t=rn(e,this);return S(this,tt,Mn).call(this,t)}append(...e){this.safeAppend(e)}safeAppend(e){for(let t of e)this.insertAt(t)}replaceChildren(...e){this.safeReplaceChildren(e)}safeReplaceChildren(e){for(let t=this.length-1;t>=0;t--)this.removeAt(t);this.safeAppend(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,t=""){return this.childNodes.map(r=>r.toString(e)).join(t)}caretPositionFromIndex(e){}elementFromIndex(e){}elementFromPoint(e,t){}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];o.setAttribute("aIndex",s);let l=o.lint(s,t);l.length>0&&r.push(...l),s+=o.toString().length+this.getGaps(i)}return r}print(e={}){let t=e.class;return this.toString()?(t===""?"":`<span class="wpb-${t!=null?t:this.type}${this.getAttribute("invalid")?" wpb-invalid":""}">`)+Me(this.childNodes,e)+(t===""?"":"</span>"):""}json(e,t=this.getAbsoluteIndex()){let r=oe(X({},this),{type:this.type,range:[t,t+this.toString().length],childNodes:[]});for(let i=0,s=t+this.getAttribute("padding");i<this.length;i++){let o=this.childNodes[i],{length:l}=o.toString();o.setAttribute("aIndex",s),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}};tt=new WeakSet,_n=function(e){var t;for(let r of this.childNodes){if(r.type==="text")continue;if(e(r))return r;let i=S(t=r,tt,_n).call(t,e);if(i)return i}},Mn=function(e){var r;let t=[];for(let i of this.childNodes)i.type!=="text"&&(e(i)&&t.push(i),t=[...t,...S(r=i,tt,Mn).call(r,e)]);return t}});var zn,xs,al,ll,dl,gl,pl,fs,Dn,sn,bs,Er,Ts=k(()=>{"use strict";ie();M();W();qn();zn=String.raw`[${Se}\t]*`,xs=String.raw`<\s*(?:/\s*)?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|(?:rfc|pmid)(?=[-::]?${zn}\d)|isbn(?=[-::]?${zn}(?:\d(?:${zn}|-)){6})`,al=new RegExp(String.raw`${xs}|https?[:/]/+`,"giu"),ll=new RegExp(xs,"giu"),dl=new Set(["attr-value","ext-link-text","link-text"]),gl={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},pl={"<":"tag-like","[":"lonely-bracket","{":"lonely-bracket","]":"lonely-bracket","}":"lonely-bracket",h:"lonely-http",r:"lonely-http",p:"lonely-http",i:"lonely-http"},fs=new Set(["html","head","style","title","body","a","audio","img","video","embed","iframe","object","canvas","script","col","colgroup","tbody","tfoot","thead","button","input","label","option","select","textarea"]);try{Dn=new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch(a){Dn=/\w/u}Er=class extends Vt{constructor(e){super();T(this,sn);ge(this,"data","");this.data=e}get type(){return"text"}toString(e){var t;return e&&!((t=this.parentNode)!=null&&t.getAttribute("built"))?ae(this.data):this.data}text(){return this.data}lint(e=this.getAbsoluteIndex(),t){var V,B,ne;if(t===!1)return[];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:K,name:J,tag:ee}=p;if(K!=="ext-attr")d=!0;else if(ee==="ref"&&(J==="name"||J==="extends"||J==="follow")||J==="group"&&(ee==="ref"||ee==="references")||ee==="choose"&&(J==="before"||J==="after"))return[]}if(t!=null||(t=l==="free-ext-link"||l==="ext-link-url"||l==="ext-link-text"||l==="image-parameter"&&g==="link"||d?ll:al),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,f=this.getRootNode(),b=f.toString(),{ext:v,html:C,variants:w}=f.getAttribute("config"),{top:I,left:F}=f.posFromIndex(e),z=new Set(["onlyinclude","noinclude","includeonly",...v,...C[0],...C[1],...C[2],...fs]);for(let K=t.exec(r);K;K=t.exec(r)){let[,J,ee]=K,{index:Y,0:_}=K;if(ee&&ee!=="]"){let{length:be}=ee;Y+=be,_=_.slice(be)}_=_.toLowerCase();let[q]=_,we=q==="r"||q==="p"||q==="i",{length:he}=_;if(q==="<"&&!z.has(J.toLowerCase())||q==="["&&l==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(r.slice(Y+1))||s!=null&&s.is("ext")&&m==="nowiki"&&((V=s.innerText)!=null&&V.includes("]")))||we&&(!i.isPlain()||dl.has(l)))continue;q==="]"&&(Y||he>1)&&t.lastIndex--;let xe=e+Y,Ye=xe+he,Ze=b[Ye],Zr=b[xe-1],ut=he>1&&!(q==="<"&&(/^<\s/u.test(_)||!/[\s/>]/u.test(Ze!=null?Ze:"")||fs.has(J))||d&&(q==="["||q==="]")||we&&l==="parameter-value"||/^(?:rfc|pmid|isbn)$/iu.test(_))||q==="{"&&(Ze===q||Zr==="-"&&w.length>0)||q==="}"&&(Zr===q||Ze==="-"&&w.length>0)||q==="["&&(l==="ext-link-text"||h==="free-ext-link"&&!r.slice(Y+1).trim())||q==="]"&&x==="free-ext-link"&&!r.slice(0,Y).includes("]")?"error":"warning",Ln=q==="{"||q==="[";if(ut==="warning"&&(Ln||(q==="]"||q==="}"))){let be=gl[q],Fn=Ln?r.slice(Y+1):r.slice(0,Y);if(q==="{"&&((B=be.exec(Fn))==null?void 0:B[0])==="}"||q==="}"&&((ne=be.exec(Fn))==null?void 0:ne[0])==="{")continue;if(!Fn.includes(q)){let Ji=Ln?"nextSibling":"previousSibling",ct=this[Ji];for(;ct&&(ct.type!=="text"||!be.test(ct.data));)ct=ct[Ji];if(ct&&be.exec(ct.data)[0]!==q)continue}}we?_=_.toUpperCase():_==="{"&&Zr==="-"&&ut==="error"?(ut="warning",Y>0&&(_="-{",Y--,xe--,he=2)):_==="}"&&Ze==="-"&&ut==="error"&&(ut="warning",Y<r.length-1&&(_="}-",Ye++,he=2));let Xi=this.posFromIndex(Y),{line:Qi,character:Ki}=Bn(I,F,Xi.top+1,Xi.left),Bt={rule:pl[q],message:$.msg('lonely "$1"',we||q==="h"||_==="-{"||_==="}-"?_:q),severity:ut,startIndex:xe,endIndex:Ye,startLine:Qi,endLine:Qi,startCol:Ki,endCol:Ki+he};if(q==="<")Bt.suggestions=[{desc:"escape",range:[xe,xe+1],text:"<"}];else if(q==="h"&&l!=="link-text"&&Dn.test(Zr||""))Bt.suggestions=[{desc:"whitespace",range:[xe,xe],text:" "}];else if(q==="["&&l==="ext-link-text"){let be=i.getAbsoluteIndex()+i.toString().length;Bt.suggestions=[{desc:"escape",range:[be,be+1],text:"]"}]}else if(q==="]"&&x==="free-ext-link"&&ut==="error"){let be=e-o.toString().length;Bt.suggestions=[{desc:"left bracket",range:[be,be],text:"["}]}else we&&(Bt.suggestions=[...K[0]===_?[]:[{desc:"uppercase",range:[xe,Ye],text:_}],...Ze===":"||Ze===":"?[{desc:"whitespace",range:[Ye,Ye+1],text:" "}]:[]]);u.push(Bt)}return u}replaceData(e){S(this,sn,bs).call(this,e)}print(){return Mt(this.data)}};sn=new WeakSet,bs=function(e){this.setAttribute("data",e)}});var ve,ft=k(()=>{"use strict";pe();ve=(a=!0,n=!0)=>e=>{class t extends e{text(){return""}lint(i){return a?[]:super.lint(i)}}return Fe(t,e),t}});var Lr,me,xt=k(()=>{"use strict";O();me=class extends A{constructor(e,t,r,i,s){super(e,r,i,s);T(this,Lr);y(this,Lr,t)}get type(){return c(this,Lr)}lint(e=this.getAbsoluteIndex()){return super.lint(e,!1)}};Lr=new WeakMap});var ue,ze=k(()=>{"use strict";pe();ue=({length:a})=>n=>{class e extends n{getAttribute(r){return r==="padding"?a:super.getAttribute(r)}}return Fe(e,n),e}});var Xt,Q,De=k(()=>{"use strict";O();Q=class extends A{constructor(e,t,r,i,s){super(e,r,i,s);T(this,Xt);y(this,Xt,t)}get type(){return c(this,Xt)}set type(e){y(this,Xt,e)}getAttribute(e){var t;return e==="invalid"?this.type==="converter-flag"&&!!((t=this.parentNode)!=null&&t.isInvalidFlag(this)):super.getAttribute(e)}};Xt=new WeakMap});var ul,ys,bt,$e,Ue,Un,cl,Te,Fr=k(()=>{"use strict";M();ie();se();ze();O();De();ul=a=>a==="redirect-target"||a==="link";ys=[ue("[[")];Te=class extends(cl=A){constructor(e,t,r,i=[],s="|"){super(void 0,r,i,{});T(this,bt,!0);T(this,$e);T(this,Ue);if(this.insertAt(new Q(e,"link-target",r,i,{})),t!==void 0){let o=new A(t,r,i,{});o.type="link-text",o.setAttribute("stage",10),this.insertAt(o)}y(this,$e,s)}get link(){}get fragment(){return c(this,Ue).fragment}afterBuild(){y(this,Ue,this.getTitle()),c(this,$e).includes("\0")&&y(this,$e,this.buildFromStr(c(this,$e),0)),this.setAttribute("name",c(this,Ue).title),super.afterBuild()}setAttribute(e,t){e==="bracket"?y(this,bt,t):e==="title"?y(this,Ue,t):super.setAttribute(e,t)}toString(e){let t=super.toString(e,c(this,$e));return c(this,bt)?`[[${t}]]`:t}text(){let e=super.text("|");return c(this,bt)?`[[${e}]]`:e}getAttribute(e){return e==="title"?c(this,Ue):super.getAttribute(e)}getGaps(e){return e===0?c(this,$e).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,Ue),p=new L(this,e);if(i.childNodes.some(({type:d})=>d==="template")&&r.push(N(i,p,"unknown-page","template in an internal link target","warning")),l){let d=N(i,p,"url-encoding","unnecessary URL encoding in an internal link");d.suggestions=[{desc:"decode",range:[d.startIndex,d.endIndex],text:et(i.text())}],r.push(d)}if(o==="link"||o==="category"){let d=s==null?void 0:s.childNodes.findIndex(h=>h.type==="text"&&h.data.includes("|")),u=s==null?void 0:s.childNodes[d];if(u){let h=N(s,p,"pipe-like",'additional "|" in the link text',"warning"),m=h.startIndex+s.getRelativeIndex(d);h.suggestions=[{desc:"escape",range:[m,m+u.data.length],text:u.data.replace(/\|/gu,"|")}],r.push(h)}}if(g!==void 0&&!ul(o)){let d=N(i,p,"no-ignored","useless fragment","warning"),u=i.childNodes.findIndex(m=>m.type==="text"&&m.data.includes("#")),h=i.childNodes[u];h&&(d.fix={range:[d.startIndex+i.getRelativeIndex(u)+h.data.indexOf("#"),d.endIndex],text:"",desc:"remove"}),r.push(d)}return r}getTitle(e,t){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:t,temporary:e,decode:!0,selfLink:!0})}print(){return super.print(c(this,bt)?{pre:"[[",post:"]]",sep:c(this,$e)}:{sep:c(this,$e)})}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t),{type:i,fragment:s}=this;return s!==void 0&&(i==="link"||i==="redirect-target")&&(r.fragment=s),r}};Un=R(cl),bt=new WeakMap,$e=new WeakMap,Ue=new WeakMap,Te=j(Un,0,"LinkBaseToken",ys,Te),P(Un,1,Te)});var ce,rt=k(()=>{"use strict";O();ce=class extends A{get innerText(){return this.firstChild.data}constructor(n="",e,t){super(n,e,t)}}});var ks,Wn,hl,D,We=k(()=>{"use strict";ft();rt();ks=[ve()];D=class extends(hl=ce){get type(){return"noinclude"}toString(n){return n?"":super.toString()}};Wn=R(hl),D=j(Wn,0,"NoincludeToken",ks,D),P(Wn,1,D)});var on,vs=k(()=>{"use strict";M();Fr();We();on=class extends Te{get type(){return"redirect-target"}constructor(n,e,t,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,{halfParsed:!0,decode:!0})}lint(n=this.getAbsoluteIndex()){let e=super.lint(n,!1);if(this.length===2){let t=N(this.lastChild,{start:n},"no-ignored","useless link text","warning");t.startIndex--,t.startCol--,t.fix={range:[t.startIndex,t.endIndex],text:"",desc:"remove"},e.push(t)}return e}}});var As,nt,Qt,Hn,ml,Tt,ws=k(()=>{"use strict";ft();O();xt();vs();As=[ve(!1,!1)];Tt=class extends(ml=A){constructor(e,t,r,i,s,o,l=[]){super(void 0,o,l);T(this,nt);T(this,Qt);y(this,nt,e),y(this,Qt,s),this.append(new me(t,"redirect-syntax",o,l),new on(r,i==null?void 0:i.slice(1),o,l))}get type(){return"redirect"}getAttribute(e){return e==="padding"?c(this,nt).length:super.getAttribute(e)}toString(e){return c(this,nt)+super.toString(e)+c(this,Qt)}lint(e=this.getAbsoluteIndex()){let t=e+c(this,nt).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",t),this.lastChild.lint(t)}print(){return super.print({pre:c(this,nt),post:c(this,Qt)})}};Hn=R(ml),nt=new WeakMap,Qt=new WeakMap,Tt=j(Hn,0,"RedirectToken",As,Tt),P(Hn,1,Tt)});var Ss={};te(Ss,{parseRedirect:()=>fl});var fl,Cs=k(()=>{"use strict";W();ws();fl=(a,n,e)=>{var r;(r=n.regexRedirect)!=null||(n.regexRedirect=new RegExp(String.raw`^(\s*)((?:${n.redirection.join("|")})\s*(?::\s*)?)\[\[([^\n|\]]+)(\|.*?)?\]\](\s*)`,"iu"));let t=n.regexRedirect.exec(a);return t&&$.normalizeTitle(t[3],0,!1,n,{halfParsed:!0,temporary:!0,decode:!0}).valid?(a=`\0${e.length}o${a.slice(t[0].length)}`,new Tt(...t.slice(1),n,e),a):!1}});var $s,Gn,xl,yt,Ns=k(()=>{"use strict";ze();O();$s=[ue("<onlyinclude>")];yt=class extends(xl=A){get type(){return"onlyinclude"}toString(n){return`<onlyinclude>${super.toString(n)}</onlyinclude>`}isPlain(){return!0}print(){return super.print({pre:'<span class="wpb-ext"><onlyinclude></span>',post:'<span class="wpb-ext"></onlyinclude></span>'})}};Gn=R(xl),yt=j(Gn,0,"OnlyincludeToken",$s,yt),P(Gn,1,yt)});var it,Rr=k(()=>{"use strict";pe();it=(a=1)=>n=>{class e extends n{getGaps(){return a}}return Fe(e,n),e}});var Is,st,Vn,bl,Ie,an=k(()=>{"use strict";Rr();O();Is=[it()];Ie=class extends(bl=A){constructor(e,t,r,i,s,o=[]){super(void 0,s);T(this,st);ge(this,"closed");ge(this,"selfClosing");this.setAttribute("name",e.toLowerCase()),y(this,st,[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(e){let{selfClosing:t,firstChild:r,lastChild:i}=this,[s,o]=c(this,st);return t?`<${s}${r.toString(e)}/>`:`<${s}${r.toString(e)}>${i.toString(e)}${this.closed?`</${o}>`:""}`}text(){let[e,t]=c(this,st);return this.selfClosing?`<${e}${this.firstChild.text()}/>`:`<${e}${super.text(">")}${this.closed?`</${t}>`:""}`}getAttribute(e){return e==="padding"?c(this,st)[0].length+1:super.getAttribute(e)}print(){let[e,t]=c(this,st);return super.print(this.selfClosing?{pre:`<${e}`,post:"/>"}:{pre:`<${e}`,sep:">",post:this.closed?`</${t}>`:""})}};Vn=R(bl),st=new WeakMap,Ie=j(Vn,0,"TagPairToken",Is,Ie),P(Vn,1,Ie)});var dn,Es,ln,Ls=k(()=>{"use strict";O();an();xt();We();ln=class extends Ie{constructor(e,t,r,i=[]){let s=new me(e,"translate-attr",r,i);t=t==null?void 0:t.replace(/(<tvar\|[^>]+>)([\s\S]*?)(<\/>)/gu,(l,g,p,d)=>(new D(g,r,i),new D(d,r,i),`\0${i.length-1}n${p}\0${i.length}n`)).replace(/(<tvar\s+name\s*=(?:\s*(?:(["'])[\s\S]*?\2|[^"'\s>]+))?\s*>)([\s\S]*?)(<\/tvar\s*>)/giu,(l,g,p,d,u)=>(new D(g,r,i),new D(u,r,i),`\0${i.length-1}n${d}\0${i.length}n`));let o=new A(t,r,i);o.type="translate-inner";super("translate",s,o,"translate",r,i);T(this,dn);this.seal("closed",!0),this.seal("selfClosing",!0)}get type(){return"translate"}toString(e){return e?this.lastChild.toString(!0):super.toString()}text(){return this.lastChild.text()}print(){return`<span class="wpb-ext"><translate${S(this,dn,Es).call(this)?'<span class="wpb-ext-attrs"> <span class="wpb-ext-attr"><span class="wpb-attr-key">nowrap</span></span></span>':""}>${this.lastChild.print({class:"ext-inner"})}</translate></span>`}};dn=new WeakSet,Es=function(){return this.firstChild.toString()===" nowrap"}});var Fs,Xn,Tl,kt,Rs=k(()=>{"use strict";M();se();ft();W();an();Fs=[ve(!1)];kt=class extends(Tl=Ie){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)}toString(n){return n?"":super.toString()}lint(n=this.getAbsoluteIndex()){let e=[],{firstChild:t,closed:r,name:i}=this,s=new L(this,n);if(t.data.trim()){let o=N(t,s,"no-ignored","useless attribute","warning");o.suggestions=[{desc:"remove",range:[o.startIndex,o.endIndex],text:""}],e.push(o)}if(!r){let o=E(this,s,"unclosed-comment",$.msg("unclosed $1",`<${i}>`));o.suggestions=[{desc:"close",range:[o.endIndex,o.endIndex],text:`</${i}>`}],e.push(o)}return e}};Xn=R(Tl),kt=j(Xn,0,"IncludeToken",Fs,kt),P(Xn,1,kt)});var Kt,gn=k(()=>{"use strict";pe();Kt=(a=0)=>n=>{var t,Ps;class e extends n{constructor(){super(...arguments);T(this,t)}getAttr(o){return S(this,t,Ps).call(this).getAttr(o)}}return t=new WeakSet,Ps=function(){return this.childNodes[a]},Fe(e,n),e}});var re,js,Bs,pn,Kn,Os,Jt,_s,Ms,zs,Qn,qs,Re,Ds,Us,Ws,Hs,Gs=k(()=>{"use strict";re=new Set(["align"]),js=new Set(["cite"]),Bs=new Set(["cite","datetime"]),pn=new Set(["width"]),Kn=new Set(["axis","align","bgcolor","height","width","valign"]),Os=new Set([...Kn,"abbr","headers","scope","rowspan","colspan"]),Jt=new Set(["type"]),_s=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),Ms=new Set(["clear"]),zs=new Set(["bgcolor","align","valign"]),Qn=new Set(["qid","forcemathmode","type","display"]),qs=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),Re=new Set,Ds=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"]),Us={div:re,h1:re,h2:re,h3:re,h4:re,h5:re,h6:re,blockquote:js,q:js,p:re,br:Ms,pre:pn,ins:Bs,del:Bs,ul:Jt,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([..._s,"border"]),caption:re,tr:zs,td:Os,th:Os,img:new Set(["alt","src","width","height","srcset"]),font:new Set(["size","color","face"]),hr:pn,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:Jt,poem:re,categorytree:re,combooption:re,math:Re,chem:Re,ce:Re},Ws={gallery:new Set(["mode","showfilename","caption","perrow","widths","heights","showthumbnails"]),poem:new Set(["compact"]),categorytree:new Set(["hideroot","onlyroot","depth","mode","hideprefix","namespaces","showcount","notranslations"]),combooption:new Set(["name","for","inline"]),nowiki:Re,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:Re,inputbox:Re,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:Re,poll:new Set(["id","show-results-before-voting"]),sm2:Jt,flashmp3:Jt,score:new Set(["line_width_inches","lang","override_midi","raw","note-language","override_audio","override_ogg","sound","vorbis"]),seo:new Set(["title","title_mode","title_separator","keywords","description","robots","google_bot","image","image_width","image_height","image_alt","type","site_name","locale","section","author","published_time","twitter_site"]),tab:new Set(["nested","name","index","class","block","inline","openname","closename","collapsed","dropdown","style","bgcolor","container","id","title"]),tabs:new Set(["plain","class","container","id","title","style"]),combobox:new Set(["placeholder","value","id","class","text","dropdown","style"]),math:new Set([...Qn,"chem"]),chem:Qn,ce:Qn,hiero:Re,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:qs,syntaxhighlight:qs,templatedata:Re,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:Re},Hs={table:_s,td:new Set([...Kn,"scope"]),th:Kn,br:Ms,caption:re,div:re,hr:pn,h1:re,h2:re,h3:re,h4:re,h5:re,h6:re,li:Jt,p:re,pre:pn,tr:zs,ul:Jt}});var yl,kl,Pr,Yt,de,Pe,jr,Jn,Zt,Vs=k(()=>{"use strict";M();ie();Gs();se();W();O();De();yl=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,kl=new Set(["ext","arg","magic-word","template"]),Zt=class extends A{constructor(e,t,r,i="",s,o=[],l=$.getConfig(),g=[]){let p=new Q(r,"attr-key",l,g),d;if(r==="title"||t==="img"&&r==="alt")d=new A(s,l,g,{}),d.type="attr-value",d.setAttribute("stage",10);else if(t==="gallery"&&r==="caption"||t==="choose"&&(r==="before"||r==="after")){let u=oe(X({},l),{excludes:[...l.excludes,"heading","html","table","hr","list"]});d=new A(s,u,g,{}),d.type="attr-value",d.setAttribute("stage",1)}else d=new Q(s,"attr-value",l,g,{});super(void 0,l,g);T(this,jr);T(this,Pr);T(this,Yt);T(this,de);T(this,Pe);y(this,Pr,e),this.append(p,d),y(this,de,i),y(this,Pe,[...o]),y(this,Yt,t),this.setAttribute("name",_e(ae(r)))}get type(){return c(this,Pr)}get tag(){return c(this,Yt)}get balanced(){return!c(this,de)||c(this,Pe)[0]===c(this,Pe)[1]}afterBuild(){c(this,de).includes("\0")&&y(this,de,this.buildFromStr(c(this,de),0)),this.parentNode&&y(this,Yt,this.parentNode.name),this.setAttribute("name",_e(this.firstChild.text())),super.afterBuild()}toString(e){let[t="",r=""]=c(this,Pe);return c(this,de)?super.toString(e,c(this,de)+t)+r:this.firstChild.toString(e)}text(){return c(this,de)?`${super.text(`${c(this,de).trim()}"`)}"`:this.firstChild.text()}getGaps(){var e,t;return c(this,de)?c(this,de).length+((t=(e=c(this,Pe)[0])==null?void 0:e.length)!=null?t:0):0}lint(e=this.getAbsoluteIndex(),t){var u;let r=super.lint(e,t),{balanced:i,firstChild:s,lastChild:o,name:l,tag:g}=this,p=new L(this,e);if(!i){let h=N(o,p,"unclosed-quote",$.msg("unclosed $1","quotes"),"warning");h.startIndex--,h.startCol--,h.suggestions=[{range:[h.endIndex,h.endIndex],text:c(this,Pe)[0],desc:"close"}],r.push(h)}let d=S(this,jr,Jn).call(this,e,p);return d&&r.push(d),(u=Hs[g])!=null&&u.has(l)&&r.push(N(s,p,"obsolete-attr","obsolete attribute","warning")),r}getValue(){return c(this,de)?this.lastChild.text().trim():this.type==="ext-attr"||""}getAttribute(e){return e==="invalid"?S(this,jr,Jn).call(this):super.getAttribute(e)}print(){let[e="",t=""]=c(this,Pe);return c(this,de)?super.print({sep:Mt(c(this,de))+e,post:t}):super.print()}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return r.tag=this.tag,r}};Pr=new WeakMap,Yt=new WeakMap,de=new WeakMap,Pe=new WeakMap,jr=new WeakSet,Jn=function(e,t){let{firstChild:r,lastChild:i,type:s,name:o,tag:l}=this,g=this.getValue(),p=Ws[l],d=Us[l],{length:u}=this.toString();if(!(p!=null&&p.has(o))&&!(d!=null&&d.has(o))&&(s==="ext-attr"?p||d:!/\{\{[^{]+\}\}/u.test(o))&&(s==="ext-attr"&&!d||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(o)&&(l==="meta"||l==="link"||!Ds.has(o)))){if(e===void 0)return!0;let h=N(r,t,"illegal-attr","illegal attribute name");return h.suggestions=[{desc:"remove",range:[e,e+u],text:""}],h}else{if(o==="style"&&typeof g=="string"&&yl.test(g))return e===void 0?!0:N(i,t,"insecure-style","insecure style");if(o==="tabindex"&&typeof g=="string"&&g!=="0"){if(e===void 0)return!0;let h=N(i,t,"illegal-attr","nonzero tabindex");return h.suggestions=[{desc:"remove",range:[e,e+u],text:""},{desc:"0 tabindex",range:[h.startIndex,h.endIndex],text:"0"}],h}else if(s!=="ext-attr"&&!i.childNodes.some(({type:h})=>kl.has(h))){let h=cs(l,o),m=String(g).toLowerCase();if(h.length>0&&h.every(x=>x!==m))return e===void 0?!0:N(i,t,"illegal-attr","illegal attribute value","warning")}}return!1}});var Xs,vl,Yn,Br,er,un,ot,cn=k(()=>{"use strict";M();ie();se();W();O();De();Vs();Xs=a=>a.slice(0,-1),vl=a=>`${Xs(a)}-dirty`;try{Yn=new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch(a){Yn=/[^\W_]/u}ot=class extends A{constructor(e,t,r,i,s=[]){super(void 0,i,s,{});T(this,er);T(this,Br);if(y(this,Br,t),this.setAttribute("name",r),e){let o=/([^\s/](?:(?!\0\d+~\x7F)[^\s/=])*)(?:((?:\s(?:\s|\0\d+[cn]\x7F)*)?(?:=|\0\d+~\x7F)(?:\s|\0\d+[cn]\x7F)*)(?:(["'])([\s\S]*?)(\3|$)|(\S*)))?/gu,l="",g=o.exec(e),p=0,d=()=>{l&&(super.insertAt(new Q(l,vl(t),i,s,{})),l="")};for(;g;){let{index:u,0:h,1:m,2:x,3:f,4:b,5:v,6:C}=g;if(l+=e.slice(p,u),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(ae(m).trim())){let w=b!=null?b:C,I=[f,v],F=new Zt(Xs(t),r,m,x,w,I,i,s);d(),super.insertAt(F)}else l+=h;({lastIndex:p}=o),g=o.exec(e)}l+=e.slice(p),d()}}get type(){return c(this,Br)}afterBuild(){let{parentNode:e}=this;(e==null?void 0:e.type)==="td"&&this.setAttribute("name",e.subtype),super.afterBuild()}getAttrTokens(e){return this.childNodes.filter(t=>t instanceof Zt&&(!e||t.name===_e(e)))}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,childNodes:s}=this,o=new Map,l=new Set,g=new L(this,e);if(S(this,er,un).call(this)){let p=E(this,g,"no-ignored","attributes of a closing tag"),d=i.getAbsoluteIndex();p.suggestions=[{desc:"remove",range:[e,p.endIndex],text:""},{desc:"open",range:[d+1,d+2],text:""}],r.push(p)}for(let p of s)if(p instanceof Zt){let{name:d}=p;o.has(d)?(l.add(d),o.get(d).push(p)):o.set(d,[p])}else{let d=p.text().trim();if(d){let u=N(p,g,"no-ignored","containing invalid attribute",Yn.test(d)?"error":"warning");u.suggestions=[{desc:"remove",range:[u.startIndex,u.endIndex],text:" "}],r.push(u)}}if(l.size>0)for(let p of l){let d=o.get(p).map(u=>{let h=u.getValue();return[u,h===!0?"":h]});r.push(...d.map(([u,h],m)=>{let x=N(u,g,"no-duplicate",$.msg("duplicated $1 attribute",p)),f={desc:"remove",range:[x.startIndex,x.endIndex],text:""};return!h||d.slice(0,m).some(([,b])=>b===h)?x.fix=f:x.suggestions=[f],x}))}return r}getAttribute(e){return e==="invalid"?S(this,er,un).call(this):super.getAttribute(e)}print(){return this.toString()?`<span class="wpb-${this.type}${S(this,er,un).call(this)?" wpb-invalid":""}">${this.childNodes.map(e=>e.print(e instanceof Q?{class:e.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}};Br=new WeakMap,er=new WeakSet,un=function(){let{parentNode:e}=this;return(e==null?void 0:e.type)==="html"&&e.closing&&this.text().trim()!==""}});var Qs={};te(Qs,{PreToken:()=>Zn});var Zn,Ks=k(()=>{"use strict";O();We();Zn=class extends A{get type(){return"ext-inner"}constructor(n,e,t=[]){if(n){let r=/<nowiki>/giu,i=/<\/nowiki>/giu,{length:s}=r.source,o=r.exec(n);o&&(i.lastIndex=o.index+s);let l=i.exec(n),g=0,p="";for(;o&&l;)new D(o[0],e,t),new D(l[0],e,t),p+=`${n.slice(g,o.index)}\0${t.length-1}n${n.slice(o.index+s,l.index)}\0${t.length}n`,g=l.index+s+1,r.lastIndex=g,o=r.exec(n),o&&(i.lastIndex=o.index+s),l=i.exec(n);n=p+n.slice(g)}super(n,e,t,{}),this.setAttribute("stage",10)}isPlain(){return!0}lint(n=this.getAbsoluteIndex()){return super.lint(n,/<\s*\/\s*(pre)\b/giu)}}});var tr,hn=k(()=>{"use strict";pe();tr=a=>{class n extends a{toString(t){return super.toString(t,`
|
|
3
|
+
`)}text(){return super.text(`
|
|
4
|
+
`).replace(/\n\s*\n/gu,`
|
|
5
|
+
`)}getGaps(){return 1}print(){return super.print({sep:`
|
|
6
|
+
`})}}return Fe(n,a),n}});var Ys={};te(Ys,{ParamTagToken:()=>at});var Js,ei,Al,at,ti=k(()=>{"use strict";M();se();Or();hn();W();O();De();Js=[tr];at=class extends(Al=A){get type(){return"ext-inner"}constructor(n,e,t=$.getConfig(),r=[],i){if(super(void 0,t,r,{}),e){let s=Q;this.append(...e.split(`
|
|
7
|
+
`).map(o=>i?o:vt(o,t,r,n)).map(o=>new s(o,"param-line",t,r,{})))}r.splice(r.indexOf(this),1),r.push(this)}lint(n=this.getAbsoluteIndex()){let e=new L(this,n),t=$.msg("invalid parameter of <$1>",this.name),r=[];for(let i of this.childNodes){i.setAttribute("aIndex",n);let s=i.childNodes.filter(({type:o})=>o!=="comment"&&o!=="include"&&o!=="noinclude");if(s.some(({type:o})=>o==="ext"))r.push(N(i,e,"no-ignored",t));else{let o=s.findIndex(({type:g})=>g!=="text"),l=s.slice(0,o===-1?void 0:o).map(String).join("");if(l&&!(o===-1?/^[a-z]+(?:\[\])?\s*=/iu:/^[a-z]+(?:\[\])?\s*(?:=|$)/iu).test(l)){let g=N(i,e,"no-ignored",t);g.suggestions=[{desc:"remove",range:[g.startIndex,g.endIndex],text:""}],r.push(g)}else{let g=i.lint(n,!1);g.length>0&&r.push(...g)}}n+=i.toString().length+1}return r}};ei=R(Al),at=j(ei,0,"ParamTagToken",Js,at),P(ei,1,at)});var qr,rr,mn,nr,ri=k(()=>{"use strict";M();pe();se();W();O();xt();nr=class extends A{constructor(e,t,r,i=[]){super(void 0,r,i);T(this,rr);T(this,qr);y(this,qr,e);let s=new A(t[0],r,i);s.type="heading-title",s.setAttribute("stage",2);let o=new me(t[1],"heading-trail",r,i);this.append(s,o)}get type(){return"heading"}get level(){return c(this,qr)}toString(e){let t=S(this,rr,mn).call(this);return t+this.firstChild.toString(e)+t+this.lastChild.toString(e)}text(){let e=S(this,rr,mn).call(this);return e+this.firstChild.text()+e}getAttribute(e){return e==="invalid"?this.inHtmlAttrs()==="error":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=o.startsWith("="),g=l||o.endsWith("="),p=i.childNodes.filter(ir("quote")),d=p.filter(({bold:f})=>f),u=p.filter(({italic:f})=>f),h=new L(this,e),m=this.inHtmlAttrs();if(this.level===1){let f=N(i,h,"h1","<h1>");g||(f.suggestions=[{desc:"h2",range:[f.startIndex,f.endIndex],text:`=${o}=`}]),r.push(f)}if(g){let f=N(i,h,"unbalanced-header",$.msg("unbalanced $1 in a section header",'"="'));if(o!=="=")if(l){let[b]=/^=+/u.exec(o),v=s+b.length;f.suggestions=[{desc:`h${s}`,range:[f.startIndex,f.startIndex+b.length],text:""}],v<7&&f.suggestions.push({desc:`h${v}`,range:[f.endIndex,f.endIndex],text:b})}else{let b=/[^=](=+)$/u.exec(o)[1],v=s+b.length;f.suggestions=[{desc:`h${s}`,range:[f.endIndex-b.length,f.endIndex],text:""}],v<7&&f.suggestions.push({desc:`h${v}`,range:[f.startIndex,f.startIndex],text:b})}r.push(f)}m&&r.push(E(this,h,"parsing-order","section header in an HTML tag",m));let x=this.getRootNode().toString();if(d.length%2){let f=N(d[d.length-1],oe(X({},h),{start:e+s,left:h.left+s}),"format-leakage",$.msg("unbalanced $1 in a section header","bold apostrophes")),b=e+s+o.length;x.slice(f.endIndex,b).trim()?f.suggestions=[{desc:"close",range:[b,b],text:"'''"}]:f.fix={desc:"remove",range:[f.startIndex,f.endIndex],text:""},r.push(f)}if(u.length%2){let f=N(u[u.length-1],{start:e+s},"format-leakage",$.msg("unbalanced $1 in a section header","italic apostrophes")),b=e+s+o.length;x.slice(f.endIndex,b).trim()?f.suggestions=[{desc:"close",range:[b,b],text:"''"}]:f.fix={desc:"remove",range:[f.startIndex,f.endIndex],text:""},r.push(f)}return r}print(){let e=S(this,rr,mn).call(this);return super.print({pre:e,sep:e})}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return r.level=this.level,r}};qr=new WeakMap,rr=new WeakSet,mn=function(){return"=".repeat(this.level)}});var wl,fn,Zs=k(()=>{"use strict";ie();M();O();wl=new RegExp(`https?://${Oe}${qe}$`,"iu"),fn=class extends A{get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){var n;try{return!!((n=this.parentNode)!=null&&n.getDuplicatedArgs().some(([e])=>e===this.name))}catch(e){return!1}}constructor(n,e,t,r=[]){super(void 0,t,r);let i=new A(typeof n=="number"?void 0:n,t,r,{}),s=new A(e,t,r);i.type="parameter-key",i.setAttribute("stage",2),s.type="parameter-value",s.setAttribute("stage",2),this.append(i,s)}trimName(n,e=!0){let t=(typeof n=="string"?n:n.toString(!0)).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");return this.setAttribute("name",t),t}afterBuild(){if(!this.anon){let{parentNode:n,firstChild:e}=this,t=this.trimName(e);n&&n.getArgs(t,!1,!1).add(this)}super.afterBuild()}toString(n){return this.anon?this.lastChild.toString(n):super.toString(n,"=")}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=wl.exec(r.text()))==null?void 0:s[0];if(i&&new URL(i).search){let o=N(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:"{{=}}",desc:"escape"},t.push(o)}return t}print(){return super.print({sep:this.anon?"":"="})}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e);return Object.assign(t,{anon:this.anon},this.duplicated&&{duplicated:!0}),t}}});var eo,_r,dt,At,wt,sr,gt,xn,to,ni,Sl,lt,ro=k(()=>{"use strict";ie();M();pe();se();Rr();O();Zs();De();xt();eo=[it()];lt=class extends(Sl=A){constructor(e,t,r,i=[]){var v,C;let s,o=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(e);o&&(s=Number(o[1]),e=e.replace(`\0${s}h`,i[s].toString().replace(/^\n/u,"")));super(void 0,r,i,{});T(this,gt);ge(this,"modifier","");T(this,_r,"template");T(this,dt,":");T(this,At,!1);T(this,wt,new Map);T(this,sr);let{parserFunction:[l,g],variable:p,functionHook:d}=r,u=(v=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(e))==null?void 0:v[0];if(u)this.setAttribute("modifier",u),e=e.slice(u.length);else if(e.includes(":")){let[w,...I]=e.split(":"),[F]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((C=I[0])!=null?C:"");this.setModifier(`${w}:${F}`)&&(e=I.join(":").slice(F.length))}let h=e.search(/[::]/u),m=e[h]===":",x=h!==-1;if(x||t.length===0&&!c(this,At)){let w=x?e.slice(0,h):e,I=x&&e.slice(h+1),F=ae(w),z=x?F.slice(F.search(/\S/u))+(m?":":""):F.trim(),V=z.toLowerCase(),B=Array.isArray(g),ne=B?g.includes(z):Object.prototype.hasOwnProperty.call(g,z),K=!B&&ne?g[z]:Object.prototype.hasOwnProperty.call(l,V)&&l[V],J=B&&ne||!("functionHook"in r)||d.includes(K),ee=B&&ne||p.includes(K);if(x?K&&J:ee){this.setAttribute("name",K||V.replace(/^#|:$/u,"")),y(this,_r,"magic-word"),m&&y(this,dt,":");let Y=new me(w,"magic-word-name",r,i);if(super.insertAt(Y),I!==!1&&t.unshift([I]),this.name==="invoke")for(let _=0;_<2;_++){let q=t.shift();if(!q)break;let we=new Q(q.join("="),`invoke-${_?"function":"module"}`,r,i);super.insertAt(we)}}}if(this.type==="template"){let w=ae(e).trim();if(!this.normalizeTitle(w,10,{halfParsed:!0,temporary:!0}).valid)throw i.pop(),new SyntaxError("Invalid template name");let I=new Q(e,"template-name",r,i,{});super.insertAt(I)}typeof s=="number"&&(i[s]=void 0);let f=this.isTemplate(),b=1;for(let w=0;w<t.length;w++){let I=t[w];f||this.name==="switch"&&w>0||this.name==="tag"&&w>1||(I[0]=I.join("="),I.length=1),I.length===1&&(I.unshift(b),b++),this.insertAt(new fn(...I,r,i))}this.seal("modifier")}get type(){return c(this,_r)}setModifier(e){let{parserFunction:[,,t,r]}=this.getAttribute("config"),i=ae(e).trim();if(e&&!i.endsWith(":"))return!1;let s=i.slice(0,-1).toLowerCase(),o=t.includes(s),l=r.includes(s);return c(this,At)&&o||!c(this,At)&&(l||!e)||(le.running||this.length>1)&&(o||l||!e)?(this.setAttribute("modifier",e),y(this,At,o),!!e):!1}isTemplate(){return this.type==="template"||this.name==="invoke"}getModule(){}afterBuild(){this.modifier.includes("\0")&&this.setAttribute("modifier",this.buildFromStr(this.modifier,0)),super.afterBuild(),this.isTemplate()&&this.type==="template"&&(y(this,sr,S(this,gt,xn).call(this)),this.setAttribute("name",c(this,sr).title))}toString(e){return`{{${this.modifier}${this.type==="magic-word"?this.firstChild.toString(e)+(this.length===1?"":c(this,dt))+this.childNodes.slice(1).map(t=>t.toString(e)).join("|"):super.toString(e,"|")}}}`}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?"":c(this,dt))+ke(e.slice(1),"|"):super.text("|")}}}`}getAttribute(e){switch(e){case"padding":return this.modifier.length+2;case"title":return c(this,sr);case"colon":return c(this,dt);case"invalid":return this.type==="magic-word"&&this.name==="invoke"&&(this.length===2||!S(this,gt,xn).call(this).valid);default:return super.getAttribute(e)}}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t);if(!this.isTemplate())return r;let{type:i,childNodes:s,length:o}=this,l=new L(this,e),g=i==="magic-word";if(g&&!S(this,gt,xn).call(this).valid)r.push(N(s[1],l,"invalid-invoke","illegal module name"));else{let d=s[g?1:0],u=d.childNodes.findIndex(m=>m.type==="text"&&mt(m.data).includes("#")),h=d.childNodes[u];if(h){let m=N(d,l,"no-ignored","useless fragment","warning");m.fix={range:[m.startIndex+d.getRelativeIndex(u)+h.data.indexOf("#"),m.endIndex],text:"",desc:"remove"},r.push(m)}}if(g&&o===2)return r.push(E(this,l,"invalid-invoke","missing module function")),r;let p=this.getDuplicatedArgs().filter(([,d])=>!d[0].querySelector("ext"));if(p.length>0)for(let[,d]of p)r.push(...d.map(u=>{let h=N(u,l,"no-duplicate","duplicated parameter");return h.suggestions=[{desc:"remove",range:[h.startIndex-1,h.endIndex],text:""}],h}));return r}insertAt(e,t=this.length){return super.insertAt(e,t),e.anon?S(this,gt,to).call(this,e):e.name&&this.getArgs(e.name,!1,!1).add(e),e}getAllArgs(){return this.childNodes.filter(ir("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,wt).has(i)?s=c(this,wt).get(i):(s=new Set(this.getAllArgs().filter(({name:o})=>i===o)),c(this,wt).set(i,s)),s}getDuplicatedArgs(){return[...c(this,wt)].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,s;switch(t){case"if":case"ifexist":case"ifexpr":case"iferror":i=2;break;case"ifeq":i=3;break;case"switch":{let o=r.slice(2),l=o[o.length-1];s=[...o.filter(({anon:g})=>!g),...l!=null&&l.anon?[l]:[]].map(({lastChild:g})=>g);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}s!=null||(s=r.slice(i,i+2).map(({lastChild: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}${this.getAttribute("invalid")?" wpb-invalid":""}">{{${Mt(i)}${s==="magic-word"?r.print()+(t===1?"":c(this,dt))+Me(e.slice(1),{sep:"|"}):Me(e,{sep:"|"})}}}</span>`}};ni=R(Sl),_r=new WeakMap,dt=new WeakMap,At=new WeakMap,wt=new WeakMap,sr=new WeakMap,gt=new WeakSet,xn=function(){let e=this.type==="template";return this.normalizeTitle(this.childNodes[e?0:1].text(),e?10:828,{temporary:!0})},to=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===e)&&(s.setAttribute("name",l),this.getArgs(l,!1,!1).add(s))}},lt=j(ni,0,"TranscludeToken",eo,lt),P(ni,1,lt)});var no,ii,Cl,St,io=k(()=>{"use strict";ft();O();no=[ve()];St=class extends(Cl=A){get type(){return"hidden"}getAttribute(n){return n==="invalid"||super.getAttribute(n)}};ii=R(Cl),St=j(ii,0,"HiddenToken",no,St),P(ii,1,St)});var so,oi,$l,si,Nl,Ct,oo=k(()=>{"use strict";ie();M();se();ze();Rr();O();De();io();so=[ue("{{{"),it()];Ct=class extends(Nl=A){constructor(e,t,r=[]){super(void 0,t,r,{});T(this,oi);for(let i=0;i<e.length;i++){let s=e[i];if(i===0){let o=new Q(s,"arg-name",t,r,{});super.insertAt(o)}else if(i>1){let o=new St(s,t,r);super.insertAt(o)}else{let o=new A(s,t,r);o.type="arg-default",o.setAttribute("stage",2),super.insertAt(o)}}}get type(){return"arg"}get default(){var e,t;return(t=(e=this.childNodes[1])==null?void 0:e.text())!=null?t:!1}toString(e){return`{{{${super.toString(e,"|")}}}}`}text(){return`{{{${ke(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){super.afterBuild()}lint(e=this.getAbsoluteIndex(),t){let{childNodes:[r,i,...s]}=this;r.setAttribute("aIndex",e+3);let o=r.lint(e+3,t);if(i){let l=e+4+r.toString().length;i.setAttribute("aIndex",l);let g=i.lint(l,t);g.length>0&&o.push(...g)}if(s.length>0){let l=new L(this,e);o.push(...s.map(g=>{let p=N(g,l,"no-ignored","invisible content inside triple braces");return p.startIndex--,p.startCol--,p.suggestions=[{desc:"remove",range:[p.startIndex,p.endIndex],text:""},{desc:"escape",range:[p.startIndex,p.startIndex+1],text:"{{!}}"}],p}))}if(!this.getAttribute("include")){let l=E(this,{start:e},"no-arg","unexpected template argument","warning");i&&(l.suggestions=[{range:[e,l.endIndex],text:i.text(),desc:"expand"}]),o.push(l)}return o}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return r.default=this.default,r}};si=R(Nl),oi=new WeakSet,$l=function(){},Ct=j(si,0,"ArgToken",so,Ct),P(si,1,Ct)});var ho={};te(ho,{parseBraces:()=>Mr});var Il,ao,ai,lo,go,po,co,uo,Mr,bn=k(()=>{"use strict";_t();ie();ri();ro();oo();Il={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},ao=String.raw`\[(?!\[)`,ai=String.raw`\n(?![=\0])`,lo=String.raw`|\{{2,}`,go=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),po=Ee(a=>new RegExp(a,"gmu"));co=new RegExp(String.raw`\{\{((?:[^\n{}[]|${ao}|${ai})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${ai})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${ao}|${ai})*\}-`,"gu");uo=a=>{let n=_e(ae(a));return go.has(n)?go.get(n):/^(?:filepath|(?:full|canonical)urle?):./u.test(n)?"m":/^#vardefine:./u.test(n)?"n":"t"},Mr=(a,n,e)=>{var m,x,f,b,v;let t=String.raw`${n.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,r]}=n,i=[],s=[],o=(C,w,I,F)=>{w[w.length-1].push(Le(C.slice(I,F),s))},l;do l!==void 0&&(a=l),l=a.replace(co,(C,w,I)=>{if(w!==void 0||typeof I=="string")try{let{length:F}=e,z=(w!=null?w:I).split("|");return new lt(Le(z[0],s),z.slice(1).map(V=>{let B=V.indexOf("=");return(B===-1?[V]:[V.slice(0,B),V.slice(B+1)]).map(ne=>Le(ne,s))}),n,e),`\0${F}${uo(z[0])}`}catch(F){if(!(F instanceof SyntaxError)||F.message!=="Invalid template name")throw F}return s.push(Le(C,s)),`\0${s.length-1}`});while(l!==a);a=l;let g=a.lastIndexOf("}}")-a.length,p=g+a.length!==-1,d=po(t+(p?lo:"")),u=d.exec(a),h;for(;u||h!==void 0&&h<=a.length&&((x=(m=i[i.length-1])==null?void 0:m[0])!=null&&x.startsWith("="));){if(u!=null&&u[1]){let[,{length:ee}]=u;u[0]=u[0].slice(ee),u.index+=ee}let{0:C,index:w}=u!=null?u:{0:`
|
|
8
|
+
`,index:a.length},I=(f=i.pop())!=null?f:{},{0:F,index:z,parts:V,findEqual:B,pos:ne}=I,K=C==="="&&B;if(C==="]]"||C==="}-")h=w+2;else if(C===`
|
|
9
|
+
`){h=w+1;let{pos:ee,findEqual:Y}=(b=i[i.length-1])!=null?b:{};if(ee===void 0||Y||ae(a.slice(ee,z))!==""){let _=/^(={1,6})(.+)\1((?:\s|\0\d+[cn]\x7F)*)$/u.exec(a.slice(z,w));_&&(_[2]=Le(_[2],s),_[2].includes(`
|
|
10
|
+
`)||(a=`${a.slice(0,z)}\0${e.length}h${a.slice(w)}`,h=z+4+String(e.length).length,new nr(_[1].length,_.slice(2),n,e)))}}else if(C==="|"||K)h=w+1,o(a,V,ne,w),C==="|"&&V.push([]),I.pos=h,I.findEqual=C==="|",i.push(I);else if(C.startsWith("}}")){let ee=C.slice(0,Math.min(F.length,3)),Y=F.length-ee.length,{length:_}=e;h=w+ee.length,o(a,V,ne,w);let q=!1,we="t";if(ee.length===3){let he=V.map(Ye=>Ye.join("=")),xe=he.length>1&&ae(he[1]).trim();new Ct(he,n,e),xe&&xe.endsWith(":")&&r.includes(xe.slice(0,-1).toLowerCase())&&(we="s")}else try{new lt(V[0][0],V.slice(1),n,e),we=uo(V[0][0])}catch(he){if(he instanceof SyntaxError&&he.message==="Invalid template name")q=!0;else throw he}q||(a=`${a.slice(0,z+Y)}\0${_}${we}${a.slice(h)}`,h=z+Y+3+String(_).length,Y>1?i.push({0:F.slice(0,Y),index:z,pos:z+Y,parts:[[]]}):Y===1&&a[z-1]==="-"&&i.push({0:"-{",index:z-1,pos:z+1,parts:[[]]}))}else h=w+C.length,C.startsWith("{")&&(u.pos=h,u.parts=[[]]),i.push(..."0"in I?[I]:[],u);let J=i[i.length-1];if(p&&g+a.length<h)for(p=!1;(v=J==null?void 0:J[0])!=null&&v.startsWith("{");)i.pop(),J=i[i.length-1];d=po(t+(p?lo:"")+(J?`|${Il[J[0][0]]}${J.findEqual?"|=":""}`:"")),d.lastIndex=h,u=d.exec(a)}return Le(a,s)}});var mo={};te(mo,{InputboxToken:()=>li});var li,fo=k(()=>{"use strict";Or();bn();W();ti();li=class extends at{constructor(n,e,t=$.getConfig(),r=[]){let i=Symbol("InputboxToken"),s=t.excludes.includes("heading")?t:oe(X({},t),{excludes:[...t.excludes,"heading"]}),{length:o}=r;r.push(i),e&&(e=vt(e,s,r,n)),e&&(e=Mr(e,s,r)),r.splice(o,1),super(n,e,s,r,{})}}});var Tn={};te(Tn,{NestedToken:()=>di});var El,Ll,zr,or,di,yn=k(()=>{"use strict";M();se();Or();bn();W();O();gi();We();El=new Set(["comment","include","arg","template","magic-word"]),Ll=[!1,!0].map(a=>{let n=a?"includeonly":"noinclude";return new RegExp(String.raw`^(?:<${n}(?:\s[^>]*)?/?>|</${n}\s*>)$`,"iu")}),di=class extends A{constructor(e,t,r,i,s=[]){if(typeof t=="boolean"){let o=Symbol("InputboxToken"),{length:l}=s;s.push(o),e&&(e=vt(e,i,s,t)),e&&(e=Mr(e,i,s)),s.splice(l,1)}else e&&(e=e.replace(t,(o,l,g,p,d)=>{let u=`\0${s.length+1}e`;return new He(l,g,p,d,i,!1,s),u}));e&&(e=e.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(o,l,g)=>(new D(g,i,s),`${l}\0${s.length}n`)));super(e,i,s);T(this,zr);T(this,or);y(this,zr,[...r]),y(this,or,t)}get type(){return"ext-inner"}lint(e=this.getAbsoluteIndex(),t){let r=new L(this,e),i=typeof c(this,or)=="boolean"?Ll[c(this,or)?1:0]:/^<!--[\s\S]*-->$/u;return[...super.lint(e,t),...this.childNodes.filter(s=>{let{type:o,name:l}=s;if(o==="ext")return!c(this,zr).includes(l);if(El.has(o))return!1;let g=s.toString().trim();return g&&!i.test(g)}).map(s=>{let o=N(s,r,"no-ignored",$.msg("invalid content in <$1>",this.name));return o.suggestions=[{desc:"remove",range:[o.startIndex,o.endIndex],text:""},{desc:"comment",range:[o.startIndex,o.endIndex],text:`<!--${s.toString()}-->`}],o})]}};zr=new WeakMap,or=new WeakMap});function xo(a,n,e,t,r){n=ae(n).trim();let i=n.replace(a==="link"?/\0\d+[tq]\x7F/gu:/\0\d+t\x7F/gu,"").trim();switch(a){case"width":return!i&&!!n||/^(?:\d+x?|\d*x\d+)(?:\s*px)?$/u.test(i);case"link":{if(i){if(Fl(e.protocol).test(i))return Rl(e.protocol).test(i)&&n;i.startsWith("[[")&&i.endsWith("]]")&&(i=i.slice(2,-2))}else return n;let s=$.normalizeTitle(i,0,!1,e,{halfParsed:t,decode:!0,selfLink:!0});return s.valid&&s}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 Fl,Rl,Pl,jl,fe,vn,bo,kn,To=k(()=>{"use strict";_t();ie();M();W();O();Fl=Ee(a=>new RegExp(String.raw`^(?:${a}|//|\0\d+m\x7F)`,"iu")),Rl=Ee(a=>new RegExp(String.raw`^(?:(?:${a}|//)${Oe}|\0\d+m\x7F)${qe}$`,"iu")),Pl=Ee(a=>new RegExp(String.raw`^(\s*(?!\s))${a.replace("$1","(.*)")}${a.endsWith("$1")?`(?=$|
|
|
11
|
+
)`:""}(\s*)$`,"u")),jl=new Set(["alt","link","lang","page","caption"]);kn=class extends A{constructor(e,t,r,i){var n=(...Wu)=>(super(...Wu),T(this,vn),T(this,fe,""),this);let s,o=Object.entries(r.img).map(([g,p])=>[g,p,Pl(g)]),l=o.find(([,g,p])=>(s=p.exec(e),s&&(s.length!==4||xo(g,s[2],r,!0,t)!==!1)));if(l&&s){s.length===3?(n(void 0,r,i),y(this,fe,e)):(n(s[2],r,i,{}),y(this,fe,s[1]+l[0]+s[3])),this.setAttribute("name",l[1]);return}n(e,r.excludes.includes("list")?r:oe(X({},r),{excludes:[...r.excludes,"list"]}),i),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get type(){return"image-parameter"}get link(){return this.name==="link"?xo("link",super.text(),this.getAttribute("config")):void 0}afterBuild(){var e;((e=this.parentNode)==null?void 0:e.type)==="gallery-image"&&!jl.has(this.name)&&this.setAttribute("name","invalid"),super.afterBuild()}toString(e){return c(this,fe)?c(this,fe).replace("$1",super.toString(e)):super.toString(e)}text(){return c(this,fe)?c(this,fe).replace("$1",super.text()).trim():super.text().trim()}isPlain(){return this.name==="caption"}getAttribute(e){return e==="invalid"?this.name==="invalid":e==="padding"?Math.max(0,c(this,fe).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=E(this,{start:e},"invalid-gallery","invalid image parameter");o.fix={range:[e-1,o.endIndex],text:"",desc:"remove"},r.push(o)}else if(typeof i=="object"&&i.encoded){let o=E(this,{start:e},"url-encoding","unnecessary URL encoding in an internal link");o.suggestions=[{desc:"decode",range:[e,o.endIndex],text:et(this.text())}],r.push(o)}return r}getValue(){return this.name==="invalid"?this.text():S(this,vn,bo).call(this)||super.text()}print(){return c(this,fe)?`<span class="wpb-image-parameter${this.name==="invalid"?" wpb-invalid":""}">${c(this,fe).replace("$1",`<span class="wpb-image-caption">${Me(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}};fe=new WeakMap,vn=new WeakSet,bo=function(){return c(this,fe)&&!c(this,fe).includes("$1")}});var yo,Bl,Ol,ko,vo,ql,_l,Ao,ar,pi=k(()=>{"use strict";M();se();W();Fr();To();yo=new Map([["manualthumb","Thumb"],["frameless","Frameless"],["framed","Frame"],["thumbnail","Thumb"]]),Bl=new Set(["arg"]),Ol=new Set(["template","magic-word"]),ko=new Set(["left","right","center","none"]),vo=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),ql=new Set(["tiff","tif","png","gif","jpg","jpeg","webp","xcf","pdf","svg","djvu"]),_l=a=>{if(a===void 0)return[];let n=/-\{|\}-|\|/gu,e=[],t=n.exec(a),r=0,i=0;for(;t;){let{0:s,index:o}=t;s!=="|"?r+=s==="-{"?1:-1:r===0&&(e.push(a.slice(i,o)),{lastIndex:i}=n),t=n.exec(a)}return e.push(a.slice(i)),e},Ao=(a,n)=>a.filter(({childNodes:e})=>{let t=e.filter(r=>r.text().trim());return t.length!==1||!n.has(t[0].type)}),ar=class extends Te{get type(){return"file"}get extension(){return this.getAttribute("title").extension}constructor(n,e,t,r=[],i="|"){super(n,void 0,t,r,i);let{extension:s}=this.getTitle(!0,!0);this.safeAppend(_l(e).map(o=>new kn(o,s,t,r)))}lint(n=this.getAbsoluteIndex(),e){var m;let t=super.lint(n,e),r=Ao(this.getAllArgs(),Bl),i=[...new Set(r.map(({name:x})=>x))],s=i.filter(x=>yo.has(x)),o=i.filter(x=>ko.has(x)),l=i.filter(x=>vo.has(x)),[g]=s,p=g==="framed"||g==="manualthumb",d=new L(this,n);if(this.closest("ext-link-text")&&((m=this.getValue("link"))==null?void 0:m.trim())!==""&&t.push(E(this,d,"nested-link","internal link in an external link")),p)for(let x of r.filter(({name:f})=>f==="width")){let f=N(x,d,"invalid-gallery","invalid image parameter");f.fix={range:[f.startIndex-1,f.endIndex],text:"",desc:"remove"},t.push(f)}if(r.length===i.length&&s.length<2&&o.length<2&&l.length<2)return t;let u=(x,f,b=!0)=>v=>{let C=typeof b=="function"?b(v):b,w=N(v,d,"no-duplicate",$.msg(`${x} image $1 parameter`,f),C?"error":"warning");return w.suggestions=[{desc:"remove",range:[w.startIndex-1,w.endIndex],text:""}],w},{extension:h}=this;for(let x of i){if(x==="invalid"||x==="width"&&p)continue;let f=x==="caption",b=r.filter(({name:v})=>v===x);if(f&&(b=[...b.slice(0,-1).filter(v=>v.text()),...b.slice(-1)]),b.length>1){let v=!f||!h||ql.has(h);if(f&&v){let C=Ao(b,Ol);v=C.length>1&&(w=>C.includes(w))}t.push(...b.map(u("duplicated",x,v)))}}return s.length>1&&t.push(...r.filter(({name:x})=>yo.has(x)).map(u("conflicting","frame"))),o.length>1&&t.push(...r.filter(({name:x})=>ko.has(x)).map(u("conflicting","horizontal-alignment"))),l.length>1&&t.push(...r.filter(({name:x})=>vo.has(x)).map(u("conflicting","vertical-alignment"))),t}getAllArgs(){return this.childNodes.slice(1)}getArgs(n){return this.getAllArgs().filter(({name:e})=>n===e)}getArg(n){let e=this.getArgs(n);return e[n==="manualthumb"?0:e.length-1]}getValue(n){var e;return(e=this.getArg(n))==null?void 0:e.getValue()}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e),{extension:r}=this;return r&&(t.extension=r),t}}});var wo,Dr,ci,ui,Ml,Ge,hi=k(()=>{"use strict";M();ze();O();pi();wo=[ue("")];Ge=class extends(Ml=ar){constructor(e,t,r,i,s=[]){let o;if(r!==void 0){let{length:l}=s;o=new A(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);T(this,Dr);ge(this,"privateType","imagemap-image");this.setAttribute("bracket",!1),this.privateType=`${e}-image`,this.seal("privateType",!0)}get type(){return this.privateType}getTitle(e){let t=this.type==="imagemap-image";return this.normalizeTitle(this.firstChild.toString(),t?0:6,{halfParsed:!0,temporary:e,decode:!t})}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t);if(S(this,Dr,ci).call(this)){let i=E(this,{start:e},"invalid-gallery","invalid gallery image");i.suggestions=[{desc:"prefix",range:[e,e],text:"File:"}],r.push(i)}return r}getAttribute(e){return e==="invalid"?S(this,Dr,ci).call(this):super.getAttribute(e)}};ui=R(Ml),Dr=new WeakSet,ci=function(){let{ns:e}=this.getAttribute("title");return e!==6},Ge=j(ui,0,"GalleryImageToken",wo,Ge),P(ui,1,Ge)});var $o={};te($o,{GalleryToken:()=>lr});var So,$t,Co,fi,mi,zl,lr,No=k(()=>{"use strict";hn();W();O();hi();We();So=[tr];lr=class extends(zl=A){constructor(e,t,r=[]){var i;super(void 0,t,r,{});T(this,$t);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;S(this,$t,Co).call(this,l)?super.insertAt(new Ge("gallery",l,g,t,r)):super.insertAt(new D(s,t,r))}}get type(){return"ext-inner"}get widths(){return S(this,$t,fi).call(this,"widths")}get heights(){return S(this,$t,fi).call(this,"heights")}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(),{type:u}=l,h=r+o,m=o?0:i;if(l.setAttribute("aIndex",e),u==="noinclude"&&d&&!/^<!--.*-->$/u.test(d)){let x=e+p;s.push({rule:"no-ignored",message:$.msg("invalid content in <$1>","gallery"),severity:d.endsWith("-->")||/^(?:\||<!--)/u.test(d)?"warning":"error",startIndex:e,endIndex:x,startLine:h,endLine:h,startCol:m,endCol:m+p,suggestions:[{desc:"remove",range:[e,x],text:""},{desc:"comment",range:[e,x],text:`<!--${g}-->`}]})}else if(u!=="noinclude"&&u!=="text"){let x=l.lint(e,t);x.length>0&&s.push(...x)}e+=p+1}return s}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return Object.assign(r,{widths:this.widths,heights:this.heights}),r}};mi=R(zl),$t=new WeakSet,Co=function(e){return this.normalizeTitle(e,6,{halfParsed:!0,temporary:!0,decode:!0}).valid},fi=function(e){var i,s;let t=(i=this.parentNode)==null?void 0:i.getAttr(e),r=typeof t=="string"&&((s=/^(\d+)\s*(?:px)?$/u.exec(t))==null?void 0:s[1]);return r&&Number(r)||120},lr=j(mi,0,"GalleryToken",So,lr),P(mi,1,lr)});var dr,xi=k(()=>{"use strict";M();Fr();dr=class extends Te{get type(){return"link"}lint(n=this.getAbsoluteIndex(),e){let t=super.lint(n,e);return this.closest("ext-link-text")&&t.push(E(this,{start:n},"nested-link","internal link in an external link")),t}}});var Dl,Ul,Ur,Wr,bi,Ve,An=k(()=>{"use strict";M();ie();se();W();O();Dl=String.raw`(?:[${Se}\t]| |�*160;|&#[xX]0*[aA]0;)`,Ul=new RegExp(`${Dl}+`,"gu"),Ve=class extends A{constructor(e,t="free-ext-link",r=$.getConfig(),i){super(e,r,i,{});T(this,Wr);T(this,Ur);y(this,Ur,t)}get type(){return c(this,Ur)}get innerText(){let e=new Map([["!","|"],["=","="]]),t=ke(this.childNodes.map(r=>{let{type:i}=r,s=String(r.name);return i==="magic-word"&&e.has(s)?e.get(s):r}));return this.type==="magic-link"&&(t=t.replace(Ul," ")),t}get link(){let{innerText:e}=this;return this.type==="magic-link"?e.startsWith("ISBN")?`ISBN ${e.slice(5).replace(/[- ]/gu,"").replace(/x$/u,"X")}`:e:ds(e)}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),i=new L(this,e),{type:s,childNodes:o}=this;if(s==="magic-link")return S(this,Wr,bi).call(this)&&r.push(E(this,i,"invalid-isbn","invalid ISBN")),r;let l=s==="ext-link-url",g=l?/\|/u:/[,;。:!?()]+/u,p=o.find(d=>d.type==="text"&&g.test(d.data));if(p){let{data:d}=p,u=N(p,i,"unterminated-url",$.msg("$1 in URL",l?'"|"':"full-width punctuation"),"warning"),{index:h,0:m}=g.exec(d),x=u.startIndex+h;u.suggestions=l?[{desc:"whitespace",range:[x,x+1],text:" "}]:[{desc:"whitespace",range:[x,x],text:" "},{desc:"escape",range:[x,x+m.length],text:encodeURI(m)}],r.push(u)}return r}getUrl(e){}getAttribute(e){return e==="invalid"?S(this,Wr,bi).call(this):super.getAttribute(e)}};Ur=new WeakMap,Wr=new WeakSet,bi=function(){if(this.type==="magic-link"){let{link:e}=this;if(e.startsWith("ISBN")){let t=[...e.slice(5)].map(r=>r==="X"?10:Number(r));return t.length===10?t.reduce((r,i,s)=>r+i*(10-s),0)%11!==0:t.length===13&&(t[12]===10||t.reduce((r,i,s)=>r+i*(s%2?3:1),0)%10!==0)}}return!1}});var Io,Xe,Ti,Wl,Qe,yi=k(()=>{"use strict";M();ze();O();An();Io=[ue("[")];Qe=class extends(Wl=A){constructor(e,t="",r="",i,s=[]){super(void 0,i,s,{});T(this,Xe);let o=e&&/^\0\d+f\x7F$/u.test(e)?s[Number(e.slice(1,-2))]:new Ve(e,"ext-link-url",i,s);if(this.insertAt(o),y(this,Xe,t),r){let l=new A(r,i,s,{});l.type="ext-link-text",l.setAttribute("stage",10),this.insertAt(l)}}get type(){return"ext-link"}toString(e){return this.length===1?`[${super.toString(e)}${c(this,Xe)}]`:`[${super.toString(e,c(this,Xe))}]`}text(){return`[${super.text(" ")}]`}getGaps(){return c(this,Xe).length}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t);return this.length===1&&this.closest("heading-title")&&r.push(E(this,{start:e},"var-anchor","variable anchor in a section header")),r}print(){return super.print(this.length===1?{pre:"[",post:`${c(this,Xe)}]`}:{pre:"[",sep:c(this,Xe),post:"]"})}};Ti=R(Wl),Xe=new WeakMap,Qe=j(Ti,0,"ExtLinkToken",Io,Qe),P(Ti,1,Qe)});var Hr,Eo=k(()=>{"use strict";O();We();xi();yi();Hr=class extends A{get type(){return"imagemap-link"}constructor(n,e,t,r,i=[]){super(void 0,r,i),this.append(n,e.length===2?new dr(...e,r,i):new Qe(...e,r,i),new D(t,r,i))}}});var Fo={};te(Fo,{ImagemapToken:()=>gr});var Lo,ki,Hl,gr,Ro=k(()=>{"use strict";M();pe();se();hn();W();O();We();hi();Eo();Lo=[tr];gr=class extends(Hl=A){get type(){return"ext-inner"}get image(){return this.childNodes.find(ir("imagemap-image"))}constructor(n,e=$.getConfig(),t=[]){if(super(void 0,e,t,{}),!n)return;let r=n.split(`
|
|
13
|
+
`),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=g.indexOf("|"),u=d===-1?g:g.slice(0,d),{valid:h,ns:m}=this.normalizeTitle(u,0,{halfParsed:!0,temporary:!0});if(h&&m===6){let x=new Ge("imagemap",u,d===-1?void 0:g.slice(d+1),e,t);super.insertAt(x),o=!1;continue}else l=!0}else if(g.trim().split(/[\t ]/u,1)[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,{halfParsed:!0,temporary:!0,selfLink:!0}).valid){super.insertAt(new Hr(g.slice(0,d),h.slice(1),u.slice(u.indexOf("]]")+2),e,t));continue}}else if(u.startsWith("[//")||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 Hr(g.slice(0,d),m.slice(1),u.slice(u.indexOf("]")+1),e,t));continue}}}}super.insertAt(new s(g,e,t))}}lint(n=this.getAbsoluteIndex(),e){let t=super.lint(n,e),r=new L(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=>{let s=N(i,r,"invalid-imagemap","invalid link in <imagemap>");return s.suggestions=[{desc:"remove",range:[s.startIndex-1,s.endIndex],text:""},{desc:"comment",range:[s.startIndex,s.startIndex],text:"# "}],s})):t.push(E(this,r,"invalid-imagemap","<imagemap> without an image")),t}getAttribute(n){return n==="invalid"?!this.image:super.getAttribute(n)}};ki=R(Hl),gr=j(ki,0,"ImagemapToken",Lo,gr),P(ki,1,gr)});var Po,vi,Gl,Ke,Ai=k(()=>{"use strict";M();ft();ze();W();rt();Po=[ve(!1),ue("<!--")];Ke=class extends(Gl=ce){constructor(e,t,r,i){super(e,r,i);ge(this,"closed");this.closed=t}get type(){return"comment"}lint(e=this.getAbsoluteIndex()){if(this.closed)return[];let t=E(this,{start:e},"unclosed-comment",$.msg("unclosed $1","HTML comment"));return t.suggestions=[{range:[t.endIndex,t.endIndex],text:"-->",desc:"close"}],[t]}toString(e){return e?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"<!--",post:this.closed?"-->":""})}};vi=R(Gl),Ke=j(vi,0,"CommentToken",Po,Ke),P(vi,1,Ke)});var jo={};te(jo,{CommentedToken:()=>wi});var wi,Bo=k(()=>{"use strict";O();Ai();wi=class extends A{get type(){return"ext-inner"}constructor(n,e,t=[]){if(super(void 0,e,t,{AstText:":",CommentToken:":"}),n){let r=n.indexOf("<!--"),i=r!==-1&&n.indexOf("-->",r+4),s=0;for(;i!==!1&&i!==-1;)r>s&&this.insertAt(n.slice(s,r)),this.insertAt(new Ke(n.slice(r+4,i),!0,e,t)),s=i+3,r=n.indexOf("<!--",s),i=r!==-1&&n.indexOf("-->",r+4);s<n.length&&this.insertAt(n.slice(s))}}lint(n=this.getAbsoluteIndex()){return super.lint(n,/<\s*(?:\/\s*)?(hiero)\b/giu)}}});var Oo={};te(Oo,{NowikiToken:()=>Si});var Vl,Xl,Gr,Ci,Si,qo=k(()=>{"use strict";_t();M();W();rt();Vl=Ee(a=>new RegExp(String.raw`<\s*(?:/\s*)${a==="nowiki"?"":"?"}(${a})\b`,"giu")),Xl=new Set(["templatestyles","section","languages"]),Si=class extends ce{constructor(){super(...arguments);T(this,Gr)}get type(){return"ext-inner"}lint(e=this.getAbsoluteIndex()){let{name:t}=this;if(S(this,Gr,Ci).call(this)){let r=E(this,{start:e},"void-ext",$.msg("nothing should be in <$1>",t));return r.fix={range:[e,r.endIndex],text:"",desc:"empty"},[r]}return super.lint(e,Vl(t))}getAttribute(e){return e==="invalid"?S(this,Gr,Ci).call(this):super.getAttribute(e)}};Gr=new WeakSet,Ci=function(){let{name:e,firstChild:{data:t}}=this;return Xl.has(e)&&!!t}});var _o,$i,Ql,He,gi=k(()=>{"use strict";M();se();W();gn();O();an();cn();_o=[Kt()];He=class extends(Ql=Ie){get type(){return"ext"}constructor(n,e,t,r,i=$.getConfig(),s=!1,o=[]){let l=n.toLowerCase(),g=new ot(!e||/^\s/u.test(e)?e:` ${e}`,"ext-attrs",l,i,o),p=oe(X({},i),{ext:i.ext.filter(u=>u!==l),excludes:[...i.excludes]}),d;switch(p.inExt=!0,l){case"tab":p.ext=p.ext.filter(u=>u!=="tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":case"langconvert":case"phonos":l==="poem"&&p.excludes.push("heading"),d=new A(t,p,o);break;case"pre":{let{PreToken:u}=(Ks(),U(Qs));d=new u(t,p,o);break}case"dynamicpagelist":{let{ParamTagToken:u}=(ti(),U(Ys));d=new u(s,t,p,o);break}case"inputbox":{let{InputboxToken:u}=(fo(),U(mo));d=new u(s,t,p,o);break}case"references":{let{NestedToken:u}=(yn(),U(Tn));p.excludes.push("heading"),d=new u(t,s,["ref"],p,o);break}case"choose":{let{NestedToken:u}=(yn(),U(Tn));d=new u(t,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],p,o);break}case"combobox":{let{NestedToken:u}=(yn(),U(Tn));d=new u(t,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],p,o);break}case"gallery":{let{GalleryToken:u}=(No(),U($o));d=new u(t,p,o);break}case"imagemap":{let{ImagemapToken:u}=(Ro(),U(Fo));d=new u(t,p,o);break}case"hiero":{let{CommentedToken:u}=(Bo(),U(jo));d=new u(t,p,o);break}default:{let{NowikiToken:u}=(qo(),U(Oo));d=new u(t,p,o)}}d.setAttribute("name",l),d.type==="plain"&&(d.type="ext-inner"),super(n,g,d,r,i,o),this.seal("closed",!0)}lint(n=this.getAbsoluteIndex(),e){let t=super.lint(n,e),r=new L(this,n);if(this.name!=="nowiki"){let i=this.inHtmlAttrs();i&&t.push(E(this,r,"parsing-order","extension tag in HTML tag attributes",i))}return this.name==="ref"&&this.closest("heading-title")&&t.push(E(this,r,"var-anchor","variable anchor in a section header")),t}};$i=R(Ql),He=j($i,0,"ExtToken",_o,He),P($i,1,He)});var Do={};te(Do,{parseCommentAndExt:()=>vt});var zo,Kl,Ni,Jl,Mo,vt,Or=k(()=>{"use strict";_t();ie();Ns();We();Ls();Rs();gi();Ai();zo="<onlyinclude>",Kl="</onlyinclude>",{length:Ni}=zo,Jl=[!1,!0].map(a=>{let n=a?"includeonly":"(?:no|only)include",e=a?"noinclude":"includeonly";return Ee(t=>new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${n}(?:\s[^>]*)?/?>|</${n}\s*>|<(${t.join("|")})(\s[^>]*?)?(?:/>|>([\s\S]*?)</(\1\s*)>)|<(${e})(\s[^>]*?)?(?:/>|>([\s\S]*?)(?:</(${e}\s*)>|$))`,"giu"))}),Mo=a=>{let n=a.indexOf(zo);return{i:n,j:a.indexOf(Kl,n+Ni)}},vt=(a,n,e,t)=>{if(t){let{i:o,j:l}=Mo(a);if(o!==-1&&l!==-1){let g="",p=d=>{new D(d,n,e),g+=`\0${e.length-1}n`};for(;o!==-1&&l!==-1;){let d=`\0${e.length}e`;new yt(a.slice(o+Ni,l),n,e),o>0&&p(a.slice(0,o)),g+=d,a=a.slice(l+Ni+1),{i:o,j:l}=Mo(a)}return a&&p(a),g}}let{ext:r}=n,i=r.filter(o=>o!=="translate"&&o!=="tvar"),s=oe(X({},n),{ext:i});if(r.includes("translate")){let o=[];a=a.replace(/<nowiki>[\s\S]*?<\/nowiki>/giu,l=>(o.push(l),`\0${o.length-1}`)).replace(/<translate( nowrap)?>([\s\S]+?)?<\/translate>/gu,(l,g,p)=>{let d=e.length;return new ln(g,p&&Le(p,o),s,e),`\0${d}g`}),a=Le(a,o)}return a.replace(Jl[t?1:0](i),(o,l,g,p,d,u,h,m,x)=>{let f=e.length,b="n";if(l)b="e",new He(l,g,p,d,s,u,e);else if(o.startsWith("<!--")){b="c";let v=o.endsWith("-->");new Ke(o.slice(4,v?-3:void 0),v,n,e)}else u?new kt(u,h,m,x,n,e):new D(o,n,e);return`\0${f}${b}`})}});var Yl,Zl,ed,Uo,pr,je,pt,Je,Ii,td,Nt,Wo=k(()=>{"use strict";M();pe();se();gn();O();W();Yl=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),Zl=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"]),ed=new Set(["strike","big","center","font","tt"]);Uo=[Kt()];Nt=class extends(td=A){constructor(e,t,r,i,s,o){super(void 0,s,o);T(this,pr);T(this,je);T(this,pt);T(this,Je);this.insertAt(t),this.setAttribute("name",e.toLowerCase()),y(this,pr,r),y(this,je,i),y(this,pt,e)}get type(){return"html"}get selfClosing(){return c(this,je)}get closing(){return c(this,pr)}toString(e){return`<${this.closing?"/":""}${c(this,pt)}${super.toString(e)}${c(this,je)?"/":""}>`}text(){let{closing:e}=this,t=c(this,pt)+(e?"":super.text());return`<${e?"/":""}${t}${c(this,je)?"/":""}>`}getAttribute(e){return e==="invalid"?this.inTableAttrs()==="error":e==="padding"?c(this,pt).length+(this.closing?2:1):super.getAttribute(e)}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{name:i,parentNode:s,closing:o,selfClosing:l}=this,g=new L(this,e),p=this.inTableAttrs();if(i==="h1"&&!o){let f=E(this,g,"h1","<h1>");f.suggestions=[{desc:"h2",range:[e+2,e+3],text:"2"}],r.push(f)}if(p){let f=E(this,g,"parsing-order","HTML tag in table attributes",p);p==="error"&&(f.fix={desc:"remove",range:[e,f.endIndex],text:""}),r.push(f)}ed.has(i)&&r.push(E(this,g,"obsolete-tag","obsolete HTML tag","warning")),(i==="b"||i==="strong")&&this.closest("heading-title")&&r.push(E(this,g,"bold-header","bold in section header","warning"));let{html:[,d,u]}=this.getAttribute("config"),h=u.includes(i),m=d.includes(i);if(o&&(l||h)||l&&(!h&&!m)){let f=E(this,g,"unmatched-tag",o?"tag that is both closing and self-closing":"invalid self-closing tag"),b={desc:"open",range:[e+1,e+2],text:""},v={desc:"no self-closing",range:[f.endIndex-2,f.endIndex-1],text:""};m?f.suggestions=[b,v]:o?f.fix=h?b:v:f.suggestions=[v,{desc:"close",range:[f.endIndex-2,f.endIndex],text:`></${i}>`}],r.push(f)}else if(!this.findMatchingTag()){let f=E(this,g,"unmatched-tag",o?"unmatched closing tag":"unclosed tag");if(o){let b=this.closest("magic-word");b&&Yl.has(b.name)?f.severity="warning":f.suggestions=[{desc:"remove",range:[e,f.endIndex],text:""}]}else{let b=s==null?void 0:s.childNodes;Zl.has(i)&&(b!=null&&b.slice(0,b.indexOf(this)).some(({type:v,name:C})=>v==="html"&&C===i))?f.suggestions=[{desc:"close",range:[e+1,e+1],text:"/"}]:this.closest("heading-title")||(f.severity="warning")}r.push(f)}return r}findMatchingTag(){return Ce(c(this,Je),()=>{let{name:e,parentNode:t,closing:r,selfClosing:i}=this,{html:[,s,o]}=this.getAttribute("config"),l=o.includes(e),g=s.includes(e);if(l||g&&i)return this;if(!t)return;let{childNodes:p}=t,d=p.indexOf(this),u=r?p.slice(0,d).reverse():p.slice(d+1),h=[this],{rev:m}=le;for(let x of u)if(!(!x.is("html")||x.name!==e||g&&c(x,je)))if(c(x,pr)===r)h.push(x);else{let f=h.pop();if(f===this)return x;$.viewOnly&&(y(f,Je,[m,x]),y(x,Je,[m,f]))}if($.viewOnly)for(let x of h)y(x,Je,[m,void 0])},e=>{y(this,Je,e),e[1]&&e[1]!==this&&y(e[1],Je,[le.rev,this])})}print(){return super.print({pre:`<${this.closing?"/":""}${c(this,pt)}`,post:`${c(this,je)?"/":""}>`})}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return Object.assign(r,{closing:this.closing,selfClosing:c(this,je)}),r}};Ii=R(td),pr=new WeakMap,je=new WeakMap,pt=new WeakMap,Je=new WeakMap,Nt=j(Ii,0,"HtmlToken",Uo,Nt),P(Ii,1,Nt)});var Ho={};te(Ho,{parseHtml:()=>nd});var rd,nd,Go=k(()=>{"use strict";cn();Wo();rd=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,nd=(a,n,e)=>{var s;let{html:t}=n;(s=n.htmlElements)!=null||(n.htmlElements=new Set([...t[0],...t[1],...t[2]]));let r=a.split("<"),i=r.shift();for(let o of r){let l=rd.exec(o),g=l==null?void 0:l[2],p=g==null?void 0:g.toLowerCase();if(!l||!n.htmlElements.has(p)){i+=`<${o}`;continue}let[,d,,u="",h,m]=l,{length:x}=e,f=new ot(u,"html-attrs",p,n,e),b=f.getAttr("itemprop");if(p==="meta"&&(b===void 0||f.getAttr("content")===void 0)||p==="link"&&(b===void 0||f.getAttr("href")===void 0)){i+=`<${o}`,e.length=x;continue}i+=`\0${e.length}x${m}`,new Nt(g,f,d==="/",h==="/>",n,e)}return i}});var ur,Ei=k(()=>{"use strict";gn();O();xt();cn();ur=class extends Kt(1)(A){constructor(n,e,t,r,i,s=[],o){super(void 0,i,s,o),this.append(new me(e,"table-syntax",i,s),new ot(r,"table-attrs",t,i,s))}}});var Ae,Vr,Xr,Li,cr,Fi=k(()=>{"use strict";M();se();O();Ei();cr=class extends ur{constructor(e,t,r,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);T(this,Xr);T(this,Ae,"");T(this,Vr);s&&([tn(this,Ae)._]=s);let l=new A(t==null?void 0:t.slice(((g=s==null?void 0:s.index)!=null?g:NaN)+c(this,Ae).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 S(this,Xr,Li).call(this).subtype}afterBuild(){c(this,Ae).includes("\0")&&y(this,Ae,this.buildFromStr(c(this,Ae),0)),super.afterBuild()}toString(e){let{childNodes:[t,r,i]}=this;return t.toString(e)+r.toString(e)+c(this,Ae)+i.toString(e)}text(){let{childNodes:[e,t,r]}=this;return e.text()+t.text()+c(this,Ae)+r.text()}getGaps(e){return e===1?c(this,Ae).length:0}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),i=new L(this,e+this.getRelativeIndex(this.length-1));for(let s of this.lastChild.childNodes)if(s.type==="text"){let{data:o}=s;if(o.includes("|")){let l=o.includes("||"),g=N(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,`
|
|
14
|
+
${p}`),desc:"newline"}}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(`
|
|
15
|
+
`)}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,Ae)}${r.print()}</span>`}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t),{rowspan:i,colspan:s}=this;return Object.assign(r,{subtype:this.subtype},i!==1&&{rowspan:i},s!==1&&{colspan:s}),r}};Ae=new WeakMap,Vr=new WeakMap,Xr=new WeakSet,Li=function(){return Ce(c(this,Vr),()=>{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 X({},S(o=i,Xr,Li).call(o))},e=>{y(this,Vr,e)})}});var hr,Ri=k(()=>{"use strict";M();Ei();Fi();hr=class extends ur{lint(n=this.getAbsoluteIndex(),e){let t=super.lint(n,e),r=this.childNodes.find(({type:o})=>o==="table-inter");if(!r)return t;let i=Dt(r);if(!i)return t;let s=N(r,{start:n},"fostered-content","content to be moved out from the table",i);return s.startIndex++,s.startLine++,s.startCol=0,t.push(s),t}getRowCount(){return Number(this.childNodes.some(n=>n instanceof cr&&n.isIndependent()&&!n.firstChild.text().endsWith("+")))}}});var id,sd,Pi,wn,Vo=k(()=>{"use strict";M();pe();se();W();Ri();xt();id=(a,n)=>new Array(a).fill(void 0).map((e,t)=>n(t)),sd=({type:a})=>a==="tr"||a==="table-syntax",Pi=class extends Array{},wn=class extends hr{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 L(this,n);this.closed||t.push(N(this.firstChild,r,"unclosed-table",$.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=N(this.getNthRow(g),r,"table-layout","inconsistent table layout","warning");p.startIndex++,p.startLine++,p.startCol=0,t.push(p)}}return t}close(n=`
|
|
16
|
+
|}`,e){let t=this.getAttribute("config"),r=this.getAttribute("accum"),i=[n];le.run(()=>{let s=new me(void 0,"table-syntax",t,r);super.insertAt(s)}),this.lastChild.safeReplaceChildren(i)}getLayout(n){let e=this.getAllRows(),{length:t}=e,r=Pi.from(id(t,()=>[]));for(let i=0;i<r.length;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(sd(p))break}return r}getAllRows(){return[...super.getRowCount()?[this]:[],...this.childNodes.slice(1).filter(n=>n.type==="tr"&&n.getRowCount()>0)]}getNthRow(n,e,t){let r=super.getRowCount();if(n===0&&r)return this;r&&n--;for(let i of this.childNodes.slice(2)){let{type:s}=i;if(s==="tr"&&i.getRowCount()&&(n--,n<0))return i}}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e);return t.closed=this.closed,t}}});var Sn,Xo=k(()=>{"use strict";Ri();Sn=class extends hr{get type(){return"tr"}constructor(n,e,t,r){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,n,"tr",e,t,r)}}});var mr,ji=k(()=>{"use strict";rt();mr=class extends ce{get indent(){return this.innerText.split(":").length-1}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e),{indent:r}=this;return r&&(t.indent=r),t}}});var fr,Bi=k(()=>{"use strict";ji();fr=class extends mr{get type(){return"dd"}}});var Ko={};te(Ko,{parseTable:()=>ad});var od,Qo,ad,Jo=k(()=>{"use strict";O();Vo();Xo();Fi();Bi();od=a=>a.lastChild.constructor!==A,Qo=(a,n)=>a.type==="td"?n.pop():a,ad=({firstChild:{data:a},type:n,name:e},t,r)=>{let i=[],s=a.split(`
|
|
17
|
+
`),o=n==="root"||n==="parameter-value"||n==="ext-inner"&&e==="poem"?"":`
|
|
18
|
+
${s.shift()}`,l,g=(p,d)=>{if(!d){o+=p;return}let{lastChild:u}=d;if(od(d)){let h=new A(p,t,r);h.type="table-inter",h.setAttribute("stage",3),d.insertAt(h)}else u.setText(u.toString()+p)};for(let p of s){l=i.pop();let[d]=/^(?:\s|\0\d+[cno]\x7F)*/u.exec(p),u=p.slice(d.length),h=/^(:*)((?:\s|\0\d+[cn]\x7F)*)(\{\||\{(?:\0\d+[cn]\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(u);if(h){for(;l&&l.type!=="td";)l=i.pop();let[,C,w,I,F]=h;C&&new fr(C,t,r),g(`
|
|
19
|
+
${d}${C&&`\0${r.length-1}d`}${w}\0${r.length}b`,l),i.push(...l?[l]:[],new wn(I,F,t,r));continue}else if(!l){o+=`
|
|
20
|
+
${p}`;continue}let m=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(u);if(!m){g(`
|
|
21
|
+
${p}`,l),i.push(l);continue}let[,x,f,b,v]=m;if(x){for(;l.type!=="table";)l=i.pop();l.close(`
|
|
22
|
+
${d}${x}`,!0),g(v,i[i.length-1])}else if(f){l=Qo(l,i),l.type==="tr"&&(l=i.pop());let C=new Sn(`
|
|
23
|
+
${d}${f}`,v,t,r);i.push(l,C),l.insertAt(C)}else{l=Qo(l,i);let C=b==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu,w=C.exec(v),I=0,F=`
|
|
24
|
+
${d}${b}`,z=V=>{let B=new cr(F,v.slice(I,w==null?void 0:w.index),t,r);return V.insertAt(B),B};for(;w;)z(l),{lastIndex:I}=C,[F]=w,w=C.exec(v);i.push(l,z(l))}}return o.slice(1)}});var Cn,Yo=k(()=>{"use strict";rt();Cn=class extends ce{get type(){return"hr"}}});var Zo,Oi,ld,It,ea=k(()=>{"use strict";ft();ze();rt();Zo=[ve(),ue("__")];It=class extends(ld=ce){get type(){return"double-underscore"}constructor(n,e,t,r){var l,g;super(n,t,r);let i=n.toLowerCase(),{doubleUnderscore:[,,s,o]}=t;this.setAttribute("name",(g=e?(l=o==null?void 0:o[n])==null?void 0:l.toLowerCase():s==null?void 0:s[i])!=null?g:i)}toString(){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}};Oi=R(ld),It=j(Oi,0,"DoubleUnderscoreToken",Zo,It),P(Oi,1,It)});var ta={};te(ta,{parseHrAndDoubleUnderscore:()=>dd});var dd,ra=k(()=>{"use strict";Yo();ea();ri();dd=({firstChild:{data:a},type:n,name:e},t,r)=>{var l,g,p;let{doubleUnderscore:[i,s,o]}=t;return(l=t.insensitiveDoubleUnderscore)!=null||(t.insensitiveDoubleUnderscore=new Set(i)),(g=t.sensitiveDoubleUnderscore)!=null||(t.sensitiveDoubleUnderscore=new Set(s)),(p=t.regexHrAndDoubleUnderscore)!=null||(t.regexHrAndDoubleUnderscore=new RegExp(`__(${[...i,...s].join("|")})__`,"giu")),n!=="root"&&(n!=="ext-inner"||e!=="poem")&&(a=`\0${a}`),a=a.replace(/^((?:\0\d+[cno]\x7F)*)(-{4,})/gmu,(d,u,h)=>(new Cn(h,t,r),`${u}\0${r.length-1}r`)).replace(t.regexHrAndDoubleUnderscore,(d,u)=>{var f;let h=t.sensitiveDoubleUnderscore.has(u),m=u.toLowerCase(),x=t.insensitiveDoubleUnderscore.has(m);return h||x?(new It(u,h,t,r),`\0${r.length-1}${x&&((f=o==null?void 0:o[m])!=null?f:m)==="toc"?"u":"n"}`):d}).replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(d,u,h,m,x)=>{let f=`${u}\0${r.length}h`;return new nr(h.length,[m,x],t,r),f}),n==="root"||n==="ext-inner"&&e==="poem"?a:a.slice(1)}});var xr,$n,na=k(()=>{"use strict";M();se();W();rt();$n=class extends ce{constructor(e,t,r,i){super(e,r,i);T(this,xr);y(this,xr,t)}get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}get closing(){return X(X({},this.bold?{bold:c(this,xr).bold}:void 0),this.italic?{italic:c(this,xr).italic}:void 0)}text(){let{parentNode:e,innerText:t}=this;return(e==null?void 0:e.type)==="image-parameter"&&e.name!=="caption"?"":t}lint(e=this.getAbsoluteIndex()){let{previousSibling:t,nextSibling:r,bold:i,closing:s}=this,o=(t==null?void 0:t.type)==="text"?t.data:void 0,l=(r==null?void 0:r.type)==="text"?r.data:void 0,g=$.msg('lonely "$1"',"'"),p=[],d=new L(this,e),u=(h,m,x)=>[{desc:"escape",range:[h,m],text:"'".repeat(x)},{desc:"remove",range:[h,m],text:""}];if(o!=null&&o.endsWith("'")){let h=E(this,d,"lonely-apos",g,(s.bold||s.italic)&&(/[a-z\d]'$/iu.test(o)||l&&/^[a-z\d]/iu.test(l))?"warning":"error"),{startIndex:m,startLine:x,startCol:f}=h,[,{length:b}]=/(?:^|[^'])('+)$/u.exec(o),v=e-b;p.push(oe(X({},h),{startIndex:v,endIndex:m,endLine:x,startCol:f-b,endCol:f,suggestions:u(v,m,b)}))}if(l!=null&&l.startsWith("'")){let h=E(this,d,"lonely-apos",g),{endIndex:m,endLine:x,endCol:f}=h,[{length:b}]=/^'+/u.exec(l),v=m+b;p.push(oe(X({},h),{startIndex:m,endIndex:v,startLine:x,startCol:f,endCol:f+b,suggestions:u(m,v,b)}))}if(i&&this.closest("heading-title")){let h=E(this,d,"bold-header","bold in section header","warning");h.suggestions=[{desc:"remove",range:[e,e+3],text:""}],p.push(h)}return p}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return Object.assign(r,{bold:this.bold,italic:this.italic}),r}};xr=new WeakMap});var ia={};te(ia,{parseQuotes:()=>qi});var qi,_i=k(()=>{"use strict";na();qi=(a,n,e,t)=>{var h;let r=a.split(/('{2,})/u),{length:i}=r;if(i===1)return a;let s=0,o=0,l,g,p;for(let m=1;m<i;m+=2){let x=r[m].length;switch(x){case 2:o++;break;case 4:r[m-1]+="'",r[m]="'''";case 3:if(s++,l!==void 0)break;r[m-1].endsWith(" ")?g===void 0&&p===void 0&&(p=m):r[m-1].slice(-2,-1)===" "?l=m:g!=null||(g=m);break;default:r[m-1]+="'".repeat(x-5),r[m]="'''''",o++,s++}}if(o%2===1&&s%2===1){let m=(h=l!=null?l:g)!=null?h:p;m!==void 0&&(r[m]="''",r[m-1]+="'")}let d=!0,u=!0;for(let m=1;m<i;m+=2){let x=r[m].length,f=x!==2,b=x!==3;f&&(d=!d),b&&(u=!u),new $n(r[m],{bold:f&&d,italic:b&&u},n,e),r[m]=`\0${e.length-1}q`}return r.join("")}});var sa={};te(sa,{parseExternalLinks:()=>Mi});var Mi,zi=k(()=>{"use strict";ie();yi();An();Mi=(a,n,e,t)=>{var r;return(r=n.regexExternalLinks)!=null||(n.regexExternalLinks=new RegExp(String.raw`\[(\0\d+f\x7F|(?:(?:${n.protocol}|//)${Oe}|\0\d+m\x7F)${qe}(?=[[\]<>"\t${Se}]|\0\d))([${Se}]*(?![${Se}]))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),a.replace(n.regexExternalLinks,(i,s,o,l)=>{let{length:g}=e,p=/&[lg]t;/u.exec(s);return p&&(o="",l=s.slice(p.index)+o+l,s=s.slice(0,p.index)),t?(new Ve(s,"ext-link-url",n,e),`[\0${g}f${o}${l}]`):(new Qe(s,o,l,n,e),`\0${g}w`)})}});var Nn,oa=k(()=>{"use strict";ie();Fr();Nn=class extends Te{get type(){return"category"}get sortkey(){let{childNodes:[,n]}=this;return n&&mt(n.text())}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e),{sortkey:r}=this;return r&&(t.sortkey=r),t}}});var la={};te(la,{parseLinks:()=>aa});var gd,aa,da=k(()=>{"use strict";W();_i();zi();xi();pi();oa();gd=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)([\s\S]*)$/u,aa=(a,n,e,t)=>{var o;(o=n.regexLinks)!=null||(n.regexLinks=new RegExp(String.raw`^\s*(?:${n.protocol}|//)`,"iu"));let r=n.inExt?/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]]))?\]\]([\s\S]*)$/u:/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]])?)?\]\]([\s\S]*)$/u,i=a.split("[["),s=i.shift();for(let l=0;l<i.length;l++){let g=!1,p,d,u,h,m=i[l],x=r.exec(m);if(x)[,p,d,u,h]=x,h.startsWith("]")&&(u!=null&&u.includes("["))&&(u+="]",h=h.slice(1));else{let w=gd.exec(m);w&&(g=!0,[,p,d,u]=w)}if(p===void 0||n.regexLinks.test(p)||/\0\d+[exhbru]\x7F/u.test(p)){s+=`[[${m}`;continue}let f=p.trim().startsWith(":");if(f&&g){s+=`[[${m}`;continue}let{ns:b,valid:v}=$.normalizeTitle(p,0,!1,n,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0});if(v){if(g){if(b!==6){s+=`[[${m}`;continue}let w=!1;for(l++;l<i.length;l++){let I=i[l],F=I.split("]]");if(F.length>2){w=!0,u+=`[[${F[0]}]]${F[1]}`,h=F.slice(2).join("]]");break}else if(F.length===2)u+=`[[${F[0]}]]${F[1]}`;else{u+=`[[${I}`;break}}if(u=aa(u,n,e,t),!w){s+=`[[${p}${d}${u}`;continue}}}else{s+=`[[${m}`;continue}u&&(u=qi(u,n,e,t));let C=dr;f||(b===6?(u&&(u=Mi(u,n,e,!0)),C=ar):b===14&&(C=Nn)),u===void 0&&d&&(u=""),s+=`\0${e.length}l${h}`,new C(p,u,n,e,d)}return s}});var ha={};te(ha,{parseMagicLinks:()=>pd});var ca,ga,pa,ua,pd,ma=k(()=>{"use strict";ie();An();ca=String.raw`[${Se}\t]| |�*160;|�*a0;`,ga=`(?:${ca})+`,pa=`(?:${ca}|-)`,ua=String.raw`(?:RFC|PMID)${ga}\d+\b|ISBN${ga}(?:97[89]${pa}?)?(?:\d${pa}?){9}[\dx]\b`,pd=(a,n,e)=>{if(!n.regexMagicLinks)try{n.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${n.protocol})(${Oe}${qe})|${ua})`,"giu")}catch(t){n.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${n.protocol})(${Oe}${qe})|${ua})`,"giu")}return a.replace(n.regexMagicLinks,(t,r,i)=>{let s=r?t.slice(r.length):t;if(i){let o="",l=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(s);l&&(o=s.slice(l.index),s=s.slice(0,l.index));let g=s.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,p=g.exec(s);if(p){let d=1;p[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(s.slice(0,p.index))&&(d=2),o=s.slice(p.index+d)+o,s=s.slice(0,p.index+d)}return o.length>=i.length?t:(new Ve(s,void 0,n,e),`${r}\0${e.length-1}w${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(s))return t;return new Ve(s,"magic-link",n,e),`${r}\0${e.length-1}i`})}});var fa,xa=k(()=>{"use strict";fa=(a,n)=>a.startsWith(n)?n.length:[...n].findIndex((e,t)=>e!==a[t])});var In,ba=k(()=>{"use strict";ji();In=class extends mr{get type(){return"list"}}});var Ta={};te(Ta,{parseList:()=>ud});var ud,ya=k(()=>{"use strict";xa();ba();Bi();ud=(a,n,e,t)=>{let r=/^((?:\0\d+[cno]\x7F)*)([;:*#]+\s*)/u.exec(a);if(!r)return n.lastPrefix="",a;let[i,s,o]=r,l=o.replace(/;/gu,":"),g=fa(l,n.lastPrefix),p=(g>1?o.slice(g-1):o).split(/(?=;)/u),d=p[0].startsWith(";"),u=p.length-(d?0:1);if(g>1){let B=o.slice(0,g-1);d?p.unshift(B):p[0]=B+p[0]}n.lastPrefix=l;let h=s+p.map((B,ne)=>`\0${t.length+ne}d`).join("")+a.slice(i.length);for(let B of p)new In(B,e,t);if(!u)return h;let{html:[m,,x]}=e,f=/:+|-\{|\0\d+[xq]\x7F/gu,b=f,v=b.exec(h),C=0,w=!1,I=!1,F=0,z=(B,ne)=>(new fr(B,e,t),`${h.slice(0,ne)}\0${t.length-1}d${h.slice(ne+B.length)}`),V=B=>{B?C&&C--:C++};for(;v&&u;){let{0:B,index:ne}=v;if(B==="-{"){if(!F){let{lastIndex:K}=b;b=/-\{|\}-/gu,b.lastIndex=K}F++}else if(B==="}-"){if(F--,!F){let{lastIndex:K}=b;b=f,b.lastIndex=K}}else if(B.endsWith("x")){let{name:K,closing:J,selfClosing:ee}=t[Number(B.slice(1,-2))];(m.includes(K)||!ee&&!x.includes(K))&&V(J)}else if(B.endsWith("q")){let{bold:K,italic:J}=t[Number(B.slice(1,-2))];K&&(V(w),w=!w),J&&(V(I),I=!I)}else if(C===0){if(B.length>=u)return z(B.slice(0,u),ne);u-=B.length,b.lastIndex=ne+4+String(t.length).length,h=z(B,ne)}v=b.exec(h)}return h}});var Di,ka,Be,Ui,cd,Et,va=k(()=>{"use strict";M();se();Rr();O();De();Di=new Set(["A","T","R","D","-","H","N"]);ka=[it()];Et=class extends(cd=A){constructor(e,t,r=[]){super(void 0,t,r,{});T(this,Be);this.safeAppend(e.map(i=>new Q(i,"converter-flag",t,r)))}get type(){return"converter-flags"}afterBuild(){y(this,Be,this.childNodes.map(e=>e.text().trim())),super.afterBuild()}toString(e){return super.toString(e,";")}text(){return super.text(";")}getUnknownFlags(){return new Set(c(this,Be).filter(e=>/\{{3}[^{}]+\}{3}/u.test(e)))}getVariantFlags(){let e=new Set(this.getAttribute("config").variants);return new Set(c(this,Be).filter(t=>e.has(t)))}isInvalidFlag(e,t,r,i){return typeof e=="object"&&(e=e.text().trim(),t=this.getVariantFlags(),r=this.getUnknownFlags(),i=new Set(c(this,Be).filter(s=>Di.has(s)))),!!e&&!t.has(e)&&!r.has(e)&&(t.size>0||!i.has(e))}lint(e=this.getAbsoluteIndex(),t){let r=this.getVariantFlags(),i=this.getUnknownFlags(),s=new Set(c(this,Be).filter(d=>Di.has(d))),o=c(this,Be).filter(d=>!d).length,l=c(this,Be).length-i.size-o,g=super.lint(e,t);if(r.size===l||s.size===l)return g;let p=new L(this,e);for(let d=0;d<this.length;d++){let u=this.childNodes[d],h=u.text().trim();if(this.isInvalidFlag(h,r,i,s)){let m=N(u,p,"no-ignored","invalid conversion flag");r.size===0&&Di.has(h.toUpperCase())?m.fix={range:[m.startIndex,m.endIndex],text:h.toUpperCase(),desc:"uppercase"}:m.suggestions=[{desc:"remove",range:[m.startIndex-(d&&1),m.endIndex],text:""}],g.push(m)}}return g}print(){return super.print({sep:";"})}};Ui=R(cd),Be=new WeakMap,Et=j(Ui,0,"ConverterFlagsToken",ka,Et),P(Ui,1,Et)});var br,Aa=k(()=>{"use strict";W();O();De();br=class extends A{get type(){return"converter-rule"}get variant(){var n,e;return(e=(n=this.childNodes[this.length-2])==null?void 0:n.text().trim())!=null?e:""}constructor(n,e=!0,t=$.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 Q(o,"converter-rule-variant",t,r)),super.insertAt(new Q(n.slice(i+1),"converter-rule-to",t,r)),s!==-1&&super.insertAt(new Q(n.slice(0,s),"converter-rule-from",t,r),0)):super.insertAt(new Q(n,"converter-rule-to",t,r))}toString(n){let{childNodes:e,firstChild:t,lastChild:r}=this;return e.length===3?`${t.toString(n)}=>${e[1].toString(n)}:${r.toString(n)}`:super.toString(n,":")}text(){let{childNodes:n,firstChild:e,lastChild:t}=this;return n.length===3?`${e.text()}=>${n[1].text()}:${t.text()}`: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:":"})}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e);return t.variant=this.variant,t}}});var wa,Wi,hd,Lt,Sa=k(()=>{"use strict";ie();ze();O();va();Aa();wa=[ue("-{")];Lt=class extends(hd=A){get type(){return"converter"}constructor(n,e,t,r=[]){super(void 0,t,r),this.insertAt(new Et(n,t,r));let[i]=e,s=i.includes(":"),o=new br(i,s,t,r);s&&o.length===1||!s&&e.length===2&&!ae(e[1]).trim()?this.insertAt(new br(e.join(";"),!1,t,r)):this.append(o,...e.slice(1).map(l=>new br(l,!0,t,r)))}toString(n){let{childNodes:[e,...t]}=this;return`-{${e.toString(n)}${e.length>0?"|":""}${t.map(r=>r.toString(n)).join(";")}}-`}text(){let{childNodes:[n,...e]}=this;return`-{${n.text()}|${ke(e,";")}}-`}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?"|":""}${Me(e,{sep:";"})}}-</span>`}};Wi=R(hd),Lt=j(Wi,0,"ConverterToken",wa,Lt),P(Wi,1,Lt)});var Ca={};te(Ca,{parseConverter:()=>md});var md,$a=k(()=>{"use strict";Sa();md=(a,n,e)=>{var l;(l=n.regexConverter)!=null||(n.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${n.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"u"));let t=/-\{/gu,r=/-\{|\}-/gu,i=[],s=t,o=s.exec(a);for(;o;){let{0:g,index:p}=o;if(g==="}-"){let d=i.pop(),{length:u}=e,h=a.slice(d.index+2,p),m=h.indexOf("|"),[x,f]=m===-1?[[],h]:[h.slice(0,m).split(";"),h.slice(m+1)],b=f.replace(/(&[#a-z\d]+);/giu,"$1"),v=b.split(n.regexConverter).map(C=>C.replace(/\x01/gu,";"));new Lt(x,v,n,e),a=`${a.slice(0,d.index)}\0${u}v${a.slice(p+2)}`,i.length===0&&(s=t),s.lastIndex=d.index+3+String(u).length}else i.push(o),s=r,s.lastIndex=p+2;o=s.exec(a)}return a}});var En={};te(En,{Token:()=>A});var Qr,ye,H,Z,Ft,Tr,Kr,G,Na,Ia,Ea,La,Fa,Ra,Pa,ja,Ba,Oa,qa,_a,Hi,A,O=k(()=>{"use strict";ie();M();pe();W();ms();Ts();Hi=class Hi extends nn{constructor(e,t=$.getConfig(),r=[],i){super();T(this,G);T(this,Qr,"plain");T(this,ye,0);T(this,H);T(this,Z);T(this,Ft);T(this,Tr,!1);T(this,Kr);typeof e=="string"&&this.insertAt(e),y(this,H,t),y(this,Z,r),r.push(this)}get type(){return c(this,Qr)}set type(e){y(this,Qr,e)}parseOnce(e=c(this,ye),t=!1,r){if(e<c(this,ye)||this.length===0||!this.isPlain())return this;if(c(this,ye)>=11)return this;switch(e){case 0:if(this.type==="root"){c(this,Z).pop();let i=S(this,G,Na).call(this);t&&(t=!i)}y(this,Ft,t),S(this,G,Ia).call(this,t);break;case 1:S(this,G,Ea).call(this);break;case 2:S(this,G,La).call(this);break;case 3:S(this,G,Fa).call(this);break;case 4:S(this,G,Ra).call(this);break;case 5:S(this,G,Pa).call(this,r);break;case 6:S(this,G,ja).call(this,r);break;case 7:S(this,G,Ba).call(this);break;case 8:S(this,G,Oa).call(this);break;case 9:S(this,G,qa).call(this);break;case 10:S(this,G,_a).call(this)}if(this.type==="root")for(let i of c(this,Z))i==null||i.parseOnce(e,t,r);return tn(this,ye)._++,this}buildFromStr(e,t){let r=e.split(/[\0\x7F]/u).map((i,s)=>{if(s%2===0)return new Er(i);if(isNaN(i.slice(-1)))return c(this,Z)[Number(i.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${i}`)});return t===0?r.map(String).join(""):t===1?ke(r):r}build(){y(this,ye,11);let{length:e,firstChild:t}=this,r=t==null?void 0:t.toString();if(e===1&&t.type==="text"&&r.includes("\0")&&(Ir(this,0,1,this.buildFromStr(r)),this.normalize(),this.type==="root"))for(let i of c(this,Z))i==null||i.build()}afterBuild(){if(this.type==="root")for(let e of c(this,Z))e==null||e.afterBuild();y(this,Tr,!0)}parse(e=11,t,r){for(e=Math.min(e,11);c(this,ye)<e;)this.parseOnce(c(this,ye),t,r);return e&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===Hi}getAttribute(e){var t;switch(e){case"config":return c(this,H);case"include":return(t=c(this,Ft))!=null?t:!!c(this.getRootNode(),Ft);case"accum":return c(this,Z);case"built":return c(this,Tr);case"stage":return c(this,ye);case"invalid":return this.type==="table-inter"&&Dt(this)==="error";default:return super.getAttribute(e)}}setAttribute(e,t){switch(e){case"stage":c(this,ye)===0&&this.type==="root"&&c(this,Z).shift(),y(this,ye,t);break;default:super.setAttribute(e,t)}}insertAt(e,t=this.length){let r=typeof e=="string"?new Er(e):e;super.insertAt(r,t);let{type:i}=r;return i==="root"&&(r.type="plain"),r}normalizeTitle(e,t=0,r){return $.normalizeTitle(e,t,c(this,Ft),c(this,H),r)}inTableAttrs(){var e,t;return((e=this.closest("table-attrs,ext"))==null?void 0:e.type)==="table-attrs"&&(((t=this.closest("table-attrs,arg,magic-word,template"))==null?void 0:t.type)==="table-attrs"?"error":"warning")}inHtmlAttrs(){var e;return((e=this.closest("html-attrs,ext"))==null?void 0:e.type)==="html-attrs"?"error":this.inTableAttrs()}lint(e=this.getAbsoluteIndex(),t){var i;let r=super.lint(e,t);if(this.type==="root"){let s=new Map,o="category,html-attr#id,ext-attr#id,table-attr#id";for(let u of this.querySelectorAll(o)){let h;if(u.type==="category")h=u.name;else{let m=u.getValue();m&&m!==!0&&(h=`#${m}`)}if(h){let m=s.get(h);m?m.add(u):s.set(h,new Set([u]))}}for(let[u,h]of s)if(h.size>1&&!u.startsWith("#mw-customcollapsible-")){let m=!u.startsWith("#"),x=`duplicated ${m?"category":"id"}`,f=m?"error":"warning";r.push(...[...h].map(b=>{let v=E(b,{start:b.getAbsoluteIndex()},"no-duplicate",x,f);return m&&(v.suggestions=[{desc:"remove",range:[v.startIndex,v.endIndex],text:""}]),v}))}let l=/<!--\s*lint-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->/gu,g=this.toString(),p=[],d=l.exec(g);for(;d;){let{1:u,index:h}=d,m=(i=d[2])==null?void 0:i.trim();p.push({line:this.posFromIndex(h).top+(u==="disable-line"?0:1),from:u==="disable"?l.lastIndex:void 0,to:u==="enable"?l.lastIndex:void 0,rules:m?new Set(m.split(",").map(x=>x.trim())):void 0}),d=l.exec(g)}if(r=r.filter(({rule:u,startLine:h,startIndex:m})=>{let x={pos:0};for(let{line:f,from:b,to:v,rules:C}of p){if(f>h+1)break;if(C&&!C.has(u))continue;if(f===h&&b===void 0&&v===void 0)return!1;b<=m&&b>x.pos?(x.pos=b,x.type="from"):v<=m&&v>x.pos&&(x.pos=v,x.type="to")}return x.type!=="from"}),r.some(({fix:u})=>u)){let u=r.map(({fix:x})=>x).filter(Boolean).sort(({range:[x,f]},{range:[b,v]})=>f===v?b-x:v-f),h=1/0,m=g;for(let{range:[x,f],text:b}of u)f<=h&&(m=m.slice(0,x)+b+m.slice(f),h=x);Object.assign(r,{output:m})}}return r}toString(e,t){return e?super.toString(!0,t):Ce(c(this,Kr),()=>super.toString(!1,t),r=>{let i=this.getRootNode();i.type==="root"&&c(i,Tr)&&y(this,Kr,r)})}};Qr=new WeakMap,ye=new WeakMap,H=new WeakMap,Z=new WeakMap,Ft=new WeakMap,Tr=new WeakMap,Kr=new WeakMap,G=new WeakSet,Na=function(){let{parseRedirect:e}=(Cs(),U(Ss)),t=this.firstChild.toString(),r=e(t,c(this,H),c(this,Z));return r&&this.setText(r),!!r},Ia=function(e){let{parseCommentAndExt:t}=(Or(),U(Do));this.setText(t(this.firstChild.toString(),c(this,H),c(this,Z),e))},Ea=function(){let{parseBraces:e}=(bn(),U(ho)),t=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,r=e(t,c(this,H),c(this,Z));this.setText(this.type==="root"?r:r.slice(1))},La=function(){if(c(this,H).excludes.includes("html"))return;let{parseHtml:e}=(Go(),U(Ho));this.setText(e(this.firstChild.toString(),c(this,H),c(this,Z)))},Fa=function(){if(c(this,H).excludes.includes("table"))return;let{parseTable:e}=(Jo(),U(Ko));this.setText(e(this,c(this,H),c(this,Z)))},Ra=function(){if(c(this,H).excludes.includes("hr"))return;let{parseHrAndDoubleUnderscore:e}=(ra(),U(ta));this.setText(e(this,c(this,H),c(this,Z)))},Pa=function(e){let{parseLinks:t}=(da(),U(la));this.setText(t(this.firstChild.toString(),c(this,H),c(this,Z),e))},ja=function(e){if(c(this,H).excludes.includes("quote"))return;let{parseQuotes:t}=(_i(),U(ia)),r=this.firstChild.toString().split(`
|
|
25
|
+
`);for(let i=0;i<r.length;i++)r[i]=t(r[i],c(this,H),c(this,Z),e);this.setText(r.join(`
|
|
26
|
+
`))},Ba=function(){if(c(this,H).excludes.includes("extLink"))return;let{parseExternalLinks:e}=(zi(),U(sa));this.setText(e(this.firstChild.toString(),c(this,H),c(this,Z)))},Oa=function(){if(c(this,H).excludes.includes("magicLink"))return;let{parseMagicLinks:e}=(ma(),U(ha));this.setText(e(this.firstChild.toString(),c(this,H),c(this,Z)))},qa=function(){if(c(this,H).excludes.includes("list"))return;let{parseList:e}=(ya(),U(Ta)),{firstChild:t,type:r,name:i}=this,s=t.toString().split(`
|
|
27
|
+
`),o={lastPrefix:""},l=r==="root"||r==="ext-inner"&&i==="poem"?0:1;for(;l<s.length;l++)s[l]=e(s[l],o,c(this,H),c(this,Z));this.setText(s.join(`
|
|
28
|
+
`))},_a=function(){if(c(this,H).variants.length>0){let{parseConverter:e}=($a(),U(Ca));this.setText(e(this.firstChild.toString(),c(this,H),c(this,Z)))}};A=Hi});var le,ir,Ir,Fe,pe=k(()=>{"use strict";le={running:!1,run(a){let{running:n}=this;this.running=!0;try{let{Token:e}=(O(),U(En)),t=a();return t instanceof e&&!t.getAttribute("built")&&t.afterBuild(),this.running=n,t}catch(e){throw this.running=n,e}},rev:0},ir=a=>n=>n.type===a,Ir=(a,n,e,t=[])=>{var s,o;let r=a.getChildNodes(),i;r.length===e?(i=r,r=t):i=r.splice(n,e,...t);for(let l=0;l<t.length;l++){let g=t[l];g.setAttribute("parentNode",a),g.setAttribute("nextSibling",r[n+l+1]),g.setAttribute("previousSibling",r[n+l-1])}return(s=r[n-1])==null||s.setAttribute("nextSibling",r[n]),(o=r[n+t.length])==null||o.setAttribute("previousSibling",r[n+t.length-1]),r===t&&a.setAttribute("childNodes",r),i},Fe=(a,n)=>{Object.defineProperty(a,"name",{value:n.name})}});var Ma={};te(Ma,{Title:()=>Gi});var Jr,Yr,Rt,yr,Pt,Gi,za=k(()=>{"use strict";ie();Gi=class{constructor(n,e,t,{temporary:r,decode:i,selfLink:s}={}){T(this,Jr);T(this,Yr);T(this,Rt);T(this,yr);T(this,Pt);ge(this,"valid");ge(this,"encoded",!1);let o=n.trim().startsWith("../");if(i&&n.includes("%"))try{let g=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(n);n=et(n),this.encoded=g}catch(g){}if(n=mt(n).replace(/[_ ]+/gu," ").trim(),o)y(this,yr,0);else{let g=e;n.startsWith(":")&&(g=0,n=n.slice(1).trim());let p=n.split(":");if(p.length>1){let d=_e(p[0]),u=Object.prototype.hasOwnProperty.call(t.nsid,d)&&t.nsid[d];u&&(g=u,n=p.slice(1).join(":").trim())}y(this,yr,g)}let l=n.indexOf("#");if(l!==-1){let g=n.slice(l).trim().slice(1);if(g.includes("%"))try{g=et(g)}catch(p){}y(this,Pt,g.replace(/ /gu,"_")),n=n.slice(0,l).trim()}this.valid=!!(n||s&&this.ns===0&&c(this,Pt)!==void 0)&&mt(n)===n&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(o?/^(?:\.\.\/)+(.*)/u.exec(n)[1]:n),this.main=n,y(this,Yr,t.namespaces),y(this,Rt,t.articlePath||"/wiki/$1"),c(this,Rt).includes("$1")||y(this,Rt,c(this,Rt)+`${c(this,Rt).endsWith("/")?"":"/"}$1`),r||Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}})}get ns(){return c(this,yr)}get fragment(){return c(this,Pt)}get main(){return c(this,Jr)}set main(n){n=n.replace(/_/gu," ").trim(),y(this,Jr,n&&n[0].toUpperCase()+n.slice(1))}get prefix(){let n=c(this,Yr)[this.ns];return n+(n&&":")}get title(){return this.getRedirection()[1]}get extension(){let{main:n}=this,e=n.lastIndexOf(".");return e===-1?void 0:n.slice(e+1).toLowerCase()}getRedirection(){return[!1,(this.prefix+this.main).replace(/ /gu,"_")]}setFragment(n){y(this,Pt,n)}getUrl(n){}};Jr=new WeakMap,Yr=new WeakMap,Rt=new WeakMap,yr=new WeakMap,Pt=new WeakMap});var Vi,jt,Da,fd,$,W=k(()=>{os();pe();ps();ie();Vi=!0,jt={config:Pn,i18n:void 0,rules:ss,get viewOnly(){return Vi},set viewOnly(a){Vi&&!a&&le.rev++,Vi=a},getConfig(a){let n=a!=null?a:this.config,{doubleUnderscore:e,ext:t,parserFunction:r,variable:i}=n;for(let s=0;s<2;s++)e.length>s+2&&e[s].length===0&&(e[s]=Object.keys(e[s+2]));return t.includes("translate")&&!i.includes("translationlanguage")&&(i.push("translationlanguage"),Array.isArray(r[1])?r[1].push("TRANSLATIONLANGUAGE"):r[1].TRANSLATIONLANGUAGE="translationlanguage"),oe(X(X({},Pn),n),{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=jt.getConfig(),r){let{Title:i}=(za(),U(Ma)),s;if(r!=null&&r.halfParsed)s=new i(a,n,t,r);else{let{Token:o}=(O(),U(En));s=le.run(()=>{let l=new o(a,t);l.type="root",l.parseOnce(0,e).parseOnce();let g=new i(l.toString(),n,t,r);for(let p of["main","fragment"]){let d=g[p];if(d!=null&&d.includes("\0")){let u=l.buildFromStr(d,1);p==="main"?g.main=u:g.setFragment(u)}}return g})}return s},parse(a,n,e=11,t=jt.getConfig()){a=ls(a);let r;typeof e!="number"&&(r=Array.isArray(e)?e:[e],e=Math.max(...r.map(o=>is[o]||11)));let{Token:i}=(O(),U(En));return le.run(()=>{let o=new i(a,t);return o.type="root",o.parse(e,n)})},async partialParse(a,n,e,t=jt.getConfig()){},createLanguageService(a){}},Da={},fd=new Set(["normalizeTitle","parse","createLanguageService"]);for(let a in jt)fd.has(a)||(Da[a]={enumerable:!1});Object.defineProperties(jt,Da);Object.assign(typeof globalThis=="object"?globalThis:self,{Parser:jt});$=jt});W();})();
|