wikiparser-node 1.27.0 → 1.28.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/bundle/bundle-es8.min.js +25 -25
- package/bundle/bundle-lsp.min.js +29 -29
- package/bundle/bundle.min.js +24 -25
- package/config/default.json +15 -16
- package/config/jawiki.json +15 -16
- package/dist/addon/token.js +1 -1
- package/dist/base.d.mts +2 -2
- package/dist/base.d.ts +2 -2
- package/dist/base.js +1 -0
- package/dist/base.mjs +1 -0
- package/dist/bin/config.js +11 -11
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -3
- package/dist/internal.d.ts +5 -5
- package/dist/lib/lintConfig.js +7 -5
- package/dist/lib/lsp.d.ts +1 -1
- package/dist/lib/lsp.js +5 -2
- package/dist/lib/node.js +51 -40
- package/dist/mixin/attributesParent.js +59 -57
- package/dist/mixin/elementLike.js +77 -75
- package/dist/mixin/hidden.js +3 -3
- package/dist/mixin/nodeLike.js +2 -2
- package/dist/mixin/padded.js +9 -7
- package/dist/mixin/singleLine.d.ts +1 -1
- package/dist/mixin/singleLine.js +10 -11
- package/dist/parser/commentAndExt.js +5 -2
- package/dist/parser/hrAndDoubleUnderscore.js +9 -8
- package/dist/parser/html.js +1 -1
- package/dist/parser/selector.js +2 -1
- package/dist/src/arg.js +4 -5
- package/dist/src/atom.d.ts +1 -1
- package/dist/src/atom.js +0 -1
- package/dist/src/attribute.d.ts +5 -7
- package/dist/src/attribute.js +18 -8
- package/dist/src/attributes.d.ts +7 -8
- package/dist/src/attributes.js +5 -3
- package/dist/src/commented.d.ts +3 -3
- package/dist/src/converterRule.js +1 -1
- package/dist/src/heading.js +1 -1
- package/dist/src/imageParameter.d.ts +0 -8
- package/dist/src/imageParameter.js +56 -25
- package/dist/src/imagemapLink.js +1 -1
- package/dist/src/index.d.ts +0 -5
- package/dist/src/index.js +2 -5
- package/dist/src/link/base.js +1 -2
- package/dist/src/link/category.js +1 -2
- package/dist/src/link/file.js +9 -11
- package/dist/src/link/galleryImage.d.ts +0 -3
- package/dist/src/link/galleryImage.js +3 -2
- package/dist/src/link/index.js +1 -1
- package/dist/src/magicLink.d.ts +0 -7
- package/dist/src/magicLink.js +12 -1
- package/dist/src/multiLine/gallery.d.ts +49 -0
- package/dist/src/{gallery.js → multiLine/gallery.js} +24 -37
- package/dist/src/multiLine/imagemap.d.ts +25 -0
- package/dist/src/{imagemap.js → multiLine/imagemap.js} +20 -36
- package/dist/src/multiLine/index.d.ts +17 -0
- package/dist/src/multiLine/index.js +36 -0
- package/dist/src/{paramTag → multiLine}/inputbox.d.ts +1 -1
- package/dist/src/{paramTag → multiLine}/inputbox.js +2 -2
- package/dist/src/multiLine/paramTag.d.ts +20 -0
- package/dist/src/{paramTag/index.js → multiLine/paramTag.js} +10 -24
- package/dist/src/nowiki/base.d.ts +1 -1
- package/dist/src/nowiki/comment.js +2 -0
- package/dist/src/nowiki/commentLine.d.ts +11 -0
- package/dist/src/nowiki/commentLine.js +67 -0
- package/dist/src/nowiki/doubleUnderscore.d.ts +2 -1
- package/dist/src/nowiki/doubleUnderscore.js +10 -4
- package/dist/src/nowiki/listBase.js +1 -2
- package/dist/src/nowiki/noinclude.d.ts +6 -0
- package/dist/src/nowiki/noinclude.js +19 -4
- package/dist/src/nowiki/quote.js +2 -2
- package/dist/src/paramLine.d.ts +17 -0
- package/dist/src/paramLine.js +83 -0
- package/dist/src/parameter.d.ts +0 -1
- package/dist/src/parameter.js +2 -1
- package/dist/src/pre.d.ts +6 -8
- package/dist/src/pre.js +3 -2
- package/dist/src/syntax.d.ts +1 -1
- package/dist/src/table/base.d.ts +6 -1
- package/dist/src/table/base.js +96 -46
- package/dist/src/table/index.js +70 -66
- package/dist/src/table/td.d.ts +2 -2
- package/dist/src/table/td.js +8 -7
- package/dist/src/table/tr.d.ts +2 -2
- package/dist/src/table/trBase.d.ts +0 -5
- package/dist/src/table/trBase.js +4 -5
- package/dist/src/{html.d.ts → tag/html.d.ts} +6 -22
- package/dist/src/{html.js → tag/html.js} +43 -131
- package/dist/src/tag/index.d.ts +44 -0
- package/dist/src/tag/index.js +214 -0
- package/dist/src/tag/tvar.d.ts +38 -0
- package/dist/src/tag/tvar.js +169 -0
- package/dist/src/tagPair/ext.js +14 -7
- package/dist/src/tagPair/include.js +1 -1
- package/dist/src/tagPair/index.d.ts +1 -1
- package/dist/src/tagPair/index.js +1 -0
- package/dist/src/tagPair/translate.js +10 -10
- package/dist/src/transclude.d.ts +8 -9
- package/dist/src/transclude.js +8 -5
- package/dist/util/constants.js +1 -1
- package/extensions/dist/base.js +1 -1
- package/extensions/ui.css +1 -1
- package/i18n/en.json +2 -0
- package/i18n/zh-hans.json +2 -0
- package/i18n/zh-hant.json +2 -0
- package/package.json +5 -5
- package/dist/mixin/multiLine.d.ts +0 -4
- package/dist/mixin/multiLine.js +0 -33
- package/dist/src/gallery.d.ts +0 -66
- package/dist/src/imagemap.d.ts +0 -49
- package/dist/src/paramTag/index.d.ts +0 -28
package/bundle/bundle-es8.min.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
"use strict";(()=>{var Aa=Object.defineProperty,_a=Object.defineProperties;var $a=Object.getOwnPropertyDescriptors;var Jt=Object.getOwnPropertySymbols;var Fn=Object.prototype.hasOwnProperty,jn=Object.prototype.propertyIsEnumerable;var Pn=e=>{throw TypeError(e)};var js=(e,t,s)=>t in e?Aa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,me=(e,t)=>{for(var s in t||(t={}))Fn.call(t,s)&&js(e,s,t[s]);if(Jt)for(var s of Jt(t))jn.call(t,s)&&js(e,s,t[s]);return e},Le=(e,t)=>_a(e,$a(t));var Rn=(e,t)=>{var s={};for(var i in e)Fn.call(e,i)&&t.indexOf(i)<0&&(s[i]=e[i]);if(e!=null&&Jt)for(var i of Jt(e))t.indexOf(i)<0&&jn.call(e,i)&&(s[i]=e[i]);return s};var Ta=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ee=(e,t,s)=>js(e,typeof t!="symbol"?t+"":t,s),Ps=(e,t,s)=>t.has(e)||Pn("Cannot "+s);var f=(e,t,s)=>(Ps(e,t,"read from private field"),s?s.call(e):t.get(e)),N=(e,t,s)=>t.has(e)?Pn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),L=(e,t,s,i)=>(Ps(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),R=(e,t,s)=>(Ps(e,t,"access private method"),s);var On=(e,t,s,i)=>({set _(n){L(e,t,n,s)},get _(){return f(e,t,i)}});var Nu=Ta((Eu,ka)=>{var Ca=Object.create,xt=Object.defineProperty,Ll=Object.getOwnPropertyDescriptor,sn=Object.getOwnPropertyNames,Ia=Object.prototype.hasOwnProperty,El=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),vt=e=>{throw TypeError(e)},Fl=(e,t,s)=>t in e?xt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Bn=(e,t)=>xt(e,"name",{value:t,configurable:!0}),C=(e,t)=>function(){return e&&(t=(0,e[sn(e)[0]])(e=0)),t},jl=(e,t)=>function(){return t||(0,e[sn(e)[0]])((t={exports:{}}).exports,t),t.exports},se=(e,t)=>{for(var s in t)xt(e,s,{get:t[s],enumerable:!0})},Na=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of sn(t))!Ia.call(e,n)&&n!==s&&xt(e,n,{get:()=>t[n],enumerable:!(i=Ll(t,n))||i.enumerable});return e},Q=e=>Na(xt({},"__esModule",{value:!0}),e),K=e=>{var t;return[,,,Ca((t=e==null?void 0:e[El("metadata")])!=null?t:null)]},Pl=["class","method","getter","setter","accessor","field","value","get","set"],It=e=>e!==void 0&&typeof e!="function"?vt("Function expected"):e,La=(e,t,s,i,n)=>({kind:Pl[e],name:t,metadata:i,addInitializer:r=>s._?vt("Already initialized"):n.push(It(r||null))}),nn=(e,t)=>Fl(t,El("metadata"),e[3]),J=(e,t,s,i)=>{for(var n=0,r=e[t>>1],l=r&&r.length;n<l;n++)t&1?r[n].call(s):i=r[n].call(s,i);return i},X=(e,t,s,i,n,r)=>{var l,o,u,d,a,h=t&7,g=!!(t&8),c=!!(t&16),p=h>3?e.length+1:h?g?1:2:0,b=Pl[h+5],w=h>3&&(e[p-1]=[]),k=e[p]||(e[p]=[]),_=h&&(!c&&!g&&(n=n.prototype),h<5&&(h>3||!c)&&Ll(h<4?n:{get[s](){return he(this,r)},set[s](m){return ye(this,r,m)}},s));h?c&&h<4&&Bn(r,(h>2?"set ":h>1?"get ":"")+s):Bn(n,s);for(var v=i.length-1;v>=0;v--)d=La(h,s,u={},e[3],k),h&&(d.static=g,d.private=c,a=d.access={has:c?m=>Fa(n,m):m=>s in m},h^3&&(a.get=c?m=>(h^1?he:Ui)(m,n,h^4?r:_.get):m=>m[s]),h>2&&(a.set=c?(m,S)=>ye(m,n,S,h^4?r:_.set):(m,S)=>m[s]=S)),o=(0,i[v])(h?h<4?c?r:_[b]:h>4?void 0:{get:_.get,set:_.set}:n,d),u._=1,h^4||o===void 0?It(o)&&(h>4?w.unshift(o):h?c?r=o:_[b]=o:n=o):typeof o!="object"||o===null?vt("Object expected"):(It(l=o.get)&&(_.get=l),It(l=o.set)&&(_.set=l),It(l=o.init)&&w.unshift(l));return h||nn(e,n),_&&xt(n,s,_),c?h^4?r:_:n},Ea=(e,t,s)=>Fl(e,typeof t!="symbol"?t+"":t,s),rn=(e,t,s)=>t.has(e)||vt("Cannot "+s),Fa=(e,t)=>Object(t)!==t?vt('Cannot use the "in" operator on this value'):e.has(t),he=(e,t,s)=>(rn(e,t,"read from private field"),s?s.call(e):t.get(e)),Re=(e,t,s)=>t.has(e)?vt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),ye=(e,t,s,i)=>(rn(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),Ui=(e,t,s)=>(rn(e,t,"access private method"),s),ja=(e,t,s,i)=>({set _(n){ye(e,t,n,s)},get _(){return he(e,t,i)}}),Rl,fs,Ol=C({"base.ts"(){"use strict";Rl=(()=>{const e={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(e,null),e})(),fs=(()=>{const e=["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(e),e})()}});function Se(e,t,s){return s===1?e.replace(/\0(\d+)g\x7F/gu,(i,n)=>Se(String(t[n]),t,2)):s===2?e.replace(/\0(\d+)n\x7F/gu,(i,n)=>String(t[n])):e.replace(/\0(\d+)\x7F/gu,(i,n)=>t[n])}var Be,Rs,ct,gt,pt,st,Bl,be,Ke,qn,Wn,ms,ql,Mn,zn,Ut,ft,ge=C({"util/string.ts"(){"use strict";Be=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,Rs=String.raw`[^[\]<>"\0-\x1F\x7F${Be}\uFFFD]`,ct=String.raw`(?:\[[\da-f:.]+\]|${Rs})`,gt=String.raw`(?:${Rs}|\0\d+[cn!~]\x7F)*`,pt=e=>e.trim().toLowerCase(),st=(e,t)=>s=>s.replace(e,t),Bl=st(/[\0\x7F]|\r$/gmu,""),be=st(/\0\d+[cn]\x7F/gu,""),Ke=(e,t="")=>e.map(s=>typeof s=="string"?s:s.text()).join(t),qn={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},Wn=st(/&(?:#(\d+|[Xx][\da-fA-F]+)|([lg]t|[LG]T|[lr]brac[ke]|nbsp|amp|AMP|quot|QUOT));/gu,(e,t,s)=>t?String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t)):qn[s.toLowerCase()]),ms=e=>Wn(e),ql=st(/&#(\d+|x[\da-f]+);/giu,(e,t)=>String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t))),Mn={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},zn=e=>st(e,t=>`&${Mn[t]};`),Ut=zn(/[&<>]/gu),ft=(e,t={})=>{const{pre:s="",post:i="",sep:n=""}=t;return s+e.map(r=>r.print()).join(n)+i}}}),Pa=jl({"i18n/en.json"(e,t){t.exports={"attributes-of-closing-tag":"attributes of a closing tag","bold-apostrophes":"bold apostrophes","bold-in-header":"bold text in a section header",close:null,"closing-and-self-closing":"tag that is both closing and self-closing",comment:null,"conflicting-image-parameter":"conflicting image $1 parameter","content-outside-table":"content to be moved outside the table",decode:null,delink:null,"duplicate-attribute":"duplicate $1 attribute","duplicate-category":"duplicate category","duplicate-id":"duplicate HTML id","duplicate-image-parameter":"duplicate image $1 parameter","duplicate-parameter":"duplicate template parameter",encode:null,escape:null,expand:null,"ext-in-html":"extension tag in HTML tag attributes",frame:null,"full-width-punctuation":"full-width punctuation","header-in-html":"section header in HTML tag attributes","horizontal-alignment":null,"html-in-table":"HTML tag in table attributes","illegal-attribute-name":"invalid attribute name","illegal-attribute-value":"invalid attribute value","illegal-module":"invalid Scribunto module name","imagemap-without-image":"<imagemap> without an image","in-url":"$1 in URL","inconsistent-table":"inconsistent table layout","insecure-style":"insecure style","invalid-attribute":"element containing an invalid attribute name","invalid-content":"invalid content in <$1>","invalid-conversion-flag":"invalid conversion flag","invalid-gallery":"invalid gallery image","invalid-image-parameter":"invalid image parameter","invalid-imagemap-link":"invalid link in <imagemap>","invalid-isbn":"invalid ISBN","invalid-parameter":"invalid parameter of <$1>","invalid-self-closing":"invalid self-closing tag","invisible-triple-braces":"invisible content inside triple braces","italic-apostrophes":"italic apostrophes","left-bracket":"opening bracket","link-in-extlink":"internal link in an external link",lonely:'lonely "$1"',"missing-extension":"missing file extension","missing-function":"missing Scribunto module function name",newline:null,"no-self-closing":"no self-closing","nonzero-tabindex":"nonzero tabindex","nothing-in":"nothing should be in <$1>","obsolete-attribute":"obsolete attribute","obsolete-tag":"obsolete HTML tag",open:null,prefix:null,"pipe-in-link":'additional "|" in the link text',"pipe-in-table":'additional "|" in a table cell',remove:null,"template-in-link":"template in an internal link target","unbalanced-in-section-header":"unbalanced $1 in a section header",unclosed:"unclosed $1","unclosed-comment":"unclosed HTML comment","unclosed-quotes":"unclosed quotes","unclosed-table":"unclosed table","unclosed-tag":"unclosed tag","unescaped-query":"unescaped query string in an anonymous parameter","unexpected-argument":"unexpected template argument","unmatched-closing":"unmatched closing tag","unnecessary-encoding":"unnecessary percent-encoding in an internal link",uppercase:null,"useless-attribute":"useless attribute","useless-fragment":"useless fragment","useless-link-text":"useless link text","variable-anchor":"variable anchor in a section header","vertical-alignment":null,whitespace:null}}}),Ra=jl({"config/minimum.json"(e,t){t.exports={ext:[],html:[["b","bdi","del","i","ins","u","font","big","small","sub","sup","h1","h2","h3","h4","h5","h6","cite","code","em","s","strike","strong","tt","var","div","center","blockquote","ol","ul","dl","table","caption","pre","ruby","rb","rp","rt","rtc","p","span","abbr","dfn","kbd","samp","data","time","mark","tr","td","th","q","bdo"],["li","dt","dd"],["br","wbr","hr","meta","link"]],namespaces:{0:"",6:"File",10:"Template",14:"Category",828:"Module"},nsid:{"":0,file:6,template:10,category:14,module:828},functionHook:["msgnw"],variable:["!","=","pageid","articlepath","server","servername","scriptpath","stylepath"],parserFunction:[{msgnw:"msgnw",pageid:"pageid",articlepath:"articlepath",server:"server",servername:"servername",scriptpath:"scriptpath",stylepath:"stylepath","#language":"language","#special":"special","#speciale":"speciale","#tag":"tag","#formatdate":"formatdate","#dateformat":"formatdate","#invoke":"invoke","#while":"while","#dowhile":"dowhile","#loop":"loop","#forargs":"forargs","#fornumargs":"fornumargs","#if":"if","#ifeq":"ifeq","#switch":"switch","#ifexist":"ifexist","#ifexpr":"ifexpr","#iferror":"iferror","#time":"time","#timel":"timel","#expr":"expr","#rel2abs":"rel2abs","#titleparts":"titleparts","#categorytree":"categorytree","#urldecode":"urldecode","#choose":"choose","#var":"var","#varexists":"varexists","#var_final":"var_final","#vardefine":"vardefine","#vardefineecho":"vardefineecho","#widget":"widget","#related":"related","#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","#avatar":"avatar","#img":"img","#chart":"chart"},{"!":"!","=":"=","#FORMAL":"formal","#bcp47":"bcp47","#dir":"dir","#interwikilink":"interwikilink","#interlanguagelink":"interlanguagelink","#contentmodel":"contentmodel","#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:|wikipedia://|worldwind://|xmpp:",interwiki:[],img:{},redirection:["#redirect"],variants:[]}}}),we,Wl,Hi,We=C({"util/constants.ts"(){"use strict";we=11,Wl=Pa(),Hi=Ra()}});function ht(e){const t=new Map,s=new WeakMap;return i=>{const n=typeof i=="string"?t:s;if(n.has(i)){const l=n.get(i);return l.lastIndex=0,l}const r=e(i);return n.set(i,r),r}}var Ht,Ml,Ye=C({"../common/dist/index.mjs"(){"use strict";Ht=e=>decodeURIComponent(e.replace(/%(?![\da-f]{2})/giu,"%25")),Ml=ht}}),le,de=C({"lib/rect.ts"(){"use strict";var e,t,s,i,Di,r;le=(r=class{constructor(l,o){N(this,i);N(this,e);N(this,t);N(this,s);L(this,e,l),L(this,t,o)}get start(){return f(this,t)}get top(){return R(this,i,Di).call(this).top}get left(){return R(this,i,Di).call(this).left}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakSet,Di=function(){var l;return(l=f(this,s))!=null||L(this,s,f(this,e).getRootNode().posFromIndex(f(this,t))),f(this,s)},r)}}),Un,Hn,zt,Gi,Os,B,G,$e,bs,U,ln,qe,on,an,un,Dt,mt,dn,Xe,zl,M=C({"util/lint.ts"(){"use strict";Ye(),Ne(),de(),W(),Un=new Set(["tr","td","th","caption"]),Hn=new Set(["Template:!!","Template:!-"]),zt=e=>{const t=e.childNodes.find(s=>s.text().trim());if(!t||t.type==="text"&&t.data.trim().startsWith("!")||t.is("magic-word")&&t.name==="!"||t.is("template")&&Hn.has(t.name)||t.is("html")&&Un.has(t.name))return!1;if(t.is("arg"))return t.length>1&&zt(t.childNodes[1]);if(t.is("magic-word"))try{const s=t.getPossibleValues().map(zt);return s.includes(2)?2:s.includes(1)&&1}catch(s){}return t.is("template")||t.is("magic-word")&&t.name==="invoke"?1:2},Gi=(e,t,s,i)=>({line:e+s-1,character:(s===1?t:0)+i}),Os=e=>(t,s,i,n,r="error")=>{const{start:l}=s,{top:o,left:u}=s instanceof le?s:new le(t,l),{offsetHeight:d,offsetWidth:a}=t,{startIndex:h,startLine:g,startCol:c}=e(t,l,o,u),{line:p,character:b}=Gi(g,c,d,a);return{rule:i,message:I.msg(n),severity:r,startIndex:h,endIndex:h+t.toString().length,startLine:g,endLine:p,startCol:c,endCol:b}},B=Os((e,t,s,i)=>{const n=e.getRelativeIndex(),{top:r,left:l}=e.parentNode.posFromIndex(n);return{startIndex:t+n,startLine:s+r,startCol:r?l:i+l}}),G=Os((e,t,s,i)=>({startIndex:t,startLine:s,startCol:i})),$e=(e,t,s,i=0)=>({desc:I.msg(t),range:[e.startIndex+i,e.endIndex],text:s}),bs=(e,t,s)=>({desc:I.msg(t),range:[e,e],text:s}),U=(e,t=0,s="")=>typeof e=="number"?{desc:I.msg("remove"),range:[e,e+t],text:s}:$e(e,"remove",s,t),ln=(e,t)=>$e(e,"decode",Ht(t.text().replace(/%(?=21|3[ce]|5[bd]|7[b-d])/giu,"%25"))),qe=(e,t,s=0)=>({desc:I.msg("close"),range:[e+s,e],text:t}),on=e=>({desc:I.msg("open"),range:[e+1,e+2],text:""}),an=(e,t)=>$e(e,"comment",`<!--${t}-->`),un=(e,t)=>$e(e,"uppercase",t.toUpperCase()),Dt=(e,t=0)=>({desc:I.msg("whitespace"),range:[e,e+t],text:" "}),mt=(e,t,s=1)=>({desc:I.msg("escape"),range:[e,e+s],text:t.repeat(s)}),dn=(e,t)=>({desc:I.msg("escape"),range:[e,e+t.length],text:t.replace(/\|/gu,"|")}),Xe=(e,t,s,i)=>{if(e&&(i||I.viewOnly&&e[0]===ke.rev))return e[1];const n=t();return(i||I.viewOnly)&&s([ke.rev,n]),n},zl=(e,t)=>e==="ol"&&t==="type"?["1","a","A","i","I"]:e==="th"&&t==="scope"?["row","col","rowgroup","colgroup"]:t==="dir"?["ltr","rtl","auto"]:t==="aria-hidden"?["true","false"]:[]}}),Dn,hn,Ul=C({"parser/selector.ts"(){"use strict";Dn=(e,t,s)=>{if(e.includes("#")){const i=e.indexOf("#");return(i===0||e.slice(0,i)===t)&&e.slice(i+1)===s}return!e||e===t},hn=(e,t,s)=>{const i=e.split(",");return({type:n,name:r})=>i.some(l=>Dn(l.trim(),n,r))}}}),ws,cn=C({"mixin/cached.ts"(){"use strict";M(),ws=(e=!0)=>t=>{const s=new WeakMap;return function(...i){return Xe(s.get(this),()=>t.apply(this,i),n=>{s.set(this,n)},e)}}}}),Hl,Oa=C({"mixin/nodeLike.ts"(){"use strict";Hl=e=>{class t extends e{get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get offsetHeight(){return this.getDimension().height}get offsetWidth(){return this.getDimension().width}}return t}}}),Gn,Vn,Xt,yt,St,Kt,kt,At,_t,Qe,Dl=C({"lib/node.ts"(){"use strict";M(),Ne(),cn(),Oa(),W(),Vn=[Hl],Gn=[ws(!1)],Qe=class{constructor(){J(_t,5,this),Ea(this,"childNodes",[]),Re(this,Xt),Re(this,yt),Re(this,St),Re(this,Kt),Re(this,kt),Re(this,At,{})}get parentNode(){return he(this,Xt)}get nextSibling(){return he(this,yt)}get previousSibling(){return he(this,St)}getChildNodes(){const{childNodes:e}=this;return Object.isFrozen(e)?[...e]:e}getAttribute(e){return e==="padding"?0:this[e]}setAttribute(e,t){switch(e){case"parentNode":ye(this,Xt,t),t||(ye(this,yt,void 0),ye(this,St,void 0));break;case"nextSibling":ye(this,yt,t);break;case"previousSibling":ye(this,St,t);break;case"aIndex":I.viewOnly&&ye(this,kt,[ke.rev,t]);break;default:this[e]=t}}getRootNode(){return Xe(he(this,Kt),()=>{var e,t;return(t=(e=this.parentNode)==null?void 0:e.getRootNode())!=null?t:this},e=>{const[,t]=e;t.type==="root"&&ye(this,Kt,e)})}indexFromPos(e,t){this.lspError("AstNode.indexFromPos")}posFromIndex(e){const{length:t}=String(this);if(e+=e<0?t:0,e>=0&&e<=t){const s=this.getLines(),i=s.findIndex(([,,n])=>e<=n);return{top:i,left:e-s[i][1]}}}getDimension(){const e=this.getLines(),t=e[e.length-1];return{height:e.length,width:t[2]-t[1]}}getGaps(e){return 0}getRelativeIndex(e){if(e===void 0){const{parentNode:t}=this;return t?t.getRelativeIndex(t.childNodes.indexOf(this)):0}return Xe(he(this,At)[e],()=>{const{childNodes:t}=this,s=e+(e<0?t.length:0);let i=this.getAttribute("padding");for(let n=0;n<s;n++)I.viewOnly&&(he(this,At)[n]=[ke.rev,i]),i+=t[n].toString().length+this.getGaps(n);return i},t=>{he(this,At)[e]=t})}getAbsoluteIndex(){return Xe(he(this,kt),()=>{const{parentNode:e}=this;return e?e.getAbsoluteIndex()+this.getRelativeIndex():0},e=>{ye(this,kt,e)})}getBoundingClientRect(){this.lspError("AstNode.getBoundingClientRect")}is(e){return this.type===e}getLines(){const e=[];let t=0;for(const s of String(this).split(`
|
|
2
|
-
`)){const i=t+s.length;e.push([s,t,i]),t=i+1}return e}seal(e,t){const s=!t&&!!this[e];Object.defineProperty(this,e,{enumerable:s,configurable:!0})}lspError(e){throw new Error(`${e} method is only available in the LSP version!`)}},_t=K(null),Xt=new WeakMap,yt=new WeakMap,St=new WeakMap,Kt=new WeakMap,kt=new WeakMap,At=new WeakMap,X(_t,1,"getLines",Gn,Qe),Qe=X(_t,0,"AstNode",Vn,Qe),J(_t,1,Qe)}}),Gl,Ba=C({"mixin/elementLike.ts"(){"use strict";Ul(),Gl=e=>{var s,Vi;class t extends e{constructor(){super(...arguments);N(this,s)}getElementBy(l){for(const o of this.childNodes){if(o.type==="text")continue;if(l(o))return o;const u=o.getElementBy(l);if(u)return u}}querySelector(l){return this.getElementBy(R(this,s,Vi).call(this,l))}getElementsBy(l,o=[]){for(const u of this.childNodes)u.type!=="text"&&(l(u)&&o.push(u),u.getElementsBy(l,o));return o}querySelectorAll(l){return this.getElementsBy(R(this,s,Vi).call(this,l))}escape(){}}return s=new WeakSet,Vi=function(l){return hn(l,this)},t}}}),Qn,Bs,Jn,Nt,qa=C({"lib/element.ts"(){"use strict";ge(),Ne(),Ul(),Dl(),Ba(),Qn=[Gl],Nt=class extends(Jn=Qe){get length(){return this.childNodes.length}text(e){return Ke(this.childNodes,e)}normalize(){const e=this.getChildNodes(),t=s=>{var i,n;e.splice(s,1),(i=e[s-1])==null||i.setAttribute("nextSibling",e[s]),(n=e[s])==null||n.setAttribute("previousSibling",e[s-1])};for(let s=e.length-1;s>=0;s--){const{type:i,data:n}=e[s];i!=="text"||e.length===1||this.getGaps(s-(s&&1))||n===""&&t(s)}this.setAttribute("childNodes",e)}removeAt(e){this.lspError("AstElement.removeAt")}insertAt(e,t=this.length){return Tn(this,t,0,[e]),e}closest(e){const t=hn(e,this);let{parentNode:s}=this;for(;s;){if(t(s))return s;({parentNode:s}=s)}}append(...e){this.safeAppend(e)}safeAppend(e){for(const t of e)this.insertAt(t)}safeReplaceChildren(e){}setText(e,t=0){t+=t<0?this.length:0;const s=this.childNodes[t],{data:i}=s;return s.replaceData(e),i}toString(e,t=""){return this.childNodes.map(s=>s.toString(e)).join(t)}caretPositionFromIndex(e){this.lspError("AstElement.caretPositionFromIndex")}elementFromIndex(e){this.lspError("AstElement.elementFromIndex")}elementFromPoint(e,t){this.lspError("AstElement.elementFromPoint")}lint(e=this.getAbsoluteIndex(),t){{const s=[];for(let i=0,n=e+this.getAttribute("padding");i<this.length;i++){const r=this.childNodes[i];r.setAttribute("aIndex",n);const l=r.lint(n,t);l.length>0&&s.push(...l),n+=r.toString().length+this.getGaps(i)}return s}}print(e={}){const t=e.class;return this.toString()?(t===""?"":`<span class="wpb-${t!=null?t:this.type}${this.getAttribute("invalid")?" wpb-invalid":""}">`)+ft(this.childNodes,e)+(t===""?"":"</span>"):""}json(e,t=this.getAbsoluteIndex()){this.lspError("AstElement.json")}},Bs=K(Jn),Nt=X(Bs,0,"AstElement",Qn,Nt),J(Bs,1,Nt)}}),Yt,qs,Ws,Xn,Kn,Yn,Zn,Ms,er,Qi,Wa=C({"lib/text.ts"(){"use strict";var e,Vl,s;ge(),M(),W(),Dl(),Yt=String.raw`[${Be}\t]*`,qs=String.raw`[^\S\n]*`,Ws=String.raw`<${qs}(?:/${qs})?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|(?:rfc|pmid)(?=[-::]?${Yt}\d)|isbn(?=[-::]?${Yt}(?:\d(?:${Yt}|-)){6})`,Xn=new RegExp(String.raw`${Ws}|https?[:/]/+`,"giu"),Kn=new RegExp(Ws,"giu"),Yn=new Set(["attr-value","ext-link-text","link-text"]),Zn={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},Ms=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"]),er=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch(i){return/\w/u}})(),Qi=(s=class extends Qe{constructor(n){super();N(this,e);Ee(this,"data","");this.data=n}get type(){return"text"}toString(n){var r;return n&&!((r=this.parentNode)!=null&&r.getAttribute("built"))?be(this.data):this.data}text(){return this.data}lint(n=this.getAbsoluteIndex(),r){var l,o,u;{if(r===!1)return[];const{data:d,parentNode:a,nextSibling:h,previousSibling:g}=this;if(!a)throw new Error("An isolated text node cannot be linted!");const{type:c,name:p,parentNode:b}=a;if(c==="attr-value"){const{name:O,tag:re}=b;if(re==="ref"&&(O==="name"||O==="follow")||O==="group"&&(re==="ref"||re==="references")||re==="choose"&&(O==="before"||O==="after"))return[]}if(r!=null||(r=c==="free-ext-link"||c==="ext-link-url"||c==="ext-link-text"||c==="image-parameter"&&p==="link"||c==="attr-value"?Kn:Xn),d.search(r)===-1)return[];r.lastIndex=0;const w=[],k=h==null?void 0:h.type,_=h==null?void 0:h.name,v=g==null?void 0:g.type,m=this.getRootNode(),S=m.toString(),{ext:A,html:x,variants:y}=m.getAttribute("config"),{top:T,left:$}=m.posFromIndex(n),{lintConfig:E}=I,F=E.rules["tag-like"],P=typeof F=="object"&&F[1]?new Set(Object.keys(F[1]).filter(O=>O!=="invalid"&&O!=="disallowed")):new Set,ne=new Set(["onlyinclude","noinclude","includeonly",...A,...x[0],...x[1],...x[2],...P,...E.getSeverity("tag-like","disallowed")?Ms:[]]);for(let O=r.exec(d);O;O=r.exec(d)){const[,re,fe]=O;let{index:V,0:D}=O;if(fe&&fe!=="]"){const{length:pe}=fe;V+=pe,D=D.slice(pe)}D=D.toLowerCase();const[Y]=D,z=Y==="r"||Y==="p"||Y==="i",Z=Y==="{",H=Y==="}",ee=Y==="[",oe=Y==="]";let{length:ae}=D;if(Y==="<"&&!ne.has(re.toLowerCase())||ee&&c==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(d.slice(V+1))||h!=null&&h.is("ext")&&_==="nowiki"&&((l=h.innerText)!=null&&l.includes("]")))||z&&(!a.isPlain()||Yn.has(c)))continue;oe&&(V||ae>1)&&r.lastIndex--;let te=n+V,He=te+ae,ue,ve;const Ce=S[He],Is=S[te-1],Ns=Z||ee,Ls=Z&&Is==="-"&&y.length>0,Es=H&&Ce==="-"&&y.length>0,Cn=ee&&k==="free-ext-link"&&!d.slice(V+1).trim()||oe&&v==="free-ext-link"&&!d.slice(0,V).includes("]");if(z)ue="lonely-http",D=D.toUpperCase(),ve=E.getSeverity(ue,D);else if(Y==="<"){ue="tag-like";let pe;/^<\/?\s/u.test(D)||!/[\s/>]/u.test(Ce!=null?Ce:"")?pe="invalid":P.has(re)?pe=re:Ms.has(re)&&!A.includes(re)&&(pe="disallowed"),ve=E.getSeverity(ue,pe)}else if(Ls||Es)ue="lonely-bracket",ve=E.getSeverity(ue,"converter"),Ls&&V>0?(D="-{",V--,te--,ae=2):Es&&V<d.length-1&&(D="}-",He++,ae=2);else if(Cn)ue="lonely-bracket",ve=E.getSeverity(ue,"extLink");else if(Ns||H||oe)if(ue="lonely-bracket",ae>1||Z&&Ce===Y||H&&Is===Y)ve=E.getSeverity(ue,"double");else{if(!ee||c!=="ext-link-text"){const pe=Zn[Y],Fs=Ns?d.slice(V+1):d.slice(0,V);if(Z&&((o=pe.exec(Fs))==null?void 0:o[0])==="}"||H&&((u=pe.exec(Fs))==null?void 0:u[0])==="{")continue;if(!Fs.includes(Y)){const En=Ns?"nextSibling":"previousSibling";let Ge=this[En];for(;Ge&&(Ge.type!=="text"||!pe.test(Ge.data));)Ge=Ge[En];if(Ge&&pe.exec(Ge.data)[0]!==Y)continue}}ve=E.getSeverity(ue,"single")}else ue="lonely-http",ve=E.getSeverity(ue);if(!ve)continue;const In=this.posFromIndex(V),{line:Nn,character:Ln}=Gi(T,$,In.top+1,In.left),De={rule:ue,message:I.msg("lonely",z||Y==="h"||Ls||Es?D:Y),severity:ve,startIndex:te,endIndex:He,startLine:Nn,endLine:Nn,startCol:Ln,endCol:Ln+ae};if(E.computeEditInfo)if(Y==="<")De.suggestions=[mt(te,"<")];else if(Y==="h"&&c!=="link-text"&&er.test(Is||""))De.suggestions=[Dt(te)];else if(ee&&c==="ext-link-text"){const pe=a.getAbsoluteIndex()+a.toString().length;De.suggestions=[mt(pe,"]")]}else if(oe&&Cn){const pe=n-g.toString().length;De.suggestions=[bs(pe,"left-bracket","[")]}else z&&(De.suggestions=[...O[0]===D?[]:[un(De,D)],...Ce===":"||Ce===":"?[Dt(He,1)]:[]]);w.push(De)}return w}}replaceData(n){R(this,e,Vl).call(this,n)}splitText(n){this.lspError("AstText.splitText")}escape(){}print(){return Ut(this.data)}},e=new WeakSet,Vl=function(n){this.setAttribute("data",n)},s)}}),Ze,bt=C({"mixin/hidden.ts"(){"use strict";Ze=(e=!0,t=!0)=>s=>{class i extends s{text(){return""}lint(r){return e?[]:super.lint(r)}}return i}}}),Ie,Fe=C({"mixin/noEscape.ts"(){"use strict";Ie=e=>{}}}),et,wt=C({"src/syntax.ts"(){"use strict";var e,t;q(),et=(t=class extends j{constructor(i,n,r,l,o){super(i,r,l,o);N(this,e);L(this,e,n)}get type(){return f(this,e)}lint(i=this.getAbsoluteIndex()){return super.lint(i,!1)}},e=new WeakMap,t)}}),je,Me=C({"mixin/padded.ts"(){"use strict";je=({length:e})=>t=>{class s extends t{getAttribute(n){return n==="padding"?e:super.getAttribute(n)}}return s}}}),xe,ze=C({"src/atom.ts"(){"use strict";var e,t;q(),xe=(t=class extends j{constructor(i,n,r,l,o){super(i,r,l,o);N(this,e);L(this,e,n)}get type(){return f(this,e)}set type(i){L(this,e,i)}getAttribute(i){var n;return i==="invalid"?this.type==="converter-flag"&&!!((n=this.parentNode)!=null&&n.isInvalidFlag(this)):super.getAttribute(i)}},e=new WeakMap,t)}}),tr,sr,zs,ir,Oe,ys=C({"src/link/base.ts"(){"use strict";var e,t,s,i;M(),We(),de(),Me(),Fe(),W(),q(),ze(),tr=n=>n==="redirect-target"||n==="link",sr=[Ie,je("[[")],Oe=(i=class extends(ir=j){constructor(r,l,o,u=[],d="|"){super(void 0,o,u,{});N(this,e,!0);N(this,t);N(this,s);if(this.insertAt(new xe(r,"link-target",o,u,{})),l!==void 0){const a=new j(l,o,u,{});a.type="link-text",a.setAttribute("stage",we-1),this.insertAt(a)}L(this,t,d)}get link(){}get fragment(){}afterBuild(){L(this,s,this.getTitle()),f(this,t).includes("\0")&&L(this,t,this.buildFromStr(f(this,t),0)),this.setAttribute("name",f(this,s).title),super.afterBuild()}setAttribute(r,l){r==="bracket"?L(this,e,l):r==="title"?L(this,s,l):super.setAttribute(r,l)}toString(r){const l=super.toString(r,f(this,t));return f(this,e)?`[[${l}]]`:l}text(){const r=super.text("|");return f(this,e)?`[[${r}]]`:r}getAttribute(r){return r==="title"?f(this,s):super.getAttribute(r)}getGaps(r){return r===0?f(this,t).length:1}lint(r=this.getAbsoluteIndex(),l){{const o=super.lint(r,l),{childNodes:[u,d],type:a}=this,{encoded:h,fragment:g}=f(this,s),{lintConfig:c}=I,{computeEditInfo:p,fix:b}=c,w=new le(this,r);let k="unknown-page",_=c.getSeverity(k);if(_&&u.childNodes.some(({type:v})=>v==="template")&&o.push(B(u,w,k,"template-in-link",_)),k="url-encoding",_=c.getSeverity(k),_&&h){const v=B(u,w,k,"unnecessary-encoding",_);(p||b)&&(v.fix=ln(v,u)),o.push(v)}if(k="pipe-like",_=c.getSeverity(k,"link"),_&&(a==="link"||a==="category")){const v=d==null?void 0:d.childNodes.findIndex(S=>S.type==="text"&&S.data.includes("|")),m=d==null?void 0:d.childNodes[v];if(m){const S=B(d,w,k,"pipe-in-link",_);if(p){const A=S.startIndex+d.getRelativeIndex(v);S.suggestions=[dn(A,m.data)]}o.push(S)}}if(k="no-ignored",_=c.getSeverity(k,"fragment"),_&&g!==void 0&&!tr(a)){const v=B(u,w,k,"useless-fragment",_);if(p||b){const m=u.childNodes.findIndex(A=>A.type==="text"&&A.data.includes("#")),S=u.childNodes[m];S&&(v.fix=U(v,u.getRelativeIndex(m)+S.data.indexOf("#")))}o.push(v)}return o}}getTitle(r,l){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:l,temporary:r,decode:!0,selfLink:!0})}print(){return super.print(f(this,e)?{pre:"[[",post:"]]",sep:f(this,t)}:{sep:f(this,t)})}json(r,l=this.getAbsoluteIndex()){const o=super.json(void 0,l)}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i),zs=K(ir),Oe=X(zs,0,"LinkBaseToken",sr,Oe),J(zs,1,Oe)}}),nr,Us,rr,Te,tt=C({"src/nowiki/base.ts"(){"use strict";Fe(),q(),nr=[Ie],Te=class extends(rr=j){get innerText(){return this.firstChild.data}constructor(e="",t,s){super(e,t,s)}},Us=K(rr),Te=X(Us,0,"NowikiBaseToken",nr,Te),J(Us,1,Te)}}),lr,Hs,or,ce,Ue=C({"src/nowiki/noinclude.ts"(){"use strict";bt(),tt(),lr=[Ze()],ce=class extends(or=Te){get type(){return"noinclude"}toString(e){return e?"":super.toString()}},Hs=K(or),ce=X(Hs,0,"NoincludeToken",lr,ce),J(Hs,1,ce)}}),Ql,Ma=C({"src/link/redirectTarget.ts"(){"use strict";M(),W(),ys(),Ue(),Ql=class extends Oe{get type(){return"redirect-target"}constructor(e,t,s,i){super(e,void 0,s,i),t!==void 0&&this.insertAt(new ce(t,s,i))}getTitle(){return this.normalizeTitle(this.firstChild.toString(),0,{halfParsed:!0,decode:!0})}lint(e=this.getAbsoluteIndex()){{const t=super.lint(e,!1),s="no-ignored",{lintConfig:i}=I,n=i.getSeverity(s,"redirect");if(n&&this.length===2){const r=B(this.lastChild,{start:e},s,"useless-link-text",n);r.startIndex--,r.startCol--,(i.computeEditInfo||i.fix)&&(r.fix=U(r)),t.push(r)}return t}}}}}),ar,Ds,ur,Lt,za=C({"src/redirect.ts"(){"use strict";var e,t,s;bt(),Fe(),q(),wt(),Ma(),ar=[Ze(!1,!1),Ie],Lt=(s=class extends(ur=j){constructor(n,r,l,o,u,d,a=[]){super(void 0,d,a);N(this,e);N(this,t);L(this,e,n),L(this,t,u),this.append(new et(r,"redirect-syntax",d,a),new Ql(l,o==null?void 0:o.slice(1),d,a))}get type(){return"redirect"}getAttribute(n){return n==="padding"?f(this,e).length:super.getAttribute(n)}toString(n){return f(this,e)+super.toString(n)+f(this,t)}lint(n=this.getAbsoluteIndex()){{const r=n+f(this,e).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",r),this.lastChild.lint(r)}}print(){return super.print({pre:f(this,e),post:f(this,t)})}},e=new WeakMap,t=new WeakMap,s),Ds=K(ur),Lt=X(Ds,0,"RedirectToken",ar,Lt),J(Ds,1,Lt)}}),Jl={};se(Jl,{parseRedirect:()=>Xl});var Xl,Ua=C({"parser/redirect.ts"(){"use strict";W(),za(),Xl=(e,t,s)=>{var n;(n=t.regexRedirect)!=null||(t.regexRedirect=new RegExp(String.raw`^(\s*)((?:${t.redirection.join("|")})\s*(?::\s*)?)\[\[([^\n|\]]+)(\|.*?)?\]\](\s*)`,"iu"));const i=t.regexRedirect.exec(e);return i&&I.normalizeTitle(i[3],0,!1,t,{halfParsed:!0,temporary:!0,decode:!0}).valid?(e=`\0${s.length}o${e.slice(i[0].length)}`,new Lt(...i.slice(1),t,s),e):!1}}}),dr,Gs,hr,Et,Ha=C({"src/onlyinclude.ts"(){"use strict";Me(),Fe(),q(),dr=[Ie,je("<onlyinclude>")],Et=class extends(hr=j){get type(){return"onlyinclude"}toString(e){return`<onlyinclude>${super.toString(e)}</onlyinclude>`}isPlain(){return!0}print(){return super.print({pre:'<span class="wpb-ext"><onlyinclude></span>',post:'<span class="wpb-ext"></onlyinclude></span>'})}},Gs=K(hr),Et=X(Gs,0,"OnlyincludeToken",dr,Et),J(Gs,1,Et)}}),Vt,Ss=C({"mixin/gapped.ts"(){"use strict";Vt=(e=1)=>t=>{class s extends t{getGaps(){return e}}return s}}}),cr,Vs,gr,Je,gn=C({"src/tagPair/index.ts"(){"use strict";var e,t;Ss(),Fe(),q(),cr=[Vt(),Ie],Je=(t=class extends(gr=j){constructor(i,n,r,l,o,u=[]){super(void 0,o);N(this,e);Ee(this,"closed");Ee(this,"selfClosing");this.setAttribute("name",i.toLowerCase()),L(this,e,[i,l||i]),this.closed=l!=="",this.selfClosing=l===void 0,this.append(n,r);const d=typeof n=="string"?-1:u.indexOf(n);u.splice(d===-1?1/0:d,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(i){const{selfClosing:n,firstChild:r,lastChild:l}=this,[o,u]=f(this,e);return n?`<${o}${r.toString(i)}/>`:`<${o}${r.toString(i)}>${l.toString(i)}${this.closed?`</${u}>`:""}`}text(){const[i,n]=f(this,e);return this.selfClosing?`<${i}${this.firstChild.text()}/>`:`<${i}${super.text(">")}${this.closed?`</${n}>`:""}`}getAttribute(i){return i==="padding"?f(this,e)[0].length+1:super.getAttribute(i)}print(){const[i,n]=f(this,e);return super.print(this.selfClosing?{pre:`<${i}`,post:"/>"}:{pre:`<${i}`,sep:">",post:this.closed?`</${n}>`:""})}},e=new WeakMap,t),Vs=K(gr),Je=X(Vs,0,"TagPairToken",cr,Je),J(Vs,1,Je)}}),Kl,Da=C({"src/tagPair/translate.ts"(){"use strict";var e,Yl,s;q(),gn(),wt(),Ue(),Kl=(s=class extends Je{constructor(n,r,l,o=[]){const u=new et(n,"translate-attr",l,o);r=r==null?void 0:r.replace(/(<tvar\|[^>]+>)([\s\S]*?)(<\/>)/gu,(a,h,g,c)=>(new ce(h,l,o),new ce(c,l,o),`\0${o.length-1}n${g}\0${o.length}n`)).replace(/(<tvar\s+name\s*=(?:\s*(?:(["'])[\s\S]*?\2|[^"'\s>]+))?\s*>)([\s\S]*?)(<\/tvar\s*>)/giu,(a,h,g,c,p)=>(new ce(h,l,o),new ce(p,l,o),`\0${o.length-1}n${c}\0${o.length}n`));const d=new j(r,l,o);d.type="translate-inner";super("translate",u,d,"translate",l,o);N(this,e);this.seal("closed",!0),this.seal("selfClosing",!0)}get type(){return"translate"}toString(n){return n?this.lastChild.toString(!0):super.toString()}text(){return this.lastChild.text()}print(){return`<span class="wpb-ext"><translate${R(this,e,Yl).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>`}},e=new WeakSet,Yl=function(){return this.firstChild.toString()===" nowrap"},s)}}),pr,Qs,fr,Ft,Ga=C({"src/tagPair/include.ts"(){"use strict";M(),de(),bt(),W(),gn(),pr=[Ze(!1)],Ft=class extends(fr=Je){get type(){return"include"}constructor(e,t="",s,i,n,r){super(e,t,s!=null?s:"",s===void 0||i!=null?i:"",n,r)}toString(e){return e?"":super.toString()}lint(e=this.getAbsoluteIndex()){{const t=[],{firstChild:s,closed:i,name:n}=this,r=new le(this,e),l=["no-ignored","unclosed-comment"],{lintConfig:o}=I,{computeEditInfo:u}=o,d=l.map(a=>o.getSeverity(a,"include"));if(d[0]&&s.data.trim()){const a=B(s,r,l[0],"useless-attribute",d[0]);u&&(a.suggestions=[U(a)]),t.push(a)}if(d[1]&&!i){const a=G(this,r,l[1],I.msg("unclosed",`<${n}>`),d[1]);u&&(a.suggestions=[qe(a.endIndex,`</${n}>`)]),t.push(a)}return t}}},Qs=K(fr),Ft=X(Qs,0,"IncludeToken",pr,Ft),J(Qs,1,Ft)}}),ks,pn=C({"mixin/attributesParent.ts"(){"use strict";ks=(e=0)=>t=>{var i,Zl;class s extends t{constructor(){super(...arguments);N(this,i)}hasAttr(o){this.lspError("AttributesParent.hasAttr")}getAttr(o){return R(this,i,Zl).call(this).getAttr(o)}}return i=new WeakSet,Zl=function(){return this.childNodes[e]},s}}}),ie,Js,Xs,$t,Zt,Ks,Ve,Ys,Zs,ei,es,ti,Ae,eo,to,so,io,Va=C({"util/sharable.ts"(){"use strict";ie=new Set(["align"]),Js=new Set(["cite"]),Xs=new Set(["cite","datetime"]),$t=new Set(["width"]),Zt=new Set(["axis","align","bgcolor","height","width","valign"]),Ks=new Set([...Zt,"abbr","headers","scope","rowspan","colspan"]),Ve=new Set(["type"]),Ys=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),Zs=new Set(["clear"]),ei=new Set(["bgcolor","align","valign"]),es=new Set(["qid","forcemathmode","type","display"]),ti=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),Ae=new Set,eo=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"]),to={div:ie,h1:ie,h2:ie,h3:ie,h4:ie,h5:ie,h6:ie,blockquote:Js,q:Js,p:ie,br:Zs,pre:$t,ins:Xs,del:Xs,ul:Ve,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...Ys,"border"]),caption:ie,tr:ei,td:Ks,th:Ks,font:new Set(["size","color","face"]),hr:$t,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:Ve,poem:ie,categorytree:ie,combooption:ie,math:Ae,chem:Ae,ce:Ae,img:new Set(["alt","src","width","height","loading","srcset"])},so={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:Ae,indicator:new Set(["name"]),langconvert:new Set(["from","to"]),ref:new Set(["group","name","follow","dir","details"]),references:new Set(["group","responsive"]),charinsert:new Set(["label"]),choose:new Set(["uncached","before","after"]),option:new Set(["weight"]),imagemap:Ae,inputbox:Ae,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:Ae,poll:new Set(["id","show-results-before-voting"]),sm2:Ve,flashmp3:Ve,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([...es,"chem"]),chem:es,ce:es,hiero:Ae,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:ti,syntaxhighlight:ti,templatedata:Ae,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:Ae},io={table:Ys,td:new Set([...Zt,"scope"]),th:Zt,br:Zs,caption:ie,div:ie,hr:$t,h1:ie,h2:ie,h3:ie,h4:ie,h5:ie,h6:ie,li:Ve,p:ie,pre:$t,tr:ei,ul:Ve}}}),mr,xr,vr,br,as,Qa=C({"src/attribute.ts"(){"use strict";var e,t,s,i,n,Ji,l;M(),ge(),We(),Va(),de(),W(),q(),ze(),mr=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,xr=/(?:^|\s|\*\/)(?:javascript|vbscript)(?:\W|$)/iu,vr=new Set(["ext","arg","magic-word","template"]),br=new Set(["about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),as=(l=class extends j{constructor(u,d,a,h="",g,c=[],p=I.getConfig(),b=[]){const w=new xe(a,"attr-key",p,b);let k;if(a==="title"||d==="img"&&a==="alt")k=new j(g,p,b,{}),k.type="attr-value",k.setAttribute("stage",we-1);else if(d==="gallery"&&a==="caption"||d==="choose"&&(a==="before"||a==="after")){const _=Le(me({},p),{excludes:[...p.excludes,"heading","html","table","hr","list"]});k=new j(g,_,b,{}),k.type="attr-value",k.setAttribute("stage",1)}else k=new xe(g,"attr-value",p,b,{});super(void 0,p,b);N(this,n);N(this,e);N(this,t);N(this,s);N(this,i);L(this,e,u),this.append(w,k),L(this,s,h),L(this,i,[...c]),L(this,t,d),this.setAttribute("name",pt(be(a)))}get type(){return f(this,e)}get tag(){return f(this,t)}get balanced(){return!f(this,s)||f(this,i)[0]===f(this,i)[1]}afterBuild(){f(this,s).includes("\0")&&L(this,s,this.buildFromStr(f(this,s),0)),this.parentNode&&L(this,t,this.parentNode.name),this.setAttribute("name",pt(this.firstChild.text())),super.afterBuild()}toString(u){const[d="",a=""]=f(this,i);return f(this,s)?super.toString(u,f(this,s)+d)+a:this.firstChild.toString(u)}text(){return f(this,s)?`${super.text(`${f(this,s).trim()}"`)}"`:this.firstChild.text()}getGaps(){var u,d;return f(this,s)?f(this,s).length+((d=(u=f(this,i)[0])==null?void 0:u.length)!=null?d:0):0}lint(u=this.getAbsoluteIndex(),d){var a;{const h=super.lint(u,d),{balanced:g,firstChild:c,lastChild:p,name:b,tag:w}=this,k=new le(this,u),_=["unclosed-quote","obsolete-attr"],{lintConfig:v}=I,m=_.map(A=>v.getSeverity(A,b));if(m[0]&&!g){const A=B(p,k,_[0],"unclosed-quotes",m[0]);A.startIndex--,A.startCol--,v.computeEditInfo&&(A.suggestions=[qe(A.endIndex,f(this,i)[0])]),h.push(A)}const S=R(this,n,Ji).call(this,u,k);return S&&h.push(S),m[1]&&((a=io[w])!=null&&a.has(b))&&h.push(B(c,k,_[1],"obsolete-attribute",m[1])),h}}getValue(){return f(this,s)?this.lastChild.text().trim():this.type==="ext-attr"||""}escape(){}getAttribute(u){return u==="invalid"?R(this,n,Ji).call(this):super.getAttribute(u)}print(){const[u="",d=""]=f(this,i);return f(this,s)?super.print({sep:Ut(f(this,s))+u,post:d}):super.print()}json(u,d=this.getAbsoluteIndex()){const a=super.json(void 0,d)}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,n=new WeakSet,Ji=function(u,d){const{firstChild:a,lastChild:h,type:g,name:c,tag:p,parentNode:b}=this,w=!h.childNodes.some(({type:y})=>vr.has(y)),k=this.getValue(),_=so[p],v=to[p],{length:m}=this.toString();let S="illegal-attr",A,x;if({lintConfig:A}=I,{computeEditInfo:x}=A,!(_!=null&&_.has(c))&&!(v!=null&&v.has(c))&&(g==="ext-attr"?_||v:!/\{\{[^{]+\}\}/u.test(c))&&(g==="ext-attr"&&!v||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(c)&&(p==="meta"||p==="link"||!eo.has(c)))||(c==="itemtype"||c==="itemid"||c==="itemref")&&!(b!=null&&b.hasAttr("itemscope"))){if(u===void 0)return!0;{const y=A.getSeverity(S,"unknown");if(y){const T=B(a,d,S,"illegal-attribute-name",y);return x&&(T.suggestions=[U(u,m)]),T}}}else if(c==="style"&&typeof k=="string"&&mr.test(k)){if(u===void 0)return!0;{S="insecure-style";const y=A.getSeverity(S);return y&&B(h,d,S,"insecure-style",y)}}else if(c==="tabindex"&&typeof k=="string"&&k!=="0"){if(u===void 0)return!0;{const y=A.getSeverity(S,"tabindex");if(y){const T=B(h,d,S,"nonzero-tabindex",y);return x&&(T.suggestions=[U(u,m),$e(T,"0 tabindex","0")]),T}}}else if(typeof k=="string"&&((/^xmlns:[\w:.-]+$/u.test(c)||br.has(c))&&xr.test(k)||w&&(c==="href"||p==="img"&&c==="src")&&!new RegExp(String.raw`^(?:${this.getAttribute("config").protocol}|//)\S+$`,"iu").test(k))){if(u===void 0)return!0;{const y=A.getSeverity(S,"value");return y&&B(h,d,S,"illegal-attribute-value",y)}}else if(w&&g!=="ext-attr"){const y=zl(p,c),T=String(k).toLowerCase();if(y.length>0&&y.every($=>$!==T)){if(u===void 0)return!0;{const $=A.getSeverity(S,"value");return $&&B(h,d,S,"illegal-attribute-value",$)}}}return!1},l)}}),si,wr,yr,As,fn=C({"src/attributes.ts"(){"use strict";var e,t,us,i;M(),ge(),de(),W(),q(),ze(),Qa(),si=n=>n.slice(0,-1),wr=n=>`${si(n)}-dirty`,yr=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch(n){return/[^\W_]/u}})(),As=(i=class extends j{constructor(r,l,o,u,d=[]){super(void 0,u,d,{});N(this,t);N(this,e);if(L(this,e,l),this.setAttribute("name",o),r){const a=/([^\s/](?:(?!\0\d+~\x7F)[^\s/=])*)(?:((?:\s(?:\s|\0\d+[cn]\x7F)*)?(?:=|\0\d+~\x7F)(?:\s|\0\d+[cn]\x7F)*)(?:(["'])([\s\S]*?)(\3|$)|(\S*)))?/gu;let h="",g=a.exec(r),c=0;const p=()=>{h&&(super.insertAt(new xe(h,wr(l),u,d,{})),h="")};for(;g;){const{index:b,0:w,1:k,2:_,3:v,4:m,5:S,6:A}=g;if(h+=r.slice(c,b),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(be(k).trim())){const x=m!=null?m:A,y=[v,S],T=new as(si(l),o,k,_,x,y,u,d);p(),super.insertAt(T)}else h+=w;({lastIndex:c}=a),g=a.exec(r)}h+=r.slice(c),p()}}get type(){return f(this,e)}afterBuild(){const{parentNode:r}=this;r!=null&&r.is("td")&&this.setAttribute("name",r.subtype),super.afterBuild()}getAttrTokens(r){return this.childNodes.filter(l=>l instanceof as&&(!r||l.name===pt(r)))}hasAttr(r){return this.getAttrTokens(r).length>0}getAttrToken(r){const l=this.getAttrTokens(r);return l[l.length-1]}getAttr(r){var l;return(l=this.getAttrToken(r))==null?void 0:l.getValue()}lint(r=this.getAbsoluteIndex(),l){{const o=super.lint(r,l),{parentNode:u,childNodes:d}=this,a=new Map,h=new Set,g=new le(this,r),c=["no-ignored","no-duplicate"],{lintConfig:p}=I,{computeEditInfo:b,fix:w}=p,k=["closingTag","invalidAttributes","nonWordAttributes"].map(v=>p.getSeverity(c[0],v));if(k[0]&&R(this,t,us).call(this)){const v=G(this,g,c[0],"attributes-of-closing-tag",k[0]);if(b){const m=u.getAbsoluteIndex();v.suggestions=[U(v),on(m)]}o.push(v)}for(const v of d)if(v instanceof as){const{name:m}=v;a.has(m)?(h.add(m),a.get(m).push(v)):a.set(m,[v])}else{const m=v.text().trim(),S=k[yr.test(m)?1:2];if(m&&S){const A=B(v,g,c[0],"invalid-attribute",S);b&&(A.suggestions=[U(A,0," ")]),o.push(A)}}const _=p.getSeverity(c[1],"attribute");if(_&&h.size>0)for(const v of h){const m=a.get(v).map(S=>{const A=S.getValue();return[S,A===!0?"":A]});o.push(...m.map(([S,A],x)=>{const y=B(S,g,c[1],I.msg("duplicate-attribute",v),_);if(b||w){const T=U(y);!A||m.slice(0,x).some(([,$])=>$===A)?y.fix=T:b&&(y.suggestions=[T])}return y}))}return o}}getAttribute(r){return r==="invalid"?R(this,t,us).call(this):super.getAttribute(r)}print(){return this.toString()?`<span class="wpb-${this.type}${R(this,t,us).call(this)?" wpb-invalid":""}">${this.childNodes.map(r=>r.print(r instanceof xe?{class:r.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}},e=new WeakMap,t=new WeakSet,us=function(){const{parentNode:r}=this;return(r==null?void 0:r.type)==="html"&&r.closing&&this.text().trim()!==""},i)}}),no={};se(no,{PreToken:()=>ro});var ro,Ja=C({"src/pre.ts"(){"use strict";We(),q(),Ue(),ro=class extends j{get type(){return"ext-inner"}constructor(e,t,s=[]){if(e){const i=/<nowiki>/giu,n=/<\/nowiki>/giu,{length:r}=i.source;let l=i.exec(e);l&&(n.lastIndex=l.index+r);let o=n.exec(e),u=0,d="";for(;l&&o;)new ce(l[0],t,s),new ce(o[0],t,s),d+=`${e.slice(u,l.index)}\0${s.length-1}n${e.slice(l.index+r,o.index)}\0${s.length}n`,u=o.index+r+1,i.lastIndex=u,l=i.exec(e),l&&(n.lastIndex=l.index+r),o=n.exec(e);e=d+e.slice(u)}super(e,t,s,{}),this.setAttribute("stage",we-1)}isPlain(){return!0}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*\/\s*(pre)\b/giu)}}}}),_s,mn=C({"mixin/multiLine.ts"(){"use strict";_s=e=>{class t extends e{toString(i){return super.toString(i,`
|
|
1
|
+
"use strict";(()=>{var Na=Object.defineProperty,La=Object.defineProperties;var Fa=Object.getOwnPropertyDescriptors;var Jt=Object.getOwnPropertySymbols;var Pn=Object.prototype.hasOwnProperty,Rn=Object.prototype.propertyIsEnumerable;var On=e=>{throw TypeError(e)};var Rs=(e,t,s)=>t in e?Na(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,fe=(e,t)=>{for(var s in t||(t={}))Pn.call(t,s)&&Rs(e,s,t[s]);if(Jt)for(var s of Jt(t))Rn.call(t,s)&&Rs(e,s,t[s]);return e},Le=(e,t)=>La(e,Fa(t));var Bn=(e,t)=>{var s={};for(var i in e)Pn.call(e,i)&&t.indexOf(i)<0&&(s[i]=e[i]);if(e!=null&&Jt)for(var i of Jt(e))t.indexOf(i)<0&&Rn.call(e,i)&&(s[i]=e[i]);return s};var Ea=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Fe=(e,t,s)=>Rs(e,typeof t!="symbol"?t+"":t,s),Os=(e,t,s)=>t.has(e)||On("Cannot "+s);var m=(e,t,s)=>(Os(e,t,"read from private field"),s?s.call(e):t.get(e)),N=(e,t,s)=>t.has(e)?On("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),L=(e,t,s,i)=>(Os(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),P=(e,t,s)=>(Os(e,t,"access private method"),s);var jn=(e,t,s,i)=>({set _(r){L(e,t,r,s)},get _(){return m(e,t,i)}});var qu=Ea((Mu,Ia)=>{var Pa=Object.create,bt=Object.defineProperty,Ll=Object.getOwnPropertyDescriptor,sn=Object.getOwnPropertyNames,Ra=Object.prototype.hasOwnProperty,Fl=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),wt=e=>{throw TypeError(e)},El=(e,t,s)=>t in e?bt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,qn=(e,t)=>bt(e,"name",{value:t,configurable:!0}),C=(e,t)=>function(){return e&&(t=(0,e[sn(e)[0]])(e=0)),t},Pl=(e,t)=>function(){return t||(0,e[sn(e)[0]])((t={exports:{}}).exports,t),t.exports},se=(e,t)=>{for(var s in t)bt(e,s,{get:t[s],enumerable:!0})},Oa=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of sn(t))!Ra.call(e,r)&&r!==s&&bt(e,r,{get:()=>t[r],enumerable:!(i=Ll(t,r))||i.enumerable});return e},Q=e=>Oa(bt({},"__esModule",{value:!0}),e),Y=e=>{var t;return[,,,Pa((t=e==null?void 0:e[Fl("metadata")])!=null?t:null)]},Rl=["class","method","getter","setter","accessor","field","value","get","set"],Nt=e=>e!==void 0&&typeof e!="function"?wt("Function expected"):e,Ba=(e,t,s,i,r)=>({kind:Rl[e],name:t,metadata:i,addInitializer:n=>s._?wt("Already initialized"):r.push(Nt(n||null))}),nn=(e,t)=>El(t,Fl("metadata"),e[3]),J=(e,t,s,i)=>{for(var r=0,n=e[t>>1],l=n&&n.length;r<l;r++)t&1?n[r].call(s):i=n[r].call(s,i);return i},X=(e,t,s,i,r,n)=>{var l,o,d,u,a,h=t&7,c=!!(t&8),g=!!(t&16),p=h>3?e.length+1:h?c?1:2:0,v=Rl[h+5],x=h>3&&(e[p-1]=[]),b=e[p]||(e[p]=[]),y=h&&(!g&&!c&&(r=r.prototype),h<5&&(h>3||!g)&&Ll(h<4?r:{get[s](){return he(this,n)},set[s](w){return ye(this,n,w)}},s));h?g&&h<4&&qn(n,(h>2?"set ":h>1?"get ":"")+s):qn(r,s);for(var S=i.length-1;S>=0;S--)u=Ba(h,s,d={},e[3],b),h&&(u.static=c,u.private=g,a=u.access={has:g?w=>qa(r,w):w=>s in w},h^3&&(a.get=g?w=>(h^1?he:Ui)(w,r,h^4?n:y.get):w=>w[s]),h>2&&(a.set=g?(w,A)=>ye(w,r,A,h^4?n:y.set):(w,A)=>w[s]=A)),o=(0,i[S])(h?h<4?g?n:y[v]:h>4?void 0:{get:y.get,set:y.set}:r,u),d._=1,h^4||o===void 0?Nt(o)&&(h>4?x.unshift(o):h?g?n=o:y[v]=o:r=o):typeof o!="object"||o===null?wt("Object expected"):(Nt(l=o.get)&&(y.get=l),Nt(l=o.set)&&(y.set=l),Nt(l=o.init)&&x.unshift(l));return h||nn(e,r),y&&bt(r,s,y),g?h^4?n:y:r},ja=(e,t,s)=>El(e,typeof t!="symbol"?t+"":t,s),rn=(e,t,s)=>t.has(e)||wt("Cannot "+s),qa=(e,t)=>Object(t)!==t?wt('Cannot use the "in" operator on this value'):e.has(t),he=(e,t,s)=>(rn(e,t,"read from private field"),s?s.call(e):t.get(e)),Oe=(e,t,s)=>t.has(e)?wt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),ye=(e,t,s,i)=>(rn(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),Ui=(e,t,s)=>(rn(e,t,"access private method"),s),Wa=(e,t,s,i)=>({set _(r){ye(e,t,r,s)},get _(){return he(e,t,i)}}),Ol,fs,Bl=C({"base.ts"(){"use strict";Ol=(()=>{const e={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(e,null),e})(),fs=(()=>{const e=["bold-header","format-leakage","fostered-content","h1","illegal-attr","insecure-style","invalid-gallery","invalid-imagemap","invalid-invoke","invalid-isbn","invalid-url","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(e),e})()}});function Se(e,t,s){return s===1?e.replace(/\0(\d+)g\x7F/gu,(i,r)=>Se(String(t[r]),t,2)):s===2?e.replace(/\0(\d+)n\x7F/gu,(i,r)=>String(t[r])):e.replace(/\0(\d+)\x7F/gu,(i,r)=>t[r])}var qe,Bs,pt,ft,mt,nt,jl,ve,Ye,Wn,Mn,ms,ql,zn,Un,Ut,xt,ce=C({"util/string.ts"(){"use strict";qe=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,Bs=String.raw`[^[\]<>"\0-\x1F\x7F${qe}\uFFFD]`,pt=String.raw`(?:\[[\da-f:.]+\]|${Bs})`,ft=String.raw`(?:${Bs}|\0\d+[cn!~]\x7F)*`,mt=e=>e.trim().toLowerCase(),nt=(e,t)=>s=>s.replace(e,t),jl=nt(/[\0\x7F]|\r$/gmu,""),ve=nt(/\0\d+[cn]\x7F/gu,""),Ye=(e,t="")=>e.map(s=>typeof s=="string"?s:s.text()).join(t),Wn={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},Mn=nt(/&(?:#(\d+|[Xx][\da-fA-F]+)|([lg]t|[LG]T|[lr]brac[ke]|nbsp|amp|AMP|quot|QUOT));/gu,(e,t,s)=>t?String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t)):Wn[s.toLowerCase()]),ms=e=>Mn(e),ql=nt(/&#(\d+|x[\da-f]+);/giu,(e,t)=>String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t))),zn={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},Un=e=>nt(e,t=>`&${zn[t]};`),Ut=Un(/[&<>]/gu),xt=(e,t={})=>{const{pre:s="",post:i="",sep:r=""}=t;return s+e.map(n=>n.print()).join(r)+i}}}),Ma=Pl({"i18n/en.json"(e,t){t.exports={"attributes-of-closing-tag":"attributes of a closing tag","bold-apostrophes":"bold apostrophes","bold-in-header":"bold text in a section header",close:null,"closing-and-self-closing":"tag that is both closing and self-closing",comment:null,"conflicting-image-parameter":"conflicting image $1 parameter","content-outside-table":"content to be moved outside the table",decode:null,delink:null,"duplicate-attribute":"duplicate $1 attribute","duplicate-category":"duplicate category","duplicate-id":"duplicate HTML id","duplicate-image-parameter":"duplicate image $1 parameter","duplicate-parameter":"duplicate template parameter",encode:null,escape:null,expand:null,"ext-in-html":"extension tag in HTML tag attributes",frame:null,"full-width-punctuation":"full-width punctuation","header-in-html":"section header in HTML tag attributes","horizontal-alignment":null,"html-in-table":"HTML tag in table attributes","illegal-attribute-name":"invalid attribute name","illegal-attribute-value":"invalid attribute value","illegal-module":"invalid Scribunto module name","imagemap-without-image":"<imagemap> without an image","in-url":"$1 in URL","inconsistent-table":"inconsistent table layout","insecure-style":"insecure style","invalid-attribute":"element containing an invalid attribute name","invalid-content":"invalid content in <$1>","invalid-conversion-flag":"invalid conversion flag","invalid-gallery":"invalid gallery image","invalid-image-parameter":"invalid image parameter","invalid-imagemap-link":"invalid link in <imagemap>","invalid-isbn":"invalid ISBN","invalid-parameter":"invalid parameter of <$1>","invalid-self-closing":"invalid self-closing tag","invalid-url":"invalid URL","invisible-triple-braces":"invisible content inside triple braces","italic-apostrophes":"italic apostrophes","left-bracket":"opening bracket","link-in-extlink":"internal link in an external link",lonely:'lonely "$1"',"missing-extension":"missing file extension","missing-function":"missing Scribunto module function name",newline:null,"no-self-closing":"no self-closing","nonzero-tabindex":"nonzero tabindex","nothing-in":"nothing should be in <$1>","obsolete-attribute":"obsolete attribute","obsolete-tag":"obsolete HTML tag",open:null,prefix:null,"pipe-in-link":'additional "|" in the link text',"pipe-in-table":'additional "|" in a table cell',"ref-in-link":"<ref> in an internal or external link",remove:null,"template-in-link":"template in an internal link target","unbalanced-in-section-header":"unbalanced $1 in a section header",unclosed:"unclosed $1","unclosed-comment":"unclosed HTML comment","unclosed-quotes":"unclosed quotes","unclosed-table":"unclosed table","unclosed-tag":"unclosed tag","unescaped-query":"unescaped query string in an anonymous parameter","unexpected-argument":"unexpected template argument","unmatched-closing":"unmatched closing tag","unnecessary-encoding":"unnecessary percent-encoding in an internal link",uppercase:null,"useless-attribute":"useless attribute","useless-fragment":"useless fragment","useless-link-text":"useless link text","variable-anchor":"variable anchor in a section header","vertical-alignment":null,whitespace:null}}}),za=Pl({"config/minimum.json"(e,t){t.exports={ext:[],html:[["b","bdi","del","i","ins","u","font","big","small","sub","sup","h1","h2","h3","h4","h5","h6","cite","code","em","s","strike","strong","tt","var","div","center","blockquote","ol","ul","dl","table","caption","pre","ruby","rb","rp","rt","rtc","p","span","abbr","dfn","kbd","samp","data","time","mark","tr","td","th","q","bdo"],["li","dt","dd"],["br","wbr","hr","meta","link"]],namespaces:{0:"",6:"File",10:"Template",14:"Category",828:"Module"},nsid:{"":0,file:6,template:10,category:14,module:828},functionHook:["msgnw"],variable:["!","=","pageid","articlepath","server","servername","scriptpath","stylepath"],parserFunction:[{msgnw:"msgnw",pageid:"pageid",articlepath:"articlepath",server:"server",servername:"servername",scriptpath:"scriptpath",stylepath:"stylepath","#language":"language","#special":"special","#speciale":"speciale","#tag":"tag","#formatdate":"formatdate","#dateformat":"formatdate","#invoke":"invoke","#while":"while","#dowhile":"dowhile","#loop":"loop","#forargs":"forargs","#fornumargs":"fornumargs","#if":"if","#ifeq":"ifeq","#switch":"switch","#ifexist":"ifexist","#ifexpr":"ifexpr","#iferror":"iferror","#time":"time","#timel":"timel","#expr":"expr","#rel2abs":"rel2abs","#titleparts":"titleparts","#categorytree":"categorytree","#urldecode":"urldecode","#choose":"choose","#var":"var","#varexists":"varexists","#var_final":"var_final","#vardefine":"vardefine","#vardefineecho":"vardefineecho","#widget":"widget","#related":"related","#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","#avatar":"avatar","#img":"img","#chart":"chart"},{"!":"!","=":"=","#FORMAL":"formal","#bcp47":"bcp47","#dir":"dir","#interwikilink":"interwikilink","#interlanguagelink":"interlanguagelink","#contentmodel":"contentmodel","#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:|wikipedia://|worldwind://|xmpp:",interwiki:[],img:{},redirection:["#redirect"],variants:[]}}}),be,Wl,Hi,Me=C({"util/constants.ts"(){"use strict";be=11,Wl=Ma(),Hi=za()}});function gt(e){const t=new Map,s=new WeakMap;return i=>{const r=typeof i=="string"?t:s;if(r.has(i)){const l=r.get(i);return l.lastIndex=0,l}const n=e(i);return r.set(i,n),n}}var Ht,Ml,Ze=C({"../common/dist/index.mjs"(){"use strict";Ht=e=>decodeURIComponent(e.replace(/%(?![\da-f]{2})/giu,"%25")),Ml=gt}}),le,de=C({"lib/rect.ts"(){"use strict";var e,t,s,i,Di,n;le=(n=class{constructor(l,o){N(this,i);N(this,e);N(this,t);N(this,s);L(this,e,l),L(this,t,o)}get start(){return m(this,t)}get top(){return P(this,i,Di).call(this).top}get left(){return P(this,i,Di).call(this).left}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakSet,Di=function(){var l;return(l=m(this,s))!=null||L(this,s,m(this,e).getRootNode().posFromIndex(m(this,t))),m(this,s)},n)}}),Hn,Dn,zt,Gi,js,q,z,$e,ws,U,ln,We,on,an,un,Dt,vt,dn,Ke,zl,M=C({"util/lint.ts"(){"use strict";Ze(),Ce(),de(),B(),Hn=new Set(["tr","td","th","caption"]),Dn=new Set(["Template:!!","Template:!-"]),zt=e=>{const t=e.childNodes.find(s=>s.text().trim());if(!t||t.type==="text"&&t.data.trim().startsWith("!")||t.is("magic-word")&&t.name==="!"||t.is("template")&&Dn.has(t.name)||t.is("html")&&Hn.has(t.name))return!1;if(t.is("arg"))return t.length>1&&zt(t.childNodes[1]);if(t.is("magic-word"))try{const s=t.getPossibleValues().map(zt);return s.includes(2)?2:s.includes(1)&&1}catch(s){}return t.is("template")||t.is("magic-word")&&t.name==="invoke"?1:2},Gi=(e,t,s,i)=>({line:e+s-1,character:(s===1?t:0)+i}),js=e=>(t,s,i,r,n="error")=>{const{start:l}=s,{top:o,left:d}=s instanceof le?s:new le(t,l),{offsetHeight:u,offsetWidth:a}=t,{startIndex:h,startLine:c,startCol:g}=e(t,l,o,d),{line:p,character:v}=Gi(c,g,u,a);return{rule:i,message:I.msg(r),severity:n,startIndex:h,endIndex:h+t.toString().length,startLine:c,endLine:p,startCol:g,endCol:v}},q=js((e,t,s,i)=>{const r=e.getRelativeIndex(),{top:n,left:l}=e.parentNode.posFromIndex(r);return{startIndex:t+r,startLine:s+n,startCol:n?l:i+l}}),z=js((e,t,s,i)=>({startIndex:t,startLine:s,startCol:i})),$e=(e,t,s,i=0)=>({desc:I.msg(t),range:[e.startIndex+i,e.endIndex],text:s}),ws=(e,t,s)=>({desc:I.msg(t),range:[e,e],text:s}),U=(e,t=0,s="")=>typeof e=="number"?{desc:I.msg("remove"),range:[e,e+t],text:s}:$e(e,"remove",s,t),ln=(e,t)=>$e(e,"decode",Ht(t.text().replace(/%(?=21|3[ce]|5[bd]|7[b-d])/giu,"%25"))),We=(e,t,s=0)=>({desc:I.msg("close"),range:[e+s,e],text:t}),on=e=>({desc:I.msg("open"),range:[e+1,e+2],text:""}),an=(e,t)=>$e(e,"comment",`<!--${t}-->`),un=(e,t)=>$e(e,"uppercase",t.toUpperCase()),Dt=(e,t=0)=>({desc:I.msg("whitespace"),range:[e,e+t],text:" "}),vt=(e,t,s=1)=>({desc:I.msg("escape"),range:[e,e+s],text:t.repeat(s)}),dn=(e,t)=>({desc:I.msg("escape"),range:[e,e+t.length],text:t.replace(/\|/gu,"|")}),Ke=(e,t,s,i)=>{if(e&&(i||I.viewOnly&&e[0]===we.rev))return e[1];const r=t();return(i||I.viewOnly)&&s([we.rev,r]),r},zl=(e,t)=>e==="ol"&&t==="type"?["1","a","A","i","I"]:e==="th"&&t==="scope"?["row","col","rowgroup","colgroup"]:t==="dir"?["ltr","rtl","auto"]:t==="aria-hidden"?["true","false"]:[]}}),Gn,hn,Ul=C({"parser/selector.ts"(){"use strict";Gn=(e,t,s)=>{if(e.includes("#")){const i=e.indexOf("#");return(i===0||e.slice(0,i)===t)&&e.slice(i+1)===s}return!e||e===t},hn=(e,t,s)=>{const i=e.split(",");return(({type:r,name:n})=>i.some(l=>Gn(l.trim(),r,n)))}}}),ys,cn=C({"mixin/cached.ts"(){"use strict";M(),ys=(e=!0)=>t=>{const s=new WeakMap;return function(...i){return Ke(s.get(this),()=>t.apply(this,i),r=>{s.set(this,r)},e)}}}}),Hl,Ua=C({"mixin/nodeLike.ts"(){"use strict";Hl=e=>{class t extends e{get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get offsetHeight(){return this.getDimension().height}get offsetWidth(){return this.getDimension().width}}return t}}}),Vn,Qn,Xt,St,kt,Kt,At,_t,$t,Je,Dl=C({"lib/node.ts"(){"use strict";M(),Ce(),cn(),Ua(),B(),Qn=[Hl],Vn=[ys(!1)],Je=class{constructor(){J($t,5,this),ja(this,"childNodes",[]),Oe(this,Xt),Oe(this,St),Oe(this,kt),Oe(this,Kt),Oe(this,At),Oe(this,_t,{})}get parentNode(){return he(this,Xt)}get nextSibling(){return he(this,St)}get previousSibling(){return he(this,kt)}getChildNodes(){const{childNodes:e}=this;return Object.isFrozen(e)?[...e]:e}getAttribute(e){return e==="padding"?0:this[e]}setAttribute(e,t){switch(e){case"parentNode":ye(this,Xt,t),t||(ye(this,St,void 0),ye(this,kt,void 0));break;case"nextSibling":ye(this,St,t);break;case"previousSibling":ye(this,kt,t);break;case"aIndex":I.viewOnly&&ye(this,At,[we.rev,t]);break;default:this[e]=t}}getRootNode(){return Ke(he(this,Kt),()=>{var e,t;return(t=(e=this.parentNode)==null?void 0:e.getRootNode())!=null?t:this},e=>{const[,t]=e;t.type==="root"&&ye(this,Kt,e)})}indexFromPos(e,t){this.lspError("AstNode.indexFromPos")}posFromIndex(e){{const{length:t}=String(this);if(e+=e<0?t:0,e>=0&&e<=t){const s=this.getLines(),i=s.findIndex(([,,r])=>e<=r);return{top:i,left:e-s[i][1]}}return}}getDimension(){{const e=this.getLines(),t=e[e.length-1];return{height:e.length,width:t[2]-t[1]}}}getGaps(e){return 0}getRelativeIndex(e){if(e===void 0){const{parentNode:t}=this;return t?t.getRelativeIndex(t.childNodes.indexOf(this)):0}return Ke(he(this,_t)[e],()=>{const{childNodes:t}=this,s=e+(e<0?t.length:0);let i=this.getAttribute("padding");for(let r=0;r<s;r++)I.viewOnly&&(he(this,_t)[r]=[we.rev,i]),i+=t[r].toString().length+this.getGaps(r);return i},t=>{he(this,_t)[e]=t})}getAbsoluteIndex(){return Ke(he(this,At),()=>{const{parentNode:e}=this;return e?e.getAbsoluteIndex()+this.getRelativeIndex():0},e=>{ye(this,At,e)})}getBoundingClientRect(){this.lspError("AstNode.getBoundingClientRect")}is(e){return this.type===e}getLines(){{const e=[];let t=0;for(const s of String(this).split(`
|
|
2
|
+
`)){const i=t+s.length;e.push([s,t,i]),t=i+1}return e}}seal(e,t){const s=!t&&!!this[e];Object.defineProperty(this,e,{enumerable:s,configurable:!0})}lspError(e){throw new Error(`${e} method is only available in the LSP version!`)}},$t=Y(null),Xt=new WeakMap,St=new WeakMap,kt=new WeakMap,Kt=new WeakMap,At=new WeakMap,_t=new WeakMap,X($t,1,"getLines",Vn,Je),Je=X($t,0,"AstNode",Qn,Je),J($t,1,Je)}}),Gl,Ha=C({"mixin/elementLike.ts"(){"use strict";Ul(),Gl=e=>{var t,Vi;{class i extends e{constructor(){super(...arguments);N(this,t)}getElementBy(l){for(const o of this.childNodes){if(o.type==="text")continue;if(l(o))return o;const d=o.getElementBy(l);if(d)return d}}querySelector(l){return this.getElementBy(P(this,t,Vi).call(this,l))}getElementsBy(l,o=[]){for(const d of this.childNodes)d.type!=="text"&&(l(d)&&o.push(d),d.getElementsBy(l,o));return o}querySelectorAll(l){return this.getElementsBy(P(this,t,Vi).call(this,l))}escape(){}}return t=new WeakSet,Vi=function(l){return hn(l,this)},i}}}}),Jn,qs,Xn,Lt,Da=C({"lib/element.ts"(){"use strict";ce(),Ce(),Ul(),Dl(),Ha(),Jn=[Gl],Lt=class extends(Xn=Je){get length(){return this.childNodes.length}text(e){return Ye(this.childNodes,e)}normalize(){const e=this.getChildNodes(),t=s=>{var i,r;e.splice(s,1),(i=e[s-1])==null||i.setAttribute("nextSibling",e[s]),(r=e[s])==null||r.setAttribute("previousSibling",e[s-1])};for(let s=e.length-1;s>=0;s--){const{type:i,data:r}=e[s];i!=="text"||e.length===1||this.getGaps(s-(s&&1))||r===""&&t(s)}this.setAttribute("childNodes",e)}removeAt(e){this.lspError("AstElement.removeAt")}insertAt(e,t=this.length){return Cn(this,t,0,[e]),e}closest(e){const t=hn(e,this);let{parentNode:s}=this;for(;s;){if(t(s))return s;({parentNode:s}=s)}}append(...e){this.safeAppend(e)}safeAppend(e){for(const t of e)this.insertAt(t)}safeReplaceChildren(e){}setText(e,t=0){t+=t<0?this.length:0;const s=this.childNodes[t],{data:i}=s;return s.replaceData(e),i}toString(e,t=""){return this.childNodes.map(s=>s.toString(e)).join(t)}caretPositionFromIndex(e){this.lspError("AstElement.caretPositionFromIndex")}elementFromIndex(e){this.lspError("AstElement.elementFromIndex")}elementFromPoint(e,t){this.lspError("AstElement.elementFromPoint")}lint(e=this.getAbsoluteIndex(),t){{const s=[];for(let i=0,r=e+this.getAttribute("padding");i<this.length;i++){const n=this.childNodes[i];n.setAttribute("aIndex",r);const l=n.lint(r,t);l.length>0&&s.push(...l),r+=n.toString().length+this.getGaps(i)}return s}}print(e={}){const t=e.class;return this.toString()?(t===""?"":`<span class="wpb-${t!=null?t:this.type}${this.getAttribute("invalid")?" wpb-invalid":""}">`)+xt(this.childNodes,e)+(t===""?"":"</span>"):""}json(e,t=this.getAbsoluteIndex()){}},qs=Y(Xn),Lt=X(qs,0,"AstElement",Jn,Lt),J(qs,1,Lt)}}),Yt,Ws,Ms,Kn,Yn,Zn,er,zs,tr,Qi,Ga=C({"lib/text.ts"(){"use strict";var e,Vl,s;ce(),M(),B(),Dl(),Yt=String.raw`[${qe}\t]*`,Ws=String.raw`[^\S\n]*`,Ms=String.raw`<${Ws}(?:/${Ws})?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|(?:rfc|pmid)(?=[-::]?${Yt}\d)|isbn(?=[-::]?${Yt}(?:\d(?:${Yt}|-)){6})`,Kn=new RegExp(String.raw`${Ms}|https?[:/]/+`,"giu"),Yn=new RegExp(Ms,"giu"),Zn=new Set(["attr-value","ext-link-text","link-text"]),er={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},zs=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"]),tr=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch(i){return/\w/u}})(),Qi=(s=class extends Je{constructor(r){super();N(this,e);Fe(this,"data","");this.data=r}get type(){return"text"}toString(r){var n;return r&&!((n=this.parentNode)!=null&&n.getAttribute("built"))?ve(this.data):this.data}text(){return this.data}lint(r=this.getAbsoluteIndex(),n){var l,o,d;{if(n===!1)return[];const{data:u,parentNode:a,nextSibling:h,previousSibling:c}=this;if(!a)throw new Error("An isolated text node cannot be linted!");const{type:g,name:p,parentNode:v}=a;if(g==="attr-value"){const{name:O,tag:re}=v;if(re==="ref"&&(O==="name"||O==="follow")||O==="group"&&(re==="ref"||re==="references")||re==="choose"&&(O==="before"||O==="after"))return[]}if(n!=null||(n=g==="free-ext-link"||g==="ext-link-url"||g==="ext-link-text"||g==="image-parameter"&&p==="link"||g==="attr-value"?Yn:Kn),u.search(n)===-1)return[];n.lastIndex=0;const x=[],b=h==null?void 0:h.type,y=h==null?void 0:h.name,S=c==null?void 0:c.type,w=this.getRootNode(),A=w.toString(),{ext:_,html:f,variants:k}=w.getAttribute("config"),{top:$,left:T}=w.posFromIndex(r),{lintConfig:F}=I,j=F.rules["tag-like"],R=typeof j=="object"&&j[1]?new Set(Object.keys(j[1]).filter(O=>O!=="invalid"&&O!=="disallowed")):new Set,ne=new Set(["onlyinclude","noinclude","includeonly",..._,...f[0],...f[1],...f[2],...R,...F.getSeverity("tag-like","disallowed")?zs:[]]);for(let O=n.exec(u);O;O=n.exec(u)){const[,re,pe]=O;let{index:V,0:G}=O;if(pe&&pe!=="]"){const{length:ge}=pe;V+=ge,G=G.slice(ge)}G=G.toLowerCase();const[K]=G,H=K==="r"||K==="p"||K==="i",Z=K==="{",D=K==="}",ee=K==="[",oe=K==="]";let{length:ae}=G;if(K==="<"&&!ne.has(re.toLowerCase())||ee&&g==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(u.slice(V+1))||h!=null&&h.is("ext")&&y==="nowiki"&&((l=h.innerText)!=null&&l.includes("]")))||H&&(!a.isPlain()||Zn.has(g)))continue;oe&&(V||ae>1)&&n.lastIndex--;let te=r+V,De=te+ae,ue,me;const Ie=A[De],Ns=A[te-1],Ls=Z||ee,Fs=Z&&Ns==="-"&&k.length>0,Es=D&&Ie==="-"&&k.length>0,In=ee&&b==="free-ext-link"&&!u.slice(V+1).trim()||oe&&S==="free-ext-link"&&!u.slice(0,V).includes("]");if(H)ue="lonely-http",G=G.toUpperCase(),me=F.getSeverity(ue,G);else if(K==="<"){ue="tag-like";let ge;/^<\/?\s/u.test(G)||!/[\s/>]/u.test(Ie!=null?Ie:"")?ge="invalid":R.has(re)?ge=re:zs.has(re)&&!_.includes(re)&&(ge="disallowed"),me=F.getSeverity(ue,ge)}else if(Fs||Es)ue="lonely-bracket",me=F.getSeverity(ue,"converter"),Fs&&V>0?(G="-{",V--,te--,ae=2):Es&&V<u.length-1&&(G="}-",De++,ae=2);else if(In)ue="lonely-bracket",me=F.getSeverity(ue,"extLink");else if(Ls||D||oe)if(ue="lonely-bracket",ae>1||Z&&Ie===K||D&&Ns===K)me=F.getSeverity(ue,"double");else{if(!ee||g!=="ext-link-text"){const ge=er[K],Ps=Ls?u.slice(V+1):u.slice(0,V);if(Z&&((o=ge.exec(Ps))==null?void 0:o[0])==="}"||D&&((d=ge.exec(Ps))==null?void 0:d[0])==="{")continue;if(!Ps.includes(K)){const En=Ls?"nextSibling":"previousSibling";let Ve=this[En];for(;Ve&&(Ve.type!=="text"||!ge.test(Ve.data));)Ve=Ve[En];if(Ve&&ge.exec(Ve.data)[0]!==K)continue}}me=F.getSeverity(ue,"single")}else ue="lonely-http",me=F.getSeverity(ue);if(!me)continue;const Nn=this.posFromIndex(V),{line:Ln,character:Fn}=Gi($,T,Nn.top+1,Nn.left),Ge={rule:ue,message:I.msg("lonely",H||K==="h"||Fs||Es?G:K),severity:me,startIndex:te,endIndex:De,startLine:Ln,endLine:Ln,startCol:Fn,endCol:Fn+ae};if(F.computeEditInfo)if(K==="<")Ge.suggestions=[vt(te,"<")];else if(K==="h"&&g!=="link-text"&&tr.test(Ns||""))Ge.suggestions=[Dt(te)];else if(ee&&g==="ext-link-text"){const ge=a.getAbsoluteIndex()+a.toString().length;Ge.suggestions=[vt(ge,"]")]}else if(oe&&In){const ge=r-c.toString().length;Ge.suggestions=[ws(ge,"left-bracket","[")]}else H&&(Ge.suggestions=[...O[0]===G?[]:[un(Ge,G)],...Ie===":"||Ie===":"?[Dt(De,1)]:[]]);x.push(Ge)}return x}}replaceData(r){P(this,e,Vl).call(this,r)}splitText(r){this.lspError("AstText.splitText")}escape(){}print(){return Ut(this.data)}},e=new WeakSet,Vl=function(r){this.setAttribute("data",r)},s)}}),ze,et=C({"mixin/hidden.ts"(){"use strict";ze=(e=!0,t=!0)=>s=>{class i extends s{text(){return""}lint(n){return e?[]:super.lint(n)}}return i}}}),Ne,Ee=C({"mixin/noEscape.ts"(){"use strict";Ne=e=>{}}}),Ue,tt=C({"src/syntax.ts"(){"use strict";var e,t;W(),Ue=(t=class extends E{constructor(i,r,n,l,o){super(i,n,l,o);N(this,e);L(this,e,r)}get type(){return m(this,e)}lint(i=this.getAbsoluteIndex()){return super.lint(i,!1)}},e=new WeakMap,t)}}),Pe,He=C({"mixin/padded.ts"(){"use strict";Pe=({length:e})=>t=>{{class s extends t{getAttribute(r){return r==="padding"?e:super.getAttribute(r)}}return s}}}}),xe,st=C({"src/atom.ts"(){"use strict";var e,t;W(),xe=(t=class extends E{constructor(i,r,n,l,o){super(i,n,l,o);N(this,e);L(this,e,r)}get type(){return m(this,e)}set type(i){L(this,e,i)}getAttribute(i){var r;return i==="invalid"?this.type==="converter-flag"&&!!((r=this.parentNode)!=null&&r.isInvalidFlag(this)):super.getAttribute(i)}},e=new WeakMap,t)}}),sr,ir,Us,nr,Be,Ss=C({"src/link/base.ts"(){"use strict";var e,t,s,i;M(),Me(),de(),He(),Ee(),B(),W(),st(),sr=r=>r==="redirect-target"||r==="link",ir=[Ne,Pe("[[")],Be=(i=class extends(nr=E){constructor(n,l,o,d=[],u="|"){super(void 0,o,d,{});N(this,e,!0);N(this,t);N(this,s);if(this.insertAt(new xe(n,"link-target",o,d,{})),l!==void 0){const a=new E(l,o,d,{});a.type="link-text",a.setAttribute("stage",be-1),this.insertAt(a)}L(this,t,u)}get link(){}get fragment(){}afterBuild(){L(this,s,this.getTitle()),m(this,t).includes("\0")&&L(this,t,this.buildFromStr(m(this,t),0)),this.setAttribute("name",m(this,s).title),super.afterBuild()}setAttribute(n,l){n==="bracket"?L(this,e,l):n==="title"?L(this,s,l):super.setAttribute(n,l)}toString(n){const l=super.toString(n,m(this,t));return m(this,e)?`[[${l}]]`:l}text(){const n=super.text("|");return m(this,e)?`[[${n}]]`:n}getAttribute(n){return n==="title"?m(this,s):super.getAttribute(n)}getGaps(n){return n===0?m(this,t).length:1}lint(n=this.getAbsoluteIndex(),l){{const o=super.lint(n,l),{childNodes:[d,u],type:a}=this,{encoded:h,fragment:c}=m(this,s),{lintConfig:g}=I,{computeEditInfo:p,fix:v}=g,x=new le(this,n);let b="unknown-page",y=g.getSeverity(b);if(y&&d.childNodes.some(({type:S})=>S==="template")&&o.push(q(d,x,b,"template-in-link",y)),b="url-encoding",y=g.getSeverity(b),y&&h){const S=q(d,x,b,"unnecessary-encoding",y);(p||v)&&(S.fix=ln(S,d)),o.push(S)}if(b="pipe-like",y=g.getSeverity(b,"link"),y&&(a==="link"||a==="category")){const S=u==null?void 0:u.childNodes.findIndex(A=>A.type==="text"&&A.data.includes("|")),w=u==null?void 0:u.childNodes[S];if(w){const A=q(u,x,b,"pipe-in-link",y);if(p){const _=A.startIndex+u.getRelativeIndex(S);A.suggestions=[dn(_,w.data)]}o.push(A)}}if(b="no-ignored",y=g.getSeverity(b,"fragment"),y&&c!==void 0&&!sr(a)){const S=q(d,x,b,"useless-fragment",y);if(p||v){const w=d.childNodes.findIndex(_=>_.type==="text"&&_.data.includes("#")),A=d.childNodes[w];A&&(S.fix=U(S,d.getRelativeIndex(w)+A.data.indexOf("#")))}o.push(S)}return o}}getTitle(n,l){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:l,temporary:n,decode:!0,selfLink:!0})}print(){return super.print(m(this,e)?{pre:"[[",post:"]]",sep:m(this,t)}:{sep:m(this,t)})}json(n,l=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i),Us=Y(nr),Be=X(Us,0,"LinkBaseToken",ir,Be),J(Us,1,Be)}}),rr,Hs,lr,Te,it=C({"src/nowiki/base.ts"(){"use strict";Ee(),W(),rr=[Ne],Te=class extends(lr=E){get innerText(){return this.firstChild.data}constructor(e="",t,s){super(e,t,s)}},Hs=Y(lr),Te=X(Hs,0,"NowikiBaseToken",rr,Te),J(Hs,1,Te)}}),or,Ds,ar,ke,yt=C({"src/nowiki/noinclude.ts"(){"use strict";et(),it(),or=[ze()],ke=class extends(ar=Te){get type(){return"noinclude"}toString(e){return e?"":super.toString()}},Ds=Y(ar),ke=X(Ds,0,"NoincludeToken",or,ke),J(Ds,1,ke)}}),Ql,Va=C({"src/link/redirectTarget.ts"(){"use strict";M(),B(),Ss(),yt(),Ql=class extends Be{get type(){return"redirect-target"}constructor(e,t,s,i){super(e,void 0,s,i),t!==void 0&&this.insertAt(new ke(t,s,i))}getTitle(){return this.normalizeTitle(this.firstChild.toString(),0,{halfParsed:!0,decode:!0})}lint(e=this.getAbsoluteIndex()){{const t=super.lint(e,!1),s="no-ignored",{lintConfig:i}=I,r=i.getSeverity(s,"redirect");if(r&&this.length===2){const n=q(this.lastChild,{start:e},s,"useless-link-text",r);n.startIndex--,n.startCol--,(i.computeEditInfo||i.fix)&&(n.fix=U(n)),t.push(n)}return t}}}}}),ur,Gs,dr,Ft,Qa=C({"src/redirect.ts"(){"use strict";var e,t,s;et(),Ee(),W(),tt(),Va(),ur=[ze(!1,!1),Ne],Ft=(s=class extends(dr=E){constructor(r,n,l,o,d,u,a=[]){super(void 0,u,a);N(this,e);N(this,t);L(this,e,r),L(this,t,d),this.append(new Ue(n,"redirect-syntax",u,a),new Ql(l,o==null?void 0:o.slice(1),u,a))}get type(){return"redirect"}getAttribute(r){return r==="padding"?m(this,e).length:super.getAttribute(r)}toString(r){return m(this,e)+super.toString(r)+m(this,t)}lint(r=this.getAbsoluteIndex()){{const n=r+m(this,e).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",n),this.lastChild.lint(n)}}print(){return super.print({pre:m(this,e),post:m(this,t)})}},e=new WeakMap,t=new WeakMap,s),Gs=Y(dr),Ft=X(Gs,0,"RedirectToken",ur,Ft),J(Gs,1,Ft)}}),Jl={};se(Jl,{parseRedirect:()=>Xl});var Xl,Ja=C({"parser/redirect.ts"(){"use strict";B(),Qa(),Xl=(e,t,s)=>{var r;(r=t.regexRedirect)!=null||(t.regexRedirect=new RegExp(String.raw`^(\s*)((?:${t.redirection.join("|")})\s*(?::\s*)?)\[\[([^\n|\]]+)(\|.*?)?\]\](\s*)`,"iu"));const i=t.regexRedirect.exec(e);return i&&I.normalizeTitle(i[3],0,!1,t,{halfParsed:!0,temporary:!0,decode:!0}).valid?(e=`\0${s.length}o${e.slice(i[0].length)}`,new Ft(...i.slice(1),t,s),e):!1}}}),hr,Vs,cr,Et,Xa=C({"src/onlyinclude.ts"(){"use strict";He(),Ee(),W(),hr=[Ne,Pe("<onlyinclude>")],Et=class extends(cr=E){get type(){return"onlyinclude"}toString(e){return`<onlyinclude>${super.toString(e)}</onlyinclude>`}isPlain(){return!0}print(){return super.print({pre:'<span class="wpb-ext"><onlyinclude></span>',post:'<span class="wpb-ext"></onlyinclude></span>'})}},Vs=Y(cr),Et=X(Vs,0,"OnlyincludeToken",hr,Et),J(Vs,1,Et)}}),Vt,ks=C({"mixin/gapped.ts"(){"use strict";Vt=(e=1)=>t=>{class s extends t{getGaps(){return e}}return s}}}),gr,Qs,pr,Xe,gn=C({"src/tagPair/index.ts"(){"use strict";var e,t;ks(),Ee(),W(),gr=[Vt(),Ne],Xe=(t=class extends(pr=E){constructor(i,r,n,l,o,d=[]){super(void 0,o);N(this,e);Fe(this,"closed");Fe(this,"selfClosing");this.setAttribute("name",i.toLowerCase()),L(this,e,[i,l||i]),this.closed=l!=="",this.selfClosing=l===void 0,this.append(r,n);const u=typeof r=="string"?-1:d.indexOf(r);d.splice(u===-1?1/0:u,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(i){const{selfClosing:r,firstChild:n,lastChild:l}=this,[o,d]=m(this,e);return r?`<${o}${n.toString(i)}/>`:`<${o}${n.toString(i)}>${l.toString(i)}${this.closed?`</${d}>`:""}`}text(){const[i,r]=m(this,e);return this.selfClosing?`<${i}${this.firstChild.text()}/>`:`<${i}${super.text(">")}${this.closed?`</${r}>`:""}`}getAttribute(i){return i==="padding"?m(this,e)[0].length+1:super.getAttribute(i)}print(){const[i,r]=m(this,e);return super.print(this.selfClosing?{pre:`<${i}`,post:"/>"}:{pre:`<${i}`,sep:">",post:this.closed?`</${r}>`:""})}},e=new WeakMap,t),Qs=Y(pr),Xe=X(Qs,0,"TagPairToken",gr,Xe),J(Qs,1,Xe)}}),pn,Kl=C({"src/tag/index.ts"(){"use strict";var e,t,s,i;M(),Ce(),B(),W(),pn=(i=class extends E{constructor(n,l,o,d,u){super(void 0,d,u);N(this,e);N(this,t);N(this,s);this.insertAt(l),L(this,e,o),L(this,t,n)}get closing(){return m(this,e)}toString(n){return`<${m(this,e)?"/":""}${m(this,t)}${super.toString(n)}${this.selfClosing?"/":""}>`}text(n=""){const{closing:l}=this;return`<${l&&!n?"/":""}${m(this,t)}${l?"":super.text()}${n}>`}getAttribute(n){return n==="padding"?m(this,t).length+(m(this,e)?2:1):super.getAttribute(n)}findMatchingTag(){return Ke(m(this,s),()=>{const{type:n,name:l,parentNode:o,closing:d,selfClosing:u}=this;let a=!1,h=!1;if(n==="html"){const{html:[,b,y]}=this.getAttribute("config");a=y.includes(l),h=b.includes(l)}if(a||h&&u)return this;if(!o)return;const{childNodes:c}=o,g=c.indexOf(this),p=d?c.slice(0,g).reverse():c.slice(g+1),v=[this],{rev:x}=we;for(const b of p)if(!(!b.is(n)||n==="html"&&(b.name!==l||h&&b.selfClosing)))if(m(b,e)===d){if(n==="tvar")return;v.push(b)}else{const y=v.pop();if(y===this)return b;I.viewOnly&&(L(y,s,[x,b]),L(b,s,[x,y]))}if(I.viewOnly)for(const b of v)L(b,s,[x,void 0])},n=>{L(this,s,n),n[1]&&n[1]!==this&&L(n[1],s,[we.rev,this])})}print(){return super.print({pre:`<${m(this,e)?"/":""}${m(this,t)}`,post:`${this.selfClosing?"/":""}>`})}json(n,l=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i)}}),fr,Js,mr,je,Ka=C({"src/tag/tvar.ts"(){"use strict";et(),Kl(),tt(),fr=[ze()],je=class extends(mr=pn){get type(){return"tvar"}constructor(e,t,s,i,r){const n=new Ue(t,"tvar-name",i,r);super(e,n,s,i,r)}},Js=Y(mr),je=X(Js,0,"TvarToken",fr,je),J(Js,1,je)}}),Yl,Ya=C({"src/tagPair/translate.ts"(){"use strict";var e,Zl,s;W(),gn(),tt(),Ka(),Yl=(s=class extends Xe{constructor(r,n,l,o=[]){const d=new Ue(r,"translate-attr",l,o);n=n==null?void 0:n.replace(/<tvar(\|[^>]+)>([\s\S]*?)<\/>/gu,(a,h,c)=>(new je("tvar",h,!1,l,o),new je("","",!0,l,o),`\0${o.length-2}n${c}\0${o.length}n`)).replace(/<(tvar)(\s+name\s*=(?:\s*(?:(["'])[\s\S]*?\3|[^"'\s>]+))?\s*)>([\s\S]*?)<\/(tvar)(\s*)>/giu,(a,h,c,g,p,v,x)=>(new je(h,c,!1,l,o),new je(v,x,!0,l,o),`\0${o.length-2}n${p}\0${o.length}n`));const u=new E(n,l,o);u.type="translate-inner";super("translate",d,u,"translate",l,o);N(this,e);this.seal("closed",!0),this.seal("selfClosing",!0)}get type(){return"translate"}toString(r){return r?this.lastChild.toString(!0):super.toString()}text(){return this.lastChild.text()}print(){return`<span class="wpb-ext"><translate${P(this,e,Zl).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>`}},e=new WeakSet,Zl=function(){return this.firstChild.toString()===" nowrap"},s)}}),xr,Xs,vr,Pt,Za=C({"src/tagPair/include.ts"(){"use strict";M(),de(),et(),B(),gn(),xr=[ze(!1)],Pt=class extends(vr=Xe){get type(){return"include"}constructor(e,t="",s,i,r,n){super(e,t,s!=null?s:"",s===void 0||i!=null?i:"",r,n)}toString(e){return e?"":super.toString()}lint(e=this.getAbsoluteIndex()){{const t=[],{firstChild:s,closed:i,name:r}=this,n=new le(this,e),l=["no-ignored","unclosed-comment"],{lintConfig:o}=I,{computeEditInfo:d}=o,u=l.map(a=>o.getSeverity(a,"include"));if(u[0]&&s.data.trim()){const a=q(s,n,l[0],"useless-attribute",u[0]);d&&(a.suggestions=[U(a)]),t.push(a)}if(u[1]&&!i){const a=z(this,n,l[1],I.msg("unclosed",`<${r}>`),u[1]);d&&(a.suggestions=[We(a.endIndex,`</${r}>`)]),t.push(a)}return t}}},Xs=Y(vr),Pt=X(Xs,0,"IncludeToken",xr,Pt),J(Xs,1,Pt)}}),As,fn=C({"mixin/attributesParent.ts"(){"use strict";As=(e=0)=>t=>{var s,eo;{class r extends t{constructor(){super(...arguments);N(this,s)}hasAttr(o){this.lspError("AttributesParent.hasAttr")}getAttr(o){return P(this,s,eo).call(this).getAttr(o)}}return s=new WeakSet,eo=function(){return this.childNodes[e]},r}}}}),ie,Ks,Ys,Tt,Zt,Zs,Qe,ei,ti,si,es,ii,Ae,to,so,io,no,eu=C({"util/sharable.ts"(){"use strict";ie=new Set(["align"]),Ks=new Set(["cite"]),Ys=new Set(["cite","datetime"]),Tt=new Set(["width"]),Zt=new Set(["axis","align","bgcolor","height","width","valign"]),Zs=new Set([...Zt,"abbr","headers","scope","rowspan","colspan"]),Qe=new Set(["type"]),ei=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),ti=new Set(["clear"]),si=new Set(["bgcolor","align","valign"]),es=new Set(["qid","forcemathmode","type","display"]),ii=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),Ae=new Set,to=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"]),so={div:ie,h1:ie,h2:ie,h3:ie,h4:ie,h5:ie,h6:ie,blockquote:Ks,q:Ks,p:ie,br:ti,pre:Tt,ins:Ys,del:Ys,ul:Qe,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...ei,"border"]),caption:ie,tr:si,td:Zs,th:Zs,font:new Set(["size","color","face"]),hr:Tt,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:Qe,poem:ie,categorytree:ie,combooption:ie,math:Ae,chem:Ae,ce:Ae,img:new Set(["alt","src","width","height","loading","srcset"])},io={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:Ae,indicator:new Set(["name"]),langconvert:new Set(["from","to"]),ref:new Set(["group","name","follow","dir","details"]),references:new Set(["group","responsive"]),charinsert:new Set(["label"]),choose:new Set(["uncached","before","after"]),option:new Set(["weight"]),imagemap:Ae,inputbox:Ae,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:Ae,poll:new Set(["id","show-results-before-voting"]),sm2:Qe,flashmp3:Qe,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([...es,"chem"]),chem:es,ce:es,hiero:Ae,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:ii,syntaxhighlight:ii,templatedata:Ae,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:Ae},no={table:ei,td:new Set([...Zt,"scope"]),th:Zt,br:ti,caption:ie,div:ie,hr:Tt,h1:ie,h2:ie,h3:ie,h4:ie,h5:ie,h6:ie,li:Qe,p:ie,pre:Tt,tr:si,ul:Qe}}}),br,wr,yr,Sr,as,tu=C({"src/attribute.ts"(){"use strict";var e,t,s,i,r,ro,Ji,o;M(),ce(),Me(),eu(),de(),B(),W(),st(),br=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,wr=/(?:^|\s|\*\/)(?:javascript|vbscript)(?:\W|$)/iu,yr=new Set(["ext","arg","magic-word","template"]),Sr=new Set(["about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),as=(o=class extends E{constructor(u,a,h,c="",g,p=[],v=I.getConfig(),x=[]){const b=new xe(h,"attr-key",v,x);let y;if(h==="title"||a==="img"&&h==="alt")y=new E(g,v,x,{}),y.type="attr-value",y.setAttribute("stage",be-1);else if(a==="gallery"&&h==="caption"||a==="ref"&&h==="details"||a==="choose"&&(h==="before"||h==="after")){const S=Le(fe({},v),{excludes:[...v.excludes,"heading","html","table","hr","list"]});y=new E(g,S,x,{}),y.type="attr-value",y.setAttribute("stage",1)}else y=new xe(g,"attr-value",v,x,{});super(void 0,v,x);N(this,r);N(this,e);N(this,t);N(this,s);N(this,i);L(this,e,u),this.append(b,y),L(this,s,c),L(this,i,[...p]),L(this,t,a),this.setAttribute("name",mt(ve(h)))}get type(){return m(this,e)}get tag(){return m(this,t)}get balanced(){return!m(this,s)||m(this,i)[0]===m(this,i)[1]}afterBuild(){m(this,s).includes("\0")&&L(this,s,this.buildFromStr(m(this,s),0)),this.parentNode&&L(this,t,this.parentNode.name),P(this,r,ro).call(this),super.afterBuild()}toString(u){const[a="",h=""]=m(this,i);return m(this,s)?super.toString(u,m(this,s)+a)+h:this.firstChild.toString(u)}text(){return m(this,s)?`${super.text(`${m(this,s).trim()}"`)}"`:this.firstChild.text()}getGaps(){var u,a;return m(this,s)?m(this,s).length+((a=(u=m(this,i)[0])==null?void 0:u.length)!=null?a:0):0}lint(u=this.getAbsoluteIndex(),a){var h;{const c=super.lint(u,a),{balanced:g,firstChild:p,lastChild:v,name:x,tag:b}=this,y=new le(this,u),S=["unclosed-quote","obsolete-attr"],{lintConfig:w}=I,A=S.map(f=>w.getSeverity(f,x));if(A[0]&&!g){const f=q(v,y,S[0],"unclosed-quotes",A[0]);f.startIndex--,f.startCol--,w.computeEditInfo&&(f.suggestions=[We(f.endIndex,m(this,i)[0])]),c.push(f)}const _=P(this,r,Ji).call(this,u,y);return _&&c.push(_),A[1]&&((h=no[b])!=null&&h.has(x))&&c.push(q(p,y,S[1],"obsolete-attribute",A[1])),c}}getValue(){return m(this,s)?this.lastChild.text().trim():this.type==="ext-attr"||""}escape(){}getAttribute(u){return u==="invalid"?P(this,r,Ji).call(this):super.getAttribute(u)}print(){const[u="",a=""]=m(this,i);return m(this,s)?super.print({sep:Ut(m(this,s))+u,post:a}):super.print()}json(u,a=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakSet,ro=function(){this.setAttribute("name",mt(this.firstChild.text()))},Ji=function(u,a){const{firstChild:h,lastChild:c,type:g,name:p,tag:v,parentNode:x}=this,b=!c.childNodes.some(({type:$})=>yr.has($)),y=this.getValue(),S=io[v],w=so[v],{length:A}=this.toString();let _="illegal-attr",f,k;if({lintConfig:f}=I,{computeEditInfo:k}=f,!(S!=null&&S.has(p))&&!(w!=null&&w.has(p))&&(g==="ext-attr"?S||w:!/\{\{[^{]+\}\}/u.test(p))&&(g==="ext-attr"&&!w||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(p)&&(v==="meta"||v==="link"||!to.has(p)))||(p==="itemtype"||p==="itemid"||p==="itemref")&&!(x!=null&&x.hasAttr("itemscope"))){if(u===void 0)return!0;{const $=f.getSeverity(_,"unknown");if($){const T=q(h,a,_,"illegal-attribute-name",$);return k&&(T.suggestions=[U(u,A)]),T}}}else if(p==="style"&&typeof y=="string"&&br.test(y)){if(u===void 0)return!0;{_="insecure-style";const $=f.getSeverity(_);return $&&q(c,a,_,"insecure-style",$)}}else if(p==="tabindex"&&typeof y=="string"&&y!=="0"){if(u===void 0)return!0;{const $=f.getSeverity(_,"tabindex");if($){const T=q(c,a,_,"nonzero-tabindex",$);return k&&(T.suggestions=[U(u,A),$e(T,"0 tabindex","0")]),T}}}else if(typeof y=="string"&&((/^xmlns:[\w:.-]+$/u.test(p)||Sr.has(p))&&wr.test(y)||b&&(p==="href"||v==="img"&&p==="src")&&!new RegExp(String.raw`^(?:${this.getAttribute("config").protocol}|//)\S+$`,"iu").test(y))){if(u===void 0)return!0;{const $=f.getSeverity(_,"value");return $&&q(c,a,_,"illegal-attribute-value",$)}}else if(b&&g!=="ext-attr"){const $=zl(v,p),T=String(y).toLowerCase();if($.length>0&&$.every(F=>F!==T)){if(u===void 0)return!0;{const F=f.getSeverity(_,"value");return F&&q(c,a,_,"illegal-attribute-value",F)}}}return!1},o)}}),ni,kr,Ar,_s,mn=C({"src/attributes.ts"(){"use strict";var e,t,us,i;M(),ce(),de(),B(),W(),st(),tu(),ni=r=>r.slice(0,-1),kr=r=>`${ni(r)}-dirty`,Ar=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch(r){return/[^\W_]/u}})(),_s=(i=class extends E{constructor(n,l,o,d,u=[]){super(void 0,d,u,{});N(this,t);N(this,e);if(L(this,e,l),this.setAttribute("name",o),n){const a=/([^\s/](?:(?!\0\d+~\x7F)[^\s/=])*)(?:((?:\s(?:\s|\0\d+[cn]\x7F)*)?(?:=|\0\d+~\x7F)(?:\s|\0\d+[cn]\x7F)*)(?:(["'])([\s\S]*?)(\3|$)|(\S*)))?/gu;let h="",c=a.exec(n),g=0;const p=(()=>{h&&(super.insertAt(new xe(h,kr(l),d,u,{})),h="")});for(;c;){const{index:v,0:x,1:b,2:y,3:S,4:w,5:A,6:_}=c;if(h+=n.slice(g,v),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(ve(b).trim())){const f=w!=null?w:_,k=[S,A],$=new as(ni(l),o,b,y,f,k,d,u);p(),super.insertAt($)}else h+=x;({lastIndex:g}=a),c=a.exec(n)}h+=n.slice(g),p()}}get type(){return m(this,e)}afterBuild(){const{parentNode:n}=this;n!=null&&n.is("td")&&this.setAttribute("name",n.subtype),super.afterBuild()}getAttrTokens(n){return this.childNodes.filter(l=>l instanceof as&&(!n||l.name===mt(n)))}hasAttr(n){return this.getAttrTokens(n).length>0}getAttrToken(n){{const l=this.getAttrTokens(n);return l[l.length-1]}}getAttr(n){var l;return(l=this.getAttrToken(n))==null?void 0:l.getValue()}lint(n=this.getAbsoluteIndex(),l){{const o=super.lint(n,l),{parentNode:d,childNodes:u}=this,a=new Map,h=new Set,c=new le(this,n),g=["no-ignored","no-duplicate"],{lintConfig:p}=I,{computeEditInfo:v,fix:x}=p,b=["closingTag","invalidAttributes","nonWordAttributes"].map(S=>p.getSeverity(g[0],S));if(b[0]&&P(this,t,us).call(this)){const S=z(this,c,g[0],"attributes-of-closing-tag",b[0]);if(v){const w=d.getAbsoluteIndex();S.suggestions=[U(S),on(w)]}o.push(S)}for(const S of u)if(S instanceof as){const{name:w}=S;a.has(w)?(h.add(w),a.get(w).push(S)):a.set(w,[S])}else{const w=S.text().trim(),A=b[Ar.test(w)?1:2];if(w&&A){const _=q(S,c,g[0],"invalid-attribute",A);v&&(_.suggestions=[U(_,0," ")]),o.push(_)}}const y=p.getSeverity(g[1],"attribute");if(y&&h.size>0)for(const S of h){const w=a.get(S).map(A=>{const _=A.getValue();return[A,_===!0?"":_]});o.push(...w.map(([A,_],f)=>{const k=q(A,c,g[1],I.msg("duplicate-attribute",S),y);if(v||x){const $=U(k);!_||w.slice(0,f).some(([,T])=>T===_)?k.fix=$:v&&(k.suggestions=[$])}return k}))}return o}}getAttribute(n){return n==="invalid"?P(this,t,us).call(this):super.getAttribute(n)}print(){return this.toString()?`<span class="wpb-${this.type}${P(this,t,us).call(this)?" wpb-invalid":""}">${this.childNodes.map(n=>n.print(n instanceof xe?{class:n.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}},e=new WeakMap,t=new WeakSet,us=function(){const{parentNode:n}=this;return(n==null?void 0:n.type)==="html"&&n.closing&&this.text().trim()!==""},i)}}),lo={};se(lo,{PreToken:()=>oo});var oo,su=C({"src/pre.ts"(){"use strict";Me(),W(),yt(),oo=class extends E{get type(){return"ext-inner"}constructor(e,t,s=[]){if(e){const i=/<nowiki>/giu,r=/<\/nowiki>/giu,{length:n}=i.source;let l=i.exec(e);l&&(r.lastIndex=l.index+n);let o=r.exec(e),d=0,u="";for(;l&&o;)new ke(l[0],t,s,!0),new ke(o[0],t,s,!0),u+=`${e.slice(d,l.index)}\0${s.length-1}n${e.slice(l.index+n,o.index)}\0${s.length}n`,d=o.index+n+1,i.lastIndex=d,l=i.exec(e),l&&(r.lastIndex=l.index+n),o=r.exec(e);e=u+e.slice(d)}super(e,t,s,{}),this.setAttribute("stage",be-1)}isPlain(){return!0}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*\/\s*(pre)\b/giu)}}}}),$s,xn=C({"src/multiLine/index.ts"(){"use strict";W(),$s=class extends E{get type(){return"ext-inner"}toString(e){return super.toString(e,`
|
|
3
3
|
`)}text(){return super.text(`
|
|
4
4
|
`).replace(/\n\s*\n/gu,`
|
|
5
5
|
`)}getGaps(){return 1}print(){return super.print({sep:`
|
|
6
|
-
`})}}return
|
|
7
|
-
`).map(l=>n?l:Qt(l,s,i,e)).map(l=>new r(l,"param-line",s,i,{})))}i.splice(i.indexOf(this),1),i.push(this)}lint(e=this.getAbsoluteIndex()){{const t="no-ignored",{lintConfig:s}=I,i=s.getSeverity(t,this.name);if(!i)return[];const n=new le(this,e),r=I.msg("invalid-parameter",this.name),l=[];for(const o of this.childNodes){o.setAttribute("aIndex",e);const u=o.childNodes.filter(({type:d})=>d!=="comment"&&d!=="include"&&d!=="noinclude");if(u.some(({type:d})=>d==="ext"))l.push(B(o,n,t,r,i));else{const d=u.findIndex(({type:h})=>h!=="text"),a=u.slice(0,d===-1?void 0:d).map(String).join("");if(a&&!(d===-1?/^[a-z]+(?:\[\])?\s*=/iu:/^[a-z]+(?:\[\])?\s*(?:=|$)/iu).test(a)){const h=B(o,n,t,r,i);s.computeEditInfo&&(h.suggestions=[U(h)]),l.push(h)}else{const h=o.lint(e,!1);h.length>0&&l.push(...h)}}e+=o.toString().length+1}return l}}},ii=K(kr),nt=X(ii,0,"ParamTagToken",Sr,nt),J(ii,1,nt)}}),Ar,ni,_r,rt,ao=C({"src/heading.ts"(){"use strict";var e,t,ds,i;M(),Ne(),de(),Fe(),W(),q(),wt(),Ar=[Ie],rt=(i=class extends(_r=j){constructor(r,l,o,u=[]){super(void 0,o,u);N(this,t);N(this,e);L(this,e,r);const d=new j(l[0],o,u);d.type="heading-title",d.setAttribute("stage",2);const a=new et(l[1],"heading-trail",o,u);this.append(d,a)}get type(){return"heading"}get level(){return f(this,e)}toString(r){const l=R(this,t,ds).call(this);return l+this.firstChild.toString(r)+l+this.lastChild.toString(r)}text(){const r=R(this,t,ds).call(this);return r+this.firstChild.text()+r}getAttribute(r){return r==="invalid"?this.inHtmlAttrs()===2:r==="padding"?this.level:super.getAttribute(r)}getGaps(){return this.level}lint(r=this.getAbsoluteIndex(),l){{const o=super.lint(r,l),{firstChild:u,level:d}=this,a=u.toString(),h=a.startsWith("="),g=h||a.endsWith("="),c=new le(this,r),p=this.inHtmlAttrs(),b=["h1","unbalanced-header","format-leakage"],{lintConfig:w}=I,{computeEditInfo:k,fix:_}=w,v=b.map(m=>w.getSeverity(m,"apostrophe"));if(v[0]&&this.level===1){const m=B(u,c,b[0],"<h1>",v[0]);k&&!g&&(m.suggestions=[$e(m,"h2",`=${a}=`)]),o.push(m)}if(v[1]&&g){const m=I.msg("unbalanced-in-section-header",'"="'),S=B(u,c,b[1],m,v[1]);if(!(!k||a==="="))if(h){const[A]=/^=+/u.exec(a),x=d+A.length;S.suggestions=[{desc:`h${d}`,range:[S.startIndex,S.startIndex+A.length],text:""}],x<7&&S.suggestions.push({desc:`h${x}`,range:[S.endIndex,S.endIndex],text:A})}else{const A=/[^=](=+)$/u.exec(a)[1],x=d+A.length;S.suggestions=[{desc:`h${d}`,range:[S.endIndex-A.length,S.endIndex],text:""}],x<7&&S.suggestions.push({desc:`h${x}`,range:[S.startIndex,S.startIndex],text:A})}o.push(S)}if(p){const m="parsing-order",S=w.getSeverity(m,p===2?"heading":"templateInTable");S&&o.push(G(this,c,m,"header-in-html",S))}if(v[2]){const m=this.getRootNode().toString(),S=u.childNodes.filter(Cs("quote")),A=S.filter(({bold:y})=>y),x=S.filter(({italic:y})=>y);if(A.length%2){const y=B(A[A.length-1],Le(me({},c),{start:r+d,left:c.left+d}),b[2],I.msg("unbalanced-in-section-header","bold-apostrophes"),v[2]);if(k||_){const T=r+d+a.length,$=U(y);m.slice(y.endIndex,T).trim()?k&&(y.suggestions=[$,qe(T,"'''")]):A.length===1&&x.length===0?y.fix=$:k&&(y.suggestions=[$])}o.push(y)}if(x.length%2){const y=B(x[x.length-1],{start:r+d},b[2],I.msg("unbalanced-in-section-header","italic-apostrophes"),v[2]);if(k||_){const T=r+d+a.length;m.slice(y.endIndex,T).trim()?k&&(y.suggestions=[qe(T,"''")]):x.length===1&&A.length===0?y.fix=U(y):k&&(y.suggestions=[U(y)])}o.push(y)}}return o}}print(){const r=R(this,t,ds).call(this);return super.print({pre:r,sep:r})}json(r,l=this.getAbsoluteIndex()){const o=super.json(void 0,l)}},e=new WeakMap,t=new WeakSet,ds=function(){return"=".repeat(this.level)},i),ni=K(_r),rt=X(ni,0,"HeadingToken",Ar,rt),J(ni,1,rt)}}),$r,uo,Xa=C({"src/parameter.ts"(){"use strict";ge(),M(),W(),q(),$r=new RegExp(`https?://${ct}${gt}$`,"iu"),uo=class extends j{get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){}constructor(e,t,s,i=[]){super(void 0,s,i);const n=new j(typeof e=="number"?void 0:e,s,i,{}),r=new j(t,s,i);n.type="parameter-key",n.setAttribute("stage",2),r.type="parameter-value",r.setAttribute("stage",2),this.append(n,r)}trimName(e,t=!0){const s=(typeof e=="string"?e:e.toString(!0)).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");return this.setAttribute("name",s),s}afterBuild(){if(!this.anon){const{parentNode:e,firstChild:t}=this,s=this.trimName(t);e&&e.getArgs(s,!1,!1).add(this)}super.afterBuild()}toString(e){return this.anon?this.lastChild.toString(e):super.toString(e,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(e=this.getAbsoluteIndex(),t){var s;{const i=super.lint(e,t),n="unescaped",{lintConfig:r}=I,l=r.getSeverity(n);if(l){const{firstChild:o}=this,u=(s=$r.exec(o.text()))==null?void 0:s[0];try{if(u&&new URL(u).search){const d=B(o,{start:e},n,"unescaped-query",l);d.startIndex=d.endIndex,d.startLine=d.endLine,d.startCol=d.endCol,d.endIndex++,d.endCol++,(r.computeEditInfo||r.fix)&&(d.fix=mt(d.startIndex,"{{=}}")),i.push(d)}}catch(d){}}return i}}print(){return super.print({sep:this.anon?"":"="})}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t)}}}}),Tr,ri,Cr,lt,Ka=C({"src/transclude.ts"(){"use strict";var e,t,s,i,n,r,hs,ho,u;ge(),M(),Ne(),de(),Ss(),Fe(),W(),q(),Xa(),ze(),wt(),Tr=[Ie,Vt()],lt=(u=class extends(Cr=j){constructor(a,h,g,c=[]){var $,E;let p;const b=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(a);b&&(p=Number(b[1]),a=a.replace(`\0${p}h`,c[p].toString().replace(/^\n/u,"")));super(void 0,g,c,{});N(this,r);Ee(this,"modifier","");N(this,e,"template");N(this,t,":");N(this,s,!1);N(this,i,new Map);N(this,n);const{parserFunction:[w,k],variable:_,functionHook:v}=g,m=($=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(a))==null?void 0:$[0];if(m)this.setAttribute("modifier",m),a=a.slice(m.length);else if(a.includes(":")){const[F,...P]=a.split(":"),[ne]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((E=P[0])!=null?E:"");this.setModifier(`${F}:${ne}`)&&(a=P.join(":").slice(ne.length))}const S=a.search(/[::]/u),A=a[S]===":",x=S!==-1;if(x||h.length===0&&!f(this,s)){const F=x?a.slice(0,S):a,P=x&&a.slice(S+1),ne=be(F),O=x?ne.slice(ne.search(/\S/u))+(A?":":""):ne.trim(),re=O.toLowerCase(),fe=Array.isArray(k),V=fe?k.includes(O):Object.prototype.hasOwnProperty.call(k,O),D=!fe&&V?k[O]:Object.prototype.hasOwnProperty.call(w,re)&&w[re],Y=fe&&V||!("functionHook"in g)||v.includes(D),z=fe&&V||_.includes(D);if(x?D&&Y:z){this.setAttribute("name",D||re.replace(/^#|:$/u,"")),L(this,e,"magic-word"),A&&L(this,t,":");const Z=new et(F,"magic-word-name",g,c);if(super.insertAt(Z),P!==!1&&h.unshift([P]),this.name==="invoke")for(let H=0;H<2;H++){const ee=h.shift();if(!ee)break;const oe=new xe(ee.join("="),`invoke-${H?"function":"module"}`,g,c);super.insertAt(oe)}}}if(this.type==="template"){const F=be(a).trim();if(!this.normalizeTitle(F,10,{halfParsed:!0,temporary:!0}).valid)throw c.pop(),new SyntaxError("Invalid template name");const P=new xe(a,"template-name",g,c,{});super.insertAt(P)}typeof p=="number"&&(c[p]=void 0);const y=this.isTemplate();let T=1;for(let F=0;F<h.length;F++){const P=h[F];y||this.name==="switch"&&F>0||this.name==="tag"&&F>1||(P[0]=P.join("="),P.length=1),P.length===1&&(P.unshift(T),T++),this.insertAt(new uo(...P,g,c))}this.seal("modifier")}get type(){return f(this,e)}get module(){}get function(){}setModifier(a){const{parserFunction:[,,h,g]}=this.getAttribute("config"),c=be(a).trim();if(a&&!c.endsWith(":"))return!1;const p=c.slice(0,-1).toLowerCase(),b=h.includes(p),w=g.includes(p);return f(this,s)&&b||!f(this,s)&&(w||!a)||(ke.running||this.length>1)&&(b||w||!a)?(this.setAttribute("modifier",a),L(this,s,b),!!a):!1}isTemplate(){return this.type==="template"||this.name==="invoke"}afterBuild(){this.modifier.includes("\0")&&this.setAttribute("modifier",this.buildFromStr(this.modifier,0)),super.afterBuild(),this.isTemplate()&&this.type==="template"&&(L(this,n,R(this,r,hs).call(this)),this.setAttribute("name",f(this,n).title))}toString(a){const{childNodes:h,length:g,firstChild:c,modifier:p,type:b}=this;return`{{${p}${b==="magic-word"?c.toString(a)+(g===1?"":f(this,t))+h.slice(1).map(w=>w.toString(a)).join("|"):super.toString(a,"|")}}}`}text(){const{childNodes:a,length:h,firstChild:g,modifier:c,type:p,name:b}=this;return p==="magic-word"&&b==="vardefine"?"":`{{${c}${p==="magic-word"?g.text()+(h===1?"":f(this,t))+Ke(a.slice(1),"|"):super.text("|")}}}`}getAttribute(a){switch(a){case"padding":return this.modifier.length+2;case"title":return f(this,n);case"colon":return f(this,t);case"invalid":return this.type==="magic-word"&&this.name==="invoke"&&(this.length===2||!R(this,r,hs).call(this).valid);default:return super.getAttribute(a)}}lint(a=this.getAbsoluteIndex(),h){{const g=super.lint(a,h);if(!this.isTemplate())return g;const{type:c,childNodes:p,length:b}=this,w=new le(this,a),{lintConfig:k}=I,{computeEditInfo:_}=k,v=c==="magic-word";let m="no-ignored",S=k.getSeverity(m,"fragment");if(v&&!R(this,r,hs).call(this).valid)m="invalid-invoke",S=k.getSeverity(m,"name"),S&&g.push(B(p[1],w,m,"illegal-module",S));else if(S){const A=p[v?1:0],x=A.childNodes.findIndex(T=>T.type==="text"&&ms(T.data).includes("#")),y=A.childNodes[x];if(y){const T=B(A,w,m,"useless-fragment",S);_&&(T.suggestions=[U(T,A.getRelativeIndex(x)+y.data.indexOf("#"))]),g.push(T)}}if(m="invalid-invoke",S=k.getSeverity(m,"function"),S&&v&&b===2)return g.push(G(this,w,m,"missing-function",S)),g;if(m="no-duplicate",S=k.getSeverity(m,"parameter"),S){const A=this.getDuplicatedArgs().filter(([,y])=>!y[0].querySelector("ext")),x="duplicate-parameter";for(const[,y]of A)g.push(...y.map(T=>{const $=B(T,w,m,x,S);return _&&($.suggestions=[U($,-1)]),$}))}return g}}insertAt(a,h=this.length){return super.insertAt(a,h),a.anon?R(this,r,ho).call(this,a):a.name&&this.getArgs(a.name,!1,!1).add(a),a}getAllArgs(){return this.childNodes.filter(Cs("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:a})=>a)}getArgs(a,h,g=!0){const c=String(a).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");let p;return f(this,i).has(c)?p=f(this,i).get(c):(p=new Set(this.getAllArgs().filter(({name:b})=>c===b)),f(this,i).set(c,p)),p}getDuplicatedArgs(){return[...f(this,i)].filter(([,{size:a}])=>a>1).map(([a,h])=>[a,[...h]])}getPossibleValues(){const{type:a,name:h,childNodes:g}=this;if(a==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let c,p;switch(h){case"if":case"ifexist":case"ifexpr":case"iferror":c=2;break;case"ifeq":c=3;break;case"switch":{const b=g.slice(2),w=b[b.length-1];p=[...b.filter(({anon:k})=>!k),...w!=null&&w.anon?[w]:[]].map(({lastChild:k})=>k);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}p!=null||(p=g.slice(c,c+2).map(({lastChild:b})=>b));for(let b=0;b<p.length;){const{length:w,0:k}=p[b].childNodes.filter(_=>_.text().trim());if(w===0)p.splice(b,1);else if(w>1||k.type!=="magic-word")b++;else try{const _=k.getPossibleValues();p.splice(b,1,..._),b+=_.length}catch(_){b++}}return p}print(){const{childNodes:a,length:h,firstChild:g,modifier:c,type:p}=this;return`<span class="wpb-${p}${this.getAttribute("invalid")?" wpb-invalid":""}">{{${p==="magic-word"?Ut(c)+g.print()+(h===1?"":f(this,t))+ft(a.slice(1),{sep:"|"}):(c?`<span class="wpb-magic-word">${Ut(c)}</span>`:"")+ft(a,{sep:"|"})}}}</span>`}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,n=new WeakMap,r=new WeakSet,hs=function(){const a=this.type==="template";return this.normalizeTitle(this.childNodes[a?0:1].text(),a?10:828,{temporary:!0})},ho=function(a){const h=this.getAnonArgs(),g=typeof a!="number";for(let c=g?h.indexOf(a):a-1;c<h.length;c++){const p=h[c],{name:b}=p,w=String(c+1);(b!==w||p===a)&&(p.setAttribute("name",w),this.getArgs(w,!1,!1).add(p))}},u),ri=K(Cr),lt=X(ri,0,"TranscludeToken",Tr,lt),J(ri,1,lt)}}),Ir,li,Nr,jt,Ya=C({"src/hidden.ts"(){"use strict";bt(),q(),Ir=[Ze()],jt=class extends(Nr=j){get type(){return"hidden"}getAttribute(e){return e==="invalid"||super.getAttribute(e)}},li=K(Nr),jt=X(li,0,"HiddenToken",Ir,jt),J(li,1,jt)}}),Lr,oi,Er,Pt,Za=C({"src/arg.ts"(){"use strict";var e,eu,s;ge(),M(),de(),Me(),Ss(),Fe(),W(),q(),ze(),Ya(),Lr=[Ie,je("{{{"),Vt()],Pt=(s=class extends(Er=j){constructor(n,r,l=[]){super(void 0,r,l,{});N(this,e);for(let o=0;o<n.length;o++){const u=n[o];if(o===0){const d=new xe(u,"arg-name",r,l,{});super.insertAt(d)}else if(o>1){const d=new jt(u,r,l);super.insertAt(d)}else{const d=new j(u,r,l);d.type="arg-default",d.setAttribute("stage",2),super.insertAt(d)}}}get type(){return"arg"}get default(){}toString(n){return`{{{${super.toString(n,"|")}}}}`}text(){return`{{{${Ke(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){super.afterBuild()}lint(n=this.getAbsoluteIndex(),r){{const{childNodes:[l,o,...u]}=this;l.setAttribute("aIndex",n+3);const d=l.lint(n+3,r);if(o){const p=n+4+l.toString().length;o.setAttribute("aIndex",p);const b=o.lint(p,r);b.length>0&&d.push(...b)}const a=["no-ignored","no-arg"],{lintConfig:h}=I,{computeEditInfo:g}=h,c=a.map(p=>h.getSeverity(p,"arg"));if(c[0]&&u.length>0){const p=new le(this,n);d.push(...u.map(b=>{const w=B(b,p,a[0],"invisible-triple-braces",c[0]);return w.startIndex--,w.startCol--,g&&(w.suggestions=[U(w),mt(w.startIndex,"{{!}}")]),w}))}if(c[1]&&!this.getAttribute("include")){const p=G(this,{start:n},a[1],"unexpected-argument",c[1]);g&&o&&(p.suggestions=[$e(p,"expand",o.text())]),d.push(p)}return d}}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(n,r=this.getAbsoluteIndex()){const l=super.json(void 0,r)}},e=new WeakSet,eu=function(){},s),oi=K(Er),Pt=X(oi,0,"ArgToken",Lr,Pt),J(oi,1,Pt)}}),co={};se(co,{parseBraces:()=>$s});var Fr,ai,ts,ui,di,hi,jr,ci,$s,xn=C({"parser/braces.ts"(){"use strict";Ye(),ge(),ao(),Ka(),Za(),Fr={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},ai=String.raw`\[(?!\[)`,ts=String.raw`\n(?![=\0])`,ui=String.raw`|\{{2,}`,di=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),hi=ht(e=>new RegExp(e,"gmu")),jr=new RegExp(String.raw`\{\{((?:[^\n{}[]|${ai}|${ts})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${ts})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${ai}|${ts})*\}-`,"gu"),ci=e=>{const t=pt(be(e));return di.has(t)?di.get(t):/^(?:filepath|(?:full|canonical)urle?):./u.test(t)?"m":/^#vardefine:./u.test(t)?"n":"t"},$s=(e,t,s)=>{var p,b,w,k,_;const i=String.raw`${t.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,n]}=t,r=[],l=[],o=(v,m,S,A)=>{m[m.length-1].push(Se(v.slice(S,A),l))};let u;do u!==void 0&&(e=u),u=e.replace(jr,(v,m,S)=>{if(m!==void 0||typeof S=="string")try{const{length:A}=s,x=(m!=null?m:S).split("|");return new lt(Se(x[0],l),x.slice(1).map(y=>{const T=y.indexOf("=");return(T===-1?[y]:[y.slice(0,T),y.slice(T+1)]).map($=>Se($,l))}),t,s),`\0${A}${ci(x[0])}`}catch(A){if(!(A instanceof SyntaxError)||A.message!=="Invalid template name")throw A}return l.push(Se(v,l)),`\0${l.length-1}`});while(u!==e);e=u;const d=e.lastIndexOf("}}")-e.length;let a=d+e.length!==-1,h=hi(i+(a?ui:"")),g=h.exec(e),c;for(;g||c!==void 0&&c<=e.length&&((b=(p=r[r.length-1])==null?void 0:p[0])!=null&&b.startsWith("="));){if(g!=null&&g[1]){const[,{length:P}]=g;g[0]=g[0].slice(P),g.index+=P}const{0:v,index:m}=g!=null?g:{0:`
|
|
8
|
-
`,index:e.length},
|
|
9
|
-
`){
|
|
10
|
-
`)||(e=`${e.slice(0,
|
|
11
|
-
)`:""}(\s*)$`,"u")),
|
|
12
|
-
`))!=null?
|
|
13
|
-
`),n=new Set(t.protocol.split("|")),r=ce;let l=!0,o=!1;for(const u of i){const d=u.trim();if(!(o||!d||d.startsWith("#"))){if(l){const a=u.indexOf("|"),h=a===-1?u:u.slice(0,a),{valid:g,ns:c}=this.normalizeTitle(h,0,{halfParsed:!0,temporary:!0});if(g&&c===6){const p=new ot("imagemap",h,a===-1?void 0:u.slice(a+1),t,s);super.insertAt(p),l=!1;continue}else o=!0}else if(u.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(u);continue}else if(u.includes("[")){const a=u.indexOf("["),h=u.slice(a),g=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(h);if(g){if(this.normalizeTitle(g[1],0,{halfParsed:!0,temporary:!0,selfLink:!0}).valid){super.insertAt(new Yi(u.slice(0,a),g.slice(1),h.slice(h.indexOf("]]")+2),t,s));continue}}else if(h.startsWith("[//")||n.has(h.slice(1,h.indexOf(":")+1))||n.has(h.slice(1,h.indexOf("//")+2))){const c=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(h);if(c){super.insertAt(new Yi(u.slice(0,a),c.slice(1),h.slice(h.indexOf("]")+1),t,s));continue}}}}super.insertAt(new r(u,t,s))}}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new le(this,e),{childNodes:n,image:r}=this,l="invalid-imagemap",{lintConfig:o}=I,u=o.getSeverity(l,r?"link":"image");return u&&(r?s.push(...n.filter(d=>{const a=d.toString().trim();return d.is("noinclude")&&a&&!a.startsWith("#")}).map(d=>{const a=B(d,i,l,"invalid-imagemap-link",u);return o.computeEditInfo&&(a.suggestions=[U(a,-1),$e(a,"comment","# ")]),a})):s.push(G(this,i,l,"imagemap-without-image",u))),s}}getAttribute(e){return e==="invalid"?!this.image:super.getAttribute(e)}},Si=K(Yr),Ot=X(Si,0,"ImagemapToken",Kr,Ot),J(Si,1,Ot)}}),Zr,ki,el,ut,To=C({"src/nowiki/comment.ts"(){"use strict";M(),bt(),Me(),W(),tt(),Zr=[Ze(!1),je("<!--")],ut=class extends(el=Te){constructor(t,s,i,n){super(t,i,n);Ee(this,"closed");this.closed=s}get type(){return"comment"}lint(t=this.getAbsoluteIndex()){{if(this.closed)return[];const s="unclosed-comment",{lintConfig:i}=I,n=i.getSeverity(s);if(!n)return[];const r=G(this,{start:t},s,"unclosed-comment",n);return i.computeEditInfo&&(r.suggestions=[qe(r.endIndex,"-->")]),[r]}}toString(t){return t?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"<!--",post:this.closed?"-->":""})}},ki=K(el),ut=X(ki,0,"CommentToken",Zr,ut),J(ki,1,ut)}}),Co={};se(Co,{CommentedToken:()=>Io});var Io,ou=C({"src/commented.ts"(){"use strict";q(),To(),Io=class extends j{get type(){return"ext-inner"}constructor(e,t,s=[]){if(super(void 0,t,s,{AstText:":",CommentToken:":"}),e){let i=e.indexOf("<!--"),n=i!==-1&&e.indexOf("-->",i+4),r=0;for(;n!==!1&&n!==-1;)i>r&&this.insertAt(e.slice(r,i)),this.insertAt(new ut(e.slice(i+4,n),!0,t,s)),r=n+3,i=e.indexOf("<!--",r),n=i!==-1&&e.indexOf("-->",i+4);r<e.length&&this.insertAt(e.slice(r))}}lint(e=this.getAbsoluteIndex()){return super.lint(e,new RegExp(String.raw`<\s*(?:\/\s*)?(${this.name})\b`,"giu"))}}}}),No={};se(No,{NowikiToken:()=>Lo});var tl,sl,Lo,au=C({"src/nowiki/index.ts"(){"use strict";var e,Zi,s;Ye(),M(),W(),tt(),tl=ht(i=>new RegExp(String.raw`<\s*(?:/\s*)${i==="nowiki"?"":"?"}(${i})\b`,"giu")),sl=new Set(["languages","section","templatestyles"]),Lo=(s=class extends Te{constructor(){super(...arguments);N(this,e)}get type(){return"ext-inner"}lint(n=this.getAbsoluteIndex()){{const{name:r}=this,l="void-ext",{lintConfig:o}=I,u=o.getSeverity(l,r);if(u&&R(this,e,Zi).call(this)){const d=G(this,{start:n},l,I.msg("nothing-in",r),u);return o.computeEditInfo&&(d.suggestions=[U(d)]),[d]}return super.lint(n,tl(r))}}getAttribute(n){return n==="invalid"?R(this,e,Zi).call(this):super.getAttribute(n)}},e=new WeakSet,Zi=function(){const{name:n,firstChild:{data:r}}=this;return sl.has(n)&&!!r},s)}}),il,Ai,nl,dt,Eo=C({"src/tagPair/ext.ts"(){"use strict";M(),de(),W(),pn(),q(),gn(),fn(),il=[ks()],dt=class extends(nl=Je){get type(){return"ext"}constructor(e,t,s,i,n=I.getConfig(),r=!1,l=[]){const o=e.toLowerCase(),u=new As(!t||/^\s/u.test(t)?t:` ${t}`,"ext-attrs",o,n,l),d=Le(me({},n),{ext:n.ext.filter(h=>h!==o),excludes:[...n.excludes],inExt:!0});let a;switch(o){case"tab":d.ext=d.ext.filter(h=>h!=="tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":case"langconvert":case"phonos":o==="poem"&&d.excludes.push("heading"),a=new j(s,d,l);break;case"pre":{const{PreToken:h}=(Ja(),Q(no));a=new h(s,d,l);break}case"dynamicpagelist":{const{ParamTagToken:h}=(oo(),Q(lo));a=new h(r,s,d,l);break}case"inputbox":{const{InputboxToken:h}=(tu(),Q(go));a=new h(r,s,d,l);break}case"references":{const{NestedToken:h}=(gi(),Q(cs));d.excludes.push("heading"),a=new h(s,r,["ref"],d,l);break}case"choose":{const{NestedToken:h}=(gi(),Q(cs));a=new h(s,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],d,l);break}case"combobox":{const{NestedToken:h}=(gi(),Q(cs));a=new h(s,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],d,l);break}case"gallery":{const{GalleryToken:h}=(iu(),Q(So));a=new h(s,d,l);break}case"imagemap":{const{ImagemapToken:h}=(lu(),Q($o));a=new h(s,d,l);break}case"hiero":{const{CommentedToken:h}=(ou(),Q(Co));a=new h(s,d,l);break}default:{const{NowikiToken:h}=(au(),Q(No));a=new h(s,d,l)}}a.setAttribute("name",o),a.type==="plain"&&(a.type="ext-inner"),super(e,u,a,i,n,l),this.seal("closed",!0)}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),{lintConfig:i}=I,n=new le(this,e);if(this.name!=="nowiki"){const o=this.inHtmlAttrs(),u="parsing-order",d=o&&i.getSeverity(u,o===2?"ext":"templateInTable");d&&s.push(G(this,n,u,"ext-in-html",d))}const r="var-anchor",l=i.getSeverity(r,"ref");return l&&this.name==="ref"&&this.closest("heading-title")&&s.push(G(this,n,r,"variable-anchor",l)),s}}},Ai=K(nl),dt=X(Ai,0,"ExtToken",il,dt),J(Ai,1,dt)}}),Fo={};se(Fo,{parseCommentAndExt:()=>Qt});var _i,rl,ss,ll,$i,Qt,Ts=C({"parser/commentAndExt.ts"(){"use strict";Ye(),ge(),Ha(),Ue(),Da(),Ga(),Eo(),To(),_i="<onlyinclude>",rl="</onlyinclude>",{length:ss}=_i,ll=[!1,!0].map(e=>{const t=e?"includeonly":"(?:no|only)include",s=e?"noinclude":"includeonly";return Ml(i=>new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${t}(?:\s[^>]*)?/?>|</${t}\s*>|<(${i.join("|")})(\s[^>]*?)?(?:/>|>([\s\S]*?)</(${"\\1"}\s*)>)|<(${s})(\s[^>]*?)?(?:/>|>([\s\S]*?)(?:</(${s}\s*)>|$))`,"giu"))}),$i=e=>{const t=e.indexOf(_i);return{i:t,j:e.indexOf(rl,t+ss)}},Qt=(e,t,s,i)=>{if(i){let{i:o,j:u}=$i(e);if(o!==-1&&u!==-1){let d="";const a=h=>{new ce(h,t,s),d+=`\0${s.length-1}n`};for(;o!==-1&&u!==-1;){const h=`\0${s.length}e`;new Et(e.slice(o+ss,u),t,s),o>0&&a(e.slice(0,o)),d+=h,e=e.slice(u+ss+1),{i:o,j:u}=$i(e)}return e&&a(e),d}}const{ext:n}=t,r=n.filter(o=>o!=="translate"&&o!=="tvar"),l=Le(me({},t),{ext:r});if(n.includes("translate")){const o=[];e=e.replace(/<nowiki>[\s\S]*?<\/nowiki>/giu,u=>(o.push(u),`\0${o.length-1}`)).replace(/<translate( nowrap)?>([\s\S]+?)?<\/translate>/gu,(u,d,a)=>{const h=s.length;return new Kl(d,a&&Se(a,o),l,s),`\0${h}g`}),e=Se(e,o)}return e.replace(ll[i?1:0](r),(o,u,d,a,h,g,c,p,b)=>{const w=s.length;let k="n";if(u)k="e",new dt(u,d,a,h,l,g,s);else if(o.startsWith("<!--")){k="c";const _=o.endsWith("-->");new ut(Se(o,s,1).slice(4,_?-3:void 0),_,t,s)}else g?new Ft(g,c&&Se(c,s,1),p&&Se(p,s,1),b,t,s):new ce(o,t,s);return`\0${w}${k}`})}}}),ol,al,ul,dl,Ti,hl,Bt,uu=C({"src/html.ts"(){"use strict";var e,t,s,i,n;M(),Ne(),de(),pn(),W(),q(),ol=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),al=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"]),ul=new Set(["strike","big","center","font","tt"]),dl=[ks()],Bt=(n=class extends(hl=j){constructor(l,o,u,d,a,h){super(void 0,a,h);N(this,e);N(this,t);N(this,s);N(this,i);this.insertAt(o),this.setAttribute("name",l.toLowerCase()),L(this,e,u),L(this,t,d),L(this,s,l)}get type(){return"html"}get selfClosing(){return f(this,t)}get closing(){return f(this,e)}toString(l){return`<${this.closing?"/":""}${f(this,s)}${super.toString(l)}${f(this,t)?"/":""}>`}text(){const{closing:l}=this,o=f(this,s)+(l?"":super.text());return`<${l?"/":""}${o}${f(this,t)?"/":""}>`}getAttribute(l){return l==="invalid"?this.inTableAttrs()===2:l==="padding"?f(this,s).length+(this.closing?2:1):super.getAttribute(l)}lint(l=this.getAbsoluteIndex(),o){var u;{const d=super.lint(l,o),{name:a,parentNode:h,closing:g,selfClosing:c}=this,p=new le(this,l),{lintConfig:b}=I,{computeEditInfo:w,fix:k}=b,_=this.inTableAttrs();let v="h1",m=b.getSeverity(v,"html");if(m&&a==="h1"&&!g){const $=G(this,p,v,"<h1>",m);w&&($.suggestions=[{desc:"h2",range:[l+2,l+3],text:"2"}]),d.push($)}if(v="parsing-order",m=_&&b.getSeverity(v,_===2?"html":"templateInTable"),m){const $=G(this,p,v,"html-in-table",m);w&&_===2&&($.suggestions=[U($)]),d.push($)}if(v="obsolete-tag",m=b.getSeverity(v,a),m&&ul.has(a)&&d.push(G(this,p,v,"obsolete-tag",m)),v="bold-header",m=b.getSeverity(v,a),m&&(a==="b"||a==="strong")&&((u=this.closest("heading-title,ext"))==null?void 0:u.type)==="heading-title"){const $=G(this,p,v,"bold-in-header",m);w&&($.suggestions=[U($)]),d.push($)}const{html:[,S,A]}=this.getAttribute("config"),x=A.includes(a),y=S.includes(a),T=!x&&!y;if(v="unmatched-tag",g&&(c||x)||c&&T){if(m=b.getSeverity(v,g?"both":"selfClosing"),m){const $=G(this,p,v,g?"closing-and-self-closing":"invalid-self-closing",m);if(w||k){const E=on(l),F={desc:I.msg("no-self-closing"),range:[$.endIndex-2,$.endIndex-1],text:""};y?w&&($.suggestions=[E,F]):g?$.fix=x?E:F:w&&($.suggestions=[F,qe($.endIndex,`></${a}>`,-2)])}d.push($)}}else if(!this.findMatchingTag()){const $=G(this,p,v,g?"unmatched-closing":"unclosed-tag"),E=this.closest("magic-word");if(E&&ol.has(E.name))m=b.getSeverity(v,"conditional");else if(g)m=b.getSeverity(v,"closing"),$.suggestions=[U($)];else{m=b.getSeverity(v,"opening");const F=h==null?void 0:h.childNodes;al.has(a)&&(F!=null&&F.slice(0,F.indexOf(this)).some(P=>P.type==="html"&&P.name===a&&!P.findMatchingTag())&&($.suggestions=[qe(l+1,"/")]),this.closest("heading-title")&&($.rule="format-leakage",m=b.getSeverity("format-leakage",a)))}m&&($.severity=m,d.push($))}return d}}findMatchingTag(){return Xe(f(this,i),()=>{const{name:l,parentNode:o,closing:u,selfClosing:d}=this,{html:[,a,h]}=this.getAttribute("config"),g=h.includes(l),c=a.includes(l);if(g||c&&d)return this;if(!o)return;const{childNodes:p}=o,b=p.indexOf(this),w=u?p.slice(0,b).reverse():p.slice(b+1),k=[this],{rev:_}=ke;for(const v of w)if(!(!v.is("html")||v.name!==l||c&&f(v,t)))if(f(v,e)===u)k.push(v);else{const m=k.pop();if(m===this)return v;I.viewOnly&&(L(m,i,[_,v]),L(v,i,[_,m]))}if(I.viewOnly)for(const v of k)L(v,i,[_,void 0])},l=>{L(this,i,l),l[1]&&l[1]!==this&&L(l[1],i,[ke.rev,this])})}print(){return super.print({pre:`<${this.closing?"/":""}${f(this,s)}`,post:`${f(this,t)?"/":""}>`})}json(l,o=this.getAbsoluteIndex()){const u=super.json(void 0,o)}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,n),Ti=K(hl),Bt=X(Ti,0,"HtmlToken",dl,Bt),J(Ti,1,Bt)}}),jo={};se(jo,{parseHtml:()=>Po});var cl,Po,du=C({"parser/html.ts"(){"use strict";fn(),uu(),cl=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,Po=(e,t,s)=>{var l;const{html:i}=t;(l=t.htmlElements)!=null||(t.htmlElements=new Set([...i[0],...i[1],...i[2]]));const n=e.split("<");let r=n.shift();for(const o of n){const u=cl.exec(o),d=u==null?void 0:u[2],a=d==null?void 0:d.toLowerCase();if(!u||!t.htmlElements.has(a)){r+=`<${o}`;continue}const[,h,,g="",c,p]=u,{length:b}=s,w=new As(g,"html-attrs",a,t,s),k=w.hasAttr("itemprop");if(a==="meta"&&!(k&&w.hasAttr("content"))||a==="link"&&!(k&&w.hasAttr("href"))){r+=`<${o}`,s.length=b;continue}r+=`\0${s.length}x${p}`,new Bt(d,w,h==="/",c==="/>",t,s)}return r}}}),yn,Ro=C({"src/table/base.ts"(){"use strict";pn(),q(),wt(),fn(),yn=class extends ks(1)(j){constructor(e,t,s,i,n,r=[],l){super(void 0,n,r,l),this.append(new et(t,"table-syntax",n,r),new As(i,"table-attrs",s,n,r))}escape(){}}}}),gl,Ci,_e,is,Tt,Ct,xs,Oo=C({"src/table/td.ts"(){"use strict";M(),de(),cn(),W(),q(),Ro(),xs=class extends(Ci=yn,gl=[ws(!1)],Ci){constructor(e,t,s,i=[]){var o;let n=/\||\0\d+!\x7F/u.exec(t!=null?t:""),r=n?t.slice(0,n.index):"";/\[\[|-\{/u.test(r)&&(n=null,r=""),super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",r,s,i),J(is,5,this),Re(this,Tt),Re(this,_e,""),n&&([ja(this,_e)._]=n);const l=new j(t==null?void 0:t.slice(((o=n==null?void 0:n.index)!=null?o:NaN)+he(this,_e).length),s,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 Ui(this,Tt,Ct).call(this).subtype}afterBuild(){he(this,_e).includes("\0")&&ye(this,_e,this.buildFromStr(he(this,_e),0)),super.afterBuild()}toString(e){const{childNodes:[t,s,i]}=this;return t.toString(e)+s.toString(e)+he(this,_e)+i.toString(e)}text(){const{childNodes:[e,t,s]}=this;return e.text()+t.text()+he(this,_e)+s.text()}getGaps(e){return e===1?he(this,_e).length:0}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new le(this,e+this.getRelativeIndex(this.length-1)),n="pipe-like",{lintConfig:r}=I,{computeEditInfo:l,fix:o}=r,u=["td","double"].map(d=>r.getSeverity(n,d));for(const d of this.lastChild.childNodes)if(d.type==="text"){const{data:a}=d;if(a.includes("|")){const h=a.includes("||"),g=u[h?1:0];if(g){const c=B(d,i,n,"pipe-in-table",g);if(l||o)if(h){const p={caption:"|+",td:"|",th:"!"}[this.subtype];c.fix=$e(c,"newline",a.replace(/\|\|/gu,`
|
|
14
|
-
${p}`))}else l&&(
|
|
15
|
-
`)}getAttr(e){const t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}escape(){}print(){const{childNodes:[e,t,s]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${he(this,_e)}${s.print()}</span>`}json(e,t=this.getAbsoluteIndex()){
|
|
16
|
-
|}`,t){const s=this.getAttribute("config"),i=this.getAttribute("accum");
|
|
6
|
+
`})}}}}),ao,iu=C({"src/paramLine.ts"(){"use strict";W(),ao=class extends E{get type(){return"param-line"}}}}),uo={};se(uo,{ParamTagToken:()=>vn});var vn,ho=C({"src/multiLine/paramTag.ts"(){"use strict";M(),de(),Cs(),B(),xn(),iu(),vn=class extends $s{constructor(e,t,s=I.getConfig(),i=[],r){super(void 0,s,i,{}),t&&this.append(...t.split(`
|
|
7
|
+
`).map(n=>r?n:Qt(n,s,i,e)).map(n=>new ao(n,s,i,{}))),i.splice(i.indexOf(this),1),i.push(this)}lint(e=this.getAbsoluteIndex()){{const t="no-ignored",{lintConfig:s}=I,i=s.getSeverity(t,this.name);if(!i)return[];const r=new le(this,e),n=I.msg("invalid-parameter",this.name),l=[];for(const o of this.childNodes){o.setAttribute("aIndex",e);const d=o.childNodes.filter(({type:u})=>u!=="comment"&&u!=="include"&&u!=="noinclude");if(d.some(({type:u})=>u==="ext"))l.push(q(o,r,t,n,i));else{const u=d.findIndex(({type:h})=>h!=="text"),a=d.slice(0,u===-1?void 0:u).map(String).join("");if(a&&!(u===-1?/^[a-z]+(?:\[\])?\s*=/iu:/^[a-z]+(?:\[\])?\s*(?:=|$)/iu).test(a)){const h=q(o,r,t,n,i);s.computeEditInfo&&(h.suggestions=[U(h)]),l.push(h)}else{const h=o.lint(e,!1);h.length>0&&l.push(...h)}}e+=o.toString().length+1}return l}}}}}),_r,ri,$r,lt,co=C({"src/heading.ts"(){"use strict";var e,t,ds,i;M(),Ce(),de(),Ee(),B(),W(),tt(),_r=[Ne],lt=(i=class extends($r=E){constructor(n,l,o,d=[]){super(void 0,o,d);N(this,t);N(this,e);L(this,e,n);const u=new E(l[0],o,d);u.type="heading-title",u.setAttribute("stage",2);const a=new Ue(l[1],"heading-trail",o,d);this.append(u,a)}get type(){return"heading"}get level(){return m(this,e)}toString(n){const l=P(this,t,ds).call(this);return l+this.firstChild.toString(n)+l+this.lastChild.toString(n)}text(){const n=P(this,t,ds).call(this);return n+this.firstChild.text()+n}getAttribute(n){return n==="invalid"?this.inHtmlAttrs()===2:n==="padding"?this.level:super.getAttribute(n)}getGaps(){return this.level}lint(n=this.getAbsoluteIndex(),l){{const o=super.lint(n,l),{firstChild:d,level:u}=this,a=d.toString(),h=a.startsWith("="),c=h||a.endsWith("="),g=new le(this,n),p=this.inHtmlAttrs(),v=["h1","unbalanced-header","format-leakage"],{lintConfig:x}=I,{computeEditInfo:b,fix:y}=x,S=v.map(w=>x.getSeverity(w,"apostrophe"));if(S[0]&&this.level===1){const w=q(d,g,v[0],"<h1>",S[0]);b&&!c&&(w.suggestions=[$e(w,"h2",`=${a}=`)]),o.push(w)}if(S[1]&&c){const w=I.msg("unbalanced-in-section-header",'"="'),A=q(d,g,v[1],w,S[1]);if(!(!b||a==="="))if(h){const[_]=/^=+/u.exec(a),f=u+_.length;A.suggestions=[{desc:`h${u}`,range:[A.startIndex,A.startIndex+_.length],text:""}],f<7&&A.suggestions.push({desc:`h${f}`,range:[A.endIndex,A.endIndex],text:_})}else{const _=/[^=](=+)$/u.exec(a)[1],f=u+_.length;A.suggestions=[{desc:`h${u}`,range:[A.endIndex-_.length,A.endIndex],text:""}],f<7&&A.suggestions.push({desc:`h${f}`,range:[A.startIndex,A.startIndex],text:_})}o.push(A)}if(p){const w="parsing-order",A=x.getSeverity(w,p===2?"heading":"templateInTable");A&&o.push(z(this,g,w,"header-in-html",A))}if(S[2]){const w=this.getRootNode().toString(),A=d.childNodes.filter(Is("quote")),_=A.filter(({bold:k})=>k),f=A.filter(({italic:k})=>k);if(_.length%2){const k=q(_[_.length-1],Le(fe({},g),{start:n+u,left:g.left+u}),v[2],I.msg("unbalanced-in-section-header","bold-apostrophes"),S[2]);if(b||y){const $=n+u+a.length,T=U(k);w.slice(k.endIndex,$).trim()?b&&(k.suggestions=[T,We($,"'''")]):_.length===1&&f.length===0?k.fix=T:b&&(k.suggestions=[T])}o.push(k)}if(f.length%2){const k=q(f[f.length-1],{start:n+u},v[2],I.msg("unbalanced-in-section-header","italic-apostrophes"),S[2]);if(b||y){const $=n+u+a.length;w.slice(k.endIndex,$).trim()?b&&(k.suggestions=[We($,"''")]):f.length===1&&_.length===0?k.fix=U(k):b&&(k.suggestions=[U(k)])}o.push(k)}}return o}}print(){const n=P(this,t,ds).call(this);return super.print({pre:n,sep:n})}json(n,l=this.getAbsoluteIndex()){}},e=new WeakMap,t=new WeakSet,ds=function(){return"=".repeat(this.level)},i),ri=Y($r),lt=X(ri,0,"HeadingToken",_r,lt),J(ri,1,lt)}}),Tr,go,nu=C({"src/parameter.ts"(){"use strict";ce(),M(),B(),W(),Tr=new RegExp(`https?://${pt}${ft}$`,"iu"),go=class extends E{get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){}constructor(e,t,s,i=[]){super(void 0,s,i);const r=new E(typeof e=="number"?void 0:e,s,i,{}),n=new E(t,s,i);r.type="parameter-key",r.setAttribute("stage",2),n.type="parameter-value",n.setAttribute("stage",2),this.append(r,n)}trimName(e,t=!0){const s=(typeof e=="string"?e:e.toString(!0)).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");return this.setAttribute("name",s),s}afterBuild(){if(!this.anon){const{parentNode:e,firstChild:t}=this,s=this.trimName(t);e&&e.getArgs(s,!1,!1).add(this)}super.afterBuild()}toString(e){return this.anon?this.lastChild.toString(e):super.toString(e,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(e=this.getAbsoluteIndex(),t){var s;{const i=super.lint(e,t),r="unescaped",{lintConfig:n}=I,l=n.getSeverity(r);if(l){const{firstChild:o}=this,d=(s=Tr.exec(o.text()))==null?void 0:s[0];try{if(d&&new URL(d).search){const u=q(o,{start:e},r,"unescaped-query",l);u.startIndex=u.endIndex,u.startLine=u.endLine,u.startCol=u.endCol,u.endIndex++,u.endCol++,(n.computeEditInfo||n.fix)&&(u.fix=vt(u.startIndex,"{{=}}")),i.push(u)}}catch(u){}}return i}}print(){return super.print({sep:this.anon?"":"="})}json(e,t=this.getAbsoluteIndex()){}}}}),Cr,li,Ir,ot,ru=C({"src/transclude.ts"(){"use strict";var e,t,s,i,r,n,hs,po,d;ce(),M(),Ce(),de(),ks(),Ee(),B(),W(),nu(),st(),tt(),Cr=[Ne,Vt()],ot=(d=class extends(Ir=E){constructor(a,h,c,g=[]){var T,F;let p;const v=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(a);v&&(p=Number(v[1]),a=a.replace(`\0${p}h`,g[p].toString().replace(/^\n/u,"")));super(void 0,c,g,{});N(this,n);Fe(this,"modifier","");N(this,e,"template");N(this,t,":");N(this,s,!1);N(this,i,new Map);N(this,r);const{parserFunction:[x,b],variable:y,functionHook:S}=c,w=(T=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(a))==null?void 0:T[0];if(w)this.setAttribute("modifier",w),a=a.slice(w.length);else if(a.includes(":")){const[j,...R]=a.split(":"),[ne]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((F=R[0])!=null?F:"");this.setModifier(`${j}:${ne}`)&&(a=R.join(":").slice(ne.length))}const A=a.search(/[::]/u),_=a[A]===":",f=A!==-1;if(f||h.length===0&&!m(this,s)){const j=f?a.slice(0,A):a,R=f&&a.slice(A+1),ne=ve(j),O=f?ne.slice(ne.search(/\S/u))+(_?":":""):ne.trim(),re=O.toLowerCase(),pe=Array.isArray(b),V=pe?b.includes(O):Object.prototype.hasOwnProperty.call(b,O),G=!pe&&V?b[O]:Object.prototype.hasOwnProperty.call(x,re)&&x[re],K=pe&&V||!("functionHook"in c)||S.includes(G),H=pe&&V||y.includes(G);if(f?G&&K:H){this.setAttribute("name",G||re.replace(/^#|:$/u,"")),L(this,e,"magic-word"),_&&L(this,t,":");const Z=new Ue(j,"magic-word-name",c,g);if(super.insertAt(Z),R!==!1&&h.unshift([R]),this.name==="invoke")for(let D=0;D<2;D++){const ee=h.shift();if(!ee)break;const oe=new xe(ee.join("="),`invoke-${D?"function":"module"}`,c,g);super.insertAt(oe)}}}if(this.type==="template"){const j=ve(a).trim();if(!this.normalizeTitle(j,10,{halfParsed:!0,temporary:!0}).valid)throw g.pop(),new SyntaxError("Invalid template name");const R=new xe(a,"template-name",c,g,{});super.insertAt(R)}typeof p=="number"&&(g[p]=void 0);const k=this.isTemplate();let $=1;for(let j=0;j<h.length;j++){const R=h[j];k||this.name==="switch"&&j>0||this.name==="tag"&&j>1||(R[0]=R.join("="),R.length=1),R.length===1&&(R.unshift($),$++),this.insertAt(new go(...R,c,g))}this.seal("modifier")}get type(){return m(this,e)}get module(){}get function(){}setModifier(a){const{parserFunction:[,,h,c]}=this.getAttribute("config"),g=ve(a).trim();if(a&&!g.endsWith(":"))return!1;const p=g.slice(0,-1).toLowerCase(),v=h.includes(p),x=c.includes(p);return m(this,s)&&v||!m(this,s)&&(x||!a)||(we.running||this.length>1)&&(v||x||!a)?(this.setAttribute("modifier",a),L(this,s,v),!!a):!1}isTemplate(){return this.type==="template"||this.name==="invoke"}afterBuild(){this.modifier.includes("\0")&&this.setAttribute("modifier",this.buildFromStr(this.modifier,0)),super.afterBuild(),this.isTemplate()&&this.type==="template"&&(L(this,r,P(this,n,hs).call(this)),this.setAttribute("name",m(this,r).title))}toString(a){const{childNodes:h,length:c,firstChild:g,modifier:p,type:v}=this;return`{{${p}${v==="magic-word"?g.toString(a)+(c===1?"":m(this,t))+h.slice(1).map(x=>x.toString(a)).join("|"):super.toString(a,"|")}}}`}text(){const{childNodes:a,length:h,firstChild:c,modifier:g,type:p,name:v}=this;return p==="magic-word"&&v==="vardefine"?"":`{{${g}${p==="magic-word"?c.text()+(h===1?"":m(this,t))+Ye(a.slice(1),"|"):super.text("|")}}}`}getAttribute(a){switch(a){case"padding":return this.modifier.length+2;case"title":return m(this,r);case"colon":return m(this,t);case"invalid":return this.type==="magic-word"&&this.name==="invoke"&&(this.length===2||!P(this,n,hs).call(this).valid);default:return super.getAttribute(a)}}lint(a=this.getAbsoluteIndex(),h){{const c=super.lint(a,h);if(!this.isTemplate())return c;const{type:g,childNodes:p,length:v}=this,x=new le(this,a),{lintConfig:b}=I,{computeEditInfo:y}=b,S=g==="magic-word";let w="no-ignored",A=b.getSeverity(w,"fragment");if(S&&!P(this,n,hs).call(this).valid)w="invalid-invoke",A=b.getSeverity(w,"name"),A&&c.push(q(p[1],x,w,"illegal-module",A));else if(A){const _=p[S?1:0],f=_.childNodes.findIndex($=>$.type==="text"&&ms($.data).includes("#")),k=_.childNodes[f];if(k){const $=q(_,x,w,"useless-fragment",A);y&&($.suggestions=[U($,_.getRelativeIndex(f)+k.data.indexOf("#"))]),c.push($)}}if(w="invalid-invoke",A=b.getSeverity(w,"function"),A&&S&&v===2)return c.push(z(this,x,w,"missing-function",A)),c;if(w="no-duplicate",A=b.getSeverity(w,"parameter"),A){const _=this.getDuplicatedArgs().filter(([,k])=>!k[0].querySelector("ext")),f="duplicate-parameter";for(const[,k]of _)c.push(...k.map($=>{const T=q($,x,w,f,A);return y&&(T.suggestions=[U(T,-1)]),T}))}return c}}insertAt(a,h=this.length){return super.insertAt(a,h),a.anon?P(this,n,po).call(this,a):a.name&&this.getArgs(a.name,!1,!1).add(a),a}getAllArgs(){return this.childNodes.filter(Is("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:a})=>a)}getArgs(a,h,c=!0){const g=String(a).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");let p;return m(this,i).has(g)?p=m(this,i).get(g):(p=new Set(this.getAllArgs().filter(({name:v})=>g===v)),m(this,i).set(g,p)),p}getDuplicatedArgs(){return[...m(this,i)].filter(([,{size:a}])=>a>1).map(([a,h])=>[a,[...h]])}getPossibleValues(){const{type:a,name:h,childNodes:c}=this;if(a==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let g,p;switch(h){case"if":case"ifexist":case"ifexpr":case"iferror":g=2;break;case"ifeq":g=3;break;case"switch":{const v=c.slice(2),x=v[v.length-1];p=[...v.filter(({anon:b})=>!b),...x!=null&&x.anon?[x]:[]].map(({lastChild:b})=>b);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}p!=null||(p=c.slice(g,g+2).map(({lastChild:v})=>v));for(let v=0;v<p.length;){const{length:x,0:b}=p[v].childNodes.filter(y=>y.text().trim());if(x===0)p.splice(v,1);else if(x>1||b.type!=="magic-word")v++;else try{const y=b.getPossibleValues();p.splice(v,1,...y),v+=y.length}catch(y){v++}}return p}print(){const{childNodes:a,length:h,firstChild:c,modifier:g,type:p}=this;return`<span class="wpb-${p}${this.getAttribute("invalid")?" wpb-invalid":""}">{{${p==="magic-word"?Ut(g)+c.print()+(h===1?"":m(this,t))+xt(a.slice(1),{sep:"|"}):(g?`<span class="wpb-magic-word">${Ut(g)}</span>`:"")+xt(a,{sep:"|"})}}}</span>`}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakMap,n=new WeakSet,hs=function(){const a=this.type==="template";return this.normalizeTitle(this.childNodes[a?0:1].text(),a?10:828,{temporary:!0})},po=function(a){const h=this.getAnonArgs(),c=typeof a!="number";for(let g=c?h.indexOf(a):a-1;g<h.length;g++){const p=h[g],{name:v}=p,x=String(g+1);(v!==x||p===a)&&(p.setAttribute("name",x),this.getArgs(x,!1,!1).add(p))}},d),li=Y(Ir),ot=X(li,0,"TranscludeToken",Cr,ot),J(li,1,ot)}}),Nr,oi,Lr,Rt,lu=C({"src/hidden.ts"(){"use strict";et(),W(),Nr=[ze()],Rt=class extends(Lr=E){get type(){return"hidden"}getAttribute(e){return e==="invalid"||super.getAttribute(e)}},oi=Y(Lr),Rt=X(oi,0,"HiddenToken",Nr,Rt),J(oi,1,Rt)}}),Fr,ai,Er,Ot,ou=C({"src/arg.ts"(){"use strict";var e,au,s;ce(),M(),de(),He(),ks(),Ee(),B(),W(),st(),lu(),Fr=[Ne,Pe("{{{"),Vt()],Ot=(s=class extends(Er=E){constructor(r,n,l=[]){super(void 0,n,l,{});N(this,e);for(let o=0;o<r.length;o++){const d=r[o];if(o===0){const u=new xe(d,"arg-name",n,l,{});super.insertAt(u)}else if(o>1){const u=new Rt(d,n,l);super.insertAt(u)}else{const u=new E(d,n,l);u.type="arg-default",u.setAttribute("stage",2),super.insertAt(u)}}}get type(){return"arg"}get default(){}toString(r){return`{{{${super.toString(r,"|")}}}}`}text(){return`{{{${Ye(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){super.afterBuild()}lint(r=this.getAbsoluteIndex(),n){{const{childNodes:[l,o,...d]}=this;l.setAttribute("aIndex",r+3);const u=l.lint(r+3,n);if(o){const v=r+4+l.toString().length;o.setAttribute("aIndex",v);const x=o.lint(v,n);x.length>0&&u.push(...x)}const a=["no-ignored","no-arg"],{lintConfig:h}=I,{computeEditInfo:c}=h,g=new le(this,r),p=a.map(v=>h.getSeverity(v,"arg"));if(p[0]&&d.length>0&&u.push(...d.map(v=>{const x=q(v,g,a[0],"invisible-triple-braces",p[0]);return x.startIndex--,x.startCol--,c&&(x.suggestions=[U(x),vt(x.startIndex,"{{!}}")]),x})),p[1]&&!this.getAttribute("include")){const v=z(this,g,a[1],"unexpected-argument",p[1]);c&&o&&(v.suggestions=[$e(v,"expand",o.text())]),u.push(v)}return u}}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(r,n=this.getAbsoluteIndex()){}},e=new WeakSet,au=function(){},s),ai=Y(Er),Ot=X(ai,0,"ArgToken",Fr,Ot),J(ai,1,Ot)}}),fo={};se(fo,{parseBraces:()=>Ts});var Pr,ui,ts,di,hi,ci,Rr,gi,Ts,bn=C({"parser/braces.ts"(){"use strict";Ze(),ce(),co(),ru(),ou(),Pr={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},ui=String.raw`\[(?!\[)`,ts=String.raw`\n(?![=\0])`,di=String.raw`|\{{2,}`,hi=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),ci=gt(e=>new RegExp(e,"gmu")),Rr=new RegExp(String.raw`\{\{((?:[^\n{}[]|${ui}|${ts})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${ts})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${ui}|${ts})*\}-`,"gu"),gi=e=>{const t=mt(ve(e));return hi.has(t)?hi.get(t):/^(?:filepath|(?:full|canonical)urle?):./u.test(t)?"m":/^#vardefine:./u.test(t)?"n":"t"},Ts=(e,t,s)=>{var p,v,x,b,y;const i=String.raw`${t.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,r]}=t,n=[],l=[],o=(S,w,A,_)=>{w[w.length-1].push(Se(S.slice(A,_),l))};let d;do d!==void 0&&(e=d),d=e.replace(Rr,(S,w,A)=>{if(w!==void 0||typeof A=="string")try{const{length:_}=s,f=(w!=null?w:A).split("|");return new ot(Se(f[0],l),f.slice(1).map(k=>{const $=k.indexOf("=");return($===-1?[k]:[k.slice(0,$),k.slice($+1)]).map(T=>Se(T,l))}),t,s),`\0${_}${gi(f[0])}`}catch(_){if(!(_ instanceof SyntaxError)||_.message!=="Invalid template name")throw _}return l.push(Se(S,l)),`\0${l.length-1}`});while(d!==e);e=d;const u=e.lastIndexOf("}}")-e.length;let a=u+e.length!==-1,h=ci(i+(a?di:"")),c=h.exec(e),g;for(;c||g!==void 0&&g<=e.length&&((v=(p=n[n.length-1])==null?void 0:p[0])!=null&&v.startsWith("="));){if(c!=null&&c[1]){const[,{length:R}]=c;c[0]=c[0].slice(R),c.index+=R}const{0:S,index:w}=c!=null?c:{0:`
|
|
8
|
+
`,index:e.length},A=(x=n.pop())!=null?x:{},{0:_,index:f,parts:k,findEqual:$,pos:T}=A,F=S==="="&&$;if(S==="]]"||S==="}-")g=w+2;else if(S===`
|
|
9
|
+
`){g=w+1;const{pos:R,findEqual:ne}=(b=n[n.length-1])!=null?b:{};if(R===void 0||ne||ve(e.slice(R,f))!==""){const O=/^(={1,6})(.+)\1((?:\s|\0\d+[cn]\x7F)*)$/u.exec(e.slice(f,w));O&&(O[2]=Se(O[2],l),O[2].includes(`
|
|
10
|
+
`)||(e=`${e.slice(0,f)}\0${s.length}h${e.slice(w)}`,g=f+4+String(s.length).length,new lt(O[1].length,O.slice(2),t,s)))}}else if(S==="|"||F)g=w+1,o(e,k,T,w),S==="|"&&k.push([]),A.pos=g,A.findEqual=S==="|",n.push(A);else if(S.startsWith("}}")){const R=S.slice(0,Math.min(_.length,3)),ne=_.length-R.length,{length:O}=s;g=w+R.length,o(e,k,T,w);let re=!1,pe="t";if(R.length===3){const V=k.map(K=>K.join("=")),G=V.length>1&&ve(V[1]).trim();new Ot(V,t,s),G&&G.endsWith(":")&&r.includes(G.slice(0,-1).toLowerCase())&&(pe="s")}else try{new ot(k[0][0],k.slice(1),t,s),pe=gi(k[0][0])}catch(V){if(V instanceof SyntaxError&&V.message==="Invalid template name")re=!0;else throw V}re||(e=`${e.slice(0,f+ne)}\0${O}${pe}${e.slice(g)}`,g=f+ne+3+String(O).length,ne>1?n.push({0:_.slice(0,ne),index:f,pos:f+ne,parts:[[]]}):ne===1&&e[f-1]==="-"&&n.push({0:"-{",index:f-1,pos:f+1,parts:[[]]}))}else g=w+S.length,S.startsWith("{")&&(c.pos=g,c.parts=[[]]),n.push(..."0"in A?[A]:[],c);let j=n[n.length-1];if(a&&u+e.length<g)for(a=!1;(y=j==null?void 0:j[0])!=null&&y.startsWith("{");)n.pop(),j=n[n.length-1];h=ci(i+(a?di:"")+(j?`|${Pr[j[0][0]]}${j.findEqual?"|=":""}`:"")),h.lastIndex=g,c=h.exec(e)}return Se(e,l)}}}),mo={};se(mo,{InputboxToken:()=>xo});var xo,uu=C({"src/multiLine/inputbox.ts"(){"use strict";Cs(),bn(),B(),ho(),xo=class extends vn{constructor(e,t,s=I.getConfig(),i=[]){const r=Symbol("InputboxToken"),n=s.excludes.includes("heading")?s:Le(fe({},s),{excludes:[...s.excludes,"heading"]}),{length:l}=i;i.push(r),t&&(t=Qt(t,n,i,e)),t&&(t=Ts(t,n,i)),i.splice(l,1),super(e,t,n,i,{})}}}}),cs={};se(cs,{NestedToken:()=>vo});var Or,Br,vo,pi=C({"src/nested.ts"(){"use strict";var e,t,s;M(),de(),Cs(),bn(),B(),W(),jo(),yt(),Or=new Set(["comment","include","arg","template","magic-word"]),Br=[!1,!0].map(i=>{const r=i?"includeonly":"noinclude";return new RegExp(String.raw`^(?:<${r}(?:\s[^>]*)?/?>|</${r}\s*>)$`,"iu")}),vo=(s=class extends E{constructor(r,n,l,o,d=[]){if(typeof n=="boolean"){const u=Symbol("NestedToken"),{length:a}=d;d.push(u),r&&(r=Qt(r,o,d,n)),r&&(r=Ts(r,o,d)),d.splice(a,1)}else r&&(r=r.replace(n,(u,a,h,c,g)=>{const p=`\0${d.length+1}e`;return new ht(a,h,c,g,o,!1,d),p}));r&&(r=r.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(u,a,h)=>(new ke(h,o,d),`${a}\0${d.length}n`)));super(r,o,d);N(this,e);N(this,t);L(this,e,[...l]),L(this,t,n)}get type(){return"ext-inner"}lint(r=this.getAbsoluteIndex(),n){{const l=super.lint(r,n),o="no-ignored",{lintConfig:d}=I,u=d.getSeverity(o,this.name);if(!u)return l;const a=new le(this,r),h=typeof m(this,t)=="boolean"?Br[m(this,t)?1:0]:/^<!--[\s\S]*-->$/u;return[...l,...this.childNodes.filter(c=>{const{type:g,name:p}=c;if(g==="ext")return!m(this,e).includes(p);if(Or.has(g))return!1;const v=c.toString().trim();return v&&!h.test(v)}).map(c=>{const g=q(c,a,o,I.msg("invalid-content",this.name),u);return d.computeEditInfo&&(g.suggestions=[U(g),an(g,c.toString())]),g})]}}},e=new WeakMap,t=new WeakMap,s)}});function jr(e,t,s,i,r){t=ve(t).trim();let n=t.replace(e==="link"?/\0\d+[tq]\x7F/gu:/\0\d+t\x7F/gu,"").trim();switch(e){case"width":return!n&&!!t||/^(?:\d+x?|\d*x\d+)(?:\s*px)?$/u.test(n);case"link":{if(n){if(bo(s.protocol).test(n))return wo(s.protocol).test(n)&&t;n.startsWith("[[")&&n.endsWith("]]")&&(n=n.slice(2,-2))}else return t;const l=I.normalizeTitle(n,0,!1,s,{halfParsed:i,decode:!0,selfLink:!0});return l.valid&&l}case"lang":return(r==="svg"||r==="svgz")&&!/[^a-z\d-]/u.test(n);case"alt":case"class":case"manualthumb":return!0;case"page":return(r==="djvu"||r==="djv"||r==="pdf")&&Number(n)>0;default:return!!n&&!isNaN(n)}}var bo,wo,qr,Wr,Mr,yo,du=C({"src/imageParameter.ts"(){"use strict";var e,t,So,r;Ze(),ce(),M(),Me(),Ce(),B(),W(),bo=gt(n=>new RegExp(String.raw`^(?:${n}|//|\0\d+m\x7F)`,"iu")),wo=gt(n=>new RegExp(String.raw`^(?:(?:${n}|//)${pt}|\0\d+m\x7F)${ft}$`,"iu")),qr=gt(n=>new RegExp(String.raw`^(\s*(?!\s))${n.replace("$1","(.*)")}${n.endsWith("$1")?`(?=$|
|
|
11
|
+
)`:""}(\s*)$`,"u")),Wr=new Set(["alt","link","lang","page","caption"]),Mr=n=>{if(n)n.startsWith("//")&&(n=`https:${n}`);else return n;return new URL(n).href},yo=(r=class extends E{constructor(l,o,d,u){var n=(...i)=>(super(...i),N(this,t),N(this,e,""),this);let a;const h=Object.entries(d.img).map(([g,p])=>[g,p,qr(g)]),c=h.find(([,g,p])=>(a=p.exec(l),a&&(a.length!==4||jr(g,a[2],d,!0,o)!==!1)));if(c&&a){a.length===3?(n(void 0,d,u),L(this,e,l)):(n(a[2],d,u,{}),L(this,e,a[1]+c[0]+a[3])),this.setAttribute("name",c[1]),c[1]==="alt"&&this.setAttribute("stage",be-1);return}n(l,d.excludes.includes("list")?d:Le(fe({},d),{excludes:[...d.excludes,"list"]}),u),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get type(){return"image-parameter"}get link(){{if(this.name!=="link")return;const l=super.text().trim();return we.run(()=>{const o=new E(l,this.getAttribute("config"));return o.parseOnce(0,this.getAttribute("include")).parseOnce(),/^\0\d+m\x7F/u.test(o.toString())?l:jr("link",l,this.getAttribute("config"))})}}afterBuild(){var l;(l=this.parentNode)!=null&&l.is("gallery-image")&&!Wr.has(this.name)&&this.setAttribute("name","invalid"),super.afterBuild()}toString(l){return m(this,e)?m(this,e).replace("$1",super.toString(l)):super.toString(l)}text(){return m(this,e)?m(this,e).replace("$1",super.text()).trim():super.text().trim()}isPlain(){return this.name==="caption"||this.name==="alt"}getAttribute(l){return l==="invalid"?this.name==="invalid":l==="padding"?Math.max(0,m(this,e).indexOf("$1")):super.getAttribute(l)}lint(l=this.getAbsoluteIndex(),o){{const d=super.lint(l,o),{lintConfig:u}=I,{computeEditInfo:a,fix:h}=u,{link:c,name:g}=this,p=g==="width"&&this.getValue();if(g==="invalid"||p&&p.endsWith("px")){const v="invalid-gallery",x=u.getSeverity(v,"parameter");if(x){const b=z(this,{start:l},v,"invalid-image-parameter",x);(a||h)&&(b.fix=p?U(b,0,p):U(b,-1)),d.push(b)}}else if(g==="link"){if(typeof c=="string"){const v="invalid-url",x=u.getSeverity(v);if(x&&!this.querySelector("magic-word"))try{Mr(c)}catch(b){d.push(z(this,{start:l},v,"invalid-url",x))}}else if(c.encoded){const v="url-encoding",x=u.getSeverity(v,"file");if(x){const b=z(this,{start:l},v,"unnecessary-encoding",x);(a||h)&&(b.fix=ln(b,this)),d.push(b)}}}return d}}getValue(){return this.name==="invalid"?this.text():P(this,t,So).call(this)||super.text()}print(){return m(this,e)?`<span class="wpb-image-parameter${this.name==="invalid"?" wpb-invalid":""}">${m(this,e).replace("$1",`<span class="wpb-image-caption">${xt(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}},e=new WeakMap,t=new WeakSet,So=function(){return m(this,e)&&!m(this,e).includes("$1")},r)}}),fi,zr,Ur,mi,xi,vi,Hr,bi,wn,ko=C({"src/link/file.ts"(){"use strict";M(),de(),B(),Ss(),du(),fi=new Map([["manualthumb","Thumb"],["frameless","Frameless"],["framed","Frame"],["thumbnail","Thumb"]]),zr=new Set(["arg"]),Ur=new Set(["template","magic-word"]),mi=new Set(["left","right","center","none"]),xi=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),vi=new Set(["tiff","tif","png","gif","jpg","jpeg","webp","xcf","pdf","svg","djvu"]),Hr=e=>{if(e===void 0)return[];const t=/-\{|\}-|\|/gu,s=[];let i=t.exec(e),r=0,n=0;for(;i;){const{0:l,index:o}=i;l!=="|"?r+=l==="-{"?1:-1:r===0&&(s.push(e.slice(n,o)),{lastIndex:n}=t),i=t.exec(e)}return s.push(e.slice(n)),s},bi=(e,t)=>e.filter(({childNodes:s})=>!s.some(i=>i.text().trim()&&t.has(i.type))),wn=class extends Be{get type(){return"file"}get extension(){}constructor(e,t,s,i=[],r="|"){super(e,void 0,s,i,r);const{extension:n}=this.getTitle(!0,!0);this.safeAppend(Hr(t).map(l=>new yo(l,n,s,i)))}lint(e=this.getAbsoluteIndex(),t){var s;{const i=super.lint(e,t),r=bi(this.getAllArgs(),zr),n=[...new Set(r.map(({name:_})=>_))],l=n.filter(_=>fi.has(_)),o=n.filter(_=>mi.has(_)),d=n.filter(_=>xi.has(_)),[u]=l,a=u==="framed"||u==="manualthumb",h=new le(this,e),{lintConfig:c}=I,{computeEditInfo:g,fix:p}=c,{ns:v,extension:x}=this.getAttribute("title"),{firstChild:b}=this;let y="nested-link",S=c.getSeverity(y,"file");if(S&&vi.has(x)&&this.closest("ext-link-text")&&((s=this.getValue("link"))==null?void 0:s.trim())!==""){const _=z(this,h,y,"link-in-extlink",S);if(g||p){const f=this.getArg("link");if(f){const k=e+f.getRelativeIndex();_.fix={desc:I.msg("delink"),range:[k,k+f.toString().length],text:"link="}}else _.fix=ws(_.endIndex-2,"delink","|link=")}i.push(_)}if(y="invalid-gallery",S=c.getSeverity(y,"extension"),S&&v===6&&!x&&!b.querySelector("arg,magic-word,template")&&i.push(z(this,h,y,"missing-extension",S)),S=c.getSeverity(y,"parameter"),S&&a)for(const _ of r.filter(({name:f})=>f==="width")){const f=q(_,h,y,"invalid-image-parameter",S);(g||p)&&(f.fix=U(f,-1)),i.push(f)}if(r.length===n.length&&l.length<2&&o.length<2&&d.length<2)return i;y="no-duplicate";const w=["unknownImageParameter","imageParameter"].map(_=>c.getSeverity(y,_)),A=(_,f,k,$=!0)=>_.map(T=>{if(S=w[Number(typeof $=="function"?$(T):$)],!S)return!1;const F=q(T,h,y,I.msg(`${f}-image-parameter`,k),S);return g&&(F.suggestions=[U(F,-1)]),F}).filter(T=>T!==!1);for(const _ of n){if(_==="invalid"||_==="width"&&a)continue;const f=_==="caption";let k=r.filter(({name:$})=>$===_);if(f&&(k=[...k.slice(0,-1).filter($=>$.text()),...k.slice(-1)]),k.length>1){let $=!f||!x||vi.has(x);if(f&&$){const T=bi(k,Ur);$=T.length>1&&(F=>T.includes(F))}i.push(...A(k,"duplicate",_,$))}}return l.length>1&&i.push(...A(r.filter(({name:_})=>fi.has(_)),"conflicting","frame")),o.length>1&&i.push(...A(r.filter(({name:_})=>mi.has(_)),"conflicting","horizontal-alignment")),d.length>1&&i.push(...A(r.filter(({name:_})=>xi.has(_)),"conflicting","vertical-alignment")),i}}getAllArgs(){return this.childNodes.slice(1)}getArgs(e){return this.getAllArgs().filter(({name:t})=>e===t)}getArg(e){{const t=this.getArgs(e);return t[e==="manualthumb"?0:t.length-1]}}getValue(e){var t;return(t=this.getArg(e))==null?void 0:t.getValue()}json(e,t=this.getAbsoluteIndex()){}}}}),Dr,wi,Gr,at,Ao=C({"src/link/galleryImage.ts"(){"use strict";var e,Xi,s;M(),Me(),He(),B(),W(),ko(),Dr=[Pe("")],at=(s=class extends(Gr=wn){constructor(r,n,l,o,d=[]){let u;if(l!==void 0){const{length:a}=d;u=new E(l,o,d);for(let h=0;h<be-1;h++)u.parseOnce();d.splice(a,1)}super(n,u==null?void 0:u.toString(),o,d);N(this,e);Fe(this,"privateType","imagemap-image");this.setAttribute("bracket",!1),this.privateType=`${r}-image`,this.seal("privateType",!0)}get type(){return this.privateType}getTitle(r){const n=this.type==="imagemap-image";return this.normalizeTitle(this.firstChild.toString(),n?0:6,{halfParsed:!0,temporary:r,decode:!n})}lint(r=this.getAbsoluteIndex(),n){{const l=super.lint(r,n),o="invalid-gallery",{lintConfig:d}=I,u=d.getSeverity(o,"image");if(u&&P(this,e,Xi).call(this)){const a=z(this,{start:r},o,"invalid-gallery",u);d.computeEditInfo&&(a.suggestions=[ws(r,"prefix","File:")]),l.push(a)}return l}}getAttribute(r){return r==="invalid"?P(this,e,Xi).call(this):super.getAttribute(r)}},e=new WeakSet,Xi=function(){const{ns:r}=this.getAttribute("title");return r!==6},s),wi=Y(Gr),at=X(wi,0,"GalleryImageToken",Dr,at),J(wi,1,at)}}),xs,_o=C({"src/nowiki/commentLine.ts"(){"use strict";yt(),xs=class extends ke{}}}),$o={};se($o,{GalleryToken:()=>To});var To,hu=C({"src/multiLine/gallery.ts"(){"use strict";var e,Co,cu,i;M(),B(),xn(),Ao(),_o(),To=(i=class extends $s{constructor(n,l,o=[]){var d;super(void 0,l,o,{});N(this,e);for(const u of(d=n==null?void 0:n.split(`
|
|
12
|
+
`))!=null?d:[]){const a=/^([^|]+)(?:\|(.*))?/u.exec(u);if(!a){super.insertAt(u.trim()?new xs(u,l,o):u);continue}const[,h,c]=a;P(this,e,Co).call(this,h)?super.insertAt(new at("gallery",h,c,l,o)):super.insertAt(new xs(u,l,o))}}get widths(){}get heights(){}lint(n=this.getAbsoluteIndex(),l){{const{top:o,left:d}=this.getRootNode().posFromIndex(n),u=[],a="no-ignored",{lintConfig:h}=I,c=["Image","NoImage","Comment"].map(g=>h.getSeverity(a,`gallery${g}`));for(let g=0;g<this.length;g++){const p=this.childNodes[g],v=p.toString(),{length:x}=v,b=v.trim(),{type:y}=p,S=o+g,w=g?0:d;if(p.setAttribute("aIndex",n),y==="noinclude"&&b&&!/^<!--.*-->$/u.test(b)){let[A]=c;if(b.startsWith("|")?[,A]=c:(b.startsWith("<!--")||b.endsWith("-->"))&&([,,A]=c),A){const _=n+x,f={rule:a,message:I.msg("invalid-content","gallery"),severity:A,startIndex:n,endIndex:_,startLine:S,endLine:S,startCol:w,endCol:w+x};h.computeEditInfo&&(f.suggestions=[U(f),an(f,v)]),u.push(f)}}else if(y!=="noinclude"&&y!=="text"){const A=p.lint(n,l);A.length>0&&u.push(...A)}n+=x+1}return u}}json(n,l=this.getAbsoluteIndex()){}},e=new WeakSet,Co=function(n){return this.normalizeTitle(n,6,{halfParsed:!0,temporary:!0,decode:!0}).valid},cu=function(n){},i)}}),yn,Io=C({"src/link/index.ts"(){"use strict";Ze(),M(),B(),Ss(),yn=class extends Be{get type(){return"link"}get innerText(){return this.length>1?this.lastChild.text():Ht(this.firstChild.text().replace(/^\s*:?/u,""))}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i="nested-link",{lintConfig:r}=I,n=r.getSeverity(i);if(n&&this.closest("ext-link-text")){const l=z(this,{start:e},i,"link-in-extlink",n);(r.computeEditInfo||r.fix)&&(l.fix=$e(l,"delink",this.innerText)),s.push(l)}return s}}}}}),Vr,Qr,Gt,Sn=C({"src/magicLink.ts"(){"use strict";var e,t,Ki,i;M(),ce(),de(),B(),W(),Vr=String.raw`(?:[${qe}\t]| |�*160;|&#[xX]0*[aA]0;)`,Qr=new RegExp(`${Vr}+`,"gu"),Gt=(i=class extends E{constructor(n,l="free-ext-link",o=I.getConfig(),d){super(n,o,d,{});N(this,t);N(this,e);L(this,e,l)}get type(){return m(this,e)}get innerText(){const n=new Map([["!","|"],["=","="]]);let l=Ye(this.childNodes.map(o=>{const{type:d}=o,u=String(o.name);return d==="magic-word"&&n.has(u)?n.get(u):o}));return this.type==="magic-link"&&(l=l.replace(Qr," ")),l}get link(){const{innerText:n}=this;return this.type==="magic-link"?n.startsWith("ISBN")?`ISBN ${n.slice(5).replace(/[- ]/gu,"").replace(/x$/u,"X")}`:n:ql(n).replace(/\n/gu,"%0A")}lint(n=this.getAbsoluteIndex(),l){{const o=super.lint(n,l),d=new le(this,n),{lintConfig:u}=I,{type:a,childNodes:h}=this;if(a==="magic-link"){const v="invalid-isbn",x=u.getSeverity(v);return x&&P(this,t,Ki).call(this)&&o.push(z(this,d,v,"invalid-isbn",x)),o}let c="invalid-url",g=u.getSeverity(c);if(g&&!this.querySelector("magic-word"))try{this.getUrl()}catch(v){o.push(z(this,d,c,"invalid-url",g))}const p=a==="ext-link-url";if(c="unterminated-url",g=u.getSeverity(c,p?"pipe":"punctuation"),g){const v=p?/\|/u:/[,;。:!?()]+/u,x=h.find(b=>b.type==="text"&&v.test(b.data));if(x){const{data:b}=x,y=q(x,d,c,I.msg("in-url",p?'"|"':"full-width-punctuation"),g);if(u.computeEditInfo){const{index:S,0:w}=v.exec(b),A=y.startIndex+S;y.suggestions=p?[Dt(A,1)]:[Dt(A),{desc:I.msg("encode"),range:[A,A+w.length],text:encodeURI(w)}]}o.push(y)}}return o}}getUrl(n){this.lspError("MagicLinkToken.getUrl")}getAttribute(n){return n==="invalid"?P(this,t,Ki).call(this):super.getAttribute(n)}},e=new WeakMap,t=new WeakSet,Ki=function(){if(this.type==="magic-link"){const{link:n}=this;if(n.startsWith("ISBN")){const l=[...n.slice(5)].map(o=>o==="X"?10:Number(o));return l.length===10?l.reduce((o,d,u)=>o+d*(10-u),0)%11!==0:l.length===13&&(l[12]===10||l.reduce((o,d,u)=>o+d*(u%2?3:1),0)%10!==0)}}return!1},i)}}),Jr,yi,Xr,ut,No=C({"src/extLink.ts"(){"use strict";var e,t;Me(),M(),He(),B(),W(),Sn(),Jr=[Pe("[")],ut=(t=class extends(Xr=E){constructor(i,r="",n="",l,o=[]){super(void 0,l,o,{});N(this,e);const d=i&&/^\0\d+f\x7F$/u.test(i)?o[Number(i.slice(1,-2))]:new Gt(i,"ext-link-url",l,o);if(this.insertAt(d),L(this,e,r),n){const u=new E(n,l,o,{});u.type="ext-link-text",u.setAttribute("stage",be-1),this.insertAt(u)}}get type(){return"ext-link"}toString(i){return this.length===1?`[${super.toString(i)}${m(this,e)}]`:`[${super.toString(i,m(this,e))}]`}text(){return`[${super.text(" ")}]`}getGaps(){return m(this,e).length}lint(i=this.getAbsoluteIndex(),r){{const n=super.lint(i,r),l="var-anchor",o=I.lintConfig.getSeverity(l,"extLink");return o&&this.length===1&&this.closest("heading-title")&&n.push(z(this,{start:i},l,"variable-anchor",o)),n}}print(){return super.print(this.length===1?{pre:"[",post:`${m(this,e)}]`}:{pre:"[",sep:m(this,e),post:"]"})}},e=new WeakMap,t),yi=Y(Xr),ut=X(yi,0,"ExtLinkToken",Jr,ut),J(yi,1,ut)}}),Yi,gu=C({"src/imagemapLink.ts"(){"use strict";W(),yt(),Io(),No(),Yi=class extends E{get type(){return"imagemap-link"}constructor(e,t,s,i,r=[]){super(void 0,i,r),this.append(e,t.length===2?new yn(...t,i,r):new ut(...t,i,r),new ke(s,i,r))}}}}),Lo={};se(Lo,{ImagemapToken:()=>Fo});var Fo,pu=C({"src/multiLine/imagemap.ts"(){"use strict";M(),Ce(),de(),B(),xn(),_o(),Ao(),gu(),Fo=class extends $s{get image(){return this.childNodes.find(Is("imagemap-image"))}constructor(e,t=I.getConfig(),s=[]){if(super(void 0,t,s,{}),!e)return;const i=e.split(`
|
|
13
|
+
`),r=new Set(t.protocol.split("|"));let n=!0,l=!1;for(const o of i){const d=o.trim();if(!(l||!d||d.startsWith("#"))){if(n){const u=o.indexOf("|"),a=u===-1?o:o.slice(0,u),{valid:h,ns:c}=this.normalizeTitle(a,0,{halfParsed:!0,temporary:!0});if(h&&c===6){const g=new at("imagemap",a,u===-1?void 0:o.slice(u+1),t,s);super.insertAt(g),n=!1;continue}else l=!0}else if(o.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(o);continue}else if(o.includes("[")){const u=o.indexOf("["),a=o.slice(u),h=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(a);if(h){if(this.normalizeTitle(h[1],0,{halfParsed:!0,temporary:!0,selfLink:!0}).valid){super.insertAt(new Yi(o.slice(0,u),h.slice(1),a.slice(a.indexOf("]]")+2),t,s));continue}}else if(a.startsWith("[//")||r.has(a.slice(1,a.indexOf(":")+1))||r.has(a.slice(1,a.indexOf("//")+2))){const c=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(a);if(c){super.insertAt(new Yi(o.slice(0,u),c.slice(1),a.slice(a.indexOf("]")+1),t,s));continue}}}}super.insertAt(new xs(o,t,s))}}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new le(this,e),{childNodes:r,image:n}=this,l="invalid-imagemap",{lintConfig:o}=I,d=o.getSeverity(l,n?"link":"image");return d&&(n?s.push(...r.filter(u=>{const a=u.toString().trim();return u.is("noinclude")&&a&&!a.startsWith("#")}).map(u=>{const a=q(u,i,l,"invalid-imagemap-link",d);return o.computeEditInfo&&(a.suggestions=[U(a,-1),$e(a,"comment","# ")]),a})):s.push(z(this,i,l,"imagemap-without-image",d))),s}}getAttribute(e){return e==="invalid"?!this.image:super.getAttribute(e)}}}}),Kr,Si,Yr,dt,Eo=C({"src/nowiki/comment.ts"(){"use strict";M(),et(),He(),B(),it(),Kr=[ze(!1),Pe("<!--")],dt=class extends(Yr=Te){constructor(t,s,i,r){super(t,i,r);Fe(this,"closed");this.closed=s}get type(){return"comment"}lint(t=this.getAbsoluteIndex()){{if(this.closed)return[];const s="unclosed-comment",{lintConfig:i}=I,r=i.getSeverity(s);if(!r)return[];const n=z(this,{start:t},s,"unclosed-comment",r);return i.computeEditInfo&&(n.suggestions=[We(n.endIndex,"-->")]),[n]}}toString(t){return t?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"<!--",post:this.closed?"-->":""})}},Si=Y(Yr),dt=X(Si,0,"CommentToken",Kr,dt),J(Si,1,dt)}}),Po={};se(Po,{CommentedToken:()=>Ro});var Ro,fu=C({"src/commented.ts"(){"use strict";W(),Eo(),Ro=class extends E{get type(){return"ext-inner"}constructor(e,t,s=[]){if(super(void 0,t,s,{AstText:":",CommentToken:":"}),e){let i=e.indexOf("<!--"),r=i!==-1&&e.indexOf("-->",i+4),n=0;for(;r!==!1&&r!==-1;)i>n&&this.insertAt(e.slice(n,i)),this.insertAt(new dt(e.slice(i+4,r),!0,t,s)),n=r+3,i=e.indexOf("<!--",n),r=i!==-1&&e.indexOf("-->",i+4);n<e.length&&this.insertAt(e.slice(n))}}lint(e=this.getAbsoluteIndex()){return super.lint(e,new RegExp(String.raw`<\s*(?:\/\s*)?(${this.name})\b`,"giu"))}}}}),Oo={};se(Oo,{NowikiToken:()=>Bo});var Zr,el,Bo,mu=C({"src/nowiki/index.ts"(){"use strict";var e,Zi,s;Ze(),M(),B(),it(),Zr=gt(i=>new RegExp(String.raw`<\s*(?:/\s*)${i==="nowiki"?"":"?"}(${i})\b`,"giu")),el=new Set(["languages","section","templatestyles"]),Bo=(s=class extends Te{constructor(){super(...arguments);N(this,e)}get type(){return"ext-inner"}lint(r=this.getAbsoluteIndex()){{const{name:n}=this,l="void-ext",{lintConfig:o}=I,d=o.getSeverity(l,n);if(d&&P(this,e,Zi).call(this)){const u=z(this,{start:r},l,I.msg("nothing-in",n),d);return o.computeEditInfo&&(u.suggestions=[U(u)]),[u]}return super.lint(r,Zr(n))}}getAttribute(r){return r==="invalid"?P(this,e,Zi).call(this):super.getAttribute(r)}},e=new WeakSet,Zi=function(){const{name:r,firstChild:{data:n}}=this;return el.has(r)&&!!n},s)}}),tl,ki,sl,ht,jo=C({"src/tagPair/ext.ts"(){"use strict";M(),de(),B(),fn(),W(),gn(),mn(),tl=[As()],ht=class extends(sl=Xe){get type(){return"ext"}constructor(e,t,s,i,r=I.getConfig(),n=!1,l=[]){const o=e.toLowerCase(),d=new _s(!t||/^\s/u.test(t)?t:` ${t}`,"ext-attrs",o,r,l),u=Le(fe({},r),{ext:r.ext.filter(h=>h!==o),excludes:[...r.excludes],inExt:!0});let a;switch(o){case"tab":u.ext=u.ext.filter(h=>h!=="tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":case"langconvert":case"phonos":o==="poem"&&u.excludes.push("heading"),a=new E(s,u,l);break;case"pre":{const{PreToken:h}=(su(),Q(lo));a=new h(s,u,l);break}case"dynamicpagelist":{const{ParamTagToken:h}=(ho(),Q(uo));a=new h(n,s,u,l);break}case"inputbox":{const{InputboxToken:h}=(uu(),Q(mo));a=new h(n,s,u,l);break}case"references":{const{NestedToken:h}=(pi(),Q(cs));u.excludes.push("heading"),a=new h(s,n,["ref"],u,l);break}case"choose":{const{NestedToken:h}=(pi(),Q(cs));a=new h(s,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],u,l);break}case"combobox":{const{NestedToken:h}=(pi(),Q(cs));a=new h(s,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],u,l);break}case"gallery":{const{GalleryToken:h}=(hu(),Q($o));a=new h(s,u,l);break}case"imagemap":{const{ImagemapToken:h}=(pu(),Q(Lo));a=new h(s,u,l);break}case"hiero":{const{CommentedToken:h}=(fu(),Q(Po));a=new h(s,u,l);break}default:{const{NowikiToken:h}=(mu(),Q(Oo));a=new h(s,u,l)}}a.setAttribute("name",o),a.type==="plain"&&(a.type="ext-inner"),super(e,d,a,i,r,l),this.seal("closed",!0)}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),{lintConfig:i}=I,r=new le(this,e);if(this.name!=="nowiki"){const n=this.inHtmlAttrs(),l="parsing-order",o=n&&i.getSeverity(l,n===2?"ext":"templateInTable");o&&s.push(z(this,r,l,"ext-in-html",o))}if(this.name==="ref"){let n="var-anchor",l=i.getSeverity(n,"ref");l&&this.closest("heading-title")&&s.push(z(this,r,n,"variable-anchor",l)),n="nested-link",l=i.getSeverity(n,"ref"),l&&this.closest("link,ext-link-text")&&s.push(z(this,r,n,"ref-in-link",l))}return s}}},ki=Y(sl),ht=X(ki,0,"ExtToken",tl,ht),J(ki,1,ht)}}),qo={};se(qo,{parseCommentAndExt:()=>Qt});var Ai,il,ss,nl,_i,Qt,Cs=C({"parser/commentAndExt.ts"(){"use strict";Ze(),ce(),Xa(),yt(),Ya(),Za(),jo(),Eo(),Ai="<onlyinclude>",il="</onlyinclude>",{length:ss}=Ai,nl=[!1,!0].map(e=>{const t=e?"includeonly":"(?:no|only)include",s=e?"noinclude":"includeonly";return Ml(i=>new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${t}(?:\s[^>]*)?/?>|</${t}\s*>|<(${i.join("|")})(\s[^>]*?)?(?:/>|>([\s\S]*?)</(${"\\1"}\s*)>)|<(${s})(\s[^>]*?)?(?:/>|>([\s\S]*?)(?:</(${s}\s*)>|$))`,"giu"))}),_i=e=>{const t=e.indexOf(Ai);return{i:t,j:e.indexOf(il,t+ss)}},Qt=(e,t,s,i)=>{if(i){let{i:o,j:d}=_i(e);if(o!==-1&&d!==-1){let u="";const a=h=>{new ke(h,t,s),u+=`\0${s.length-1}n`};for(;o!==-1&&d!==-1;){const h=`\0${s.length}e`;new Et(e.slice(o+ss,d),t,s),o>0&&a(e.slice(0,o)),u+=h,e=e.slice(d+ss+1),{i:o,j:d}=_i(e)}return e&&a(e),u}}const{ext:r}=t;let n=r,l=t;if(r.includes("translate")){n=r.filter(d=>d!=="translate"&&d!=="tvar"),l=Le(fe({},t),{ext:n});const o=[];e=e.replace(/<nowiki>[\s\S]*?<\/nowiki>/giu,d=>(o.push(d),`\0${o.length-1}`)).replace(/<translate( nowrap)?>([\s\S]+?)?<\/translate>/gu,(d,u,a)=>{const h=s.length;return new Yl(u,a&&Se(a,o),l,s),`\0${h}g`}),e=Se(e,o)}return e.replace(nl[i?1:0](n),(o,d,u,a,h,c,g,p,v)=>{const x=s.length;let b="n";if(d)b="e",new ht(d,u,a,h,l,c,s);else if(o.startsWith("<!--")){b="c";const y=o.endsWith("-->");new dt(Se(o,s,1).slice(4,y?-3:void 0),y,t,s)}else c?new Pt(c,g&&Se(g,s,1),p&&Se(p,s,1),v,t,s):new ke(o,t,s,!0);return`\0${x}${b}`})}}}),rl,ll,ol,al,$i,ul,Bt,xu=C({"src/tag/html.ts"(){"use strict";var e,t;M(),de(),fn(),B(),Kl(),rl=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),ll=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"]),ol=new Set(["strike","big","center","font","tt"]),al=[As()],Bt=(t=class extends(ul=pn){constructor(i,r,n,l,o,d){super(i,r,n,o,d);N(this,e);this.setAttribute("name",i.toLowerCase()),L(this,e,l)}get type(){return"html"}get selfClosing(){return m(this,e)}text(){const{closing:i,selfClosing:r,name:n}=this,{html:[,,l]}=this.getAttribute("config");return l.includes(n)?i&&n!=="br"?"":super.text("/"):super.text(r&&!i?"/":"")}lint(i=this.getAbsoluteIndex(),r){var n;{const l=super.lint(i,r),{name:o,parentNode:d,closing:u,selfClosing:a}=this,h=new le(this,i),{lintConfig:c}=I,{computeEditInfo:g,fix:p}=c,v=this.inTableAttrs();let x="h1",b=c.getSeverity(x,"html");if(b&&o==="h1"&&!u){const f=z(this,h,x,"<h1>",b);g&&(f.suggestions=[{desc:"h2",range:[i+2,i+3],text:"2"}]),l.push(f)}if(x="parsing-order",b=v&&c.getSeverity(x,v===2?"html":"templateInTable"),b){const f=z(this,h,x,"html-in-table",b);g&&v===2&&(f.suggestions=[U(f)]),l.push(f)}if(x="obsolete-tag",b=c.getSeverity(x,o),b&&ol.has(o)&&l.push(z(this,h,x,"obsolete-tag",b)),x="bold-header",b=c.getSeverity(x,o),b&&(o==="b"||o==="strong")&&((n=this.closest("heading-title,ext"))==null?void 0:n.type)==="heading-title"){const f=z(this,h,x,"bold-in-header",b);g&&(f.suggestions=[U(f)]),l.push(f)}const{html:[,y,S]}=this.getAttribute("config"),w=S.includes(o),A=y.includes(o),_=!w&&!A;if(x="unmatched-tag",u&&(a||w)||a&&_){if(b=c.getSeverity(x,u?"both":"selfClosing"),b){const f=z(this,h,x,u?"closing-and-self-closing":"invalid-self-closing",b);if(g||p){const k=on(i),$={desc:I.msg("no-self-closing"),range:[f.endIndex-2,f.endIndex-1],text:""};A?g&&(f.suggestions=[k,$]):u?f.fix=w?k:$:g&&(f.suggestions=[$,We(f.endIndex,`></${o}>`,-2)])}l.push(f)}}else if(!this.findMatchingTag()){const f=z(this,h,x,u?"unmatched-closing":"unclosed-tag"),k=this.closest("magic-word");if(k&&rl.has(k.name))b=c.getSeverity(x,"conditional");else if(u)b=c.getSeverity(x,"closing"),f.suggestions=[U(f)];else{b=c.getSeverity(x,"opening");const $=d==null?void 0:d.childNodes;ll.has(o)&&($!=null&&$.slice(0,$.indexOf(this)).some(T=>T.type==="html"&&T.name===o&&!T.findMatchingTag())&&(f.suggestions=[We(i+1,"/")]),this.closest("heading-title")&&(f.rule="format-leakage",b=c.getSeverity("format-leakage",o)))}b&&(f.severity=b,l.push(f))}return l}}getAttribute(i){return i==="invalid"?this.inTableAttrs()===2:super.getAttribute(i)}json(i,r=this.getAbsoluteIndex()){}},e=new WeakMap,t),$i=Y(ul),Bt=X($i,0,"HtmlToken",al,Bt),J($i,1,Bt)}}),Wo={};se(Wo,{parseHtml:()=>Mo});var dl,Mo,vu=C({"parser/html.ts"(){"use strict";mn(),xu(),dl=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,Mo=(e,t,s)=>{var l;const{html:i}=t;(l=t.htmlElements)!=null||(t.htmlElements=new Set([...i[0],...i[1],...i[2]]));const r=e.split("<");let n=r.shift();for(const o of r){const d=dl.exec(o),u=d==null?void 0:d[2],a=u==null?void 0:u.toLowerCase();if(!d||!t.htmlElements.has(a)){n+=`<${o}`;continue}const[,h,,c="",g,p]=d,{length:v}=s,x=new _s(c,"html-attrs",a,t,s),b=x.hasAttr("itemprop");if(a==="meta"&&!(b&&x.hasAttr("content"))||a==="link"&&!(b&&x.hasAttr("href"))){n+=`<${o}`,s.length=v;continue}n+=`\0${s.length}x${p}`,new Bt(u,x,h==="/",g==="/>",t,s)}return n}}}),hl,Ti,cl,ct,zo=C({"src/table/base.ts"(){"use strict";fn(),W(),tt(),mn(),hl=[As(1)],ct=class extends(cl=E){constructor(e,t,s,i,r,n=[],l){super(void 0,r,n,l),this.append(new Ue(t,"table-syntax",r,n),new _s(i,"table-attrs",s,r,n))}escape(){}},Ti=Y(cl),ct=X(Ti,0,"TableBaseToken",hl,ct),J(Ti,1,ct)}}),gl,Ci,_e,is,Ct,It,vs,Uo=C({"src/table/td.ts"(){"use strict";M(),de(),cn(),B(),W(),zo(),vs=class extends(Ci=ct,gl=[ys(!1)],Ci){constructor(e,t,s,i=[]){var o;let r=/\||\0\d+!\x7F/u.exec(t!=null?t:""),n=r?t.slice(0,r.index):"";/\[\[|-\{/u.test(n)&&(r=null,n=""),super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",n,s,i),J(is,5,this),Oe(this,Ct),Oe(this,_e,""),r&&([Wa(this,_e)._]=r);const l=new E(t==null?void 0:t.slice(((o=r==null?void 0:r.index)!=null?o:NaN)+he(this,_e).length),s,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 Ui(this,Ct,It).call(this).subtype}afterBuild(){he(this,_e).includes("\0")&&ye(this,_e,this.buildFromStr(he(this,_e),0)),super.afterBuild()}toString(e){const{childNodes:[t,s,i]}=this;return t.toString(e)+s.toString(e)+he(this,_e)+i.toString(e)}text(){const{childNodes:[e,t,s]}=this;return e.text()+t.text()+he(this,_e)+s.text()}getGaps(e){return e===1?he(this,_e).length:0}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new le(this,e+this.getRelativeIndex(this.length-1)),r="pipe-like",{lintConfig:n}=I,{computeEditInfo:l,fix:o}=n,d=["td","double"].map(u=>n.getSeverity(r,u));for(const u of this.lastChild.childNodes)if(u.type==="text"){const{data:a}=u;if(a.includes("|")){const h=a.includes("||"),c=d[h?1:0];if(c){const g=q(u,i,r,"pipe-in-table",c);if(l||o)if(h){const p={caption:"|+",td:"|",th:"!"}[this.subtype];g.fix=$e(g,"newline",a.replace(/\|\|/gu,`
|
|
14
|
+
${p}`))}else l&&(g.suggestions=[dn(g.startIndex,a)]);s.push(g)}}}return s}}isIndependent(){return this.firstChild.text().startsWith(`
|
|
15
|
+
`)}getAttr(e){{const t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}}escape(){}print(){const{childNodes:[e,t,s]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${he(this,_e)}${s.print()}</span>`}json(e,t=this.getAbsoluteIndex()){}},is=Y(Ci),_e=new WeakMap,Ct=new WeakSet,It=function(){var e;const t=this.firstChild.text(),s=t.slice(-1);let i="td";if(s==="!"?i="th":s==="+"&&(i="caption"),this.isIndependent())return{subtype:i};const{previousSibling:r}=this;return fe({},Ui(e=r,Ct,It).call(e))},It=X(is,17,"#getSyntax",gl,Ct,It),nn(is,vs)}}),kn,Ho=C({"src/table/trBase.ts"(){"use strict";M(),B(),zo(),Uo(),kn=class extends ct{lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=this.childNodes.find(({type:o})=>o==="table-inter");if(!i)return s;const r=zt(i),n="fostered-content",l=r&&I.lintConfig.getSeverity(n,r===2?void 0:"transclusion");if(l){const o=q(i,{start:e},n,"content-outside-table",l);o.startIndex++,o.startLine++,o.startCol=0,s.push(o)}return s}}getRowCount(){return Number(this.childNodes.some(e=>e instanceof vs&&e.isIndependent()&&!e.firstChild.text().endsWith("+")))}}}}),pl,fl,ml,xl,Ii,ns,gs,bu=C({"src/table/index.ts"(){"use strict";M(),Ce(),de(),cn(),B(),Ho(),tt(),pl=(e,t)=>new Array(e).fill(void 0).map((s,i)=>t(i)),fl=({type:e})=>e==="tr"||e==="table-syntax",ml=class extends Array{},gs=class extends(Ii=kn,xl=[ys(!1)],Ii){constructor(e,t,s,i){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,e,"table",t,s,i,{}),J(ns,5,this)}get type(){return"table"}get closed(){return this.lastChild.is("table-syntax")}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new le(this,e),r=["unclosed-table","table-layout"],n=r.map(l=>I.lintConfig.getSeverity(l));if(n[0]&&!this.closed&&s.push(q(this.firstChild,i,r[0],"unclosed-table",n[0])),n[1]){const l=this.getLayout(),{length:o}=l;if(o>1){let d=1,u=1/0,a=0;for(;a<o;a++){const h=l[a],c=h.length;if(c<d)break;c<u&&(u=c);const g=h.indexOf(h[c-1])+1;if(g>u)break;g>d&&(d=g)}if(a<o){const h=this.getNthRow(a),c=q(h,i,r[1],"inconsistent-table",n[1]);c.startIndex++,c.startLine++,c.startCol=0,s.push(c)}}}return s}}close(e=`
|
|
16
|
+
|}`,t){const s=this.getAttribute("config"),i=this.getAttribute("accum");we.run(()=>{const r=new Ue(t?e:void 0,"table-syntax",s,i);super.insertAt(r)})}getLayout(e){{const t=this.getAllRows(),{length:s}=t,i=ml.from(pl(s,()=>[]));for(let r=0;r<i.length;r++){const n=i[r];let l=0,o=0,d;for(const u of t[r].childNodes.slice(2))if(u.is("td")){if(u.isIndependent()&&(d=u.subtype!=="caption"),d){const a={row:r,column:l},{rowspan:h,colspan:c}=u;for(l++;n[o];)o++;for(let g=r;g<Math.min(r+h,s);g++)for(let p=o;p<o+c;p++)i[g][p]=a;o+=c}}else if(fl(u))break}return i}}getAllRows(){return[...super.getRowCount()?[this]:[],...this.childNodes.slice(1).filter(e=>e.is("tr")&&e.getRowCount()>0)]}getNthRow(e,t,s){{const i=super.getRowCount();if(e===0&&i)return this;i&&e--;for(const r of this.childNodes.slice(2)){const{type:n}=r;if(n==="tr"&&r.getRowCount()&&(e--,e<0))return r}return}}json(e,t=this.getAbsoluteIndex()){}},ns=Y(Ii),X(ns,1,"getLayout",xl,gs),nn(ns,gs)}}),Do,wu=C({"src/table/tr.ts"(){"use strict";Ho(),Do=class extends kn{get type(){return"tr"}constructor(e,t,s,i){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,e,"tr",t,s,i)}}}}),An,Go=C({"src/nowiki/listBase.ts"(){"use strict";it(),An=class extends Te{get indent(){}json(e,t=this.getAbsoluteIndex()){}}}}),_n,Vo=C({"src/nowiki/dd.ts"(){"use strict";Go(),_n=class extends An{get type(){return"dd"}}}}),Qo={};se(Qo,{parseTable:()=>Jo});var vl,Ni,Jo,yu=C({"parser/table.ts"(){"use strict";W(),bu(),wu(),Uo(),Vo(),vl=e=>e.lastChild.constructor!==E,Ni=(e,t)=>e.is("td")?t.pop():e,Jo=({firstChild:{data:e},type:t,name:s},i,r)=>{const n=[],l=e.split(`
|
|
17
17
|
`);let o=t==="root"||t==="parameter-value"||t==="ext-inner"&&s==="poem"?"":`
|
|
18
|
-
${l.shift()}`,
|
|
19
|
-
${h}${
|
|
20
|
-
${a}`;continue}const p=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(
|
|
21
|
-
${a}`,
|
|
22
|
-
${h}${
|
|
23
|
-
${h}${
|
|
24
|
-
${h}${
|
|
25
|
-
`)&&(w=be(g).trim());const{ns:_,valid:v}=I.normalizeTitle(w,0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0});if(v){if(d){if(_!==6){l+=`[[${p}`;continue}let S=!1;for(u++;u<r.length;u++){const A=r[u],x=A.split("]]");if(x.length>2){S=!0,g+=`[[${x[0]}]]${x[1]}`,c=x.slice(2).join("]]");break}else if(x.length===2)g+=`[[${x[0]}]]${x[1]}`;else{g+=`[[${A}`;break}}if(g=en(g,t,s,i),!S){l+=`[[${a}${h}${g}`;continue}}}else{l+=`[[${p}`;continue}g&&(g=_n(g,t,s,i));let m=bn;k||(_===6?(g&&(g=$n(g,t,s,!0)),m=vn):_===14&&(m=Yo)),g===void 0&&h&&(g=""),l+=`\0${s.length}l${c}`,new m(a,g,t,s,h)}return l}}}),ea={};se(ea,{parseMagicLinks:()=>ta});var Ei,Fi,ji,Pi,ta,wu=C({"parser/magicLinks.ts"(){"use strict";ge(),wn(),Ei=String.raw`[${Be}\t]| |�*160;|�*a0;`,Fi=`(?:${Ei})+`,ji=`(?:${Ei}|-)`,Pi=String.raw`(?:RFC|PMID)${Fi}\d+\b|ISBN${Fi}(?:97[89]${ji}?)?(?:\d${ji}?){9}[\dx]\b`,ta=(e,t,s)=>{if(!t.regexMagicLinks)try{t.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${t.protocol})(${ct}${gt})|${Pi})`,"giu")}catch(i){t.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${t.protocol})(${ct}${gt})|${Pi})`,"giu")}return e.replace(t.regexMagicLinks,(i,n,r)=>{let l=n?i.slice(n.length):i;if(r){let o="";const u=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(l);u&&(o=l.slice(u.index),l=l.slice(0,u.index));const d=l.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,a=d.exec(l);if(a){let h=1;a[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(l.slice(0,a.index))&&(h=2),o=l.slice(a.index+h)+o,l=l.slice(0,a.index+h)}return o.length>=r.length?i:(new Gt(l,void 0,t,s),`${n}\0${s.length-1}w${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(l))return i;return new Gt(l,"magic-link",t,s),`${n}\0${s.length-1}i`})}}}),sa,yu=C({"util/html.ts"(){"use strict";sa=(e,t)=>e.startsWith(t)?t.length:[...t].findIndex((s,i)=>s!==e[i])}}),ia,Su=C({"src/nowiki/list.ts"(){"use strict";Wo(),ia=class extends kn{get type(){return"list"}}}}),na={};se(na,{parseList:()=>ra});var ra,ku=C({"parser/list.ts"(){"use strict";yu(),Su(),Mo(),ra=(e,t,s,i)=>{const n=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(e);if(!n)return t.lastPrefix="",e;const[r,l,o,u]=n,d=o.replace(/;/gu,":"),a=sa(d,t.lastPrefix),h=((a>1?o.slice(a-1):o)+u).split(/(?=;)/u),g=h[0].startsWith(";");let c=h.length-(g?0:1);if(a>1){const $=o.slice(0,a-1);if(g){const E=$.split(/(?=;)/u);h.unshift(...E),c+=$.includes(";")?E.length:0}else h[0]=$+h[0]}t.lastPrefix=d;let p=l+h.map(($,E)=>`\0${i.length+E}d`).join("")+e.slice(r.length);for(const $ of h)new ia($,s,i);if(!c)return p;const{html:[b,,w]}=s,k=/:+|-\{|\0\d+[xq]\x7F/gu;let _=k,v=_.exec(p),m=0,S=!1,A=!1,x=0;const y=($,E)=>(new An($,s,i),`${p.slice(0,E)}\0${i.length-1}d${p.slice(E+$.length)}`),T=$=>{$?m&&m--:m++};for(;v&&c;){const{0:$,index:E}=v;if($==="-{"){if(!x){const{lastIndex:F}=_;_=/-\{|\}-/gu,_.lastIndex=F}x++}else if($==="}-"){if(x--,!x){const{lastIndex:F}=_;_=k,_.lastIndex=F}}else if($.endsWith("x")){const{name:F,closing:P,selfClosing:ne}=i[Number($.slice(1,-2))];(b.includes(F)||!ne&&!w.includes(F))&&T(P)}else if($.endsWith("q")){const{bold:F,italic:P}=i[Number($.slice(1,-2))];F&&(T(S),S=!S),P&&(T(A),A=!A)}else if(m===0){if($.length>=c)return y($.slice(0,c),E);c-=$.length,_.lastIndex=E+4+String(i.length).length,p=y($,E)}v=_.exec(p)}return p}}}),rs,Sl,Ri,kl,Wt,Au=C({"src/converterFlags.ts"(){"use strict";var e,t;M(),de(),Ss(),W(),q(),ze(),rs=new Set(["A","T","R","D","-","H","N"]),Sl=[Vt()],Wt=(t=class extends(kl=j){constructor(i,n,r=[]){super(void 0,n,r,{});N(this,e);this.safeAppend(i.map(l=>new xe(l,"converter-flag",n,r)))}get type(){return"converter-flags"}afterBuild(){L(this,e,this.childNodes.map(i=>i.text().trim())),super.afterBuild()}toString(i){return super.toString(i,";")}text(){return super.text(";")}getUnknownFlags(){return new Set(f(this,e).filter(i=>/\{{3}[^{}]+\}{3}/u.test(i)))}getVariantFlags(){const i=new Set(this.getAttribute("config").variants);return new Set(f(this,e).filter(n=>i.has(n)))}isInvalidFlag(i,n,r,l){return typeof i=="object"&&(i=i.text().trim(),n=this.getVariantFlags(),r=this.getUnknownFlags(),l=new Set(f(this,e).filter(o=>rs.has(o)))),!!i&&!n.has(i)&&!r.has(i)&&(n.size>0||!l.has(i))}lint(i=this.getAbsoluteIndex(),n){{const r=this.getVariantFlags(),l=this.getUnknownFlags(),o=new Set(f(this,e).filter(w=>rs.has(w))),u=f(this,e).filter(w=>!w).length,d=f(this,e).length-l.size-u,{lintConfig:a}=I,{computeEditInfo:h,fix:g}=a,c=super.lint(i,n);if(r.size===d||o.size===d)return c;const p="no-ignored",b=a.getSeverity(p,"conversionFlag");if(b){const w=new le(this,i);for(let k=0;k<this.length;k++){const _=this.childNodes[k],v=_.text().trim();if(this.isInvalidFlag(v,r,l,o)){const m=B(_,w,p,"invalid-conversion-flag",b);(h||g)&&(r.size===0&&rs.has(v.toUpperCase())?m.fix=un(m,v):h&&(m.suggestions=[U(m,k&&-1)])),c.push(m)}}}return c}}print(){return super.print({sep:";"})}},e=new WeakMap,t),Ri=K(kl),Wt=X(Ri,0,"ConverterFlagsToken",Sl,Wt),J(Ri,1,Wt)}}),ps,_u=C({"src/converterRule.ts"(){"use strict";W(),q(),ze(),ps=class extends j{get type(){return"converter-rule"}get variant(){}constructor(e,t=!0,s=I.getConfig(),i=[]){super(void 0,s,i);const n=e.indexOf(":"),r=e.slice(0,n).indexOf("=>"),l=r===-1?e.slice(0,n):e.slice(r+2,n);t&&s.variants.includes(l.trim().toLowerCase())?(super.insertAt(new xe(l,"converter-rule-variant",s,i)),super.insertAt(new xe(e.slice(n+1),"converter-rule-to",s,i)),r!==-1&&super.insertAt(new xe(e.slice(0,r),"converter-rule-from",s,i),0)):super.insertAt(new xe(e,"converter-rule-to",s,i))}toString(e){const{childNodes:t,firstChild:s,lastChild:i}=this;return t.length===3?`${s.toString(e)}=>${t[1].toString(e)}:${i.toString(e)}`:super.toString(e,":")}text(){const{childNodes:e,firstChild:t,lastChild:s}=this;return e.length===3?`${t.text()}=>${e[1].text()}:${s.text()}`:super.text(":")}getGaps(e){return e===0&&this.length===3?2:1}print(){const{childNodes:e}=this;if(e.length===3){const[t,s,i]=e;return`<span class="wpb-converter-rule">${t.print()}=>${s.print()}:${i.print()}</span>`}return super.print({sep:":"})}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t)}}}}),Al,Oi,_l,Mt,$u=C({"src/converter.ts"(){"use strict";ge(),Me(),Fe(),q(),Au(),_u(),Al=[Ie,je("-{")],Mt=class extends(_l=j){get type(){return"converter"}constructor(e,t,s,i=[]){super(void 0,s,i),this.insertAt(new Wt(e,s,i));const[n]=t,r=n.includes(":"),l=new ps(n,r,s,i);r&&l.length===1||!r&&t.length===2&&!be(t[1]).trim()?this.insertAt(new ps(t.join(";"),!1,s,i)):this.append(l,...t.slice(1).map(o=>new ps(o,!0,s,i)))}toString(e){const{childNodes:[t,...s]}=this;return`-{${t.toString(e)}${t.length>0?"|":""}${s.map(i=>i.toString(e)).join(";")}}-`}text(){const{childNodes:[e,...t]}=this;return`-{${e.text()}|${Ke(t,";")}}-`}getGaps(e){return e||this.firstChild.length>0?1:0}print(){const{childNodes:[e,...t]}=this;return`<span class="wpb-converter">-{${e.print()}${e.length>0?"|":""}${ft(t,{sep:";"})}}-</span>`}},Oi=K(_l),Mt=X(Oi,0,"ConverterToken",Al,Mt),J(Oi,1,Mt)}}),la={};se(la,{parseConverter:()=>oa});var oa,Tu=C({"parser/converter.ts"(){"use strict";$u(),oa=(e,t,s)=>{var u;(u=t.regexConverter)!=null||(t.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${t.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"iu"));const i=/-\{/gu,n=/-\{|\}-/gu,r=[];let l=i,o=l.exec(e);for(;o;){const{0:d,index:a}=o;if(d==="}-"){const h=r.pop(),{length:g}=s,c=e.slice(h.index+2,a),p=c.indexOf("|"),[b,w]=p===-1?[[],c]:[c.slice(0,p).split(";"),c.slice(p+1)],k=w.replace(/(&[#a-z\d]+);/giu,"$1"),_=k.split(t.regexConverter).map(v=>v.replace(/\x01/gu,";"));new Mt(b,_,t,s),e=`${e.slice(0,h.index)}\0${g}v${e.slice(a+2)}`,r.length===0&&(l=i),l.lastIndex=h.index+3+String(g).length}else r.push(o),l=n,l.lastIndex=a+2;o=l.exec(e)}return e}}}),vs={};se(vs,{Token:()=>j});var $l,j,q=C({"src/index.ts"(){"use strict";var e,t,s,i,n,r,l,o,aa,ua,da,ha,ca,ga,pa,fa,ma,xa,va,ba,m;ge(),We(),M(),Ne(),W(),qa(),Wa(),$l=["category","html-attr#id,ext-attr#id,table-attr#id"],j=(m=class extends Nt{constructor(x,y=I.getConfig(),T=[],$){super();N(this,o);N(this,e,"plain");N(this,t,0);N(this,s);N(this,i);N(this,n);N(this,r,!1);N(this,l);typeof x=="string"&&this.insertAt(x),L(this,s,y),L(this,i,T),T.push(this)}get type(){return f(this,e)}set type(x){L(this,e,x)}parseOnce(x=f(this,t),y=!1,T){if(x<f(this,t)||this.length===0||!this.isPlain())return this;if(f(this,t)>=we)return this;switch(x){case 0:if(this.type==="root"){f(this,i).pop();const $=R(this,o,aa).call(this);y&&(y=!$)}L(this,n,y),R(this,o,ua).call(this,y);break;case 1:R(this,o,da).call(this);break;case 2:R(this,o,ha).call(this);break;case 3:R(this,o,ca).call(this);break;case 4:R(this,o,ga).call(this);break;case 5:R(this,o,pa).call(this,T);break;case 6:R(this,o,fa).call(this,T);break;case 7:R(this,o,ma).call(this);break;case 8:R(this,o,xa).call(this);break;case 9:R(this,o,va).call(this);break;case 10:R(this,o,ba).call(this)}if(this.type==="root")for(const $ of f(this,i))$==null||$.parseOnce(x,y,T);return On(this,t)._++,this}buildFromStr(x,y){const T=x.split(/[\0\x7F]/u).map(($,E)=>{if(E%2===0)return new Qi($);if(isNaN($.slice(-1)))return f(this,i)[Number($.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${$}`)});return y===0?T.map(String).join(""):y===1?Ke(T):T}build(){L(this,t,we);const{length:x,firstChild:y}=this,T=y==null?void 0:y.toString();if(x===1&&y.type==="text"&&T.includes("\0")&&(Tn(this,0,1,this.buildFromStr(T)),this.normalize(),this.type==="root"))for(const $ of f(this,i))$==null||$.build()}afterBuild(){if(this.type==="root")for(const x of f(this,i))x==null||x.afterBuild();L(this,r,!0)}parse(x=we,y,T){for(x=Math.min(x,we);f(this,t)<x;)this.parseOnce(f(this,t),y,T);return x&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===m}getAttribute(x){var y;switch(x){case"config":return f(this,s);case"include":return(y=f(this,n))!=null?y:!!f(this.getRootNode(),n);case"accum":return f(this,i);case"built":return f(this,r);case"stage":return f(this,t);case"invalid":return this.type==="table-inter"&&zt(this)===2;default:return super.getAttribute(x)}}setAttribute(x,y){switch(x){case"stage":f(this,t)===0&&this.type==="root"&&f(this,i).shift(),L(this,t,y);break;default:super.setAttribute(x,y)}}insertAt(x,y=this.length){const T=typeof x=="string"?new Qi(x):x;super.insertAt(T,y);const{type:$}=T;return $==="root"&&(T.type="plain"),T}normalizeTitle(x,y=0,T){return I.normalizeTitle(x,y,f(this,n),f(this,s),T)}inTableAttrs(){var x,y;return((x=this.closest("table-attrs,ext"))==null?void 0:x.type)==="table-attrs"&&((y=this.closest("table-attrs,arg,magic-word,template"))!=null&&y.is("table-attrs")?2:1)}inHtmlAttrs(){var x;return(x=this.closest("html-attrs,ext"))!=null&&x.is("html-attrs")?2:this.inTableAttrs()}lint(x=this.getAbsoluteIndex(),y){var T;{const{lintConfig:$}=I,{computeEditInfo:E,fix:F,ignoreDisables:P,configurationComment:ne}=$;let O=super.lint(x,y);if(this.type==="root"){const re=new Map,fe="no-duplicate",V=["category","id"].map(z=>$.getSeverity(fe,z)),D=this.toString(),Y=$l.filter((z,Z)=>V[Z]).join();if(Y){for(const z of this.querySelectorAll(Y)){let Z;if(z.is("category"))Z=z.name;else{const H=z.getValue();H&&H!==!0&&(Z=`#${H}`)}if(Z){const H=re.get(Z);H?H.add(z):re.set(Z,new Set([z]))}}for(const[z,Z]of re)if(Z.size>1&&!z.startsWith("#mw-customcollapsible-")){const H=!z.startsWith("#"),ee=`duplicate-${H?"category":"id"}`,oe=V[H?0:1];O.push(...[...Z].map(ae=>{const te=G(ae,{start:ae.getAbsoluteIndex()},fe,ee,oe);return E&&H&&(te.suggestions=[U(te)]),te}))}}if(!P){const z=new RegExp(String.raw`<!--\s*${ne}-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->`,"gu"),Z=[];let H=z.exec(D);for(;H;){const{1:ee,index:oe}=H,ae=(T=H[2])==null?void 0:T.trim();Z.push({line:this.posFromIndex(oe).top+(ee==="disable-line"?0:1),from:ee==="disable"?z.lastIndex:void 0,to:ee==="enable"?z.lastIndex:void 0,rules:ae?new Set(ae.split(",").map(te=>te.trim())):void 0}),H=z.exec(D)}O=O.filter(({rule:ee,startLine:oe,startIndex:ae})=>{const te={pos:0};for(const{line:He,from:ue,to:ve,rules:Ce}of Z){if(He>oe+1)break;if(Ce&&!Ce.has(ee))continue;if(He===oe&&ue===void 0&&ve===void 0)return!1;ue<=ae&&ue>te.pos?(te.pos=ue,te.type="from"):ve<=ae&&ve>te.pos&&(te.pos=ve,te.type="to")}return te.type!=="from"})}if(F&&O.some(({fix:z})=>z)){const z=O.map(({fix:ee})=>ee).filter(Boolean).sort(({range:[ee,oe]},{range:[ae,te]})=>oe===te?ae-ee:te-oe);let Z=1/0,H=D;for(const{range:[ee,oe],text:ae}of z)oe<=Z&&(H=H.slice(0,ee)+ae+H.slice(oe),Z=ee);Object.assign(O,{output:H})}if(!E)for(const z of O)delete z.fix,delete z.suggestions}return O}}toString(x,y){return x?super.toString(!0,y):Xe(f(this,l),()=>super.toString(!1,y),T=>{const $=this.getRootNode();$.type==="root"&&f($,r)&&L(this,l,T)})}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,n=new WeakMap,r=new WeakMap,l=new WeakMap,o=new WeakSet,aa=function(){const{parseRedirect:x}=(Ua(),Q(Jl)),y=this.firstChild.toString(),T=x(y,f(this,s),f(this,i));return T&&this.setText(T),!!T},ua=function(x){const{parseCommentAndExt:y}=(Ts(),Q(Fo));this.setText(y(this.firstChild.toString(),f(this,s),f(this,i),x))},da=function(){const{parseBraces:x}=(xn(),Q(co)),y=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,T=x(y,f(this,s),f(this,i));this.setText(this.type==="root"?T:T.slice(1))},ha=function(){if(f(this,s).excludes.includes("html"))return;const{parseHtml:x}=(du(),Q(jo));this.setText(x(this.firstChild.toString(),f(this,s),f(this,i)))},ca=function(){if(f(this,s).excludes.includes("table"))return;const{parseTable:x}=(gu(),Q(zo));this.setText(x(this,f(this,s),f(this,i)))},ga=function(){if(f(this,s).excludes.includes("hr"))return;const{parseHrAndDoubleUnderscore:x}=(mu(),Q(Do));this.setText(x(this,f(this,s),f(this,i)))},pa=function(x){const{parseLinks:y}=(bu(),Q(Zo));this.setText(y(this.firstChild.toString(),f(this,s),f(this,i),x))},fa=function(x){if(f(this,s).excludes.includes("quote"))return;const{parseQuotes:y}=(Jo(),Q(Qo)),T=this.firstChild.toString().split(`
|
|
26
|
-
`);for(let
|
|
27
|
-
`))},
|
|
28
|
-
`),
|
|
29
|
-
`))},
|
|
18
|
+
${l.shift()}`,d;const u=(a,h)=>{if(!h){o+=a;return}const{lastChild:c}=h;if(vl(h)){const g=new E(a,i,r);g.type="table-inter",g.setAttribute("stage",3),h.insertAt(g)}else c.setText(c.toString()+a)};for(const a of l){d=n.pop();const[h]=/^(?:\s|\0\d+[cno]\x7F)*/u.exec(a),c=a.slice(h.length),g=/^(:*)((?:\s|\0\d+[cn]\x7F)*)(\{\||\{(?:\0\d+[cn]\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(c);if(g){for(;d&&!d.is("td");)d=n.pop();const[,S,w,A,_]=g;S&&new _n(S,i,r),u(`
|
|
19
|
+
${h}${S&&`\0${r.length-1}d`}${w}\0${r.length}b`,d),n.push(...d?[d]:[],new gs(A,_,i,r));continue}else if(!d){o+=`
|
|
20
|
+
${a}`;continue}const p=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(c);if(!p){u(`
|
|
21
|
+
${a}`,d),n.push(d);continue}const[,v,x,b,y]=p;if(v){for(;!d.is("table");)d=n.pop();d.close(`
|
|
22
|
+
${h}${v}`,!0),u(y,n[n.length-1])}else if(x){d=Ni(d,n),d.is("tr")&&(d=n.pop());const S=new Do(`
|
|
23
|
+
${h}${x}`,y,i,r);n.push(d,S),d.insertAt(S)}else{d=Ni(d,n);const S=b==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu;let w=S.exec(y),A=0,_=`
|
|
24
|
+
${h}${b}`;const f=k=>{const $=new vs(_,y.slice(A,w==null?void 0:w.index),i,r);return k.insertAt($),$};for(;w;)f(d),{lastIndex:A}=S,[_]=w,w=S.exec(y);n.push(d,f(d))}}return o.slice(1)}}}),jt,Su=C({"../cm-util/dist/index.mjs"(){"use strict";jt=e=>!/^_{2}.+_{2}$/u.test(e)}}),Xo,ku=C({"src/nowiki/hr.ts"(){"use strict";it(),Xo=class extends Te{get type(){return"hr"}}}}),bl,Li,wl,qt,Au=C({"src/nowiki/doubleUnderscore.ts"(){"use strict";var e,t;et(),He(),it(),bl=[ze(),Pe("__")],qt=(t=class extends(wl=Te){constructor(i,r,n,l,o){var h,c;super(i,l,o);N(this,e);const d=i.toLowerCase(),{doubleUnderscore:[,,u,a]}=l;this.setAttribute("name",(c=r?(h=a==null?void 0:a[i])==null?void 0:h.toLowerCase():u==null?void 0:u[d])!=null?c:d),L(this,e,n)}get type(){return"double-underscore"}toString(){const i=m(this,e)?"__":"__";return i+this.innerText+i}print(){const i=m(this,e)?"__":"__";return super.print({pre:i,post:i})}},e=new WeakMap,t),Li=Y(wl),qt=X(Li,0,"DoubleUnderscoreToken",bl,qt),J(Li,1,qt)}}),Ko={};se(Ko,{parseHrAndDoubleUnderscore:()=>Yo});var Yo,_u=C({"parser/hrAndDoubleUnderscore.ts"(){"use strict";Su(),ku(),Au(),co(),Yo=({firstChild:{data:e},type:t,name:s},i,r)=>{var u,a,h;const{doubleUnderscore:[n,l,o]}=i,d=[...n,...l];return(u=i.insensitiveDoubleUnderscore)!=null||(i.insensitiveDoubleUnderscore=new Set(n.filter(jt))),(a=i.sensitiveDoubleUnderscore)!=null||(i.sensitiveDoubleUnderscore=new Set(l.filter(jt))),(h=i.regexHrAndDoubleUnderscore)!=null||(i.regexHrAndDoubleUnderscore=new RegExp(`__(${d.filter(jt).join("|")})__|_{2}(${d.filter(c=>!jt(c)).map(c=>c.slice(2,-2)).join("|")})_{2}`,"giu")),t!=="root"&&(t!=="ext-inner"||s!=="poem")&&(e=`\0${e}`),e=e.replace(/^((?:\0\d+[cno]\x7F)*)(-{4,})/gmu,(c,g,p)=>(new Xo(p,i,r),`${g}\0${r.length-1}r`)).replace(i.regexHrAndDoubleUnderscore,(c,g,p)=>{var S;const v=g!=null?g:p,x=i.sensitiveDoubleUnderscore.has(v),b=v.toLowerCase(),y=i.insensitiveDoubleUnderscore.has(b);return x||y?(new qt(v,x,!!p,i,r),`\0${r.length-1}${y&&((S=o==null?void 0:o[b])!=null?S:b)==="toc"?"u":"n"}`):c}),i.excludes.includes("heading")||(e=e.replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(c,g,p,v,x)=>{const b=`${g}\0${r.length}h`;return new lt(p.length,[v,x],i,r),b})),t==="root"||t==="ext-inner"&&s==="poem"?e:e.slice(1)}}}),Zo,$u=C({"src/nowiki/quote.ts"(){"use strict";var e,t;M(),de(),B(),it(),Zo=(t=class extends Te{constructor(i,r,n,l){super(i,n,l);N(this,e);L(this,e,r)}get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}get closing(){return fe(fe({},this.bold?{bold:m(this,e).bold}:void 0),this.italic?{italic:m(this,e).italic}:void 0)}text(){const{parentNode:i,innerText:r}=this;return i!=null&&i.is("image-parameter")&&i.name!=="caption"?"":r}lint(i=this.getAbsoluteIndex()){var r;{const{previousSibling:n,bold:l,closing:o}=this,d=(n==null?void 0:n.type)==="text"?n.data:void 0,u=[],a=new le(this,i),h=["lonely-apos","bold-header"],{lintConfig:c}=I,{computeEditInfo:g}=c,p=[void 0,"word"].map(x=>c.getSeverity(h[0],x)),v=c.getSeverity(h[1]);if(d!=null&&d.endsWith("'")){const x=p[(o.bold||o.italic)&&/[a-z\d]'$/iu.test(d)?1:0];if(x){const b=z(this,a,h[0],I.msg("lonely","'"),x),{startLine:y,startCol:S}=b,[,{length:w}]=/(?:^|[^'])('+)$/u.exec(d),A=i-w,_=Le(fe({},b),{startIndex:A,endIndex:i,endLine:y,startCol:S-w,endCol:S});g&&(_.suggestions=[vt(A,"'",w),U(_)]),u.push(_)}}if(v&&l&&((r=this.closest("heading-title,ext"))==null?void 0:r.type)==="heading-title"){const x=z(this,a,h[1],"bold-in-header",v);g&&(x.suggestions=[U(x)]),u.push(x)}return u}}json(i,r=this.getAbsoluteIndex()){}},e=new WeakMap,t)}}),ea={};se(ea,{parseQuotes:()=>$n});var $n,ta=C({"parser/quotes.ts"(){"use strict";$u(),$n=(e,t,s,i)=>{var g;const r=e.split(/('{2,})/u),{length:n}=r;if(n===1)return e;let l=0,o=0,d,u,a;for(let p=1;p<n;p+=2){const v=r[p].length;switch(v){case 2:o++;break;case 4:r[p-1]+="'",r[p]="'''";case 3:if(l++,d!==void 0)break;r[p-1].endsWith(" ")?u===void 0&&a===void 0&&(a=p):r[p-1].slice(-2,-1)===" "?d=p:u!=null||(u=p);break;default:r[p-1]+="'".repeat(v-5),r[p]="'''''",o++,l++}}if(o%2===1&&l%2===1){const p=(g=d!=null?d:u)!=null?g:a;p!==void 0&&(r[p]="''",r[p-1]+="'")}let h=!0,c=!0;for(let p=1;p<n;p+=2){const v=r[p].length,x=v!==2,b=v!==3;x&&(h=!h),b&&(c=!c),new Zo(r[p],{bold:x&&h,italic:b&&c},t,s),r[p]=`\0${s.length-1}q`}return r.join("")}}}),sa={};se(sa,{parseExternalLinks:()=>Tn});var Tn,ia=C({"parser/externalLinks.ts"(){"use strict";ce(),No(),Sn(),Tn=(e,t,s,i)=>{var r;return(r=t.regexExternalLinks)!=null||(t.regexExternalLinks=new RegExp(String.raw`\[((?:\0\d+[cn]\x7F)*(?:\0\d+f\x7F|(?:(?:${t.protocol}|//)${pt}|\0\d+m\x7F)${ft}(?=[[\]<>"\t${qe}]|\0\d)))([${qe}]*(?![${qe}]))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),e.replace(t.regexExternalLinks,(n,l,o,d)=>{const{length:u}=s,a=/&[lg]t;/u.exec(l);return a&&(o="",d=l.slice(a.index)+o+d,l=l.slice(0,a.index)),i?(new Gt(l,"ext-link-url",t,s),`[\0${u}f${o}${d}]`):(new ut(l,o,d,t,s),`\0${u}w`)})}}}),na,Tu=C({"src/link/category.ts"(){"use strict";Ss(),na=class extends Be{get type(){return"category"}get sortkey(){}json(e,t=this.getAbsoluteIndex()){}}}}),ra={};se(ra,{parseLinks:()=>en});var yl,en,Cu=C({"parser/links.ts"(){"use strict";ce(),B(),ta(),ia(),Io(),ko(),Tu(),yl=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)([\s\S]*)$/u,en=(e,t,s,i)=>{var o;(o=t.regexLinks)!=null||(t.regexLinks=new RegExp(String.raw`^\s*(?:${t.protocol}|//)`,"iu"));const r=t.inExt?/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]]))?\]\]([\s\S]*)$/u:/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])*)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]])?)?\]\]([\s\S]*)$/u,n=e.split("[[");let l=n.shift();for(let d=0;d<n.length;d++){let u=!1,a,h,c,g;const p=n[d],v=r.exec(p);if(v)[,a,h,c,g]=v,g.startsWith("]")&&(c!=null&&c.includes("["))&&(c+="]",g=g.slice(1));else{const A=yl.exec(p);A&&(u=!0,[,a,h,c]=A)}if(a===void 0||t.regexLinks.test(a)||/\0\d+[exhbru]\x7F/u.test(a)){l+=`[[${p}`;continue}let x=ve(a).trim();const b=x.startsWith(":");if(b&&u){l+=`[[${p}`;continue}else!x&&c&&!c.includes(`
|
|
25
|
+
`)&&(x=ve(c).trim());const{ns:y,valid:S}=I.normalizeTitle(x,0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0});if(S){if(u){if(y!==6){l+=`[[${p}`;continue}let A=!1;for(d++;d<n.length;d++){const _=n[d],f=_.split("]]");if(f.length>2){A=!0,c+=`[[${f[0]}]]${f[1]}`,g=f.slice(2).join("]]");break}else if(f.length===2)c+=`[[${f[0]}]]${f[1]}`;else{c+=`[[${_}`;break}}if(c=en(c,t,s,i),!A){l+=`[[${a}${h}${c}`;continue}}}else{l+=`[[${p}`;continue}c&&(c=$n(c,t,s,i));let w=yn;b||(y===6?(c&&(c=Tn(c,t,s,!0)),w=wn):y===14&&(w=na)),c===void 0&&h&&(c=""),l+=`\0${s.length}l${g}`,new w(a,c,t,s,h)}return l}}}),la={};se(la,{parseMagicLinks:()=>oa});var Fi,Ei,Pi,Ri,oa,Iu=C({"parser/magicLinks.ts"(){"use strict";ce(),Sn(),Fi=String.raw`[${qe}\t]| |�*160;|�*a0;`,Ei=`(?:${Fi})+`,Pi=`(?:${Fi}|-)`,Ri=String.raw`(?:RFC|PMID)${Ei}\d+\b|ISBN${Ei}(?:97[89]${Pi}?)?(?:\d${Pi}?){9}[\dx]\b`,oa=(e,t,s)=>{if(!t.regexMagicLinks)try{t.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${t.protocol})(${pt}${ft})|${Ri})`,"giu")}catch(i){t.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${t.protocol})(${pt}${ft})|${Ri})`,"giu")}return e.replace(t.regexMagicLinks,(i,r,n)=>{let l=r?i.slice(r.length):i;if(n){let o="";const d=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(l);d&&(o=l.slice(d.index),l=l.slice(0,d.index));const u=l.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,a=u.exec(l);if(a){let h=1;a[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(l.slice(0,a.index))&&(h=2),o=l.slice(a.index+h)+o,l=l.slice(0,a.index+h)}return o.length>=n.length?i:(new Gt(l,void 0,t,s),`${r}\0${s.length-1}w${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(l))return i;return new Gt(l,"magic-link",t,s),`${r}\0${s.length-1}i`})}}}),aa,Nu=C({"util/html.ts"(){"use strict";aa=(e,t)=>e.startsWith(t)?t.length:[...t].findIndex((s,i)=>s!==e[i])}}),ua,Lu=C({"src/nowiki/list.ts"(){"use strict";Go(),ua=class extends An{get type(){return"list"}}}}),da={};se(da,{parseList:()=>ha});var ha,Fu=C({"parser/list.ts"(){"use strict";Nu(),Lu(),Vo(),ha=(e,t,s,i)=>{const r=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(e);if(!r)return t.lastPrefix="",e;const[n,l,o,d]=r,u=o.replace(/;/gu,":"),a=aa(u,t.lastPrefix),h=((a>1?o.slice(a-1):o)+d).split(/(?=;)/u),c=h[0].startsWith(";");let g=h.length-(c?0:1);if(a>1){const T=o.slice(0,a-1);if(c){const F=T.split(/(?=;)/u);h.unshift(...F),g+=T.includes(";")?F.length:0}else h[0]=T+h[0]}t.lastPrefix=u;let p=l+h.map((T,F)=>`\0${i.length+F}d`).join("")+e.slice(n.length);for(const T of h)new ua(T,s,i);if(!g)return p;const{html:[v,,x]}=s,b=/:+|-\{|\0\d+[xq]\x7F/gu;let y=b,S=y.exec(p),w=0,A=!1,_=!1,f=0;const k=(T,F)=>(new _n(T,s,i),`${p.slice(0,F)}\0${i.length-1}d${p.slice(F+T.length)}`),$=T=>{T?w&&w--:w++};for(;S&&g;){const{0:T,index:F}=S;if(T==="-{"){if(!f){const{lastIndex:j}=y;y=/-\{|\}-/gu,y.lastIndex=j}f++}else if(T==="}-"){if(f--,!f){const{lastIndex:j}=y;y=b,y.lastIndex=j}}else if(T.endsWith("x")){const{name:j,closing:R,selfClosing:ne}=i[Number(T.slice(1,-2))];(v.includes(j)||!ne&&!x.includes(j))&&$(R)}else if(T.endsWith("q")){const{bold:j,italic:R}=i[Number(T.slice(1,-2))];j&&($(A),A=!A),R&&($(_),_=!_)}else if(w===0){if(T.length>=g)return k(T.slice(0,g),F);g-=T.length,y.lastIndex=F+4+String(i.length).length,p=k(T,F)}S=y.exec(p)}return p}}}),rs,Sl,Oi,kl,Wt,Eu=C({"src/converterFlags.ts"(){"use strict";var e,t;M(),de(),ks(),B(),W(),st(),rs=new Set(["A","T","R","D","-","H","N"]),Sl=[Vt()],Wt=(t=class extends(kl=E){constructor(i,r,n=[]){super(void 0,r,n,{});N(this,e);this.safeAppend(i.map(l=>new xe(l,"converter-flag",r,n)))}get type(){return"converter-flags"}afterBuild(){L(this,e,this.childNodes.map(i=>i.text().trim())),super.afterBuild()}toString(i){return super.toString(i,";")}text(){return super.text(";")}getUnknownFlags(){return new Set(m(this,e).filter(i=>/\{{3}[^{}]+\}{3}/u.test(i)))}getVariantFlags(){const i=new Set(this.getAttribute("config").variants);return new Set(m(this,e).filter(r=>i.has(r)))}isInvalidFlag(i,r,n,l){return typeof i=="object"&&(i=i.text().trim(),r=this.getVariantFlags(),n=this.getUnknownFlags(),l=new Set(m(this,e).filter(o=>rs.has(o)))),!!i&&!r.has(i)&&!n.has(i)&&(r.size>0||!l.has(i))}lint(i=this.getAbsoluteIndex(),r){{const n=this.getVariantFlags(),l=this.getUnknownFlags(),o=new Set(m(this,e).filter(x=>rs.has(x))),d=m(this,e).filter(x=>!x).length,u=m(this,e).length-l.size-d,{lintConfig:a}=I,{computeEditInfo:h,fix:c}=a,g=super.lint(i,r);if(n.size===u||o.size===u)return g;const p="no-ignored",v=a.getSeverity(p,"conversionFlag");if(v){const x=new le(this,i);for(let b=0;b<this.length;b++){const y=this.childNodes[b],S=y.text().trim();if(this.isInvalidFlag(S,n,l,o)){const w=q(y,x,p,"invalid-conversion-flag",v);(h||c)&&(n.size===0&&rs.has(S.toUpperCase())?w.fix=un(w,S):h&&(w.suggestions=[U(w,b&&-1)])),g.push(w)}}}return g}}print(){return super.print({sep:";"})}},e=new WeakMap,t),Oi=Y(kl),Wt=X(Oi,0,"ConverterFlagsToken",Sl,Wt),J(Oi,1,Wt)}}),ps,Pu=C({"src/converterRule.ts"(){"use strict";B(),W(),st(),ps=class extends E{get type(){return"converter-rule"}get variant(){}constructor(e,t=!0,s=I.getConfig(),i=[]){super(void 0,s,i);const r=e.indexOf(":"),n=e.slice(0,r).indexOf("=>"),l=n===-1?e.slice(0,r):e.slice(n+2,r);t&&s.variants.includes(l.trim().toLowerCase())?(super.insertAt(new xe(l,"converter-rule-variant",s,i)),super.insertAt(new xe(e.slice(r+1),"converter-rule-to",s,i)),n!==-1&&super.insertAt(new xe(e.slice(0,n),"converter-rule-from",s,i),0)):super.insertAt(new xe(e,"converter-rule-to",s,i))}toString(e){const{childNodes:t,firstChild:s,lastChild:i}=this;return t.length===3?`${s.toString(e)}=>${t[1].toString(e)}:${i.toString(e)}`:super.toString(e,":")}text(){const{childNodes:e,firstChild:t,lastChild:s}=this;return e.length===3?`${t.text()}=>${e[1].text()}:${s.text()}`:super.text(":")}getGaps(e){return e===0&&this.length===3?2:1}print(){const{childNodes:e}=this;if(e.length===3){const[t,s,i]=e;return`<span class="wpb-converter-rule">${t.print()}=>${s.print()}:${i.print()}</span>`}return super.print({sep:":"})}json(e,t=this.getAbsoluteIndex()){}}}}),Al,Bi,_l,Mt,Ru=C({"src/converter.ts"(){"use strict";ce(),He(),Ee(),W(),Eu(),Pu(),Al=[Ne,Pe("-{")],Mt=class extends(_l=E){get type(){return"converter"}constructor(e,t,s,i=[]){super(void 0,s,i),this.insertAt(new Wt(e,s,i));const[r]=t,n=r.includes(":"),l=new ps(r,n,s,i);n&&l.length===1||!n&&t.length===2&&!ve(t[1]).trim()?this.insertAt(new ps(t.join(";"),!1,s,i)):this.append(l,...t.slice(1).map(o=>new ps(o,!0,s,i)))}toString(e){const{childNodes:[t,...s]}=this;return`-{${t.toString(e)}${t.length>0?"|":""}${s.map(i=>i.toString(e)).join(";")}}-`}text(){const{childNodes:[e,...t]}=this;return`-{${e.text()}|${Ye(t,";")}}-`}getGaps(e){return e||this.firstChild.length>0?1:0}print(){const{childNodes:[e,...t]}=this;return`<span class="wpb-converter">-{${e.print()}${e.length>0?"|":""}${xt(t,{sep:";"})}}-</span>`}},Bi=Y(_l),Mt=X(Bi,0,"ConverterToken",Al,Mt),J(Bi,1,Mt)}}),ca={};se(ca,{parseConverter:()=>ga});var ga,Ou=C({"parser/converter.ts"(){"use strict";Ru(),ga=(e,t,s)=>{var d;(d=t.regexConverter)!=null||(t.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${t.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"iu"));const i=/-\{/gu,r=/-\{|\}-/gu,n=[];let l=i,o=l.exec(e);for(;o;){const{0:u,index:a}=o;if(u==="}-"){const h=n.pop(),{length:c}=s,g=e.slice(h.index+2,a),p=g.indexOf("|"),[v,x]=p===-1?[[],g]:[g.slice(0,p).split(";"),g.slice(p+1)],b=x.replace(/(&[#a-z\d]+);/giu,"$1"),y=b.split(t.regexConverter).map(S=>S.replace(/\x01/gu,";"));new Mt(v,y,t,s),e=`${e.slice(0,h.index)}\0${c}v${e.slice(a+2)}`,n.length===0&&(l=i),l.lastIndex=h.index+3+String(c).length}else n.push(o),l=r,l.lastIndex=a+2;o=l.exec(e)}return e}}}),bs={};se(bs,{Token:()=>E});var $l,E,W=C({"src/index.ts"(){"use strict";var e,t,s,i,r,n,l,o,pa,fa,ma,xa,va,ba,wa,ya,Sa,ka,Aa,_a,w;ce(),Me(),M(),Ce(),B(),Da(),Ga(),$l=["category","html-attr#id,ext-attr#id,table-attr#id"],E=(w=class extends Lt{constructor(f,k=I.getConfig(),$=[],T){super();N(this,o);N(this,e,"plain");N(this,t,0);N(this,s);N(this,i);N(this,r);N(this,n,!1);N(this,l);typeof f=="string"&&this.insertAt(f),L(this,s,k),L(this,i,$),$.push(this)}get type(){return m(this,e)}set type(f){L(this,e,f)}parseOnce(f=m(this,t),k=!1,$){if(f<m(this,t)||this.length===0||!this.isPlain())return this;if(m(this,t)>=be)return this;switch(f){case 0:if(this.type==="root"){m(this,i).pop();const T=P(this,o,pa).call(this);k&&(k=!T)}L(this,r,k),P(this,o,fa).call(this,k);break;case 1:P(this,o,ma).call(this);break;case 2:P(this,o,xa).call(this);break;case 3:P(this,o,va).call(this);break;case 4:P(this,o,ba).call(this);break;case 5:P(this,o,wa).call(this,$);break;case 6:P(this,o,ya).call(this,$);break;case 7:P(this,o,Sa).call(this);break;case 8:P(this,o,ka).call(this);break;case 9:P(this,o,Aa).call(this);break;case 10:P(this,o,_a).call(this)}if(this.type==="root")for(const T of m(this,i))T==null||T.parseOnce(f,k,$);return jn(this,t)._++,this}buildFromStr(f,k){const $=f.split(/[\0\x7F]/u).map((T,F)=>{if(F%2===0)return new Qi(T);if(isNaN(T.slice(-1)))return m(this,i)[Number(T.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${T}`)});return k===0?$.map(String).join(""):k===1?Ye($):$}build(){L(this,t,be);const{length:f,firstChild:k}=this,$=k==null?void 0:k.toString();if(f===1&&k.type==="text"&&$.includes("\0")&&(Cn(this,0,1,this.buildFromStr($)),this.normalize(),this.type==="root"))for(const T of m(this,i))T==null||T.build()}afterBuild(){if(this.type==="root")for(const f of m(this,i))f==null||f.afterBuild();L(this,n,!0)}parse(f=be,k,$){for(f=Math.min(f,be);m(this,t)<f;)this.parseOnce(m(this,t),k,$);return f&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===w}getAttribute(f){var k;switch(f){case"config":return m(this,s);case"include":return(k=m(this,r))!=null?k:!!m(this.getRootNode(),r);case"accum":return m(this,i);case"built":return m(this,n);case"stage":return m(this,t);case"invalid":return this.type==="table-inter"&&zt(this)===2;default:return super.getAttribute(f)}}setAttribute(f,k){switch(f){case"stage":m(this,t)===0&&this.type==="root"&&m(this,i).shift(),L(this,t,k);break;default:super.setAttribute(f,k)}}insertAt(f,k=this.length){const $=typeof f=="string"?new Qi(f):f;super.insertAt($,k);const{type:T}=$;return T==="root"&&($.type="plain"),$}normalizeTitle(f,k=0,$){return I.normalizeTitle(f,k,m(this,r),m(this,s),$)}inTableAttrs(){var f,k;return((f=this.closest("table-attrs,ext"))==null?void 0:f.type)==="table-attrs"&&((k=this.closest("table-attrs,arg,magic-word,template"))!=null&&k.is("table-attrs")?2:1)}inHtmlAttrs(){var f;return(f=this.closest("html-attrs,ext"))!=null&&f.is("html-attrs")?2:this.inTableAttrs()}lint(f=this.getAbsoluteIndex(),k){var $;{const{lintConfig:T}=I,{computeEditInfo:F,fix:j,ignoreDisables:R,configurationComment:ne}=T;let O=super.lint(f,k);if(this.type==="root"){const re=new Map,pe="no-duplicate",V=["category","id"].map(H=>T.getSeverity(pe,H)),G=this.toString(),K=$l.filter((H,Z)=>V[Z]).join();if(K){for(const H of this.querySelectorAll(K)){let Z;if(H.is("category"))Z=H.name;else{const D=H.getValue();D&&D!==!0&&(Z=`#${D}`)}if(Z){const D=re.get(Z);D?D.add(H):re.set(Z,new Set([H]))}}for(const[H,Z]of re)if(Z.size>1&&!H.startsWith("#mw-customcollapsible-")){const D=!H.startsWith("#"),ee=`duplicate-${D?"category":"id"}`,oe=V[D?0:1];O.push(...[...Z].map(ae=>{const te=z(ae,{start:ae.getAbsoluteIndex()},pe,ee,oe);return F&&D&&(te.suggestions=[U(te)]),te}))}}if(!R){const H=new RegExp(String.raw`<!--\s*${ne}-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->`,"gu"),Z=[];let D=H.exec(G);for(;D;){const{1:ee,index:oe}=D,ae=($=D[2])==null?void 0:$.trim();Z.push({line:this.posFromIndex(oe).top+(ee==="disable-line"?0:1),from:ee==="disable"?H.lastIndex:void 0,to:ee==="enable"?H.lastIndex:void 0,rules:ae?new Set(ae.split(",").map(te=>te.trim())):void 0}),D=H.exec(G)}O=O.filter(({rule:ee,startLine:oe,startIndex:ae})=>{const te={pos:0};for(const{line:De,from:ue,to:me,rules:Ie}of Z){if(De>oe+1)break;if(Ie&&!Ie.has(ee))continue;if(De===oe&&ue===void 0&&me===void 0)return!1;ue<=ae&&ue>te.pos?(te.pos=ue,te.type="from"):me<=ae&&me>te.pos&&(te.pos=me,te.type="to")}return te.type!=="from"})}if(j&&O.some(({fix:H})=>H)){const H=O.map(({fix:ee})=>ee).filter(Boolean).sort(({range:[ee,oe]},{range:[ae,te]})=>oe===te?ae-ee:te-oe);let Z=1/0,D=G;for(const{range:[ee,oe],text:ae}of H)oe<=Z&&(D=D.slice(0,ee)+ae+D.slice(oe),Z=ee);Object.assign(O,{output:D})}if(!F)for(const H of O)delete H.fix,delete H.suggestions}return O}}toString(f,k){return f?super.toString(!0,k):Ke(m(this,l),()=>super.toString(!1,k),$=>{const T=this.getRootNode();T.type==="root"&&m(T,n)&&L(this,l,$)})}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakMap,n=new WeakMap,l=new WeakMap,o=new WeakSet,pa=function(){const{parseRedirect:f}=(Ja(),Q(Jl)),k=this.firstChild.toString(),$=f(k,m(this,s),m(this,i));return $&&this.setText($),!!$},fa=function(f){const{parseCommentAndExt:k}=(Cs(),Q(qo));this.setText(k(this.firstChild.toString(),m(this,s),m(this,i),f))},ma=function(){const{parseBraces:f}=(bn(),Q(fo)),k=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,$=f(k,m(this,s),m(this,i));this.setText(this.type==="root"?$:$.slice(1))},xa=function(){if(m(this,s).excludes.includes("html"))return;const{parseHtml:f}=(vu(),Q(Wo));this.setText(f(this.firstChild.toString(),m(this,s),m(this,i)))},va=function(){if(m(this,s).excludes.includes("table"))return;const{parseTable:f}=(yu(),Q(Qo));this.setText(f(this,m(this,s),m(this,i)))},ba=function(){if(m(this,s).excludes.includes("hr"))return;const{parseHrAndDoubleUnderscore:f}=(_u(),Q(Ko));this.setText(f(this,m(this,s),m(this,i)))},wa=function(f){const{parseLinks:k}=(Cu(),Q(ra));this.setText(k(this.firstChild.toString(),m(this,s),m(this,i),f))},ya=function(f){if(m(this,s).excludes.includes("quote"))return;const{parseQuotes:k}=(ta(),Q(ea)),$=this.firstChild.toString().split(`
|
|
26
|
+
`);for(let T=0;T<$.length;T++)$[T]=k($[T],m(this,s),m(this,i),f);this.setText($.join(`
|
|
27
|
+
`))},Sa=function(){if(m(this,s).excludes.includes("extLink"))return;const{parseExternalLinks:f}=(ia(),Q(sa));this.setText(f(this.firstChild.toString(),m(this,s),m(this,i)))},ka=function(){if(m(this,s).excludes.includes("magicLink"))return;const{parseMagicLinks:f}=(Iu(),Q(la));this.setText(f(this.firstChild.toString(),m(this,s),m(this,i)))},Aa=function(){if(m(this,s).excludes.includes("list"))return;const{parseList:f}=(Fu(),Q(da)),{firstChild:k,type:$,name:T}=this,F=k.toString().split(`
|
|
28
|
+
`),j={lastPrefix:""};let R=$==="root"||$==="ext-inner"&&T==="poem"?0:1;for(;R<F.length;R++)F[R]=f(F[R],j,m(this,s),m(this,i));this.setText(F.join(`
|
|
29
|
+
`))},_a=function(){if(m(this,s).variants.length>0){const{parseConverter:f}=(Ou(),Q(ca));this.setText(f(this.firstChild.toString(),m(this,s),m(this,i)))}},w)}}),we,Is,Cn,Ce=C({"util/debug.ts"(){"use strict";we={running:!1,run(e){const{running:t}=this;this.running=!0;try{const{Token:s}=(W(),Q(bs)),i=e();return i instanceof s&&!i.getAttribute("built")&&i.afterBuild(),this.running=t,i}catch(s){throw this.running=t,s}},rev:0},Is=e=>t=>t.type===e,Cn=(e,t,s,i=[])=>{var l,o;let r=e.getChildNodes(),n;r.length===s?(n=r,r=i):n=r.splice(t,s,...i);for(let d=0;d<i.length;d++){const u=i[d];u.setAttribute("parentNode",e),u.setAttribute("nextSibling",r[t+d+1]),u.setAttribute("previousSibling",r[t+d-1])}return(l=r[t-1])==null||l.setAttribute("nextSibling",r[t]),(o=r[t+i.length])==null||o.setAttribute("previousSibling",r[t+i.length-1]),r===i&&e.setAttribute("childNodes",r),n}}}),rt,ji,ls,qi,Tl,Wi,Cl,tn,Bu=C({"lib/lintConfig.ts"(){"use strict";var e,t;Bl(),rt=new Map([[0,!1],[1,"warning"],[2,"error"],[!1,!1],["off",!1],["warning","warning"],["error","error"]]),ji={"bold-header":[1,{}],"format-leakage":[1,{}],"fostered-content":[1,{}],h1:[1,{}],"illegal-attr":[2,{}],"insecure-style":2,"invalid-gallery":[2,{parameter:1}],"invalid-imagemap":[2,{}],"invalid-invoke":[2,{}],"invalid-isbn":2,"invalid-url":1,"lonely-apos":[1,{}],"lonely-bracket":[1,{extLink:2}],"lonely-http":[1,{}],"nested-link":[2,{}],"no-arg":1,"no-duplicate":[2,{category:1,id:1,unknownImageParameter:1}],"no-ignored":[2,{fragment:1,galleryComment:1,galleryNoImage:1,include:1,nonWordAttributes:1,redirect:1}],"obsolete-attr":1,"obsolete-tag":1,"parsing-order":[2,{templateInTable:1}],"pipe-like":[1,{double:2}],"table-layout":1,"tag-like":[2,{disallowed:1,invalid:1}],"unbalanced-header":2,"unclosed-comment":[1,{}],"unclosed-quote":1,"unclosed-table":2,unescaped:2,"unknown-page":1,"unmatched-tag":[1,{both:2,selfClosing:2}],"unterminated-url":[1,{}],"url-encoding":[1,{}],"var-anchor":[1,{}],"void-ext":[2,{}]},Object.freeze(ji),ls={configurationComment:"lint",ignoreDisables:!1,fix:!0,computeEditInfo:!0},Object.freeze(ls),qi=s=>rt.has(s),Tl=s=>qi(s)||Array.isArray(s)&&qi(s[0])&&(s.length===1||typeof s[1]=="object"),Wi=(s,i,r)=>{if(fs.includes(i)){if(r===void 0)return!1;if(Tl(r))return s[i]=r,!0}else throw new RangeError(`Unknown lint rule: ${i}`);throw new RangeError(`Invalid lint config for ${i}: ${JSON.stringify(r)}`)},Cl=class{constructor(s){if(Object.assign(this,JSON.parse(JSON.stringify(ji))),!!s)for(const[i,r]of Object.entries(s))Wi(this,i,r)}getSeverity(s,i){var n,l;const r=this[s];return typeof r!="object"?rt.get(r):i&&(l=rt.get((n=r[1])==null?void 0:n[i]))!=null?l:rt.get(r[0])}},tn=(t=class{constructor(s){N(this,e);if(Object.assign(this,ls),s&&!("rules"in s)&&Object.keys(s).some(r=>fs.includes(r)))this.rules=s;else{const i=s!=null?s:{},{rules:r}=i,n=Bn(i,["rules"]);this.rules=r;for(const[l,o]of Object.entries(n))o!==void 0&&Object.prototype.hasOwnProperty.call(ls,l)&&(this[l]=o)}}get rules(){return m(this,e)}set rules(s){L(this,e,new Proxy(new Cl(s),{set:Wi,deleteProperty(){return!1}}))}getSeverity(s,i){return m(this,e).getSeverity(s,i)}},e=new WeakMap,t)}}),$a={};se($a,{Title:()=>Ta});var Ta,ju=C({"lib/title.ts"(){"use strict";var e,t,s,i,r,n;Ze(),ce(),Ta=(n=class{constructor(l,o,d,{temporary:u,decode:a,selfLink:h}={}){N(this,e);N(this,t);N(this,s);N(this,i);N(this,r);Fe(this,"valid");Fe(this,"encoded",!1);const c=l.trim().startsWith("../");if(a&&l.includes("%"))try{const p=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(l);l=Ht(l),this.encoded=p}catch(p){}if(l=ms(l).replace(/[_ ]+/gu," ").trim(),c)L(this,i,0);else{let p=o;l.startsWith(":")&&(p=0,l=l.slice(1).trim());const v=l.split(":");if(v.length>1){const x=mt(v[0]),b=Object.prototype.hasOwnProperty.call(d.nsid,x)&&d.nsid[x];b&&(p=b,l=v.slice(1).join(":").trim())}L(this,i,p)}const g=l.indexOf("#");if(g!==-1){let p=l.slice(g).trim().slice(1);if(p.includes("%"))try{p=Ht(p)}catch(v){}L(this,r,p.replace(/ /gu,"_")),l=l.slice(0,g).trim()}this.valid=!!(l||h&&this.ns===0&&m(this,r)!==void 0)&&ms(l)===l&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(c?/^(?:\.\.\/)+(.*)/u.exec(l)[1]:l),this.main=l,L(this,t,d.namespaces),L(this,s,d.articlePath||"/wiki/$1"),m(this,s).includes("$1")||L(this,s,m(this,s)+`${m(this,s).endsWith("/")?"":"/"}$1`),u||Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}})}get ns(){return m(this,i)}get fragment(){return m(this,r)}get main(){return m(this,e)}set main(l){l=l.replace(/_/gu," ").trim(),L(this,e,l&&l[0].toUpperCase()+l.slice(1))}get prefix(){const l=m(this,t)[this.ns];return l+(l&&":")}get title(){return this.getRedirection()[1]}get extension(){const{main:l}=this,o=l.lastIndexOf(".");return o===-1?void 0:l.slice(o+1).toLowerCase()}getRedirection(){return[!1,(this.prefix+this.main).replace(/ /gu,"_")]}setFragment(l){L(this,r,l)}getUrl(l){throw new Error("Title.getUrl method is only available in the LSP version!")}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakMap,n)}}),Ca={};se(Ca,{default:()=>I});Ia.exports=Q(Ca);var os,Mi,Il,Re,zi,Nl,I,B=C({"index.ts"(){Bl(),Ce(),Me(),ce(),Bu(),os=!0,Mi=new tn,Re={config:Hi,get rules(){return fs},get i18n(){return fe(fe({},Wl),Il)},set i18n(e){Il=e},get lintConfig(){return Mi},set lintConfig(e){Mi=new tn(e)},get viewOnly(){return os},set viewOnly(e){os&&!e&&we.rev++,os=e},getConfig(e){const t=e!=null?e:this.config,{doubleUnderscore:s,ext:i,parserFunction:r,variable:n}=t;for(let l=0;l<2;l++)s.length>l+2&&s[l].length===0&&(s[l]=Object.keys(s[l+2]));return i.includes("translate")&&!n.includes("translationlanguage")&&(n.push("translationlanguage"),Array.isArray(r[1])?r[1].push("TRANSLATIONLANGUAGE"):r[1].TRANSLATIONLANGUAGE="translationlanguage"),Le(fe(fe({},Hi),t),{excludes:[]})},msg(e,t=""){var s;return e&&((s=this.i18n[e])!=null?s:e).replace("$1",this.msg(t))},normalizeTitle(e,t=0,s,i=Re.getConfig(),r){const{Title:n}=(ju(),Q($a));let l;if(r!=null&&r.halfParsed)l=new n(e,t,i,r);else{const{Token:o}=(W(),Q(bs));l=we.run(()=>{const d=new o(e,i);d.type="root",d.parseOnce(0,s).parseOnce();const u=new n(d.toString(),t,i,r);d.build();for(const a of["main","fragment"]){const h=u[a];if(h!=null&&h.includes("\0")){const c=d.buildFromStr(h,1);a==="main"?u.main=c:u.setFragment(c)}}return u})}return l},parse(e,t,s=be,i=Re.getConfig()){e=jl(e);let r;typeof s!="number"&&(r=Array.isArray(s)?s:[s],s=Math.max(...r.map(o=>Ol[o]||be)));const{Token:n}=(W(),Q(bs));return we.run(()=>{const o=new n(e,i);return o.type="root",o.parse(s,t)})},async partialParse(e,t,s,i=Re.getConfig()){},createLanguageService(e={}){throw new Error("Parser.createLanguageService method is only available in the LSP version!")}},zi={},Nl=new Set(["lintConfig","normalizeTitle","parse","createLanguageService"]);for(const e in Re)Nl.has(e)||(zi[e]={enumerable:!1});Object.defineProperties(Re,zi),Object.assign(typeof globalThis=="object"?globalThis:self,{Parser:Re}),I=Re}});B()});qu();})();
|