wikiparser-node 1.24.0 → 1.25.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -2
- package/bundle/bundle-es8.min.js +23 -23
- package/bundle/bundle-lsp.min.js +36 -0
- package/bundle/bundle.min.js +29 -0
- package/dist/bin/config.js +1 -1
- package/dist/index.js +18 -10
- package/dist/lib/lsp.d.ts +2 -2
- package/dist/lib/lsp.js +2 -2
- package/dist/lib/text.js +2 -2
- package/dist/src/arg.js +2 -2
- package/dist/src/attribute.js +7 -7
- package/dist/src/attributes.js +3 -3
- package/dist/src/converterFlags.js +1 -1
- package/dist/src/extLink.js +1 -1
- package/dist/src/gallery.js +1 -1
- package/dist/src/heading.js +4 -4
- package/dist/src/html.js +6 -6
- package/dist/src/imageParameter.js +2 -2
- package/dist/src/imagemap.js +2 -2
- package/dist/src/index.js +1 -1
- package/dist/src/link/base.js +4 -4
- package/dist/src/link/file.js +6 -5
- package/dist/src/link/galleryImage.js +1 -1
- package/dist/src/link/index.js +1 -1
- package/dist/src/link/redirectTarget.js +1 -1
- package/dist/src/magicLink.js +3 -3
- package/dist/src/nested.js +1 -1
- package/dist/src/nowiki/comment.js +1 -1
- package/dist/src/nowiki/index.js +1 -1
- package/dist/src/nowiki/quote.js +2 -2
- package/dist/src/paramTag/index.js +1 -1
- package/dist/src/parameter.js +1 -1
- package/dist/src/table/index.js +2 -2
- package/dist/src/table/td.js +1 -1
- package/dist/src/table/trBase.js +1 -1
- package/dist/src/tagPair/ext.js +2 -2
- package/dist/src/tagPair/include.js +2 -2
- package/dist/src/transclude.js +4 -4
- package/dist/util/constants.js +2 -1
- package/dist/util/lint.js +10 -8
- package/extensions/dist/base.js +378 -0
- package/extensions/dist/codejar.js +57 -0
- package/extensions/dist/editor.js +159 -0
- package/extensions/dist/highlight.js +30 -0
- package/extensions/dist/lint.js +80 -0
- package/extensions/dist/lsp.js +89 -0
- package/extensions/editor.css +59 -0
- package/extensions/ui.css +1 -0
- package/i18n/en.json +77 -0
- package/i18n/zh-hans.json +71 -56
- package/i18n/zh-hant.json +71 -56
- package/package.json +1 -1
package/bundle/bundle-es8.min.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
"use strict";(()=>{var va=Object.defineProperty,ba=Object.defineProperties;var wa=Object.getOwnPropertyDescriptors;var En=Object.getOwnPropertySymbols;var ya=Object.prototype.hasOwnProperty,Sa=Object.prototype.propertyIsEnumerable;var jn=e=>{throw TypeError(e)};var Ns=(e,t,s)=>t in e?va(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,fe=(e,t)=>{for(var s in t||(t={}))ya.call(t,s)&&Ns(e,s,t[s]);if(En)for(var s of En(t))Sa.call(t,s)&&Ns(e,s,t[s]);return e},_e=(e,t)=>ba(e,wa(t));var ka=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ne=(e,t,s)=>Ns(e,typeof t!="symbol"?t+"":t,s),Ls=(e,t,s)=>t.has(e)||jn("Cannot "+s);var f=(e,t,s)=>(Ls(e,t,"read from private field"),s?s.call(e):t.get(e)),N=(e,t,s)=>t.has(e)?jn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),L=(e,t,s,i)=>(Ls(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),j=(e,t,s)=>(Ls(e,t,"access private method"),s);var Pn=(e,t,s,i)=>({set _(n){L(e,t,n,s)},get _(){return f(e,t,i)}});var _u=ka((Tu,ma)=>{var Aa=Object.create,pt=Object.defineProperty,Tl=Object.getOwnPropertyDescriptor,tn=Object.getOwnPropertyNames,_a=Object.prototype.hasOwnProperty,Cl=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),ft=e=>{throw TypeError(e)},Il=(e,t,s)=>t in e?pt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Rn=(e,t)=>pt(e,"name",{value:t,configurable:!0}),_=(e,t)=>function(){return e&&(t=(0,e[tn(e)[0]])(e=0)),t},$a=(e,t)=>function(){return t||(0,e[tn(e)[0]])((t={exports:{}}).exports,t),t.exports},te=(e,t)=>{for(var s in t)pt(e,s,{get:t[s],enumerable:!0})},Ta=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of tn(t))!_a.call(e,n)&&n!==s&&pt(e,n,{get:()=>t[n],enumerable:!(i=Tl(t,n))||i.enumerable});return e},Q=e=>Ta(pt({},"__esModule",{value:!0}),e),Y=e=>{var t;return[,,,Aa((t=e==null?void 0:e[Cl("metadata")])!=null?t:null)]},Nl=["class","method","getter","setter","accessor","field","value","get","set"],Tt=e=>e!==void 0&&typeof e!="function"?ft("Function expected"):e,Ca=(e,t,s,i,n)=>({kind:Nl[e],name:t,metadata:i,addInitializer:r=>s._?ft("Already initialized"):n.push(Tt(r||null))}),sn=(e,t)=>Il(t,Cl("metadata"),e[3]),X=(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},K=(e,t,s,i,n,r)=>{var l,o,a,h,u,d=t&7,g=!!(t&8),c=!!(t&16),p=d>3?e.length+1:d?g?1:2:0,b=Nl[d+5],m=d>3&&(e[p-1]=[]),x=e[p]||(e[p]=[]),w=d&&(!c&&!g&&(n=n.prototype),d<5&&(d>3||!c)&&Tl(d<4?n:{get[s](){return ae(this,r)},set[s](S){return xe(this,r,S)}},s));d?c&&d<4&&Rn(r,(d>2?"set ":d>1?"get ":"")+s):Rn(n,s);for(var y=i.length-1;y>=0;y--)h=Ca(d,s,a={},e[3],x),d&&(h.static=g,h.private=c,u=h.access={has:c?S=>Na(n,S):S=>s in S},d^3&&(u.get=c?S=>(d^1?ae:Mi)(S,n,d^4?r:w.get):S=>S[s]),d>2&&(u.set=c?(S,A)=>xe(S,n,A,d^4?r:w.set):(S,A)=>S[s]=A)),o=(0,i[y])(d?d<4?c?r:w[b]:d>4?void 0:{get:w.get,set:w.set}:n,h),a._=1,d^4||o===void 0?Tt(o)&&(d>4?m.unshift(o):d?c?r=o:w[b]=o:n=o):typeof o!="object"||o===null?ft("Object expected"):(Tt(l=o.get)&&(w.get=l),Tt(l=o.set)&&(w.set=l),Tt(l=o.init)&&m.unshift(l));return d||sn(e,n),w&&pt(n,s,w),c?d^4?r:w:n},Ia=(e,t,s)=>Il(e,typeof t!="symbol"?t+"":t,s),nn=(e,t,s)=>t.has(e)||ft("Cannot "+s),Na=(e,t)=>Object(t)!==t?ft('Cannot use the "in" operator on this value'):e.has(t),ae=(e,t,s)=>(nn(e,t,"read from private field"),s?s.call(e):t.get(e)),je=(e,t,s)=>t.has(e)?ft("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),xe=(e,t,s,i)=>(nn(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),Mi=(e,t,s)=>(nn(e,t,"access private method"),s),La=(e,t,s,i)=>({set _(n){xe(e,t,n,s)},get _(){return ae(e,t,i)}}),Ll,rn,Fl=_({"base.ts"(){"use strict";Ll=(()=>{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})(),rn=(()=>{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 me(e,t,s){return s===1?e.replace(/\0(\d+)g\x7F/gu,(i,n)=>me(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 Re,Fs,ut,ht,dt,et,El,be,Qe,On,Bn,Mt,jl,qn,Wn,Ut,ct,he=_({"util/string.ts"(){"use strict";Re=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,Fs=String.raw`[^[\]<>"\0-\x1F\x7F${Re}\uFFFD]`,ut=String.raw`(?:\[[\da-f:.]+\]|${Fs})`,ht=String.raw`(?:${Fs}|\0\d+[cn!~]\x7F)*`,dt=e=>e.trim().toLowerCase(),et=(e,t)=>s=>s.replace(e,t),El=et(/[\0\x7F]|\r$/gmu,""),be=et(/\0\d+[cn]\x7F/gu,""),Qe=(e,t="")=>e.map(s=>typeof s=="string"?s:s.text()).join(t),On={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},Bn=et(/&(?:#(\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)):On[s.toLowerCase()]),Mt=e=>Bn(e),jl=et(/&#(\d+|x[\da-f]+);/giu,(e,t)=>String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t))),qn={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},Wn=e=>et(e,t=>`&${qn[t]};`),Ut=Wn(/[&<>]/gu),ct=(e,t={})=>{const{pre:s="",post:i="",sep:n=""}=t;return s+e.map(r=>r.print()).join(n)+i}}}),Fa=$a({"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","#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:[]}}}),ve,Ui,Je=_({"util/constants.ts"(){"use strict";ve=11,Ui=Fa()}});function at(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 zt,Pl,Xe=_({"../common/dist/index.mjs"(){"use strict";zt=e=>decodeURIComponent(e.replace(/%(?![\da-f]{2})/giu,"%25")),Pl=at}}),ie,oe=_({"lib/rect.ts"(){"use strict";var e,t,s,i,zi,r;ie=(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 j(this,i,zi).call(this).top}get left(){return j(this,i,zi).call(this).left}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakSet,zi=function(){var l;return(l=f(this,s))!=null||L(this,s,f(this,e).getRootNode().posFromIndex(f(this,t))),f(this,s)},r)}}),Mn,Un,Wt,Hi,Es,O,J,ke,fs,D,ln,Oe,on,an,un,Ht,gt,hn,Ve,Rl,U=_({"util/lint.ts"(){"use strict";Xe(),Te(),oe(),q(),Mn=new Set(["tr","td","th","caption"]),Un=new Set(["Template:!!","Template:!-"]),Wt=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")&&Un.has(t.name)||t.is("html")&&Mn.has(t.name))return!1;if(t.is("arg"))return t.length>1&&Wt(t.childNodes[1]);if(t.is("magic-word"))try{const s=t.getPossibleValues().map(Wt);return s.includes(2)?2:s.includes(1)&&1}catch(s){}return t.is("template")||t.is("magic-word")&&t.name==="invoke"?1:2},Hi=(e,t,s,i)=>({line:e+s-1,character:(s===1?t:0)+i}),Es=e=>(t,s,i,n,r="error")=>{const{start:l}=s,{top:o,left:a}=s instanceof ie?s:new ie(t,l),{offsetHeight:h,offsetWidth:u}=t,{startIndex:d,startLine:g,startCol:c}=e(t,l,o,a),{line:p,character:b}=Hi(g,c,h,u);return{rule:i,message:k.msg(n),severity:r,startIndex:d,endIndex:d+t.toString().length,startLine:g,endLine:p,startCol:c,endCol:b}},O=Es((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}}),J=Es((e,t,s,i)=>({startIndex:t,startLine:s,startCol:i})),ke=(e,t,s,i=0)=>({desc:t,range:[e.startIndex+i,e.endIndex],text:s}),fs=(e,t,s)=>({desc:t,range:[e,e],text:s}),D=(e,t=0,s="")=>typeof e=="number"?{desc:"remove",range:[e,e+t],text:s}:ke(e,"remove",s,t),ln=(e,t)=>ke(e,"decode",zt(t.text().replace(/%(?=21|3[ce]|5[bd]|7[b-d])/giu,"%25"))),Oe=(e,t,s=0)=>({desc:"close",range:[e+s,e],text:t}),on=e=>({desc:"open",range:[e+1,e+2],text:""}),an=(e,t)=>ke(e,"comment",`<!--${t}-->`),un=(e,t)=>ke(e,"uppercase",t.toUpperCase()),Ht=(e,t=0)=>({desc:"whitespace",range:[e,e+t],text:" "}),gt=(e,t,s=1)=>({desc:"escape",range:[e,e+s],text:t.repeat(s)}),hn=(e,t)=>({desc:"escape",range:[e,e+t.length],text:t.replace(/\|/gu,"|")}),Ve=(e,t,s,i)=>{if(e&&(i||k.viewOnly&&e[0]===we.rev))return e[1];const n=t();return(i||k.viewOnly)&&s([we.rev,n]),n},Rl=(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"]:[]}}),zn,dn,Ol=_({"parser/selector.ts"(){"use strict";zn=(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},dn=(e,t,s)=>{const i=e.split(",");return({type:n,name:r})=>i.some(l=>zn(l.trim(),n,r))}}}),xs,cn=_({"mixin/cached.ts"(){"use strict";U(),xs=(e=!0)=>t=>{const s=new WeakMap;return function(...i){return Ve(s.get(this),()=>t.apply(this,i),n=>{s.set(this,n)},e)}}}}),Bl,Ea=_({"mixin/nodeLike.ts"(){"use strict";Bl=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}}}),Hn,Dn,Jt,vt,bt,Xt,wt,yt,St,De,ql=_({"lib/node.ts"(){"use strict";U(),Te(),cn(),Ea(),q(),Dn=[Bl],Hn=[xs(!1)],De=class{constructor(){X(St,5,this),Ia(this,"childNodes",[]),je(this,Jt),je(this,vt),je(this,bt),je(this,Xt),je(this,wt),je(this,yt,{})}get parentNode(){return ae(this,Jt)}get nextSibling(){return ae(this,vt)}get previousSibling(){return ae(this,bt)}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":xe(this,Jt,t),t||(xe(this,vt,void 0),xe(this,bt,void 0));break;case"nextSibling":xe(this,vt,t);break;case"previousSibling":xe(this,bt,t);break;case"aIndex":k.viewOnly&&xe(this,wt,[we.rev,t]);break;default:this[e]=t}}getRootNode(){return Ve(ae(this,Xt),()=>{var e,t;return(t=(e=this.parentNode)==null?void 0:e.getRootNode())!=null?t:this},e=>{const[,t]=e;t.type==="root"&&xe(this,Xt,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 Ve(ae(this,yt)[e],()=>{const{childNodes:t}=this,s=e+(e<0?t.length:0);let i=this.getAttribute("padding");for(let n=0;n<s;n++)k.viewOnly&&(ae(this,yt)[n]=[we.rev,i]),i+=t[n].toString().length+this.getGaps(n);return i},t=>{ae(this,yt)[e]=t})}getAbsoluteIndex(){return Ve(ae(this,wt),()=>{const{parentNode:e}=this;return e?e.getAbsoluteIndex()+this.getRelativeIndex():0},e=>{xe(this,wt,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!`)}},St=Y(null),Jt=new WeakMap,vt=new WeakMap,bt=new WeakMap,Xt=new WeakMap,wt=new WeakMap,yt=new WeakMap,K(St,1,"getLines",Hn,De),De=K(St,0,"AstNode",Dn,De),X(St,1,De)}}),Wl,ja=_({"mixin/elementLike.ts"(){"use strict";Ol(),Wl=e=>{var s,Di;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 a=o.getElementBy(l);if(a)return a}}querySelector(l){return this.getElementBy(j(this,s,Di).call(this,l))}getElementsBy(l,o=[]){for(const a of this.childNodes)a.type!=="text"&&(l(a)&&o.push(a),a.getElementsBy(l,o));return o}querySelectorAll(l){return this.getElementsBy(j(this,s,Di).call(this,l))}escape(){}}return s=new WeakSet,Di=function(l){return dn(l,this)},t}}}),Gn,js,Vn,Ct,Pa=_({"lib/element.ts"(){"use strict";he(),Te(),Ol(),ql(),ja(),Gn=[Wl],Ct=class extends(Vn=De){get length(){return this.childNodes.length}text(e){return Qe(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=dn(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":""}">`)+ct(this.childNodes,e)+(t===""?"":"</span>"):""}json(e,t=this.getAbsoluteIndex()){const s=_e(fe({},this),{type:this.type,range:[t,t+this.toString().length],childNodes:[]});for(let i=0,n=t+this.getAttribute("padding");i<this.length;i++){const r=this.childNodes[i],{length:l}=r.toString();r.setAttribute("aIndex",n),s.childNodes.push(r.type==="text"?{data:r.data,range:[n,n+l]}:r.json(void 0,n)),n+=l+this.getGaps(i)}return s}},js=Y(Vn),Ct=K(js,0,"AstElement",Gn,Ct),X(js,1,Ct)}}),Kt,Ps,Rs,Qn,Jn,Xn,Kn,Os,Bs,Gi,Ra=_({"lib/text.ts"(){"use strict";var e,Ml,s;he(),U(),q(),ql(),Kt=String.raw`[${Re}\t]*`,Ps=String.raw`[^\S\n]*`,Rs=String.raw`<${Ps}(?:/${Ps})?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|(?:rfc|pmid)(?=[-::]?${Kt}\d)|isbn(?=[-::]?${Kt}(?:\d(?:${Kt}|-)){6})`,Qn=new RegExp(String.raw`${Rs}|https?[:/]/+`,"giu"),Jn=new RegExp(Rs,"giu"),Xn=new Set(["attr-value","ext-link-text","link-text"]),Kn={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},Os=new Set(["html","head","style","title","body","a","audio","img","video","embed","iframe","object","canvas","script","col","colgroup","tbody","tfoot","thead","button","input","label","option","select","textarea"]);try{Bs=new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch(i){Bs=/\w/u}Gi=(s=class extends De{constructor(n){super();N(this,e);Ne(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 z,R,P;if(r===!1)return[];const{data:l,parentNode:o,nextSibling:a,previousSibling:h}=this;if(!o)throw new Error("An isolated text node cannot be linted!");const{type:u,name:d,parentNode:g}=o;if(u==="attr-value"){const{name:W,tag:H}=g;if(H==="ref"&&(W==="name"||W==="follow")||W==="group"&&(H==="ref"||H==="references")||H==="choose"&&(W==="before"||W==="after"))return[]}if(r!=null||(r=u==="free-ext-link"||u==="ext-link-url"||u==="ext-link-text"||u==="image-parameter"&&d==="link"||u==="attr-value"?Jn:Qn),l.search(r)===-1)return[];r.lastIndex=0;const c=[],p=a==null?void 0:a.type,b=a==null?void 0:a.name,m=h==null?void 0:h.type,x=this.getRootNode(),w=x.toString(),{ext:y,html:S,variants:A}=x.getAttribute("config"),{top:T,left:v}=x.posFromIndex(n),$=k.lintConfig["tag-like"],C=typeof $=="number"?new Set:new Set(Object.keys($[1]).filter(W=>W!=="invalid"&&W!=="disallowed")),I=new Set(["onlyinclude","noinclude","includeonly",...y,...S[0],...S[1],...S[2],...C,...Os]);for(let W=r.exec(l);W;W=r.exec(l)){const[,H,ge]=W;let{index:ee,0:M}=W;if(ge&&ge!=="]"){const{length:de}=ge;ee+=de,M=M.slice(de)}M=M.toLowerCase();const[F]=M,V=F==="r"||F==="p"||F==="i",G=F==="{",Z=F==="}",ne=F==="[",le=F==="]";let{length:re}=M;if(F==="<"&&!I.has(H.toLowerCase())||ne&&u==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(l.slice(ee+1))||a!=null&&a.is("ext")&&b==="nowiki"&&((z=a.innerText)!=null&&z.includes("]")))||V&&(!o.isPlain()||Xn.has(u)))continue;le&&(ee||re>1)&&r.lastIndex--;let Ce=n+ee,Qt=Ce+re,pe,Ie;const Me=w[Qt],_s=w[Ce-1],$s=G||ne,Ts=G&&_s==="-"&&A.length>0,Cs=Z&&Me==="-"&&A.length>0,Cn=ne&&p==="free-ext-link"&&!l.slice(ee+1).trim()||le&&m==="free-ext-link"&&!l.slice(0,ee).includes("]");if(V)pe="lonely-http",M=M.toUpperCase(),Ie=k.lintConfig.getSeverity(pe,M);else if(F==="<"){pe="tag-like";let de;/^<\/?\s/u.test(M)||!/[\s/>]/u.test(Me!=null?Me:"")?de="invalid":C.has(H)?de=H:Os.has(H)&&!y.includes(H)&&(de="disallowed"),Ie=k.lintConfig.getSeverity(pe,de)}else if(Ts||Cs)pe="lonely-bracket",Ie=k.lintConfig.getSeverity(pe,"converter"),Ts&&ee>0?(M="-{",ee--,Ce--,re=2):Cs&&ee<l.length-1&&(M="}-",Qt++,re=2);else if(Cn)pe="lonely-bracket",Ie=k.lintConfig.getSeverity(pe,"extLink");else if($s||Z||le)if(pe="lonely-bracket",re>1||G&&Me===F||Z&&_s===F)Ie=k.lintConfig.getSeverity(pe,"double");else{if(!ne||u!=="ext-link-text"){const de=Kn[F],Is=$s?l.slice(ee+1):l.slice(0,ee);if(G&&((R=de.exec(Is))==null?void 0:R[0])==="}"||Z&&((P=de.exec(Is))==null?void 0:P[0])==="{")continue;if(!Is.includes(F)){const Fn=$s?"nextSibling":"previousSibling";let ze=this[Fn];for(;ze&&(ze.type!=="text"||!de.test(ze.data));)ze=ze[Fn];if(ze&&de.exec(ze.data)[0]!==F)continue}}Ie=k.lintConfig.getSeverity(pe,"single")}else pe="lonely-http",Ie=k.lintConfig.getSeverity(pe);if(!Ie)continue;const In=this.posFromIndex(ee),{line:Nn,character:Ln}=Hi(T,v,In.top+1,In.left),Ue={rule:pe,message:k.msg('lonely "$1"',V||F==="h"||Ts||Cs?M:F),severity:Ie,startIndex:Ce,endIndex:Qt,startLine:Nn,endLine:Nn,startCol:Ln,endCol:Ln+re};if(F==="<")Ue.suggestions=[gt(Ce,"<")];else if(F==="h"&&u!=="link-text"&&Bs.test(_s||""))Ue.suggestions=[Ht(Ce)];else if(ne&&u==="ext-link-text"){const de=o.getAbsoluteIndex()+o.toString().length;Ue.suggestions=[gt(de,"]")]}else if(le&&Cn){const de=n-h.toString().length;Ue.suggestions=[fs(de,"left bracket","[")]}else V&&(Ue.suggestions=[...W[0]===M?[]:[un(Ue,M)],...Me===":"||Me===":"?[Ht(Qt,1)]:[]]);c.push(Ue)}return c}replaceData(n){j(this,e,Ml).call(this,n)}splitText(n){this.lspError("AstText.splitText")}escape(){}print(){return Ut(this.data)}},e=new WeakSet,Ml=function(n){this.setAttribute("data",n)},s)}}),Ke,xt=_({"mixin/hidden.ts"(){"use strict";Ke=(e=!0,t=!0)=>s=>{class i extends s{text(){return""}lint(r){return e?[]:super.lint(r)}}return i}}}),$e,Le=_({"mixin/noEscape.ts"(){"use strict";$e=e=>{class t extends e{escape(){}}return t}}}),Ye,mt=_({"src/syntax.ts"(){"use strict";var e,t;B(),Ye=(t=class extends E{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)}}),Fe,Be=_({"mixin/padded.ts"(){"use strict";Fe=({length:e})=>t=>{class s extends t{getAttribute(n){return n==="padding"?e:super.getAttribute(n)}}return s}}}),ce,qe=_({"src/atom.ts"(){"use strict";var e,t;B(),ce=(t=class extends E{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)}}),Yn,Zn,qs,er,Pe,ms=_({"src/link/base.ts"(){"use strict";var e,t,s,i;U(),Je(),oe(),Be(),Le(),q(),B(),qe(),Yn=n=>n==="redirect-target"||n==="link",Zn=[$e,Fe("[[")],Pe=(i=class extends(er=E){constructor(r,l,o,a=[],h="|"){super(void 0,o,a,{});N(this,e,!0);N(this,t);N(this,s);if(this.insertAt(new ce(r,"link-target",o,a,{})),l!==void 0){const u=new E(l,o,a,{});u.type="link-text",u.setAttribute("stage",ve-1),this.insertAt(u)}L(this,t,h)}get link(){}get fragment(){return f(this,s).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:[a,h],type:u}=this,{encoded:d,fragment:g}=f(this,s),c=new ie(this,r);let p="unknown-page",b=k.lintConfig.getSeverity(p);if(b&&a.childNodes.some(({type:m})=>m==="template")&&o.push(O(a,c,p,"template in an internal link target",b)),p="url-encoding",b=k.lintConfig.getSeverity(p),b&&d){const m=O(a,c,p,"unnecessary URL encoding in an internal link",b);m.fix=ln(m,a),o.push(m)}if(p="pipe-like",b=k.lintConfig.getSeverity(p,"link"),b&&(u==="link"||u==="category")){const m=h==null?void 0:h.childNodes.findIndex(w=>w.type==="text"&&w.data.includes("|")),x=h==null?void 0:h.childNodes[m];if(x){const w=O(h,c,p,'additional "|" in the link text',b),y=w.startIndex+h.getRelativeIndex(m);w.suggestions=[hn(y,x.data)],o.push(w)}}if(p="no-ignored",b=k.lintConfig.getSeverity(p,"fragment"),b&&g!==void 0&&!Yn(u)){const m=O(a,c,p,"useless fragment",b),x=a.childNodes.findIndex(y=>y.type==="text"&&y.data.includes("#")),w=a.childNodes[x];w&&(m.fix=D(m,a.getRelativeIndex(x)+w.data.indexOf("#"))),o.push(m)}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),{type:a,fragment:h}=this;return h!==void 0&&(a==="link"||a==="redirect-target")&&(o.fragment=h),o}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i),qs=Y(er),Pe=K(qs,0,"LinkBaseToken",Zn,Pe),X(qs,1,Pe)}}),tr,Ws,sr,Ae,Ze=_({"src/nowiki/base.ts"(){"use strict";Le(),B(),tr=[$e],Ae=class extends(sr=E){get innerText(){return this.firstChild.data}constructor(e="",t,s){super(e,t,s)}},Ws=Y(sr),Ae=K(Ws,0,"NowikiBaseToken",tr,Ae),X(Ws,1,Ae)}}),ir,Ms,nr,ue,We=_({"src/nowiki/noinclude.ts"(){"use strict";xt(),Ze(),ir=[Ke()],ue=class extends(nr=Ae){get type(){return"noinclude"}toString(e){return e?"":super.toString()}},Ms=Y(nr),ue=K(Ms,0,"NoincludeToken",ir,ue),X(Ms,1,ue)}}),Ul,Oa=_({"src/link/redirectTarget.ts"(){"use strict";U(),q(),ms(),We(),Ul=class extends Pe{get type(){return"redirect-target"}constructor(e,t,s,i){super(e,void 0,s,i),t!==void 0&&this.insertAt(new ue(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",i=k.lintConfig.getSeverity(s,"redirect");if(i&&this.length===2){const n=O(this.lastChild,{start:e},s,"useless link text",i);n.startIndex--,n.startCol--,n.fix=D(n),t.push(n)}return t}}}}),rr,Us,lr,It,Ba=_({"src/redirect.ts"(){"use strict";var e,t,s;xt(),Le(),B(),mt(),Oa(),rr=[Ke(!1,!1),$e],It=(s=class extends(lr=E){constructor(n,r,l,o,a,h,u=[]){super(void 0,h,u);N(this,e);N(this,t);L(this,e,n),L(this,t,a),this.append(new Ye(r,"redirect-syntax",h,u),new Ul(l,o==null?void 0:o.slice(1),h,u))}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),Us=Y(lr),It=K(Us,0,"RedirectToken",rr,It),X(Us,1,It)}}),zl={};te(zl,{parseRedirect:()=>Hl});var Hl,qa=_({"parser/redirect.ts"(){"use strict";q(),Ba(),Hl=(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&&k.normalizeTitle(i[3],0,!1,t,{halfParsed:!0,temporary:!0,decode:!0}).valid?(e=`\0${s.length}o${e.slice(i[0].length)}`,new It(...i.slice(1),t,s),e):!1}}}),or,zs,ar,Nt,Wa=_({"src/onlyinclude.ts"(){"use strict";Be(),Le(),B(),or=[$e,Fe("<onlyinclude>")],Nt=class extends(ar=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>'})}},zs=Y(ar),Nt=K(zs,0,"OnlyincludeToken",or,Nt),X(zs,1,Nt)}}),Gt,vs=_({"mixin/gapped.ts"(){"use strict";Gt=(e=1)=>t=>{class s extends t{getGaps(){return e}}return s}}}),ur,Hs,hr,Ge,gn=_({"src/tagPair/index.ts"(){"use strict";var e,t;vs(),Le(),B(),ur=[Gt(),$e],Ge=(t=class extends(hr=E){constructor(i,n,r,l,o,a=[]){super(void 0,o);N(this,e);Ne(this,"closed");Ne(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 h=typeof n=="string"?-1:a.indexOf(n);a.splice(h===-1?1/0:h,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(i){const{selfClosing:n,firstChild:r,lastChild:l}=this,[o,a]=f(this,e);return n?`<${o}${r.toString(i)}/>`:`<${o}${r.toString(i)}>${l.toString(i)}${this.closed?`</${a}>`:""}`}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),Hs=Y(hr),Ge=K(Hs,0,"TagPairToken",ur,Ge),X(Hs,1,Ge)}}),Dl,Ma=_({"src/tagPair/translate.ts"(){"use strict";var e,Gl,s;B(),gn(),mt(),We(),Dl=(s=class extends Ge{constructor(n,r,l,o=[]){const a=new Ye(n,"translate-attr",l,o);r=r==null?void 0:r.replace(/(<tvar\|[^>]+>)([\s\S]*?)(<\/>)/gu,(u,d,g,c)=>(new ue(d,l,o),new ue(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,(u,d,g,c,p)=>(new ue(d,l,o),new ue(p,l,o),`\0${o.length-1}n${c}\0${o.length}n`));const h=new E(r,l,o);h.type="translate-inner";super("translate",a,h,"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${j(this,e,Gl).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,Gl=function(){return this.firstChild.toString()===" nowrap"},s)}}),dr,Ds,cr,Lt,Ua=_({"src/tagPair/include.ts"(){"use strict";U(),oe(),xt(),q(),gn(),dr=[Ke(!1)],Lt=class extends(cr=Ge){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 ie(this,e),l=["no-ignored","unclosed-comment"],o=l.map(a=>k.lintConfig.getSeverity(a,"include"));if(o[0]&&s.data.trim()){const a=O(s,r,l[0],"useless attribute",o[0]);a.suggestions=[D(a)],t.push(a)}if(o[1]&&!i){const a=J(this,r,l[1],k.msg("unclosed $1",`<${n}>`),o[1]);a.suggestions=[Oe(a.endIndex,`</${n}>`)],t.push(a)}return t}},Ds=Y(cr),Lt=K(Ds,0,"IncludeToken",dr,Lt),X(Ds,1,Lt)}}),bs,pn=_({"mixin/attributesParent.ts"(){"use strict";bs=(e=0)=>t=>{var i,Vl;class s extends t{constructor(){super(...arguments);N(this,i)}hasAttr(o){this.lspError("AttributesParent.hasAttr")}getAttr(o){return j(this,i,Vl).call(this).getAttr(o)}}return i=new WeakSet,Vl=function(){return this.childNodes[e]},s}}}),se,Gs,Vs,kt,Yt,Qs,He,Js,Xs,Ks,Zt,Ys,ye,Ql,Jl,Xl,Kl,za=_({"util/sharable.ts"(){"use strict";se=new Set(["align"]),Gs=new Set(["cite"]),Vs=new Set(["cite","datetime"]),kt=new Set(["width"]),Yt=new Set(["axis","align","bgcolor","height","width","valign"]),Qs=new Set([...Yt,"abbr","headers","scope","rowspan","colspan"]),He=new Set(["type"]),Js=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),Xs=new Set(["clear"]),Ks=new Set(["bgcolor","align","valign"]),Zt=new Set(["qid","forcemathmode","type","display"]),Ys=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),ye=new Set,Ql=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"]),Jl={div:se,h1:se,h2:se,h3:se,h4:se,h5:se,h6:se,blockquote:Gs,q:Gs,p:se,br:Xs,pre:kt,ins:Vs,del:Vs,ul:He,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...Js,"border"]),caption:se,tr:Ks,td:Qs,th:Qs,font:new Set(["size","color","face"]),hr:kt,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:He,poem:se,categorytree:se,combooption:se,math:ye,chem:ye,ce:ye,img:new Set(["alt","src","width","height","loading","srcset"])},Xl={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:ye,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:ye,inputbox:ye,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:ye,poll:new Set(["id","show-results-before-voting"]),sm2:He,flashmp3:He,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([...Zt,"chem"]),chem:Zt,ce:Zt,hiero:ye,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:Ys,syntaxhighlight:Ys,templatedata:ye,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:ye},Kl={table:Js,td:new Set([...Yt,"scope"]),th:Yt,br:Xs,caption:se,div:se,hr:kt,h1:se,h2:se,h3:se,h4:se,h5:se,h6:se,li:He,p:se,pre:kt,tr:Ks,ul:He}}}),gr,pr,fr,xr,ls,Ha=_({"src/attribute.ts"(){"use strict";var e,t,s,i,n,Vi,l;U(),he(),Je(),za(),oe(),q(),B(),qe(),gr=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,pr=/(?:^|\s|\*\/)(?:javascript|vbscript)(?:\W|$)/iu,fr=new Set(["ext","arg","magic-word","template"]),xr=new Set(["about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),ls=(l=class extends E{constructor(a,h,u,d="",g,c=[],p=k.getConfig(),b=[]){const m=new ce(u,"attr-key",p,b);let x;if(u==="title"||h==="img"&&u==="alt")x=new E(g,p,b,{}),x.type="attr-value",x.setAttribute("stage",ve-1);else if(h==="gallery"&&u==="caption"||h==="choose"&&(u==="before"||u==="after")){const w=_e(fe({},p),{excludes:[...p.excludes,"heading","html","table","hr","list"]});x=new E(g,w,b,{}),x.type="attr-value",x.setAttribute("stage",1)}else x=new ce(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,a),this.append(m,x),L(this,s,d),L(this,i,[...c]),L(this,t,h),this.setAttribute("name",dt(be(u)))}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",dt(this.firstChild.text())),super.afterBuild()}toString(a){const[h="",u=""]=f(this,i);return f(this,s)?super.toString(a,f(this,s)+h)+u:this.firstChild.toString(a)}text(){return f(this,s)?`${super.text(`${f(this,s).trim()}"`)}"`:this.firstChild.text()}getGaps(){var a,h;return f(this,s)?f(this,s).length+((h=(a=f(this,i)[0])==null?void 0:a.length)!=null?h:0):0}lint(a=this.getAbsoluteIndex(),h){var S;const u=super.lint(a,h),{balanced:d,firstChild:g,lastChild:c,name:p,tag:b}=this,m=new ie(this,a),x=["unclosed-quote","obsolete-attr"],w=x.map(A=>k.lintConfig.getSeverity(A,p));if(w[0]&&!d){const A=O(c,m,x[0],k.msg("unclosed $1","quotes"),w[0]);A.startIndex--,A.startCol--,A.suggestions=[Oe(A.endIndex,f(this,i)[0])],u.push(A)}const y=j(this,n,Vi).call(this,a,m);return y&&u.push(y),w[1]&&((S=Kl[b])!=null&&S.has(p))&&u.push(O(g,m,x[1],"obsolete attribute",w[1])),u}getValue(){return f(this,s)?this.lastChild.text().trim():this.type==="ext-attr"||""}escape(){}getAttribute(a){return a==="invalid"?j(this,n,Vi).call(this):super.getAttribute(a)}print(){const[a="",h=""]=f(this,i);return f(this,s)?super.print({sep:Ut(f(this,s))+a,post:h}):super.print()}json(a,h=this.getAbsoluteIndex()){const u=super.json(void 0,h);return u.tag=this.tag,u}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,n=new WeakSet,Vi=function(a,h){const{firstChild:u,lastChild:d,type:g,name:c,tag:p,parentNode:b}=this,m=!d.childNodes.some(({type:T})=>fr.has(T)),x=this.getValue(),w=Xl[p],y=Jl[p],{length:S}=this.toString();let A="illegal-attr";if(!(w!=null&&w.has(c))&&!(y!=null&&y.has(c))&&(g==="ext-attr"?w||y:!/\{\{[^{]+\}\}/u.test(c))&&(g==="ext-attr"&&!y||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(c)&&(p==="meta"||p==="link"||!Ql.has(c)))||(c==="itemtype"||c==="itemid"||c==="itemref")&&!(b!=null&&b.hasAttr("itemscope"))){if(a===void 0)return!0;const T=k.lintConfig.getSeverity(A,"unknown");if(T){const v=O(u,h,A,"illegal attribute name",T);return v.suggestions=[D(a,S)],v}}else if(c==="style"&&typeof x=="string"&&gr.test(x)){if(a===void 0)return!0;A="insecure-style";const T=k.lintConfig.getSeverity(A);return T&&O(d,h,A,"insecure style",T)}else if(c==="tabindex"&&typeof x=="string"&&x!=="0"){if(a===void 0)return!0;const T=k.lintConfig.getSeverity(A,"tabindex");if(T){const v=O(d,h,A,"nonzero tabindex",T);return v.suggestions=[D(a,S),ke(v,"0 tabindex","0")],v}}else if(m&&g!=="ext-attr"){const T=Rl(p,c),v=String(x).toLowerCase();if(T.length>0&&T.every($=>$!==v)){if(a===void 0)return!0;const $=k.lintConfig.getSeverity(A,"value");return $&&O(d,h,A,"illegal attribute value",$)}}else if(typeof x=="string"&&((/^xmlns:[\w:.-]+$/u.test(c)||xr.has(c))&&pr.test(x)||m&&(c==="href"||p==="img"&&c==="src")&&!new RegExp(String.raw`^(?:${this.getAttribute("config").protocol}|//)\S+$`,"iu").test(x))){if(a===void 0)return!0;const T=k.lintConfig.getSeverity(A,"value");return T&&O(d,h,A,"illegal attribute value",T)}return!1},l)}}),Zs,mr,ei,ws,fn=_({"src/attributes.ts"(){"use strict";var e,t,os,i;U(),he(),oe(),q(),B(),qe(),Ha(),Zs=n=>n.slice(0,-1),mr=n=>`${Zs(n)}-dirty`;try{ei=new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch(n){ei=/[^\W_]/u}ws=(i=class extends E{constructor(r,l,o,a,h=[]){super(void 0,a,h,{});N(this,t);N(this,e);if(L(this,e,l),this.setAttribute("name",o),r){const u=/([^\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 d="",g=u.exec(r),c=0;const p=()=>{d&&(super.insertAt(new ce(d,mr(l),a,h,{})),d="")};for(;g;){const{index:b,0:m,1:x,2:w,3:y,4:S,5:A,6:T}=g;if(d+=r.slice(c,b),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(be(x).trim())){const v=S!=null?S:T,$=[y,A],C=new ls(Zs(l),o,x,w,v,$,a,h);p(),super.insertAt(C)}else d+=m;({lastIndex:c}=u),g=u.exec(r)}d+=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 ls&&(!r||l.name===dt(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:a,childNodes:h}=this,u=new Map,d=new Set,g=new ie(this,r),c=["no-ignored","no-duplicate"],p=["closingTag","invalidAttributes","nonWordAttributes"].map(m=>k.lintConfig.getSeverity(c[0],m));if(p[0]&&j(this,t,os).call(this)){const m=J(this,g,c[0],"attributes of a closing tag",p[0]),x=a.getAbsoluteIndex();m.suggestions=[D(m),on(x)],o.push(m)}for(const m of h)if(m instanceof ls){const{name:x}=m;u.has(x)?(d.add(x),u.get(x).push(m)):u.set(x,[m])}else{const x=m.text().trim(),w=p[ei.test(x)?1:2];if(x&&w){const y=O(m,g,c[0],"containing invalid attribute",w);y.suggestions=[D(y,0," ")],o.push(y)}}const b=k.lintConfig.getSeverity(c[1],"attribute");if(b&&d.size>0)for(const m of d){const x=u.get(m).map(w=>{const y=w.getValue();return[w,y===!0?"":y]});o.push(...x.map(([w,y],S)=>{const A=O(w,g,c[1],k.msg("duplicated $1 attribute",m),b),T=D(A);return!y||x.slice(0,S).some(([,v])=>v===y)?A.fix=T:A.suggestions=[T],A}))}return o}getAttribute(r){return r==="invalid"?j(this,t,os).call(this):super.getAttribute(r)}print(){return this.toString()?`<span class="wpb-${this.type}${j(this,t,os).call(this)?" wpb-invalid":""}">${this.childNodes.map(r=>r.print(r instanceof ce?{class:r.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}},e=new WeakMap,t=new WeakSet,os=function(){const{parentNode:r}=this;return(r==null?void 0:r.type)==="html"&&r.closing&&this.text().trim()!==""},i)}}),Yl={};te(Yl,{PreToken:()=>Zl});var Zl,Da=_({"src/pre.ts"(){"use strict";Je(),B(),We(),Zl=class extends E{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),a=0,h="";for(;l&&o;)new ue(l[0],t,s),new ue(o[0],t,s),h+=`${e.slice(a,l.index)}\0${s.length-1}n${e.slice(l.index+r,o.index)}\0${s.length}n`,a=o.index+r+1,i.lastIndex=a,l=i.exec(e),l&&(n.lastIndex=l.index+r),o=n.exec(e);e=h+e.slice(a)}super(e,t,s,{}),this.setAttribute("stage",ve-1)}isPlain(){return!0}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*\/\s*(pre)\b/giu)}}}}),ys,xn=_({"mixin/multiLine.ts"(){"use strict";ys=e=>{class t extends e{toString(i){return super.toString(i,`
|
|
1
|
+
"use strict";(()=>{var ya=Object.defineProperty,Sa=Object.defineProperties;var ka=Object.getOwnPropertyDescriptors;var En=Object.getOwnPropertySymbols;var Aa=Object.prototype.hasOwnProperty,_a=Object.prototype.propertyIsEnumerable;var jn=e=>{throw TypeError(e)};var Ns=(e,t,s)=>t in e?ya(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,ce=(e,t)=>{for(var s in t||(t={}))Aa.call(t,s)&&Ns(e,s,t[s]);if(En)for(var s of En(t))_a.call(t,s)&&Ns(e,s,t[s]);return e},_e=(e,t)=>Sa(e,ka(t));var $a=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ne=(e,t,s)=>Ns(e,typeof t!="symbol"?t+"":t,s),Ls=(e,t,s)=>t.has(e)||jn("Cannot "+s);var f=(e,t,s)=>(Ls(e,t,"read from private field"),s?s.call(e):t.get(e)),N=(e,t,s)=>t.has(e)?jn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),L=(e,t,s,i)=>(Ls(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),j=(e,t,s)=>(Ls(e,t,"access private method"),s);var Pn=(e,t,s,i)=>({set _(n){L(e,t,n,s)},get _(){return f(e,t,i)}});var Cu=$a((Nu,wa)=>{var Ta=Object.create,pt=Object.defineProperty,Cl=Object.getOwnPropertyDescriptor,tn=Object.getOwnPropertyNames,Ca=Object.prototype.hasOwnProperty,Il=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),ft=e=>{throw TypeError(e)},Nl=(e,t,s)=>t in e?pt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Rn=(e,t)=>pt(e,"name",{value:t,configurable:!0}),_=(e,t)=>function(){return e&&(t=(0,e[tn(e)[0]])(e=0)),t},Ll=(e,t)=>function(){return t||(0,e[tn(e)[0]])((t={exports:{}}).exports,t),t.exports},te=(e,t)=>{for(var s in t)pt(e,s,{get:t[s],enumerable:!0})},Ia=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of tn(t))!Ca.call(e,n)&&n!==s&&pt(e,n,{get:()=>t[n],enumerable:!(i=Cl(t,n))||i.enumerable});return e},Q=e=>Ia(pt({},"__esModule",{value:!0}),e),Y=e=>{var t;return[,,,Ta((t=e==null?void 0:e[Il("metadata")])!=null?t:null)]},Fl=["class","method","getter","setter","accessor","field","value","get","set"],Tt=e=>e!==void 0&&typeof e!="function"?ft("Function expected"):e,Na=(e,t,s,i,n)=>({kind:Fl[e],name:t,metadata:i,addInitializer:r=>s._?ft("Already initialized"):n.push(Tt(r||null))}),sn=(e,t)=>Nl(t,Il("metadata"),e[3]),X=(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},K=(e,t,s,i,n,r)=>{var l,o,a,d,u,h=t&7,g=!!(t&8),c=!!(t&16),p=h>3?e.length+1:h?g?1:2:0,b=Fl[h+5],x=h>3&&(e[p-1]=[]),m=e[p]||(e[p]=[]),w=h&&(!c&&!g&&(n=n.prototype),h<5&&(h>3||!c)&&Cl(h<4?n:{get[s](){return ae(this,r)},set[s](S){return me(this,r,S)}},s));h?c&&h<4&&Rn(r,(h>2?"set ":h>1?"get ":"")+s):Rn(n,s);for(var y=i.length-1;y>=0;y--)d=Na(h,s,a={},e[3],m),h&&(d.static=g,d.private=c,u=d.access={has:c?S=>Fa(n,S):S=>s in S},h^3&&(u.get=c?S=>(h^1?ae:Mi)(S,n,h^4?r:w.get):S=>S[s]),h>2&&(u.set=c?(S,A)=>me(S,n,A,h^4?r:w.set):(S,A)=>S[s]=A)),o=(0,i[y])(h?h<4?c?r:w[b]:h>4?void 0:{get:w.get,set:w.set}:n,d),a._=1,h^4||o===void 0?Tt(o)&&(h>4?x.unshift(o):h?c?r=o:w[b]=o:n=o):typeof o!="object"||o===null?ft("Object expected"):(Tt(l=o.get)&&(w.get=l),Tt(l=o.set)&&(w.set=l),Tt(l=o.init)&&x.unshift(l));return h||sn(e,n),w&&pt(n,s,w),c?h^4?r:w:n},La=(e,t,s)=>Nl(e,typeof t!="symbol"?t+"":t,s),nn=(e,t,s)=>t.has(e)||ft("Cannot "+s),Fa=(e,t)=>Object(t)!==t?ft('Cannot use the "in" operator on this value'):e.has(t),ae=(e,t,s)=>(nn(e,t,"read from private field"),s?s.call(e):t.get(e)),je=(e,t,s)=>t.has(e)?ft("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),me=(e,t,s,i)=>(nn(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),Mi=(e,t,s)=>(nn(e,t,"access private method"),s),Ea=(e,t,s,i)=>({set _(n){me(e,t,n,s)},get _(){return ae(e,t,i)}}),El,rn,jl=_({"base.ts"(){"use strict";El=(()=>{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})(),rn=(()=>{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 xe(e,t,s){return s===1?e.replace(/\0(\d+)g\x7F/gu,(i,n)=>xe(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 Re,Fs,ut,dt,ht,et,Pl,be,Qe,On,Bn,Mt,Rl,qn,Wn,zt,ct,de=_({"util/string.ts"(){"use strict";Re=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,Fs=String.raw`[^[\]<>"\0-\x1F\x7F${Re}\uFFFD]`,ut=String.raw`(?:\[[\da-f:.]+\]|${Fs})`,dt=String.raw`(?:${Fs}|\0\d+[cn!~]\x7F)*`,ht=e=>e.trim().toLowerCase(),et=(e,t)=>s=>s.replace(e,t),Pl=et(/[\0\x7F]|\r$/gmu,""),be=et(/\0\d+[cn]\x7F/gu,""),Qe=(e,t="")=>e.map(s=>typeof s=="string"?s:s.text()).join(t),On={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},Bn=et(/&(?:#(\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)):On[s.toLowerCase()]),Mt=e=>Bn(e),Rl=et(/&#(\d+|x[\da-f]+);/giu,(e,t)=>String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t))),qn={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},Wn=e=>et(e,t=>`&${qn[t]};`),zt=Wn(/[&<>]/gu),ct=(e,t={})=>{const{pre:s="",post:i="",sep:n=""}=t;return s+e.map(r=>r.print()).join(n)+i}}}),ja=Ll({"i18n/en.json"(e,t){t.exports={"attributes-of-closing-tag":"attributes of a closing tag","bold-apostrophes":"bold apostrophes","bold-in-header":"bold in 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 id","duplicate-image-parameter":"duplicate image $1 parameter","duplicate-parameter":"duplicate 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-comment":"HTML comment","html-in-table":"HTML tag in table attributes","illegal-attribute-name":"illegal attribute name","illegal-attribute-value":"illegal attribute value","illegal-module":"illegal 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":"containing invalid attribute","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":"left bracket","link-in-extlink":"internal link in an external link",lonely:'lonely "$1"',"missing-function":"missing module function",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',quotes:null,remove:null,table:null,"template-in-link":"template in an internal link target","unbalanced-in-section-header":"unbalanced $1 in a section header",unclosed:"unclosed $1","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 URL 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}}}),Pa=Ll({"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","#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:[]}}}),ve,Ol,zi,Je=_({"util/constants.ts"(){"use strict";ve=11,Ol=ja(),zi=Pa()}});function at(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 Ut,Bl,Xe=_({"../common/dist/index.mjs"(){"use strict";Ut=e=>decodeURIComponent(e.replace(/%(?![\da-f]{2})/giu,"%25")),Bl=at}}),ie,oe=_({"lib/rect.ts"(){"use strict";var e,t,s,i,Ui,r;ie=(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 j(this,i,Ui).call(this).top}get left(){return j(this,i,Ui).call(this).left}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakSet,Ui=function(){var l;return(l=f(this,s))!=null||L(this,s,f(this,e).getRootNode().posFromIndex(f(this,t))),f(this,s)},r)}}),Mn,zn,Wt,Hi,Es,O,J,ke,fs,D,ln,Oe,on,an,un,Ht,gt,dn,Ve,ql,z=_({"util/lint.ts"(){"use strict";Xe(),Te(),oe(),q(),Mn=new Set(["tr","td","th","caption"]),zn=new Set(["Template:!!","Template:!-"]),Wt=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")&&zn.has(t.name)||t.is("html")&&Mn.has(t.name))return!1;if(t.is("arg"))return t.length>1&&Wt(t.childNodes[1]);if(t.is("magic-word"))try{const s=t.getPossibleValues().map(Wt);return s.includes(2)?2:s.includes(1)&&1}catch(s){}return t.is("template")||t.is("magic-word")&&t.name==="invoke"?1:2},Hi=(e,t,s,i)=>({line:e+s-1,character:(s===1?t:0)+i}),Es=e=>(t,s,i,n,r="error")=>{const{start:l}=s,{top:o,left:a}=s instanceof ie?s:new ie(t,l),{offsetHeight:d,offsetWidth:u}=t,{startIndex:h,startLine:g,startCol:c}=e(t,l,o,a),{line:p,character:b}=Hi(g,c,d,u);return{rule:i,message:k.msg(n),severity:r,startIndex:h,endIndex:h+t.toString().length,startLine:g,endLine:p,startCol:c,endCol:b}},O=Es((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}}),J=Es((e,t,s,i)=>({startIndex:t,startLine:s,startCol:i})),ke=(e,t,s,i=0)=>({desc:k.msg(t),range:[e.startIndex+i,e.endIndex],text:s}),fs=(e,t,s)=>({desc:k.msg(t),range:[e,e],text:s}),D=(e,t=0,s="")=>typeof e=="number"?{desc:k.msg("remove"),range:[e,e+t],text:s}:ke(e,"remove",s,t),ln=(e,t)=>ke(e,"decode",Ut(t.text().replace(/%(?=21|3[ce]|5[bd]|7[b-d])/giu,"%25"))),Oe=(e,t,s=0)=>({desc:k.msg("close"),range:[e+s,e],text:t}),on=e=>({desc:k.msg("open"),range:[e+1,e+2],text:""}),an=(e,t)=>ke(e,"comment",`<!--${t}-->`),un=(e,t)=>ke(e,"uppercase",t.toUpperCase()),Ht=(e,t=0)=>({desc:k.msg("whitespace"),range:[e,e+t],text:" "}),gt=(e,t,s=1)=>({desc:k.msg("escape"),range:[e,e+s],text:t.repeat(s)}),dn=(e,t)=>({desc:k.msg("escape"),range:[e,e+t.length],text:t.replace(/\|/gu,"|")}),Ve=(e,t,s,i)=>{if(e&&(i||k.viewOnly&&e[0]===we.rev))return e[1];const n=t();return(i||k.viewOnly)&&s([we.rev,n]),n},ql=(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"]:[]}}),Un,hn,Wl=_({"parser/selector.ts"(){"use strict";Un=(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=>Un(l.trim(),n,r))}}}),ms,cn=_({"mixin/cached.ts"(){"use strict";z(),ms=(e=!0)=>t=>{const s=new WeakMap;return function(...i){return Ve(s.get(this),()=>t.apply(this,i),n=>{s.set(this,n)},e)}}}}),Ml,Ra=_({"mixin/nodeLike.ts"(){"use strict";Ml=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}}}),Hn,Dn,Jt,vt,bt,Xt,wt,yt,St,De,zl=_({"lib/node.ts"(){"use strict";z(),Te(),cn(),Ra(),q(),Dn=[Ml],Hn=[ms(!1)],De=class{constructor(){X(St,5,this),La(this,"childNodes",[]),je(this,Jt),je(this,vt),je(this,bt),je(this,Xt),je(this,wt),je(this,yt,{})}get parentNode(){return ae(this,Jt)}get nextSibling(){return ae(this,vt)}get previousSibling(){return ae(this,bt)}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":me(this,Jt,t),t||(me(this,vt,void 0),me(this,bt,void 0));break;case"nextSibling":me(this,vt,t);break;case"previousSibling":me(this,bt,t);break;case"aIndex":k.viewOnly&&me(this,wt,[we.rev,t]);break;default:this[e]=t}}getRootNode(){return Ve(ae(this,Xt),()=>{var e,t;return(t=(e=this.parentNode)==null?void 0:e.getRootNode())!=null?t:this},e=>{const[,t]=e;t.type==="root"&&me(this,Xt,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 Ve(ae(this,yt)[e],()=>{const{childNodes:t}=this,s=e+(e<0?t.length:0);let i=this.getAttribute("padding");for(let n=0;n<s;n++)k.viewOnly&&(ae(this,yt)[n]=[we.rev,i]),i+=t[n].toString().length+this.getGaps(n);return i},t=>{ae(this,yt)[e]=t})}getAbsoluteIndex(){return Ve(ae(this,wt),()=>{const{parentNode:e}=this;return e?e.getAbsoluteIndex()+this.getRelativeIndex():0},e=>{me(this,wt,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!`)}},St=Y(null),Jt=new WeakMap,vt=new WeakMap,bt=new WeakMap,Xt=new WeakMap,wt=new WeakMap,yt=new WeakMap,K(St,1,"getLines",Hn,De),De=K(St,0,"AstNode",Dn,De),X(St,1,De)}}),Ul,Oa=_({"mixin/elementLike.ts"(){"use strict";Wl(),Ul=e=>{var s,Di;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 a=o.getElementBy(l);if(a)return a}}querySelector(l){return this.getElementBy(j(this,s,Di).call(this,l))}getElementsBy(l,o=[]){for(const a of this.childNodes)a.type!=="text"&&(l(a)&&o.push(a),a.getElementsBy(l,o));return o}querySelectorAll(l){return this.getElementsBy(j(this,s,Di).call(this,l))}escape(){}}return s=new WeakSet,Di=function(l){return hn(l,this)},t}}}),Gn,js,Vn,Ct,Ba=_({"lib/element.ts"(){"use strict";de(),Te(),Wl(),zl(),Oa(),Gn=[Ul],Ct=class extends(Vn=De){get length(){return this.childNodes.length}text(e){return Qe(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":""}">`)+ct(this.childNodes,e)+(t===""?"":"</span>"):""}json(e,t=this.getAbsoluteIndex()){const s=_e(ce({},this),{type:this.type,range:[t,t+this.toString().length],childNodes:[]});for(let i=0,n=t+this.getAttribute("padding");i<this.length;i++){const r=this.childNodes[i],{length:l}=r.toString();r.setAttribute("aIndex",n),s.childNodes.push(r.type==="text"?{data:r.data,range:[n,n+l]}:r.json(void 0,n)),n+=l+this.getGaps(i)}return s}},js=Y(Vn),Ct=K(js,0,"AstElement",Gn,Ct),X(js,1,Ct)}}),Kt,Ps,Rs,Qn,Jn,Xn,Kn,Os,Bs,Gi,qa=_({"lib/text.ts"(){"use strict";var e,Hl,s;de(),z(),q(),zl(),Kt=String.raw`[${Re}\t]*`,Ps=String.raw`[^\S\n]*`,Rs=String.raw`<${Ps}(?:/${Ps})?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|(?:rfc|pmid)(?=[-::]?${Kt}\d)|isbn(?=[-::]?${Kt}(?:\d(?:${Kt}|-)){6})`,Qn=new RegExp(String.raw`${Rs}|https?[:/]/+`,"giu"),Jn=new RegExp(Rs,"giu"),Xn=new Set(["attr-value","ext-link-text","link-text"]),Kn={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},Os=new Set(["html","head","style","title","body","a","audio","img","video","embed","iframe","object","canvas","script","col","colgroup","tbody","tfoot","thead","button","input","label","option","select","textarea"]);try{Bs=new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch(i){Bs=/\w/u}Gi=(s=class extends De{constructor(n){super();N(this,e);Ne(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 U,R,P;if(r===!1)return[];const{data:l,parentNode:o,nextSibling:a,previousSibling:d}=this;if(!o)throw new Error("An isolated text node cannot be linted!");const{type:u,name:h,parentNode:g}=o;if(u==="attr-value"){const{name:W,tag:H}=g;if(H==="ref"&&(W==="name"||W==="follow")||W==="group"&&(H==="ref"||H==="references")||H==="choose"&&(W==="before"||W==="after"))return[]}if(r!=null||(r=u==="free-ext-link"||u==="ext-link-url"||u==="ext-link-text"||u==="image-parameter"&&h==="link"||u==="attr-value"?Jn:Qn),l.search(r)===-1)return[];r.lastIndex=0;const c=[],p=a==null?void 0:a.type,b=a==null?void 0:a.name,x=d==null?void 0:d.type,m=this.getRootNode(),w=m.toString(),{ext:y,html:S,variants:A}=m.getAttribute("config"),{top:T,left:v}=m.posFromIndex(n),$=k.lintConfig["tag-like"],C=typeof $=="number"?new Set:new Set(Object.keys($[1]).filter(W=>W!=="invalid"&&W!=="disallowed")),I=new Set(["onlyinclude","noinclude","includeonly",...y,...S[0],...S[1],...S[2],...C,...Os]);for(let W=r.exec(l);W;W=r.exec(l)){const[,H,pe]=W;let{index:ee,0:M}=W;if(pe&&pe!=="]"){const{length:he}=pe;ee+=he,M=M.slice(he)}M=M.toLowerCase();const[F]=M,V=F==="r"||F==="p"||F==="i",G=F==="{",Z=F==="}",ne=F==="[",le=F==="]";let{length:re}=M;if(F==="<"&&!I.has(H.toLowerCase())||ne&&u==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(l.slice(ee+1))||a!=null&&a.is("ext")&&b==="nowiki"&&((U=a.innerText)!=null&&U.includes("]")))||V&&(!o.isPlain()||Xn.has(u)))continue;le&&(ee||re>1)&&r.lastIndex--;let Ce=n+ee,Qt=Ce+re,fe,Ie;const Me=w[Qt],_s=w[Ce-1],$s=G||ne,Ts=G&&_s==="-"&&A.length>0,Cs=Z&&Me==="-"&&A.length>0,Cn=ne&&p==="free-ext-link"&&!l.slice(ee+1).trim()||le&&x==="free-ext-link"&&!l.slice(0,ee).includes("]");if(V)fe="lonely-http",M=M.toUpperCase(),Ie=k.lintConfig.getSeverity(fe,M);else if(F==="<"){fe="tag-like";let he;/^<\/?\s/u.test(M)||!/[\s/>]/u.test(Me!=null?Me:"")?he="invalid":C.has(H)?he=H:Os.has(H)&&!y.includes(H)&&(he="disallowed"),Ie=k.lintConfig.getSeverity(fe,he)}else if(Ts||Cs)fe="lonely-bracket",Ie=k.lintConfig.getSeverity(fe,"converter"),Ts&&ee>0?(M="-{",ee--,Ce--,re=2):Cs&&ee<l.length-1&&(M="}-",Qt++,re=2);else if(Cn)fe="lonely-bracket",Ie=k.lintConfig.getSeverity(fe,"extLink");else if($s||Z||le)if(fe="lonely-bracket",re>1||G&&Me===F||Z&&_s===F)Ie=k.lintConfig.getSeverity(fe,"double");else{if(!ne||u!=="ext-link-text"){const he=Kn[F],Is=$s?l.slice(ee+1):l.slice(0,ee);if(G&&((R=he.exec(Is))==null?void 0:R[0])==="}"||Z&&((P=he.exec(Is))==null?void 0:P[0])==="{")continue;if(!Is.includes(F)){const Fn=$s?"nextSibling":"previousSibling";let Ue=this[Fn];for(;Ue&&(Ue.type!=="text"||!he.test(Ue.data));)Ue=Ue[Fn];if(Ue&&he.exec(Ue.data)[0]!==F)continue}}Ie=k.lintConfig.getSeverity(fe,"single")}else fe="lonely-http",Ie=k.lintConfig.getSeverity(fe);if(!Ie)continue;const In=this.posFromIndex(ee),{line:Nn,character:Ln}=Hi(T,v,In.top+1,In.left),ze={rule:fe,message:k.msg("lonely",V||F==="h"||Ts||Cs?M:F),severity:Ie,startIndex:Ce,endIndex:Qt,startLine:Nn,endLine:Nn,startCol:Ln,endCol:Ln+re};if(F==="<")ze.suggestions=[gt(Ce,"<")];else if(F==="h"&&u!=="link-text"&&Bs.test(_s||""))ze.suggestions=[Ht(Ce)];else if(ne&&u==="ext-link-text"){const he=o.getAbsoluteIndex()+o.toString().length;ze.suggestions=[gt(he,"]")]}else if(le&&Cn){const he=n-d.toString().length;ze.suggestions=[fs(he,"left-bracket","[")]}else V&&(ze.suggestions=[...W[0]===M?[]:[un(ze,M)],...Me===":"||Me===":"?[Ht(Qt,1)]:[]]);c.push(ze)}return c}replaceData(n){j(this,e,Hl).call(this,n)}splitText(n){this.lspError("AstText.splitText")}escape(){}print(){return zt(this.data)}},e=new WeakSet,Hl=function(n){this.setAttribute("data",n)},s)}}),Ke,mt=_({"mixin/hidden.ts"(){"use strict";Ke=(e=!0,t=!0)=>s=>{class i extends s{text(){return""}lint(r){return e?[]:super.lint(r)}}return i}}}),$e,Le=_({"mixin/noEscape.ts"(){"use strict";$e=e=>{class t extends e{escape(){}}return t}}}),Ye,xt=_({"src/syntax.ts"(){"use strict";var e,t;B(),Ye=(t=class extends E{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)}}),Fe,Be=_({"mixin/padded.ts"(){"use strict";Fe=({length:e})=>t=>{class s extends t{getAttribute(n){return n==="padding"?e:super.getAttribute(n)}}return s}}}),ge,qe=_({"src/atom.ts"(){"use strict";var e,t;B(),ge=(t=class extends E{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)}}),Yn,Zn,qs,er,Pe,xs=_({"src/link/base.ts"(){"use strict";var e,t,s,i;z(),Je(),oe(),Be(),Le(),q(),B(),qe(),Yn=n=>n==="redirect-target"||n==="link",Zn=[$e,Fe("[[")],Pe=(i=class extends(er=E){constructor(r,l,o,a=[],d="|"){super(void 0,o,a,{});N(this,e,!0);N(this,t);N(this,s);if(this.insertAt(new ge(r,"link-target",o,a,{})),l!==void 0){const u=new E(l,o,a,{});u.type="link-text",u.setAttribute("stage",ve-1),this.insertAt(u)}L(this,t,d)}get link(){}get fragment(){return f(this,s).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:[a,d],type:u}=this,{encoded:h,fragment:g}=f(this,s),c=new ie(this,r);let p="unknown-page",b=k.lintConfig.getSeverity(p);if(b&&a.childNodes.some(({type:x})=>x==="template")&&o.push(O(a,c,p,"template-in-link",b)),p="url-encoding",b=k.lintConfig.getSeverity(p),b&&h){const x=O(a,c,p,"unnecessary-encoding",b);x.fix=ln(x,a),o.push(x)}if(p="pipe-like",b=k.lintConfig.getSeverity(p,"link"),b&&(u==="link"||u==="category")){const x=d==null?void 0:d.childNodes.findIndex(w=>w.type==="text"&&w.data.includes("|")),m=d==null?void 0:d.childNodes[x];if(m){const w=O(d,c,p,"pipe-in-link",b),y=w.startIndex+d.getRelativeIndex(x);w.suggestions=[dn(y,m.data)],o.push(w)}}if(p="no-ignored",b=k.lintConfig.getSeverity(p,"fragment"),b&&g!==void 0&&!Yn(u)){const x=O(a,c,p,"useless-fragment",b),m=a.childNodes.findIndex(y=>y.type==="text"&&y.data.includes("#")),w=a.childNodes[m];w&&(x.fix=D(x,a.getRelativeIndex(m)+w.data.indexOf("#"))),o.push(x)}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),{type:a,fragment:d}=this;return d!==void 0&&(a==="link"||a==="redirect-target")&&(o.fragment=d),o}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i),qs=Y(er),Pe=K(qs,0,"LinkBaseToken",Zn,Pe),X(qs,1,Pe)}}),tr,Ws,sr,Ae,Ze=_({"src/nowiki/base.ts"(){"use strict";Le(),B(),tr=[$e],Ae=class extends(sr=E){get innerText(){return this.firstChild.data}constructor(e="",t,s){super(e,t,s)}},Ws=Y(sr),Ae=K(Ws,0,"NowikiBaseToken",tr,Ae),X(Ws,1,Ae)}}),ir,Ms,nr,ue,We=_({"src/nowiki/noinclude.ts"(){"use strict";mt(),Ze(),ir=[Ke()],ue=class extends(nr=Ae){get type(){return"noinclude"}toString(e){return e?"":super.toString()}},Ms=Y(nr),ue=K(Ms,0,"NoincludeToken",ir,ue),X(Ms,1,ue)}}),Dl,Wa=_({"src/link/redirectTarget.ts"(){"use strict";z(),q(),xs(),We(),Dl=class extends Pe{get type(){return"redirect-target"}constructor(e,t,s,i){super(e,void 0,s,i),t!==void 0&&this.insertAt(new ue(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",i=k.lintConfig.getSeverity(s,"redirect");if(i&&this.length===2){const n=O(this.lastChild,{start:e},s,"useless-link-text",i);n.startIndex--,n.startCol--,n.fix=D(n),t.push(n)}return t}}}}),rr,zs,lr,It,Ma=_({"src/redirect.ts"(){"use strict";var e,t,s;mt(),Le(),B(),xt(),Wa(),rr=[Ke(!1,!1),$e],It=(s=class extends(lr=E){constructor(n,r,l,o,a,d,u=[]){super(void 0,d,u);N(this,e);N(this,t);L(this,e,n),L(this,t,a),this.append(new Ye(r,"redirect-syntax",d,u),new Dl(l,o==null?void 0:o.slice(1),d,u))}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),zs=Y(lr),It=K(zs,0,"RedirectToken",rr,It),X(zs,1,It)}}),Gl={};te(Gl,{parseRedirect:()=>Vl});var Vl,za=_({"parser/redirect.ts"(){"use strict";q(),Ma(),Vl=(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&&k.normalizeTitle(i[3],0,!1,t,{halfParsed:!0,temporary:!0,decode:!0}).valid?(e=`\0${s.length}o${e.slice(i[0].length)}`,new It(...i.slice(1),t,s),e):!1}}}),or,Us,ar,Nt,Ua=_({"src/onlyinclude.ts"(){"use strict";Be(),Le(),B(),or=[$e,Fe("<onlyinclude>")],Nt=class extends(ar=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>'})}},Us=Y(ar),Nt=K(Us,0,"OnlyincludeToken",or,Nt),X(Us,1,Nt)}}),Gt,vs=_({"mixin/gapped.ts"(){"use strict";Gt=(e=1)=>t=>{class s extends t{getGaps(){return e}}return s}}}),ur,Hs,dr,Ge,gn=_({"src/tagPair/index.ts"(){"use strict";var e,t;vs(),Le(),B(),ur=[Gt(),$e],Ge=(t=class extends(dr=E){constructor(i,n,r,l,o,a=[]){super(void 0,o);N(this,e);Ne(this,"closed");Ne(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:a.indexOf(n);a.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,a]=f(this,e);return n?`<${o}${r.toString(i)}/>`:`<${o}${r.toString(i)}>${l.toString(i)}${this.closed?`</${a}>`:""}`}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),Hs=Y(dr),Ge=K(Hs,0,"TagPairToken",ur,Ge),X(Hs,1,Ge)}}),Ql,Ha=_({"src/tagPair/translate.ts"(){"use strict";var e,Jl,s;B(),gn(),xt(),We(),Ql=(s=class extends Ge{constructor(n,r,l,o=[]){const a=new Ye(n,"translate-attr",l,o);r=r==null?void 0:r.replace(/(<tvar\|[^>]+>)([\s\S]*?)(<\/>)/gu,(u,h,g,c)=>(new ue(h,l,o),new ue(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,(u,h,g,c,p)=>(new ue(h,l,o),new ue(p,l,o),`\0${o.length-1}n${c}\0${o.length}n`));const d=new E(r,l,o);d.type="translate-inner";super("translate",a,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${j(this,e,Jl).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,Jl=function(){return this.firstChild.toString()===" nowrap"},s)}}),hr,Ds,cr,Lt,Da=_({"src/tagPair/include.ts"(){"use strict";z(),oe(),mt(),q(),gn(),hr=[Ke(!1)],Lt=class extends(cr=Ge){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 ie(this,e),l=["no-ignored","unclosed-comment"],o=l.map(a=>k.lintConfig.getSeverity(a,"include"));if(o[0]&&s.data.trim()){const a=O(s,r,l[0],"useless-attribute",o[0]);a.suggestions=[D(a)],t.push(a)}if(o[1]&&!i){const a=J(this,r,l[1],k.msg("unclosed",`<${n}>`),o[1]);a.suggestions=[Oe(a.endIndex,`</${n}>`)],t.push(a)}return t}},Ds=Y(cr),Lt=K(Ds,0,"IncludeToken",hr,Lt),X(Ds,1,Lt)}}),bs,pn=_({"mixin/attributesParent.ts"(){"use strict";bs=(e=0)=>t=>{var i,Xl;class s extends t{constructor(){super(...arguments);N(this,i)}hasAttr(o){this.lspError("AttributesParent.hasAttr")}getAttr(o){return j(this,i,Xl).call(this).getAttr(o)}}return i=new WeakSet,Xl=function(){return this.childNodes[e]},s}}}),se,Gs,Vs,kt,Yt,Qs,He,Js,Xs,Ks,Zt,Ys,ye,Kl,Yl,Zl,eo,Ga=_({"util/sharable.ts"(){"use strict";se=new Set(["align"]),Gs=new Set(["cite"]),Vs=new Set(["cite","datetime"]),kt=new Set(["width"]),Yt=new Set(["axis","align","bgcolor","height","width","valign"]),Qs=new Set([...Yt,"abbr","headers","scope","rowspan","colspan"]),He=new Set(["type"]),Js=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),Xs=new Set(["clear"]),Ks=new Set(["bgcolor","align","valign"]),Zt=new Set(["qid","forcemathmode","type","display"]),Ys=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),ye=new Set,Kl=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"]),Yl={div:se,h1:se,h2:se,h3:se,h4:se,h5:se,h6:se,blockquote:Gs,q:Gs,p:se,br:Xs,pre:kt,ins:Vs,del:Vs,ul:He,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...Js,"border"]),caption:se,tr:Ks,td:Qs,th:Qs,font:new Set(["size","color","face"]),hr:kt,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:He,poem:se,categorytree:se,combooption:se,math:ye,chem:ye,ce:ye,img:new Set(["alt","src","width","height","loading","srcset"])},Zl={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:ye,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:ye,inputbox:ye,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:ye,poll:new Set(["id","show-results-before-voting"]),sm2:He,flashmp3:He,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([...Zt,"chem"]),chem:Zt,ce:Zt,hiero:ye,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:Ys,syntaxhighlight:Ys,templatedata:ye,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:ye},eo={table:Js,td:new Set([...Yt,"scope"]),th:Yt,br:Xs,caption:se,div:se,hr:kt,h1:se,h2:se,h3:se,h4:se,h5:se,h6:se,li:He,p:se,pre:kt,tr:Ks,ul:He}}}),gr,pr,fr,mr,ls,Va=_({"src/attribute.ts"(){"use strict";var e,t,s,i,n,Vi,l;z(),de(),Je(),Ga(),oe(),q(),B(),qe(),gr=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,pr=/(?:^|\s|\*\/)(?:javascript|vbscript)(?:\W|$)/iu,fr=new Set(["ext","arg","magic-word","template"]),mr=new Set(["about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),ls=(l=class extends E{constructor(a,d,u,h="",g,c=[],p=k.getConfig(),b=[]){const x=new ge(u,"attr-key",p,b);let m;if(u==="title"||d==="img"&&u==="alt")m=new E(g,p,b,{}),m.type="attr-value",m.setAttribute("stage",ve-1);else if(d==="gallery"&&u==="caption"||d==="choose"&&(u==="before"||u==="after")){const w=_e(ce({},p),{excludes:[...p.excludes,"heading","html","table","hr","list"]});m=new E(g,w,b,{}),m.type="attr-value",m.setAttribute("stage",1)}else m=new ge(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,a),this.append(x,m),L(this,s,h),L(this,i,[...c]),L(this,t,d),this.setAttribute("name",ht(be(u)))}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",ht(this.firstChild.text())),super.afterBuild()}toString(a){const[d="",u=""]=f(this,i);return f(this,s)?super.toString(a,f(this,s)+d)+u:this.firstChild.toString(a)}text(){return f(this,s)?`${super.text(`${f(this,s).trim()}"`)}"`:this.firstChild.text()}getGaps(){var a,d;return f(this,s)?f(this,s).length+((d=(a=f(this,i)[0])==null?void 0:a.length)!=null?d:0):0}lint(a=this.getAbsoluteIndex(),d){var S;const u=super.lint(a,d),{balanced:h,firstChild:g,lastChild:c,name:p,tag:b}=this,x=new ie(this,a),m=["unclosed-quote","obsolete-attr"],w=m.map(A=>k.lintConfig.getSeverity(A,p));if(w[0]&&!h){const A=O(c,x,m[0],k.msg("unclosed","quotes"),w[0]);A.startIndex--,A.startCol--,A.suggestions=[Oe(A.endIndex,f(this,i)[0])],u.push(A)}const y=j(this,n,Vi).call(this,a,x);return y&&u.push(y),w[1]&&((S=eo[b])!=null&&S.has(p))&&u.push(O(g,x,m[1],"obsolete-attribute",w[1])),u}getValue(){return f(this,s)?this.lastChild.text().trim():this.type==="ext-attr"||""}escape(){}getAttribute(a){return a==="invalid"?j(this,n,Vi).call(this):super.getAttribute(a)}print(){const[a="",d=""]=f(this,i);return f(this,s)?super.print({sep:zt(f(this,s))+a,post:d}):super.print()}json(a,d=this.getAbsoluteIndex()){const u=super.json(void 0,d);return u.tag=this.tag,u}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,n=new WeakSet,Vi=function(a,d){const{firstChild:u,lastChild:h,type:g,name:c,tag:p,parentNode:b}=this,x=!h.childNodes.some(({type:T})=>fr.has(T)),m=this.getValue(),w=Zl[p],y=Yl[p],{length:S}=this.toString();let A="illegal-attr";if(!(w!=null&&w.has(c))&&!(y!=null&&y.has(c))&&(g==="ext-attr"?w||y:!/\{\{[^{]+\}\}/u.test(c))&&(g==="ext-attr"&&!y||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(c)&&(p==="meta"||p==="link"||!Kl.has(c)))||(c==="itemtype"||c==="itemid"||c==="itemref")&&!(b!=null&&b.hasAttr("itemscope"))){if(a===void 0)return!0;const T=k.lintConfig.getSeverity(A,"unknown");if(T){const v=O(u,d,A,"illegal-attribute-name",T);return v.suggestions=[D(a,S)],v}}else if(c==="style"&&typeof m=="string"&&gr.test(m)){if(a===void 0)return!0;A="insecure-style";const T=k.lintConfig.getSeverity(A);return T&&O(h,d,A,"insecure-style",T)}else if(c==="tabindex"&&typeof m=="string"&&m!=="0"){if(a===void 0)return!0;const T=k.lintConfig.getSeverity(A,"tabindex");if(T){const v=O(h,d,A,"nonzero-tabindex",T);return v.suggestions=[D(a,S),ke(v,"0 tabindex","0")],v}}else if(x&&g!=="ext-attr"){const T=ql(p,c),v=String(m).toLowerCase();if(T.length>0&&T.every($=>$!==v)){if(a===void 0)return!0;const $=k.lintConfig.getSeverity(A,"value");return $&&O(h,d,A,"illegal-attribute-value",$)}}else if(typeof m=="string"&&((/^xmlns:[\w:.-]+$/u.test(c)||mr.has(c))&&pr.test(m)||x&&(c==="href"||p==="img"&&c==="src")&&!new RegExp(String.raw`^(?:${this.getAttribute("config").protocol}|//)\S+$`,"iu").test(m))){if(a===void 0)return!0;const T=k.lintConfig.getSeverity(A,"value");return T&&O(h,d,A,"illegal-attribute-value",T)}return!1},l)}}),Zs,xr,ei,ws,fn=_({"src/attributes.ts"(){"use strict";var e,t,os,i;z(),de(),oe(),q(),B(),qe(),Va(),Zs=n=>n.slice(0,-1),xr=n=>`${Zs(n)}-dirty`;try{ei=new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch(n){ei=/[^\W_]/u}ws=(i=class extends E{constructor(r,l,o,a,d=[]){super(void 0,a,d,{});N(this,t);N(this,e);if(L(this,e,l),this.setAttribute("name",o),r){const u=/([^\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=u.exec(r),c=0;const p=()=>{h&&(super.insertAt(new ge(h,xr(l),a,d,{})),h="")};for(;g;){const{index:b,0:x,1:m,2:w,3:y,4:S,5:A,6:T}=g;if(h+=r.slice(c,b),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(be(m).trim())){const v=S!=null?S:T,$=[y,A],C=new ls(Zs(l),o,m,w,v,$,a,d);p(),super.insertAt(C)}else h+=x;({lastIndex:c}=u),g=u.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 ls&&(!r||l.name===ht(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:a,childNodes:d}=this,u=new Map,h=new Set,g=new ie(this,r),c=["no-ignored","no-duplicate"],p=["closingTag","invalidAttributes","nonWordAttributes"].map(x=>k.lintConfig.getSeverity(c[0],x));if(p[0]&&j(this,t,os).call(this)){const x=J(this,g,c[0],"attributes-of-closing-tag",p[0]),m=a.getAbsoluteIndex();x.suggestions=[D(x),on(m)],o.push(x)}for(const x of d)if(x instanceof ls){const{name:m}=x;u.has(m)?(h.add(m),u.get(m).push(x)):u.set(m,[x])}else{const m=x.text().trim(),w=p[ei.test(m)?1:2];if(m&&w){const y=O(x,g,c[0],"invalid-attribute",w);y.suggestions=[D(y,0," ")],o.push(y)}}const b=k.lintConfig.getSeverity(c[1],"attribute");if(b&&h.size>0)for(const x of h){const m=u.get(x).map(w=>{const y=w.getValue();return[w,y===!0?"":y]});o.push(...m.map(([w,y],S)=>{const A=O(w,g,c[1],k.msg("duplicate-attribute",x),b),T=D(A);return!y||m.slice(0,S).some(([,v])=>v===y)?A.fix=T:A.suggestions=[T],A}))}return o}getAttribute(r){return r==="invalid"?j(this,t,os).call(this):super.getAttribute(r)}print(){return this.toString()?`<span class="wpb-${this.type}${j(this,t,os).call(this)?" wpb-invalid":""}">${this.childNodes.map(r=>r.print(r instanceof ge?{class:r.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}},e=new WeakMap,t=new WeakSet,os=function(){const{parentNode:r}=this;return(r==null?void 0:r.type)==="html"&&r.closing&&this.text().trim()!==""},i)}}),to={};te(to,{PreToken:()=>so});var so,Qa=_({"src/pre.ts"(){"use strict";Je(),B(),We(),so=class extends E{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),a=0,d="";for(;l&&o;)new ue(l[0],t,s),new ue(o[0],t,s),d+=`${e.slice(a,l.index)}\0${s.length-1}n${e.slice(l.index+r,o.index)}\0${s.length}n`,a=o.index+r+1,i.lastIndex=a,l=i.exec(e),l&&(n.lastIndex=l.index+r),o=n.exec(e);e=d+e.slice(a)}super(e,t,s,{}),this.setAttribute("stage",ve-1)}isPlain(){return!0}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*\/\s*(pre)\b/giu)}}}}),ys,mn=_({"mixin/multiLine.ts"(){"use strict";ys=e=>{class t extends e{toString(i){return super.toString(i,`
|
|
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 t}}}),
|
|
7
|
-
`).map(l=>n?l:Vt(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",s=k.lintConfig.getSeverity(t,this.name);if(!s)return[];const i=new ie(this,e),n=k.msg("invalid parameter of <$1>",this.name),r=[];for(const l of this.childNodes){l.setAttribute("aIndex",e);const o=l.childNodes.filter(({type:a})=>a!=="comment"&&a!=="include"&&a!=="noinclude");if(o.some(({type:a})=>a==="ext"))r.push(O(l,i,t,n,s));else{const a=o.findIndex(({type:u})=>u!=="text"),h=o.slice(0,a===-1?void 0:a).map(String).join("");if(h&&!(a===-1?/^[a-z]+(?:\[\])?\s*=/iu:/^[a-z]+(?:\[\])?\s*(?:=|$)/iu).test(h)){const u=O(l,i,t,n,s);u.suggestions=[D(u)],r.push(u)}else{const u=l.lint(e,!1);u.length>0&&r.push(...u)}}e+=l.toString().length+1}return r}},ti=Y(br),tt=K(ti,0,"ParamTagToken",vr,tt),X(ti,1,tt)}}),wr,si,yr,st,so=_({"src/heading.ts"(){"use strict";var e,t,as,i;U(),Te(),oe(),Le(),q(),B(),mt(),wr=[$e],st=(i=class extends(yr=E){constructor(r,l,o,a=[]){super(void 0,o,a);N(this,t);N(this,e);L(this,e,r);const h=new E(l[0],o,a);h.type="heading-title",h.setAttribute("stage",2);const u=new Ye(l[1],"heading-trail",o,a);this.append(h,u)}get type(){return"heading"}get level(){return f(this,e)}toString(r){const l=j(this,t,as).call(this);return l+this.firstChild.toString(r)+l+this.lastChild.toString(r)}text(){const r=j(this,t,as).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:a,level:h}=this,u=a.toString(),d=u.startsWith("="),g=d||u.endsWith("="),c=new ie(this,r),p=this.inHtmlAttrs(),b=["h1","unbalanced-header","format-leakage"],m=b.map(x=>k.lintConfig.getSeverity(x,"apostrophe"));if(m[0]&&this.level===1){const x=O(a,c,b[0],"<h1>",m[0]);g||(x.suggestions=[ke(x,"h2",`=${u}=`)]),o.push(x)}if(m[1]&&g){const x=k.msg("unbalanced $1 in a section header",'"="'),w=O(a,c,b[1],x,m[1]);if(u!=="=")if(d){const[y]=/^=+/u.exec(u),S=h+y.length;w.suggestions=[{desc:`h${h}`,range:[w.startIndex,w.startIndex+y.length],text:""}],S<7&&w.suggestions.push({desc:`h${S}`,range:[w.endIndex,w.endIndex],text:y})}else{const y=/[^=](=+)$/u.exec(u)[1],S=h+y.length;w.suggestions=[{desc:`h${h}`,range:[w.endIndex-y.length,w.endIndex],text:""}],S<7&&w.suggestions.push({desc:`h${S}`,range:[w.startIndex,w.startIndex],text:y})}o.push(w)}if(p){const x="parsing-order",w=k.lintConfig.getSeverity(x,p===2?"heading":"templateInTable");w&&o.push(J(this,c,x,"section header in HTML tag attributes",w))}if(m[2]){const x=this.getRootNode().toString(),w=a.childNodes.filter(As("quote")),y=w.filter(({bold:A})=>A),S=w.filter(({italic:A})=>A);if(y.length%2){const A=O(y[y.length-1],_e(fe({},c),{start:r+h,left:c.left+h}),b[2],k.msg("unbalanced $1 in a section header","bold apostrophes"),m[2]),T=r+h+u.length,v=D(A);x.slice(A.endIndex,T).trim()?A.suggestions=[v,Oe(T,"'''")]:y.length===1&&S.length===0?A.fix=v:A.suggestions=[v],o.push(A)}if(S.length%2){const A=O(S[S.length-1],{start:r+h},b[2],k.msg("unbalanced $1 in a section header","italic apostrophes"),m[2]),T=r+h+u.length;x.slice(A.endIndex,T).trim()?A.suggestions=[Oe(T,"''")]:S.length===1&&y.length===0?A.fix=D(A):A.suggestions=[D(A)],o.push(A)}}return o}print(){const r=j(this,t,as).call(this);return super.print({pre:r,sep:r})}json(r,l=this.getAbsoluteIndex()){const o=super.json(void 0,l);return o.level=this.level,o}},e=new WeakMap,t=new WeakSet,as=function(){return"=".repeat(this.level)},i),si=Y(yr),st=K(si,0,"HeadingToken",wr,st),X(si,1,st)}}),Sr,io,Ga=_({"src/parameter.ts"(){"use strict";he(),U(),q(),B(),Sr=new RegExp(`https?://${ut}${ht}$`,"iu"),io=class extends E{get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){var e;try{return!!((e=this.parentNode)!=null&&e.getDuplicatedArgs().some(([t])=>t===this.name))}catch(t){return!1}}constructor(e,t,s,i=[]){super(void 0,s,i);const n=new E(typeof e=="number"?void 0:e,s,i,{}),r=new E(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 r;const s=super.lint(e,t),i="unescaped",n=k.lintConfig.getSeverity(i);if(n){const{firstChild:l}=this,o=(r=Sr.exec(l.text()))==null?void 0:r[0];try{if(o&&new URL(o).search){const a="unescaped query string in an anonymous parameter",h=O(l,{start:e},i,a,n);h.startIndex=h.endIndex,h.startLine=h.endLine,h.startCol=h.endCol,h.endIndex++,h.endCol++,h.fix=gt(h.startIndex,"{{=}}"),s.push(h)}}catch(a){}}return s}print(){return super.print({sep:this.anon?"":"="})}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t);return Object.assign(s,{anon:this.anon},this.duplicated&&{duplicated:!0}),s}}}}),kr,ii,Ar,it,Va=_({"src/transclude.ts"(){"use strict";var e,t,s,i,n,r,us,no,a;he(),U(),Te(),oe(),vs(),Le(),q(),B(),Ga(),qe(),mt(),kr=[$e,Gt()],it=(a=class extends(Ar=E){constructor(u,d,g,c=[]){var I,z;let p;const b=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(u);b&&(p=Number(b[1]),u=u.replace(`\0${p}h`,c[p].toString().replace(/^\n/u,"")));super(void 0,g,c,{});N(this,r);Ne(this,"modifier","");N(this,e,"template");N(this,t,":");N(this,s,!1);N(this,i,new Map);N(this,n);const{parserFunction:[m,x],variable:w,functionHook:y}=g,S=(I=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(u))==null?void 0:I[0];if(S)this.setAttribute("modifier",S),u=u.slice(S.length);else if(u.includes(":")){const[R,...P]=u.split(":"),[W]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((z=P[0])!=null?z:"");this.setModifier(`${R}:${W}`)&&(u=P.join(":").slice(W.length))}const A=u.search(/[::]/u),T=u[A]===":",v=A!==-1;if(v||d.length===0&&!f(this,s)){const R=v?u.slice(0,A):u,P=v&&u.slice(A+1),W=be(R),H=v?W.slice(W.search(/\S/u))+(T?":":""):W.trim(),ge=H.toLowerCase(),ee=Array.isArray(x),M=ee?x.includes(H):Object.prototype.hasOwnProperty.call(x,H),F=!ee&&M?x[H]:Object.prototype.hasOwnProperty.call(m,ge)&&m[ge],V=ee&&M||!("functionHook"in g)||y.includes(F),G=ee&&M||w.includes(F);if(v?F&&V:G){this.setAttribute("name",F||ge.replace(/^#|:$/u,"")),L(this,e,"magic-word"),T&&L(this,t,":");const Z=new Ye(R,"magic-word-name",g,c);if(super.insertAt(Z),P!==!1&&d.unshift([P]),this.name==="invoke")for(let ne=0;ne<2;ne++){const le=d.shift();if(!le)break;const re=new ce(le.join("="),`invoke-${ne?"function":"module"}`,g,c);super.insertAt(re)}}}if(this.type==="template"){const R=be(u).trim();if(!this.normalizeTitle(R,10,{halfParsed:!0,temporary:!0}).valid)throw c.pop(),new SyntaxError("Invalid template name");const P=new ce(u,"template-name",g,c,{});super.insertAt(P)}typeof p=="number"&&(c[p]=void 0);const $=this.isTemplate();let C=1;for(let R=0;R<d.length;R++){const P=d[R];$||this.name==="switch"&&R>0||this.name==="tag"&&R>1||(P[0]=P.join("="),P.length=1),P.length===1&&(P.unshift(C),C++),this.insertAt(new io(...P,g,c))}this.seal("modifier")}get type(){return f(this,e)}get module(){}get function(){}setModifier(u){const{parserFunction:[,,d,g]}=this.getAttribute("config"),c=be(u).trim();if(u&&!c.endsWith(":"))return!1;const p=c.slice(0,-1).toLowerCase(),b=d.includes(p),m=g.includes(p);return f(this,s)&&b||!f(this,s)&&(m||!u)||(we.running||this.length>1)&&(b||m||!u)?(this.setAttribute("modifier",u),L(this,s,b),!!u):!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,j(this,r,us).call(this)),this.setAttribute("name",f(this,n).title))}toString(u){const{childNodes:d,length:g,firstChild:c,modifier:p,type:b}=this;return`{{${p}${b==="magic-word"?c.toString(u)+(g===1?"":f(this,t))+d.slice(1).map(m=>m.toString(u)).join("|"):super.toString(u,"|")}}}`}text(){const{childNodes:u,length:d,firstChild:g,modifier:c,type:p,name:b}=this;return p==="magic-word"&&b==="vardefine"?"":`{{${c}${p==="magic-word"?g.text()+(d===1?"":f(this,t))+Qe(u.slice(1),"|"):super.text("|")}}}`}getAttribute(u){switch(u){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||!j(this,r,us).call(this).valid);default:return super.getAttribute(u)}}lint(u=this.getAbsoluteIndex(),d){const g=super.lint(u,d);if(!this.isTemplate())return g;const{type:c,childNodes:p,length:b}=this,m=new ie(this,u),x=c==="magic-word";let w="no-ignored",y=k.lintConfig.getSeverity(w,"fragment");if(x&&!j(this,r,us).call(this).valid)w="invalid-invoke",y=k.lintConfig.getSeverity(w,"name"),y&&g.push(O(p[1],m,w,"illegal module name",y));else if(y){const S=p[x?1:0],A=S.childNodes.findIndex(v=>v.type==="text"&&Mt(v.data).includes("#")),T=S.childNodes[A];if(T){const v=O(S,m,w,"useless fragment",y);v.suggestions=[D(v,S.getRelativeIndex(A)+T.data.indexOf("#"))],g.push(v)}}if(w="invalid-invoke",y=k.lintConfig.getSeverity(w,"function"),y&&x&&b===2)return g.push(J(this,m,w,"missing module function",y)),g;if(w="no-duplicate",y=k.lintConfig.getSeverity(w,"parameter"),y){const S=this.getDuplicatedArgs().filter(([,T])=>!T[0].querySelector("ext")),A="duplicated parameter";for(const[,T]of S)g.push(...T.map(v=>{const $=O(v,m,w,A,y);return $.suggestions=[D($,-1)],$}))}return g}insertAt(u,d=this.length){return super.insertAt(u,d),u.anon?j(this,r,no).call(this,u):u.name&&this.getArgs(u.name,!1,!1).add(u),u}getAllArgs(){return this.childNodes.filter(As("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:u})=>u)}getArgs(u,d,g=!0){const c=String(u).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:u}])=>u>1).map(([u,d])=>[u,[...d]])}getPossibleValues(){const{type:u,name:d,childNodes:g}=this;if(u==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let c,p;switch(d){case"if":case"ifexist":case"ifexpr":case"iferror":c=2;break;case"ifeq":c=3;break;case"switch":{const b=g.slice(2),m=b[b.length-1];p=[...b.filter(({anon:x})=>!x),...m!=null&&m.anon?[m]:[]].map(({lastChild:x})=>x);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:m,0:x}=p[b].childNodes.filter(w=>w.text().trim());if(m===0)p.splice(b,1);else if(m>1||x.type!=="magic-word")b++;else try{const w=x.getPossibleValues();p.splice(b,1,...w),b+=w.length}catch(w){b++}}return p}print(){const{childNodes:u,length:d,firstChild:g,modifier:c,type:p}=this;return`<span class="wpb-${p}${this.getAttribute("invalid")?" wpb-invalid":""}">{{${p==="magic-word"?Ut(c)+g.print()+(d===1?"":f(this,t))+ct(u.slice(1),{sep:"|"}):(c?`<span class="wpb-magic-word">${Ut(c)}</span>`:"")+ct(u,{sep:"|"})}}}</span>`}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,n=new WeakMap,r=new WeakSet,us=function(){const u=this.type==="template";return this.normalizeTitle(this.childNodes[u?0:1].text(),u?10:828,{temporary:!0})},no=function(u){const d=this.getAnonArgs(),g=typeof u!="number";for(let c=g?d.indexOf(u):u-1;c<d.length;c++){const p=d[c],{name:b}=p,m=String(c+1);(b!==m||p===u)&&(p.setAttribute("name",m),this.getArgs(m,!1,!1).add(p))}},a),ii=Y(Ar),it=K(ii,0,"TranscludeToken",kr,it),X(ii,1,it)}}),_r,ni,$r,Ft,Qa=_({"src/hidden.ts"(){"use strict";xt(),B(),_r=[Ke()],Ft=class extends($r=E){get type(){return"hidden"}getAttribute(e){return e==="invalid"||super.getAttribute(e)}},ni=Y($r),Ft=K(ni,0,"HiddenToken",_r,Ft),X(ni,1,Ft)}}),Tr,ri,Cr,Et,Ja=_({"src/arg.ts"(){"use strict";var e,Xa,s;he(),U(),oe(),Be(),vs(),Le(),q(),B(),qe(),Qa(),Tr=[$e,Fe("{{{"),Gt()],Et=(s=class extends(Cr=E){constructor(n,r,l=[]){super(void 0,r,l,{});N(this,e);for(let o=0;o<n.length;o++){const a=n[o];if(o===0){const h=new ce(a,"arg-name",r,l,{});super.insertAt(h)}else if(o>1){const h=new Ft(a,r,l);super.insertAt(h)}else{const h=new E(a,r,l);h.type="arg-default",h.setAttribute("stage",2),super.insertAt(h)}}}get type(){return"arg"}get default(){var n,r;return(r=(n=this.childNodes[1])==null?void 0:n.text())!=null?r:!1}toString(n){return`{{{${super.toString(n,"|")}}}}`}text(){return`{{{${Qe(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){super.afterBuild()}lint(n=this.getAbsoluteIndex(),r){const{childNodes:[l,o,...a]}=this;l.setAttribute("aIndex",n+3);const h=l.lint(n+3,r);if(o){const g=n+4+l.toString().length;o.setAttribute("aIndex",g);const c=o.lint(g,r);c.length>0&&h.push(...c)}const u=["no-ignored","no-arg"],d=u.map(g=>k.lintConfig.getSeverity(g,"arg"));if(d[0]&&a.length>0){const g=new ie(this,n);h.push(...a.map(c=>{const p=O(c,g,u[0],"invisible content inside triple braces",d[0]);return p.startIndex--,p.startCol--,p.suggestions=[D(p),gt(p.startIndex,"{{!}}")],p}))}if(d[1]&&!this.getAttribute("include")){const g=J(this,{start:n},u[1],"unexpected template argument",d[1]);o&&(g.suggestions=[ke(g,"expand",o.text())]),h.push(g)}return h}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(n,r=this.getAbsoluteIndex()){const l=super.json(void 0,r);return l.default=this.default,l}},e=new WeakSet,Xa=function(){},s),ri=Y(Cr),Et=K(ri,0,"ArgToken",Tr,Et),X(ri,1,Et)}}),ro={};te(ro,{parseBraces:()=>Ss});var Ir,li,es,oi,ai,ui,Nr,hi,Ss,mn=_({"parser/braces.ts"(){"use strict";Xe(),he(),so(),Va(),Ja(),Ir={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},li=String.raw`\[(?!\[)`,es=String.raw`\n(?![=\0])`,oi=String.raw`|\{{2,}`,ai=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),ui=at(e=>new RegExp(e,"gmu")),Nr=new RegExp(String.raw`\{\{((?:[^\n{}[]|${li}|${es})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${es})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${li}|${es})*\}-`,"gu"),hi=e=>{const t=dt(be(e));return ai.has(t)?ai.get(t):/^(?:filepath|(?:full|canonical)urle?):./u.test(t)?"m":/^#vardefine:./u.test(t)?"n":"t"},Ss=(e,t,s)=>{var p,b,m,x,w;const i=String.raw`${t.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,n]}=t,r=[],l=[],o=(y,S,A,T)=>{S[S.length-1].push(me(y.slice(A,T),l))};let a;do a!==void 0&&(e=a),a=e.replace(Nr,(y,S,A)=>{if(S!==void 0||typeof A=="string")try{const{length:T}=s,v=(S!=null?S:A).split("|");return new it(me(v[0],l),v.slice(1).map($=>{const C=$.indexOf("=");return(C===-1?[$]:[$.slice(0,C),$.slice(C+1)]).map(I=>me(I,l))}),t,s),`\0${T}${hi(v[0])}`}catch(T){if(!(T instanceof SyntaxError)||T.message!=="Invalid template name")throw T}return l.push(me(y,l)),`\0${l.length-1}`});while(a!==e);e=a;const h=e.lastIndexOf("}}")-e.length;let u=h+e.length!==-1,d=ui(i+(u?oi:"")),g=d.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:y,index:S}=g!=null?g:{0:`
|
|
8
|
-
`,index:e.length},A=(
|
|
9
|
-
`){c=S+1;const{pos:P,findEqual:W}=(
|
|
10
|
-
`)||(e=`${e.slice(0,v)}\0${s.length}h${e.slice(S)}`,c=v+4+String(s.length).length,new st(H[1].length,H.slice(2),t,s)))}}else if(y==="|"||
|
|
11
|
-
)`:""}(\s*)$`,"u")),Pr=new Set(["alt","link","lang","page","caption"]),
|
|
12
|
-
`))!=null?a:[]){const u=/^([^|]+)(?:\|(.*))?/u.exec(
|
|
13
|
-
`),n=new Set(t.protocol.split("|")),r=ue;let l=!0,o=!1;for(const a of i){const h=a.trim();if(!(o||!h||h.startsWith("#"))){if(l){const u=a.indexOf("|"),d=u===-1?a:a.slice(0,u),{valid:g,ns:c}=this.normalizeTitle(d,0,{halfParsed:!0,temporary:!0});if(g&&c===6){const p=new nt("imagemap",d,u===-1?void 0:a.slice(u+1),t,s);super.insertAt(p),l=!1;continue}else o=!0}else if(a.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(a);continue}else if(a.includes("[")){const u=a.indexOf("["),d=a.slice(u),g=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(d);if(g){if(this.normalizeTitle(g[1],0,{halfParsed:!0,temporary:!0,selfLink:!0}).valid){super.insertAt(new Ki(a.slice(0,u),g.slice(1),d.slice(d.indexOf("]]")+2),t,s));continue}}else if(d.startsWith("[//")||n.has(d.slice(1,d.indexOf(":")+1))||n.has(d.slice(1,d.indexOf("//")+2))){const c=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(d);if(c){super.insertAt(new Ki(a.slice(0,u),c.slice(1),d.slice(d.indexOf("]")+1),t,s));continue}}}}super.insertAt(new r(a,t,s))}}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),i=new ie(this,e),{childNodes:n,image:r}=this,l="invalid-imagemap",o=k.lintConfig.getSeverity(l,r?"link":"image");return o&&(r?s.push(...n.filter(a=>{const h=a.toString().trim();return a.is("noinclude")&&h&&!h.startsWith("#")}).map(a=>{const h=O(a,i,l,"invalid link in <imagemap>",o);return h.suggestions=[D(h,-1),ke(h,"comment","# ")],h})):s.push(J(this,i,l,"<imagemap> without an image",o))),s}getAttribute(e){return e==="invalid"?!this.image:super.getAttribute(e)}},wi=Y(Qr),Pt=K(wi,0,"ImagemapToken",Vr,Pt),X(wi,1,Pt)}}),Jr,yi,Xr,lt,yo=_({"src/nowiki/comment.ts"(){"use strict";U(),xt(),Be(),q(),Ze(),Jr=[Ke(!1),Fe("<!--")],lt=class extends(Xr=Ae){constructor(t,s,i,n){super(t,i,n);Ne(this,"closed");this.closed=s}get type(){return"comment"}lint(t=this.getAbsoluteIndex()){if(this.closed)return[];const s="unclosed-comment",i=k.lintConfig.getSeverity(s);if(!i)return[];const n=J(this,{start:t},s,k.msg("unclosed $1","HTML comment"),i);return n.suggestions=[Oe(n.endIndex,"-->")],[n]}toString(t){return t?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"<!--",post:this.closed?"-->":""})}},yi=Y(Xr),lt=K(yi,0,"CommentToken",Jr,lt),X(yi,1,lt)}}),So={};te(So,{CommentedToken:()=>ko});var ko,su=_({"src/commented.ts"(){"use strict";B(),yo(),ko=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("<!--"),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 lt(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"))}}}}),Ao={};te(Ao,{NowikiToken:()=>_o});var Kr,Yr,_o,iu=_({"src/nowiki/index.ts"(){"use strict";var e,Yi,s;Xe(),U(),q(),Ze(),Kr=at(i=>new RegExp(String.raw`<\s*(?:/\s*)${i==="nowiki"?"":"?"}(${i})\b`,"giu")),Yr=new Set(["languages","section","templatestyles"]),_o=(s=class extends Ae{constructor(){super(...arguments);N(this,e)}get type(){return"ext-inner"}lint(n=this.getAbsoluteIndex()){const{name:r}=this,l="void-ext",o=k.lintConfig.getSeverity(l,r);if(o&&j(this,e,Yi).call(this)){const a=J(this,{start:n},l,k.msg("nothing should be in <$1>",r),o);return a.suggestions=[D(a)],[a]}return super.lint(n,Kr(r))}getAttribute(n){return n==="invalid"?j(this,e,Yi).call(this):super.getAttribute(n)}},e=new WeakSet,Yi=function(){const{name:n,firstChild:{data:r}}=this;return Yr.has(n)&&!!r},s)}}),Zr,Si,el,ot,$o=_({"src/tagPair/ext.ts"(){"use strict";U(),oe(),q(),pn(),B(),gn(),fn(),Zr=[bs()],ot=class extends(el=Ge){get type(){return"ext"}constructor(e,t,s,i,n=k.getConfig(),r=!1,l=[]){const o=e.toLowerCase(),a=new ws(!t||/^\s/u.test(t)?t:` ${t}`,"ext-attrs",o,n,l),h=_e(fe({},n),{ext:n.ext.filter(d=>d!==o),excludes:[...n.excludes]});let u;switch(h.inExt=!0,o){case"tab":h.ext=h.ext.filter(d=>d!=="tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":case"langconvert":case"phonos":o==="poem"&&h.excludes.push("heading"),u=new E(s,h,l);break;case"pre":{const{PreToken:d}=(Da(),Q(Yl));u=new d(s,h,l);break}case"dynamicpagelist":{const{ParamTagToken:d}=(to(),Q(eo));u=new d(r,s,h,l);break}case"inputbox":{const{InputboxToken:d}=(Ka(),Q(lo));u=new d(r,s,h,l);break}case"references":{const{NestedToken:d}=(di(),Q(hs));h.excludes.push("heading"),u=new d(s,r,["ref"],h,l);break}case"choose":{const{NestedToken:d}=(di(),Q(hs));u=new d(s,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],h,l);break}case"combobox":{const{NestedToken:d}=(di(),Q(hs));u=new d(s,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],h,l);break}case"gallery":{const{GalleryToken:d}=(Za(),Q(xo));u=new d(s,h,l);break}case"imagemap":{const{ImagemapToken:d}=(tu(),Q(wo));u=new d(s,h,l);break}case"hiero":{const{CommentedToken:d}=(su(),Q(So));u=new d(s,h,l);break}default:{const{NowikiToken:d}=(iu(),Q(Ao));u=new d(s,h,l)}}u.setAttribute("name",o),u.type==="plain"&&(u.type="ext-inner"),super(e,a,u,i,n,l),this.seal("closed",!0)}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),i=new ie(this,e);if(this.name!=="nowiki"){const l=this.inHtmlAttrs(),o="parsing-order",a=l&&k.lintConfig.getSeverity(o,l===2?"ext":"templateInTable");a&&s.push(J(this,i,o,"extension tag in HTML tag attributes",a))}const n="var-anchor",r=k.lintConfig.getSeverity(n,"ref");return r&&this.name==="ref"&&this.closest("heading-title")&&s.push(J(this,i,n,"variable anchor in a section header",r)),s}},Si=Y(el),ot=K(Si,0,"ExtToken",Zr,ot),X(Si,1,ot)}}),To={};te(To,{parseCommentAndExt:()=>Vt});var ki,tl,ts,sl,Ai,Vt,ks=_({"parser/commentAndExt.ts"(){"use strict";Xe(),he(),Wa(),We(),Ma(),Ua(),$o(),yo(),ki="<onlyinclude>",tl="</onlyinclude>",{length:ts}=ki,sl=[!1,!0].map(e=>{const t=e?"includeonly":"(?:no|only)include",s=e?"noinclude":"includeonly";return Pl(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"))}),Ai=e=>{const t=e.indexOf(ki);return{i:t,j:e.indexOf(tl,t+ts)}},Vt=(e,t,s,i)=>{if(i){let{i:o,j:a}=Ai(e);if(o!==-1&&a!==-1){let h="";const u=d=>{new ue(d,t,s),h+=`\0${s.length-1}n`};for(;o!==-1&&a!==-1;){const d=`\0${s.length}e`;new Nt(e.slice(o+ts,a),t,s),o>0&&u(e.slice(0,o)),h+=d,e=e.slice(a+ts+1),{i:o,j:a}=Ai(e)}return e&&u(e),h}}const{ext:n}=t,r=n.filter(o=>o!=="translate"&&o!=="tvar"),l=_e(fe({},t),{ext:r});if(n.includes("translate")){const o=[];e=e.replace(/<nowiki>[\s\S]*?<\/nowiki>/giu,a=>(o.push(a),`\0${o.length-1}`)).replace(/<translate( nowrap)?>([\s\S]+?)?<\/translate>/gu,(a,h,u)=>{const d=s.length;return new Dl(h,u&&me(u,o),l,s),`\0${d}g`}),e=me(e,o)}return e.replace(sl[i?1:0](r),(o,a,h,u,d,g,c,p,b)=>{const m=s.length;let x="n";if(a)x="e",new ot(a,h,u,d,l,g,s);else if(o.startsWith("<!--")){x="c";const w=o.endsWith("-->");new lt(me(o,s,1).slice(4,w?-3:void 0),w,t,s)}else g?new Lt(g,c&&me(c,s,1),p&&me(p,s,1),b,t,s):new ue(o,t,s);return`\0${m}${x}`})}}}),il,nl,rl,ll,_i,ol,Rt,nu=_({"src/html.ts"(){"use strict";var e,t,s,i,n;U(),Te(),oe(),pn(),q(),B(),il=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),nl=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"]),rl=new Set(["strike","big","center","font","tt"]),ll=[bs()],Rt=(n=class extends(ol=E){constructor(l,o,a,h,u,d){super(void 0,u,d);N(this,e);N(this,t);N(this,s);N(this,i);this.insertAt(o),this.setAttribute("name",l.toLowerCase()),L(this,e,a),L(this,t,h),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 T;const a=super.lint(l,o),{name:h,parentNode:u,closing:d,selfClosing:g}=this,c=new ie(this,l),p=this.inTableAttrs();let b="h1",m=k.lintConfig.getSeverity(b,"html");if(m&&h==="h1"&&!d){const v=J(this,c,b,"<h1>",m);v.suggestions=[{desc:"h2",range:[l+2,l+3],text:"2"}],a.push(v)}if(b="parsing-order",m=p&&k.lintConfig.getSeverity(b,p===2?"html":"templateInTable"),m){const v=J(this,c,b,"HTML tag in table attributes",m);p===2&&(v.suggestions=[D(v)]),a.push(v)}if(b="obsolete-tag",m=k.lintConfig.getSeverity(b,h),m&&rl.has(h)&&a.push(J(this,c,b,"obsolete HTML tag",m)),b="bold-header",m=k.lintConfig.getSeverity(b,h),m&&(h==="b"||h==="strong")&&((T=this.closest("heading-title,ext"))==null?void 0:T.type)==="heading-title"){const v=J(this,c,b,"bold in section header",m);v.suggestions=[D(v)],a.push(v)}const{html:[,x,w]}=this.getAttribute("config"),y=w.includes(h),S=x.includes(h),A=!y&&!S;if(b="unmatched-tag",d&&(g||y)||g&&A){if(m=k.lintConfig.getSeverity(b,d?"both":"selfClosing"),m){const v=J(this,c,b,d?"tag that is both closing and self-closing":"invalid self-closing tag",m),$=on(l),C={desc:"no self-closing",range:[v.endIndex-2,v.endIndex-1],text:""};S?v.suggestions=[$,C]:d?v.fix=y?$:C:v.suggestions=[C,Oe(v.endIndex,`></${h}>`,-2)],a.push(v)}}else if(!this.findMatchingTag()){const v=J(this,c,b,d?"unmatched closing tag":"unclosed tag"),$=this.closest("magic-word");if($&&il.has($.name))m=k.lintConfig.getSeverity(b,"conditional");else if(d)m=k.lintConfig.getSeverity(b,"closing"),v.suggestions=[D(v)];else{m=k.lintConfig.getSeverity(b,"opening");const C=u==null?void 0:u.childNodes;nl.has(h)&&(C!=null&&C.slice(0,C.indexOf(this)).some(I=>I.type==="html"&&I.name===h&&!I.findMatchingTag())&&(v.suggestions=[Oe(l+1,"/")]),this.closest("heading-title")&&(v.rule="format-leakage",m=k.lintConfig.getSeverity("format-leakage",h)))}m&&(v.severity=m,a.push(v))}return a}findMatchingTag(){return Ve(f(this,i),()=>{const{name:l,parentNode:o,closing:a,selfClosing:h}=this,{html:[,u,d]}=this.getAttribute("config"),g=d.includes(l),c=u.includes(l);if(g||c&&h)return this;if(!o)return;const{childNodes:p}=o,b=p.indexOf(this),m=a?p.slice(0,b).reverse():p.slice(b+1),x=[this],{rev:w}=we;for(const y of m)if(!(!y.is("html")||y.name!==l||c&&f(y,t)))if(f(y,e)===a)x.push(y);else{const S=x.pop();if(S===this)return y;k.viewOnly&&(L(S,i,[w,y]),L(y,i,[w,S]))}if(k.viewOnly)for(const y of x)L(y,i,[w,void 0])},l=>{L(this,i,l),l[1]&&l[1]!==this&&L(l[1],i,[we.rev,this])})}print(){return super.print({pre:`<${this.closing?"/":""}${f(this,s)}`,post:`${f(this,t)?"/":""}>`})}json(l,o=this.getAbsoluteIndex()){const a=super.json(void 0,o);return Object.assign(a,{closing:this.closing,selfClosing:f(this,t)}),a}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,n),_i=Y(ol),Rt=K(_i,0,"HtmlToken",ll,Rt),X(_i,1,Rt)}}),Co={};te(Co,{parseHtml:()=>Io});var al,Io,ru=_({"parser/html.ts"(){"use strict";fn(),nu(),al=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,Io=(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 a=al.exec(o),h=a==null?void 0:a[2],u=h==null?void 0:h.toLowerCase();if(!a||!t.htmlElements.has(u)){r+=`<${o}`;continue}const[,d,,g="",c,p]=a,{length:b}=s,m=new ws(g,"html-attrs",u,t,s),x=m.hasAttr("itemprop");if(u==="meta"&&!(x&&m.hasAttr("content"))||u==="link"&&!(x&&m.hasAttr("href"))){r+=`<${o}`,s.length=b;continue}r+=`\0${s.length}x${p}`,new Rt(h,m,d==="/",c==="/>",t,s)}return r}}}),yn,No=_({"src/table/base.ts"(){"use strict";pn(),B(),mt(),fn(),yn=class extends bs(1)(E){constructor(e,t,s,i,n,r=[],l){super(void 0,n,r,l),this.append(new Ye(t,"table-syntax",n,r),new ws(i,"table-attrs",s,n,r))}escape(){}}}}),ul,$i,Se,ss,At,_t,gs,Lo=_({"src/table/td.ts"(){"use strict";U(),oe(),cn(),q(),B(),No(),gs=class extends($i=yn,ul=[xs(!1)],$i){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),X(ss,5,this),je(this,At),je(this,Se,""),n&&([La(this,Se)._]=n);const l=new E(t==null?void 0:t.slice(((o=n==null?void 0:n.index)!=null?o:NaN)+ae(this,Se).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 Mi(this,At,_t).call(this).subtype}afterBuild(){ae(this,Se).includes("\0")&&xe(this,Se,this.buildFromStr(ae(this,Se),0)),super.afterBuild()}toString(e){const{childNodes:[t,s,i]}=this;return t.toString(e)+s.toString(e)+ae(this,Se)+i.toString(e)}text(){const{childNodes:[e,t,s]}=this;return e.text()+t.text()+ae(this,Se)+s.text()}getGaps(e){return e===1?ae(this,Se).length:0}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),i=new ie(this,e+this.getRelativeIndex(this.length-1)),n="pipe-like",r=["td","double"].map(l=>k.lintConfig.getSeverity(n,l));for(const l of this.lastChild.childNodes)if(l.type==="text"){const{data:o}=l;if(o.includes("|")){const a=o.includes("||"),h=r[a?1:0];if(h){const u=O(l,i,n,'additional "|" in a table cell',h);if(a){const d={caption:"|+",td:"|",th:"!"}[this.subtype];u.fix=ke(u,"newline",o.replace(/\|\|/gu,`
|
|
14
|
-
${
|
|
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()}${ae(this,Se)}${s.print()}</span>`}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t),{rowspan:i,colspan:n}=this;return Object.assign(s,{subtype:this.subtype},i!==1&&{rowspan:i},n!==1&&{colspan:n}),s}},ss=Y($i),Se=new WeakMap,At=new WeakSet,_t=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:n}=this;return
|
|
16
|
-
|}`,t){const s=this.getAttribute("config"),i=this.getAttribute("accum");we.run(()=>{const n=new Ye(t?e:void 0,"table-syntax",s,i);super.insertAt(n)})}getLayout(e){const t=this.getAllRows(),{length:s}=t,i=cl.from(
|
|
6
|
+
`})}}return t}}}),io={};te(io,{ParamTagToken:()=>tt});var vr,ti,br,tt,no=_({"src/paramTag/index.ts"(){"use strict";z(),oe(),ks(),mn(),q(),B(),qe(),vr=[ys],tt=class extends(br=E){get type(){return"ext-inner"}constructor(e,t,s=k.getConfig(),i=[],n){if(super(void 0,s,i,{}),t){const r=ge;this.append(...t.split(`
|
|
7
|
+
`).map(l=>n?l:Vt(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",s=k.lintConfig.getSeverity(t,this.name);if(!s)return[];const i=new ie(this,e),n=k.msg("invalid-parameter",this.name),r=[];for(const l of this.childNodes){l.setAttribute("aIndex",e);const o=l.childNodes.filter(({type:a})=>a!=="comment"&&a!=="include"&&a!=="noinclude");if(o.some(({type:a})=>a==="ext"))r.push(O(l,i,t,n,s));else{const a=o.findIndex(({type:u})=>u!=="text"),d=o.slice(0,a===-1?void 0:a).map(String).join("");if(d&&!(a===-1?/^[a-z]+(?:\[\])?\s*=/iu:/^[a-z]+(?:\[\])?\s*(?:=|$)/iu).test(d)){const u=O(l,i,t,n,s);u.suggestions=[D(u)],r.push(u)}else{const u=l.lint(e,!1);u.length>0&&r.push(...u)}}e+=l.toString().length+1}return r}},ti=Y(br),tt=K(ti,0,"ParamTagToken",vr,tt),X(ti,1,tt)}}),wr,si,yr,st,ro=_({"src/heading.ts"(){"use strict";var e,t,as,i;z(),Te(),oe(),Le(),q(),B(),xt(),wr=[$e],st=(i=class extends(yr=E){constructor(r,l,o,a=[]){super(void 0,o,a);N(this,t);N(this,e);L(this,e,r);const d=new E(l[0],o,a);d.type="heading-title",d.setAttribute("stage",2);const u=new Ye(l[1],"heading-trail",o,a);this.append(d,u)}get type(){return"heading"}get level(){return f(this,e)}toString(r){const l=j(this,t,as).call(this);return l+this.firstChild.toString(r)+l+this.lastChild.toString(r)}text(){const r=j(this,t,as).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:a,level:d}=this,u=a.toString(),h=u.startsWith("="),g=h||u.endsWith("="),c=new ie(this,r),p=this.inHtmlAttrs(),b=["h1","unbalanced-header","format-leakage"],x=b.map(m=>k.lintConfig.getSeverity(m,"apostrophe"));if(x[0]&&this.level===1){const m=O(a,c,b[0],"<h1>",x[0]);g||(m.suggestions=[ke(m,"h2",`=${u}=`)]),o.push(m)}if(x[1]&&g){const m=k.msg("unbalanced-in-section-header",'"="'),w=O(a,c,b[1],m,x[1]);if(u!=="=")if(h){const[y]=/^=+/u.exec(u),S=d+y.length;w.suggestions=[{desc:`h${d}`,range:[w.startIndex,w.startIndex+y.length],text:""}],S<7&&w.suggestions.push({desc:`h${S}`,range:[w.endIndex,w.endIndex],text:y})}else{const y=/[^=](=+)$/u.exec(u)[1],S=d+y.length;w.suggestions=[{desc:`h${d}`,range:[w.endIndex-y.length,w.endIndex],text:""}],S<7&&w.suggestions.push({desc:`h${S}`,range:[w.startIndex,w.startIndex],text:y})}o.push(w)}if(p){const m="parsing-order",w=k.lintConfig.getSeverity(m,p===2?"heading":"templateInTable");w&&o.push(J(this,c,m,"header-in-html",w))}if(x[2]){const m=this.getRootNode().toString(),w=a.childNodes.filter(As("quote")),y=w.filter(({bold:A})=>A),S=w.filter(({italic:A})=>A);if(y.length%2){const A=O(y[y.length-1],_e(ce({},c),{start:r+d,left:c.left+d}),b[2],k.msg("unbalanced-in-section-header","bold-apostrophes"),x[2]),T=r+d+u.length,v=D(A);m.slice(A.endIndex,T).trim()?A.suggestions=[v,Oe(T,"'''")]:y.length===1&&S.length===0?A.fix=v:A.suggestions=[v],o.push(A)}if(S.length%2){const A=O(S[S.length-1],{start:r+d},b[2],k.msg("unbalanced-in-section-header","italic-apostrophes"),x[2]),T=r+d+u.length;m.slice(A.endIndex,T).trim()?A.suggestions=[Oe(T,"''")]:S.length===1&&y.length===0?A.fix=D(A):A.suggestions=[D(A)],o.push(A)}}return o}print(){const r=j(this,t,as).call(this);return super.print({pre:r,sep:r})}json(r,l=this.getAbsoluteIndex()){const o=super.json(void 0,l);return o.level=this.level,o}},e=new WeakMap,t=new WeakSet,as=function(){return"=".repeat(this.level)},i),si=Y(yr),st=K(si,0,"HeadingToken",wr,st),X(si,1,st)}}),Sr,lo,Ja=_({"src/parameter.ts"(){"use strict";de(),z(),q(),B(),Sr=new RegExp(`https?://${ut}${dt}$`,"iu"),lo=class extends E{get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){var e;try{return!!((e=this.parentNode)!=null&&e.getDuplicatedArgs().some(([t])=>t===this.name))}catch(t){return!1}}constructor(e,t,s,i=[]){super(void 0,s,i);const n=new E(typeof e=="number"?void 0:e,s,i,{}),r=new E(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 r;const s=super.lint(e,t),i="unescaped",n=k.lintConfig.getSeverity(i);if(n){const{firstChild:l}=this,o=(r=Sr.exec(l.text()))==null?void 0:r[0];try{if(o&&new URL(o).search){const a=O(l,{start:e},i,"unescaped-query",n);a.startIndex=a.endIndex,a.startLine=a.endLine,a.startCol=a.endCol,a.endIndex++,a.endCol++,a.fix=gt(a.startIndex,"{{=}}"),s.push(a)}}catch(a){}}return s}print(){return super.print({sep:this.anon?"":"="})}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t);return Object.assign(s,{anon:this.anon},this.duplicated&&{duplicated:!0}),s}}}}),kr,ii,Ar,it,Xa=_({"src/transclude.ts"(){"use strict";var e,t,s,i,n,r,us,oo,a;de(),z(),Te(),oe(),vs(),Le(),q(),B(),Ja(),qe(),xt(),kr=[$e,Gt()],it=(a=class extends(Ar=E){constructor(u,h,g,c=[]){var I,U;let p;const b=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(u);b&&(p=Number(b[1]),u=u.replace(`\0${p}h`,c[p].toString().replace(/^\n/u,"")));super(void 0,g,c,{});N(this,r);Ne(this,"modifier","");N(this,e,"template");N(this,t,":");N(this,s,!1);N(this,i,new Map);N(this,n);const{parserFunction:[x,m],variable:w,functionHook:y}=g,S=(I=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(u))==null?void 0:I[0];if(S)this.setAttribute("modifier",S),u=u.slice(S.length);else if(u.includes(":")){const[R,...P]=u.split(":"),[W]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((U=P[0])!=null?U:"");this.setModifier(`${R}:${W}`)&&(u=P.join(":").slice(W.length))}const A=u.search(/[::]/u),T=u[A]===":",v=A!==-1;if(v||h.length===0&&!f(this,s)){const R=v?u.slice(0,A):u,P=v&&u.slice(A+1),W=be(R),H=v?W.slice(W.search(/\S/u))+(T?":":""):W.trim(),pe=H.toLowerCase(),ee=Array.isArray(m),M=ee?m.includes(H):Object.prototype.hasOwnProperty.call(m,H),F=!ee&&M?m[H]:Object.prototype.hasOwnProperty.call(x,pe)&&x[pe],V=ee&&M||!("functionHook"in g)||y.includes(F),G=ee&&M||w.includes(F);if(v?F&&V:G){this.setAttribute("name",F||pe.replace(/^#|:$/u,"")),L(this,e,"magic-word"),T&&L(this,t,":");const Z=new Ye(R,"magic-word-name",g,c);if(super.insertAt(Z),P!==!1&&h.unshift([P]),this.name==="invoke")for(let ne=0;ne<2;ne++){const le=h.shift();if(!le)break;const re=new ge(le.join("="),`invoke-${ne?"function":"module"}`,g,c);super.insertAt(re)}}}if(this.type==="template"){const R=be(u).trim();if(!this.normalizeTitle(R,10,{halfParsed:!0,temporary:!0}).valid)throw c.pop(),new SyntaxError("Invalid template name");const P=new ge(u,"template-name",g,c,{});super.insertAt(P)}typeof p=="number"&&(c[p]=void 0);const $=this.isTemplate();let C=1;for(let R=0;R<h.length;R++){const P=h[R];$||this.name==="switch"&&R>0||this.name==="tag"&&R>1||(P[0]=P.join("="),P.length=1),P.length===1&&(P.unshift(C),C++),this.insertAt(new lo(...P,g,c))}this.seal("modifier")}get type(){return f(this,e)}get module(){}get function(){}setModifier(u){const{parserFunction:[,,h,g]}=this.getAttribute("config"),c=be(u).trim();if(u&&!c.endsWith(":"))return!1;const p=c.slice(0,-1).toLowerCase(),b=h.includes(p),x=g.includes(p);return f(this,s)&&b||!f(this,s)&&(x||!u)||(we.running||this.length>1)&&(b||x||!u)?(this.setAttribute("modifier",u),L(this,s,b),!!u):!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,j(this,r,us).call(this)),this.setAttribute("name",f(this,n).title))}toString(u){const{childNodes:h,length:g,firstChild:c,modifier:p,type:b}=this;return`{{${p}${b==="magic-word"?c.toString(u)+(g===1?"":f(this,t))+h.slice(1).map(x=>x.toString(u)).join("|"):super.toString(u,"|")}}}`}text(){const{childNodes:u,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))+Qe(u.slice(1),"|"):super.text("|")}}}`}getAttribute(u){switch(u){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||!j(this,r,us).call(this).valid);default:return super.getAttribute(u)}}lint(u=this.getAbsoluteIndex(),h){const g=super.lint(u,h);if(!this.isTemplate())return g;const{type:c,childNodes:p,length:b}=this,x=new ie(this,u),m=c==="magic-word";let w="no-ignored",y=k.lintConfig.getSeverity(w,"fragment");if(m&&!j(this,r,us).call(this).valid)w="invalid-invoke",y=k.lintConfig.getSeverity(w,"name"),y&&g.push(O(p[1],x,w,"illegal-module",y));else if(y){const S=p[m?1:0],A=S.childNodes.findIndex(v=>v.type==="text"&&Mt(v.data).includes("#")),T=S.childNodes[A];if(T){const v=O(S,x,w,"useless-fragment",y);v.suggestions=[D(v,S.getRelativeIndex(A)+T.data.indexOf("#"))],g.push(v)}}if(w="invalid-invoke",y=k.lintConfig.getSeverity(w,"function"),y&&m&&b===2)return g.push(J(this,x,w,"missing-function",y)),g;if(w="no-duplicate",y=k.lintConfig.getSeverity(w,"parameter"),y){const S=this.getDuplicatedArgs().filter(([,T])=>!T[0].querySelector("ext")),A="duplicate-parameter";for(const[,T]of S)g.push(...T.map(v=>{const $=O(v,x,w,A,y);return $.suggestions=[D($,-1)],$}))}return g}insertAt(u,h=this.length){return super.insertAt(u,h),u.anon?j(this,r,oo).call(this,u):u.name&&this.getArgs(u.name,!1,!1).add(u),u}getAllArgs(){return this.childNodes.filter(As("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:u})=>u)}getArgs(u,h,g=!0){const c=String(u).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:u}])=>u>1).map(([u,h])=>[u,[...h]])}getPossibleValues(){const{type:u,name:h,childNodes:g}=this;if(u==="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),x=b[b.length-1];p=[...b.filter(({anon:m})=>!m),...x!=null&&x.anon?[x]:[]].map(({lastChild:m})=>m);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:x,0:m}=p[b].childNodes.filter(w=>w.text().trim());if(x===0)p.splice(b,1);else if(x>1||m.type!=="magic-word")b++;else try{const w=m.getPossibleValues();p.splice(b,1,...w),b+=w.length}catch(w){b++}}return p}print(){const{childNodes:u,length:h,firstChild:g,modifier:c,type:p}=this;return`<span class="wpb-${p}${this.getAttribute("invalid")?" wpb-invalid":""}">{{${p==="magic-word"?zt(c)+g.print()+(h===1?"":f(this,t))+ct(u.slice(1),{sep:"|"}):(c?`<span class="wpb-magic-word">${zt(c)}</span>`:"")+ct(u,{sep:"|"})}}}</span>`}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,n=new WeakMap,r=new WeakSet,us=function(){const u=this.type==="template";return this.normalizeTitle(this.childNodes[u?0:1].text(),u?10:828,{temporary:!0})},oo=function(u){const h=this.getAnonArgs(),g=typeof u!="number";for(let c=g?h.indexOf(u):u-1;c<h.length;c++){const p=h[c],{name:b}=p,x=String(c+1);(b!==x||p===u)&&(p.setAttribute("name",x),this.getArgs(x,!1,!1).add(p))}},a),ii=Y(Ar),it=K(ii,0,"TranscludeToken",kr,it),X(ii,1,it)}}),_r,ni,$r,Ft,Ka=_({"src/hidden.ts"(){"use strict";mt(),B(),_r=[Ke()],Ft=class extends($r=E){get type(){return"hidden"}getAttribute(e){return e==="invalid"||super.getAttribute(e)}},ni=Y($r),Ft=K(ni,0,"HiddenToken",_r,Ft),X(ni,1,Ft)}}),Tr,ri,Cr,Et,Ya=_({"src/arg.ts"(){"use strict";var e,Za,s;de(),z(),oe(),Be(),vs(),Le(),q(),B(),qe(),Ka(),Tr=[$e,Fe("{{{"),Gt()],Et=(s=class extends(Cr=E){constructor(n,r,l=[]){super(void 0,r,l,{});N(this,e);for(let o=0;o<n.length;o++){const a=n[o];if(o===0){const d=new ge(a,"arg-name",r,l,{});super.insertAt(d)}else if(o>1){const d=new Ft(a,r,l);super.insertAt(d)}else{const d=new E(a,r,l);d.type="arg-default",d.setAttribute("stage",2),super.insertAt(d)}}}get type(){return"arg"}get default(){var n,r;return(r=(n=this.childNodes[1])==null?void 0:n.text())!=null?r:!1}toString(n){return`{{{${super.toString(n,"|")}}}}`}text(){return`{{{${Qe(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){super.afterBuild()}lint(n=this.getAbsoluteIndex(),r){const{childNodes:[l,o,...a]}=this;l.setAttribute("aIndex",n+3);const d=l.lint(n+3,r);if(o){const g=n+4+l.toString().length;o.setAttribute("aIndex",g);const c=o.lint(g,r);c.length>0&&d.push(...c)}const u=["no-ignored","no-arg"],h=u.map(g=>k.lintConfig.getSeverity(g,"arg"));if(h[0]&&a.length>0){const g=new ie(this,n);d.push(...a.map(c=>{const p=O(c,g,u[0],"invisible-triple-braces",h[0]);return p.startIndex--,p.startCol--,p.suggestions=[D(p),gt(p.startIndex,"{{!}}")],p}))}if(h[1]&&!this.getAttribute("include")){const g=J(this,{start:n},u[1],"unexpected-argument",h[1]);o&&(g.suggestions=[ke(g,"expand",o.text())]),d.push(g)}return d}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(n,r=this.getAbsoluteIndex()){const l=super.json(void 0,r);return l.default=this.default,l}},e=new WeakSet,Za=function(){},s),ri=Y(Cr),Et=K(ri,0,"ArgToken",Tr,Et),X(ri,1,Et)}}),ao={};te(ao,{parseBraces:()=>Ss});var Ir,li,es,oi,ai,ui,Nr,di,Ss,xn=_({"parser/braces.ts"(){"use strict";Xe(),de(),ro(),Xa(),Ya(),Ir={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},li=String.raw`\[(?!\[)`,es=String.raw`\n(?![=\0])`,oi=String.raw`|\{{2,}`,ai=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),ui=at(e=>new RegExp(e,"gmu")),Nr=new RegExp(String.raw`\{\{((?:[^\n{}[]|${li}|${es})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${es})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${li}|${es})*\}-`,"gu"),di=e=>{const t=ht(be(e));return ai.has(t)?ai.get(t):/^(?:filepath|(?:full|canonical)urle?):./u.test(t)?"m":/^#vardefine:./u.test(t)?"n":"t"},Ss=(e,t,s)=>{var p,b,x,m,w;const i=String.raw`${t.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,n]}=t,r=[],l=[],o=(y,S,A,T)=>{S[S.length-1].push(xe(y.slice(A,T),l))};let a;do a!==void 0&&(e=a),a=e.replace(Nr,(y,S,A)=>{if(S!==void 0||typeof A=="string")try{const{length:T}=s,v=(S!=null?S:A).split("|");return new it(xe(v[0],l),v.slice(1).map($=>{const C=$.indexOf("=");return(C===-1?[$]:[$.slice(0,C),$.slice(C+1)]).map(I=>xe(I,l))}),t,s),`\0${T}${di(v[0])}`}catch(T){if(!(T instanceof SyntaxError)||T.message!=="Invalid template name")throw T}return l.push(xe(y,l)),`\0${l.length-1}`});while(a!==e);e=a;const d=e.lastIndexOf("}}")-e.length;let u=d+e.length!==-1,h=ui(i+(u?oi:"")),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:y,index:S}=g!=null?g:{0:`
|
|
8
|
+
`,index:e.length},A=(x=r.pop())!=null?x:{},{0:T,index:v,parts:$,findEqual:C,pos:I}=A,U=y==="="&&C;if(y==="]]"||y==="}-")c=S+2;else if(y===`
|
|
9
|
+
`){c=S+1;const{pos:P,findEqual:W}=(m=r[r.length-1])!=null?m:{};if(P===void 0||W||be(e.slice(P,v))!==""){const H=/^(={1,6})(.+)\1((?:\s|\0\d+[cn]\x7F)*)$/u.exec(e.slice(v,S));H&&(H[2]=xe(H[2],l),H[2].includes(`
|
|
10
|
+
`)||(e=`${e.slice(0,v)}\0${s.length}h${e.slice(S)}`,c=v+4+String(s.length).length,new st(H[1].length,H.slice(2),t,s)))}}else if(y==="|"||U)c=S+1,o(e,$,I,S),y==="|"&&$.push([]),A.pos=c,A.findEqual=y==="|",r.push(A);else if(y.startsWith("}}")){const P=y.slice(0,Math.min(T.length,3)),W=T.length-P.length,{length:H}=s;c=S+P.length,o(e,$,I,S);let pe=!1,ee="t";if(P.length===3){const M=$.map(V=>V.join("=")),F=M.length>1&&be(M[1]).trim();new Et(M,t,s),F&&F.endsWith(":")&&n.includes(F.slice(0,-1).toLowerCase())&&(ee="s")}else try{new it($[0][0],$.slice(1),t,s),ee=di($[0][0])}catch(M){if(M instanceof SyntaxError&&M.message==="Invalid template name")pe=!0;else throw M}pe||(e=`${e.slice(0,v+W)}\0${H}${ee}${e.slice(c)}`,c=v+W+3+String(H).length,W>1?r.push({0:T.slice(0,W),index:v,pos:v+W,parts:[[]]}):W===1&&e[v-1]==="-"&&r.push({0:"-{",index:v-1,pos:v+1,parts:[[]]}))}else c=S+y.length,y.startsWith("{")&&(g.pos=c,g.parts=[[]]),r.push(..."0"in A?[A]:[],g);let R=r[r.length-1];if(u&&d+e.length<c)for(u=!1;(w=R==null?void 0:R[0])!=null&&w.startsWith("{");)r.pop(),R=r[r.length-1];h=ui(i+(u?oi:"")+(R?`|${Ir[R[0][0]]}${R.findEqual?"|=":""}`:"")),h.lastIndex=c,g=h.exec(e)}return xe(e,l)}}}),uo={};te(uo,{InputboxToken:()=>ho});var ho,eu=_({"src/paramTag/inputbox.ts"(){"use strict";ks(),xn(),q(),no(),ho=class extends tt{constructor(e,t,s=k.getConfig(),i=[]){const n=Symbol("InputboxToken"),r=s.excludes.includes("heading")?s:_e(ce({},s),{excludes:[...s.excludes,"heading"]}),{length:l}=i;i.push(n),t&&(t=Vt(t,r,i,e)),t&&(t=Ss(t,r,i)),i.splice(l,1),super(e,t,r,i,{})}}}}),ds={};te(ds,{NestedToken:()=>co});var Lr,Fr,co,hi=_({"src/nested.ts"(){"use strict";var e,t,s;z(),oe(),ks(),xn(),q(),B(),Io(),We(),Lr=new Set(["comment","include","arg","template","magic-word"]),Fr=[!1,!0].map(i=>{const n=i?"includeonly":"noinclude";return new RegExp(String.raw`^(?:<${n}(?:\s[^>]*)?/?>|</${n}\s*>)$`,"iu")}),co=(s=class extends E{constructor(n,r,l,o,a=[]){if(typeof r=="boolean"){const d=Symbol("NestedToken"),{length:u}=a;a.push(d),n&&(n=Vt(n,o,a,r)),n&&(n=Ss(n,o,a)),a.splice(u,1)}else n&&(n=n.replace(r,(d,u,h,g,c)=>{const p=`\0${a.length+1}e`;return new ot(u,h,g,c,o,!1,a),p}));n&&(n=n.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(d,u,h)=>(new ue(h,o,a),`${u}\0${a.length}n`)));super(n,o,a);N(this,e);N(this,t);L(this,e,[...l]),L(this,t,r)}get type(){return"ext-inner"}lint(n=this.getAbsoluteIndex(),r){const l=super.lint(n,r),o="no-ignored",a=k.lintConfig.getSeverity(o,this.name);if(!a)return l;const d=new ie(this,n),u=typeof f(this,t)=="boolean"?Fr[f(this,t)?1:0]:/^<!--[\s\S]*-->$/u;return[...l,...this.childNodes.filter(h=>{const{type:g,name:c}=h;if(g==="ext")return!f(this,e).includes(c);if(Lr.has(g))return!1;const p=h.toString().trim();return p&&!u.test(p)}).map(h=>{const g=O(h,d,o,k.msg("invalid-content",this.name),a);return g.suggestions=[D(g),an(g,h.toString())],g})]}},e=new WeakMap,t=new WeakMap,s)}});function Er(e,t,s,i,n){t=be(t).trim();let r=t.replace(e==="link"?/\0\d+[tq]\x7F/gu:/\0\d+t\x7F/gu,"").trim();switch(e){case"width":return!r&&!!t||/^(?:\d+x?|\d*x\d+)(?:\s*px)?$/u.test(r);case"link":{if(r){if(go(s.protocol).test(r))return po(s.protocol).test(r)&&t;r.startsWith("[[")&&r.endsWith("]]")&&(r=r.slice(2,-2))}else return t;const l=k.normalizeTitle(r,0,!1,s,{halfParsed:i,decode:!0,selfLink:!0});return l.valid&&l}case"lang":return(n==="svg"||n==="svgz")&&!/[^a-z\d-]/u.test(r);case"alt":case"class":case"manualthumb":return!0;case"page":return(n==="djvu"||n==="djv"||n==="pdf")&&Number(r)>0;default:return!!r&&!isNaN(r)}}var go,po,jr,Pr,fo,tu=_({"src/imageParameter.ts"(){"use strict";var e,t,mo,n;Xe(),de(),z(),q(),B(),go=at(r=>new RegExp(String.raw`^(?:${r}|//|\0\d+m\x7F)`,"iu")),po=at(r=>new RegExp(String.raw`^(?:(?:${r}|//)${ut}|\0\d+m\x7F)${dt}$`,"iu")),jr=at(r=>new RegExp(String.raw`^(\s*(?!\s))${r.replace("$1","(.*)")}${r.endsWith("$1")?`(?=$|
|
|
11
|
+
)`:""}(\s*)$`,"u")),Pr=new Set(["alt","link","lang","page","caption"]),fo=(n=class extends E{constructor(l,o,a,d){var r=(...i)=>(super(...i),N(this,t),N(this,e,""),this);let u;const h=Object.entries(a.img).map(([c,p])=>[c,p,jr(c)]),g=h.find(([,c,p])=>(u=p.exec(l),u&&(u.length!==4||Er(c,u[2],a,!0,o)!==!1)));if(g&&u){u.length===3?(r(void 0,a,d),L(this,e,l)):(r(u[2],a,d,{}),L(this,e,u[1]+g[0]+u[3])),this.setAttribute("name",g[1]);return}r(l,a.excludes.includes("list")?a:_e(ce({},a),{excludes:[...a.excludes,"list"]}),d),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get type(){return"image-parameter"}get link(){return this.name==="link"?Er("link",super.text(),this.getAttribute("config")):void 0}afterBuild(){var l;(l=this.parentNode)!=null&&l.is("gallery-image")&&!Pr.has(this.name)&&this.setAttribute("name","invalid"),super.afterBuild()}toString(l){return f(this,e)?f(this,e).replace("$1",super.toString(l)):super.toString(l)}text(){return f(this,e)?f(this,e).replace("$1",super.text()).trim():super.text().trim()}isPlain(){return this.name==="caption"}getAttribute(l){return l==="invalid"?this.name==="invalid":l==="padding"?Math.max(0,f(this,e).indexOf("$1")):super.getAttribute(l)}lint(l=this.getAbsoluteIndex(),o){const a=super.lint(l,o),{link:d,name:u}=this;if(u==="invalid"){const h="invalid-gallery",g=k.lintConfig.getSeverity(h,"parameter");if(g){const c=J(this,{start:l},h,"invalid-image-parameter",g);c.fix=D(c,-1),a.push(c)}}else if(typeof d=="object"&&d.encoded){const h="url-encoding",g=k.lintConfig.getSeverity(h,"file");if(g){const c=J(this,{start:l},h,"unnecessary-encoding",g);c.fix=ln(c,this),a.push(c)}}return a}getValue(){return this.name==="invalid"?this.text():j(this,t,mo).call(this)||super.text()}print(){return f(this,e)?`<span class="wpb-image-parameter${this.name==="invalid"?" wpb-invalid":""}">${f(this,e).replace("$1",`<span class="wpb-image-caption">${ct(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}},e=new WeakMap,t=new WeakSet,mo=function(){return f(this,e)&&!f(this,e).includes("$1")},n)}}),ci,Rr,Or,gi,pi,fi,Br,mi,vn,xo=_({"src/link/file.ts"(){"use strict";z(),oe(),q(),xs(),tu(),ci=new Map([["manualthumb","Thumb"],["frameless","Frameless"],["framed","Frame"],["thumbnail","Thumb"]]),Rr=new Set(["arg"]),Or=new Set(["template","magic-word"]),gi=new Set(["left","right","center","none"]),pi=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),fi=new Set(["tiff","tif","png","gif","jpg","jpeg","webp","xcf","pdf","svg","djvu"]),Br=e=>{if(e===void 0)return[];const t=/-\{|\}-|\|/gu,s=[];let i=t.exec(e),n=0,r=0;for(;i;){const{0:l,index:o}=i;l!=="|"?n+=l==="-{"?1:-1:n===0&&(s.push(e.slice(r,o)),{lastIndex:r}=t),i=t.exec(e)}return s.push(e.slice(r)),s},mi=(e,t)=>e.filter(({childNodes:s})=>{const i=s.filter(n=>n.text().trim());return i.length!==1||!t.has(i[0].type)}),vn=class extends Pe{get type(){return"file"}get extension(){return this.getAttribute("title").extension}constructor(e,t,s,i=[],n="|"){super(e,void 0,s,i,n);const{extension:r}=this.getTitle(!0,!0);this.safeAppend(Br(t).map(l=>new fo(l,r,s,i)))}lint(e=this.getAbsoluteIndex(),t){var x;const s=super.lint(e,t),i=mi(this.getAllArgs(),Rr),n=[...new Set(i.map(({name:m})=>m))],r=n.filter(m=>ci.has(m)),l=n.filter(m=>gi.has(m)),o=n.filter(m=>pi.has(m)),[a]=r,d=a==="framed"||a==="manualthumb",u=new ie(this,e),{extension:h}=this;let g="nested-link",c=k.lintConfig.getSeverity(g,"file");if(c&&fi.has(h)&&this.closest("ext-link-text")&&((x=this.getValue("link"))==null?void 0:x.trim())!==""){const m=J(this,u,g,"link-in-extlink",c),w=this.getArg("link");if(w){const y=e+w.getRelativeIndex();m.fix={desc:k.msg("delink"),range:[y,y+w.toString().length],text:"link="}}else m.fix=fs(m.endIndex-2,"delink","|link=");s.push(m)}if(g="invalid-gallery",c=k.lintConfig.getSeverity(g,"parameter"),c&&d)for(const m of i.filter(({name:w})=>w==="width")){const w=O(m,u,g,"invalid-image-parameter",c);w.fix=D(w,-1),s.push(w)}if(i.length===n.length&&r.length<2&&l.length<2&&o.length<2)return s;g="no-duplicate";const p=["unknownImageParameter","imageParameter"].map(m=>k.lintConfig.getSeverity(g,m)),b=(m,w,y,S=!0)=>m.map(A=>{if(c=p[Number(typeof S=="function"?S(A):S)],!c)return!1;const T=O(A,u,g,k.msg(`${w}-image-parameter`,y),c);return T.suggestions=[D(T,-1)],T}).filter(A=>A!==!1);for(const m of n){if(m==="invalid"||m==="width"&&d)continue;const w=m==="caption";let y=i.filter(({name:S})=>S===m);if(w&&(y=[...y.slice(0,-1).filter(S=>S.text()),...y.slice(-1)]),y.length>1){let S=!w||!h||fi.has(h);if(w&&S){const A=mi(y,Or);S=A.length>1&&(T=>A.includes(T))}s.push(...b(y,"duplicate",m,S))}}return r.length>1&&s.push(...b(i.filter(({name:m})=>ci.has(m)),"conflicting","frame")),l.length>1&&s.push(...b(i.filter(({name:m})=>gi.has(m)),"conflicting","horizontal-alignment")),o.length>1&&s.push(...b(i.filter(({name:m})=>pi.has(m)),"conflicting","vertical-alignment")),s}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()){const s=super.json(void 0,t),{extension:i}=this;return i&&(s.extension=i),s}}}}),qr,xi,Wr,nt,vo=_({"src/link/galleryImage.ts"(){"use strict";var e,Qi,s;z(),Je(),Be(),q(),B(),xo(),qr=[Fe("")],nt=(s=class extends(Wr=vn){constructor(n,r,l,o,a=[]){let d;if(l!==void 0){const{length:u}=a;d=new E(l,o,a);for(let h=0;h<ve-1;h++)d.parseOnce();a.splice(u,1)}super(r,d==null?void 0:d.toString(),o,a);N(this,e);Ne(this,"privateType","imagemap-image");this.setAttribute("bracket",!1),this.privateType=`${n}-image`,this.seal("privateType",!0)}get type(){return this.privateType}getTitle(n){const r=this.type==="imagemap-image";return this.normalizeTitle(this.firstChild.toString(),r?0:6,{halfParsed:!0,temporary:n,decode:!r})}lint(n=this.getAbsoluteIndex(),r){const l=super.lint(n,r),o="invalid-gallery",a=k.lintConfig.getSeverity(o,"image");if(a&&j(this,e,Qi).call(this)){const d=J(this,{start:n},o,"invalid-gallery",a);d.suggestions=[fs(n,"prefix","File:")],l.push(d)}return l}getAttribute(n){return n==="invalid"?j(this,e,Qi).call(this):super.getAttribute(n)}},e=new WeakSet,Qi=function(){const{ns:n}=this.getAttribute("title");return n!==6},s),xi=Y(Wr),nt=K(xi,0,"GalleryImageToken",qr,nt),X(xi,1,nt)}}),bo={};te(bo,{GalleryToken:()=>jt});var Mr,vi,zr,jt,su=_({"src/gallery.ts"(){"use strict";var e,wo,Ji,i;z(),mn(),q(),B(),vo(),We(),Mr=[ys],jt=(i=class extends(zr=E){constructor(r,l,o=[]){var a;super(void 0,l,o,{});N(this,e);for(const d of(a=r==null?void 0:r.split(`
|
|
12
|
+
`))!=null?a:[]){const u=/^([^|]+)(?:\|(.*))?/u.exec(d);if(!u){super.insertAt(d.trim()?new ue(d,l,o):d);continue}const[,h,g]=u;j(this,e,wo).call(this,h)?super.insertAt(new nt("gallery",h,g,l,o)):super.insertAt(new ue(d,l,o))}}get type(){return"ext-inner"}get widths(){return j(this,e,Ji).call(this,"widths")}get heights(){return j(this,e,Ji).call(this,"heights")}lint(r=this.getAbsoluteIndex(),l){const{top:o,left:a}=this.getRootNode().posFromIndex(r),d=[],u="no-ignored",h=["Image","NoImage","Comment"].map(g=>k.lintConfig.getSeverity(u,`gallery${g}`));for(let g=0;g<this.length;g++){const c=this.childNodes[g],p=c.toString(),{length:b}=p,x=p.trim(),{type:m}=c,w=o+g,y=g?0:a;if(c.setAttribute("aIndex",r),m==="noinclude"&&x&&!/^<!--.*-->$/u.test(x)){let[S]=h;if(x.startsWith("|")?[,S]=h:(x.startsWith("<!--")||x.endsWith("-->"))&&([,,S]=h),S){const A=r+b,T={rule:u,message:k.msg("invalid-content","gallery"),severity:S,startIndex:r,endIndex:A,startLine:w,endLine:w,startCol:y,endCol:y+b};T.suggestions=[D(T),an(T,p)],d.push(T)}}else if(m!=="noinclude"&&m!=="text"){const S=c.lint(r,l);S.length>0&&d.push(...S)}r+=b+1}return d}json(r,l=this.getAbsoluteIndex()){const o=super.json(void 0,l);return Object.assign(o,{widths:this.widths,heights:this.heights}),o}},e=new WeakSet,wo=function(r){return this.normalizeTitle(r,6,{halfParsed:!0,temporary:!0,decode:!0}).valid},Ji=function(r){var a,d;const l=(a=this.parentNode)==null?void 0:a.getAttr(r),o=typeof l=="string"&&((d=/^(\d+)\s*(?:px)?$/u.exec(l))==null?void 0:d[1]);return o&&Number(o)||120},i),vi=Y(zr),jt=K(vi,0,"GalleryToken",Mr,jt),X(vi,1,jt)}}),bn,yo=_({"src/link/index.ts"(){"use strict";Xe(),z(),q(),xs(),bn=class extends Pe{get type(){return"link"}get innerText(){return this.length>1?this.lastChild.text():Ut(this.firstChild.text().replace(/^\s*:?/u,""))}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),i="nested-link",n=k.lintConfig.getSeverity(i);if(n&&this.closest("ext-link-text")){const r=J(this,{start:e},i,"link-in-extlink",n);r.fix=ke(r,"delink",this.innerText),s.push(r)}return s}}}}),Ur,Hr,Dt,wn=_({"src/magicLink.ts"(){"use strict";var e,t,Xi,i;z(),de(),oe(),q(),B(),Ur=String.raw`(?:[${Re}\t]| |�*160;|&#[xX]0*[aA]0;)`,Hr=new RegExp(`${Ur}+`,"gu"),Dt=(i=class extends E{constructor(r,l="free-ext-link",o=k.getConfig(),a){super(r,o,a,{});N(this,t);N(this,e);L(this,e,l)}get type(){return f(this,e)}get innerText(){const r=new Map([["!","|"],["=","="]]);let l=Qe(this.childNodes.map(o=>{const{type:a}=o,d=String(o.name);return a==="magic-word"&&r.has(d)?r.get(d):o}));return this.type==="magic-link"&&(l=l.replace(Hr," ")),l}get link(){const{innerText:r}=this;return this.type==="magic-link"?r.startsWith("ISBN")?`ISBN ${r.slice(5).replace(/[- ]/gu,"").replace(/x$/u,"X")}`:r:Rl(r).replace(/\n/gu,"%0A")}lint(r=this.getAbsoluteIndex(),l){const o=super.lint(r,l),a=new ie(this,r),{type:d,childNodes:u}=this;if(d==="magic-link"){const p="invalid-isbn",b=k.lintConfig.getSeverity(p);return b&&j(this,t,Xi).call(this)&&o.push(J(this,a,p,"invalid-isbn",b)),o}const h=d==="ext-link-url",g="unterminated-url",c=k.lintConfig.getSeverity(g,h?"pipe":"punctuation");if(c){const p=h?/\|/u:/[,;。:!?()]+/u,b=u.find(x=>x.type==="text"&&p.test(x.data));if(b){const{data:x}=b,m=O(b,a,g,k.msg("in-url",h?'"|"':"full-width-punctuation"),c),{index:w,0:y}=p.exec(x),S=m.startIndex+w;m.suggestions=h?[Ht(S,1)]:[Ht(S),{desc:k.msg("encode"),range:[S,S+y.length],text:encodeURI(y)}],o.push(m)}}return o}getUrl(r){this.lspError("MagicLinkToken.getUrl")}getAttribute(r){return r==="invalid"?j(this,t,Xi).call(this):super.getAttribute(r)}},e=new WeakMap,t=new WeakSet,Xi=function(){if(this.type==="magic-link"){const{link:r}=this;if(r.startsWith("ISBN")){const l=[...r.slice(5)].map(o=>o==="X"?10:Number(o));return l.length===10?l.reduce((o,a,d)=>o+a*(10-d),0)%11!==0:l.length===13&&(l[12]===10||l.reduce((o,a,d)=>o+a*(d%2?3:1),0)%10!==0)}}return!1},i)}}),Dr,bi,Gr,rt,So=_({"src/extLink.ts"(){"use strict";var e,t;Je(),z(),Be(),q(),B(),wn(),Dr=[Fe("[")],rt=(t=class extends(Gr=E){constructor(i,n="",r="",l,o=[]){super(void 0,l,o,{});N(this,e);const a=i&&/^\0\d+f\x7F$/u.test(i)?o[Number(i.slice(1,-2))]:new Dt(i,"ext-link-url",l,o);if(this.insertAt(a),L(this,e,n),r){const d=new E(r,l,o,{});d.type="ext-link-text",d.setAttribute("stage",ve-1),this.insertAt(d)}}get type(){return"ext-link"}toString(i){return this.length===1?`[${super.toString(i)}${f(this,e)}]`:`[${super.toString(i,f(this,e))}]`}text(){return`[${super.text(" ")}]`}getGaps(){return f(this,e).length}lint(i=this.getAbsoluteIndex(),n){const r=super.lint(i,n),l="var-anchor",o=k.lintConfig.getSeverity(l,"extLink");return o&&this.length===1&&this.closest("heading-title")&&r.push(J(this,{start:i},l,"variable-anchor",o)),r}print(){return super.print(this.length===1?{pre:"[",post:`${f(this,e)}]`}:{pre:"[",sep:f(this,e),post:"]"})}},e=new WeakMap,t),bi=Y(Gr),rt=K(bi,0,"ExtLinkToken",Dr,rt),X(bi,1,rt)}}),Ki,iu=_({"src/imagemapLink.ts"(){"use strict";B(),We(),yo(),So(),Ki=class extends E{get type(){return"imagemap-link"}constructor(e,t,s,i,n=[]){super(void 0,i,n),this.append(e,t.length===2?new bn(...t,i,n):new rt(...t,i,n),new ue(s,i,n))}}}}),ko={};te(ko,{ImagemapToken:()=>Pt});var Vr,wi,Qr,Pt,nu=_({"src/imagemap.ts"(){"use strict";z(),Te(),oe(),mn(),q(),B(),We(),vo(),iu(),Vr=[ys],Pt=class extends(Qr=E){get type(){return"ext-inner"}get image(){return this.childNodes.find(As("imagemap-image"))}constructor(e,t=k.getConfig(),s=[]){if(super(void 0,t,s,{}),!e)return;const i=e.split(`
|
|
13
|
+
`),n=new Set(t.protocol.split("|")),r=ue;let l=!0,o=!1;for(const a of i){const d=a.trim();if(!(o||!d||d.startsWith("#"))){if(l){const u=a.indexOf("|"),h=u===-1?a:a.slice(0,u),{valid:g,ns:c}=this.normalizeTitle(h,0,{halfParsed:!0,temporary:!0});if(g&&c===6){const p=new nt("imagemap",h,u===-1?void 0:a.slice(u+1),t,s);super.insertAt(p),l=!1;continue}else o=!0}else if(a.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(a);continue}else if(a.includes("[")){const u=a.indexOf("["),h=a.slice(u),g=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(h);if(g){if(this.normalizeTitle(g[1],0,{halfParsed:!0,temporary:!0,selfLink:!0}).valid){super.insertAt(new Ki(a.slice(0,u),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 Ki(a.slice(0,u),c.slice(1),h.slice(h.indexOf("]")+1),t,s));continue}}}}super.insertAt(new r(a,t,s))}}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),i=new ie(this,e),{childNodes:n,image:r}=this,l="invalid-imagemap",o=k.lintConfig.getSeverity(l,r?"link":"image");return o&&(r?s.push(...n.filter(a=>{const d=a.toString().trim();return a.is("noinclude")&&d&&!d.startsWith("#")}).map(a=>{const d=O(a,i,l,"invalid-imagemap-link",o);return d.suggestions=[D(d,-1),ke(d,"comment","# ")],d})):s.push(J(this,i,l,"imagemap-without-image",o))),s}getAttribute(e){return e==="invalid"?!this.image:super.getAttribute(e)}},wi=Y(Qr),Pt=K(wi,0,"ImagemapToken",Vr,Pt),X(wi,1,Pt)}}),Jr,yi,Xr,lt,Ao=_({"src/nowiki/comment.ts"(){"use strict";z(),mt(),Be(),q(),Ze(),Jr=[Ke(!1),Fe("<!--")],lt=class extends(Xr=Ae){constructor(t,s,i,n){super(t,i,n);Ne(this,"closed");this.closed=s}get type(){return"comment"}lint(t=this.getAbsoluteIndex()){if(this.closed)return[];const s="unclosed-comment",i=k.lintConfig.getSeverity(s);if(!i)return[];const n=J(this,{start:t},s,k.msg("unclosed","html-comment"),i);return n.suggestions=[Oe(n.endIndex,"-->")],[n]}toString(t){return t?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"<!--",post:this.closed?"-->":""})}},yi=Y(Xr),lt=K(yi,0,"CommentToken",Jr,lt),X(yi,1,lt)}}),_o={};te(_o,{CommentedToken:()=>$o});var $o,ru=_({"src/commented.ts"(){"use strict";B(),Ao(),$o=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("<!--"),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 lt(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"))}}}}),To={};te(To,{NowikiToken:()=>Co});var Kr,Yr,Co,lu=_({"src/nowiki/index.ts"(){"use strict";var e,Yi,s;Xe(),z(),q(),Ze(),Kr=at(i=>new RegExp(String.raw`<\s*(?:/\s*)${i==="nowiki"?"":"?"}(${i})\b`,"giu")),Yr=new Set(["languages","section","templatestyles"]),Co=(s=class extends Ae{constructor(){super(...arguments);N(this,e)}get type(){return"ext-inner"}lint(n=this.getAbsoluteIndex()){const{name:r}=this,l="void-ext",o=k.lintConfig.getSeverity(l,r);if(o&&j(this,e,Yi).call(this)){const a=J(this,{start:n},l,k.msg("nothing-in",r),o);return a.suggestions=[D(a)],[a]}return super.lint(n,Kr(r))}getAttribute(n){return n==="invalid"?j(this,e,Yi).call(this):super.getAttribute(n)}},e=new WeakSet,Yi=function(){const{name:n,firstChild:{data:r}}=this;return Yr.has(n)&&!!r},s)}}),Zr,Si,el,ot,Io=_({"src/tagPair/ext.ts"(){"use strict";z(),oe(),q(),pn(),B(),gn(),fn(),Zr=[bs()],ot=class extends(el=Ge){get type(){return"ext"}constructor(e,t,s,i,n=k.getConfig(),r=!1,l=[]){const o=e.toLowerCase(),a=new ws(!t||/^\s/u.test(t)?t:` ${t}`,"ext-attrs",o,n,l),d=_e(ce({},n),{ext:n.ext.filter(h=>h!==o),excludes:[...n.excludes]});let u;switch(d.inExt=!0,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"),u=new E(s,d,l);break;case"pre":{const{PreToken:h}=(Qa(),Q(to));u=new h(s,d,l);break}case"dynamicpagelist":{const{ParamTagToken:h}=(no(),Q(io));u=new h(r,s,d,l);break}case"inputbox":{const{InputboxToken:h}=(eu(),Q(uo));u=new h(r,s,d,l);break}case"references":{const{NestedToken:h}=(hi(),Q(ds));d.excludes.push("heading"),u=new h(s,r,["ref"],d,l);break}case"choose":{const{NestedToken:h}=(hi(),Q(ds));u=new h(s,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],d,l);break}case"combobox":{const{NestedToken:h}=(hi(),Q(ds));u=new h(s,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],d,l);break}case"gallery":{const{GalleryToken:h}=(su(),Q(bo));u=new h(s,d,l);break}case"imagemap":{const{ImagemapToken:h}=(nu(),Q(ko));u=new h(s,d,l);break}case"hiero":{const{CommentedToken:h}=(ru(),Q(_o));u=new h(s,d,l);break}default:{const{NowikiToken:h}=(lu(),Q(To));u=new h(s,d,l)}}u.setAttribute("name",o),u.type==="plain"&&(u.type="ext-inner"),super(e,a,u,i,n,l),this.seal("closed",!0)}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),i=new ie(this,e);if(this.name!=="nowiki"){const l=this.inHtmlAttrs(),o="parsing-order",a=l&&k.lintConfig.getSeverity(o,l===2?"ext":"templateInTable");a&&s.push(J(this,i,o,"ext-in-html",a))}const n="var-anchor",r=k.lintConfig.getSeverity(n,"ref");return r&&this.name==="ref"&&this.closest("heading-title")&&s.push(J(this,i,n,"variable-anchor",r)),s}},Si=Y(el),ot=K(Si,0,"ExtToken",Zr,ot),X(Si,1,ot)}}),No={};te(No,{parseCommentAndExt:()=>Vt});var ki,tl,ts,sl,Ai,Vt,ks=_({"parser/commentAndExt.ts"(){"use strict";Xe(),de(),Ua(),We(),Ha(),Da(),Io(),Ao(),ki="<onlyinclude>",tl="</onlyinclude>",{length:ts}=ki,sl=[!1,!0].map(e=>{const t=e?"includeonly":"(?:no|only)include",s=e?"noinclude":"includeonly";return Bl(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"))}),Ai=e=>{const t=e.indexOf(ki);return{i:t,j:e.indexOf(tl,t+ts)}},Vt=(e,t,s,i)=>{if(i){let{i:o,j:a}=Ai(e);if(o!==-1&&a!==-1){let d="";const u=h=>{new ue(h,t,s),d+=`\0${s.length-1}n`};for(;o!==-1&&a!==-1;){const h=`\0${s.length}e`;new Nt(e.slice(o+ts,a),t,s),o>0&&u(e.slice(0,o)),d+=h,e=e.slice(a+ts+1),{i:o,j:a}=Ai(e)}return e&&u(e),d}}const{ext:n}=t,r=n.filter(o=>o!=="translate"&&o!=="tvar"),l=_e(ce({},t),{ext:r});if(n.includes("translate")){const o=[];e=e.replace(/<nowiki>[\s\S]*?<\/nowiki>/giu,a=>(o.push(a),`\0${o.length-1}`)).replace(/<translate( nowrap)?>([\s\S]+?)?<\/translate>/gu,(a,d,u)=>{const h=s.length;return new Ql(d,u&&xe(u,o),l,s),`\0${h}g`}),e=xe(e,o)}return e.replace(sl[i?1:0](r),(o,a,d,u,h,g,c,p,b)=>{const x=s.length;let m="n";if(a)m="e",new ot(a,d,u,h,l,g,s);else if(o.startsWith("<!--")){m="c";const w=o.endsWith("-->");new lt(xe(o,s,1).slice(4,w?-3:void 0),w,t,s)}else g?new Lt(g,c&&xe(c,s,1),p&&xe(p,s,1),b,t,s):new ue(o,t,s);return`\0${x}${m}`})}}}),il,nl,rl,ll,_i,ol,Rt,ou=_({"src/html.ts"(){"use strict";var e,t,s,i,n;z(),Te(),oe(),pn(),q(),B(),il=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),nl=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"]),rl=new Set(["strike","big","center","font","tt"]),ll=[bs()],Rt=(n=class extends(ol=E){constructor(l,o,a,d,u,h){super(void 0,u,h);N(this,e);N(this,t);N(this,s);N(this,i);this.insertAt(o),this.setAttribute("name",l.toLowerCase()),L(this,e,a),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 T;const a=super.lint(l,o),{name:d,parentNode:u,closing:h,selfClosing:g}=this,c=new ie(this,l),p=this.inTableAttrs();let b="h1",x=k.lintConfig.getSeverity(b,"html");if(x&&d==="h1"&&!h){const v=J(this,c,b,"<h1>",x);v.suggestions=[{desc:"h2",range:[l+2,l+3],text:"2"}],a.push(v)}if(b="parsing-order",x=p&&k.lintConfig.getSeverity(b,p===2?"html":"templateInTable"),x){const v=J(this,c,b,"html-in-table",x);p===2&&(v.suggestions=[D(v)]),a.push(v)}if(b="obsolete-tag",x=k.lintConfig.getSeverity(b,d),x&&rl.has(d)&&a.push(J(this,c,b,"obsolete-tag",x)),b="bold-header",x=k.lintConfig.getSeverity(b,d),x&&(d==="b"||d==="strong")&&((T=this.closest("heading-title,ext"))==null?void 0:T.type)==="heading-title"){const v=J(this,c,b,"bold-in-header",x);v.suggestions=[D(v)],a.push(v)}const{html:[,m,w]}=this.getAttribute("config"),y=w.includes(d),S=m.includes(d),A=!y&&!S;if(b="unmatched-tag",h&&(g||y)||g&&A){if(x=k.lintConfig.getSeverity(b,h?"both":"selfClosing"),x){const v=J(this,c,b,h?"closing-and-self-closing":"invalid-self-closing",x),$=on(l),C={desc:k.msg("no-self-closing"),range:[v.endIndex-2,v.endIndex-1],text:""};S?v.suggestions=[$,C]:h?v.fix=y?$:C:v.suggestions=[C,Oe(v.endIndex,`></${d}>`,-2)],a.push(v)}}else if(!this.findMatchingTag()){const v=J(this,c,b,h?"unmatched-closing":"unclosed-tag"),$=this.closest("magic-word");if($&&il.has($.name))x=k.lintConfig.getSeverity(b,"conditional");else if(h)x=k.lintConfig.getSeverity(b,"closing"),v.suggestions=[D(v)];else{x=k.lintConfig.getSeverity(b,"opening");const C=u==null?void 0:u.childNodes;nl.has(d)&&(C!=null&&C.slice(0,C.indexOf(this)).some(I=>I.type==="html"&&I.name===d&&!I.findMatchingTag())&&(v.suggestions=[Oe(l+1,"/")]),this.closest("heading-title")&&(v.rule="format-leakage",x=k.lintConfig.getSeverity("format-leakage",d)))}x&&(v.severity=x,a.push(v))}return a}findMatchingTag(){return Ve(f(this,i),()=>{const{name:l,parentNode:o,closing:a,selfClosing:d}=this,{html:[,u,h]}=this.getAttribute("config"),g=h.includes(l),c=u.includes(l);if(g||c&&d)return this;if(!o)return;const{childNodes:p}=o,b=p.indexOf(this),x=a?p.slice(0,b).reverse():p.slice(b+1),m=[this],{rev:w}=we;for(const y of x)if(!(!y.is("html")||y.name!==l||c&&f(y,t)))if(f(y,e)===a)m.push(y);else{const S=m.pop();if(S===this)return y;k.viewOnly&&(L(S,i,[w,y]),L(y,i,[w,S]))}if(k.viewOnly)for(const y of m)L(y,i,[w,void 0])},l=>{L(this,i,l),l[1]&&l[1]!==this&&L(l[1],i,[we.rev,this])})}print(){return super.print({pre:`<${this.closing?"/":""}${f(this,s)}`,post:`${f(this,t)?"/":""}>`})}json(l,o=this.getAbsoluteIndex()){const a=super.json(void 0,o);return Object.assign(a,{closing:this.closing,selfClosing:f(this,t)}),a}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,n),_i=Y(ol),Rt=K(_i,0,"HtmlToken",ll,Rt),X(_i,1,Rt)}}),Lo={};te(Lo,{parseHtml:()=>Fo});var al,Fo,au=_({"parser/html.ts"(){"use strict";fn(),ou(),al=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,Fo=(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 a=al.exec(o),d=a==null?void 0:a[2],u=d==null?void 0:d.toLowerCase();if(!a||!t.htmlElements.has(u)){r+=`<${o}`;continue}const[,h,,g="",c,p]=a,{length:b}=s,x=new ws(g,"html-attrs",u,t,s),m=x.hasAttr("itemprop");if(u==="meta"&&!(m&&x.hasAttr("content"))||u==="link"&&!(m&&x.hasAttr("href"))){r+=`<${o}`,s.length=b;continue}r+=`\0${s.length}x${p}`,new Rt(d,x,h==="/",c==="/>",t,s)}return r}}}),yn,Eo=_({"src/table/base.ts"(){"use strict";pn(),B(),xt(),fn(),yn=class extends bs(1)(E){constructor(e,t,s,i,n,r=[],l){super(void 0,n,r,l),this.append(new Ye(t,"table-syntax",n,r),new ws(i,"table-attrs",s,n,r))}escape(){}}}}),ul,$i,Se,ss,At,_t,gs,jo=_({"src/table/td.ts"(){"use strict";z(),oe(),cn(),q(),B(),Eo(),gs=class extends($i=yn,ul=[ms(!1)],$i){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),X(ss,5,this),je(this,At),je(this,Se,""),n&&([Ea(this,Se)._]=n);const l=new E(t==null?void 0:t.slice(((o=n==null?void 0:n.index)!=null?o:NaN)+ae(this,Se).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 Mi(this,At,_t).call(this).subtype}afterBuild(){ae(this,Se).includes("\0")&&me(this,Se,this.buildFromStr(ae(this,Se),0)),super.afterBuild()}toString(e){const{childNodes:[t,s,i]}=this;return t.toString(e)+s.toString(e)+ae(this,Se)+i.toString(e)}text(){const{childNodes:[e,t,s]}=this;return e.text()+t.text()+ae(this,Se)+s.text()}getGaps(e){return e===1?ae(this,Se).length:0}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),i=new ie(this,e+this.getRelativeIndex(this.length-1)),n="pipe-like",r=["td","double"].map(l=>k.lintConfig.getSeverity(n,l));for(const l of this.lastChild.childNodes)if(l.type==="text"){const{data:o}=l;if(o.includes("|")){const a=o.includes("||"),d=r[a?1:0];if(d){const u=O(l,i,n,"pipe-in-table",d);if(a){const h={caption:"|+",td:"|",th:"!"}[this.subtype];u.fix=ke(u,"newline",o.replace(/\|\|/gu,`
|
|
14
|
+
${h}`))}else u.suggestions=[dn(u.startIndex,o)];s.push(u)}}}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()}${ae(this,Se)}${s.print()}</span>`}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t),{rowspan:i,colspan:n}=this;return Object.assign(s,{subtype:this.subtype},i!==1&&{rowspan:i},n!==1&&{colspan:n}),s}},ss=Y($i),Se=new WeakMap,At=new WeakSet,_t=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:n}=this;return ce({},Mi(e=n,At,_t).call(e))},_t=K(ss,17,"#getSyntax",ul,At,_t),sn(ss,gs)}}),Sn,Po=_({"src/table/trBase.ts"(){"use strict";z(),q(),Eo(),jo(),Sn=class extends yn{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 n=Wt(i),r="fostered-content",l=n&&k.lintConfig.getSeverity(r,n===2?void 0:"transclusion");if(l){const o=O(i,{start:e},r,"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 gs&&e.isIndependent()&&!e.firstChild.text().endsWith("+")))}}}}),dl,hl,cl,gl,Ti,is,hs,uu=_({"src/table/index.ts"(){"use strict";z(),Te(),oe(),cn(),q(),Po(),xt(),dl=(e,t)=>new Array(e).fill(void 0).map((s,i)=>t(i)),hl=({type:e})=>e==="tr"||e==="table-syntax",cl=class extends Array{},hs=class extends(Ti=Sn,gl=[ms(!1)],Ti){constructor(e,t,s,i){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,e,"table",t,s,i,{}),X(is,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 ie(this,e),n=["unclosed-table","table-layout"],r=n.map(l=>k.lintConfig.getSeverity(l));if(r[0]&&!this.closed&&s.push(O(this.firstChild,i,n[0],k.msg("unclosed","table"),r[0])),r[1]){const l=this.getLayout(),{length:o}=l;if(o>1){let a=1,d=1/0,u=0;for(;u<o;u++){const h=l[u],g=h.length;if(g<a)break;g<d&&(d=g);const c=h.indexOf(h[g-1])+1;if(c>d)break;c>a&&(a=c)}if(u<o){const h=this.getNthRow(u),g=O(h,i,n[1],"inconsistent-table",r[1]);g.startIndex++,g.startLine++,g.startCol=0,s.push(g)}}}return s}close(e=`
|
|
16
|
+
|}`,t){const s=this.getAttribute("config"),i=this.getAttribute("accum");we.run(()=>{const n=new Ye(t?e:void 0,"table-syntax",s,i);super.insertAt(n)})}getLayout(e){const t=this.getAllRows(),{length:s}=t,i=cl.from(dl(s,()=>[]));for(let n=0;n<i.length;n++){const r=i[n];let l=0,o=0,a;for(const d of t[n].childNodes.slice(2))if(d.is("td")){if(d.isIndependent()&&(a=d.subtype!=="caption"),a){const u={row:n,column:l},{rowspan:h,colspan:g}=d;for(l++;r[o];)o++;for(let c=n;c<Math.min(n+h,s);c++)for(let p=o;p<o+g;p++)i[c][p]=u;o+=g}}else if(hl(d))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 n of this.childNodes.slice(2)){const{type:r}=n;if(r==="tr"&&n.getRowCount()&&(e--,e<0))return n}}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t);return s.closed=this.closed,s}},is=Y(Ti),K(is,1,"getLayout",gl,hs),sn(is,hs)}}),Ro,du=_({"src/table/tr.ts"(){"use strict";Po(),Ro=class extends Sn{get type(){return"tr"}constructor(e,t,s,i){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,e,"tr",t,s,i)}}}}),kn,Oo=_({"src/nowiki/listBase.ts"(){"use strict";Ze(),kn=class extends Ae{get indent(){return this.innerText.split(":").length-1}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t),{indent:i}=this;return i&&(s.indent=i),s}}}}),An,Bo=_({"src/nowiki/dd.ts"(){"use strict";Oo(),An=class extends kn{get type(){return"dd"}}}}),qo={};te(qo,{parseTable:()=>Wo});var pl,Ci,Wo,hu=_({"parser/table.ts"(){"use strict";B(),uu(),du(),jo(),Bo(),pl=e=>e.lastChild.constructor!==E,Ci=(e,t)=>e.is("td")?t.pop():e,Wo=({firstChild:{data:e},type:t,name:s},i,n)=>{const r=[],l=e.split(`
|
|
17
17
|
`);let o=t==="root"||t==="parameter-value"||t==="ext-inner"&&s==="poem"?"":`
|
|
18
|
-
${l.shift()}`,a;const
|
|
19
|
-
${
|
|
20
|
-
${u}`;continue}const p=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(g);if(!p){
|
|
21
|
-
${u}`,a),r.push(a);continue}const[,b,m,
|
|
22
|
-
${
|
|
23
|
-
${
|
|
24
|
-
${d}${x}`;const v=$=>{const C=new gs(T,w.slice(A,S==null?void 0:S.index),i,n);return $.insertAt(C),C};for(;S;)v(a),{lastIndex:A}=y,[T]=S,S=y.exec(w);r.push(a,v(a))}}return o.slice(1)}}}),Bo,uu=_({"src/nowiki/hr.ts"(){"use strict";Ze(),Bo=class extends Ae{get type(){return"hr"}}}}),fl,Ii,xl,Ot,hu=_({"src/nowiki/doubleUnderscore.ts"(){"use strict";xt(),Be(),Ze(),fl=[Ke(),Fe("__")],Ot=class extends(xl=Ae){get type(){return"double-underscore"}constructor(e,t,s,i){var o,a;super(e,s,i);const n=e.toLowerCase(),{doubleUnderscore:[,,r,l]}=s;this.setAttribute("name",(a=t?(o=l==null?void 0:l[e])==null?void 0:o.toLowerCase():r==null?void 0:r[n])!=null?a:n)}toString(){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}},Ii=Y(xl),Ot=K(Ii,0,"DoubleUnderscoreToken",fl,Ot),X(Ii,1,Ot)}}),qo={};te(qo,{parseHrAndDoubleUnderscore:()=>Wo});var Wo,du=_({"parser/hrAndDoubleUnderscore.ts"(){"use strict";uu(),hu(),so(),Wo=({firstChild:{data:e},type:t,name:s},i,n)=>{var a,h,u;const{doubleUnderscore:[r,l,o]}=i;return(a=i.insensitiveDoubleUnderscore)!=null||(i.insensitiveDoubleUnderscore=new Set(r)),(h=i.sensitiveDoubleUnderscore)!=null||(i.sensitiveDoubleUnderscore=new Set(l)),(u=i.regexHrAndDoubleUnderscore)!=null||(i.regexHrAndDoubleUnderscore=new RegExp(`__(${[...r,...l].join("|")})__`,"giu")),t!=="root"&&(t!=="ext-inner"||s!=="poem")&&(e=`\0${e}`),e=e.replace(/^((?:\0\d+[cno]\x7F)*)(-{4,})/gmu,(d,g,c)=>(new Bo(c,i,n),`${g}\0${n.length-1}r`)).replace(i.regexHrAndDoubleUnderscore,(d,g)=>{var m;const c=i.sensitiveDoubleUnderscore.has(g),p=g.toLowerCase(),b=i.insensitiveDoubleUnderscore.has(p);return c||b?(new Ot(g,c,i,n),`\0${n.length-1}${b&&((m=o==null?void 0:o[p])!=null?m:p)==="toc"?"u":"n"}`):d}),i.excludes.includes("heading")||(e=e.replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(d,g,c,p,b)=>{const m=`${g}\0${n.length}h`;return new st(c.length,[p,b],i,n),m})),t==="root"||t==="ext-inner"&&s==="poem"?e:e.slice(1)}}}),Mo,cu=_({"src/nowiki/quote.ts"(){"use strict";var e,t;U(),oe(),q(),Ze(),Mo=(t=class extends Ae{constructor(i,n,r,l){super(i,r,l);N(this,e);L(this,e,n)}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:f(this,e).bold}:void 0),this.italic?{italic:f(this,e).italic}:void 0)}text(){const{parentNode:i,innerText:n}=this;return i!=null&&i.is("image-parameter")&&i.name!=="caption"?"":n}lint(i=this.getAbsoluteIndex()){var c;const{previousSibling:n,bold:r,closing:l}=this,o=(n==null?void 0:n.type)==="text"?n.data:void 0,a=[],h=new ie(this,i),u=["lonely-apos","bold-header"],d=[void 0,"word"].map(p=>k.lintConfig.getSeverity(u[0],p)),g=k.lintConfig.getSeverity(u[1]);if(o!=null&&o.endsWith("'")){const p=d[(l.bold||l.italic)&&/[a-z\d]'$/iu.test(o)?1:0];if(p){const b=J(this,h,u[0],k.msg('lonely "$1"',"'"),p),{startLine:m,startCol:x}=b,[,{length:w}]=/(?:^|[^'])('+)$/u.exec(o),y=i-w,S=_e(fe({},b),{startIndex:y,endIndex:i,endLine:m,startCol:x-w,endCol:x});S.suggestions=[gt(y,"'",w),D(S)],a.push(S)}}if(g&&r&&((c=this.closest("heading-title,ext"))==null?void 0:c.type)==="heading-title"){const p=J(this,h,u[1],"bold in section header",g);p.suggestions=[D(p)],a.push(p)}return a}json(i,n=this.getAbsoluteIndex()){const r=super.json(void 0,n);return Object.assign(r,{bold:this.bold,italic:this.italic}),r}},e=new WeakMap,t)}}),Uo={};te(Uo,{parseQuotes:()=>_n});var _n,zo=_({"parser/quotes.ts"(){"use strict";cu(),_n=(e,t,s,i)=>{var c;const n=e.split(/('{2,})/u),{length:r}=n;if(r===1)return e;let l=0,o=0,a,h,u;for(let p=1;p<r;p+=2){const b=n[p].length;switch(b){case 2:o++;break;case 4:n[p-1]+="'",n[p]="'''";case 3:if(l++,a!==void 0)break;n[p-1].endsWith(" ")?h===void 0&&u===void 0&&(u=p):n[p-1].slice(-2,-1)===" "?a=p:h!=null||(h=p);break;default:n[p-1]+="'".repeat(b-5),n[p]="'''''",o++,l++}}if(o%2===1&&l%2===1){const p=(c=a!=null?a:h)!=null?c:u;p!==void 0&&(n[p]="''",n[p-1]+="'")}let d=!0,g=!0;for(let p=1;p<r;p+=2){const b=n[p].length,m=b!==2,x=b!==3;m&&(d=!d),x&&(g=!g),new Mo(n[p],{bold:m&&d,italic:x&&g},t,s),n[p]=`\0${s.length-1}q`}return n.join("")}}}),Ho={};te(Ho,{parseExternalLinks:()=>$n});var $n,Do=_({"parser/externalLinks.ts"(){"use strict";he(),bo(),wn(),$n=(e,t,s,i)=>{var n;return(n=t.regexExternalLinks)!=null||(t.regexExternalLinks=new RegExp(String.raw`\[((?:\0\d+[cn]\x7F)*(?:\0\d+f\x7F|(?:(?:${t.protocol}|//)${ut}|\0\d+m\x7F)${ht}(?=[[\]<>"\t${Re}]|\0\d)))([${Re}]*(?![${Re}]))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),e.replace(t.regexExternalLinks,(r,l,o,a)=>{const{length:h}=s,u=/&[lg]t;/u.exec(l);return u&&(o="",a=l.slice(u.index)+o+a,l=l.slice(0,u.index)),i?(new Dt(l,"ext-link-url",t,s),`[\0${h}f${o}${a}]`):(new rt(l,o,a,t,s),`\0${h}w`)})}}}),Go,gu=_({"src/link/category.ts"(){"use strict";he(),ms(),Go=class extends Pe{get type(){return"category"}get sortkey(){const{childNodes:[,e]}=this;return e&&Mt(e.text())}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t),{sortkey:i}=this;return i&&(s.sortkey=i),s}}}}),Vo={};te(Vo,{parseLinks:()=>Zi});var ml,Zi,pu=_({"parser/links.ts"(){"use strict";q(),zo(),Do(),vo(),po(),gu(),ml=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)([\s\S]*)$/u,Zi=(e,t,s,i)=>{var o;(o=t.regexLinks)!=null||(t.regexLinks=new RegExp(String.raw`^\s*(?:${t.protocol}|//)`,"iu"));const n=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,r=e.split("[[");let l=r.shift();for(let a=0;a<r.length;a++){let h=!1,u,d,g,c;const p=r[a],b=n.exec(p);if(b)[,u,d,g,c]=b,c.startsWith("]")&&(g!=null&&g.includes("["))&&(g+="]",c=c.slice(1));else{const S=ml.exec(p);S&&(h=!0,[,u,d,g]=S)}if(u===void 0||t.regexLinks.test(u)||/\0\d+[exhbru]\x7F/u.test(u)){l+=`[[${p}`;continue}const m=u.trim().startsWith(":");if(m&&h){l+=`[[${p}`;continue}const{ns:x,valid:w}=k.normalizeTitle(u,0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0});if(w){if(h){if(x!==6){l+=`[[${p}`;continue}let S=!1;for(a++;a<r.length;a++){const A=r[a],T=A.split("]]");if(T.length>2){S=!0,g+=`[[${T[0]}]]${T[1]}`,c=T.slice(2).join("]]");break}else if(T.length===2)g+=`[[${T[0]}]]${T[1]}`;else{g+=`[[${A}`;break}}if(g=Zi(g,t,s,i),!S){l+=`[[${u}${d}${g}`;continue}}}else{l+=`[[${p}`;continue}g&&(g=_n(g,t,s,i));let y=bn;m||(x===6?(g&&(g=$n(g,t,s,!0)),y=vn):x===14&&(y=Go)),g===void 0&&d&&(g=""),l+=`\0${s.length}l${c}`,new y(u,g,t,s,d)}return l}}}),Qo={};te(Qo,{parseMagicLinks:()=>Jo});var Ni,Li,Fi,Ei,Jo,fu=_({"parser/magicLinks.ts"(){"use strict";he(),wn(),Ni=String.raw`[${Re}\t]| |�*160;|�*a0;`,Li=`(?:${Ni})+`,Fi=`(?:${Ni}|-)`,Ei=String.raw`(?:RFC|PMID)${Li}\d+\b|ISBN${Li}(?:97[89]${Fi}?)?(?:\d${Fi}?){9}[\dx]\b`,Jo=(e,t,s)=>{if(!t.regexMagicLinks)try{t.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${t.protocol})(${ut}${ht})|${Ei})`,"giu")}catch(i){t.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${t.protocol})(${ut}${ht})|${Ei})`,"giu")}return e.replace(t.regexMagicLinks,(i,n,r)=>{let l=n?i.slice(n.length):i;if(r){let o="";const a=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(l);a&&(o=l.slice(a.index),l=l.slice(0,a.index));const h=l.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,u=h.exec(l);if(u){let d=1;u[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(l.slice(0,u.index))&&(d=2),o=l.slice(u.index+d)+o,l=l.slice(0,u.index+d)}return o.length>=r.length?i:(new Dt(l,void 0,t,s),`${n}\0${s.length-1}w${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(l))return i;return new Dt(l,"magic-link",t,s),`${n}\0${s.length-1}i`})}}}),Xo,xu=_({"util/html.ts"(){"use strict";Xo=(e,t)=>e.startsWith(t)?t.length:[...t].findIndex((s,i)=>s!==e[i])}}),Ko,mu=_({"src/nowiki/list.ts"(){"use strict";jo(),Ko=class extends kn{get type(){return"list"}}}}),Yo={};te(Yo,{parseList:()=>Zo});var Zo,vu=_({"parser/list.ts"(){"use strict";xu(),mu(),Po(),Zo=(e,t,s,i)=>{const n=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(e);if(!n)return t.lastPrefix="",e;const[r,l,o,a]=n,h=o.replace(/;/gu,":"),u=Xo(h,t.lastPrefix),d=((u>1?o.slice(u-1):o)+a).split(/(?=;)/u),g=d[0].startsWith(";");let c=d.length-(g?0:1);if(u>1){const I=o.slice(0,u-1);if(g){const z=I.split(/(?=;)/u);d.unshift(...z),c+=I.includes(";")?z.length:0}else d[0]=I+d[0]}t.lastPrefix=h;let p=l+d.map((I,z)=>`\0${i.length+z}d`).join("")+e.slice(r.length);for(const I of d)new Ko(I,s,i);if(!c)return p;const{html:[b,,m]}=s,x=/:+|-\{|\0\d+[xq]\x7F/gu;let w=x,y=w.exec(p),S=0,A=!1,T=!1,v=0;const $=(I,z)=>(new An(I,s,i),`${p.slice(0,z)}\0${i.length-1}d${p.slice(z+I.length)}`),C=I=>{I?S&&S--:S++};for(;y&&c;){const{0:I,index:z}=y;if(I==="-{"){if(!v){const{lastIndex:R}=w;w=/-\{|\}-/gu,w.lastIndex=R}v++}else if(I==="}-"){if(v--,!v){const{lastIndex:R}=w;w=x,w.lastIndex=R}}else if(I.endsWith("x")){const{name:R,closing:P,selfClosing:W}=i[Number(I.slice(1,-2))];(b.includes(R)||!W&&!m.includes(R))&&C(P)}else if(I.endsWith("q")){const{bold:R,italic:P}=i[Number(I.slice(1,-2))];R&&(C(A),A=!A),P&&(C(T),T=!T)}else if(S===0){if(I.length>=c)return $(I.slice(0,c),z);c-=I.length,w.lastIndex=z+4+String(i.length).length,p=$(I,z)}y=w.exec(p)}return p}}}),ns,vl,ji,bl,Bt,bu=_({"src/converterFlags.ts"(){"use strict";var e,t;U(),oe(),vs(),q(),B(),qe(),ns=new Set(["A","T","R","D","-","H","N"]),vl=[Gt()],Bt=(t=class extends(bl=E){constructor(i,n,r=[]){super(void 0,n,r,{});N(this,e);this.safeAppend(i.map(l=>new ce(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=>ns.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(c=>ns.has(c))),a=f(this,e).filter(c=>!c).length,h=f(this,e).length-l.size-a,u=super.lint(i,n);if(r.size===h||o.size===h)return u;const d="no-ignored",g=k.lintConfig.getSeverity(d,"conversionFlag");if(g){const c=new ie(this,i);for(let p=0;p<this.length;p++){const b=this.childNodes[p],m=b.text().trim();if(this.isInvalidFlag(m,r,l,o)){const x=O(b,c,d,"invalid conversion flag",g);r.size===0&&ns.has(m.toUpperCase())?x.fix=un(x,m):x.suggestions=[D(x,p&&-1)],u.push(x)}}}return u}print(){return super.print({sep:";"})}},e=new WeakMap,t),ji=Y(bl),Bt=K(ji,0,"ConverterFlagsToken",vl,Bt),X(ji,1,Bt)}}),cs,wu=_({"src/converterRule.ts"(){"use strict";q(),B(),qe(),cs=class extends E{get type(){return"converter-rule"}get variant(){var e,t;return(t=(e=this.childNodes[this.length-2])==null?void 0:e.text().trim().toLowerCase())!=null?t:""}constructor(e,t=!0,s=k.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 ce(l,"converter-rule-variant",s,i)),super.insertAt(new ce(e.slice(n+1),"converter-rule-to",s,i)),r!==-1&&super.insertAt(new ce(e.slice(0,r),"converter-rule-from",s,i),0)):super.insertAt(new ce(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);return s.variant=this.variant,s}}}}),wl,Pi,yl,qt,yu=_({"src/converter.ts"(){"use strict";he(),Be(),Le(),B(),bu(),wu(),wl=[$e,Fe("-{")],qt=class extends(yl=E){get type(){return"converter"}constructor(e,t,s,i=[]){super(void 0,s,i),this.insertAt(new Bt(e,s,i));const[n]=t,r=n.includes(":"),l=new cs(n,r,s,i);r&&l.length===1||!r&&t.length===2&&!be(t[1]).trim()?this.insertAt(new cs(t.join(";"),!1,s,i)):this.append(l,...t.slice(1).map(o=>new cs(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()}|${Qe(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?"|":""}${ct(t,{sep:";"})}}-</span>`}},Pi=Y(yl),qt=K(Pi,0,"ConverterToken",wl,qt),X(Pi,1,qt)}}),ea={};te(ea,{parseConverter:()=>ta});var ta,Su=_({"parser/converter.ts"(){"use strict";yu(),ta=(e,t,s)=>{var a;(a=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:h,index:u}=o;if(h==="}-"){const d=r.pop(),{length:g}=s,c=e.slice(d.index+2,u),p=c.indexOf("|"),[b,m]=p===-1?[[],c]:[c.slice(0,p).split(";"),c.slice(p+1)],x=m.replace(/(&[#a-z\d]+);/giu,"$1"),w=x.split(t.regexConverter).map(y=>y.replace(/\x01/gu,";"));new qt(b,w,t,s),e=`${e.slice(0,d.index)}\0${g}v${e.slice(u+2)}`,r.length===0&&(l=i),l.lastIndex=d.index+3+String(g).length}else r.push(o),l=n,l.lastIndex=u+2;o=l.exec(e)}return e}}}),ps={};te(ps,{Token:()=>E});var Sl,E,B=_({"src/index.ts"(){"use strict";var e,t,s,i,n,r,l,o,sa,ia,na,ra,la,oa,aa,ua,ha,da,ca,ga,S;he(),Je(),U(),Te(),q(),Pa(),Ra(),Sl=["category","html-attr#id,ext-attr#id,table-attr#id"],E=(S=class extends Ct{constructor(v,$=k.getConfig(),C=[],I){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 v=="string"&&this.insertAt(v),L(this,s,$),L(this,i,C),C.push(this)}get type(){return f(this,e)}set type(v){L(this,e,v)}parseOnce(v=f(this,t),$=!1,C){if(v<f(this,t)||this.length===0||!this.isPlain())return this;if(f(this,t)>=ve)return this;switch(v){case 0:if(this.type==="root"){f(this,i).pop();const I=j(this,o,sa).call(this);$&&($=!I)}L(this,n,$),j(this,o,ia).call(this,$);break;case 1:j(this,o,na).call(this);break;case 2:j(this,o,ra).call(this);break;case 3:j(this,o,la).call(this);break;case 4:j(this,o,oa).call(this);break;case 5:j(this,o,aa).call(this,C);break;case 6:j(this,o,ua).call(this,C);break;case 7:j(this,o,ha).call(this);break;case 8:j(this,o,da).call(this);break;case 9:j(this,o,ca).call(this);break;case 10:j(this,o,ga).call(this)}if(this.type==="root")for(const I of f(this,i))I==null||I.parseOnce(v,$,C);return Pn(this,t)._++,this}buildFromStr(v,$){const C=v.split(/[\0\x7F]/u).map((I,z)=>{if(z%2===0)return new Gi(I);if(isNaN(I.slice(-1)))return f(this,i)[Number(I.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${I}`)});return $===0?C.map(String).join(""):$===1?Qe(C):C}build(){L(this,t,ve);const{length:v,firstChild:$}=this,C=$==null?void 0:$.toString();if(v===1&&$.type==="text"&&C.includes("\0")&&(Tn(this,0,1,this.buildFromStr(C)),this.normalize(),this.type==="root"))for(const I of f(this,i))I==null||I.build()}afterBuild(){if(this.type==="root")for(const v of f(this,i))v==null||v.afterBuild();L(this,r,!0)}parse(v=ve,$,C){for(v=Math.min(v,ve);f(this,t)<v;)this.parseOnce(f(this,t),$,C);return v&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===S}getAttribute(v){var $;switch(v){case"config":return f(this,s);case"include":return($=f(this,n))!=null?$:!!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"&&Wt(this)===2;default:return super.getAttribute(v)}}setAttribute(v,$){switch(v){case"stage":f(this,t)===0&&this.type==="root"&&f(this,i).shift(),L(this,t,$);break;default:super.setAttribute(v,$)}}insertAt(v,$=this.length){const C=typeof v=="string"?new Gi(v):v;super.insertAt(C,$);const{type:I}=C;return I==="root"&&(C.type="plain"),C}normalizeTitle(v,$=0,C){return k.normalizeTitle(v,$,f(this,n),f(this,s),C)}inTableAttrs(){var v,$;return((v=this.closest("table-attrs,ext"))==null?void 0:v.type)==="table-attrs"&&(($=this.closest("table-attrs,arg,magic-word,template"))!=null&&$.is("table-attrs")?2:1)}inHtmlAttrs(){var v;return(v=this.closest("html-attrs,ext"))!=null&&v.is("html-attrs")?2:this.inTableAttrs()}lint(v=this.getAbsoluteIndex(),$){var I;let C=super.lint(v,$);if(this.type==="root"){const z=new Map,R="no-duplicate",P=["category","id"].map(F=>k.lintConfig.getSeverity(R,F)),W=Sl.filter((F,V)=>P[V]).join();if(W){for(const F of this.querySelectorAll(W)){let V;if(F.is("category"))V=F.name;else{const G=F.getValue();G&&G!==!0&&(V=`#${G}`)}if(V){const G=z.get(V);G?G.add(F):z.set(V,new Set([F]))}}for(const[F,V]of z)if(V.size>1&&!F.startsWith("#mw-customcollapsible-")){const G=!F.startsWith("#"),Z=`duplicated ${G?"category":"id"}`,ne=P[G?0:1];C.push(...[...V].map(le=>{const re=J(le,{start:le.getAbsoluteIndex()},R,Z,ne);return G&&(re.suggestions=[D(re)]),re}))}}const H=/<!--\s*lint-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->/gu,ge=this.toString(),ee=[];let M=H.exec(ge);for(;M;){const{1:F,index:V}=M,G=(I=M[2])==null?void 0:I.trim();ee.push({line:this.posFromIndex(V).top+(F==="disable-line"?0:1),from:F==="disable"?H.lastIndex:void 0,to:F==="enable"?H.lastIndex:void 0,rules:G?new Set(G.split(",").map(Z=>Z.trim())):void 0}),M=H.exec(ge)}if(C=C.filter(({rule:F,startLine:V,startIndex:G})=>{const Z={pos:0};for(const{line:ne,from:le,to:re,rules:Ce}of ee){if(ne>V+1)break;if(Ce&&!Ce.has(F))continue;if(ne===V&&le===void 0&&re===void 0)return!1;le<=G&&le>Z.pos?(Z.pos=le,Z.type="from"):re<=G&&re>Z.pos&&(Z.pos=re,Z.type="to")}return Z.type!=="from"}),C.some(({fix:F})=>F)){const F=C.map(({fix:Z})=>Z).filter(Boolean).sort(({range:[Z,ne]},{range:[le,re]})=>ne===re?le-Z:re-ne);let V=1/0,G=ge;for(const{range:[Z,ne],text:le}of F)ne<=V&&(G=G.slice(0,Z)+le+G.slice(ne),V=Z);Object.assign(C,{output:G})}}return C}toString(v,$){return v?super.toString(!0,$):Ve(f(this,l),()=>super.toString(!1,$),C=>{const I=this.getRootNode();I.type==="root"&&f(I,r)&&L(this,l,C)})}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,n=new WeakMap,r=new WeakMap,l=new WeakMap,o=new WeakSet,sa=function(){const{parseRedirect:v}=(qa(),Q(zl)),$=this.firstChild.toString(),C=v($,f(this,s),f(this,i));return C&&this.setText(C),!!C},ia=function(v){const{parseCommentAndExt:$}=(ks(),Q(To));this.setText($(this.firstChild.toString(),f(this,s),f(this,i),v))},na=function(){const{parseBraces:v}=(mn(),Q(ro)),$=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,C=v($,f(this,s),f(this,i));this.setText(this.type==="root"?C:C.slice(1))},ra=function(){if(f(this,s).excludes.includes("html"))return;const{parseHtml:v}=(ru(),Q(Co));this.setText(v(this.firstChild.toString(),f(this,s),f(this,i)))},la=function(){if(f(this,s).excludes.includes("table"))return;const{parseTable:v}=(au(),Q(Ro));this.setText(v(this,f(this,s),f(this,i)))},oa=function(){if(f(this,s).excludes.includes("hr"))return;const{parseHrAndDoubleUnderscore:v}=(du(),Q(qo));this.setText(v(this,f(this,s),f(this,i)))},aa=function(v){const{parseLinks:$}=(pu(),Q(Vo));this.setText($(this.firstChild.toString(),f(this,s),f(this,i),v))},ua=function(v){if(f(this,s).excludes.includes("quote"))return;const{parseQuotes:$}=(zo(),Q(Uo)),C=this.firstChild.toString().split(`
|
|
18
|
+
${l.shift()}`,a;const d=(u,h)=>{if(!h){o+=u;return}const{lastChild:g}=h;if(pl(h)){const c=new E(u,i,n);c.type="table-inter",c.setAttribute("stage",3),h.insertAt(c)}else g.setText(g.toString()+u)};for(const u of l){a=r.pop();const[h]=/^(?:\s|\0\d+[cno]\x7F)*/u.exec(u),g=u.slice(h.length),c=/^(:*)((?:\s|\0\d+[cn]\x7F)*)(\{\||\{(?:\0\d+[cn]\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(g);if(c){for(;a&&!a.is("td");)a=r.pop();const[,y,S,A,T]=c;y&&new An(y,i,n),d(`
|
|
19
|
+
${h}${y&&`\0${n.length-1}d`}${S}\0${n.length}b`,a),r.push(...a?[a]:[],new hs(A,T,i,n));continue}else if(!a){o+=`
|
|
20
|
+
${u}`;continue}const p=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(g);if(!p){d(`
|
|
21
|
+
${u}`,a),r.push(a);continue}const[,b,x,m,w]=p;if(b){for(;!a.is("table");)a=r.pop();a.close(`
|
|
22
|
+
${h}${b}`,!0),d(w,r[r.length-1])}else if(x){a=Ci(a,r),a.is("tr")&&(a=r.pop());const y=new Ro(`
|
|
23
|
+
${h}${x}`,w,i,n);r.push(a,y),a.insertAt(y)}else{a=Ci(a,r);const y=m==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu;let S=y.exec(w),A=0,T=`
|
|
24
|
+
${h}${m}`;const v=$=>{const C=new gs(T,w.slice(A,S==null?void 0:S.index),i,n);return $.insertAt(C),C};for(;S;)v(a),{lastIndex:A}=y,[T]=S,S=y.exec(w);r.push(a,v(a))}}return o.slice(1)}}}),Mo,cu=_({"src/nowiki/hr.ts"(){"use strict";Ze(),Mo=class extends Ae{get type(){return"hr"}}}}),fl,Ii,ml,Ot,gu=_({"src/nowiki/doubleUnderscore.ts"(){"use strict";mt(),Be(),Ze(),fl=[Ke(),Fe("__")],Ot=class extends(ml=Ae){get type(){return"double-underscore"}constructor(e,t,s,i){var o,a;super(e,s,i);const n=e.toLowerCase(),{doubleUnderscore:[,,r,l]}=s;this.setAttribute("name",(a=t?(o=l==null?void 0:l[e])==null?void 0:o.toLowerCase():r==null?void 0:r[n])!=null?a:n)}toString(){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}},Ii=Y(ml),Ot=K(Ii,0,"DoubleUnderscoreToken",fl,Ot),X(Ii,1,Ot)}}),zo={};te(zo,{parseHrAndDoubleUnderscore:()=>Uo});var Uo,pu=_({"parser/hrAndDoubleUnderscore.ts"(){"use strict";cu(),gu(),ro(),Uo=({firstChild:{data:e},type:t,name:s},i,n)=>{var a,d,u;const{doubleUnderscore:[r,l,o]}=i;return(a=i.insensitiveDoubleUnderscore)!=null||(i.insensitiveDoubleUnderscore=new Set(r)),(d=i.sensitiveDoubleUnderscore)!=null||(i.sensitiveDoubleUnderscore=new Set(l)),(u=i.regexHrAndDoubleUnderscore)!=null||(i.regexHrAndDoubleUnderscore=new RegExp(`__(${[...r,...l].join("|")})__`,"giu")),t!=="root"&&(t!=="ext-inner"||s!=="poem")&&(e=`\0${e}`),e=e.replace(/^((?:\0\d+[cno]\x7F)*)(-{4,})/gmu,(h,g,c)=>(new Mo(c,i,n),`${g}\0${n.length-1}r`)).replace(i.regexHrAndDoubleUnderscore,(h,g)=>{var x;const c=i.sensitiveDoubleUnderscore.has(g),p=g.toLowerCase(),b=i.insensitiveDoubleUnderscore.has(p);return c||b?(new Ot(g,c,i,n),`\0${n.length-1}${b&&((x=o==null?void 0:o[p])!=null?x:p)==="toc"?"u":"n"}`):h}),i.excludes.includes("heading")||(e=e.replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(h,g,c,p,b)=>{const x=`${g}\0${n.length}h`;return new st(c.length,[p,b],i,n),x})),t==="root"||t==="ext-inner"&&s==="poem"?e:e.slice(1)}}}),Ho,fu=_({"src/nowiki/quote.ts"(){"use strict";var e,t;z(),oe(),q(),Ze(),Ho=(t=class extends Ae{constructor(i,n,r,l){super(i,r,l);N(this,e);L(this,e,n)}get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}get closing(){return ce(ce({},this.bold?{bold:f(this,e).bold}:void 0),this.italic?{italic:f(this,e).italic}:void 0)}text(){const{parentNode:i,innerText:n}=this;return i!=null&&i.is("image-parameter")&&i.name!=="caption"?"":n}lint(i=this.getAbsoluteIndex()){var c;const{previousSibling:n,bold:r,closing:l}=this,o=(n==null?void 0:n.type)==="text"?n.data:void 0,a=[],d=new ie(this,i),u=["lonely-apos","bold-header"],h=[void 0,"word"].map(p=>k.lintConfig.getSeverity(u[0],p)),g=k.lintConfig.getSeverity(u[1]);if(o!=null&&o.endsWith("'")){const p=h[(l.bold||l.italic)&&/[a-z\d]'$/iu.test(o)?1:0];if(p){const b=J(this,d,u[0],k.msg("lonely","'"),p),{startLine:x,startCol:m}=b,[,{length:w}]=/(?:^|[^'])('+)$/u.exec(o),y=i-w,S=_e(ce({},b),{startIndex:y,endIndex:i,endLine:x,startCol:m-w,endCol:m});S.suggestions=[gt(y,"'",w),D(S)],a.push(S)}}if(g&&r&&((c=this.closest("heading-title,ext"))==null?void 0:c.type)==="heading-title"){const p=J(this,d,u[1],"bold-in-header",g);p.suggestions=[D(p)],a.push(p)}return a}json(i,n=this.getAbsoluteIndex()){const r=super.json(void 0,n);return Object.assign(r,{bold:this.bold,italic:this.italic}),r}},e=new WeakMap,t)}}),Do={};te(Do,{parseQuotes:()=>_n});var _n,Go=_({"parser/quotes.ts"(){"use strict";fu(),_n=(e,t,s,i)=>{var c;const n=e.split(/('{2,})/u),{length:r}=n;if(r===1)return e;let l=0,o=0,a,d,u;for(let p=1;p<r;p+=2){const b=n[p].length;switch(b){case 2:o++;break;case 4:n[p-1]+="'",n[p]="'''";case 3:if(l++,a!==void 0)break;n[p-1].endsWith(" ")?d===void 0&&u===void 0&&(u=p):n[p-1].slice(-2,-1)===" "?a=p:d!=null||(d=p);break;default:n[p-1]+="'".repeat(b-5),n[p]="'''''",o++,l++}}if(o%2===1&&l%2===1){const p=(c=a!=null?a:d)!=null?c:u;p!==void 0&&(n[p]="''",n[p-1]+="'")}let h=!0,g=!0;for(let p=1;p<r;p+=2){const b=n[p].length,x=b!==2,m=b!==3;x&&(h=!h),m&&(g=!g),new Ho(n[p],{bold:x&&h,italic:m&&g},t,s),n[p]=`\0${s.length-1}q`}return n.join("")}}}),Vo={};te(Vo,{parseExternalLinks:()=>$n});var $n,Qo=_({"parser/externalLinks.ts"(){"use strict";de(),So(),wn(),$n=(e,t,s,i)=>{var n;return(n=t.regexExternalLinks)!=null||(t.regexExternalLinks=new RegExp(String.raw`\[((?:\0\d+[cn]\x7F)*(?:\0\d+f\x7F|(?:(?:${t.protocol}|//)${ut}|\0\d+m\x7F)${dt}(?=[[\]<>"\t${Re}]|\0\d)))([${Re}]*(?![${Re}]))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),e.replace(t.regexExternalLinks,(r,l,o,a)=>{const{length:d}=s,u=/&[lg]t;/u.exec(l);return u&&(o="",a=l.slice(u.index)+o+a,l=l.slice(0,u.index)),i?(new Dt(l,"ext-link-url",t,s),`[\0${d}f${o}${a}]`):(new rt(l,o,a,t,s),`\0${d}w`)})}}}),Jo,mu=_({"src/link/category.ts"(){"use strict";de(),xs(),Jo=class extends Pe{get type(){return"category"}get sortkey(){const{childNodes:[,e]}=this;return e&&Mt(e.text())}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t),{sortkey:i}=this;return i&&(s.sortkey=i),s}}}}),Xo={};te(Xo,{parseLinks:()=>Zi});var xl,Zi,xu=_({"parser/links.ts"(){"use strict";q(),Go(),Qo(),yo(),xo(),mu(),xl=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)([\s\S]*)$/u,Zi=(e,t,s,i)=>{var o;(o=t.regexLinks)!=null||(t.regexLinks=new RegExp(String.raw`^\s*(?:${t.protocol}|//)`,"iu"));const n=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,r=e.split("[[");let l=r.shift();for(let a=0;a<r.length;a++){let d=!1,u,h,g,c;const p=r[a],b=n.exec(p);if(b)[,u,h,g,c]=b,c.startsWith("]")&&(g!=null&&g.includes("["))&&(g+="]",c=c.slice(1));else{const S=xl.exec(p);S&&(d=!0,[,u,h,g]=S)}if(u===void 0||t.regexLinks.test(u)||/\0\d+[exhbru]\x7F/u.test(u)){l+=`[[${p}`;continue}const x=u.trim().startsWith(":");if(x&&d){l+=`[[${p}`;continue}const{ns:m,valid:w}=k.normalizeTitle(u,0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0});if(w){if(d){if(m!==6){l+=`[[${p}`;continue}let S=!1;for(a++;a<r.length;a++){const A=r[a],T=A.split("]]");if(T.length>2){S=!0,g+=`[[${T[0]}]]${T[1]}`,c=T.slice(2).join("]]");break}else if(T.length===2)g+=`[[${T[0]}]]${T[1]}`;else{g+=`[[${A}`;break}}if(g=Zi(g,t,s,i),!S){l+=`[[${u}${h}${g}`;continue}}}else{l+=`[[${p}`;continue}g&&(g=_n(g,t,s,i));let y=bn;x||(m===6?(g&&(g=$n(g,t,s,!0)),y=vn):m===14&&(y=Jo)),g===void 0&&h&&(g=""),l+=`\0${s.length}l${c}`,new y(u,g,t,s,h)}return l}}}),Ko={};te(Ko,{parseMagicLinks:()=>Yo});var Ni,Li,Fi,Ei,Yo,vu=_({"parser/magicLinks.ts"(){"use strict";de(),wn(),Ni=String.raw`[${Re}\t]| |�*160;|�*a0;`,Li=`(?:${Ni})+`,Fi=`(?:${Ni}|-)`,Ei=String.raw`(?:RFC|PMID)${Li}\d+\b|ISBN${Li}(?:97[89]${Fi}?)?(?:\d${Fi}?){9}[\dx]\b`,Yo=(e,t,s)=>{if(!t.regexMagicLinks)try{t.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${t.protocol})(${ut}${dt})|${Ei})`,"giu")}catch(i){t.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${t.protocol})(${ut}${dt})|${Ei})`,"giu")}return e.replace(t.regexMagicLinks,(i,n,r)=>{let l=n?i.slice(n.length):i;if(r){let o="";const a=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(l);a&&(o=l.slice(a.index),l=l.slice(0,a.index));const d=l.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,u=d.exec(l);if(u){let h=1;u[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(l.slice(0,u.index))&&(h=2),o=l.slice(u.index+h)+o,l=l.slice(0,u.index+h)}return o.length>=r.length?i:(new Dt(l,void 0,t,s),`${n}\0${s.length-1}w${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(l))return i;return new Dt(l,"magic-link",t,s),`${n}\0${s.length-1}i`})}}}),Zo,bu=_({"util/html.ts"(){"use strict";Zo=(e,t)=>e.startsWith(t)?t.length:[...t].findIndex((s,i)=>s!==e[i])}}),ea,wu=_({"src/nowiki/list.ts"(){"use strict";Oo(),ea=class extends kn{get type(){return"list"}}}}),ta={};te(ta,{parseList:()=>sa});var sa,yu=_({"parser/list.ts"(){"use strict";bu(),wu(),Bo(),sa=(e,t,s,i)=>{const n=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(e);if(!n)return t.lastPrefix="",e;const[r,l,o,a]=n,d=o.replace(/;/gu,":"),u=Zo(d,t.lastPrefix),h=((u>1?o.slice(u-1):o)+a).split(/(?=;)/u),g=h[0].startsWith(";");let c=h.length-(g?0:1);if(u>1){const I=o.slice(0,u-1);if(g){const U=I.split(/(?=;)/u);h.unshift(...U),c+=I.includes(";")?U.length:0}else h[0]=I+h[0]}t.lastPrefix=d;let p=l+h.map((I,U)=>`\0${i.length+U}d`).join("")+e.slice(r.length);for(const I of h)new ea(I,s,i);if(!c)return p;const{html:[b,,x]}=s,m=/:+|-\{|\0\d+[xq]\x7F/gu;let w=m,y=w.exec(p),S=0,A=!1,T=!1,v=0;const $=(I,U)=>(new An(I,s,i),`${p.slice(0,U)}\0${i.length-1}d${p.slice(U+I.length)}`),C=I=>{I?S&&S--:S++};for(;y&&c;){const{0:I,index:U}=y;if(I==="-{"){if(!v){const{lastIndex:R}=w;w=/-\{|\}-/gu,w.lastIndex=R}v++}else if(I==="}-"){if(v--,!v){const{lastIndex:R}=w;w=m,w.lastIndex=R}}else if(I.endsWith("x")){const{name:R,closing:P,selfClosing:W}=i[Number(I.slice(1,-2))];(b.includes(R)||!W&&!x.includes(R))&&C(P)}else if(I.endsWith("q")){const{bold:R,italic:P}=i[Number(I.slice(1,-2))];R&&(C(A),A=!A),P&&(C(T),T=!T)}else if(S===0){if(I.length>=c)return $(I.slice(0,c),U);c-=I.length,w.lastIndex=U+4+String(i.length).length,p=$(I,U)}y=w.exec(p)}return p}}}),ns,vl,ji,bl,Bt,Su=_({"src/converterFlags.ts"(){"use strict";var e,t;z(),oe(),vs(),q(),B(),qe(),ns=new Set(["A","T","R","D","-","H","N"]),vl=[Gt()],Bt=(t=class extends(bl=E){constructor(i,n,r=[]){super(void 0,n,r,{});N(this,e);this.safeAppend(i.map(l=>new ge(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=>ns.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(c=>ns.has(c))),a=f(this,e).filter(c=>!c).length,d=f(this,e).length-l.size-a,u=super.lint(i,n);if(r.size===d||o.size===d)return u;const h="no-ignored",g=k.lintConfig.getSeverity(h,"conversionFlag");if(g){const c=new ie(this,i);for(let p=0;p<this.length;p++){const b=this.childNodes[p],x=b.text().trim();if(this.isInvalidFlag(x,r,l,o)){const m=O(b,c,h,"invalid-conversion-flag",g);r.size===0&&ns.has(x.toUpperCase())?m.fix=un(m,x):m.suggestions=[D(m,p&&-1)],u.push(m)}}}return u}print(){return super.print({sep:";"})}},e=new WeakMap,t),ji=Y(bl),Bt=K(ji,0,"ConverterFlagsToken",vl,Bt),X(ji,1,Bt)}}),cs,ku=_({"src/converterRule.ts"(){"use strict";q(),B(),qe(),cs=class extends E{get type(){return"converter-rule"}get variant(){var e,t;return(t=(e=this.childNodes[this.length-2])==null?void 0:e.text().trim().toLowerCase())!=null?t:""}constructor(e,t=!0,s=k.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 ge(l,"converter-rule-variant",s,i)),super.insertAt(new ge(e.slice(n+1),"converter-rule-to",s,i)),r!==-1&&super.insertAt(new ge(e.slice(0,r),"converter-rule-from",s,i),0)):super.insertAt(new ge(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);return s.variant=this.variant,s}}}}),wl,Pi,yl,qt,Au=_({"src/converter.ts"(){"use strict";de(),Be(),Le(),B(),Su(),ku(),wl=[$e,Fe("-{")],qt=class extends(yl=E){get type(){return"converter"}constructor(e,t,s,i=[]){super(void 0,s,i),this.insertAt(new Bt(e,s,i));const[n]=t,r=n.includes(":"),l=new cs(n,r,s,i);r&&l.length===1||!r&&t.length===2&&!be(t[1]).trim()?this.insertAt(new cs(t.join(";"),!1,s,i)):this.append(l,...t.slice(1).map(o=>new cs(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()}|${Qe(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?"|":""}${ct(t,{sep:";"})}}-</span>`}},Pi=Y(yl),qt=K(Pi,0,"ConverterToken",wl,qt),X(Pi,1,qt)}}),ia={};te(ia,{parseConverter:()=>na});var na,_u=_({"parser/converter.ts"(){"use strict";Au(),na=(e,t,s)=>{var a;(a=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:u}=o;if(d==="}-"){const h=r.pop(),{length:g}=s,c=e.slice(h.index+2,u),p=c.indexOf("|"),[b,x]=p===-1?[[],c]:[c.slice(0,p).split(";"),c.slice(p+1)],m=x.replace(/(&[#a-z\d]+);/giu,"$1"),w=m.split(t.regexConverter).map(y=>y.replace(/\x01/gu,";"));new qt(b,w,t,s),e=`${e.slice(0,h.index)}\0${g}v${e.slice(u+2)}`,r.length===0&&(l=i),l.lastIndex=h.index+3+String(g).length}else r.push(o),l=n,l.lastIndex=u+2;o=l.exec(e)}return e}}}),ps={};te(ps,{Token:()=>E});var Sl,E,B=_({"src/index.ts"(){"use strict";var e,t,s,i,n,r,l,o,ra,la,oa,aa,ua,da,ha,ca,ga,pa,fa,ma,S;de(),Je(),z(),Te(),q(),Ba(),qa(),Sl=["category","html-attr#id,ext-attr#id,table-attr#id"],E=(S=class extends Ct{constructor(v,$=k.getConfig(),C=[],I){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 v=="string"&&this.insertAt(v),L(this,s,$),L(this,i,C),C.push(this)}get type(){return f(this,e)}set type(v){L(this,e,v)}parseOnce(v=f(this,t),$=!1,C){if(v<f(this,t)||this.length===0||!this.isPlain())return this;if(f(this,t)>=ve)return this;switch(v){case 0:if(this.type==="root"){f(this,i).pop();const I=j(this,o,ra).call(this);$&&($=!I)}L(this,n,$),j(this,o,la).call(this,$);break;case 1:j(this,o,oa).call(this);break;case 2:j(this,o,aa).call(this);break;case 3:j(this,o,ua).call(this);break;case 4:j(this,o,da).call(this);break;case 5:j(this,o,ha).call(this,C);break;case 6:j(this,o,ca).call(this,C);break;case 7:j(this,o,ga).call(this);break;case 8:j(this,o,pa).call(this);break;case 9:j(this,o,fa).call(this);break;case 10:j(this,o,ma).call(this)}if(this.type==="root")for(const I of f(this,i))I==null||I.parseOnce(v,$,C);return Pn(this,t)._++,this}buildFromStr(v,$){const C=v.split(/[\0\x7F]/u).map((I,U)=>{if(U%2===0)return new Gi(I);if(isNaN(I.slice(-1)))return f(this,i)[Number(I.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${I}`)});return $===0?C.map(String).join(""):$===1?Qe(C):C}build(){L(this,t,ve);const{length:v,firstChild:$}=this,C=$==null?void 0:$.toString();if(v===1&&$.type==="text"&&C.includes("\0")&&(Tn(this,0,1,this.buildFromStr(C)),this.normalize(),this.type==="root"))for(const I of f(this,i))I==null||I.build()}afterBuild(){if(this.type==="root")for(const v of f(this,i))v==null||v.afterBuild();L(this,r,!0)}parse(v=ve,$,C){for(v=Math.min(v,ve);f(this,t)<v;)this.parseOnce(f(this,t),$,C);return v&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===S}getAttribute(v){var $;switch(v){case"config":return f(this,s);case"include":return($=f(this,n))!=null?$:!!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"&&Wt(this)===2;default:return super.getAttribute(v)}}setAttribute(v,$){switch(v){case"stage":f(this,t)===0&&this.type==="root"&&f(this,i).shift(),L(this,t,$);break;default:super.setAttribute(v,$)}}insertAt(v,$=this.length){const C=typeof v=="string"?new Gi(v):v;super.insertAt(C,$);const{type:I}=C;return I==="root"&&(C.type="plain"),C}normalizeTitle(v,$=0,C){return k.normalizeTitle(v,$,f(this,n),f(this,s),C)}inTableAttrs(){var v,$;return((v=this.closest("table-attrs,ext"))==null?void 0:v.type)==="table-attrs"&&(($=this.closest("table-attrs,arg,magic-word,template"))!=null&&$.is("table-attrs")?2:1)}inHtmlAttrs(){var v;return(v=this.closest("html-attrs,ext"))!=null&&v.is("html-attrs")?2:this.inTableAttrs()}lint(v=this.getAbsoluteIndex(),$){var I;let C=super.lint(v,$);if(this.type==="root"){const U=new Map,R="no-duplicate",P=["category","id"].map(F=>k.lintConfig.getSeverity(R,F)),W=Sl.filter((F,V)=>P[V]).join();if(W){for(const F of this.querySelectorAll(W)){let V;if(F.is("category"))V=F.name;else{const G=F.getValue();G&&G!==!0&&(V=`#${G}`)}if(V){const G=U.get(V);G?G.add(F):U.set(V,new Set([F]))}}for(const[F,V]of U)if(V.size>1&&!F.startsWith("#mw-customcollapsible-")){const G=!F.startsWith("#"),Z=`duplicate-${G?"category":"id"}`,ne=P[G?0:1];C.push(...[...V].map(le=>{const re=J(le,{start:le.getAbsoluteIndex()},R,Z,ne);return G&&(re.suggestions=[D(re)]),re}))}}const H=/<!--\s*lint-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->/gu,pe=this.toString(),ee=[];let M=H.exec(pe);for(;M;){const{1:F,index:V}=M,G=(I=M[2])==null?void 0:I.trim();ee.push({line:this.posFromIndex(V).top+(F==="disable-line"?0:1),from:F==="disable"?H.lastIndex:void 0,to:F==="enable"?H.lastIndex:void 0,rules:G?new Set(G.split(",").map(Z=>Z.trim())):void 0}),M=H.exec(pe)}if(C=C.filter(({rule:F,startLine:V,startIndex:G})=>{const Z={pos:0};for(const{line:ne,from:le,to:re,rules:Ce}of ee){if(ne>V+1)break;if(Ce&&!Ce.has(F))continue;if(ne===V&&le===void 0&&re===void 0)return!1;le<=G&&le>Z.pos?(Z.pos=le,Z.type="from"):re<=G&&re>Z.pos&&(Z.pos=re,Z.type="to")}return Z.type!=="from"}),C.some(({fix:F})=>F)){const F=C.map(({fix:Z})=>Z).filter(Boolean).sort(({range:[Z,ne]},{range:[le,re]})=>ne===re?le-Z:re-ne);let V=1/0,G=pe;for(const{range:[Z,ne],text:le}of F)ne<=V&&(G=G.slice(0,Z)+le+G.slice(ne),V=Z);Object.assign(C,{output:G})}}return C}toString(v,$){return v?super.toString(!0,$):Ve(f(this,l),()=>super.toString(!1,$),C=>{const I=this.getRootNode();I.type==="root"&&f(I,r)&&L(this,l,C)})}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,n=new WeakMap,r=new WeakMap,l=new WeakMap,o=new WeakSet,ra=function(){const{parseRedirect:v}=(za(),Q(Gl)),$=this.firstChild.toString(),C=v($,f(this,s),f(this,i));return C&&this.setText(C),!!C},la=function(v){const{parseCommentAndExt:$}=(ks(),Q(No));this.setText($(this.firstChild.toString(),f(this,s),f(this,i),v))},oa=function(){const{parseBraces:v}=(xn(),Q(ao)),$=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,C=v($,f(this,s),f(this,i));this.setText(this.type==="root"?C:C.slice(1))},aa=function(){if(f(this,s).excludes.includes("html"))return;const{parseHtml:v}=(au(),Q(Lo));this.setText(v(this.firstChild.toString(),f(this,s),f(this,i)))},ua=function(){if(f(this,s).excludes.includes("table"))return;const{parseTable:v}=(hu(),Q(qo));this.setText(v(this,f(this,s),f(this,i)))},da=function(){if(f(this,s).excludes.includes("hr"))return;const{parseHrAndDoubleUnderscore:v}=(pu(),Q(zo));this.setText(v(this,f(this,s),f(this,i)))},ha=function(v){const{parseLinks:$}=(xu(),Q(Xo));this.setText($(this.firstChild.toString(),f(this,s),f(this,i),v))},ca=function(v){if(f(this,s).excludes.includes("quote"))return;const{parseQuotes:$}=(Go(),Q(Do)),C=this.firstChild.toString().split(`
|
|
25
25
|
`);for(let I=0;I<C.length;I++)C[I]=$(C[I],f(this,s),f(this,i),v);this.setText(C.join(`
|
|
26
|
-
`))},
|
|
27
|
-
`),R={lastPrefix:""};let P=C==="root"||C==="ext-inner"&&I==="poem"?0:1;for(;P<
|
|
28
|
-
`))},
|
|
26
|
+
`))},ga=function(){if(f(this,s).excludes.includes("extLink"))return;const{parseExternalLinks:v}=(Qo(),Q(Vo));this.setText(v(this.firstChild.toString(),f(this,s),f(this,i)))},pa=function(){if(f(this,s).excludes.includes("magicLink"))return;const{parseMagicLinks:v}=(vu(),Q(Ko));this.setText(v(this.firstChild.toString(),f(this,s),f(this,i)))},fa=function(){if(f(this,s).excludes.includes("list"))return;const{parseList:v}=(yu(),Q(ta)),{firstChild:$,type:C,name:I}=this,U=$.toString().split(`
|
|
27
|
+
`),R={lastPrefix:""};let P=C==="root"||C==="ext-inner"&&I==="poem"?0:1;for(;P<U.length;P++)U[P]=v(U[P],R,f(this,s),f(this,i));this.setText(U.join(`
|
|
28
|
+
`))},ma=function(){if(f(this,s).variants.length>0){const{parseConverter:v}=(_u(),Q(ia));this.setText(v(this.firstChild.toString(),f(this,s),f(this,i)))}},S)}}),we,As,Tn,Te=_({"util/debug.ts"(){"use strict";we={running:!1,run(e){const{running:t}=this;this.running=!0;try{const{Token:s}=(B(),Q(ps)),i=e();return i instanceof s&&!i.getAttribute("built")&&i.afterBuild(),this.running=t,i}catch(s){throw this.running=t,s}},rev:0},As=e=>t=>t.type===e,Tn=(e,t,s,i=[])=>{var l,o;let n=e.getChildNodes(),r;n.length===s?(r=n,n=i):r=n.splice(t,s,...i);for(let a=0;a<i.length;a++){const d=i[a];d.setAttribute("parentNode",e),d.setAttribute("nextSibling",n[t+a+1]),d.setAttribute("previousSibling",n[t+a-1])}return(l=n[t-1])==null||l.setAttribute("nextSibling",n[t]),(o=n[t+i.length])==null||o.setAttribute("previousSibling",n[t+i.length-1]),n===i&&e.setAttribute("childNodes",n),r}}}),kl,$t,Ri,Oi,Al,Bi,_l,en,$u=_({"lib/lintConfig.ts"(){"use strict";jl(),kl=new Set([0,1,2]),$t=new Map([[0,!1],[1,"warning"],[2,"error"]]),Ri={"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,"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,{}],"unterminated-url":[1,{}],"url-encoding":[1,{}],"var-anchor":[1,{}],"void-ext":[2,{}]},Object.freeze(Ri),Oi=e=>typeof e=="number"&&kl.has(e),Al=e=>Oi(e)||Array.isArray(e)&&e.length===2&&Oi(e[0])&&e[1]&&typeof e[1]=="object",Bi=(e,t,s)=>{if(rn.includes(t)){if(Al(s))return e[t]=s,!0}else throw new RangeError(`Unknown lint rule: ${t}`);throw new RangeError(`Invalid lint config for ${t}: ${JSON.stringify(s)}`)},_l=class{constructor(e){if(Object.assign(this,JSON.parse(JSON.stringify(Ri))),!!e)for(const[t,s]of Object.entries(e))Bi(this,t,s)}getSeverity(e,t){var i;const s=this[e];return typeof s=="number"?$t.get(s):t&&(i=$t.get(s[1][t]))!=null?i:$t.get(s[0])}},en=e=>new Proxy(new _l(e),{set:Bi})}}),xa={};te(xa,{Title:()=>va});var va,Tu=_({"lib/title.ts"(){"use strict";var e,t,s,i,n,r;Xe(),de(),va=(r=class{constructor(l,o,a,{temporary:d,decode:u,selfLink:h}={}){N(this,e);N(this,t);N(this,s);N(this,i);N(this,n);Ne(this,"valid");Ne(this,"encoded",!1);const g=l.trim().startsWith("../");if(u&&l.includes("%"))try{const p=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(l);l=Ut(l),this.encoded=p}catch(p){}if(l=Mt(l).replace(/[_ ]+/gu," ").trim(),g)L(this,i,0);else{let p=o;l.startsWith(":")&&(p=0,l=l.slice(1).trim());const b=l.split(":");if(b.length>1){const x=ht(b[0]),m=Object.prototype.hasOwnProperty.call(a.nsid,x)&&a.nsid[x];m&&(p=m,l=b.slice(1).join(":").trim())}L(this,i,p)}const c=l.indexOf("#");if(c!==-1){let p=l.slice(c).trim().slice(1);if(p.includes("%"))try{p=Ut(p)}catch(b){}L(this,n,p.replace(/ /gu,"_")),l=l.slice(0,c).trim()}this.valid=!!(l||h&&this.ns===0&&f(this,n)!==void 0)&&Mt(l)===l&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(g?/^(?:\.\.\/)+(.*)/u.exec(l)[1]:l),this.main=l,L(this,t,a.namespaces),L(this,s,a.articlePath||"/wiki/$1"),f(this,s).includes("$1")||L(this,s,f(this,s)+`${f(this,s).endsWith("/")?"":"/"}$1`),d||Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}})}get ns(){return f(this,i)}get fragment(){return f(this,n)}get main(){return f(this,e)}set main(l){l=l.replace(/_/gu," ").trim(),L(this,e,l&&l[0].toUpperCase()+l.slice(1))}get prefix(){const l=f(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,n,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,n=new WeakMap,r)}}),ba={};te(ba,{default:()=>k});wa.exports=Q(ba);var rs,qi,$l,Ee,Wi,Tl,k,q=_({"index.ts"(){jl(),Te(),Je(),de(),$u(),rs=!0,qi=en(),Ee={rules:rn,config:zi,get i18n(){return ce(ce({},Ol),$l)},set i18n(e){$l=e},get lintConfig(){return qi},set lintConfig(e){qi=en(e)},get viewOnly(){return rs},set viewOnly(e){rs&&!e&&we.rev++,rs=e},getConfig(e){const t=e!=null?e:this.config,{doubleUnderscore:s,ext:i,parserFunction:n,variable:r}=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")&&!r.includes("translationlanguage")&&(r.push("translationlanguage"),Array.isArray(n[1])?n[1].push("TRANSLATIONLANGUAGE"):n[1].TRANSLATIONLANGUAGE="translationlanguage"),_e(ce(ce({},zi),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=Ee.getConfig(),n){const{Title:r}=(Tu(),Q(xa));let l;if(n!=null&&n.halfParsed)l=new r(e,t,i,n);else{const{Token:o}=(B(),Q(ps));l=we.run(()=>{const a=new o(e,i);a.type="root",a.parseOnce(0,s).parseOnce();const d=new r(a.toString(),t,i,n);a.build();for(const u of["main","fragment"]){const h=d[u];if(h!=null&&h.includes("\0")){const g=a.buildFromStr(h,1);u==="main"?d.main=g:d.setFragment(g)}}return d})}return l},parse(e,t,s=ve,i=Ee.getConfig()){e=Pl(e);let n;typeof s!="number"&&(n=Array.isArray(s)?s:[s],s=Math.max(...n.map(o=>El[o]||ve)));const{Token:r}=(B(),Q(ps));return we.run(()=>{const o=new r(e,i);return o.type="root",o.parse(s,t)})},async partialParse(e,t,s,i=Ee.getConfig()){},createLanguageService(e={}){throw new Error("Parser.createLanguageService method is only available in the LSP version!")}},Wi={},Tl=new Set(["lintConfig","normalizeTitle","parse","createLanguageService"]);for(const e in Ee)Tl.has(e)||(Wi[e]={enumerable:!1});Object.defineProperties(Ee,Wi),Object.assign(typeof globalThis=="object"?globalThis:self,{Parser:Ee}),k=Ee}});q()});Cu();})();
|