wikiparser-node 1.25.0 → 1.25.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/README.md +2 -2
  2. package/bundle/bundle-es8.min.js +25 -24
  3. package/bundle/bundle-lsp.min.js +29 -28
  4. package/bundle/bundle.min.js +25 -25
  5. package/dist/addon/token.js +1 -1
  6. package/dist/base.d.mts +2 -1
  7. package/dist/base.d.ts +2 -1
  8. package/dist/bin/config.js +1 -1
  9. package/dist/index.d.ts +4 -3
  10. package/dist/index.js +74 -52
  11. package/dist/lib/element.js +33 -29
  12. package/dist/lib/text.js +174 -171
  13. package/dist/mixin/hidden.js +1 -1
  14. package/dist/mixin/noEscape.js +9 -7
  15. package/dist/parser/links.js +10 -4
  16. package/dist/src/arg.js +39 -33
  17. package/dist/src/attribute.js +52 -38
  18. package/dist/src/attributes.js +54 -51
  19. package/dist/src/commented.js +2 -1
  20. package/dist/src/converterFlags.js +20 -18
  21. package/dist/src/converterRule.js +6 -3
  22. package/dist/src/extLink.js +6 -4
  23. package/dist/src/gallery.js +48 -42
  24. package/dist/src/heading.js +65 -61
  25. package/dist/src/html.js +75 -71
  26. package/dist/src/imageParameter.js +17 -15
  27. package/dist/src/imagemap.js +20 -18
  28. package/dist/src/index.js +100 -99
  29. package/dist/src/link/base.js +38 -33
  30. package/dist/src/link/category.js +11 -6
  31. package/dist/src/link/file.js +87 -77
  32. package/dist/src/link/galleryImage.js +8 -6
  33. package/dist/src/link/index.js +8 -6
  34. package/dist/src/link/redirectTarget.js +10 -8
  35. package/dist/src/magicLink.js +22 -20
  36. package/dist/src/nested.js +29 -27
  37. package/dist/src/nowiki/comment.js +11 -9
  38. package/dist/src/nowiki/index.js +9 -7
  39. package/dist/src/nowiki/listBase.js +8 -5
  40. package/dist/src/nowiki/quote.js +29 -25
  41. package/dist/src/paramTag/index.js +24 -22
  42. package/dist/src/parameter.js +29 -23
  43. package/dist/src/pre.js +1 -1
  44. package/dist/src/redirect.js +5 -3
  45. package/dist/src/syntax.js +1 -1
  46. package/dist/src/table/index.js +35 -31
  47. package/dist/src/table/td.js +24 -19
  48. package/dist/src/table/trBase.js +13 -11
  49. package/dist/src/tagPair/ext.js +13 -10
  50. package/dist/src/tagPair/include.js +13 -11
  51. package/dist/src/transclude.js +39 -37
  52. package/dist/util/constants.js +2 -1
  53. package/dist/util/lint.js +2 -1
  54. package/extensions/dist/base.js +1 -1
  55. package/package.json +2 -2
@@ -1,36 +1,37 @@
1
- "use strict";(()=>{var au=Object.defineProperty;var ar=e=>{throw TypeError(e)};var ou=(e,t,s)=>t in e?au(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var uu=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ce=(e,t,s)=>ou(e,typeof t!="symbol"?t+"":t,s),Qs=(e,t,s)=>t.has(e)||ar("Cannot "+s);var v=(e,t,s)=>(Qs(e,t,"read from private field"),s?s.call(e):t.get(e)),B=(e,t,s)=>t.has(e)?ar("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),E=(e,t,s,i)=>(Qs(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),P=(e,t,s)=>(Qs(e,t,"access private method"),s);var or=(e,t,s,i)=>({set _(l){E(e,t,l,s)},get _(){return v(e,t,i)}});var ud=uu((cd,lu)=>{var du=Object.create,Nt=Object.defineProperty,ga=Object.getOwnPropertyDescriptor,Ln=Object.getOwnPropertyNames,cu=Object.prototype.hasOwnProperty,pa=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Lt=e=>{throw TypeError(e)},fa=(e,t,s)=>t in e?Nt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,ur=(e,t)=>Nt(e,"name",{value:t,configurable:!0}),I=(e,t)=>function(){return e&&(t=(0,e[Ln(e)[0]])(e=0)),t},ma=(e,t)=>function(){return t||(0,e[Ln(e)[0]])((t={exports:{}}).exports,t),t.exports},ae=(e,t)=>{for(var s in t)Nt(e,s,{get:t[s],enumerable:!0})},hu=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of Ln(t))!cu.call(e,l)&&l!==s&&Nt(e,l,{get:()=>t[l],enumerable:!(i=ga(t,l))||i.enumerable});return e},Y=e=>hu(Nt({},"__esModule",{value:!0}),e),re=e=>{var t;return[,,,du((t=e==null?void 0:e[pa("metadata")])!=null?t:null)]},xa=["class","method","getter","setter","accessor","field","value","get","set"],Ht=e=>e!==void 0&&typeof e!="function"?Lt("Function expected"):e,gu=(e,t,s,i,l)=>({kind:xa[e],name:t,metadata:i,addInitializer:n=>s._?Lt("Already initialized"):l.push(Ht(n||null))}),Fn=(e,t)=>fa(t,pa("metadata"),e[3]),se=(e,t,s,i)=>{for(var l=0,n=e[t>>1],r=n&&n.length;l<r;l++)t&1?n[l].call(s):i=n[l].call(s,i);return i},ie=(e,t,s,i,l,n)=>{var r,a,o,u,d,c=t&7,f=!!(t&8),p=!!(t&16),x=c>3?e.length+1:c?f?1:2:0,A=xa[c+5],S=c>3&&(e[x-1]=[]),y=e[x]||(e[x]=[]),$=c&&(!p&&!f&&(l=l.prototype),c<5&&(c>3||!p)&&ga(c<4?l:{get[s](){return ce(this,n)},set[s](h){return ke(this,n,h)}},s));c?p&&c<4&&ur(n,(c>2?"set ":c>1?"get ":"")+s):ur(l,s);for(var g=i.length-1;g>=0;g--)u=gu(c,s,o={},e[3],y),c&&(u.static=f,u.private=p,d=u.access={has:p?h=>fu(l,h):h=>s in h},c^3&&(d.get=p?h=>(c^1?ce:cn)(h,l,c^4?n:$.get):h=>h[s]),c>2&&(d.set=p?(h,b)=>ke(h,l,b,c^4?n:$.set):(h,b)=>h[s]=b)),a=(0,i[g])(c?c<4?p?n:$[A]:c>4?void 0:{get:$.get,set:$.set}:l,u),o._=1,c^4||a===void 0?Ht(a)&&(c>4?S.unshift(a):c?p?n=a:$[A]=a:l=a):typeof a!="object"||a===null?Lt("Object expected"):(Ht(r=a.get)&&($.get=r),Ht(r=a.set)&&($.set=r),Ht(r=a.init)&&S.unshift(r));return c||Fn(e,l),$&&Nt(l,s,$),p?c^4?n:$:l},pu=(e,t,s)=>fa(e,typeof t!="symbol"?t+"":t,s),jn=(e,t,s)=>t.has(e)||Lt("Cannot "+s),fu=(e,t)=>Object(t)!==t?Lt('Cannot use the "in" operator on this value'):e.has(t),ce=(e,t,s)=>(jn(e,t,"read from private field"),s?s.call(e):t.get(e)),He=(e,t,s)=>t.has(e)?Lt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),ke=(e,t,s,i)=>(jn(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),cn=(e,t,s)=>(jn(e,t,"access private method"),s),mu=(e,t,s,i)=>({set _(l){ke(e,t,l,s)},get _(){return ce(e,t,i)}}),va,Ps,En=I({"base.ts"(){"use strict";va=(()=>{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})(),Ps=(()=>{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 Ne(e,t,s){return s===1?e.replace(/\0(\d+)g\x7F/gu,(i,l)=>Ne(String(t[l]),t,2)):s===2?e.replace(/\0(\d+)n\x7F/gu,(i,l)=>String(t[l])):e.replace(/\0(\d+)\x7F/gu,(i,l)=>t[l])}var Ge,Js,$t,_t,Tt,pt,as,Le,ut,dr,cr,os,ba,hr,gr,us,Ct,he=I({"util/string.ts"(){"use strict";Ge=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,Js=String.raw`[^[\]<>"\0-\x1F\x7F${Ge}\uFFFD]`,$t=String.raw`(?:\[[\da-f:.]+\]|${Js})`,_t=String.raw`(?:${Js}|\0\d+[cn!~]\x7F)*`,Tt=e=>e.trim().toLowerCase(),pt=(e,t)=>s=>s.replace(e,t),as=pt(/[\0\x7F]|\r$/gmu,""),Le=pt(/\0\d+[cn]\x7F/gu,""),ut=(e,t="")=>e.map(s=>typeof s=="string"?s:s.text()).join(t),dr={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},cr=pt(/&(?:#(\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)):dr[s.toLowerCase()]),os=e=>cr(e),ba=pt(/&#(\d+|x[\da-f]+);/giu,(e,t)=>String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t))),hr={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},gr=e=>pt(e,t=>`&${hr[t]};`),us=gr(/[&<>]/gu),Ct=(e,t={})=>{const{pre:s="",post:i="",sep:l=""}=t;return s+e.map(n=>n.print()).join(l)+i}}}),xu=ma({"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}}}),vu=ma({"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:[]}}}),$e,wa,hn,dt=I({"util/constants.ts"(){"use strict";$e=11,wa=xu(),hn=vu()}});function at(e){const t=new Map,s=new WeakMap;return i=>{const l=typeof i=="string"?t:s;if(l.has(i)){const r=l.get(i);return r.lastIndex=0,r}const n=e(i);return l.set(i,n),n}}var ds,ya,pr,Sa,Aa,Je=I({"../common/dist/index.mjs"(){"use strict";ds=e=>decodeURIComponent(e.replace(/%(?![\da-f]{2})/giu,"%25")),ya=e=>Math.round(e*255).toString(16).padStart(2,"0"),pr=(()=>{const e=String.raw`#(?:[\da-f]{3,4}|(?:[\da-f]{2}){3,4})(?![\p{L}\p{N}_])`,t=String.raw`(?:\d*\.)?\d+%?`,s=String.raw`(?:\d*\.)?\d+(?:deg|grad|rad|turn)?`,i=String.raw`rgba?\(\s*(?:${String.raw`${new Array(3).fill(t).join(String.raw`\s+`)}(?:\s*\/\s*${t})?`}|${String.raw`${new Array(3).fill(t).join(String.raw`\s*,\s*`)}(?:\s*,\s*${t})?`})\s*\)`,l=String.raw`hsla?\(\s*(?:${String.raw`${s}\s+${t}\s+${t}(?:\s*\/\s*${t})?`}|${String.raw`${s}${String.raw`\s*,\s*(?:\d*\.)?\d+%`.repeat(2)}(?:\s*,\s*${t})?`})\s*\)`;return{full:new RegExp(String.raw`(^|[^\p{L}\p{N}_])(${e}|${i}|${l})`,"giu"),rgb:new RegExp(String.raw`(^|[^\p{L}\p{N}_])(${e}|${i})`,"giu")}})(),Sa=(e,t=!0)=>{const s=[],i=pr[t?"full":"rgb"];i.lastIndex=0;let l=i.exec(e),n=0;for(;l;){const r=l.index+l[1].length;r>n&&s.push([e.slice(n,r),n,r,!1]),{lastIndex:n}=i,s.push([l[2],r,n,e[r-1]!=="&"||!/^#\d+$/u.test(l[2])]),l=i.exec(e)}return e.length>n&&s.push([e.slice(n),n,e.length,!1]),s},Aa=at}}),de,ge=I({"lib/rect.ts"(){"use strict";var e,t,s,i,gn,n;de=(n=class{constructor(r,a){B(this,i);B(this,e);B(this,t);B(this,s);E(this,e,r),E(this,t,a)}get start(){return v(this,t)}get top(){return P(this,i,gn).call(this).top}get left(){return P(this,i,gn).call(this).left}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakSet,gn=function(){var r;return(r=v(this,s))!=null||E(this,s,v(this,e).getRootNode().posFromIndex(v(this,t))),v(this,s)},n)}}),fr,mr,rs,cs,Xs,Q,te,je,Os,Z,Rn,Ve,Pn,On,Bn,hs,It,qn,ot,Wn,X=I({"util/lint.ts"(){"use strict";Je(),Re(),ge(),G(),fr=new Set(["tr","td","th","caption"]),mr=new Set(["Template:!!","Template:!-"]),rs=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")&&mr.has(t.name)||t.is("html")&&fr.has(t.name))return!1;if(t.is("arg"))return t.length>1&&rs(t.childNodes[1]);if(t.is("magic-word"))try{const s=t.getPossibleValues().map(rs);return s.includes(2)?2:s.includes(1)&&1}catch{}return t.is("template")||t.is("magic-word")&&t.name==="invoke"?1:2},cs=(e,t,s,i)=>({line:e+s-1,character:(s===1?t:0)+i}),Xs=e=>(t,s,i,l,n="error")=>{const{start:r}=s,{top:a,left:o}=s instanceof de?s:new de(t,r),{offsetHeight:u,offsetWidth:d}=t,{startIndex:c,startLine:f,startCol:p}=e(t,r,a,o),{line:x,character:A}=cs(f,p,u,d);return{rule:i,message:C.msg(l),severity:n,startIndex:c,endIndex:c+t.toString().length,startLine:f,endLine:x,startCol:p,endCol:A}},Q=Xs((e,t,s,i)=>{const l=e.getRelativeIndex(),{top:n,left:r}=e.parentNode.posFromIndex(l);return{startIndex:t+l,startLine:s+n,startCol:n?r:i+r}}),te=Xs((e,t,s,i)=>({startIndex:t,startLine:s,startCol:i})),je=(e,t,s,i=0)=>({desc:C.msg(t),range:[e.startIndex+i,e.endIndex],text:s}),Os=(e,t,s)=>({desc:C.msg(t),range:[e,e],text:s}),Z=(e,t=0,s="")=>typeof e=="number"?{desc:C.msg("remove"),range:[e,e+t],text:s}:je(e,"remove",s,t),Rn=(e,t)=>je(e,"decode",ds(t.text().replace(/%(?=21|3[ce]|5[bd]|7[b-d])/giu,"%25"))),Ve=(e,t,s=0)=>({desc:C.msg("close"),range:[e+s,e],text:t}),Pn=e=>({desc:C.msg("open"),range:[e+1,e+2],text:""}),On=(e,t)=>je(e,"comment",`<!--${t}-->`),Bn=(e,t)=>je(e,"uppercase",t.toUpperCase()),hs=(e,t=0)=>({desc:C.msg("whitespace"),range:[e,e+t],text:" "}),It=(e,t,s=1)=>({desc:C.msg("escape"),range:[e,e+s],text:t.repeat(s)}),qn=(e,t)=>({desc:C.msg("escape"),range:[e,e+t.length],text:t.replace(/\|/gu,"&#124;")}),ot=(e,t,s,i)=>{if(e&&(i||C.viewOnly&&e[0]===ve.rev))return e[1];const l=t();return(i||C.viewOnly)&&s([ve.rev,l]),l},Wn=(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"]:[]}}),xr,Un,ka=I({"parser/selector.ts"(){"use strict";xr=(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},Un=(e,t,s)=>{const i=e.split(",");return({type:l,name:n})=>i.some(r=>xr(r.trim(),l,n))}}}),Bs,Mn=I({"mixin/cached.ts"(){"use strict";X(),Bs=(e=!0)=>t=>{const s=new WeakMap;return function(...i){return ot(s.get(this),()=>t.apply(this,i),l=>{s.set(this,l)},e)}}}}),$a,bu=I({"mixin/nodeLike.ts"(){"use strict";$a=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}}}),vr,br,xs,Et,Rt,vs,Pt,Ot,Bt,nt,_a=I({"lib/node.ts"(){"use strict";X(),Re(),Mn(),bu(),G(),br=[$a],vr=[Bs(!1)],nt=class{constructor(){se(Bt,5,this),pu(this,"childNodes",[]),He(this,xs),He(this,Et),He(this,Rt),He(this,vs),He(this,Pt),He(this,Ot,{})}get parentNode(){return ce(this,xs)}get nextSibling(){return ce(this,Et)}get previousSibling(){return ce(this,Rt)}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":ke(this,xs,t),t||(ke(this,Et,void 0),ke(this,Rt,void 0));break;case"nextSibling":ke(this,Et,t);break;case"previousSibling":ke(this,Rt,t);break;case"aIndex":C.viewOnly&&ke(this,Pt,[ve.rev,t]);break;default:this[e]=t}}getRootNode(){return ot(ce(this,vs),()=>{var e,t;return(t=(e=this.parentNode)==null?void 0:e.getRootNode())!=null?t:this},e=>{const[,t]=e;t.type==="root"&&ke(this,vs,e)})}indexFromPos(e,t){{if(e<0||t<0)return;const s=this.getLines();if(e>=s.length)return;const[,i,l]=s[e],n=i+t;return n>l?void 0:n}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(([,,l])=>e<=l);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 ot(ce(this,Ot)[e],()=>{const{childNodes:t}=this,s=e+(e<0?t.length:0);let i=this.getAttribute("padding");for(let l=0;l<s;l++)C.viewOnly&&(ce(this,Ot)[l]=[ve.rev,i]),i+=t[l].toString().length+this.getGaps(l);return i},t=>{ce(this,Ot)[e]=t})}getAbsoluteIndex(){return ot(ce(this,Pt),()=>{const{parentNode:e}=this;return e?e.getAbsoluteIndex()+this.getRelativeIndex():0},e=>{ke(this,Pt,e)})}getBoundingClientRect(){return{...this.getDimension(),...this.getRootNode().posFromIndex(this.getAbsoluteIndex())}}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!`)}},Bt=re(null),xs=new WeakMap,Et=new WeakMap,Rt=new WeakMap,vs=new WeakMap,Pt=new WeakMap,Ot=new WeakMap,ie(Bt,1,"getLines",vr,nt),nt=ie(Bt,0,"AstNode",br,nt),se(Bt,1,nt)}}),Ta,wu=I({"mixin/elementLike.ts"(){"use strict";ka(),Ta=e=>{var s,pn;class t extends e{constructor(){super(...arguments);B(this,s)}getElementBy(r){for(const a of this.childNodes){if(a.type==="text")continue;if(r(a))return a;const o=a.getElementBy(r);if(o)return o}}querySelector(r){return this.getElementBy(P(this,s,pn).call(this,r))}getElementsBy(r,a=[]){for(const o of this.childNodes)o.type!=="text"&&(r(o)&&a.push(o),o.getElementsBy(r,a));return a}querySelectorAll(r){return this.getElementsBy(P(this,s,pn).call(this,r))}escape(){for(const r of this.childNodes)r.escape()}}return s=new WeakSet,pn=function(r){return Un(r,this)},t}}}),wr,Ks,yr,Dt,yu=I({"lib/element.ts"(){"use strict";he(),Re(),ka(),_a(),wu(),wr=[Ta],Dt=class extends(yr=nt){get length(){return this.childNodes.length}text(e){return ut(this.childNodes,e)}normalize(){const e=this.getChildNodes(),t=s=>{var i,l;e.splice(s,1),(i=e[s-1])==null||i.setAttribute("nextSibling",e[s]),(l=e[s])==null||l.setAttribute("previousSibling",e[s-1])};for(let s=e.length-1;s>=0;s--){const{type:i,data:l}=e[s];i!=="text"||e.length===1||this.getGaps(s-(s&&1))||l===""&&t(s)}this.setAttribute("childNodes",e)}removeAt(e){return ps(this,e,1)[0]}insertAt(e,t=this.length){return ps(this,t,0,[e]),e}closest(e){const t=Un(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){for(let t=this.length-1;t>=0;t--)this.removeAt(t);this.safeAppend(e)}setText(e,t=0){t+=t<0?this.length:0;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){{if(e===void 0)return;const{length:t}=this.toString();if(e>t||e<-t)return;e+=e<0?t:0;let s=this,i=0,l=0;for(;s.type!=="text";){const{childNodes:n}=s;i+=s.getAttribute("padding");for(let r=0;i<=e&&r<n.length;r++){const a=n[r],{nextSibling:o}=a,u=a.toString(),d=u.length;if(a.setAttribute("aIndex",i),i+=d,i>e||i===e&&d>0&&(!o||o.type==="text"||a.type!=="text"&&(u.trim()||!o.toString().trim()))){s=a,i-=d,l=i;break}i+=s.getGaps(r)}if(s.childNodes===n)return{offsetNode:s,offset:e-l}}return{offsetNode:s,offset:e-l}}this.lspError("AstElement.caretPositionFromIndex")}elementFromIndex(e){var t;{const s=(t=this.caretPositionFromIndex(e))==null?void 0:t.offsetNode;return(s==null?void 0:s.type)==="text"?s.parentNode:s}this.lspError("AstElement.elementFromIndex")}elementFromPoint(e,t){return this.elementFromIndex(this.indexFromPos(t,e))}lint(e=this.getAbsoluteIndex(),t){const s=[];for(let i=0,l=e+this.getAttribute("padding");i<this.length;i++){const n=this.childNodes[i];n.setAttribute("aIndex",l);const r=n.lint(l,t);r.length>0&&s.push(...r),l+=n.toString().length+this.getGaps(i)}return s}print(e={}){const t=e.class;return this.toString()?(t===""?"":`<span class="wpb-${t!=null?t:this.type}${this.getAttribute("invalid")?" wpb-invalid":""}">`)+Ct(this.childNodes,e)+(t===""?"":"</span>"):""}json(e,t=this.getAbsoluteIndex()){const s={...this,type:this.type,range:[t,t+this.toString().length],childNodes:[]};for(let i=0,l=t+this.getAttribute("padding");i<this.length;i++){const n=this.childNodes[i],{length:r}=n.toString();n.setAttribute("aIndex",l),s.childNodes.push(n.type==="text"?{data:n.data,range:[l,l+r]}:n.json(void 0,l)),l+=r+this.getGaps(i)}return s}},Ks=re(yr),Dt=ie(Ks,0,"AstElement",wr,Dt),se(Ks,1,Dt)}}),fs,qs=I({"mixin/gapped.ts"(){"use strict";fs=(e=1)=>t=>{class s extends t{getGaps(){return e}}return s}}}),Oe,qe=I({"mixin/noEscape.ts"(){"use strict";Oe=e=>{class t extends e{escape(){}}return t}}}),Sr,Ca,Su=I({"src/parameter.ts"(){"use strict";he(),X(),G(),V(),Sr=new RegExp(`https?://${$t}${_t}$`,"iu"),Ca=class extends z{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{return!1}}constructor(e,t,s,i=[]){super(void 0,s,i);const l=new z(typeof e=="number"?void 0:e,s,i,{}),n=new z(t,s,i);l.type="parameter-key",l.setAttribute("stage",2),n.type="parameter-value",n.setAttribute("stage",2),this.append(l,n)}trimName(e,t=!0){const s=(typeof e=="string"?e:e.toString(!0)).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");return this.setAttribute("name",s),s}afterBuild(){if(!this.anon){const{parentNode:e,firstChild:t}=this,s=this.trimName(t);e&&e.getArgs(s,!1,!1).add(this)}super.afterBuild()}toString(e){return this.anon?this.lastChild.toString(e):super.toString(e,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(e=this.getAbsoluteIndex(),t){var n;const s=super.lint(e,t),i="unescaped",l=C.lintConfig.getSeverity(i);if(l){const{firstChild:r}=this,a=(n=Sr.exec(r.text()))==null?void 0:n[0];try{if(a&&new URL(a).search){const o=Q(r,{start:e},i,"unescaped-query",l);o.startIndex=o.endIndex,o.startLine=o.endLine,o.startCol=o.endCol,o.endIndex++,o.endCol++,o.fix=It(o.startIndex,"{{=}}"),s.push(o)}}catch{}}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}}}}),Se,Xe=I({"src/atom.ts"(){"use strict";var e,t;V(),Se=(t=class extends z{constructor(i,l,n,r,a){super(i,n,r,a);B(this,e);E(this,e,l)}get type(){return v(this,e)}set type(i){E(this,e,i)}getAttribute(i){var l;return i==="invalid"?this.type==="converter-flag"&&!!((l=this.parentNode)!=null&&l.isInvalidFlag(this)):super.getAttribute(i)}},e=new WeakMap,t)}}),Qe,Ft=I({"src/syntax.ts"(){"use strict";var e,t;V(),Qe=(t=class extends z{constructor(i,l,n,r,a){super(i,n,r,a);B(this,e);E(this,e,l)}get type(){return v(this,e)}lint(i=this.getAbsoluteIndex()){return super.lint(i,!1)}},e=new WeakMap,t)}}),Ia={};ae(Ia,{TranscludeToken:()=>rt});var Ar,Ys,kr,rt,Na=I({"src/transclude.ts"(){"use strict";var e,t,s,i,l,n,Gt,La,o;he(),X(),Re(),ge(),qs(),qe(),G(),V(),Su(),Xe(),Ft(),Ar=[Oe,fs()],rt=(o=class extends(kr=z){constructor(d,c,f,p=[]){var T,O;let x;const A=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(d);A&&(x=Number(A[1]),d=d.replace(`\0${x}h`,p[x].toString().replace(/^\n/u,"")));super(void 0,f,p,{});B(this,n);Ce(this,"modifier","");B(this,e,"template");B(this,t,":");B(this,s,!1);B(this,i,new Map);B(this,l);const{parserFunction:[S,y],variable:$,functionHook:g}=f,h=(T=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(d))==null?void 0:T[0];if(h)this.setAttribute("modifier",h),d=d.slice(h.length);else if(d.includes(":")){const[L,...j]=d.split(":"),[W]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((O=j[0])!=null?O:"");this.setModifier(`${L}:${W}`)&&(d=j.join(":").slice(W.length))}const b=d.search(/[::]/u),w=d[b]===":",m=b!==-1;if(m||c.length===0&&!v(this,s)){const L=m?d.slice(0,b):d,j=m&&d.slice(b+1),W=Le(L),N=m?W.slice(W.search(/\S/u))+(w?":":""):W.trim(),R=N.toLowerCase(),J=Array.isArray(y),q=J?y.includes(N):Object.prototype.hasOwnProperty.call(y,N),F=!J&&q?y[N]:Object.prototype.hasOwnProperty.call(S,R)&&S[R],U=J&&q||!("functionHook"in f)||g.includes(F),H=J&&q||$.includes(F);if(m?F&&U:H){this.setAttribute("name",F||R.replace(/^#|:$/u,"")),E(this,e,"magic-word"),w&&E(this,t,":");const D=new Qe(L,"magic-word-name",f,p);if(super.insertAt(D),j!==!1&&c.unshift([j]),this.name==="invoke")for(let ee=0;ee<2;ee++){const ne=c.shift();if(!ne)break;const ue=new Se(ne.join("="),`invoke-${ee?"function":"module"}`,f,p);super.insertAt(ue)}}}if(this.type==="template"){const L=Le(d).trim();if(!this.normalizeTitle(L,10,{halfParsed:!0,temporary:!0}).valid)throw p.pop(),new SyntaxError("Invalid template name");const j=new Se(d,"template-name",f,p,{});super.insertAt(j)}typeof x=="number"&&(p[x]=void 0);const _=this.isTemplate();let k=1;for(let L=0;L<c.length;L++){const j=c[L];_||this.name==="switch"&&L>0||this.name==="tag"&&L>1||(j[0]=j.join("="),j.length=1),j.length===1&&(j.unshift(k),k++),this.insertAt(new Ca(...j,f,p))}this.seal("modifier")}get type(){return v(this,e)}get module(){return this.type==="magic-word"&&this.name==="invoke"?P(this,n,Gt).call(this).title:void 0}get function(){var d;return this.type==="magic-word"&&this.name==="invoke"?(d=this.childNodes[2])==null?void 0:d.text().trim():void 0}setModifier(d){const{parserFunction:[,,c,f]}=this.getAttribute("config"),p=Le(d).trim();if(d&&!p.endsWith(":"))return!1;const x=p.slice(0,-1).toLowerCase(),A=c.includes(x),S=f.includes(x);return v(this,s)&&A||!v(this,s)&&(S||!d)||(ve.running||this.length>1)&&(A||S||!d)?(this.setAttribute("modifier",d),E(this,s,A),!!d):!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"&&(E(this,l,P(this,n,Gt).call(this)),this.setAttribute("name",v(this,l).title))}toString(d){const{childNodes:c,length:f,firstChild:p,modifier:x,type:A}=this;return`{{${x}${A==="magic-word"?p.toString(d)+(f===1?"":v(this,t))+c.slice(1).map(S=>S.toString(d)).join("|"):super.toString(d,"|")}}}`}text(){const{childNodes:d,length:c,firstChild:f,modifier:p,type:x,name:A}=this;return x==="magic-word"&&A==="vardefine"?"":`{{${p}${x==="magic-word"?f.text()+(c===1?"":v(this,t))+ut(d.slice(1),"|"):super.text("|")}}}`}getAttribute(d){switch(d){case"padding":return this.modifier.length+2;case"title":return v(this,l);case"colon":return v(this,t);case"invalid":return this.type==="magic-word"&&this.name==="invoke"&&(this.length===2||!P(this,n,Gt).call(this).valid);default:return super.getAttribute(d)}}lint(d=this.getAbsoluteIndex(),c){const f=super.lint(d,c);if(!this.isTemplate())return f;const{type:p,childNodes:x,length:A}=this,S=new de(this,d),y=p==="magic-word";let $="no-ignored",g=C.lintConfig.getSeverity($,"fragment");if(y&&!P(this,n,Gt).call(this).valid)$="invalid-invoke",g=C.lintConfig.getSeverity($,"name"),g&&f.push(Q(x[1],S,$,"illegal-module",g));else if(g){const h=x[y?1:0],b=h.childNodes.findIndex(m=>m.type==="text"&&os(m.data).includes("#")),w=h.childNodes[b];if(w){const m=Q(h,S,$,"useless-fragment",g);m.suggestions=[Z(m,h.getRelativeIndex(b)+w.data.indexOf("#"))],f.push(m)}}if($="invalid-invoke",g=C.lintConfig.getSeverity($,"function"),g&&y&&A===2)return f.push(te(this,S,$,"missing-function",g)),f;if($="no-duplicate",g=C.lintConfig.getSeverity($,"parameter"),g){const h=this.getDuplicatedArgs().filter(([,w])=>!w[0].querySelector("ext")),b="duplicate-parameter";for(const[,w]of h)f.push(...w.map(m=>{const _=Q(m,S,$,b,g);return _.suggestions=[Z(_,-1)],_}))}return f}insertAt(d,c=this.length){return super.insertAt(d,c),d.anon?P(this,n,La).call(this,d):d.name&&this.getArgs(d.name,!1,!1).add(d),d}getAllArgs(){return this.childNodes.filter(Gs("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:d})=>d)}getArgs(d,c,f=!0){const p=String(d).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");let x;return v(this,i).has(p)?x=v(this,i).get(p):(x=new Set(this.getAllArgs().filter(({name:A})=>p===A)),v(this,i).set(p,x)),x}getDuplicatedArgs(){return[...v(this,i)].filter(([,{size:d}])=>d>1).map(([d,c])=>[d,[...c]])}getPossibleValues(){const{type:d,name:c,childNodes:f}=this;if(d==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let p,x;switch(c){case"if":case"ifexist":case"ifexpr":case"iferror":p=2;break;case"ifeq":p=3;break;case"switch":{const A=f.slice(2),S=A[A.length-1];x=[...A.filter(({anon:y})=>!y),...S!=null&&S.anon?[S]:[]].map(({lastChild:y})=>y);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}x!=null||(x=f.slice(p,p+2).map(({lastChild:A})=>A));for(let A=0;A<x.length;){const{length:S,0:y}=x[A].childNodes.filter($=>$.text().trim());if(S===0)x.splice(A,1);else if(S>1||y.type!=="magic-word")A++;else try{const $=y.getPossibleValues();x.splice(A,1,...$),A+=$.length}catch{A++}}return x}print(){const{childNodes:d,length:c,firstChild:f,modifier:p,type:x}=this;return`<span class="wpb-${x}${this.getAttribute("invalid")?" wpb-invalid":""}">{{${x==="magic-word"?us(p)+f.print()+(c===1?"":v(this,t))+Ct(d.slice(1),{sep:"|"}):(p?`<span class="wpb-magic-word">${us(p)}</span>`:"")+Ct(d,{sep:"|"})}}}</span>`}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,l=new WeakMap,n=new WeakSet,Gt=function(){const d=this.type==="template";return this.normalizeTitle(this.childNodes[d?0:1].text(),d?10:828,{temporary:!0})},La=function(d){const c=this.getAnonArgs(),f=typeof d!="number";for(let p=f?c.indexOf(d):d-1;p<c.length;p++){const x=c[p],{name:A}=x,S=String(p+1);(A!==S||x===d)&&(x.setAttribute("name",S),this.getArgs(S,!1,!1).add(x))}},o),Ys=re(kr),rt=ie(Ys,0,"TranscludeToken",Ar,rt),se(Ys,1,rt)}}),bs,Zs,ei,$r,_r,Tr,Cr,ti,si,fn,Au=I({"lib/text.ts"(){"use strict";var e,mn,s;he(),X(),Re(),G(),_a(),bs=String.raw`[${Ge}\t]*`,Zs=String.raw`[^\S\n]*`,ei=String.raw`<${Zs}(?:/${Zs})?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|(?:rfc|pmid)(?=[-::]?${bs}\d)|isbn(?=[-::]?${bs}(?:\d(?:${bs}|-)){6})`,$r=new RegExp(String.raw`${ei}|https?[:/]/+`,"giu"),_r=new RegExp(ei,"giu"),Tr=new Set(["attr-value","ext-link-text","link-text"]),Cr={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},ti=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{si=new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch{si=/\w/u}fn=(s=class extends nt{constructor(n){super();B(this,e);Ce(this,"data","");this.data=n}get type(){return"text"}toString(n){var r;return n&&!((r=this.parentNode)!=null&&r.getAttribute("built"))?Le(this.data):this.data}text(){return this.data}lint(n=this.getAbsoluteIndex(),r){var L,j,W;if(r===!1)return[];const{data:a,parentNode:o,nextSibling:u,previousSibling:d}=this;if(!o)throw new Error("An isolated text node cannot be linted!");const{type:c,name:f,parentNode:p}=o;if(c==="attr-value"){const{name:N,tag:R}=p;if(R==="ref"&&(N==="name"||N==="follow")||N==="group"&&(R==="ref"||R==="references")||R==="choose"&&(N==="before"||N==="after"))return[]}if(r!=null||(r=c==="free-ext-link"||c==="ext-link-url"||c==="ext-link-text"||c==="image-parameter"&&f==="link"||c==="attr-value"?_r:$r),a.search(r)===-1)return[];r.lastIndex=0;const x=[],A=u==null?void 0:u.type,S=u==null?void 0:u.name,y=d==null?void 0:d.type,$=this.getRootNode(),g=$.toString(),{ext:h,html:b,variants:w}=$.getAttribute("config"),{top:m,left:_}=$.posFromIndex(n),k=C.lintConfig["tag-like"],T=typeof k=="number"?new Set:new Set(Object.keys(k[1]).filter(N=>N!=="invalid"&&N!=="disallowed")),O=new Set(["onlyinclude","noinclude","includeonly",...h,...b[0],...b[1],...b[2],...T,...ti]);for(let N=r.exec(a);N;N=r.exec(a)){const[,R,J]=N;let{index:q,0:F}=N;if(J&&J!=="]"){const{length:we}=J;q+=we,F=F.slice(we)}F=F.toLowerCase();const[U]=F,H=U==="r"||U==="p"||U==="i",D=U==="{",ee=U==="}",ne=U==="[",ue=U==="]";let{length:Te}=F;if(U==="<"&&!O.has(R.toLowerCase())||ne&&c==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(a.slice(q+1))||u!=null&&u.is("ext")&&S==="nowiki"&&((L=u.innerText)!=null&&L.includes("]")))||H&&(!o.isPlain()||Tr.has(c)))continue;ue&&(q||Te>1)&&r.lastIndex--;let Be=n+q,Ze=Be+Te,fe,M;const le=g[Ze],be=g[Be-1],me=D||ne,_e=D&&be==="-"&&w.length>0,Ue=ee&&le==="-"&&w.length>0,Ae=ne&&A==="free-ext-link"&&!a.slice(q+1).trim()||ue&&y==="free-ext-link"&&!a.slice(0,q).includes("]");if(H)fe="lonely-http",F=F.toUpperCase(),M=C.lintConfig.getSeverity(fe,F);else if(U==="<"){fe="tag-like";let we;/^<\/?\s/u.test(F)||!/[\s/>]/u.test(le!=null?le:"")?we="invalid":T.has(R)?we=R:ti.has(R)&&!h.includes(R)&&(we="disallowed"),M=C.lintConfig.getSeverity(fe,we)}else if(_e||Ue)fe="lonely-bracket",M=C.lintConfig.getSeverity(fe,"converter"),_e&&q>0?(F="-{",q--,Be--,Te=2):Ue&&q<a.length-1&&(F="}-",Ze++,Te=2);else if(Ae)fe="lonely-bracket",M=C.lintConfig.getSeverity(fe,"extLink");else if(me||ee||ue)if(fe="lonely-bracket",Te>1||D&&le===U||ee&&be===U)M=C.lintConfig.getSeverity(fe,"double");else{if(!ne||c!=="ext-link-text"){const we=Cr[U],Vs=me?a.slice(q+1):a.slice(0,q);if(D&&((j=we.exec(Vs))==null?void 0:j[0])==="}"||ee&&((W=we.exec(Vs))==null?void 0:W[0])==="{")continue;if(!Vs.includes(U)){const lr=me?"nextSibling":"previousSibling";let tt=this[lr];for(;tt&&(tt.type!=="text"||!we.test(tt.data));)tt=tt[lr];if(tt&&we.exec(tt.data)[0]!==U)continue}}M=C.lintConfig.getSeverity(fe,"single")}else fe="lonely-http",M=C.lintConfig.getSeverity(fe);if(!M)continue;const gt=this.posFromIndex(q),{line:K,character:et}=cs(m,_,gt.top+1,gt.left),Pe={rule:fe,message:C.msg("lonely",H||U==="h"||_e||Ue?F:U),severity:M,startIndex:Be,endIndex:Ze,startLine:K,endLine:K,startCol:et,endCol:et+Te};if(U==="<")Pe.suggestions=[It(Be,"&lt;")];else if(U==="h"&&c!=="link-text"&&si.test(be||""))Pe.suggestions=[hs(Be)];else if(ne&&c==="ext-link-text"){const we=o.getAbsoluteIndex()+o.toString().length;Pe.suggestions=[It(we,"&#93;")]}else if(ue&&Ae){const we=n-d.toString().length;Pe.suggestions=[Os(we,"left-bracket","[")]}else H&&(Pe.suggestions=[...N[0]===F?[]:[Bn(Pe,F)],...le===":"||le===":"?[hs(Ze,1)]:[]]);x.push(Pe)}return x}replaceData(n){P(this,e,mn).call(this,n)}splitText(n){{const{parentNode:r,data:a}=this;if(!r)throw new Error("The text node to be split has no parent node!");const o=new s(a.slice(n));return ps(r,r.childNodes.indexOf(this)+1,0,[o]),this.setAttribute("data",a.slice(0,n)),o}this.lspError("AstText.splitText")}escape(){{const{parentNode:n}=this;if(!n)throw new Error("The text node to be escaped has no parent node!");const{TranscludeToken:r}=(Na(),Y(Ia)),a=n.getAttribute("config"),o=n.childNodes.indexOf(this)+1,u=f=>Math.max(this.data.lastIndexOf("=",f),this.data.lastIndexOf("|",f));let d=u();const c=()=>new r(this.data[d]==="="?"=":"!",[],a);for(;d>=0;d=u(d-1))d<this.data.length-1&&this.splitText(d+1),n.insertAt(ve.run(c),o),P(this,e,mn).call(this,this.data.slice(0,d))}}print(){return us(this.data)}},e=new WeakSet,mn=function(n){this.setAttribute("data",n)},s)}}),ct,jt=I({"mixin/hidden.ts"(){"use strict";ct=(e=!0,t=!0)=>s=>{class i extends s{text(){return""}lint(n){return e?[]:super.lint(n)}}return i}}}),We,Ke=I({"mixin/padded.ts"(){"use strict";We=({length:e})=>t=>{class s extends t{getAttribute(l){return l==="padding"?e:super.getAttribute(l)}}return s}}}),Ir,Nr,ii,Lr,De,Ws=I({"src/link/base.ts"(){"use strict";var e,t,s,i;X(),dt(),ge(),Ke(),qe(),G(),V(),Xe(),Ir=l=>l==="redirect-target"||l==="link",Nr=[Oe,We("[[")],De=(i=class extends(Lr=z){constructor(n,r,a,o=[],u="|"){super(void 0,a,o,{});B(this,e,!0);B(this,t);B(this,s);if(this.insertAt(new Se(n,"link-target",a,o,{})),r!==void 0){const d=new z(r,a,o,{});d.type="link-text",d.setAttribute("stage",$e-1),this.insertAt(d)}E(this,t,u)}get link(){return v(this,s)}get fragment(){return v(this,s).fragment}afterBuild(){E(this,s,this.getTitle()),v(this,t).includes("\0")&&E(this,t,this.buildFromStr(v(this,t),0)),this.setAttribute("name",v(this,s).title),super.afterBuild()}setAttribute(n,r){n==="bracket"?E(this,e,r):n==="title"?E(this,s,r):super.setAttribute(n,r)}toString(n){const r=super.toString(n,v(this,t));return v(this,e)?`[[${r}]]`:r}text(){const n=super.text("|");return v(this,e)?`[[${n}]]`:n}getAttribute(n){return n==="title"?v(this,s):super.getAttribute(n)}getGaps(n){return n===0?v(this,t).length:1}lint(n=this.getAbsoluteIndex(),r){const a=super.lint(n,r),{childNodes:[o,u],type:d}=this,{encoded:c,fragment:f}=v(this,s),p=new de(this,n);let x="unknown-page",A=C.lintConfig.getSeverity(x);if(A&&o.childNodes.some(({type:S})=>S==="template")&&a.push(Q(o,p,x,"template-in-link",A)),x="url-encoding",A=C.lintConfig.getSeverity(x),A&&c){const S=Q(o,p,x,"unnecessary-encoding",A);S.fix=Rn(S,o),a.push(S)}if(x="pipe-like",A=C.lintConfig.getSeverity(x,"link"),A&&(d==="link"||d==="category")){const S=u==null?void 0:u.childNodes.findIndex($=>$.type==="text"&&$.data.includes("|")),y=u==null?void 0:u.childNodes[S];if(y){const $=Q(u,p,x,"pipe-in-link",A),g=$.startIndex+u.getRelativeIndex(S);$.suggestions=[qn(g,y.data)],a.push($)}}if(x="no-ignored",A=C.lintConfig.getSeverity(x,"fragment"),A&&f!==void 0&&!Ir(d)){const S=Q(o,p,x,"useless-fragment",A),y=o.childNodes.findIndex(g=>g.type==="text"&&g.data.includes("#")),$=o.childNodes[y];$&&(S.fix=Z(S,o.getRelativeIndex(y)+$.data.indexOf("#"))),a.push(S)}return a}getTitle(n,r){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:r,temporary:n,decode:!0,selfLink:!0})}print(){return super.print(v(this,e)?{pre:"[[",post:"]]",sep:v(this,t)}:{sep:v(this,t)})}json(n,r=this.getAbsoluteIndex()){const a=super.json(void 0,r),{type:o,fragment:u}=this;return u!==void 0&&(o==="link"||o==="redirect-target")&&(a.fragment=u),a}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i),ii=re(Lr),De=ie(ii,0,"LinkBaseToken",Nr,De),se(ii,1,De)}}),Fr,ni,jr,Ee,ht=I({"src/nowiki/base.ts"(){"use strict";qe(),V(),Fr=[Oe],Ee=class extends(jr=z){get innerText(){return this.firstChild.data}constructor(e="",t,s){super(e,t,s)}},ni=re(jr),Ee=ie(ni,0,"NowikiBaseToken",Fr,Ee),se(ni,1,Ee)}}),Er,ri,Rr,pe,Ye=I({"src/nowiki/noinclude.ts"(){"use strict";jt(),ht(),Er=[ct()],pe=class extends(Rr=Ee){get type(){return"noinclude"}toString(e){return e?"":super.toString()}},ri=re(Rr),pe=ie(ri,0,"NoincludeToken",Er,pe),se(ri,1,pe)}}),Fa,ku=I({"src/link/redirectTarget.ts"(){"use strict";X(),G(),Ws(),Ye(),Fa=class extends De{get type(){return"redirect-target"}constructor(e,t,s,i){super(e,void 0,s,i),t!==void 0&&this.insertAt(new pe(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=C.lintConfig.getSeverity(s,"redirect");if(i&&this.length===2){const l=Q(this.lastChild,{start:e},s,"useless-link-text",i);l.startIndex--,l.startCol--,l.fix=Z(l),t.push(l)}return t}}}}),Pr,li,Or,Vt,$u=I({"src/redirect.ts"(){"use strict";var e,t,s;jt(),qe(),V(),Ft(),ku(),Pr=[ct(!1,!1),Oe],Vt=(s=class extends(Or=z){constructor(l,n,r,a,o,u,d=[]){super(void 0,u,d);B(this,e);B(this,t);E(this,e,l),E(this,t,o),this.append(new Qe(n,"redirect-syntax",u,d),new Fa(r,a==null?void 0:a.slice(1),u,d))}get type(){return"redirect"}getAttribute(l){return l==="padding"?v(this,e).length:super.getAttribute(l)}toString(l){return v(this,e)+super.toString(l)+v(this,t)}lint(l=this.getAbsoluteIndex()){const n=l+v(this,e).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",n),this.lastChild.lint(n)}print(){return super.print({pre:v(this,e),post:v(this,t)})}},e=new WeakMap,t=new WeakMap,s),li=re(Or),Vt=ie(li,0,"RedirectToken",Pr,Vt),se(li,1,Vt)}}),ja={};ae(ja,{parseRedirect:()=>Ea});var Ea,_u=I({"parser/redirect.ts"(){"use strict";G(),$u(),Ea=(e,t,s)=>{var l;(l=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&&C.normalizeTitle(i[3],0,!1,t,{halfParsed:!0,temporary:!0,decode:!0}).valid?(e=`\0${s.length}o${e.slice(i[0].length)}`,new Vt(...i.slice(1),t,s),e):!1}}}),Br,ai,qr,Qt,Tu=I({"src/onlyinclude.ts"(){"use strict";Ke(),qe(),V(),Br=[Oe,We("<onlyinclude>")],Qt=class extends(qr=z){get type(){return"onlyinclude"}toString(e){return`<onlyinclude>${super.toString(e)}</onlyinclude>`}isPlain(){return!0}print(){return super.print({pre:'<span class="wpb-ext">&lt;onlyinclude&gt;</span>',post:'<span class="wpb-ext">&lt;/onlyinclude&gt;</span>'})}},ai=re(qr),Qt=ie(ai,0,"OnlyincludeToken",Br,Qt),se(ai,1,Qt)}}),Wr,oi,Ur,lt,zn=I({"src/tagPair/index.ts"(){"use strict";var e,t;qs(),qe(),V(),Wr=[fs(),Oe],lt=(t=class extends(Ur=z){constructor(i,l,n,r,a,o=[]){super(void 0,a);B(this,e);Ce(this,"closed");Ce(this,"selfClosing");this.setAttribute("name",i.toLowerCase()),E(this,e,[i,r||i]),this.closed=r!=="",this.selfClosing=r===void 0,this.append(l,n);const u=typeof l=="string"?-1:o.indexOf(l);o.splice(u===-1?1/0:u,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(i){const{selfClosing:l,firstChild:n,lastChild:r}=this,[a,o]=v(this,e);return l?`<${a}${n.toString(i)}/>`:`<${a}${n.toString(i)}>${r.toString(i)}${this.closed?`</${o}>`:""}`}text(){const[i,l]=v(this,e);return this.selfClosing?`<${i}${this.firstChild.text()}/>`:`<${i}${super.text(">")}${this.closed?`</${l}>`:""}`}getAttribute(i){return i==="padding"?v(this,e)[0].length+1:super.getAttribute(i)}print(){const[i,l]=v(this,e);return super.print(this.selfClosing?{pre:`&lt;${i}`,post:"/&gt;"}:{pre:`&lt;${i}`,sep:"&gt;",post:this.closed?`&lt;/${l}&gt;`:""})}},e=new WeakMap,t),oi=re(Ur),lt=ie(oi,0,"TagPairToken",Wr,lt),se(oi,1,lt)}}),Ra,Cu=I({"src/tagPair/translate.ts"(){"use strict";var e,Pa,s;V(),zn(),Ft(),Ye(),Ra=(s=class extends lt{constructor(l,n,r,a=[]){const o=new Qe(l,"translate-attr",r,a);n=n==null?void 0:n.replace(/(<tvar\|[^>]+>)([\s\S]*?)(<\/>)/gu,(d,c,f,p)=>(new pe(c,r,a),new pe(p,r,a),`\0${a.length-1}n${f}\0${a.length}n`)).replace(/(<tvar\s+name\s*=(?:\s*(?:(["'])[\s\S]*?\2|[^"'\s>]+))?\s*>)([\s\S]*?)(<\/tvar\s*>)/giu,(d,c,f,p,x)=>(new pe(c,r,a),new pe(x,r,a),`\0${a.length-1}n${p}\0${a.length}n`));const u=new z(n,r,a);u.type="translate-inner";super("translate",o,u,"translate",r,a);B(this,e);this.seal("closed",!0),this.seal("selfClosing",!0)}get type(){return"translate"}toString(l){return l?this.lastChild.toString(!0):super.toString()}text(){return this.lastChild.text()}print(){return`<span class="wpb-ext">&lt;translate${P(this,e,Pa).call(this)?'<span class="wpb-ext-attrs"> <span class="wpb-ext-attr"><span class="wpb-attr-key">nowrap</span></span></span>':""}&gt;${this.lastChild.print({class:"ext-inner"})}&lt;/translate&gt;</span>`}},e=new WeakSet,Pa=function(){return this.firstChild.toString()===" nowrap"},s)}}),Mr,ui,zr,Jt,Iu=I({"src/tagPair/include.ts"(){"use strict";X(),ge(),jt(),G(),zn(),Mr=[ct(!1)],Jt=class extends(zr=lt){get type(){return"include"}constructor(e,t="",s,i,l,n){super(e,t,s!=null?s:"",s===void 0||i!=null?i:"",l,n)}toString(e){return e?"":super.toString()}lint(e=this.getAbsoluteIndex()){const t=[],{firstChild:s,closed:i,name:l}=this,n=new de(this,e),r=["no-ignored","unclosed-comment"],a=r.map(o=>C.lintConfig.getSeverity(o,"include"));if(a[0]&&s.data.trim()){const o=Q(s,n,r[0],"useless-attribute",a[0]);o.suggestions=[Z(o)],t.push(o)}if(a[1]&&!i){const o=te(this,n,r[1],C.msg("unclosed",`<${l}>`),a[1]);o.suggestions=[Ve(o.endIndex,`</${l}>`)],t.push(o)}return t}},ui=re(zr),Jt=ie(ui,0,"IncludeToken",Mr,Jt),se(ui,1,Jt)}}),Us,Hn=I({"mixin/attributesParent.ts"(){"use strict";Us=(e=0)=>t=>{var i,xn;class s extends t{constructor(){super(...arguments);B(this,i)}hasAttr(a){return P(this,i,xn).call(this).hasAttr(a)}getAttr(a){return P(this,i,xn).call(this).getAttr(a)}}return i=new WeakSet,xn=function(){return this.childNodes[e]},s}}}),oe,di,ci,qt,ws,hi,st,gi,pi,fi,ys,mi,Fe,Dn,Gn,Vn,Oa,Ba=I({"util/sharable.ts"(){"use strict";oe=new Set(["align"]),di=new Set(["cite"]),ci=new Set(["cite","datetime"]),qt=new Set(["width"]),ws=new Set(["axis","align","bgcolor","height","width","valign"]),hi=new Set([...ws,"abbr","headers","scope","rowspan","colspan"]),st=new Set(["type"]),gi=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),pi=new Set(["clear"]),fi=new Set(["bgcolor","align","valign"]),ys=new Set(["qid","forcemathmode","type","display"]),mi=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),Fe=new Set,Dn=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"]),Gn={div:oe,h1:oe,h2:oe,h3:oe,h4:oe,h5:oe,h6:oe,blockquote:di,q:di,p:oe,br:pi,pre:qt,ins:ci,del:ci,ul:st,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...gi,"border"]),caption:oe,tr:fi,td:hi,th:hi,font:new Set(["size","color","face"]),hr:qt,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:st,poem:oe,categorytree:oe,combooption:oe,math:Fe,chem:Fe,ce:Fe,img:new Set(["alt","src","width","height","loading","srcset"])},Vn={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:Fe,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:Fe,inputbox:Fe,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:Fe,poll:new Set(["id","show-results-before-voting"]),sm2:st,flashmp3:st,score:new Set(["line_width_inches","lang","override_midi","raw","note-language","override_audio","override_ogg","sound","vorbis"]),seo:new Set(["title","title_mode","title_separator","keywords","description","robots","google_bot","image","image_width","image_height","image_alt","type","site_name","locale","section","author","published_time","twitter_site"]),tab:new Set(["nested","name","index","class","block","inline","openname","closename","collapsed","dropdown","style","bgcolor","container","id","title"]),tabs:new Set(["plain","class","container","id","title","style"]),combobox:new Set(["placeholder","value","id","class","text","dropdown","style"]),math:new Set([...ys,"chem"]),chem:ys,ce:ys,hiero:Fe,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:mi,syntaxhighlight:mi,templatedata:Fe,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:Fe},Oa={table:gi,td:new Set([...ws,"scope"]),th:ws,br:pi,caption:oe,div:oe,hr:qt,h1:oe,h2:oe,h3:oe,h4:oe,h5:oe,h6:oe,li:st,p:oe,pre:qt,tr:fi,ul:st}}}),Hr,Dr,Gr,Vr,Cs,Nu=I({"src/attribute.ts"(){"use strict";var e,t,s,i,l,vn,r;X(),he(),dt(),Ba(),ge(),G(),V(),Xe(),Hr=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,Dr=/(?:^|\s|\*\/)(?:javascript|vbscript)(?:\W|$)/iu,Gr=new Set(["ext","arg","magic-word","template"]),Vr=new Set(["about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),Cs=(r=class extends z{constructor(o,u,d,c="",f,p=[],x=C.getConfig(),A=[]){const S=new Se(d,"attr-key",x,A);let y;if(d==="title"||u==="img"&&d==="alt")y=new z(f,x,A,{}),y.type="attr-value",y.setAttribute("stage",$e-1);else if(u==="gallery"&&d==="caption"||u==="choose"&&(d==="before"||d==="after")){const $={...x,excludes:[...x.excludes,"heading","html","table","hr","list"]};y=new z(f,$,A,{}),y.type="attr-value",y.setAttribute("stage",1)}else y=new Se(f,"attr-value",x,A,{});super(void 0,x,A);B(this,l);B(this,e);B(this,t);B(this,s);B(this,i);E(this,e,o),this.append(S,y),E(this,s,c),E(this,i,[...p]),E(this,t,u),this.setAttribute("name",Tt(Le(d)))}get type(){return v(this,e)}get tag(){return v(this,t)}get balanced(){return!v(this,s)||v(this,i)[0]===v(this,i)[1]}afterBuild(){v(this,s).includes("\0")&&E(this,s,this.buildFromStr(v(this,s),0)),this.parentNode&&E(this,t,this.parentNode.name),this.setAttribute("name",Tt(this.firstChild.text())),super.afterBuild()}toString(o){const[u="",d=""]=v(this,i);return v(this,s)?super.toString(o,v(this,s)+u)+d:this.firstChild.toString(o)}text(){return v(this,s)?`${super.text(`${v(this,s).trim()}"`)}"`:this.firstChild.text()}getGaps(){var o,u;return v(this,s)?v(this,s).length+((u=(o=v(this,i)[0])==null?void 0:o.length)!=null?u:0):0}lint(o=this.getAbsoluteIndex(),u){var h;const d=super.lint(o,u),{balanced:c,firstChild:f,lastChild:p,name:x,tag:A}=this,S=new de(this,o),y=["unclosed-quote","obsolete-attr"],$=y.map(b=>C.lintConfig.getSeverity(b,x));if($[0]&&!c){const b=Q(p,S,y[0],C.msg("unclosed","quotes"),$[0]);b.startIndex--,b.startCol--,b.suggestions=[Ve(b.endIndex,v(this,i)[0])],d.push(b)}const g=P(this,l,vn).call(this,o,S);return g&&d.push(g),$[1]&&((h=Oa[A])!=null&&h.has(x))&&d.push(Q(f,S,y[1],"obsolete-attribute",$[1])),d}getValue(){return v(this,s)?this.lastChild.text().trim():this.type==="ext-attr"||""}escape(){E(this,s,"{{=}}"),this.lastChild.escape()}getAttribute(o){return o==="invalid"?P(this,l,vn).call(this):super.getAttribute(o)}print(){const[o="",u=""]=v(this,i);return v(this,s)?super.print({sep:us(v(this,s))+o,post:u}):super.print()}json(o,u=this.getAbsoluteIndex()){const d=super.json(void 0,u);return d.tag=this.tag,d}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,l=new WeakSet,vn=function(o,u){const{firstChild:d,lastChild:c,type:f,name:p,tag:x,parentNode:A}=this,S=!c.childNodes.some(({type:w})=>Gr.has(w)),y=this.getValue(),$=Vn[x],g=Gn[x],{length:h}=this.toString();let b="illegal-attr";if(!($!=null&&$.has(p))&&!(g!=null&&g.has(p))&&(f==="ext-attr"?$||g:!/\{\{[^{]+\}\}/u.test(p))&&(f==="ext-attr"&&!g||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(p)&&(x==="meta"||x==="link"||!Dn.has(p)))||(p==="itemtype"||p==="itemid"||p==="itemref")&&!(A!=null&&A.hasAttr("itemscope"))){if(o===void 0)return!0;const w=C.lintConfig.getSeverity(b,"unknown");if(w){const m=Q(d,u,b,"illegal-attribute-name",w);return m.suggestions=[Z(o,h)],m}}else if(p==="style"&&typeof y=="string"&&Hr.test(y)){if(o===void 0)return!0;b="insecure-style";const w=C.lintConfig.getSeverity(b);return w&&Q(c,u,b,"insecure-style",w)}else if(p==="tabindex"&&typeof y=="string"&&y!=="0"){if(o===void 0)return!0;const w=C.lintConfig.getSeverity(b,"tabindex");if(w){const m=Q(c,u,b,"nonzero-tabindex",w);return m.suggestions=[Z(o,h),je(m,"0 tabindex","0")],m}}else if(S&&f!=="ext-attr"){const w=Wn(x,p),m=String(y).toLowerCase();if(w.length>0&&w.every(_=>_!==m)){if(o===void 0)return!0;const _=C.lintConfig.getSeverity(b,"value");return _&&Q(c,u,b,"illegal-attribute-value",_)}}else if(typeof y=="string"&&((/^xmlns:[\w:.-]+$/u.test(p)||Vr.has(p))&&Dr.test(y)||S&&(p==="href"||x==="img"&&p==="src")&&!new RegExp(String.raw`^(?:${this.getAttribute("config").protocol}|//)\S+$`,"iu").test(y))){if(o===void 0)return!0;const w=C.lintConfig.getSeverity(b,"value");return w&&Q(c,u,b,"illegal-attribute-value",w)}return!1},r)}}),xi,Qr,vi,Ms,Qn=I({"src/attributes.ts"(){"use strict";var e,t,Is,i;X(),he(),ge(),G(),V(),Xe(),Nu(),xi=l=>l.slice(0,-1),Qr=l=>`${xi(l)}-dirty`;try{vi=new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch{vi=/[^\W_]/u}Ms=(i=class extends z{constructor(n,r,a,o,u=[]){super(void 0,o,u,{});B(this,t);B(this,e);if(E(this,e,r),this.setAttribute("name",a),n){const d=/([^\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 c="",f=d.exec(n),p=0;const x=()=>{c&&(super.insertAt(new Se(c,Qr(r),o,u,{})),c="")};for(;f;){const{index:A,0:S,1:y,2:$,3:g,4:h,5:b,6:w}=f;if(c+=n.slice(p,A),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(Le(y).trim())){const m=h!=null?h:w,_=[g,b],k=new Cs(xi(r),a,y,$,m,_,o,u);x(),super.insertAt(k)}else c+=S;({lastIndex:p}=d),f=d.exec(n)}c+=n.slice(p),x()}}get type(){return v(this,e)}afterBuild(){const{parentNode:n}=this;n!=null&&n.is("td")&&this.setAttribute("name",n.subtype),super.afterBuild()}getAttrTokens(n){return this.childNodes.filter(r=>r instanceof Cs&&(!n||r.name===Tt(n)))}hasAttr(n){return this.getAttrTokens(n).length>0}getAttrToken(n){const r=this.getAttrTokens(n);return r[r.length-1]}getAttr(n){var r;return(r=this.getAttrToken(n))==null?void 0:r.getValue()}lint(n=this.getAbsoluteIndex(),r){const a=super.lint(n,r),{parentNode:o,childNodes:u}=this,d=new Map,c=new Set,f=new de(this,n),p=["no-ignored","no-duplicate"],x=["closingTag","invalidAttributes","nonWordAttributes"].map(S=>C.lintConfig.getSeverity(p[0],S));if(x[0]&&P(this,t,Is).call(this)){const S=te(this,f,p[0],"attributes-of-closing-tag",x[0]),y=o.getAbsoluteIndex();S.suggestions=[Z(S),Pn(y)],a.push(S)}for(const S of u)if(S instanceof Cs){const{name:y}=S;d.has(y)?(c.add(y),d.get(y).push(S)):d.set(y,[S])}else{const y=S.text().trim(),$=x[vi.test(y)?1:2];if(y&&$){const g=Q(S,f,p[0],"invalid-attribute",$);g.suggestions=[Z(g,0," ")],a.push(g)}}const A=C.lintConfig.getSeverity(p[1],"attribute");if(A&&c.size>0)for(const S of c){const y=d.get(S).map($=>{const g=$.getValue();return[$,g===!0?"":g]});a.push(...y.map(([$,g],h)=>{const b=Q($,f,p[1],C.msg("duplicate-attribute",S),A),w=Z(b);return!g||y.slice(0,h).some(([,m])=>m===g)?b.fix=w:b.suggestions=[w],b}))}return a}getAttribute(n){return n==="invalid"?P(this,t,Is).call(this):super.getAttribute(n)}print(){return this.toString()?`<span class="wpb-${this.type}${P(this,t,Is).call(this)?" wpb-invalid":""}">${this.childNodes.map(n=>n.print(n instanceof Se?{class:n.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}},e=new WeakMap,t=new WeakSet,Is=function(){const{parentNode:n}=this;return(n==null?void 0:n.type)==="html"&&n.closing&&this.text().trim()!==""},i)}}),qa={};ae(qa,{PreToken:()=>Wa});var Wa,Lu=I({"src/pre.ts"(){"use strict";dt(),V(),Ye(),Wa=class extends z{get type(){return"ext-inner"}constructor(e,t,s=[]){if(e){const i=/<nowiki>/giu,l=/<\/nowiki>/giu,{length:n}=i.source;let r=i.exec(e);r&&(l.lastIndex=r.index+n);let a=l.exec(e),o=0,u="";for(;r&&a;)new pe(r[0],t,s),new pe(a[0],t,s),u+=`${e.slice(o,r.index)}\0${s.length-1}n${e.slice(r.index+n,a.index)}\0${s.length}n`,o=a.index+n+1,i.lastIndex=o,r=i.exec(e),r&&(l.lastIndex=r.index+n),a=l.exec(e);e=u+e.slice(o)}super(e,t,s,{}),this.setAttribute("stage",$e-1)}isPlain(){return!0}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*\/\s*(pre)\b/giu)}}}}),zs,Jn=I({"mixin/multiLine.ts"(){"use strict";zs=e=>{class t extends e{toString(i){return super.toString(i,`
1
+ "use strict";(()=>{var ou=Object.defineProperty;var rr=e=>{throw TypeError(e)};var au=(e,t,s)=>t in e?ou(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var uu=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ie=(e,t,s)=>au(e,typeof t!="symbol"?t+"":t,s),Qs=(e,t,s)=>t.has(e)||rr("Cannot "+s);var v=(e,t,s)=>(Qs(e,t,"read from private field"),s?s.call(e):t.get(e)),B=(e,t,s)=>t.has(e)?rr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),E=(e,t,s,i)=>(Qs(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),P=(e,t,s)=>(Qs(e,t,"access private method"),s);var lr=(e,t,s,i)=>({set _(l){E(e,t,l,s)},get _(){return v(e,t,i)}});var ud=uu((cd,lu)=>{var du=Object.create,Nt=Object.defineProperty,po=Object.getOwnPropertyDescriptor,In=Object.getOwnPropertyNames,cu=Object.prototype.hasOwnProperty,fo=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Lt=e=>{throw TypeError(e)},mo=(e,t,s)=>t in e?Nt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,or=(e,t)=>Nt(e,"name",{value:t,configurable:!0}),I=(e,t)=>function(){return e&&(t=(0,e[In(e)[0]])(e=0)),t},xo=(e,t)=>function(){return t||(0,e[In(e)[0]])((t={exports:{}}).exports,t),t.exports},oe=(e,t)=>{for(var s in t)Nt(e,s,{get:t[s],enumerable:!0})},hu=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of In(t))!cu.call(e,l)&&l!==s&&Nt(e,l,{get:()=>t[l],enumerable:!(i=po(t,l))||i.enumerable});return e},Y=e=>hu(Nt({},"__esModule",{value:!0}),e),re=e=>{var t;return[,,,du((t=e==null?void 0:e[fo("metadata")])!=null?t:null)]},vo=["class","method","getter","setter","accessor","field","value","get","set"],Ht=e=>e!==void 0&&typeof e!="function"?Lt("Function expected"):e,gu=(e,t,s,i,l)=>({kind:vo[e],name:t,metadata:i,addInitializer:n=>s._?Lt("Already initialized"):l.push(Ht(n||null))}),Nn=(e,t)=>mo(t,fo("metadata"),e[3]),se=(e,t,s,i)=>{for(var l=0,n=e[t>>1],r=n&&n.length;l<r;l++)t&1?n[l].call(s):i=n[l].call(s,i);return i},ie=(e,t,s,i,l,n)=>{var r,o,a,d,u,c=t&7,p=!!(t&8),m=!!(t&16),f=c>3?e.length+1:c?p?1:2:0,_=vo[c+5],S=c>3&&(e[f-1]=[]),w=e[f]||(e[f]=[]),A=c&&(!m&&!p&&(l=l.prototype),c<5&&(c>3||!m)&&po(c<4?l:{get[s](){return ce(this,n)},set[s](h){return ke(this,n,h)}},s));c?m&&c<4&&or(n,(c>2?"set ":c>1?"get ":"")+s):or(l,s);for(var g=i.length-1;g>=0;g--)d=gu(c,s,a={},e[3],w),c&&(d.static=p,d.private=m,u=d.access={has:m?h=>fu(l,h):h=>s in h},c^3&&(u.get=m?h=>(c^1?ce:un)(h,l,c^4?n:A.get):h=>h[s]),c>2&&(u.set=m?(h,b)=>ke(h,l,b,c^4?n:A.set):(h,b)=>h[s]=b)),o=(0,i[g])(c?c<4?m?n:A[_]:c>4?void 0:{get:A.get,set:A.set}:l,d),a._=1,c^4||o===void 0?Ht(o)&&(c>4?S.unshift(o):c?m?n=o:A[_]=o:l=o):typeof o!="object"||o===null?Lt("Object expected"):(Ht(r=o.get)&&(A.get=r),Ht(r=o.set)&&(A.set=r),Ht(r=o.init)&&S.unshift(r));return c||Nn(e,l),A&&Nt(l,s,A),m?c^4?n:A:l},pu=(e,t,s)=>mo(e,typeof t!="symbol"?t+"":t,s),Ln=(e,t,s)=>t.has(e)||Lt("Cannot "+s),fu=(e,t)=>Object(t)!==t?Lt('Cannot use the "in" operator on this value'):e.has(t),ce=(e,t,s)=>(Ln(e,t,"read from private field"),s?s.call(e):t.get(e)),He=(e,t,s)=>t.has(e)?Lt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),ke=(e,t,s,i)=>(Ln(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),un=(e,t,s)=>(Ln(e,t,"access private method"),s),mu=(e,t,s,i)=>({set _(l){ke(e,t,l,s)},get _(){return ce(e,t,i)}}),bo,Ps,Fn=I({"base.ts"(){"use strict";bo=(()=>{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})(),Ps=(()=>{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 Le(e,t,s){return s===1?e.replace(/\0(\d+)g\x7F/gu,(i,l)=>Le(String(t[l]),t,2)):s===2?e.replace(/\0(\d+)n\x7F/gu,(i,l)=>String(t[l])):e.replace(/\0(\d+)\x7F/gu,(i,l)=>t[l])}var Ge,Js,$t,_t,Tt,pt,os,_e,ut,ar,ur,as,wo,dr,cr,us,Ct,he=I({"util/string.ts"(){"use strict";Ge=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,Js=String.raw`[^[\]<>"\0-\x1F\x7F${Ge}\uFFFD]`,$t=String.raw`(?:\[[\da-f:.]+\]|${Js})`,_t=String.raw`(?:${Js}|\0\d+[cn!~]\x7F)*`,Tt=e=>e.trim().toLowerCase(),pt=(e,t)=>s=>s.replace(e,t),os=pt(/[\0\x7F]|\r$/gmu,""),_e=pt(/\0\d+[cn]\x7F/gu,""),ut=(e,t="")=>e.map(s=>typeof s=="string"?s:s.text()).join(t),ar={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},ur=pt(/&(?:#(\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)):ar[s.toLowerCase()]),as=e=>ur(e),wo=pt(/&#(\d+|x[\da-f]+);/giu,(e,t)=>String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t))),dr={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},cr=e=>pt(e,t=>`&${dr[t]};`),us=cr(/[&<>]/gu),Ct=(e,t={})=>{const{pre:s="",post:i="",sep:l=""}=t;return s+e.map(n=>n.print()).join(l)+i}}}),xu=xo({"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}}}),vu=xo({"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:[]}}}),$e,yo,dn,dt=I({"util/constants.ts"(){"use strict";$e=11,yo=xu(),dn=vu()}});function ot(e){const t=new Map,s=new WeakMap;return i=>{const l=typeof i=="string"?t:s;if(l.has(i)){const r=l.get(i);return r.lastIndex=0,r}const n=e(i);return l.set(i,n),n}}var ds,So,hr,Ao,ko,Je=I({"../common/dist/index.mjs"(){"use strict";ds=e=>decodeURIComponent(e.replace(/%(?![\da-f]{2})/giu,"%25")),So=e=>Math.round(e*255).toString(16).padStart(2,"0"),hr=(()=>{const e=String.raw`#(?:[\da-f]{3,4}|(?:[\da-f]{2}){3,4})(?![\p{L}\p{N}_])`,t=String.raw`(?:\d*\.)?\d+%?`,s=String.raw`(?:\d*\.)?\d+(?:deg|grad|rad|turn)?`,i=String.raw`rgba?\(\s*(?:${String.raw`${new Array(3).fill(t).join(String.raw`\s+`)}(?:\s*\/\s*${t})?`}|${String.raw`${new Array(3).fill(t).join(String.raw`\s*,\s*`)}(?:\s*,\s*${t})?`})\s*\)`,l=String.raw`hsla?\(\s*(?:${String.raw`${s}\s+${t}\s+${t}(?:\s*\/\s*${t})?`}|${String.raw`${s}${String.raw`\s*,\s*(?:\d*\.)?\d+%`.repeat(2)}(?:\s*,\s*${t})?`})\s*\)`;return{full:new RegExp(String.raw`(^|[^\p{L}\p{N}_])(${e}|${i}|${l})`,"giu"),rgb:new RegExp(String.raw`(^|[^\p{L}\p{N}_])(${e}|${i})`,"giu")}})(),Ao=(e,t=!0)=>{const s=[],i=hr[t?"full":"rgb"];i.lastIndex=0;let l=i.exec(e),n=0;for(;l;){const r=l.index+l[1].length;r>n&&s.push([e.slice(n,r),n,r,!1]),{lastIndex:n}=i,s.push([l[2],r,n,e[r-1]!=="&"||!/^#\d+$/u.test(l[2])]),l=i.exec(e)}return e.length>n&&s.push([e.slice(n),n,e.length,!1]),s},ko=ot}}),de,ge=I({"lib/rect.ts"(){"use strict";var e,t,s,i,cn,n;de=(n=class{constructor(r,o){B(this,i);B(this,e);B(this,t);B(this,s);E(this,e,r),E(this,t,o)}get start(){return v(this,t)}get top(){return P(this,i,cn).call(this).top}get left(){return P(this,i,cn).call(this).left}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakSet,cn=function(){var r;return(r=v(this,s))!=null||E(this,s,v(this,e).getRootNode().posFromIndex(v(this,t))),v(this,s)},n)}}),gr,pr,rs,cs,Xs,Q,te,je,Os,Z,jn,Ve,En,Rn,Pn,hs,It,On,at,Bn,X=I({"util/lint.ts"(){"use strict";Je(),Re(),ge(),G(),gr=new Set(["tr","td","th","caption"]),pr=new Set(["Template:!!","Template:!-"]),rs=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")&&pr.has(t.name)||t.is("html")&&gr.has(t.name))return!1;if(t.is("arg"))return t.length>1&&rs(t.childNodes[1]);if(t.is("magic-word"))try{const s=t.getPossibleValues().map(rs);return s.includes(2)?2:s.includes(1)&&1}catch{}return t.is("template")||t.is("magic-word")&&t.name==="invoke"?1:2},cs=(e,t,s,i)=>({line:e+s-1,character:(s===1?t:0)+i}),Xs=e=>(t,s,i,l,n="error")=>{const{start:r}=s,{top:o,left:a}=s instanceof de?s:new de(t,r),{offsetHeight:d,offsetWidth:u}=t,{startIndex:c,startLine:p,startCol:m}=e(t,r,o,a),{line:f,character:_}=cs(p,m,d,u);return{rule:i,message:C.msg(l),severity:n,startIndex:c,endIndex:c+t.toString().length,startLine:p,endLine:f,startCol:m,endCol:_}},Q=Xs((e,t,s,i)=>{const l=e.getRelativeIndex(),{top:n,left:r}=e.parentNode.posFromIndex(l);return{startIndex:t+l,startLine:s+n,startCol:n?r:i+r}}),te=Xs((e,t,s,i)=>({startIndex:t,startLine:s,startCol:i})),je=(e,t,s,i=0)=>({desc:C.msg(t),range:[e.startIndex+i,e.endIndex],text:s}),Os=(e,t,s)=>({desc:C.msg(t),range:[e,e],text:s}),Z=(e,t=0,s="")=>typeof e=="number"?{desc:C.msg("remove"),range:[e,e+t],text:s}:je(e,"remove",s,t),jn=(e,t)=>je(e,"decode",ds(t.text().replace(/%(?=21|3[ce]|5[bd]|7[b-d])/giu,"%25"))),Ve=(e,t,s=0)=>({desc:C.msg("close"),range:[e+s,e],text:t}),En=e=>({desc:C.msg("open"),range:[e+1,e+2],text:""}),Rn=(e,t)=>je(e,"comment",`<!--${t}-->`),Pn=(e,t)=>je(e,"uppercase",t.toUpperCase()),hs=(e,t=0)=>({desc:C.msg("whitespace"),range:[e,e+t],text:" "}),It=(e,t,s=1)=>({desc:C.msg("escape"),range:[e,e+s],text:t.repeat(s)}),On=(e,t)=>({desc:C.msg("escape"),range:[e,e+t.length],text:t.replace(/\|/gu,"&#124;")}),at=(e,t,s,i)=>{if(e&&(i||C.viewOnly&&e[0]===ve.rev))return e[1];const l=t();return(i||C.viewOnly)&&s([ve.rev,l]),l},Bn=(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"]:[]}}),fr,qn,$o=I({"parser/selector.ts"(){"use strict";fr=(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},qn=(e,t,s)=>{const i=e.split(",");return({type:l,name:n})=>i.some(r=>fr(r.trim(),l,n))}}}),Bs,Wn=I({"mixin/cached.ts"(){"use strict";X(),Bs=(e=!0)=>t=>{const s=new WeakMap;return function(...i){return at(s.get(this),()=>t.apply(this,i),l=>{s.set(this,l)},e)}}}}),_o,bu=I({"mixin/nodeLike.ts"(){"use strict";_o=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}}}),mr,xr,xs,Et,Rt,vs,Pt,Ot,Bt,nt,To=I({"lib/node.ts"(){"use strict";X(),Re(),Wn(),bu(),G(),xr=[_o],mr=[Bs(!1)],nt=class{constructor(){se(Bt,5,this),pu(this,"childNodes",[]),He(this,xs),He(this,Et),He(this,Rt),He(this,vs),He(this,Pt),He(this,Ot,{})}get parentNode(){return ce(this,xs)}get nextSibling(){return ce(this,Et)}get previousSibling(){return ce(this,Rt)}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":ke(this,xs,t),t||(ke(this,Et,void 0),ke(this,Rt,void 0));break;case"nextSibling":ke(this,Et,t);break;case"previousSibling":ke(this,Rt,t);break;case"aIndex":C.viewOnly&&ke(this,Pt,[ve.rev,t]);break;default:this[e]=t}}getRootNode(){return at(ce(this,vs),()=>{var e,t;return(t=(e=this.parentNode)==null?void 0:e.getRootNode())!=null?t:this},e=>{const[,t]=e;t.type==="root"&&ke(this,vs,e)})}indexFromPos(e,t){{if(e<0||t<0)return;const s=this.getLines();if(e>=s.length)return;const[,i,l]=s[e],n=i+t;return n>l?void 0:n}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(([,,l])=>e<=l);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 at(ce(this,Ot)[e],()=>{const{childNodes:t}=this,s=e+(e<0?t.length:0);let i=this.getAttribute("padding");for(let l=0;l<s;l++)C.viewOnly&&(ce(this,Ot)[l]=[ve.rev,i]),i+=t[l].toString().length+this.getGaps(l);return i},t=>{ce(this,Ot)[e]=t})}getAbsoluteIndex(){return at(ce(this,Pt),()=>{const{parentNode:e}=this;return e?e.getAbsoluteIndex()+this.getRelativeIndex():0},e=>{ke(this,Pt,e)})}getBoundingClientRect(){return{...this.getDimension(),...this.getRootNode().posFromIndex(this.getAbsoluteIndex())}}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!`)}},Bt=re(null),xs=new WeakMap,Et=new WeakMap,Rt=new WeakMap,vs=new WeakMap,Pt=new WeakMap,Ot=new WeakMap,ie(Bt,1,"getLines",mr,nt),nt=ie(Bt,0,"AstNode",xr,nt),se(Bt,1,nt)}}),Co,wu=I({"mixin/elementLike.ts"(){"use strict";$o(),Co=e=>{var s,hn;class t extends e{constructor(){super(...arguments);B(this,s)}getElementBy(r){for(const o of this.childNodes){if(o.type==="text")continue;if(r(o))return o;const a=o.getElementBy(r);if(a)return a}}querySelector(r){return this.getElementBy(P(this,s,hn).call(this,r))}getElementsBy(r,o=[]){for(const a of this.childNodes)a.type!=="text"&&(r(a)&&o.push(a),a.getElementsBy(r,o));return o}querySelectorAll(r){return this.getElementsBy(P(this,s,hn).call(this,r))}escape(){for(const r of this.childNodes)r.escape()}}return s=new WeakSet,hn=function(r){return qn(r,this)},t}}}),vr,Ks,br,Dt,yu=I({"lib/element.ts"(){"use strict";he(),Re(),$o(),To(),wu(),vr=[Co],Dt=class extends(br=nt){get length(){return this.childNodes.length}text(e){return ut(this.childNodes,e)}normalize(){const e=this.getChildNodes(),t=s=>{var i,l;e.splice(s,1),(i=e[s-1])==null||i.setAttribute("nextSibling",e[s]),(l=e[s])==null||l.setAttribute("previousSibling",e[s-1])};for(let s=e.length-1;s>=0;s--){const{type:i,data:l}=e[s];i!=="text"||e.length===1||this.getGaps(s-(s&&1))||l===""&&t(s)}this.setAttribute("childNodes",e)}removeAt(e){return ps(this,e,1)[0]}insertAt(e,t=this.length){return ps(this,t,0,[e]),e}closest(e){const t=qn(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){for(let t=this.length-1;t>=0;t--)this.removeAt(t);this.safeAppend(e)}setText(e,t=0){t+=t<0?this.length:0;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){{if(e===void 0)return;const{length:t}=this.toString();if(e>t||e<-t)return;e+=e<0?t:0;let s=this,i=0,l=0;for(;s.type!=="text";){const{childNodes:n}=s;i+=s.getAttribute("padding");for(let r=0;i<=e&&r<n.length;r++){const o=n[r],{nextSibling:a}=o,d=o.toString(),u=d.length;if(o.setAttribute("aIndex",i),i+=u,i>e||i===e&&u>0&&(!a||a.type==="text"||o.type!=="text"&&(d.trim()||!a.toString().trim()))){s=o,i-=u,l=i;break}i+=s.getGaps(r)}if(s.childNodes===n)return{offsetNode:s,offset:e-l}}return{offsetNode:s,offset:e-l}}this.lspError("AstElement.caretPositionFromIndex")}elementFromIndex(e){var t;{const s=(t=this.caretPositionFromIndex(e))==null?void 0:t.offsetNode;return(s==null?void 0:s.type)==="text"?s.parentNode:s}this.lspError("AstElement.elementFromIndex")}elementFromPoint(e,t){return this.elementFromIndex(this.indexFromPos(t,e))}lint(e=this.getAbsoluteIndex(),t){{const s=[];for(let i=0,l=e+this.getAttribute("padding");i<this.length;i++){const n=this.childNodes[i];n.setAttribute("aIndex",l);const r=n.lint(l,t);r.length>0&&s.push(...r),l+=n.toString().length+this.getGaps(i)}return s}}print(e={}){const t=e.class;return this.toString()?(t===""?"":`<span class="wpb-${t!=null?t:this.type}${this.getAttribute("invalid")?" wpb-invalid":""}">`)+Ct(this.childNodes,e)+(t===""?"":"</span>"):""}json(e,t=this.getAbsoluteIndex()){{const s={...this,type:this.type,range:[t,t+this.toString().length],childNodes:[]};for(let i=0,l=t+this.getAttribute("padding");i<this.length;i++){const n=this.childNodes[i],{length:r}=n.toString();n.setAttribute("aIndex",l),s.childNodes.push(n.type==="text"?{data:n.data,range:[l,l+r]}:n.json(void 0,l)),l+=r+this.getGaps(i)}return s}this.lspError("AstElement.json")}},Ks=re(br),Dt=ie(Ks,0,"AstElement",vr,Dt),se(Ks,1,Dt)}}),fs,qs=I({"mixin/gapped.ts"(){"use strict";fs=(e=1)=>t=>{class s extends t{getGaps(){return e}}return s}}}),Oe,qe=I({"mixin/noEscape.ts"(){"use strict";Oe=e=>{{class t extends e{escape(){}}return t}}}}),wr,Io,Su=I({"src/parameter.ts"(){"use strict";he(),X(),G(),V(),wr=new RegExp(`https?://${$t}${_t}$`,"iu"),Io=class extends z{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{return!1}}constructor(e,t,s,i=[]){super(void 0,s,i);const l=new z(typeof e=="number"?void 0:e,s,i,{}),n=new z(t,s,i);l.type="parameter-key",l.setAttribute("stage",2),n.type="parameter-value",n.setAttribute("stage",2),this.append(l,n)}trimName(e,t=!0){const s=(typeof e=="string"?e:e.toString(!0)).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");return this.setAttribute("name",s),s}afterBuild(){if(!this.anon){const{parentNode:e,firstChild:t}=this,s=this.trimName(t);e&&e.getArgs(s,!1,!1).add(this)}super.afterBuild()}toString(e){return this.anon?this.lastChild.toString(e):super.toString(e,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(e=this.getAbsoluteIndex(),t){var s;{const i=super.lint(e,t),l="unescaped",n=C.lintConfig.getSeverity(l);if(n){const{firstChild:r}=this,o=(s=wr.exec(r.text()))==null?void 0:s[0];try{if(o&&new URL(o).search){const a=Q(r,{start:e},l,"unescaped-query",n);a.startIndex=a.endIndex,a.startLine=a.endLine,a.startCol=a.endCol,a.endIndex++,a.endCol++,a.fix=It(a.startIndex,"{{=}}"),i.push(a)}}catch{}}return i}}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}}}}),Se,Xe=I({"src/atom.ts"(){"use strict";var e,t;V(),Se=(t=class extends z{constructor(i,l,n,r,o){super(i,n,r,o);B(this,e);E(this,e,l)}get type(){return v(this,e)}set type(i){E(this,e,i)}getAttribute(i){var l;return i==="invalid"?this.type==="converter-flag"&&!!((l=this.parentNode)!=null&&l.isInvalidFlag(this)):super.getAttribute(i)}},e=new WeakMap,t)}}),Qe,Ft=I({"src/syntax.ts"(){"use strict";var e,t;V(),Qe=(t=class extends z{constructor(i,l,n,r,o){super(i,n,r,o);B(this,e);E(this,e,l)}get type(){return v(this,e)}lint(i=this.getAbsoluteIndex()){return super.lint(i,!1)}},e=new WeakMap,t)}}),No={};oe(No,{TranscludeToken:()=>rt});var yr,Ys,Sr,rt,Lo=I({"src/transclude.ts"(){"use strict";var e,t,s,i,l,n,Gt,Fo,a;he(),X(),Re(),ge(),qs(),qe(),G(),V(),Su(),Xe(),Ft(),yr=[Oe,fs()],rt=(a=class extends(Sr=z){constructor(u,c,p,m=[]){var T,O;let f;const _=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(u);_&&(f=Number(_[1]),u=u.replace(`\0${f}h`,m[f].toString().replace(/^\n/u,"")));super(void 0,p,m,{});B(this,n);Ie(this,"modifier","");B(this,e,"template");B(this,t,":");B(this,s,!1);B(this,i,new Map);B(this,l);const{parserFunction:[S,w],variable:A,functionHook:g}=p,h=(T=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(u))==null?void 0:T[0];if(h)this.setAttribute("modifier",h),u=u.slice(h.length);else if(u.includes(":")){const[L,...j]=u.split(":"),[W]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((O=j[0])!=null?O:"");this.setModifier(`${L}:${W}`)&&(u=j.join(":").slice(W.length))}const b=u.search(/[::]/u),y=u[b]===":",x=b!==-1;if(x||c.length===0&&!v(this,s)){const L=x?u.slice(0,b):u,j=x&&u.slice(b+1),W=_e(L),N=x?W.slice(W.search(/\S/u))+(y?":":""):W.trim(),R=N.toLowerCase(),J=Array.isArray(w),q=J?w.includes(N):Object.prototype.hasOwnProperty.call(w,N),F=!J&&q?w[N]:Object.prototype.hasOwnProperty.call(S,R)&&S[R],U=J&&q||!("functionHook"in p)||g.includes(F),H=J&&q||A.includes(F);if(x?F&&U:H){this.setAttribute("name",F||R.replace(/^#|:$/u,"")),E(this,e,"magic-word"),y&&E(this,t,":");const D=new Qe(L,"magic-word-name",p,m);if(super.insertAt(D),j!==!1&&c.unshift([j]),this.name==="invoke")for(let ee=0;ee<2;ee++){const ne=c.shift();if(!ne)break;const ue=new Se(ne.join("="),`invoke-${ee?"function":"module"}`,p,m);super.insertAt(ue)}}}if(this.type==="template"){const L=_e(u).trim();if(!this.normalizeTitle(L,10,{halfParsed:!0,temporary:!0}).valid)throw m.pop(),new SyntaxError("Invalid template name");const j=new Se(u,"template-name",p,m,{});super.insertAt(j)}typeof f=="number"&&(m[f]=void 0);const $=this.isTemplate();let k=1;for(let L=0;L<c.length;L++){const j=c[L];$||this.name==="switch"&&L>0||this.name==="tag"&&L>1||(j[0]=j.join("="),j.length=1),j.length===1&&(j.unshift(k),k++),this.insertAt(new Io(...j,p,m))}this.seal("modifier")}get type(){return v(this,e)}get module(){return this.type==="magic-word"&&this.name==="invoke"?P(this,n,Gt).call(this).title:void 0}get function(){var u;return this.type==="magic-word"&&this.name==="invoke"?(u=this.childNodes[2])==null?void 0:u.text().trim():void 0}setModifier(u){const{parserFunction:[,,c,p]}=this.getAttribute("config"),m=_e(u).trim();if(u&&!m.endsWith(":"))return!1;const f=m.slice(0,-1).toLowerCase(),_=c.includes(f),S=p.includes(f);return v(this,s)&&_||!v(this,s)&&(S||!u)||(ve.running||this.length>1)&&(_||S||!u)?(this.setAttribute("modifier",u),E(this,s,_),!!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"&&(E(this,l,P(this,n,Gt).call(this)),this.setAttribute("name",v(this,l).title))}toString(u){const{childNodes:c,length:p,firstChild:m,modifier:f,type:_}=this;return`{{${f}${_==="magic-word"?m.toString(u)+(p===1?"":v(this,t))+c.slice(1).map(S=>S.toString(u)).join("|"):super.toString(u,"|")}}}`}text(){const{childNodes:u,length:c,firstChild:p,modifier:m,type:f,name:_}=this;return f==="magic-word"&&_==="vardefine"?"":`{{${m}${f==="magic-word"?p.text()+(c===1?"":v(this,t))+ut(u.slice(1),"|"):super.text("|")}}}`}getAttribute(u){switch(u){case"padding":return this.modifier.length+2;case"title":return v(this,l);case"colon":return v(this,t);case"invalid":return this.type==="magic-word"&&this.name==="invoke"&&(this.length===2||!P(this,n,Gt).call(this).valid);default:return super.getAttribute(u)}}lint(u=this.getAbsoluteIndex(),c){{const p=super.lint(u,c);if(!this.isTemplate())return p;const{type:m,childNodes:f,length:_}=this,S=new de(this,u),w=m==="magic-word";let A="no-ignored",g=C.lintConfig.getSeverity(A,"fragment");if(w&&!P(this,n,Gt).call(this).valid)A="invalid-invoke",g=C.lintConfig.getSeverity(A,"name"),g&&p.push(Q(f[1],S,A,"illegal-module",g));else if(g){const h=f[w?1:0],b=h.childNodes.findIndex(x=>x.type==="text"&&as(x.data).includes("#")),y=h.childNodes[b];if(y){const x=Q(h,S,A,"useless-fragment",g);x.suggestions=[Z(x,h.getRelativeIndex(b)+y.data.indexOf("#"))],p.push(x)}}if(A="invalid-invoke",g=C.lintConfig.getSeverity(A,"function"),g&&w&&_===2)return p.push(te(this,S,A,"missing-function",g)),p;if(A="no-duplicate",g=C.lintConfig.getSeverity(A,"parameter"),g){const h=this.getDuplicatedArgs().filter(([,y])=>!y[0].querySelector("ext")),b="duplicate-parameter";for(const[,y]of h)p.push(...y.map(x=>{const $=Q(x,S,A,b,g);return $.suggestions=[Z($,-1)],$}))}return p}}insertAt(u,c=this.length){return super.insertAt(u,c),u.anon?P(this,n,Fo).call(this,u):u.name&&this.getArgs(u.name,!1,!1).add(u),u}getAllArgs(){return this.childNodes.filter(Gs("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:u})=>u)}getArgs(u,c,p=!0){const m=String(u).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");let f;return v(this,i).has(m)?f=v(this,i).get(m):(f=new Set(this.getAllArgs().filter(({name:_})=>m===_)),v(this,i).set(m,f)),f}getDuplicatedArgs(){return[...v(this,i)].filter(([,{size:u}])=>u>1).map(([u,c])=>[u,[...c]])}getPossibleValues(){const{type:u,name:c,childNodes:p}=this;if(u==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let m,f;switch(c){case"if":case"ifexist":case"ifexpr":case"iferror":m=2;break;case"ifeq":m=3;break;case"switch":{const _=p.slice(2),S=_[_.length-1];f=[..._.filter(({anon:w})=>!w),...S!=null&&S.anon?[S]:[]].map(({lastChild:w})=>w);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}f!=null||(f=p.slice(m,m+2).map(({lastChild:_})=>_));for(let _=0;_<f.length;){const{length:S,0:w}=f[_].childNodes.filter(A=>A.text().trim());if(S===0)f.splice(_,1);else if(S>1||w.type!=="magic-word")_++;else try{const A=w.getPossibleValues();f.splice(_,1,...A),_+=A.length}catch{_++}}return f}print(){const{childNodes:u,length:c,firstChild:p,modifier:m,type:f}=this;return`<span class="wpb-${f}${this.getAttribute("invalid")?" wpb-invalid":""}">{{${f==="magic-word"?us(m)+p.print()+(c===1?"":v(this,t))+Ct(u.slice(1),{sep:"|"}):(m?`<span class="wpb-magic-word">${us(m)}</span>`:"")+Ct(u,{sep:"|"})}}}</span>`}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,l=new WeakMap,n=new WeakSet,Gt=function(){const u=this.type==="template";return this.normalizeTitle(this.childNodes[u?0:1].text(),u?10:828,{temporary:!0})},Fo=function(u){const c=this.getAnonArgs(),p=typeof u!="number";for(let m=p?c.indexOf(u):u-1;m<c.length;m++){const f=c[m],{name:_}=f,S=String(m+1);(_!==S||f===u)&&(f.setAttribute("name",S),this.getArgs(S,!1,!1).add(f))}},a),Ys=re(Sr),rt=ie(Ys,0,"TranscludeToken",yr,rt),se(Ys,1,rt)}}),bs,Zs,ei,Ar,kr,$r,_r,ti,Tr,gn,Au=I({"lib/text.ts"(){"use strict";var e,pn,s;he(),X(),Re(),G(),To(),bs=String.raw`[${Ge}\t]*`,Zs=String.raw`[^\S\n]*`,ei=String.raw`<${Zs}(?:/${Zs})?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|(?:rfc|pmid)(?=[-::]?${bs}\d)|isbn(?=[-::]?${bs}(?:\d(?:${bs}|-)){6})`,Ar=new RegExp(String.raw`${ei}|https?[:/]/+`,"giu"),kr=new RegExp(ei,"giu"),$r=new Set(["attr-value","ext-link-text","link-text"]),_r={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},ti=new Set(["html","head","style","title","body","a","audio","img","video","embed","iframe","object","canvas","script","col","colgroup","tbody","tfoot","thead","button","input","label","option","select","textarea"]),Tr=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch{return/\w/u}})(),gn=(s=class extends nt{constructor(n){super();B(this,e);Ie(this,"data","");this.data=n}get type(){return"text"}toString(n){var r;return n&&!((r=this.parentNode)!=null&&r.getAttribute("built"))?_e(this.data):this.data}text(){return this.data}lint(n=this.getAbsoluteIndex(),r){var o,a,d;{if(r===!1)return[];const{data:u,parentNode:c,nextSibling:p,previousSibling:m}=this;if(!c)throw new Error("An isolated text node cannot be linted!");const{type:f,name:_,parentNode:S}=c;if(f==="attr-value"){const{name:N,tag:R}=S;if(R==="ref"&&(N==="name"||N==="follow")||N==="group"&&(R==="ref"||R==="references")||R==="choose"&&(N==="before"||N==="after"))return[]}if(r!=null||(r=f==="free-ext-link"||f==="ext-link-url"||f==="ext-link-text"||f==="image-parameter"&&_==="link"||f==="attr-value"?kr:Ar),u.search(r)===-1)return[];r.lastIndex=0;const w=[],A=p==null?void 0:p.type,g=p==null?void 0:p.name,h=m==null?void 0:m.type,b=this.getRootNode(),y=b.toString(),{ext:x,html:$,variants:k}=b.getAttribute("config"),{top:T,left:O}=b.posFromIndex(n),L=C.lintConfig["tag-like"],j=typeof L=="number"?new Set:new Set(Object.keys(L[1]).filter(N=>N!=="invalid"&&N!=="disallowed")),W=new Set(["onlyinclude","noinclude","includeonly",...x,...$[0],...$[1],...$[2],...j,...ti]);for(let N=r.exec(u);N;N=r.exec(u)){const[,R,J]=N;let{index:q,0:F}=N;if(J&&J!=="]"){const{length:we}=J;q+=we,F=F.slice(we)}F=F.toLowerCase();const[U]=F,H=U==="r"||U==="p"||U==="i",D=U==="{",ee=U==="}",ne=U==="[",ue=U==="]";let{length:Ce}=F;if(U==="<"&&!W.has(R.toLowerCase())||ne&&f==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(u.slice(q+1))||p!=null&&p.is("ext")&&g==="nowiki"&&((o=p.innerText)!=null&&o.includes("]")))||H&&(!c.isPlain()||$r.has(f)))continue;ue&&(q||Ce>1)&&r.lastIndex--;let Be=n+q,Ze=Be+Ce,fe,M;const le=y[Ze],be=y[Be-1],me=D||ne,Te=D&&be==="-"&&k.length>0,Ue=ee&&le==="-"&&k.length>0,Ae=ne&&A==="free-ext-link"&&!u.slice(q+1).trim()||ue&&h==="free-ext-link"&&!u.slice(0,q).includes("]");if(H)fe="lonely-http",F=F.toUpperCase(),M=C.lintConfig.getSeverity(fe,F);else if(U==="<"){fe="tag-like";let we;/^<\/?\s/u.test(F)||!/[\s/>]/u.test(le!=null?le:"")?we="invalid":j.has(R)?we=R:ti.has(R)&&!x.includes(R)&&(we="disallowed"),M=C.lintConfig.getSeverity(fe,we)}else if(Te||Ue)fe="lonely-bracket",M=C.lintConfig.getSeverity(fe,"converter"),Te&&q>0?(F="-{",q--,Be--,Ce=2):Ue&&q<u.length-1&&(F="}-",Ze++,Ce=2);else if(Ae)fe="lonely-bracket",M=C.lintConfig.getSeverity(fe,"extLink");else if(me||ee||ue)if(fe="lonely-bracket",Ce>1||D&&le===U||ee&&be===U)M=C.lintConfig.getSeverity(fe,"double");else{if(!ne||f!=="ext-link-text"){const we=_r[U],Vs=me?u.slice(q+1):u.slice(0,q);if(D&&((a=we.exec(Vs))==null?void 0:a[0])==="}"||ee&&((d=we.exec(Vs))==null?void 0:d[0])==="{")continue;if(!Vs.includes(U)){const nr=me?"nextSibling":"previousSibling";let tt=this[nr];for(;tt&&(tt.type!=="text"||!we.test(tt.data));)tt=tt[nr];if(tt&&we.exec(tt.data)[0]!==U)continue}}M=C.lintConfig.getSeverity(fe,"single")}else fe="lonely-http",M=C.lintConfig.getSeverity(fe);if(!M)continue;const gt=this.posFromIndex(q),{line:K,character:et}=cs(T,O,gt.top+1,gt.left),Pe={rule:fe,message:C.msg("lonely",H||U==="h"||Te||Ue?F:U),severity:M,startIndex:Be,endIndex:Ze,startLine:K,endLine:K,startCol:et,endCol:et+Ce};if(U==="<")Pe.suggestions=[It(Be,"&lt;")];else if(U==="h"&&f!=="link-text"&&Tr.test(be||""))Pe.suggestions=[hs(Be)];else if(ne&&f==="ext-link-text"){const we=c.getAbsoluteIndex()+c.toString().length;Pe.suggestions=[It(we,"&#93;")]}else if(ue&&Ae){const we=n-m.toString().length;Pe.suggestions=[Os(we,"left-bracket","[")]}else H&&(Pe.suggestions=[...N[0]===F?[]:[Pn(Pe,F)],...le===":"||le===":"?[hs(Ze,1)]:[]]);w.push(Pe)}return w}}replaceData(n){P(this,e,pn).call(this,n)}splitText(n){{const{parentNode:r,data:o}=this;if(!r)throw new Error("The text node to be split has no parent node!");const a=new s(o.slice(n));return ps(r,r.childNodes.indexOf(this)+1,0,[a]),this.setAttribute("data",o.slice(0,n)),a}this.lspError("AstText.splitText")}escape(){{const{parentNode:n}=this;if(!n)throw new Error("The text node to be escaped has no parent node!");const{TranscludeToken:r}=(Lo(),Y(No)),o=n.getAttribute("config"),a=n.childNodes.indexOf(this)+1,d=p=>Math.max(this.data.lastIndexOf("=",p),this.data.lastIndexOf("|",p));let u=d();const c=()=>new r(this.data[u]==="="?"=":"!",[],o);for(;u>=0;u=d(u-1))u<this.data.length-1&&this.splitText(u+1),n.insertAt(ve.run(c),a),P(this,e,pn).call(this,this.data.slice(0,u))}}print(){return us(this.data)}},e=new WeakSet,pn=function(n){this.setAttribute("data",n)},s)}}),ct,jt=I({"mixin/hidden.ts"(){"use strict";ct=(e=!0,t=!0)=>s=>{class i extends s{text(){return""}lint(n){return e?[]:super.lint(n)}}return i}}}),We,Ke=I({"mixin/padded.ts"(){"use strict";We=({length:e})=>t=>{class s extends t{getAttribute(l){return l==="padding"?e:super.getAttribute(l)}}return s}}}),Cr,Ir,si,Nr,De,Ws=I({"src/link/base.ts"(){"use strict";var e,t,s,i;X(),dt(),ge(),Ke(),qe(),G(),V(),Xe(),Cr=l=>l==="redirect-target"||l==="link",Ir=[Oe,We("[[")],De=(i=class extends(Nr=z){constructor(n,r,o,a=[],d="|"){super(void 0,o,a,{});B(this,e,!0);B(this,t);B(this,s);if(this.insertAt(new Se(n,"link-target",o,a,{})),r!==void 0){const u=new z(r,o,a,{});u.type="link-text",u.setAttribute("stage",$e-1),this.insertAt(u)}E(this,t,d)}get link(){return v(this,s)}get fragment(){return v(this,s).fragment}afterBuild(){E(this,s,this.getTitle()),v(this,t).includes("\0")&&E(this,t,this.buildFromStr(v(this,t),0)),this.setAttribute("name",v(this,s).title),super.afterBuild()}setAttribute(n,r){n==="bracket"?E(this,e,r):n==="title"?E(this,s,r):super.setAttribute(n,r)}toString(n){const r=super.toString(n,v(this,t));return v(this,e)?`[[${r}]]`:r}text(){const n=super.text("|");return v(this,e)?`[[${n}]]`:n}getAttribute(n){return n==="title"?v(this,s):super.getAttribute(n)}getGaps(n){return n===0?v(this,t).length:1}lint(n=this.getAbsoluteIndex(),r){{const o=super.lint(n,r),{childNodes:[a,d],type:u}=this,{encoded:c,fragment:p}=v(this,s),m=new de(this,n);let f="unknown-page",_=C.lintConfig.getSeverity(f);if(_&&a.childNodes.some(({type:S})=>S==="template")&&o.push(Q(a,m,f,"template-in-link",_)),f="url-encoding",_=C.lintConfig.getSeverity(f),_&&c){const S=Q(a,m,f,"unnecessary-encoding",_);S.fix=jn(S,a),o.push(S)}if(f="pipe-like",_=C.lintConfig.getSeverity(f,"link"),_&&(u==="link"||u==="category")){const S=d==null?void 0:d.childNodes.findIndex(A=>A.type==="text"&&A.data.includes("|")),w=d==null?void 0:d.childNodes[S];if(w){const A=Q(d,m,f,"pipe-in-link",_),g=A.startIndex+d.getRelativeIndex(S);A.suggestions=[On(g,w.data)],o.push(A)}}if(f="no-ignored",_=C.lintConfig.getSeverity(f,"fragment"),_&&p!==void 0&&!Cr(u)){const S=Q(a,m,f,"useless-fragment",_),w=a.childNodes.findIndex(g=>g.type==="text"&&g.data.includes("#")),A=a.childNodes[w];A&&(S.fix=Z(S,a.getRelativeIndex(w)+A.data.indexOf("#"))),o.push(S)}return o}}getTitle(n,r){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:r,temporary:n,decode:!0,selfLink:!0})}print(){return super.print(v(this,e)?{pre:"[[",post:"]]",sep:v(this,t)}:{sep:v(this,t)})}json(n,r=this.getAbsoluteIndex()){const o=super.json(void 0,r);{const{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),si=re(Nr),De=ie(si,0,"LinkBaseToken",Ir,De),se(si,1,De)}}),Lr,ii,Fr,Ee,ht=I({"src/nowiki/base.ts"(){"use strict";qe(),V(),Lr=[Oe],Ee=class extends(Fr=z){get innerText(){return this.firstChild.data}constructor(e="",t,s){super(e,t,s)}},ii=re(Fr),Ee=ie(ii,0,"NowikiBaseToken",Lr,Ee),se(ii,1,Ee)}}),jr,ni,Er,pe,Ye=I({"src/nowiki/noinclude.ts"(){"use strict";jt(),ht(),jr=[ct()],pe=class extends(Er=Ee){get type(){return"noinclude"}toString(e){return e?"":super.toString()}},ni=re(Er),pe=ie(ni,0,"NoincludeToken",jr,pe),se(ni,1,pe)}}),jo,ku=I({"src/link/redirectTarget.ts"(){"use strict";X(),G(),Ws(),Ye(),jo=class extends De{get type(){return"redirect-target"}constructor(e,t,s,i){super(e,void 0,s,i),t!==void 0&&this.insertAt(new pe(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=C.lintConfig.getSeverity(s,"redirect");if(i&&this.length===2){const l=Q(this.lastChild,{start:e},s,"useless-link-text",i);l.startIndex--,l.startCol--,l.fix=Z(l),t.push(l)}return t}}}}}),Rr,ri,Pr,Vt,$u=I({"src/redirect.ts"(){"use strict";var e,t,s;jt(),qe(),V(),Ft(),ku(),Rr=[ct(!1,!1),Oe],Vt=(s=class extends(Pr=z){constructor(l,n,r,o,a,d,u=[]){super(void 0,d,u);B(this,e);B(this,t);E(this,e,l),E(this,t,a),this.append(new Qe(n,"redirect-syntax",d,u),new jo(r,o==null?void 0:o.slice(1),d,u))}get type(){return"redirect"}getAttribute(l){return l==="padding"?v(this,e).length:super.getAttribute(l)}toString(l){return v(this,e)+super.toString(l)+v(this,t)}lint(l=this.getAbsoluteIndex()){{const n=l+v(this,e).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",n),this.lastChild.lint(n)}}print(){return super.print({pre:v(this,e),post:v(this,t)})}},e=new WeakMap,t=new WeakMap,s),ri=re(Pr),Vt=ie(ri,0,"RedirectToken",Rr,Vt),se(ri,1,Vt)}}),Eo={};oe(Eo,{parseRedirect:()=>Ro});var Ro,_u=I({"parser/redirect.ts"(){"use strict";G(),$u(),Ro=(e,t,s)=>{var l;(l=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&&C.normalizeTitle(i[3],0,!1,t,{halfParsed:!0,temporary:!0,decode:!0}).valid?(e=`\0${s.length}o${e.slice(i[0].length)}`,new Vt(...i.slice(1),t,s),e):!1}}}),Or,li,Br,Qt,Tu=I({"src/onlyinclude.ts"(){"use strict";Ke(),qe(),V(),Or=[Oe,We("<onlyinclude>")],Qt=class extends(Br=z){get type(){return"onlyinclude"}toString(e){return`<onlyinclude>${super.toString(e)}</onlyinclude>`}isPlain(){return!0}print(){return super.print({pre:'<span class="wpb-ext">&lt;onlyinclude&gt;</span>',post:'<span class="wpb-ext">&lt;/onlyinclude&gt;</span>'})}},li=re(Br),Qt=ie(li,0,"OnlyincludeToken",Or,Qt),se(li,1,Qt)}}),qr,oi,Wr,lt,Un=I({"src/tagPair/index.ts"(){"use strict";var e,t;qs(),qe(),V(),qr=[fs(),Oe],lt=(t=class extends(Wr=z){constructor(i,l,n,r,o,a=[]){super(void 0,o);B(this,e);Ie(this,"closed");Ie(this,"selfClosing");this.setAttribute("name",i.toLowerCase()),E(this,e,[i,r||i]),this.closed=r!=="",this.selfClosing=r===void 0,this.append(l,n);const d=typeof l=="string"?-1:a.indexOf(l);a.splice(d===-1?1/0:d,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(i){const{selfClosing:l,firstChild:n,lastChild:r}=this,[o,a]=v(this,e);return l?`<${o}${n.toString(i)}/>`:`<${o}${n.toString(i)}>${r.toString(i)}${this.closed?`</${a}>`:""}`}text(){const[i,l]=v(this,e);return this.selfClosing?`<${i}${this.firstChild.text()}/>`:`<${i}${super.text(">")}${this.closed?`</${l}>`:""}`}getAttribute(i){return i==="padding"?v(this,e)[0].length+1:super.getAttribute(i)}print(){const[i,l]=v(this,e);return super.print(this.selfClosing?{pre:`&lt;${i}`,post:"/&gt;"}:{pre:`&lt;${i}`,sep:"&gt;",post:this.closed?`&lt;/${l}&gt;`:""})}},e=new WeakMap,t),oi=re(Wr),lt=ie(oi,0,"TagPairToken",qr,lt),se(oi,1,lt)}}),Po,Cu=I({"src/tagPair/translate.ts"(){"use strict";var e,Oo,s;V(),Un(),Ft(),Ye(),Po=(s=class extends lt{constructor(l,n,r,o=[]){const a=new Qe(l,"translate-attr",r,o);n=n==null?void 0:n.replace(/(<tvar\|[^>]+>)([\s\S]*?)(<\/>)/gu,(u,c,p,m)=>(new pe(c,r,o),new pe(m,r,o),`\0${o.length-1}n${p}\0${o.length}n`)).replace(/(<tvar\s+name\s*=(?:\s*(?:(["'])[\s\S]*?\2|[^"'\s>]+))?\s*>)([\s\S]*?)(<\/tvar\s*>)/giu,(u,c,p,m,f)=>(new pe(c,r,o),new pe(f,r,o),`\0${o.length-1}n${m}\0${o.length}n`));const d=new z(n,r,o);d.type="translate-inner";super("translate",a,d,"translate",r,o);B(this,e);this.seal("closed",!0),this.seal("selfClosing",!0)}get type(){return"translate"}toString(l){return l?this.lastChild.toString(!0):super.toString()}text(){return this.lastChild.text()}print(){return`<span class="wpb-ext">&lt;translate${P(this,e,Oo).call(this)?'<span class="wpb-ext-attrs"> <span class="wpb-ext-attr"><span class="wpb-attr-key">nowrap</span></span></span>':""}&gt;${this.lastChild.print({class:"ext-inner"})}&lt;/translate&gt;</span>`}},e=new WeakSet,Oo=function(){return this.firstChild.toString()===" nowrap"},s)}}),Ur,ai,Mr,Jt,Iu=I({"src/tagPair/include.ts"(){"use strict";X(),ge(),jt(),G(),Un(),Ur=[ct(!1)],Jt=class extends(Mr=lt){get type(){return"include"}constructor(e,t="",s,i,l,n){super(e,t,s!=null?s:"",s===void 0||i!=null?i:"",l,n)}toString(e){return e?"":super.toString()}lint(e=this.getAbsoluteIndex()){{const t=[],{firstChild:s,closed:i,name:l}=this,n=new de(this,e),r=["no-ignored","unclosed-comment"],o=r.map(a=>C.lintConfig.getSeverity(a,"include"));if(o[0]&&s.data.trim()){const a=Q(s,n,r[0],"useless-attribute",o[0]);a.suggestions=[Z(a)],t.push(a)}if(o[1]&&!i){const a=te(this,n,r[1],C.msg("unclosed",`<${l}>`),o[1]);a.suggestions=[Ve(a.endIndex,`</${l}>`)],t.push(a)}return t}}},ai=re(Mr),Jt=ie(ai,0,"IncludeToken",Ur,Jt),se(ai,1,Jt)}}),Us,Mn=I({"mixin/attributesParent.ts"(){"use strict";Us=(e=0)=>t=>{var i,fn;class s extends t{constructor(){super(...arguments);B(this,i)}hasAttr(o){return P(this,i,fn).call(this).hasAttr(o)}getAttr(o){return P(this,i,fn).call(this).getAttr(o)}}return i=new WeakSet,fn=function(){return this.childNodes[e]},s}}}),ae,ui,di,qt,ws,ci,st,hi,gi,pi,ys,fi,Fe,zn,Hn,Dn,Bo,qo=I({"util/sharable.ts"(){"use strict";ae=new Set(["align"]),ui=new Set(["cite"]),di=new Set(["cite","datetime"]),qt=new Set(["width"]),ws=new Set(["axis","align","bgcolor","height","width","valign"]),ci=new Set([...ws,"abbr","headers","scope","rowspan","colspan"]),st=new Set(["type"]),hi=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),gi=new Set(["clear"]),pi=new Set(["bgcolor","align","valign"]),ys=new Set(["qid","forcemathmode","type","display"]),fi=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),Fe=new Set,zn=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"]),Hn={div:ae,h1:ae,h2:ae,h3:ae,h4:ae,h5:ae,h6:ae,blockquote:ui,q:ui,p:ae,br:gi,pre:qt,ins:di,del:di,ul:st,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...hi,"border"]),caption:ae,tr:pi,td:ci,th:ci,font:new Set(["size","color","face"]),hr:qt,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:st,poem:ae,categorytree:ae,combooption:ae,math:Fe,chem:Fe,ce:Fe,img:new Set(["alt","src","width","height","loading","srcset"])},Dn={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:Fe,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:Fe,inputbox:Fe,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:Fe,poll:new Set(["id","show-results-before-voting"]),sm2:st,flashmp3:st,score:new Set(["line_width_inches","lang","override_midi","raw","note-language","override_audio","override_ogg","sound","vorbis"]),seo:new Set(["title","title_mode","title_separator","keywords","description","robots","google_bot","image","image_width","image_height","image_alt","type","site_name","locale","section","author","published_time","twitter_site"]),tab:new Set(["nested","name","index","class","block","inline","openname","closename","collapsed","dropdown","style","bgcolor","container","id","title"]),tabs:new Set(["plain","class","container","id","title","style"]),combobox:new Set(["placeholder","value","id","class","text","dropdown","style"]),math:new Set([...ys,"chem"]),chem:ys,ce:ys,hiero:Fe,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:fi,syntaxhighlight:fi,templatedata:Fe,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:Fe},Bo={table:hi,td:new Set([...ws,"scope"]),th:ws,br:gi,caption:ae,div:ae,hr:qt,h1:ae,h2:ae,h3:ae,h4:ae,h5:ae,h6:ae,li:st,p:ae,pre:qt,tr:pi,ul:st}}}),zr,Hr,Dr,Gr,Cs,Nu=I({"src/attribute.ts"(){"use strict";var e,t,s,i,l,mn,r;X(),he(),dt(),qo(),ge(),G(),V(),Xe(),zr=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,Hr=/(?:^|\s|\*\/)(?:javascript|vbscript)(?:\W|$)/iu,Dr=new Set(["ext","arg","magic-word","template"]),Gr=new Set(["about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),Cs=(r=class extends z{constructor(a,d,u,c="",p,m=[],f=C.getConfig(),_=[]){const S=new Se(u,"attr-key",f,_);let w;if(u==="title"||d==="img"&&u==="alt")w=new z(p,f,_,{}),w.type="attr-value",w.setAttribute("stage",$e-1);else if(d==="gallery"&&u==="caption"||d==="choose"&&(u==="before"||u==="after")){const A={...f,excludes:[...f.excludes,"heading","html","table","hr","list"]};w=new z(p,A,_,{}),w.type="attr-value",w.setAttribute("stage",1)}else w=new Se(p,"attr-value",f,_,{});super(void 0,f,_);B(this,l);B(this,e);B(this,t);B(this,s);B(this,i);E(this,e,a),this.append(S,w),E(this,s,c),E(this,i,[...m]),E(this,t,d),this.setAttribute("name",Tt(_e(u)))}get type(){return v(this,e)}get tag(){return v(this,t)}get balanced(){return!v(this,s)||v(this,i)[0]===v(this,i)[1]}afterBuild(){v(this,s).includes("\0")&&E(this,s,this.buildFromStr(v(this,s),0)),this.parentNode&&E(this,t,this.parentNode.name),this.setAttribute("name",Tt(this.firstChild.text())),super.afterBuild()}toString(a){const[d="",u=""]=v(this,i);return v(this,s)?super.toString(a,v(this,s)+d)+u:this.firstChild.toString(a)}text(){return v(this,s)?`${super.text(`${v(this,s).trim()}"`)}"`:this.firstChild.text()}getGaps(){var a,d;return v(this,s)?v(this,s).length+((d=(a=v(this,i)[0])==null?void 0:a.length)!=null?d:0):0}lint(a=this.getAbsoluteIndex(),d){var u;{const c=super.lint(a,d),{balanced:p,firstChild:m,lastChild:f,name:_,tag:S}=this,w=new de(this,a),A=["unclosed-quote","obsolete-attr"],g=A.map(b=>C.lintConfig.getSeverity(b,_));if(g[0]&&!p){const b=Q(f,w,A[0],C.msg("unclosed","quotes"),g[0]);b.startIndex--,b.startCol--,b.suggestions=[Ve(b.endIndex,v(this,i)[0])],c.push(b)}const h=P(this,l,mn).call(this,a,w);return h&&c.push(h),g[1]&&((u=Bo[S])!=null&&u.has(_))&&c.push(Q(m,w,A[1],"obsolete-attribute",g[1])),c}}getValue(){return v(this,s)?this.lastChild.text().trim():this.type==="ext-attr"||""}escape(){E(this,s,"{{=}}"),this.lastChild.escape()}getAttribute(a){return a==="invalid"?P(this,l,mn).call(this):super.getAttribute(a)}print(){const[a="",d=""]=v(this,i);return v(this,s)?super.print({sep:us(v(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,l=new WeakSet,mn=function(a,d){const{firstChild:u,lastChild:c,type:p,name:m,tag:f,parentNode:_}=this,S=!c.childNodes.some(({type:y})=>Dr.has(y)),w=this.getValue(),A=Dn[f],g=Hn[f],{length:h}=this.toString();let b="illegal-attr";if(!(A!=null&&A.has(m))&&!(g!=null&&g.has(m))&&(p==="ext-attr"?A||g:!/\{\{[^{]+\}\}/u.test(m))&&(p==="ext-attr"&&!g||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(m)&&(f==="meta"||f==="link"||!zn.has(m)))||(m==="itemtype"||m==="itemid"||m==="itemref")&&!(_!=null&&_.hasAttr("itemscope"))){if(a===void 0)return!0;{const y=C.lintConfig.getSeverity(b,"unknown");if(y){const x=Q(u,d,b,"illegal-attribute-name",y);return x.suggestions=[Z(a,h)],x}}}else if(m==="style"&&typeof w=="string"&&zr.test(w)){if(a===void 0)return!0;{b="insecure-style";const y=C.lintConfig.getSeverity(b);return y&&Q(c,d,b,"insecure-style",y)}}else if(m==="tabindex"&&typeof w=="string"&&w!=="0"){if(a===void 0)return!0;{const y=C.lintConfig.getSeverity(b,"tabindex");if(y){const x=Q(c,d,b,"nonzero-tabindex",y);return x.suggestions=[Z(a,h),je(x,"0 tabindex","0")],x}}}else if(S&&p!=="ext-attr"){const y=Bn(f,m),x=String(w).toLowerCase();if(y.length>0&&y.every($=>$!==x)){if(a===void 0)return!0;{const $=C.lintConfig.getSeverity(b,"value");return $&&Q(c,d,b,"illegal-attribute-value",$)}}}else if(typeof w=="string"&&((/^xmlns:[\w:.-]+$/u.test(m)||Gr.has(m))&&Hr.test(w)||S&&(m==="href"||f==="img"&&m==="src")&&!new RegExp(String.raw`^(?:${this.getAttribute("config").protocol}|//)\S+$`,"iu").test(w))){if(a===void 0)return!0;{const y=C.lintConfig.getSeverity(b,"value");return y&&Q(c,d,b,"illegal-attribute-value",y)}}return!1},r)}}),mi,Vr,Qr,Ms,Gn=I({"src/attributes.ts"(){"use strict";var e,t,Is,i;X(),he(),ge(),G(),V(),Xe(),Nu(),mi=l=>l.slice(0,-1),Vr=l=>`${mi(l)}-dirty`,Qr=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch{return/[^\W_]/u}})(),Ms=(i=class extends z{constructor(n,r,o,a,d=[]){super(void 0,a,d,{});B(this,t);B(this,e);if(E(this,e,r),this.setAttribute("name",o),n){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 c="",p=u.exec(n),m=0;const f=()=>{c&&(super.insertAt(new Se(c,Vr(r),a,d,{})),c="")};for(;p;){const{index:_,0:S,1:w,2:A,3:g,4:h,5:b,6:y}=p;if(c+=n.slice(m,_),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(_e(w).trim())){const x=h!=null?h:y,$=[g,b],k=new Cs(mi(r),o,w,A,x,$,a,d);f(),super.insertAt(k)}else c+=S;({lastIndex:m}=u),p=u.exec(n)}c+=n.slice(m),f()}}get type(){return v(this,e)}afterBuild(){const{parentNode:n}=this;n!=null&&n.is("td")&&this.setAttribute("name",n.subtype),super.afterBuild()}getAttrTokens(n){return this.childNodes.filter(r=>r instanceof Cs&&(!n||r.name===Tt(n)))}hasAttr(n){return this.getAttrTokens(n).length>0}getAttrToken(n){const r=this.getAttrTokens(n);return r[r.length-1]}getAttr(n){var r;return(r=this.getAttrToken(n))==null?void 0:r.getValue()}lint(n=this.getAbsoluteIndex(),r){{const o=super.lint(n,r),{parentNode:a,childNodes:d}=this,u=new Map,c=new Set,p=new de(this,n),m=["no-ignored","no-duplicate"],f=["closingTag","invalidAttributes","nonWordAttributes"].map(S=>C.lintConfig.getSeverity(m[0],S));if(f[0]&&P(this,t,Is).call(this)){const S=te(this,p,m[0],"attributes-of-closing-tag",f[0]),w=a.getAbsoluteIndex();S.suggestions=[Z(S),En(w)],o.push(S)}for(const S of d)if(S instanceof Cs){const{name:w}=S;u.has(w)?(c.add(w),u.get(w).push(S)):u.set(w,[S])}else{const w=S.text().trim(),A=f[Qr.test(w)?1:2];if(w&&A){const g=Q(S,p,m[0],"invalid-attribute",A);g.suggestions=[Z(g,0," ")],o.push(g)}}const _=C.lintConfig.getSeverity(m[1],"attribute");if(_&&c.size>0)for(const S of c){const w=u.get(S).map(A=>{const g=A.getValue();return[A,g===!0?"":g]});o.push(...w.map(([A,g],h)=>{const b=Q(A,p,m[1],C.msg("duplicate-attribute",S),_),y=Z(b);return!g||w.slice(0,h).some(([,x])=>x===g)?b.fix=y:b.suggestions=[y],b}))}return o}}getAttribute(n){return n==="invalid"?P(this,t,Is).call(this):super.getAttribute(n)}print(){return this.toString()?`<span class="wpb-${this.type}${P(this,t,Is).call(this)?" wpb-invalid":""}">${this.childNodes.map(n=>n.print(n instanceof Se?{class:n.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}},e=new WeakMap,t=new WeakSet,Is=function(){const{parentNode:n}=this;return(n==null?void 0:n.type)==="html"&&n.closing&&this.text().trim()!==""},i)}}),Wo={};oe(Wo,{PreToken:()=>Uo});var Uo,Lu=I({"src/pre.ts"(){"use strict";dt(),V(),Ye(),Uo=class extends z{get type(){return"ext-inner"}constructor(e,t,s=[]){if(e){const i=/<nowiki>/giu,l=/<\/nowiki>/giu,{length:n}=i.source;let r=i.exec(e);r&&(l.lastIndex=r.index+n);let o=l.exec(e),a=0,d="";for(;r&&o;)new pe(r[0],t,s),new pe(o[0],t,s),d+=`${e.slice(a,r.index)}\0${s.length-1}n${e.slice(r.index+n,o.index)}\0${s.length}n`,a=o.index+n+1,i.lastIndex=a,r=i.exec(e),r&&(l.lastIndex=r.index+n),o=l.exec(e);e=d+e.slice(a)}super(e,t,s,{}),this.setAttribute("stage",$e-1)}isPlain(){return!0}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*\/\s*(pre)\b/giu)}}}}),zs,Vn=I({"mixin/multiLine.ts"(){"use strict";zs=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}}}),Ua={};ae(Ua,{ParamTagToken:()=>bt});var Jr,bi,Xr,bt,Ma=I({"src/paramTag/index.ts"(){"use strict";X(),ge(),Ds(),Jn(),G(),V(),Xe(),Jr=[zs],bt=class extends(Xr=z){get type(){return"ext-inner"}constructor(e,t,s=C.getConfig(),i=[],l){if(super(void 0,s,i,{}),t){const n=Se;this.append(...t.split(`
7
- `).map(r=>l?r:ms(r,s,i,e)).map(r=>new n(r,"param-line",s,i,{})))}i.splice(i.indexOf(this),1),i.push(this)}lint(e=this.getAbsoluteIndex()){const t="no-ignored",s=C.lintConfig.getSeverity(t,this.name);if(!s)return[];const i=new de(this,e),l=C.msg("invalid-parameter",this.name),n=[];for(const r of this.childNodes){r.setAttribute("aIndex",e);const a=r.childNodes.filter(({type:o})=>o!=="comment"&&o!=="include"&&o!=="noinclude");if(a.some(({type:o})=>o==="ext"))n.push(Q(r,i,t,l,s));else{const o=a.findIndex(({type:d})=>d!=="text"),u=a.slice(0,o===-1?void 0:o).map(String).join("");if(u&&!(o===-1?/^[a-z]+(?:\[\])?\s*=/iu:/^[a-z]+(?:\[\])?\s*(?:=|$)/iu).test(u)){const d=Q(r,i,t,l,s);d.suggestions=[Z(d)],n.push(d)}else{const d=r.lint(e,!1);d.length>0&&n.push(...d)}}e+=r.toString().length+1}return n}},bi=re(Xr),bt=ie(bi,0,"ParamTagToken",Jr,bt),se(bi,1,bt)}}),Kr,wi,Yr,wt,za=I({"src/heading.ts"(){"use strict";var e,t,Ns,i;X(),Re(),ge(),qe(),G(),V(),Ft(),Kr=[Oe],wt=(i=class extends(Yr=z){constructor(n,r,a,o=[]){super(void 0,a,o);B(this,t);B(this,e);E(this,e,n);const u=new z(r[0],a,o);u.type="heading-title",u.setAttribute("stage",2);const d=new Qe(r[1],"heading-trail",a,o);this.append(u,d)}get type(){return"heading"}get level(){return v(this,e)}toString(n){const r=P(this,t,Ns).call(this);return r+this.firstChild.toString(n)+r+this.lastChild.toString(n)}text(){const n=P(this,t,Ns).call(this);return n+this.firstChild.text()+n}getAttribute(n){return n==="invalid"?this.inHtmlAttrs()===2:n==="padding"?this.level:super.getAttribute(n)}getGaps(){return this.level}lint(n=this.getAbsoluteIndex(),r){const a=super.lint(n,r),{firstChild:o,level:u}=this,d=o.toString(),c=d.startsWith("="),f=c||d.endsWith("="),p=new de(this,n),x=this.inHtmlAttrs(),A=["h1","unbalanced-header","format-leakage"],S=A.map(y=>C.lintConfig.getSeverity(y,"apostrophe"));if(S[0]&&this.level===1){const y=Q(o,p,A[0],"<h1>",S[0]);f||(y.suggestions=[je(y,"h2",`=${d}=`)]),a.push(y)}if(S[1]&&f){const y=C.msg("unbalanced-in-section-header",'"="'),$=Q(o,p,A[1],y,S[1]);if(d!=="=")if(c){const[g]=/^=+/u.exec(d),h=u+g.length;$.suggestions=[{desc:`h${u}`,range:[$.startIndex,$.startIndex+g.length],text:""}],h<7&&$.suggestions.push({desc:`h${h}`,range:[$.endIndex,$.endIndex],text:g})}else{const g=/[^=](=+)$/u.exec(d)[1],h=u+g.length;$.suggestions=[{desc:`h${u}`,range:[$.endIndex-g.length,$.endIndex],text:""}],h<7&&$.suggestions.push({desc:`h${h}`,range:[$.startIndex,$.startIndex],text:g})}a.push($)}if(x){const y="parsing-order",$=C.lintConfig.getSeverity(y,x===2?"heading":"templateInTable");$&&a.push(te(this,p,y,"header-in-html",$))}if(S[2]){const y=this.getRootNode().toString(),$=o.childNodes.filter(Gs("quote")),g=$.filter(({bold:b})=>b),h=$.filter(({italic:b})=>b);if(g.length%2){const b=Q(g[g.length-1],{...p,start:n+u,left:p.left+u},A[2],C.msg("unbalanced-in-section-header","bold-apostrophes"),S[2]),w=n+u+d.length,m=Z(b);y.slice(b.endIndex,w).trim()?b.suggestions=[m,Ve(w,"'''")]:g.length===1&&h.length===0?b.fix=m:b.suggestions=[m],a.push(b)}if(h.length%2){const b=Q(h[h.length-1],{start:n+u},A[2],C.msg("unbalanced-in-section-header","italic-apostrophes"),S[2]),w=n+u+d.length;y.slice(b.endIndex,w).trim()?b.suggestions=[Ve(w,"''")]:h.length===1&&g.length===0?b.fix=Z(b):b.suggestions=[Z(b)],a.push(b)}}return a}print(){const n=P(this,t,Ns).call(this);return super.print({pre:n,sep:n})}json(n,r=this.getAbsoluteIndex()){const a=super.json(void 0,r);return a.level=this.level,a}},e=new WeakMap,t=new WeakSet,Ns=function(){return"=".repeat(this.level)},i),wi=re(Yr),wt=ie(wi,0,"HeadingToken",Kr,wt),se(wi,1,wt)}}),Zr,yi,el,Xt,Fu=I({"src/hidden.ts"(){"use strict";jt(),V(),Zr=[ct()],Xt=class extends(el=z){get type(){return"hidden"}getAttribute(e){return e==="invalid"||super.getAttribute(e)}},yi=re(el),Xt=ie(yi,0,"HiddenToken",Zr,Xt),se(yi,1,Xt)}}),tl,Si,sl,Kt,ju=I({"src/arg.ts"(){"use strict";var e,Ha,s;he(),X(),ge(),Ke(),qs(),qe(),G(),V(),Xe(),Fu(),tl=[Oe,We("{{{"),fs()],Kt=(s=class extends(sl=z){constructor(l,n,r=[]){super(void 0,n,r,{});B(this,e);for(let a=0;a<l.length;a++){const o=l[a];if(a===0){const u=new Se(o,"arg-name",n,r,{});super.insertAt(u)}else if(a>1){const u=new Xt(o,n,r);super.insertAt(u)}else{const u=new z(o,n,r);u.type="arg-default",u.setAttribute("stage",2),super.insertAt(u)}}}get type(){return"arg"}get default(){var l,n;return(n=(l=this.childNodes[1])==null?void 0:l.text())!=null?n:!1}toString(l){return`{{{${super.toString(l,"|")}}}}`}text(){return`{{{${ut(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){P(this,e,Ha).call(this),super.afterBuild()}lint(l=this.getAbsoluteIndex(),n){const{childNodes:[r,a,...o]}=this;r.setAttribute("aIndex",l+3);const u=r.lint(l+3,n);if(a){const f=l+4+r.toString().length;a.setAttribute("aIndex",f);const p=a.lint(f,n);p.length>0&&u.push(...p)}const d=["no-ignored","no-arg"],c=d.map(f=>C.lintConfig.getSeverity(f,"arg"));if(c[0]&&o.length>0){const f=new de(this,l);u.push(...o.map(p=>{const x=Q(p,f,d[0],"invisible-triple-braces",c[0]);return x.startIndex--,x.startCol--,x.suggestions=[Z(x),It(x.startIndex,"{{!}}")],x}))}if(c[1]&&!this.getAttribute("include")){const f=te(this,{start:l},d[1],"unexpected-argument",c[1]);a&&(f.suggestions=[je(f,"expand",a.text())]),u.push(f)}return u}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(l,n=this.getAbsoluteIndex()){const r=super.json(void 0,n);return r.default=this.default,r}},e=new WeakSet,Ha=function(){this.setAttribute("name",this.firstChild.text().trim())},s),Si=re(sl),Kt=ie(Si,0,"ArgToken",tl,Kt),se(Si,1,Kt)}}),Da={};ae(Da,{parseBraces:()=>Hs});var il,Ai,Ss,ki,$i,_i,nl,Ti,Hs,Xn=I({"parser/braces.ts"(){"use strict";Je(),he(),za(),Na(),ju(),il={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},Ai=String.raw`\[(?!\[)`,Ss=String.raw`\n(?![=\0])`,ki=String.raw`|\{{2,}`,$i=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),_i=at(e=>new RegExp(e,"gmu")),nl=new RegExp(String.raw`\{\{((?:[^\n{}[]|${Ai}|${Ss})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${Ss})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${Ai}|${Ss})*\}-`,"gu"),Ti=e=>{const t=Tt(Le(e));return $i.has(t)?$i.get(t):/^(?:filepath|(?:full|canonical)urle?):./u.test(t)?"m":/^#vardefine:./u.test(t)?"n":"t"},Hs=(e,t,s)=>{var x,A,S,y,$;const i=String.raw`${t.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,l]}=t,n=[],r=[],a=(g,h,b,w)=>{h[h.length-1].push(Ne(g.slice(b,w),r))};let o;do o!==void 0&&(e=o),o=e.replace(nl,(g,h,b)=>{if(h!==void 0||typeof b=="string")try{const{length:w}=s,m=(h!=null?h:b).split("|");return new rt(Ne(m[0],r),m.slice(1).map(_=>{const k=_.indexOf("=");return(k===-1?[_]:[_.slice(0,k),_.slice(k+1)]).map(T=>Ne(T,r))}),t,s),`\0${w}${Ti(m[0])}`}catch(w){if(!(w instanceof SyntaxError)||w.message!=="Invalid template name")throw w}return r.push(Ne(g,r)),`\0${r.length-1}`});while(o!==e);e=o;const u=e.lastIndexOf("}}")-e.length;let d=u+e.length!==-1,c=_i(i+(d?ki:"")),f=c.exec(e),p;for(;f||p!==void 0&&p<=e.length&&((A=(x=n[n.length-1])==null?void 0:x[0])!=null&&A.startsWith("="));){if(f!=null&&f[1]){const[,{length:j}]=f;f[0]=f[0].slice(j),f.index+=j}const{0:g,index:h}=f!=null?f:{0:`
8
- `,index:e.length},b=(S=n.pop())!=null?S:{},{0:w,index:m,parts:_,findEqual:k,pos:T}=b,O=g==="="&&k;if(g==="]]"||g==="}-")p=h+2;else if(g===`
9
- `){p=h+1;const{pos:j,findEqual:W}=(y=n[n.length-1])!=null?y:{};if(j===void 0||W||Le(e.slice(j,m))!==""){const N=/^(={1,6})(.+)\1((?:\s|\0\d+[cn]\x7F)*)$/u.exec(e.slice(m,h));N&&(N[2]=Ne(N[2],r),N[2].includes(`
10
- `)||(e=`${e.slice(0,m)}\0${s.length}h${e.slice(h)}`,p=m+4+String(s.length).length,new wt(N[1].length,N.slice(2),t,s)))}}else if(g==="|"||O)p=h+1,a(e,_,T,h),g==="|"&&_.push([]),b.pos=p,b.findEqual=g==="|",n.push(b);else if(g.startsWith("}}")){const j=g.slice(0,Math.min(w.length,3)),W=w.length-j.length,{length:N}=s;p=h+j.length,a(e,_,T,h);let R=!1,J="t";if(j.length===3){const q=_.map(U=>U.join("=")),F=q.length>1&&Le(q[1]).trim();new Kt(q,t,s),F&&F.endsWith(":")&&l.includes(F.slice(0,-1).toLowerCase())&&(J="s")}else try{new rt(_[0][0],_.slice(1),t,s),J=Ti(_[0][0])}catch(q){if(q instanceof SyntaxError&&q.message==="Invalid template name")R=!0;else throw q}R||(e=`${e.slice(0,m+W)}\0${N}${J}${e.slice(p)}`,p=m+W+3+String(N).length,W>1?n.push({0:w.slice(0,W),index:m,pos:m+W,parts:[[]]}):W===1&&e[m-1]==="-"&&n.push({0:"-{",index:m-1,pos:m+1,parts:[[]]}))}else p=h+g.length,g.startsWith("{")&&(f.pos=p,f.parts=[[]]),n.push(..."0"in b?[b]:[],f);let L=n[n.length-1];if(d&&u+e.length<p)for(d=!1;($=L==null?void 0:L[0])!=null&&$.startsWith("{");)n.pop(),L=n[n.length-1];c=_i(i+(d?ki:"")+(L?`|${il[L[0][0]]}${L.findEqual?"|=":""}`:"")),c.lastIndex=p,f=c.exec(e)}return Ne(e,r)}}}),Ga={};ae(Ga,{InputboxToken:()=>Va});var Va,Eu=I({"src/paramTag/inputbox.ts"(){"use strict";Ds(),Xn(),G(),Ma(),Va=class extends bt{constructor(e,t,s=C.getConfig(),i=[]){const l=Symbol("InputboxToken"),n=s.excludes.includes("heading")?s:{...s,excludes:[...s.excludes,"heading"]},{length:r}=i;i.push(l),t&&(t=ms(t,n,i,e)),t&&(t=Hs(t,n,i)),i.splice(r,1),super(e,t,n,i,{})}}}}),Ls={};ae(Ls,{NestedToken:()=>Qa});var rl,ll,Qa,Ci=I({"src/nested.ts"(){"use strict";var e,t,s;X(),ge(),Ds(),Xn(),G(),V(),ho(),Ye(),rl=new Set(["comment","include","arg","template","magic-word"]),ll=[!1,!0].map(i=>{const l=i?"includeonly":"noinclude";return new RegExp(String.raw`^(?:<${l}(?:\s[^>]*)?/?>|</${l}\s*>)$`,"iu")}),Qa=(s=class extends z{constructor(l,n,r,a,o=[]){if(typeof n=="boolean"){const u=Symbol("NestedToken"),{length:d}=o;o.push(u),l&&(l=ms(l,a,o,n)),l&&(l=Hs(l,a,o)),o.splice(d,1)}else l&&(l=l.replace(n,(u,d,c,f,p)=>{const x=`\0${o.length+1}e`;return new kt(d,c,f,p,a,!1,o),x}));l&&(l=l.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(u,d,c)=>(new pe(c,a,o),`${d}\0${o.length}n`)));super(l,a,o);B(this,e);B(this,t);E(this,e,[...r]),E(this,t,n)}get type(){return"ext-inner"}lint(l=this.getAbsoluteIndex(),n){const r=super.lint(l,n),a="no-ignored",o=C.lintConfig.getSeverity(a,this.name);if(!o)return r;const u=new de(this,l),d=typeof v(this,t)=="boolean"?ll[v(this,t)?1:0]:/^<!--[\s\S]*-->$/u;return[...r,...this.childNodes.filter(c=>{const{type:f,name:p}=c;if(f==="ext")return!v(this,e).includes(p);if(rl.has(f))return!1;const x=c.toString().trim();return x&&!d.test(x)}).map(c=>{const f=Q(c,u,a,C.msg("invalid-content",this.name),o);return f.suggestions=[Z(f),On(f,c.toString())],f})]}},e=new WeakMap,t=new WeakMap,s)}});function al(e,t,s,i,l){t=Le(t).trim();let n=t.replace(e==="link"?/\0\d+[tq]\x7F/gu:/\0\d+t\x7F/gu,"").trim();switch(e){case"width":return!n&&!!t||/^(?:\d+x?|\d*x\d+)(?:\s*px)?$/u.test(n);case"link":{if(n){if(Ja(s.protocol).test(n))return Xa(s.protocol).test(n)&&t;n.startsWith("[[")&&n.endsWith("]]")&&(n=n.slice(2,-2))}else return t;const r=C.normalizeTitle(n,0,!1,s,{halfParsed:i,decode:!0,selfLink:!0});return r.valid&&r}case"lang":return(l==="svg"||l==="svgz")&&!/[^a-z\d-]/u.test(n);case"alt":case"class":case"manualthumb":return!0;case"page":return(l==="djvu"||l==="djv"||l==="pdf")&&Number(n)>0;default:return!!n&&!isNaN(n)}}var Ja,Xa,ol,ul,Ka,Ru=I({"src/imageParameter.ts"(){"use strict";var e,t,Ya,l;Je(),he(),X(),G(),V(),Ja=at(n=>new RegExp(String.raw`^(?:${n}|//|\0\d+m\x7F)`,"iu")),Xa=at(n=>new RegExp(String.raw`^(?:(?:${n}|//)${$t}|\0\d+m\x7F)${_t}$`,"iu")),ol=at(n=>new RegExp(String.raw`^(\s*(?!\s))${n.replace("$1","(.*)")}${n.endsWith("$1")?`(?=$|
11
- )`:""}(\s*)$`,"u")),ul=new Set(["alt","link","lang","page","caption"]),Ka=(l=class extends z{constructor(r,a,o,u){var n=(...i)=>(super(...i),B(this,t),B(this,e,""),this);let d;const c=Object.entries(o.img).map(([p,x])=>[p,x,ol(p)]),f=c.find(([,p,x])=>(d=x.exec(r),d&&(d.length!==4||al(p,d[2],o,!0,a)!==!1)));if(f&&d){d.length===3?(n(void 0,o,u),E(this,e,r)):(n(d[2],o,u,{}),E(this,e,d[1]+f[0]+d[3])),this.setAttribute("name",f[1]);return}n(r,o.excludes.includes("list")?o:{...o,excludes:[...o.excludes,"list"]},u),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get type(){return"image-parameter"}get link(){return this.name==="link"?al("link",super.text(),this.getAttribute("config")):void 0}afterBuild(){var r;(r=this.parentNode)!=null&&r.is("gallery-image")&&!ul.has(this.name)&&this.setAttribute("name","invalid"),super.afterBuild()}toString(r){return v(this,e)?v(this,e).replace("$1",super.toString(r)):super.toString(r)}text(){return v(this,e)?v(this,e).replace("$1",super.text()).trim():super.text().trim()}isPlain(){return this.name==="caption"}getAttribute(r){return r==="invalid"?this.name==="invalid":r==="padding"?Math.max(0,v(this,e).indexOf("$1")):super.getAttribute(r)}lint(r=this.getAbsoluteIndex(),a){const o=super.lint(r,a),{link:u,name:d}=this;if(d==="invalid"){const c="invalid-gallery",f=C.lintConfig.getSeverity(c,"parameter");if(f){const p=te(this,{start:r},c,"invalid-image-parameter",f);p.fix=Z(p,-1),o.push(p)}}else if(typeof u=="object"&&u.encoded){const c="url-encoding",f=C.lintConfig.getSeverity(c,"file");if(f){const p=te(this,{start:r},c,"unnecessary-encoding",f);p.fix=Rn(p,this),o.push(p)}}return o}getValue(){return this.name==="invalid"?this.text():P(this,t,Ya).call(this)||super.text()}print(){return v(this,e)?`<span class="wpb-image-parameter${this.name==="invalid"?" wpb-invalid":""}">${v(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,Ya=function(){return v(this,e)&&!v(this,e).includes("$1")},l)}}),Ii,dl,cl,Ni,Li,Fi,hl,ji,Kn,Za=I({"src/link/file.ts"(){"use strict";X(),ge(),G(),Ws(),Ru(),Ii=new Map([["manualthumb","Thumb"],["frameless","Frameless"],["framed","Frame"],["thumbnail","Thumb"]]),dl=new Set(["arg"]),cl=new Set(["template","magic-word"]),Ni=new Set(["left","right","center","none"]),Li=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"]),hl=e=>{if(e===void 0)return[];const t=/-\{|\}-|\|/gu,s=[];let i=t.exec(e),l=0,n=0;for(;i;){const{0:r,index:a}=i;r!=="|"?l+=r==="-{"?1:-1:l===0&&(s.push(e.slice(n,a)),{lastIndex:n}=t),i=t.exec(e)}return s.push(e.slice(n)),s},ji=(e,t)=>e.filter(({childNodes:s})=>{const i=s.filter(l=>l.text().trim());return i.length!==1||!t.has(i[0].type)}),Kn=class extends De{get type(){return"file"}get extension(){return this.getAttribute("title").extension}constructor(e,t,s,i=[],l="|"){super(e,void 0,s,i,l);const{extension:n}=this.getTitle(!0,!0);this.safeAppend(hl(t).map(r=>new Ka(r,n,s,i)))}lint(e=this.getAbsoluteIndex(),t){var S;const s=super.lint(e,t),i=ji(this.getAllArgs(),dl),l=[...new Set(i.map(({name:y})=>y))],n=l.filter(y=>Ii.has(y)),r=l.filter(y=>Ni.has(y)),a=l.filter(y=>Li.has(y)),[o]=n,u=o==="framed"||o==="manualthumb",d=new de(this,e),{extension:c}=this;let f="nested-link",p=C.lintConfig.getSeverity(f,"file");if(p&&Fi.has(c)&&this.closest("ext-link-text")&&((S=this.getValue("link"))==null?void 0:S.trim())!==""){const y=te(this,d,f,"link-in-extlink",p),$=this.getArg("link");if($){const g=e+$.getRelativeIndex();y.fix={desc:C.msg("delink"),range:[g,g+$.toString().length],text:"link="}}else y.fix=Os(y.endIndex-2,"delink","|link=");s.push(y)}if(f="invalid-gallery",p=C.lintConfig.getSeverity(f,"parameter"),p&&u)for(const y of i.filter(({name:$})=>$==="width")){const $=Q(y,d,f,"invalid-image-parameter",p);$.fix=Z($,-1),s.push($)}if(i.length===l.length&&n.length<2&&r.length<2&&a.length<2)return s;f="no-duplicate";const x=["unknownImageParameter","imageParameter"].map(y=>C.lintConfig.getSeverity(f,y)),A=(y,$,g,h=!0)=>y.map(b=>{if(p=x[Number(typeof h=="function"?h(b):h)],!p)return!1;const w=Q(b,d,f,C.msg(`${$}-image-parameter`,g),p);return w.suggestions=[Z(w,-1)],w}).filter(b=>b!==!1);for(const y of l){if(y==="invalid"||y==="width"&&u)continue;const $=y==="caption";let g=i.filter(({name:h})=>h===y);if($&&(g=[...g.slice(0,-1).filter(h=>h.text()),...g.slice(-1)]),g.length>1){let h=!$||!c||Fi.has(c);if($&&h){const b=ji(g,cl);h=b.length>1&&(w=>b.includes(w))}s.push(...A(g,"duplicate",y,h))}}return n.length>1&&s.push(...A(i.filter(({name:y})=>Ii.has(y)),"conflicting","frame")),r.length>1&&s.push(...A(i.filter(({name:y})=>Ni.has(y)),"conflicting","horizontal-alignment")),a.length>1&&s.push(...A(i.filter(({name:y})=>Li.has(y)),"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}}}}),gl,Ei,pl,yt,eo=I({"src/link/galleryImage.ts"(){"use strict";var e,bn,s;X(),dt(),Ke(),G(),V(),Za(),gl=[We("")],yt=(s=class extends(pl=Kn){constructor(l,n,r,a,o=[]){let u;if(r!==void 0){const{length:d}=o;u=new z(r,a,o);for(let c=0;c<$e-1;c++)u.parseOnce();o.splice(d,1)}super(n,u==null?void 0:u.toString(),a,o);B(this,e);Ce(this,"privateType","imagemap-image");this.setAttribute("bracket",!1),this.privateType=`${l}-image`,this.seal("privateType",!0)}get type(){return this.privateType}getTitle(l){const n=this.type==="imagemap-image";return this.normalizeTitle(this.firstChild.toString(),n?0:6,{halfParsed:!0,temporary:l,decode:!n})}lint(l=this.getAbsoluteIndex(),n){const r=super.lint(l,n),a="invalid-gallery",o=C.lintConfig.getSeverity(a,"image");if(o&&P(this,e,bn).call(this)){const u=te(this,{start:l},a,"invalid-gallery",o);u.suggestions=[Os(l,"prefix","File:")],r.push(u)}return r}getAttribute(l){return l==="invalid"?P(this,e,bn).call(this):super.getAttribute(l)}},e=new WeakSet,bn=function(){const{ns:l}=this.getAttribute("title");return l!==6},s),Ei=re(pl),yt=ie(Ei,0,"GalleryImageToken",gl,yt),se(Ei,1,yt)}}),to={};ae(to,{GalleryToken:()=>Yt});var fl,Ri,ml,Yt,Pu=I({"src/gallery.ts"(){"use strict";var e,so,wn,i;X(),Jn(),G(),V(),eo(),Ye(),fl=[zs],Yt=(i=class extends(ml=z){constructor(n,r,a=[]){var o;super(void 0,r,a,{});B(this,e);for(const u of(o=n==null?void 0:n.split(`
12
- `))!=null?o:[]){const d=/^([^|]+)(?:\|(.*))?/u.exec(u);if(!d){super.insertAt(u.trim()?new pe(u,r,a):u);continue}const[,c,f]=d;P(this,e,so).call(this,c)?super.insertAt(new yt("gallery",c,f,r,a)):super.insertAt(new pe(u,r,a))}}get type(){return"ext-inner"}get widths(){return P(this,e,wn).call(this,"widths")}get heights(){return P(this,e,wn).call(this,"heights")}lint(n=this.getAbsoluteIndex(),r){const{top:a,left:o}=this.getRootNode().posFromIndex(n),u=[],d="no-ignored",c=["Image","NoImage","Comment"].map(f=>C.lintConfig.getSeverity(d,`gallery${f}`));for(let f=0;f<this.length;f++){const p=this.childNodes[f],x=p.toString(),{length:A}=x,S=x.trim(),{type:y}=p,$=a+f,g=f?0:o;if(p.setAttribute("aIndex",n),y==="noinclude"&&S&&!/^<!--.*-->$/u.test(S)){let[h]=c;if(S.startsWith("|")?[,h]=c:(S.startsWith("<!--")||S.endsWith("-->"))&&([,,h]=c),h){const b=n+A,w={rule:d,message:C.msg("invalid-content","gallery"),severity:h,startIndex:n,endIndex:b,startLine:$,endLine:$,startCol:g,endCol:g+A};w.suggestions=[Z(w),On(w,x)],u.push(w)}}else if(y!=="noinclude"&&y!=="text"){const h=p.lint(n,r);h.length>0&&u.push(...h)}n+=A+1}return u}json(n,r=this.getAbsoluteIndex()){const a=super.json(void 0,r);return Object.assign(a,{widths:this.widths,heights:this.heights}),a}},e=new WeakSet,so=function(n){return this.normalizeTitle(n,6,{halfParsed:!0,temporary:!0,decode:!0}).valid},wn=function(n){var o,u;const r=(o=this.parentNode)==null?void 0:o.getAttr(n),a=typeof r=="string"&&((u=/^(\d+)\s*(?:px)?$/u.exec(r))==null?void 0:u[1]);return a&&Number(a)||120},i),Ri=re(ml),Yt=ie(Ri,0,"GalleryToken",fl,Yt),se(Ri,1,Yt)}}),Yn,io=I({"src/link/index.ts"(){"use strict";Je(),X(),G(),Ws(),Yn=class extends De{get type(){return"link"}get innerText(){return this.length>1?this.lastChild.text():ds(this.firstChild.text().replace(/^\s*:?/u,""))}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),i="nested-link",l=C.lintConfig.getSeverity(i);if(l&&this.closest("ext-link-text")){const n=te(this,{start:e},i,"link-in-extlink",l);n.fix=je(n,"delink",this.innerText),s.push(n)}return s}}}}),xl,vl,gs,Zn=I({"src/magicLink.ts"(){"use strict";var e,t,yn,i;X(),he(),ge(),G(),V(),xl=String.raw`(?:[${Ge}\t]|&nbsp;|&#0*160;|&#[xX]0*[aA]0;)`,vl=new RegExp(`${xl}+`,"gu"),gs=(i=class extends z{constructor(n,r="free-ext-link",a=C.getConfig(),o){super(n,a,o,{});B(this,t);B(this,e);E(this,e,r)}get type(){return v(this,e)}get innerText(){const n=new Map([["!","|"],["=","="]]);let r=ut(this.childNodes.map(a=>{const{type:o}=a,u=String(a.name);return o==="magic-word"&&n.has(u)?n.get(u):a}));return this.type==="magic-link"&&(r=r.replace(vl," ")),r}get link(){const{innerText:n}=this;return this.type==="magic-link"?n.startsWith("ISBN")?`ISBN ${n.slice(5).replace(/[- ]/gu,"").replace(/x$/u,"X")}`:n:ba(n).replace(/\n/gu,"%0A")}lint(n=this.getAbsoluteIndex(),r){const a=super.lint(n,r),o=new de(this,n),{type:u,childNodes:d}=this;if(u==="magic-link"){const x="invalid-isbn",A=C.lintConfig.getSeverity(x);return A&&P(this,t,yn).call(this)&&a.push(te(this,o,x,"invalid-isbn",A)),a}const c=u==="ext-link-url",f="unterminated-url",p=C.lintConfig.getSeverity(f,c?"pipe":"punctuation");if(p){const x=c?/\|/u:/[,;。:!?()]+/u,A=d.find(S=>S.type==="text"&&x.test(S.data));if(A){const{data:S}=A,y=Q(A,o,f,C.msg("in-url",c?'"|"':"full-width-punctuation"),p),{index:$,0:g}=x.exec(S),h=y.startIndex+$;y.suggestions=c?[hs(h,1)]:[hs(h),{desc:C.msg("encode"),range:[h,h+g.length],text:encodeURI(g)}],a.push(y)}}return a}getUrl(n){{const{type:r}=this;let{link:a}=this;if(r==="magic-link"){if(a.startsWith("ISBN"))return this.normalizeTitle(`BookSources/${a.slice(5)}`,-1,{temporary:!0}).getUrl(n);a=a.startsWith("RFC")?`https://datatracker.ietf.org/doc/html/rfc${a.slice(4)}`:`https://pubmed.ncbi.nlm.nih.gov/${a.slice(5)}`}else a.startsWith("//")&&(a=`https:${a}`);return new URL(a)}this.lspError("MagicLinkToken.getUrl")}getAttribute(n){return n==="invalid"?P(this,t,yn).call(this):super.getAttribute(n)}},e=new WeakMap,t=new WeakSet,yn=function(){if(this.type==="magic-link"){const{link:n}=this;if(n.startsWith("ISBN")){const r=[...n.slice(5)].map(a=>a==="X"?10:Number(a));return r.length===10?r.reduce((a,o,u)=>a+o*(10-u),0)%11!==0:r.length===13&&(r[12]===10||r.reduce((a,o,u)=>a+o*(u%2?3:1),0)%10!==0)}}return!1},i)}}),bl,Pi,wl,St,no=I({"src/extLink.ts"(){"use strict";var e,t;dt(),X(),Ke(),G(),V(),Zn(),bl=[We("[")],St=(t=class extends(wl=z){constructor(i,l="",n="",r,a=[]){super(void 0,r,a,{});B(this,e);const o=i&&/^\0\d+f\x7F$/u.test(i)?a[Number(i.slice(1,-2))]:new gs(i,"ext-link-url",r,a);if(this.insertAt(o),E(this,e,l),n){const u=new z(n,r,a,{});u.type="ext-link-text",u.setAttribute("stage",$e-1),this.insertAt(u)}}get type(){return"ext-link"}toString(i){return this.length===1?`[${super.toString(i)}${v(this,e)}]`:`[${super.toString(i,v(this,e))}]`}text(){return`[${super.text(" ")}]`}getGaps(){return v(this,e).length}lint(i=this.getAbsoluteIndex(),l){const n=super.lint(i,l),r="var-anchor",a=C.lintConfig.getSeverity(r,"extLink");return a&&this.length===1&&this.closest("heading-title")&&n.push(te(this,{start:i},r,"variable-anchor",a)),n}print(){return super.print(this.length===1?{pre:"[",post:`${v(this,e)}]`}:{pre:"[",sep:v(this,e),post:"]"})}},e=new WeakMap,t),Pi=re(wl),St=ie(Pi,0,"ExtLinkToken",bl,St),se(Pi,1,St)}}),Sn,Ou=I({"src/imagemapLink.ts"(){"use strict";V(),Ye(),io(),no(),Sn=class extends z{get type(){return"imagemap-link"}constructor(e,t,s,i,l=[]){super(void 0,i,l),this.append(e,t.length===2?new Yn(...t,i,l):new St(...t,i,l),new pe(s,i,l))}}}}),ro={};ae(ro,{ImagemapToken:()=>Zt});var yl,Oi,Sl,Zt,Bu=I({"src/imagemap.ts"(){"use strict";X(),Re(),ge(),Jn(),G(),V(),Ye(),eo(),Ou(),yl=[zs],Zt=class extends(Sl=z){get type(){return"ext-inner"}get image(){return this.childNodes.find(Gs("imagemap-image"))}constructor(e,t=C.getConfig(),s=[]){if(super(void 0,t,s,{}),!e)return;const i=e.split(`
13
- `),l=new Set(t.protocol.split("|")),n=pe;let r=!0,a=!1;for(const o of i){const u=o.trim();if(!(a||!u||u.startsWith("#"))){if(r){const d=o.indexOf("|"),c=d===-1?o:o.slice(0,d),{valid:f,ns:p}=this.normalizeTitle(c,0,{halfParsed:!0,temporary:!0});if(f&&p===6){const x=new yt("imagemap",c,d===-1?void 0:o.slice(d+1),t,s);super.insertAt(x),r=!1;continue}else a=!0}else if(o.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(o);continue}else if(o.includes("[")){const d=o.indexOf("["),c=o.slice(d),f=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(c);if(f){if(this.normalizeTitle(f[1],0,{halfParsed:!0,temporary:!0,selfLink:!0}).valid){super.insertAt(new Sn(o.slice(0,d),f.slice(1),c.slice(c.indexOf("]]")+2),t,s));continue}}else if(c.startsWith("[//")||l.has(c.slice(1,c.indexOf(":")+1))||l.has(c.slice(1,c.indexOf("//")+2))){const p=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(c);if(p){super.insertAt(new Sn(o.slice(0,d),p.slice(1),c.slice(c.indexOf("]")+1),t,s));continue}}}}super.insertAt(new n(o,t,s))}}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),i=new de(this,e),{childNodes:l,image:n}=this,r="invalid-imagemap",a=C.lintConfig.getSeverity(r,n?"link":"image");return a&&(n?s.push(...l.filter(o=>{const u=o.toString().trim();return o.is("noinclude")&&u&&!u.startsWith("#")}).map(o=>{const u=Q(o,i,r,"invalid-imagemap-link",a);return u.suggestions=[Z(u,-1),je(u,"comment","# ")],u})):s.push(te(this,i,r,"imagemap-without-image",a))),s}getAttribute(e){return e==="invalid"?!this.image:super.getAttribute(e)}},Oi=re(Sl),Zt=ie(Oi,0,"ImagemapToken",yl,Zt),se(Oi,1,Zt)}}),Al,Bi,kl,At,lo=I({"src/nowiki/comment.ts"(){"use strict";X(),jt(),Ke(),G(),ht(),Al=[ct(!1),We("<!--")],At=class extends(kl=Ee){constructor(t,s,i,l){super(t,i,l);Ce(this,"closed");this.closed=s}get type(){return"comment"}lint(t=this.getAbsoluteIndex()){if(this.closed)return[];const s="unclosed-comment",i=C.lintConfig.getSeverity(s);if(!i)return[];const l=te(this,{start:t},s,C.msg("unclosed","html-comment"),i);return l.suggestions=[Ve(l.endIndex,"-->")],[l]}toString(t){return t?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"&lt;!--",post:this.closed?"--&gt;":""})}},Bi=re(kl),At=ie(Bi,0,"CommentToken",Al,At),se(Bi,1,At)}}),ao={};ae(ao,{CommentedToken:()=>oo});var oo,qu=I({"src/commented.ts"(){"use strict";V(),lo(),oo=class extends z{get type(){return"ext-inner"}constructor(e,t,s=[]){if(super(void 0,t,s,{AstText:":",CommentToken:":"}),e){let i=e.indexOf("<!--"),l=i!==-1&&e.indexOf("-->",i+4),n=0;for(;l!==!1&&l!==-1;)i>n&&this.insertAt(e.slice(n,i)),this.insertAt(new At(e.slice(i+4,l),!0,t,s)),n=l+3,i=e.indexOf("<!--",n),l=i!==-1&&e.indexOf("-->",i+4);n<e.length&&this.insertAt(e.slice(n))}}lint(e=this.getAbsoluteIndex()){return super.lint(e,new RegExp(String.raw`<\s*(?:\/\s*)?(${this.name})\b`,"giu"))}}}}),uo={};ae(uo,{NowikiToken:()=>co});var $l,_l,co,Wu=I({"src/nowiki/index.ts"(){"use strict";var e,An,s;Je(),X(),G(),ht(),$l=at(i=>new RegExp(String.raw`<\s*(?:/\s*)${i==="nowiki"?"":"?"}(${i})\b`,"giu")),_l=new Set(["languages","section","templatestyles"]),co=(s=class extends Ee{constructor(){super(...arguments);B(this,e)}get type(){return"ext-inner"}lint(l=this.getAbsoluteIndex()){const{name:n}=this,r="void-ext",a=C.lintConfig.getSeverity(r,n);if(a&&P(this,e,An).call(this)){const o=te(this,{start:l},r,C.msg("nothing-in",n),a);return o.suggestions=[Z(o)],[o]}return super.lint(l,$l(n))}getAttribute(l){return l==="invalid"?P(this,e,An).call(this):super.getAttribute(l)}},e=new WeakSet,An=function(){const{name:l,firstChild:{data:n}}=this;return _l.has(l)&&!!n},s)}}),Tl,qi,Cl,kt,ho=I({"src/tagPair/ext.ts"(){"use strict";X(),ge(),G(),Hn(),V(),zn(),Qn(),Tl=[Us()],kt=class extends(Cl=lt){get type(){return"ext"}constructor(e,t,s,i,l=C.getConfig(),n=!1,r=[]){const a=e.toLowerCase(),o=new Ms(!t||/^\s/u.test(t)?t:` ${t}`,"ext-attrs",a,l,r),u={...l,ext:l.ext.filter(c=>c!==a),excludes:[...l.excludes]};let d;switch(u.inExt=!0,a){case"tab":u.ext=u.ext.filter(c=>c!=="tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":case"langconvert":case"phonos":a==="poem"&&u.excludes.push("heading"),d=new z(s,u,r);break;case"pre":{const{PreToken:c}=(Lu(),Y(qa));d=new c(s,u,r);break}case"dynamicpagelist":{const{ParamTagToken:c}=(Ma(),Y(Ua));d=new c(n,s,u,r);break}case"inputbox":{const{InputboxToken:c}=(Eu(),Y(Ga));d=new c(n,s,u,r);break}case"references":{const{NestedToken:c}=(Ci(),Y(Ls));u.excludes.push("heading"),d=new c(s,n,["ref"],u,r);break}case"choose":{const{NestedToken:c}=(Ci(),Y(Ls));d=new c(s,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],u,r);break}case"combobox":{const{NestedToken:c}=(Ci(),Y(Ls));d=new c(s,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],u,r);break}case"gallery":{const{GalleryToken:c}=(Pu(),Y(to));d=new c(s,u,r);break}case"imagemap":{const{ImagemapToken:c}=(Bu(),Y(ro));d=new c(s,u,r);break}case"hiero":{const{CommentedToken:c}=(qu(),Y(ao));d=new c(s,u,r);break}default:{const{NowikiToken:c}=(Wu(),Y(uo));d=new c(s,u,r)}}d.setAttribute("name",a),d.type==="plain"&&(d.type="ext-inner"),super(e,o,d,i,l,r),this.seal("closed",!0)}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),i=new de(this,e);if(this.name!=="nowiki"){const r=this.inHtmlAttrs(),a="parsing-order",o=r&&C.lintConfig.getSeverity(a,r===2?"ext":"templateInTable");o&&s.push(te(this,i,a,"ext-in-html",o))}const l="var-anchor",n=C.lintConfig.getSeverity(l,"ref");return n&&this.name==="ref"&&this.closest("heading-title")&&s.push(te(this,i,l,"variable-anchor",n)),s}},qi=re(Cl),kt=ie(qi,0,"ExtToken",Tl,kt),se(qi,1,kt)}}),go={};ae(go,{parseCommentAndExt:()=>ms});var Wi,Il,As,Nl,Ui,ms,Ds=I({"parser/commentAndExt.ts"(){"use strict";Je(),he(),Tu(),Ye(),Cu(),Iu(),ho(),lo(),Wi="<onlyinclude>",Il="</onlyinclude>",{length:As}=Wi,Nl=[!1,!0].map(e=>{const t=e?"includeonly":"(?:no|only)include",s=e?"noinclude":"includeonly";return Aa(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"))}),Ui=e=>{const t=e.indexOf(Wi);return{i:t,j:e.indexOf(Il,t+As)}},ms=(e,t,s,i)=>{if(i){let{i:a,j:o}=Ui(e);if(a!==-1&&o!==-1){let u="";const d=c=>{new pe(c,t,s),u+=`\0${s.length-1}n`};for(;a!==-1&&o!==-1;){const c=`\0${s.length}e`;new Qt(e.slice(a+As,o),t,s),a>0&&d(e.slice(0,a)),u+=c,e=e.slice(o+As+1),{i:a,j:o}=Ui(e)}return e&&d(e),u}}const{ext:l}=t,n=l.filter(a=>a!=="translate"&&a!=="tvar"),r={...t,ext:n};if(l.includes("translate")){const a=[];e=e.replace(/<nowiki>[\s\S]*?<\/nowiki>/giu,o=>(a.push(o),`\0${a.length-1}`)).replace(/<translate( nowrap)?>([\s\S]+?)?<\/translate>/gu,(o,u,d)=>{const c=s.length;return new Ra(u,d&&Ne(d,a),r,s),`\0${c}g`}),e=Ne(e,a)}return e.replace(Nl[i?1:0](n),(a,o,u,d,c,f,p,x,A)=>{const S=s.length;let y="n";if(o)y="e",new kt(o,u,d,c,r,f,s);else if(a.startsWith("<!--")){y="c";const $=a.endsWith("-->");new At(Ne(a,s,1).slice(4,$?-3:void 0),$,t,s)}else f?new Jt(f,p&&Ne(p,s,1),x&&Ne(x,s,1),A,t,s):new pe(a,t,s);return`\0${S}${y}`})}}}),Ll,Fl,jl,El,Mi,Rl,es,Uu=I({"src/html.ts"(){"use strict";var e,t,s,i,l;X(),Re(),ge(),Hn(),G(),V(),Ll=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),Fl=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"]),jl=new Set(["strike","big","center","font","tt"]),El=[Us()],es=(l=class extends(Rl=z){constructor(r,a,o,u,d,c){super(void 0,d,c);B(this,e);B(this,t);B(this,s);B(this,i);this.insertAt(a),this.setAttribute("name",r.toLowerCase()),E(this,e,o),E(this,t,u),E(this,s,r)}get type(){return"html"}get selfClosing(){return v(this,t)}get closing(){return v(this,e)}toString(r){return`<${this.closing?"/":""}${v(this,s)}${super.toString(r)}${v(this,t)?"/":""}>`}text(){const{closing:r}=this,a=v(this,s)+(r?"":super.text());return`<${r?"/":""}${a}${v(this,t)?"/":""}>`}getAttribute(r){return r==="invalid"?this.inTableAttrs()===2:r==="padding"?v(this,s).length+(this.closing?2:1):super.getAttribute(r)}lint(r=this.getAbsoluteIndex(),a){var w;const o=super.lint(r,a),{name:u,parentNode:d,closing:c,selfClosing:f}=this,p=new de(this,r),x=this.inTableAttrs();let A="h1",S=C.lintConfig.getSeverity(A,"html");if(S&&u==="h1"&&!c){const m=te(this,p,A,"<h1>",S);m.suggestions=[{desc:"h2",range:[r+2,r+3],text:"2"}],o.push(m)}if(A="parsing-order",S=x&&C.lintConfig.getSeverity(A,x===2?"html":"templateInTable"),S){const m=te(this,p,A,"html-in-table",S);x===2&&(m.suggestions=[Z(m)]),o.push(m)}if(A="obsolete-tag",S=C.lintConfig.getSeverity(A,u),S&&jl.has(u)&&o.push(te(this,p,A,"obsolete-tag",S)),A="bold-header",S=C.lintConfig.getSeverity(A,u),S&&(u==="b"||u==="strong")&&((w=this.closest("heading-title,ext"))==null?void 0:w.type)==="heading-title"){const m=te(this,p,A,"bold-in-header",S);m.suggestions=[Z(m)],o.push(m)}const{html:[,y,$]}=this.getAttribute("config"),g=$.includes(u),h=y.includes(u),b=!g&&!h;if(A="unmatched-tag",c&&(f||g)||f&&b){if(S=C.lintConfig.getSeverity(A,c?"both":"selfClosing"),S){const m=te(this,p,A,c?"closing-and-self-closing":"invalid-self-closing",S),_=Pn(r),k={desc:C.msg("no-self-closing"),range:[m.endIndex-2,m.endIndex-1],text:""};h?m.suggestions=[_,k]:c?m.fix=g?_:k:m.suggestions=[k,Ve(m.endIndex,`></${u}>`,-2)],o.push(m)}}else if(!this.findMatchingTag()){const m=te(this,p,A,c?"unmatched-closing":"unclosed-tag"),_=this.closest("magic-word");if(_&&Ll.has(_.name))S=C.lintConfig.getSeverity(A,"conditional");else if(c)S=C.lintConfig.getSeverity(A,"closing"),m.suggestions=[Z(m)];else{S=C.lintConfig.getSeverity(A,"opening");const k=d==null?void 0:d.childNodes;Fl.has(u)&&(k!=null&&k.slice(0,k.indexOf(this)).some(T=>T.type==="html"&&T.name===u&&!T.findMatchingTag())&&(m.suggestions=[Ve(r+1,"/")]),this.closest("heading-title")&&(m.rule="format-leakage",S=C.lintConfig.getSeverity("format-leakage",u)))}S&&(m.severity=S,o.push(m))}return o}findMatchingTag(){return ot(v(this,i),()=>{const{name:r,parentNode:a,closing:o,selfClosing:u}=this,{html:[,d,c]}=this.getAttribute("config"),f=c.includes(r),p=d.includes(r);if(f||p&&u)return this;if(!a)return;const{childNodes:x}=a,A=x.indexOf(this),S=o?x.slice(0,A).reverse():x.slice(A+1),y=[this],{rev:$}=ve;for(const g of S)if(!(!g.is("html")||g.name!==r||p&&v(g,t)))if(v(g,e)===o)y.push(g);else{const h=y.pop();if(h===this)return g;C.viewOnly&&(E(h,i,[$,g]),E(g,i,[$,h]))}if(C.viewOnly)for(const g of y)E(g,i,[$,void 0])},r=>{E(this,i,r),r[1]&&r[1]!==this&&E(r[1],i,[ve.rev,this])})}print(){return super.print({pre:`&lt;${this.closing?"/":""}${v(this,s)}`,post:`${v(this,t)?"/":""}&gt;`})}json(r,a=this.getAbsoluteIndex()){const o=super.json(void 0,a);return Object.assign(o,{closing:this.closing,selfClosing:v(this,t)}),o}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,l),Mi=re(Rl),es=ie(Mi,0,"HtmlToken",El,es),se(Mi,1,es)}}),po={};ae(po,{parseHtml:()=>fo});var Pl,fo,Mu=I({"parser/html.ts"(){"use strict";Qn(),Uu(),Pl=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,fo=(e,t,s)=>{var r;const{html:i}=t;(r=t.htmlElements)!=null||(t.htmlElements=new Set([...i[0],...i[1],...i[2]]));const l=e.split("<");let n=l.shift();for(const a of l){const o=Pl.exec(a),u=o==null?void 0:o[2],d=u==null?void 0:u.toLowerCase();if(!o||!t.htmlElements.has(d)){n+=`<${a}`;continue}const[,c,,f="",p,x]=o,{length:A}=s,S=new Ms(f,"html-attrs",d,t,s),y=S.hasAttr("itemprop");if(d==="meta"&&!(y&&S.hasAttr("content"))||d==="link"&&!(y&&S.hasAttr("href"))){n+=`<${a}`,s.length=A;continue}n+=`\0${s.length}x${x}`,new es(u,S,c==="/",p==="/>",t,s)}return n}}}),Ol,er,mo=I({"src/table/base.ts"(){"use strict";Hn(),G(),V(),Ft(),Qn(),Ol=e=>{const t=e.childNodes.map(i=>i.type==="text"?i.data.replace(/\|\|/gu,"{{!!}}").replace(/\|/gu,"{{!}}"):i.toString()).join(""),{childNodes:s}=C.parse(t,e.getAttribute("include"),2,e.getAttribute("config"));e.safeReplaceChildren(s)},er=class extends Us(1)(z){constructor(e,t,s,i,l,n=[],r){super(void 0,l,n,r),this.append(new Qe(t,"table-syntax",l,n),new Ms(i,"table-attrs",s,l,n))}escape(){for(const e of this.childNodes)e instanceof Qe?Ol(e):e.escape()}}}}),Bl,zi,ye,ks,Wt,Ut,Rs,xo=I({"src/table/td.ts"(){"use strict";X(),ge(),Mn(),G(),V(),mo(),Rs=class extends(zi=er,Bl=[Bs(!1)],zi){constructor(e,t,s,i=[]){var a;let l=/\||\0\d+!\x7F/u.exec(t!=null?t:""),n=l?t.slice(0,l.index):"";/\[\[|-\{/u.test(n)&&(l=null,n=""),super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",n,s,i),se(ks,5,this),He(this,Wt),He(this,ye,""),l&&([mu(this,ye)._]=l);const r=new z(t==null?void 0:t.slice(((a=l==null?void 0:l.index)!=null?a:NaN)+ce(this,ye).length),s,i);r.type="td-inner",r.setAttribute("stage",4),this.insertAt(r)}get type(){return"td"}get rowspan(){return this.getAttr("rowspan")}get colspan(){return this.getAttr("colspan")}get subtype(){return cn(this,Wt,Ut).call(this).subtype}afterBuild(){ce(this,ye).includes("\0")&&ke(this,ye,this.buildFromStr(ce(this,ye),0)),super.afterBuild()}toString(e){const{childNodes:[t,s,i]}=this;return t.toString(e)+s.toString(e)+ce(this,ye)+i.toString(e)}text(){const{childNodes:[e,t,s]}=this;return e.text()+t.text()+ce(this,ye)+s.text()}getGaps(e){return e===1?ce(this,ye).length:0}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),i=new de(this,e+this.getRelativeIndex(this.length-1)),l="pipe-like",n=["td","double"].map(r=>C.lintConfig.getSeverity(l,r));for(const r of this.lastChild.childNodes)if(r.type==="text"){const{data:a}=r;if(a.includes("|")){const o=a.includes("||"),u=n[o?1:0];if(u){const d=Q(r,i,l,"pipe-in-table",u);if(o){const c={caption:"|+",td:"|",th:"!"}[this.subtype];d.fix=je(d,"newline",a.replace(/\|\|/gu,`
14
- ${c}`))}else d.suggestions=[qn(d.startIndex,a)];s.push(d)}}}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(){super.escape(),this.childNodes[1].toString()&&(ce(this,ye)||ke(this,ye,"{{!}}")),ce(this,ye)==="|"&&ke(this,ye,"{{!}}")}print(){const{childNodes:[e,t,s]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${ce(this,ye)}${s.print()}</span>`}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t),{rowspan:i,colspan:l}=this;return Object.assign(s,{subtype:this.subtype},i!==1&&{rowspan:i},l!==1&&{colspan:l}),s}},ks=re(zi),ye=new WeakMap,Wt=new WeakSet,Ut=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:l}=this;return{...cn(e=l,Wt,Ut).call(e)}},Ut=ie(ks,17,"#getSyntax",Bl,Wt,Ut),Fn(ks,Rs)}}),tr,vo=I({"src/table/trBase.ts"(){"use strict";X(),G(),mo(),xo(),tr=class extends er{lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),i=this.childNodes.find(({type:a})=>a==="table-inter");if(!i)return s;const l=rs(i),n="fostered-content",r=l&&C.lintConfig.getSeverity(n,l===2?void 0:"transclusion");if(r){const a=Q(i,{start:e},n,"content-outside-table",r);a.startIndex++,a.startLine++,a.startCol=0,s.push(a)}return s}getRowCount(){return Number(this.childNodes.some(e=>e instanceof Rs&&e.isIndependent()&&!e.firstChild.text().endsWith("+")))}}}}),ql,Wl,Ul,Ml,Hi,$s,Fs,zu=I({"src/table/index.ts"(){"use strict";X(),Re(),ge(),Mn(),G(),vo(),Ft(),ql=(e,t)=>new Array(e).fill(void 0).map((s,i)=>t(i)),Wl=({type:e})=>e==="tr"||e==="table-syntax",Ul=class extends Array{},Fs=class extends(Hi=tr,Ml=[Bs(!1)],Hi){constructor(e,t,s,i){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,e,"table",t,s,i,{}),se($s,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 de(this,e),l=["unclosed-table","table-layout"],n=l.map(r=>C.lintConfig.getSeverity(r));if(n[0]&&!this.closed&&s.push(Q(this.firstChild,i,l[0],C.msg("unclosed","table"),n[0])),n[1]){const r=this.getLayout(),{length:a}=r;if(a>1){let o=1,u=1/0,d=0;for(;d<a;d++){const c=r[d],f=c.length;if(f<o)break;f<u&&(u=f);const p=c.indexOf(c[f-1])+1;if(p>u)break;p>o&&(o=p)}if(d<a){const c=this.getNthRow(d),f=Q(c,i,l[1],"inconsistent-table",n[1]);f.startIndex++,f.startLine++,f.startCol=0,s.push(f)}}}return s}close(e=`
16
- |}`,t){const s=this.getAttribute("config"),i=this.getAttribute("accum");ve.run(()=>{const l=new Qe(t?e:void 0,"table-syntax",s,i);super.insertAt(l)})}getLayout(e){const t=this.getAllRows(),{length:s}=t,i=Ul.from(ql(s,()=>[]));for(let l=0;l<i.length;l++){const n=i[l];let r=0,a=0,o;for(const u of t[l].childNodes.slice(2))if(u.is("td")){if(u.isIndependent()&&(o=u.subtype!=="caption"),o){const d={row:l,column:r},{rowspan:c,colspan:f}=u;for(r++;n[a];)a++;for(let p=l;p<Math.min(l+c,s);p++)for(let x=a;x<a+f;x++)i[p][x]=d;a+=f}}else if(Wl(u))break}return i}getAllRows(){return[...super.getRowCount()?[this]:[],...this.childNodes.slice(1).filter(e=>e.is("tr")&&e.getRowCount()>0)]}getNthRow(e,t,s){const i=super.getRowCount();if(e===0&&i)return this;i&&e--;for(const l of this.childNodes.slice(2)){const{type:n}=l;if(n==="tr"&&l.getRowCount()&&(e--,e<0))return l}}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t);return s.closed=this.closed,s}},$s=re(Hi),ie($s,1,"getLayout",Ml,Fs),Fn($s,Fs)}}),bo,Hu=I({"src/table/tr.ts"(){"use strict";vo(),bo=class extends tr{get type(){return"tr"}constructor(e,t,s,i){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,e,"tr",t,s,i)}}}}),sr,wo=I({"src/nowiki/listBase.ts"(){"use strict";ht(),sr=class extends Ee{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}}}}),ir,yo=I({"src/nowiki/dd.ts"(){"use strict";wo(),ir=class extends sr{get type(){return"dd"}}}}),So={};ae(So,{parseTable:()=>Ao});var zl,Di,Ao,Du=I({"parser/table.ts"(){"use strict";V(),zu(),Hu(),xo(),yo(),zl=e=>e.lastChild.constructor!==z,Di=(e,t)=>e.is("td")?t.pop():e,Ao=({firstChild:{data:e},type:t,name:s},i,l)=>{const n=[],r=e.split(`
17
- `);let a=t==="root"||t==="parameter-value"||t==="ext-inner"&&s==="poem"?"":`
18
- ${r.shift()}`,o;const u=(d,c)=>{if(!c){a+=d;return}const{lastChild:f}=c;if(zl(c)){const p=new z(d,i,l);p.type="table-inter",p.setAttribute("stage",3),c.insertAt(p)}else f.setText(f.toString()+d)};for(const d of r){o=n.pop();const[c]=/^(?:\s|\0\d+[cno]\x7F)*/u.exec(d),f=d.slice(c.length),p=/^(:*)((?:\s|\0\d+[cn]\x7F)*)(\{\||\{(?:\0\d+[cn]\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(f);if(p){for(;o&&!o.is("td");)o=n.pop();const[,g,h,b,w]=p;g&&new ir(g,i,l),u(`
19
- ${c}${g&&`\0${l.length-1}d`}${h}\0${l.length}b`,o),n.push(...o?[o]:[],new Fs(b,w,i,l));continue}else if(!o){a+=`
20
- ${d}`;continue}const x=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(f);if(!x){u(`
21
- ${d}`,o),n.push(o);continue}const[,A,S,y,$]=x;if(A){for(;!o.is("table");)o=n.pop();o.close(`
22
- ${c}${A}`,!0),u($,n[n.length-1])}else if(S){o=Di(o,n),o.is("tr")&&(o=n.pop());const g=new bo(`
23
- ${c}${S}`,$,i,l);n.push(o,g),o.insertAt(g)}else{o=Di(o,n);const g=y==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu;let h=g.exec($),b=0,w=`
24
- ${c}${y}`;const m=_=>{const k=new Rs(w,$.slice(b,h==null?void 0:h.index),i,l);return _.insertAt(k),k};for(;h;)m(o),{lastIndex:b}=g,[w]=h,h=g.exec($);n.push(o,m(o))}}return a.slice(1)}}}),ko,Gu=I({"src/nowiki/hr.ts"(){"use strict";ht(),ko=class extends Ee{get type(){return"hr"}}}}),Hl,Gi,Dl,ts,Vu=I({"src/nowiki/doubleUnderscore.ts"(){"use strict";jt(),Ke(),ht(),Hl=[ct(),We("__")],ts=class extends(Dl=Ee){get type(){return"double-underscore"}constructor(e,t,s,i){var a,o;super(e,s,i);const l=e.toLowerCase(),{doubleUnderscore:[,,n,r]}=s;this.setAttribute("name",(o=t?(a=r==null?void 0:r[e])==null?void 0:a.toLowerCase():n==null?void 0:n[l])!=null?o:l)}toString(){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}},Gi=re(Dl),ts=ie(Gi,0,"DoubleUnderscoreToken",Hl,ts),se(Gi,1,ts)}}),$o={};ae($o,{parseHrAndDoubleUnderscore:()=>_o});var _o,Qu=I({"parser/hrAndDoubleUnderscore.ts"(){"use strict";Gu(),Vu(),za(),_o=({firstChild:{data:e},type:t,name:s},i,l)=>{var o,u,d;const{doubleUnderscore:[n,r,a]}=i;return(o=i.insensitiveDoubleUnderscore)!=null||(i.insensitiveDoubleUnderscore=new Set(n)),(u=i.sensitiveDoubleUnderscore)!=null||(i.sensitiveDoubleUnderscore=new Set(r)),(d=i.regexHrAndDoubleUnderscore)!=null||(i.regexHrAndDoubleUnderscore=new RegExp(`__(${[...n,...r].join("|")})__`,"giu")),t!=="root"&&(t!=="ext-inner"||s!=="poem")&&(e=`\0${e}`),e=e.replace(/^((?:\0\d+[cno]\x7F)*)(-{4,})/gmu,(c,f,p)=>(new ko(p,i,l),`${f}\0${l.length-1}r`)).replace(i.regexHrAndDoubleUnderscore,(c,f)=>{var S;const p=i.sensitiveDoubleUnderscore.has(f),x=f.toLowerCase(),A=i.insensitiveDoubleUnderscore.has(x);return p||A?(new ts(f,p,i,l),`\0${l.length-1}${A&&((S=a==null?void 0:a[x])!=null?S:x)==="toc"?"u":"n"}`):c}),i.excludes.includes("heading")||(e=e.replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(c,f,p,x,A)=>{const S=`${f}\0${l.length}h`;return new wt(p.length,[x,A],i,l),S})),t==="root"||t==="ext-inner"&&s==="poem"?e:e.slice(1)}}}),To,Ju=I({"src/nowiki/quote.ts"(){"use strict";var e,t;X(),ge(),G(),ht(),To=(t=class extends Ee{constructor(i,l,n,r){super(i,n,r);B(this,e);E(this,e,l)}get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}get closing(){return{...this.bold?{bold:v(this,e).bold}:void 0,...this.italic?{italic:v(this,e).italic}:void 0}}text(){const{parentNode:i,innerText:l}=this;return i!=null&&i.is("image-parameter")&&i.name!=="caption"?"":l}lint(i=this.getAbsoluteIndex()){var p;const{previousSibling:l,bold:n,closing:r}=this,a=(l==null?void 0:l.type)==="text"?l.data:void 0,o=[],u=new de(this,i),d=["lonely-apos","bold-header"],c=[void 0,"word"].map(x=>C.lintConfig.getSeverity(d[0],x)),f=C.lintConfig.getSeverity(d[1]);if(a!=null&&a.endsWith("'")){const x=c[(r.bold||r.italic)&&/[a-z\d]'$/iu.test(a)?1:0];if(x){const A=te(this,u,d[0],C.msg("lonely","'"),x),{startLine:S,startCol:y}=A,[,{length:$}]=/(?:^|[^'])('+)$/u.exec(a),g=i-$,h={...A,startIndex:g,endIndex:i,endLine:S,startCol:y-$,endCol:y};h.suggestions=[It(g,"&apos;",$),Z(h)],o.push(h)}}if(f&&n&&((p=this.closest("heading-title,ext"))==null?void 0:p.type)==="heading-title"){const x=te(this,u,d[1],"bold-in-header",f);x.suggestions=[Z(x)],o.push(x)}return o}json(i,l=this.getAbsoluteIndex()){const n=super.json(void 0,l);return Object.assign(n,{bold:this.bold,italic:this.italic}),n}},e=new WeakMap,t)}}),Co={};ae(Co,{parseQuotes:()=>nr});var nr,Io=I({"parser/quotes.ts"(){"use strict";Ju(),nr=(e,t,s,i)=>{var p;const l=e.split(/('{2,})/u),{length:n}=l;if(n===1)return e;let r=0,a=0,o,u,d;for(let x=1;x<n;x+=2){const A=l[x].length;switch(A){case 2:a++;break;case 4:l[x-1]+="'",l[x]="'''";case 3:if(r++,o!==void 0)break;l[x-1].endsWith(" ")?u===void 0&&d===void 0&&(d=x):l[x-1].slice(-2,-1)===" "?o=x:u!=null||(u=x);break;default:l[x-1]+="'".repeat(A-5),l[x]="'''''",a++,r++}}if(a%2===1&&r%2===1){const x=(p=o!=null?o:u)!=null?p:d;x!==void 0&&(l[x]="''",l[x-1]+="'")}let c=!0,f=!0;for(let x=1;x<n;x+=2){const A=l[x].length,S=A!==2,y=A!==3;S&&(c=!c),y&&(f=!f),new To(l[x],{bold:S&&c,italic:y&&f},t,s),l[x]=`\0${s.length-1}q`}return l.join("")}}}),No={};ae(No,{parseExternalLinks:()=>rr});var rr,Lo=I({"parser/externalLinks.ts"(){"use strict";he(),no(),Zn(),rr=(e,t,s,i)=>{var l;return(l=t.regexExternalLinks)!=null||(t.regexExternalLinks=new RegExp(String.raw`\[((?:\0\d+[cn]\x7F)*(?:\0\d+f\x7F|(?:(?:${t.protocol}|//)${$t}|\0\d+m\x7F)${_t}(?=[[\]<>"\t${Ge}]|\0\d)))([${Ge}]*(?![${Ge}]))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),e.replace(t.regexExternalLinks,(n,r,a,o)=>{const{length:u}=s,d=/&[lg]t;/u.exec(r);return d&&(a="",o=r.slice(d.index)+a+o,r=r.slice(0,d.index)),i?(new gs(r,"ext-link-url",t,s),`[\0${u}f${a}${o}]`):(new St(r,a,o,t,s),`\0${u}w`)})}}}),Fo,Xu=I({"src/link/category.ts"(){"use strict";he(),Ws(),Fo=class extends De{get type(){return"category"}get sortkey(){const{childNodes:[,e]}=this;return e&&os(e.text())}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t),{sortkey:i}=this;return i&&(s.sortkey=i),s}}}}),jo={};ae(jo,{parseLinks:()=>kn});var Gl,kn,Ku=I({"parser/links.ts"(){"use strict";G(),Io(),Lo(),io(),Za(),Xu(),Gl=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)([\s\S]*)$/u,kn=(e,t,s,i)=>{var a;(a=t.regexLinks)!=null||(t.regexLinks=new RegExp(String.raw`^\s*(?:${t.protocol}|//)`,"iu"));const l=t.inExt?/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]]))?\]\]([\s\S]*)$/u:/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]])?)?\]\]([\s\S]*)$/u,n=e.split("[[");let r=n.shift();for(let o=0;o<n.length;o++){let u=!1,d,c,f,p;const x=n[o],A=l.exec(x);if(A)[,d,c,f,p]=A,p.startsWith("]")&&(f!=null&&f.includes("["))&&(f+="]",p=p.slice(1));else{const h=Gl.exec(x);h&&(u=!0,[,d,c,f]=h)}if(d===void 0||t.regexLinks.test(d)||/\0\d+[exhbru]\x7F/u.test(d)){r+=`[[${x}`;continue}const S=d.trim().startsWith(":");if(S&&u){r+=`[[${x}`;continue}const{ns:y,valid:$}=C.normalizeTitle(d,0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0});if($){if(u){if(y!==6){r+=`[[${x}`;continue}let h=!1;for(o++;o<n.length;o++){const b=n[o],w=b.split("]]");if(w.length>2){h=!0,f+=`[[${w[0]}]]${w[1]}`,p=w.slice(2).join("]]");break}else if(w.length===2)f+=`[[${w[0]}]]${w[1]}`;else{f+=`[[${b}`;break}}if(f=kn(f,t,s,i),!h){r+=`[[${d}${c}${f}`;continue}}}else{r+=`[[${x}`;continue}f&&(f=nr(f,t,s,i));let g=Yn;S||(y===6?(f&&(f=rr(f,t,s,!0)),g=Kn):y===14&&(g=Fo)),f===void 0&&c&&(f=""),r+=`\0${s.length}l${p}`,new g(d,f,t,s,c)}return r}}}),Eo={};ae(Eo,{parseMagicLinks:()=>Ro});var Vi,Qi,Ji,Xi,Ro,Yu=I({"parser/magicLinks.ts"(){"use strict";he(),Zn(),Vi=String.raw`[${Ge}\t]|&nbsp;|&#0*160;|&#x0*a0;`,Qi=`(?:${Vi})+`,Ji=`(?:${Vi}|-)`,Xi=String.raw`(?:RFC|PMID)${Qi}\d+\b|ISBN${Qi}(?:97[89]${Ji}?)?(?:\d${Ji}?){9}[\dx]\b`,Ro=(e,t,s)=>{if(!t.regexMagicLinks)try{t.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${t.protocol})(${$t}${_t})|${Xi})`,"giu")}catch{t.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${t.protocol})(${$t}${_t})|${Xi})`,"giu")}return e.replace(t.regexMagicLinks,(i,l,n)=>{let r=l?i.slice(l.length):i;if(n){let a="";const o=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(r);o&&(a=r.slice(o.index),r=r.slice(0,o.index));const u=r.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,d=u.exec(r);if(d){let c=1;d[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(r.slice(0,d.index))&&(c=2),a=r.slice(d.index+c)+a,r=r.slice(0,d.index+c)}return a.length>=n.length?i:(new gs(r,void 0,t,s),`${l}\0${s.length-1}w${a}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(r))return i;return new gs(r,"magic-link",t,s),`${l}\0${s.length-1}i`})}}}),Po,Zu=I({"util/html.ts"(){"use strict";Po=(e,t)=>e.startsWith(t)?t.length:[...t].findIndex((s,i)=>s!==e[i])}}),Oo,ed=I({"src/nowiki/list.ts"(){"use strict";wo(),Oo=class extends sr{get type(){return"list"}}}}),Bo={};ae(Bo,{parseList:()=>qo});var qo,td=I({"parser/list.ts"(){"use strict";Zu(),ed(),yo(),qo=(e,t,s,i)=>{const l=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(e);if(!l)return t.lastPrefix="",e;const[n,r,a,o]=l,u=a.replace(/;/gu,":"),d=Po(u,t.lastPrefix),c=((d>1?a.slice(d-1):a)+o).split(/(?=;)/u),f=c[0].startsWith(";");let p=c.length-(f?0:1);if(d>1){const T=a.slice(0,d-1);if(f){const O=T.split(/(?=;)/u);c.unshift(...O),p+=T.includes(";")?O.length:0}else c[0]=T+c[0]}t.lastPrefix=u;let x=r+c.map((T,O)=>`\0${i.length+O}d`).join("")+e.slice(n.length);for(const T of c)new Oo(T,s,i);if(!p)return x;const{html:[A,,S]}=s,y=/:+|-\{|\0\d+[xq]\x7F/gu;let $=y,g=$.exec(x),h=0,b=!1,w=!1,m=0;const _=(T,O)=>(new ir(T,s,i),`${x.slice(0,O)}\0${i.length-1}d${x.slice(O+T.length)}`),k=T=>{T?h&&h--:h++};for(;g&&p;){const{0:T,index:O}=g;if(T==="-{"){if(!m){const{lastIndex:L}=$;$=/-\{|\}-/gu,$.lastIndex=L}m++}else if(T==="}-"){if(m--,!m){const{lastIndex:L}=$;$=y,$.lastIndex=L}}else if(T.endsWith("x")){const{name:L,closing:j,selfClosing:W}=i[Number(T.slice(1,-2))];(A.includes(L)||!W&&!S.includes(L))&&k(j)}else if(T.endsWith("q")){const{bold:L,italic:j}=i[Number(T.slice(1,-2))];L&&(k(b),b=!b),j&&(k(w),w=!w)}else if(h===0){if(T.length>=p)return _(T.slice(0,p),O);p-=T.length,$.lastIndex=O+4+String(i.length).length,x=_(T,O)}g=$.exec(x)}return x}}}),_s,Vl,Ki,Ql,ss,sd=I({"src/converterFlags.ts"(){"use strict";var e,t;X(),ge(),qs(),G(),V(),Xe(),_s=new Set(["A","T","R","D","-","H","N"]),Vl=[fs()],ss=(t=class extends(Ql=z){constructor(i,l,n=[]){super(void 0,l,n,{});B(this,e);this.safeAppend(i.map(r=>new Se(r,"converter-flag",l,n)))}get type(){return"converter-flags"}afterBuild(){E(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(v(this,e).filter(i=>/\{{3}[^{}]+\}{3}/u.test(i)))}getVariantFlags(){const i=new Set(this.getAttribute("config").variants);return new Set(v(this,e).filter(l=>i.has(l)))}isInvalidFlag(i,l,n,r){return typeof i=="object"&&(i=i.text().trim(),l=this.getVariantFlags(),n=this.getUnknownFlags(),r=new Set(v(this,e).filter(a=>_s.has(a)))),!!i&&!l.has(i)&&!n.has(i)&&(l.size>0||!r.has(i))}lint(i=this.getAbsoluteIndex(),l){const n=this.getVariantFlags(),r=this.getUnknownFlags(),a=new Set(v(this,e).filter(p=>_s.has(p))),o=v(this,e).filter(p=>!p).length,u=v(this,e).length-r.size-o,d=super.lint(i,l);if(n.size===u||a.size===u)return d;const c="no-ignored",f=C.lintConfig.getSeverity(c,"conversionFlag");if(f){const p=new de(this,i);for(let x=0;x<this.length;x++){const A=this.childNodes[x],S=A.text().trim();if(this.isInvalidFlag(S,n,r,a)){const y=Q(A,p,c,"invalid-conversion-flag",f);n.size===0&&_s.has(S.toUpperCase())?y.fix=Bn(y,S):y.suggestions=[Z(y,x&&-1)],d.push(y)}}}return d}print(){return super.print({sep:";"})}},e=new WeakMap,t),Ki=re(Ql),ss=ie(Ki,0,"ConverterFlagsToken",Vl,ss),se(Ki,1,ss)}}),js,id=I({"src/converterRule.ts"(){"use strict";G(),V(),Xe(),js=class extends z{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=C.getConfig(),i=[]){super(void 0,s,i);const l=e.indexOf(":"),n=e.slice(0,l).indexOf("=>"),r=n===-1?e.slice(0,l):e.slice(n+2,l);t&&s.variants.includes(r.trim().toLowerCase())?(super.insertAt(new Se(r,"converter-rule-variant",s,i)),super.insertAt(new Se(e.slice(l+1),"converter-rule-to",s,i)),n!==-1&&super.insertAt(new Se(e.slice(0,n),"converter-rule-from",s,i),0)):super.insertAt(new Se(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}}}}),Jl,Yi,Xl,is,nd=I({"src/converter.ts"(){"use strict";he(),Ke(),qe(),V(),sd(),id(),Jl=[Oe,We("-{")],is=class extends(Xl=z){get type(){return"converter"}constructor(e,t,s,i=[]){super(void 0,s,i),this.insertAt(new ss(e,s,i));const[l]=t,n=l.includes(":"),r=new js(l,n,s,i);n&&r.length===1||!n&&t.length===2&&!Le(t[1]).trim()?this.insertAt(new js(t.join(";"),!1,s,i)):this.append(r,...t.slice(1).map(a=>new js(a,!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()}|${ut(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>`}},Yi=re(Xl),is=ie(Yi,0,"ConverterToken",Jl,is),se(Yi,1,is)}}),Wo={};ae(Wo,{parseConverter:()=>Uo});var Uo,rd=I({"parser/converter.ts"(){"use strict";nd(),Uo=(e,t,s)=>{var o;(o=t.regexConverter)!=null||(t.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${t.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"iu"));const i=/-\{/gu,l=/-\{|\}-/gu,n=[];let r=i,a=r.exec(e);for(;a;){const{0:u,index:d}=a;if(u==="}-"){const c=n.pop(),{length:f}=s,p=e.slice(c.index+2,d),x=p.indexOf("|"),[A,S]=x===-1?[[],p]:[p.slice(0,x).split(";"),p.slice(x+1)],y=S.replace(/(&[#a-z\d]+);/giu,"$1"),$=y.split(t.regexConverter).map(g=>g.replace(/\x01/gu,";"));new is(A,$,t,s),e=`${e.slice(0,c.index)}\0${f}v${e.slice(d+2)}`,n.length===0&&(r=i),r.lastIndex=c.index+3+String(f).length}else n.push(a),r=l,r.lastIndex=d+2;a=r.exec(e)}return e}}}),ls={};ae(ls,{Token:()=>z});var Kl,z,V=I({"src/index.ts"(){"use strict";var e,t,s,i,l,n,r,a,Mo,zo,Ho,Do,Go,Vo,Qo,Jo,Xo,Ko,Yo,Zo,h;he(),dt(),X(),Re(),G(),yu(),Au(),Kl=["category","html-attr#id,ext-attr#id,table-attr#id"],z=(h=class extends Dt{constructor(m,_=C.getConfig(),k=[],T){super();B(this,a);B(this,e,"plain");B(this,t,0);B(this,s);B(this,i);B(this,l);B(this,n,!1);B(this,r);typeof m=="string"&&this.insertAt(m),E(this,s,_),E(this,i,k),k.push(this)}get type(){return v(this,e)}set type(m){E(this,e,m)}parseOnce(m=v(this,t),_=!1,k){if(m<v(this,t)||this.length===0||!this.isPlain())return this;if(v(this,t)>=$e)return this;switch(m){case 0:if(this.type==="root"){v(this,i).pop();const T=P(this,a,Mo).call(this);_&&(_=!T)}E(this,l,_),P(this,a,zo).call(this,_);break;case 1:P(this,a,Ho).call(this);break;case 2:P(this,a,Do).call(this);break;case 3:P(this,a,Go).call(this);break;case 4:P(this,a,Vo).call(this);break;case 5:P(this,a,Qo).call(this,k);break;case 6:P(this,a,Jo).call(this,k);break;case 7:P(this,a,Xo).call(this);break;case 8:P(this,a,Ko).call(this);break;case 9:P(this,a,Yo).call(this);break;case 10:P(this,a,Zo).call(this)}if(this.type==="root")for(const T of v(this,i))T==null||T.parseOnce(m,_,k);return or(this,t)._++,this}buildFromStr(m,_){const k=m.split(/[\0\x7F]/u).map((T,O)=>{if(O%2===0)return new fn(T);if(isNaN(T.slice(-1)))return v(this,i)[Number(T.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${T}`)});return _===0?k.map(String).join(""):_===1?ut(k):k}build(){E(this,t,$e);const{length:m,firstChild:_}=this,k=_==null?void 0:_.toString();if(m===1&&_.type==="text"&&k.includes("\0")&&(ps(this,0,1,this.buildFromStr(k)),this.normalize(),this.type==="root"))for(const T of v(this,i))T==null||T.build()}afterBuild(){if(this.type==="root")for(const m of v(this,i))m==null||m.afterBuild();E(this,n,!0)}parse(m=$e,_,k){for(m=Math.min(m,$e);v(this,t)<m;)this.parseOnce(v(this,t),_,k);return m&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===h}getAttribute(m){var _;switch(m){case"config":return v(this,s);case"include":return(_=v(this,l))!=null?_:!!v(this.getRootNode(),l);case"accum":return v(this,i);case"built":return v(this,n);case"stage":return v(this,t);case"invalid":return this.type==="table-inter"&&rs(this)===2;default:return super.getAttribute(m)}}setAttribute(m,_){switch(m){case"stage":v(this,t)===0&&this.type==="root"&&v(this,i).shift(),E(this,t,_);break;default:super.setAttribute(m,_)}}insertAt(m,_=this.length){const k=typeof m=="string"?new fn(m):m;super.insertAt(k,_);const{type:T}=k;return T==="root"&&(k.type="plain"),k}normalizeTitle(m,_=0,k){return C.normalizeTitle(m,_,v(this,l),v(this,s),k)}inTableAttrs(){var m,_;return((m=this.closest("table-attrs,ext"))==null?void 0:m.type)==="table-attrs"&&((_=this.closest("table-attrs,arg,magic-word,template"))!=null&&_.is("table-attrs")?2:1)}inHtmlAttrs(){var m;return(m=this.closest("html-attrs,ext"))!=null&&m.is("html-attrs")?2:this.inTableAttrs()}lint(m=this.getAbsoluteIndex(),_){var T;let k=super.lint(m,_);if(this.type==="root"){const O=new Map,L="no-duplicate",j=["category","id"].map(F=>C.lintConfig.getSeverity(L,F)),W=Kl.filter((F,U)=>j[U]).join();if(W){for(const F of this.querySelectorAll(W)){let U;if(F.is("category"))U=F.name;else{const H=F.getValue();H&&H!==!0&&(U=`#${H}`)}if(U){const H=O.get(U);H?H.add(F):O.set(U,new Set([F]))}}for(const[F,U]of O)if(U.size>1&&!F.startsWith("#mw-customcollapsible-")){const H=!F.startsWith("#"),D=`duplicate-${H?"category":"id"}`,ee=j[H?0:1];k.push(...[...U].map(ne=>{const ue=te(ne,{start:ne.getAbsoluteIndex()},L,D,ee);return H&&(ue.suggestions=[Z(ue)]),ue}))}}const N=/<!--\s*lint-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->/gu,R=this.toString(),J=[];let q=N.exec(R);for(;q;){const{1:F,index:U}=q,H=(T=q[2])==null?void 0:T.trim();J.push({line:this.posFromIndex(U).top+(F==="disable-line"?0:1),from:F==="disable"?N.lastIndex:void 0,to:F==="enable"?N.lastIndex:void 0,rules:H?new Set(H.split(",").map(D=>D.trim())):void 0}),q=N.exec(R)}if(k=k.filter(({rule:F,startLine:U,startIndex:H})=>{const D={pos:0};for(const{line:ee,from:ne,to:ue,rules:Te}of J){if(ee>U+1)break;if(Te&&!Te.has(F))continue;if(ee===U&&ne===void 0&&ue===void 0)return!1;ne<=H&&ne>D.pos?(D.pos=ne,D.type="from"):ue<=H&&ue>D.pos&&(D.pos=ue,D.type="to")}return D.type!=="from"}),k.some(({fix:F})=>F)){const F=k.map(({fix:D})=>D).filter(Boolean).sort(({range:[D,ee]},{range:[ne,ue]})=>ee===ue?ne-D:ue-ee);let U=1/0,H=R;for(const{range:[D,ee],text:ne}of F)ee<=U&&(H=H.slice(0,D)+ne+H.slice(ee),U=D);Object.assign(k,{output:H})}}return k}toString(m,_){return m?super.toString(!0,_):ot(v(this,r),()=>super.toString(!1,_),k=>{const T=this.getRootNode();T.type==="root"&&v(T,n)&&E(this,r,k)})}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,l=new WeakMap,n=new WeakMap,r=new WeakMap,a=new WeakSet,Mo=function(){const{parseRedirect:m}=(_u(),Y(ja)),_=this.firstChild.toString(),k=m(_,v(this,s),v(this,i));return k&&this.setText(k),!!k},zo=function(m){const{parseCommentAndExt:_}=(Ds(),Y(go));this.setText(_(this.firstChild.toString(),v(this,s),v(this,i),m))},Ho=function(){const{parseBraces:m}=(Xn(),Y(Da)),_=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,k=m(_,v(this,s),v(this,i));this.setText(this.type==="root"?k:k.slice(1))},Do=function(){if(v(this,s).excludes.includes("html"))return;const{parseHtml:m}=(Mu(),Y(po));this.setText(m(this.firstChild.toString(),v(this,s),v(this,i)))},Go=function(){if(v(this,s).excludes.includes("table"))return;const{parseTable:m}=(Du(),Y(So));this.setText(m(this,v(this,s),v(this,i)))},Vo=function(){if(v(this,s).excludes.includes("hr"))return;const{parseHrAndDoubleUnderscore:m}=(Qu(),Y($o));this.setText(m(this,v(this,s),v(this,i)))},Qo=function(m){const{parseLinks:_}=(Ku(),Y(jo));this.setText(_(this.firstChild.toString(),v(this,s),v(this,i),m))},Jo=function(m){if(v(this,s).excludes.includes("quote"))return;const{parseQuotes:_}=(Io(),Y(Co)),k=this.firstChild.toString().split(`
25
- `);for(let T=0;T<k.length;T++)k[T]=_(k[T],v(this,s),v(this,i),m);this.setText(k.join(`
26
- `))},Xo=function(){if(v(this,s).excludes.includes("extLink"))return;const{parseExternalLinks:m}=(Lo(),Y(No));this.setText(m(this.firstChild.toString(),v(this,s),v(this,i)))},Ko=function(){if(v(this,s).excludes.includes("magicLink"))return;const{parseMagicLinks:m}=(Yu(),Y(Eo));this.setText(m(this.firstChild.toString(),v(this,s),v(this,i)))},Yo=function(){if(v(this,s).excludes.includes("list"))return;const{parseList:m}=(td(),Y(Bo)),{firstChild:_,type:k,name:T}=this,O=_.toString().split(`
27
- `),L={lastPrefix:""};let j=k==="root"||k==="ext-inner"&&T==="poem"?0:1;for(;j<O.length;j++)O[j]=m(O[j],L,v(this,s),v(this,i));this.setText(O.join(`
28
- `))},Zo=function(){if(v(this,s).variants.length>0){const{parseConverter:m}=(rd(),Y(Wo));this.setText(m(this.firstChild.toString(),v(this,s),v(this,i)))}},h)}}),ve,Gs,ps,Re=I({"util/debug.ts"(){"use strict";ve={running:!1,run(e){const{running:t}=this;this.running=!0;try{const{Token:s}=(V(),Y(ls)),i=e();return i instanceof s&&!i.getAttribute("built")&&i.afterBuild(),this.running=t,i}catch(s){throw this.running=t,s}},rev:0},Gs=e=>t=>t.type===e,ps=(e,t,s,i=[])=>{var r,a;let l=e.getChildNodes(),n;l.length===s?(n=l,l=i):n=l.splice(t,s,...i);for(let o=0;o<i.length;o++){const u=i[o];u.setAttribute("parentNode",e),u.setAttribute("nextSibling",l[t+o+1]),u.setAttribute("previousSibling",l[t+o-1])}return(r=l[t-1])==null||r.setAttribute("nextSibling",l[t]),(a=l[t+i.length])==null||a.setAttribute("previousSibling",l[t+i.length-1]),l===i&&e.setAttribute("childNodes",l),n}}}),Yl,Mt,Zi,en,Zl,tn,ea,$n,ld=I({"lib/lintConfig.ts"(){"use strict";En(),Yl=new Set([0,1,2]),Mt=new Map([[0,!1],[1,"warning"],[2,"error"]]),Zi={"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(Zi),en=e=>typeof e=="number"&&Yl.has(e),Zl=e=>en(e)||Array.isArray(e)&&e.length===2&&en(e[0])&&e[1]&&typeof e[1]=="object",tn=(e,t,s)=>{if(Ps.includes(t)){if(Zl(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)}`)},ea=class{constructor(e){if(Object.assign(this,JSON.parse(JSON.stringify(Zi))),!!e)for(const[t,s]of Object.entries(e))tn(this,t,s)}getSeverity(e,t){var i;const s=this[e];return typeof s=="number"?Mt.get(s):t&&(i=Mt.get(s[1][t]))!=null?i:Mt.get(s[0])}},$n=e=>new Proxy(new ea(e),{set:tn})}}),eu={};ae(eu,{Title:()=>tu});var tu,ad=I({"lib/title.ts"(){"use strict";var e,t,s,i,l,n;Je(),he(),tu=(n=class{constructor(r,a,o,{temporary:u,decode:d,selfLink:c}={}){B(this,e);B(this,t);B(this,s);B(this,i);B(this,l);Ce(this,"valid");Ce(this,"encoded",!1);const f=r.trim().startsWith("../");if(d&&r.includes("%"))try{const x=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(r);r=ds(r),this.encoded=x}catch{}if(r=os(r).replace(/[_ ]+/gu," ").trim(),f)E(this,i,0);else{let x=a;r.startsWith(":")&&(x=0,r=r.slice(1).trim());const A=r.split(":");if(A.length>1){const S=Tt(A[0]),y=Object.prototype.hasOwnProperty.call(o.nsid,S)&&o.nsid[S];y&&(x=y,r=A.slice(1).join(":").trim())}E(this,i,x)}const p=r.indexOf("#");if(p!==-1){let x=r.slice(p).trim().slice(1);if(x.includes("%"))try{x=ds(x)}catch{}E(this,l,x.replace(/ /gu,"_")),r=r.slice(0,p).trim()}this.valid=!!(r||c&&this.ns===0&&v(this,l)!==void 0)&&os(r)===r&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(f?/^(?:\.\.\/)+(.*)/u.exec(r)[1]:r),this.main=r,E(this,t,o.namespaces),E(this,s,o.articlePath||"/wiki/$1"),v(this,s).includes("$1")||E(this,s,v(this,s)+`${v(this,s).endsWith("/")?"":"/"}$1`),u||Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}})}get ns(){return v(this,i)}get fragment(){return v(this,l)}get main(){return v(this,e)}set main(r){r=r.replace(/_/gu," ").trim(),E(this,e,r&&r[0].toUpperCase()+r.slice(1))}get prefix(){const r=v(this,t)[this.ns];return r+(r&&":")}get title(){return this.getRedirection()[1]}get extension(){const{main:r}=this,a=r.lastIndexOf(".");return a===-1?void 0:r.slice(a+1).toLowerCase()}getRedirection(){return[!1,(this.prefix+this.main).replace(/ /gu,"_")]}setFragment(r){E(this,l,r)}getUrl(r){{typeof r=="string"&&(E(this,s,r),v(this,s).includes("$1")||E(this,s,v(this,s)+`${v(this,s).endsWith("/")?"":"/"}$1`));const{title:a,fragment:o}=this;return a?v(this,s).replace("$1",encodeURIComponent(a)+(o?`#${encodeURIComponent(o)}`:"")):o===void 0?"":`#${encodeURIComponent(o)}`}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,l=new WeakMap,n)}}),su={};ae(su,{LanguageService:()=>iu,isAttr:()=>Es,tasks:()=>_n});var _n,ta,sa,ia,na,sn,ra,la,aa,oa,Es,ua,nn,ft,rn,Me,xe,ln,an,mt,xt,it,zt,on,da,iu,od=I({"lib/lsp.ts"(){"use strict";var e,t,s,i,l,n,r,a,o,u,ns,Ie,Tn,Cn,In,nu,Nn,vt,$;Je(),En(),Ba(),X(),he(),G(),_n=new WeakMap,ta=new Set(["ref"]),sa=new Set(["ref","references"]),ia=new Set(["name","follow"]),na=new Set(["group"]),sn=new Set(["arg-name","template-name","link-target","parameter-key"]),ra=new Set(["ext","html","attr-key","image-parameter","heading-title","heading","magic-word-name",...sn]),la=new Set(["text","comment","noinclude","include"]),aa=["ext","html","table"].map(g=>`${g}-attr#style`).join(),oa=at(g=>new RegExp(`^(?:${g}|//)`,"iu")),Es=({type:g,parentNode:h,length:b,firstChild:w},m)=>g==="attr-value"&&b===1&&w.type==="text"&&(!m||h.name==="style"),ua=g=>g.is("html-attr")||g.is("table-attr"),nn=g=>g.childNodes.every(({type:h})=>la.has(h)),ft=(g,h)=>{const{top:b,left:w}=g.posFromIndex(h);return{line:b,character:w}},rn=(g,h,b)=>({start:ft(g,h),end:ft(g,b)}),Me=g=>{const{top:h,left:b,height:w,width:m}=g.getBoundingClientRect();return{start:{line:h,character:b},end:cs(h,b,w,m)}},xe=(g,h,b,{line:w,character:m},_,k)=>[...new Set(g)].map(T=>{var L;const O=(L=k==null?void 0:k(T))==null?void 0:L.description;return{label:T,kind:h,textEdit:{range:{start:{line:w,character:m-b.length},end:{line:w,character:m}},newText:T+(_!=null?_:"")},...O&&{documentation:{kind:"markdown",value:O}}}}),ln=(g,h,{line:b,character:w})=>{const m=g.indexFromPos(b,w);return g.caretPositionFromIndex(m+Number(/\w/u.test(h.charAt(m))))},an=(g,h,b)=>{const{type:w,parentNode:m={}}=g,{name:_,tag:k}=m;return w==="attr-value"&&h.has(k)&&b.has(_)?g.toString().trim():NaN},mt=g=>an(g,ta,ia),xt=g=>an(g,sa,na),it=(g,h)=>{const b=g==null?void 0:g.getAttr(h);return b!==!0&&b||!1},zt=g=>{const{type:h,name:b,parentNode:w}=g;switch(h){case"heading":return g.level;case"heading-title":return w.level;case"parameter-key":return`${w.parentNode.name}|${w.name}`;case"ext":case"html":case"image-parameter":return b;default:return w.name}},on=(g,h,b=!1)=>({range:rn(g,...h.range),newText:h.text,title:`${b?"Fix":"Suggestion"}: ${h.desc}`,fix:b}),da=(g,h)=>{const{lintConfig:b}=C;if(h){C.lintConfig={};for(const m of Ps)C.lintConfig[m]=m===h?b[m]:0}const{output:w}=g.lint();return h&&(C.lintConfig=b),w===void 0?[]:[{range:Me(g),newText:w}]},iu=($=class{constructor(g){B(this,u);B(this,e);B(this,t);B(this,s);B(this,i);B(this,l);B(this,n);B(this,r);B(this,a);B(this,o);Ce(this,"include",!0);Ce(this,"config");Ce(this,"data");_n.set(g,this),Object.defineProperties(this,{config:{enumerable:!1},data:{enumerable:!1}})}destroy(){Object.setPrototypeOf(this,null)}async provideDocumentColors(g,h,b=!0){const w=await P(this,u,Ie).call(this,h);return w.querySelectorAll("attr-value,parameter-value,arg-default").reverse().flatMap(m=>{const{type:_,childNodes:k}=m;return _!=="attr-value"&&!nn(m)?[]:k.filter(T=>T.type==="text").reverse().flatMap(T=>{const{data:O}=T,L=Sa(O,b).filter(([,,,W])=>W);if(L.length===0)return[];const j=T.getAbsoluteIndex();return L.map(([W,N,R])=>{const J=g(W);return J.length===4&&{color:{red:J[0]/255,green:J[1]/255,blue:J[2]/255,alpha:J[3]},range:rn(w,j+N,j+R)}}).filter(Boolean)})})}provideColorPresentations(g){const{color:{red:h,green:b,blue:w,alpha:m},range:_}=g,k=[h,b,w],T=m<1?`rgba(${k.map(O=>Math.round(O*255)).join()},${m})`:`#${k.map(ya).join("")}`;return[{label:T,textEdit:{range:_,newText:T}}]}async provideCompletionItems(g,h){var ee,ne,ue,Te,Be,Ze,fe;const{re:b,allTags:w,functions:m,switches:_,protocols:k,params:T,tags:O,ext:L}=P(this,u,nu).call(this),{line:j,character:W}=h,N=g.split(/\r?\n/u,j+1)[j],R=b.exec((ee=N==null?void 0:N.slice(0,W))!=null?ee:""),[,,J={},q={}]=this.config.doubleUnderscore;if((R==null?void 0:R[1])!==void 0){const M=R[1].startsWith("/");return xe(w,"Class",R[1].slice(M?1:0),h,M&&!(N!=null&&N.slice(W).trim().startsWith(">"))?">":"")}else{if(R!=null&&R[4])return xe(_,"Constant",R[4],h,"",M=>{if(this.data)return M=M.slice(2,-2),M in J?M=J[M]:M in q&&(M=q[M]),P(this,u,Nn).call(this,M.toLowerCase())});if((R==null?void 0:R[5])!==void 0)return xe(k,"Reference",R[5],h)}const F=await P(this,u,Ie).call(this,g);let U;if(R!=null&&R[2]){U=F.elementFromPoint(R.index+R[2].length-1,j);const M=(ne=R[3])!=null?ne:"";if(R[2]==="{{{")return xe(F.querySelectorAll("arg").filter(K=>K.name&&K!==U).map(({name:K})=>K),"Variable",M,h);const[le,be]=this.config.parserFunction,me=Array.isArray(be),_e=N.charAt(W),Ue=M.startsWith(":"),Ae=Ue?M.slice(1).trimStart():M;if(R[2]==="[[")return xe(F.querySelectorAll("link,file,category,redirect-target").filter(K=>K!==U).map(({name:K})=>K),"Folder",Ae,h);let gt=m;return _e===":"?gt=m.filter(K=>!K.endsWith(":")):_e===":"&&(gt=m.filter(K=>K.endsWith(":")).map(K=>K.slice(0,-1))),[...xe(gt,"Function",M,h,"",K=>{if(this.data)K in le?K=le[K]:!me&&K in be&&(K=be[K]);else return;return P(this,u,vt).call(this,K.toLowerCase())}),...M.startsWith("#")?[]:xe(F.querySelectorAll("template").filter(K=>K!==U).map(K=>{const{name:et}=K;if(Ue)return et;const{ns:Pe}=K.getAttribute("title");return Pe===0?`:${et}`:Pe===10?et.slice(9):et}),"Folder",Ae,h)]}let H,D;if((R==null?void 0:R[7])===void 0&&(U=F.elementFromPoint(W,j),{type:H,parentNode:D}=U),(R==null?void 0:R[6])!==void 0||H==="image-parameter"){const M=F.indexFromPos(j,W),le=(Te=(ue=R==null?void 0:R[6])==null?void 0:ue.trimStart())!=null?Te:v(this,e).slice(U.getAbsoluteIndex(),M).trimStart(),be=v(this,e)[M]==="=";return[...xe(T,"Property",le,h).filter(({label:me})=>!be||!/[= ]$/u.test(me)),...xe(F.querySelectorAll("image-parameter#width").filter(me=>me!==U).map(me=>me.text()),"Unit",le,h)]}else if((R==null?void 0:R[7])!==void 0||H==="attr-key"){const M=(Ze=(Be=R==null?void 0:R[7])==null?void 0:Be.toLowerCase())!=null?Ze:D.tag,le=(fe=R==null?void 0:R[9])!=null?fe:U.toString().slice(0,W-F.posFromIndex(U.getAbsoluteIndex()).left);if(!O.has(M))return;const be=Gn[M],me=Vn[M],_e=me&&xe(me,"Field",le,h);return L.includes(M)&&!be?_e:[..._e!=null?_e:[],...M==="meta"||M==="link"?[]:xe(Dn,"Property",le,h),...be?xe(be,"Property",le,h):[],...xe(["data-"],"Variable",le,h),...xe(["xmlns:"],"Interface",le,h)]}else if(H==="parameter-key"||H==="parameter-value"&&D.anon){const M=D.parentNode,{type:le,name:be}=M;if(le==="magic-word"&&be!=="invoke")return;const me=v(this,e).slice(U.getAbsoluteIndex(),F.indexFromPos(j,W)).trimStart(),{module:_e,function:Ue}=M;return me?xe(F.querySelectorAll("parameter").filter(Ae=>Ae===D||Ae.anon||Ae.parentNode.type!==le||Ae.parentNode.name!==be?!1:le==="template"?!0:Ae.parentNode.module===_e&&Ae.parentNode.function===Ue).map(({name:Ae})=>Ae),"Variable",me,h,H==="parameter-value"?"=":""):void 0}else if(Es(U)&&ua(D)){const M=Wn(D.tag,D.name);if(M.length===0)return;const le=v(this,e).slice(U.getAbsoluteIndex(),F.indexFromPos(j,W)).trimStart();return xe(M,"Value",le,h)}}async provideDiagnostics(g,h=!0){const b=await P(this,u,Ie).call(this,g),w=b.lint();return[(h?w:w.filter(({severity:T})=>T==="error")).map(({startLine:T,startCol:O,endLine:L,endCol:j,severity:W,rule:N,message:R,fix:J,suggestions:q})=>({range:{start:{line:T,character:O},end:{line:L,character:j}},severity:W==="error"?1:2,source:"WikiLint",code:N,message:R,data:[...J?[on(b,J,!0)]:[],...q?q.map(F=>on(b,F)):[]]})),[],[]].flat(2)}resolveCodeAction(g){if(g.kind!=="source.fixAll")return g;const{rule:h}=g.data;return{...g,edit:{changes:{"":da(v(this,l),h)}}}}async provideFoldingRanges(g){const h=await P(this,u,Ie).call(this,g),{length:b}=h.getLines(),w=[],m=new Array(6),_=h.querySelectorAll("heading-title,table,template,magic-word");for(const k of[..._].reverse())k.getRelativeIndex();for(const k of _){const{offsetHeight:T}=k;if(k.type==="heading-title"||T>2){const{top:O}=h.posFromIndex(k.getAbsoluteIndex());if(k.type==="heading-title"){const{level:L}=k.parentNode;for(let j=L-1;j<6;j++){const W=m[j];W!==void 0&&W<O-1&&w.push({startLine:W,endLine:O-1,kind:"region"}),m[j]=void 0}m[L-1]=O+T-1}else w.push({startLine:O,endLine:O+T-2,kind:"region"})}}for(const k of m)k!==void 0&&k<b-1&&w.push({startLine:k,endLine:b-1,kind:"region"});return w}async provideLinks(g){var _;(_=this.config)!=null||(this.config=C.getConfig());const{articlePath:h,protocol:b}=this.config,w=h==null?void 0:h.includes("//"),m=oa(b);return(await P(this,u,Ie).call(this,g)).querySelectorAll(`magic-link,ext-link-url,free-ext-link,attr-value,image-parameter#link${w?",link-target,template-name,invoke-module,magic-word#filepath,magic-word#widget":""}`).reverse().map(k=>{let T;k.is("magic-word")&&({name:T}=k,k=k.childNodes[1].lastChild);const{type:O,parentNode:L,firstChild:j,lastChild:W,childNodes:N,length:R}=k,{tag:J}=L;if(T!=null||(T=L.name),!(O!=="attr-value"||T==="src"&&["templatestyles","img"].includes(J)||T==="cite"&&["blockquote","del","ins","q"].includes(J))||!nn(k))return!1;let q=N.filter(F=>F.type==="text").map(({data:F})=>F).join("").trim();if(!q)return!1;try{if(k.is("magic-link")||k.is("ext-link-url")||k.is("free-ext-link"))q=k.getUrl(h);else if(O==="link-target"&&(L.is("link")||L.is("redirect-target")||L.is("category"))){if(q.startsWith("/"))return!1;q=L.link.getUrl(h)}else if(O==="template-name")q=L.getAttribute("title").getUrl(h);else if(["link-target","invoke-module","parameter-value"].includes(O)||O==="attr-value"&&T==="src"&&J==="templatestyles"||O==="image-parameter"&&!m.test(q)){if(!w||q.startsWith("/"))return!1;let F=0;switch(O){case"attr-value":F=10;break;case"invoke-module":F=828;break;case"parameter-value":F=T==="filepath"?6:274}const U=C.normalizeTitle(q,F,!1,this.config,{temporary:!0});if(!U.valid)return!1;q=U.getUrl()}if(typeof q=="string"&&q.startsWith("//")&&(q=`https:${q}`),q=new URL(q).href,O==="image-parameter"){const F=j.getBoundingClientRect(),{top:U,left:H,height:D,width:ee}=R===1?F:W.getBoundingClientRect();return{range:{start:{line:F.top,character:F.left},end:cs(U,H,D,ee)},target:q}}return{range:Me(k),target:q}}catch{return!1}}).filter(Boolean)}async provideReferences(g,h){const b=await P(this,u,Ie).call(this,g),{offsetNode:w,offset:m}=ln(b,v(this,e),h),_=w.type==="text"?w.parentNode:w,k=m===0&&(_.type==="ext-attr-dirty"||_.type==="html-attr-dirty")?_.parentNode.parentNode:_,{type:T}=k,O=mt(k),L=xt(k);if(!O&&!L&&!ra.has(T))return;const j=zt(k),W=b.querySelectorAll(T==="heading-title"?"heading":T).filter(N=>T==="attr-value"?mt(N)===O||xt(N)===L:zt(N)===j).reverse().map(N=>({range:Me(N.type==="parameter-key"?N.parentNode:N)}));return W.length===0?void 0:W}async provideDefinition(g,h){const b=await P(this,u,Ie).call(this,g),w=b.elementFromPoint(h.character,h.line),m=w.is("ext")&&w.name==="ref"?w:w.closest("ext#ref"),_=it(m,"name");if(!_)return;const k=it(m,"group"),T=b.querySelectorAll("ext#ref").filter(O=>O.innerText&&it(O,"name")===_&&it(O,"group")===k).reverse().map(({lastChild:O})=>({range:Me(O)}));return T.length===0?void 0:T}async resolveRenameLocation(g,h){const b=await P(this,u,Ie).call(this,g),w=b.elementFromPoint(h.character,h.line),{type:m}=w,_=mt(w),k=xt(w);return!_&&!k&&(!sn.has(m)||m==="parameter-key"&&/^[1-9]\d*$/u.test(w.parentNode.name)||m==="link-target"&&!["link","redirect-target"].includes(w.parentNode.type))?void 0:Me(w)}async provideRenameEdits(g,h,b){const w=await P(this,u,Ie).call(this,g),m=w.elementFromPoint(h.character,h.line),{type:_}=m,k=mt(m),T=k&&it(m.parentNode.parentNode,"group"),O=xt(m),L=zt(m),j=w.querySelectorAll(_).filter(W=>{const{type:N}=W.parentNode;return _==="link-target"&&N!=="link"&&N!=="redirect-target"?!1:_==="attr-value"?xt(W)===O||mt(W)===k&&it(W.parentNode.parentNode,"group")===T:zt(W)===L});return j.length===0?void 0:{changes:{"":j.reverse().map(W=>({range:Me(W),newText:b}))}}}async provideHover(g,h){if(!this.data)return;const b=await P(this,u,Ie).call(this,g);let{offsetNode:w,offset:m}=ln(b,v(this,e),h);w.type==="text"&&(m+=w.getRelativeIndex(),w=w.parentNode);const{type:_,parentNode:k,length:T,name:O}=w;let L,j,W,N;if(w.is("double-underscore")&&m>0)L=P(this,u,Nn).call(this,w.name);else if(_==="magic-word-name")L=P(this,u,vt).call(this,k.name),j=w.text().trim(),W=k.getAttribute("colon");else if(w.is("magic-word")&&!w.modifier&&T===1&&(m>0||b.posFromIndex(w.getAbsoluteIndex()).left===h.character))L=P(this,u,vt).call(this,O),j=w.firstChild.text().trim(),W=w.getAttribute("colon");else if((w.is("magic-word")||w.is("template"))&&w.modifier&&m>=2&&w.getRelativeIndex(0)>m&&(j=w.modifier.trim().slice(0,-1),L=P(this,u,vt).call(this,j.toLowerCase()),W=":",L)){const R=w.getAbsoluteIndex();N={start:ft(b,R+2),end:ft(b,R+w.modifier.trimEnd().length+1)}}return L&&{contents:{kind:"markdown",value:(L.signatures?`${L.signatures.map(R=>`- **{{ ${j}${R.length===0?"**":`${W}** `}${R.map(({label:J,const:q})=>q?J:`*${J}*`).join(" **|** ")} **}}**`).join(`
6
+ `})}}return t}}}),Mo={};oe(Mo,{ParamTagToken:()=>bt});var Jr,xi,Xr,bt,zo=I({"src/paramTag/index.ts"(){"use strict";X(),ge(),Ds(),Vn(),G(),V(),Xe(),Jr=[zs],bt=class extends(Xr=z){get type(){return"ext-inner"}constructor(e,t,s=C.getConfig(),i=[],l){if(super(void 0,s,i,{}),t){const n=Se;this.append(...t.split(`
7
+ `).map(r=>l?r:ms(r,s,i,e)).map(r=>new n(r,"param-line",s,i,{})))}i.splice(i.indexOf(this),1),i.push(this)}lint(e=this.getAbsoluteIndex()){{const t="no-ignored",s=C.lintConfig.getSeverity(t,this.name);if(!s)return[];const i=new de(this,e),l=C.msg("invalid-parameter",this.name),n=[];for(const r of this.childNodes){r.setAttribute("aIndex",e);const o=r.childNodes.filter(({type:a})=>a!=="comment"&&a!=="include"&&a!=="noinclude");if(o.some(({type:a})=>a==="ext"))n.push(Q(r,i,t,l,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=Q(r,i,t,l,s);u.suggestions=[Z(u)],n.push(u)}else{const u=r.lint(e,!1);u.length>0&&n.push(...u)}}e+=r.toString().length+1}return n}}},xi=re(Xr),bt=ie(xi,0,"ParamTagToken",Jr,bt),se(xi,1,bt)}}),Kr,vi,Yr,wt,Ho=I({"src/heading.ts"(){"use strict";var e,t,Ns,i;X(),Re(),ge(),qe(),G(),V(),Ft(),Kr=[Oe],wt=(i=class extends(Yr=z){constructor(n,r,o,a=[]){super(void 0,o,a);B(this,t);B(this,e);E(this,e,n);const d=new z(r[0],o,a);d.type="heading-title",d.setAttribute("stage",2);const u=new Qe(r[1],"heading-trail",o,a);this.append(d,u)}get type(){return"heading"}get level(){return v(this,e)}toString(n){const r=P(this,t,Ns).call(this);return r+this.firstChild.toString(n)+r+this.lastChild.toString(n)}text(){const n=P(this,t,Ns).call(this);return n+this.firstChild.text()+n}getAttribute(n){return n==="invalid"?this.inHtmlAttrs()===2:n==="padding"?this.level:super.getAttribute(n)}getGaps(){return this.level}lint(n=this.getAbsoluteIndex(),r){{const o=super.lint(n,r),{firstChild:a,level:d}=this,u=a.toString(),c=u.startsWith("="),p=c||u.endsWith("="),m=new de(this,n),f=this.inHtmlAttrs(),_=["h1","unbalanced-header","format-leakage"],S=_.map(w=>C.lintConfig.getSeverity(w,"apostrophe"));if(S[0]&&this.level===1){const w=Q(a,m,_[0],"<h1>",S[0]);p||(w.suggestions=[je(w,"h2",`=${u}=`)]),o.push(w)}if(S[1]&&p){const w=C.msg("unbalanced-in-section-header",'"="'),A=Q(a,m,_[1],w,S[1]);if(u!=="=")if(c){const[g]=/^=+/u.exec(u),h=d+g.length;A.suggestions=[{desc:`h${d}`,range:[A.startIndex,A.startIndex+g.length],text:""}],h<7&&A.suggestions.push({desc:`h${h}`,range:[A.endIndex,A.endIndex],text:g})}else{const g=/[^=](=+)$/u.exec(u)[1],h=d+g.length;A.suggestions=[{desc:`h${d}`,range:[A.endIndex-g.length,A.endIndex],text:""}],h<7&&A.suggestions.push({desc:`h${h}`,range:[A.startIndex,A.startIndex],text:g})}o.push(A)}if(f){const w="parsing-order",A=C.lintConfig.getSeverity(w,f===2?"heading":"templateInTable");A&&o.push(te(this,m,w,"header-in-html",A))}if(S[2]){const w=this.getRootNode().toString(),A=a.childNodes.filter(Gs("quote")),g=A.filter(({bold:b})=>b),h=A.filter(({italic:b})=>b);if(g.length%2){const b=Q(g[g.length-1],{...m,start:n+d,left:m.left+d},_[2],C.msg("unbalanced-in-section-header","bold-apostrophes"),S[2]),y=n+d+u.length,x=Z(b);w.slice(b.endIndex,y).trim()?b.suggestions=[x,Ve(y,"'''")]:g.length===1&&h.length===0?b.fix=x:b.suggestions=[x],o.push(b)}if(h.length%2){const b=Q(h[h.length-1],{start:n+d},_[2],C.msg("unbalanced-in-section-header","italic-apostrophes"),S[2]),y=n+d+u.length;w.slice(b.endIndex,y).trim()?b.suggestions=[Ve(y,"''")]:h.length===1&&g.length===0?b.fix=Z(b):b.suggestions=[Z(b)],o.push(b)}}return o}}print(){const n=P(this,t,Ns).call(this);return super.print({pre:n,sep:n})}json(n,r=this.getAbsoluteIndex()){const o=super.json(void 0,r);return o.level=this.level,o}},e=new WeakMap,t=new WeakSet,Ns=function(){return"=".repeat(this.level)},i),vi=re(Yr),wt=ie(vi,0,"HeadingToken",Kr,wt),se(vi,1,wt)}}),Zr,bi,el,Xt,Fu=I({"src/hidden.ts"(){"use strict";jt(),V(),Zr=[ct()],Xt=class extends(el=z){get type(){return"hidden"}getAttribute(e){return e==="invalid"||super.getAttribute(e)}},bi=re(el),Xt=ie(bi,0,"HiddenToken",Zr,Xt),se(bi,1,Xt)}}),tl,wi,sl,Kt,ju=I({"src/arg.ts"(){"use strict";var e,Do,s;he(),X(),ge(),Ke(),qs(),qe(),G(),V(),Xe(),Fu(),tl=[Oe,We("{{{"),fs()],Kt=(s=class extends(sl=z){constructor(l,n,r=[]){super(void 0,n,r,{});B(this,e);for(let o=0;o<l.length;o++){const a=l[o];if(o===0){const d=new Se(a,"arg-name",n,r,{});super.insertAt(d)}else if(o>1){const d=new Xt(a,n,r);super.insertAt(d)}else{const d=new z(a,n,r);d.type="arg-default",d.setAttribute("stage",2),super.insertAt(d)}}}get type(){return"arg"}get default(){var l,n;return(n=(l=this.childNodes[1])==null?void 0:l.text())!=null?n:!1}toString(l){return`{{{${super.toString(l,"|")}}}}`}text(){return`{{{${ut(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){P(this,e,Do).call(this),super.afterBuild()}lint(l=this.getAbsoluteIndex(),n){{const{childNodes:[r,o,...a]}=this;r.setAttribute("aIndex",l+3);const d=r.lint(l+3,n);if(o){const p=l+4+r.toString().length;o.setAttribute("aIndex",p);const m=o.lint(p,n);m.length>0&&d.push(...m)}const u=["no-ignored","no-arg"],c=u.map(p=>C.lintConfig.getSeverity(p,"arg"));if(c[0]&&a.length>0){const p=new de(this,l);d.push(...a.map(m=>{const f=Q(m,p,u[0],"invisible-triple-braces",c[0]);return f.startIndex--,f.startCol--,f.suggestions=[Z(f),It(f.startIndex,"{{!}}")],f}))}if(c[1]&&!this.getAttribute("include")){const p=te(this,{start:l},u[1],"unexpected-argument",c[1]);o&&(p.suggestions=[je(p,"expand",o.text())]),d.push(p)}return d}}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(l,n=this.getAbsoluteIndex()){const r=super.json(void 0,n);return r.default=this.default,r}},e=new WeakSet,Do=function(){this.setAttribute("name",this.firstChild.text().trim())},s),wi=re(sl),Kt=ie(wi,0,"ArgToken",tl,Kt),se(wi,1,Kt)}}),Go={};oe(Go,{parseBraces:()=>Hs});var il,yi,Ss,Si,Ai,ki,nl,$i,Hs,Qn=I({"parser/braces.ts"(){"use strict";Je(),he(),Ho(),Lo(),ju(),il={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},yi=String.raw`\[(?!\[)`,Ss=String.raw`\n(?![=\0])`,Si=String.raw`|\{{2,}`,Ai=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),ki=ot(e=>new RegExp(e,"gmu")),nl=new RegExp(String.raw`\{\{((?:[^\n{}[]|${yi}|${Ss})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${Ss})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${yi}|${Ss})*\}-`,"gu"),$i=e=>{const t=Tt(_e(e));return Ai.has(t)?Ai.get(t):/^(?:filepath|(?:full|canonical)urle?):./u.test(t)?"m":/^#vardefine:./u.test(t)?"n":"t"},Hs=(e,t,s)=>{var f,_,S,w,A;const i=String.raw`${t.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,l]}=t,n=[],r=[],o=(g,h,b,y)=>{h[h.length-1].push(Le(g.slice(b,y),r))};let a;do a!==void 0&&(e=a),a=e.replace(nl,(g,h,b)=>{if(h!==void 0||typeof b=="string")try{const{length:y}=s,x=(h!=null?h:b).split("|");return new rt(Le(x[0],r),x.slice(1).map($=>{const k=$.indexOf("=");return(k===-1?[$]:[$.slice(0,k),$.slice(k+1)]).map(T=>Le(T,r))}),t,s),`\0${y}${$i(x[0])}`}catch(y){if(!(y instanceof SyntaxError)||y.message!=="Invalid template name")throw y}return r.push(Le(g,r)),`\0${r.length-1}`});while(a!==e);e=a;const d=e.lastIndexOf("}}")-e.length;let u=d+e.length!==-1,c=ki(i+(u?Si:"")),p=c.exec(e),m;for(;p||m!==void 0&&m<=e.length&&((_=(f=n[n.length-1])==null?void 0:f[0])!=null&&_.startsWith("="));){if(p!=null&&p[1]){const[,{length:j}]=p;p[0]=p[0].slice(j),p.index+=j}const{0:g,index:h}=p!=null?p:{0:`
8
+ `,index:e.length},b=(S=n.pop())!=null?S:{},{0:y,index:x,parts:$,findEqual:k,pos:T}=b,O=g==="="&&k;if(g==="]]"||g==="}-")m=h+2;else if(g===`
9
+ `){m=h+1;const{pos:j,findEqual:W}=(w=n[n.length-1])!=null?w:{};if(j===void 0||W||_e(e.slice(j,x))!==""){const N=/^(={1,6})(.+)\1((?:\s|\0\d+[cn]\x7F)*)$/u.exec(e.slice(x,h));N&&(N[2]=Le(N[2],r),N[2].includes(`
10
+ `)||(e=`${e.slice(0,x)}\0${s.length}h${e.slice(h)}`,m=x+4+String(s.length).length,new wt(N[1].length,N.slice(2),t,s)))}}else if(g==="|"||O)m=h+1,o(e,$,T,h),g==="|"&&$.push([]),b.pos=m,b.findEqual=g==="|",n.push(b);else if(g.startsWith("}}")){const j=g.slice(0,Math.min(y.length,3)),W=y.length-j.length,{length:N}=s;m=h+j.length,o(e,$,T,h);let R=!1,J="t";if(j.length===3){const q=$.map(U=>U.join("=")),F=q.length>1&&_e(q[1]).trim();new Kt(q,t,s),F&&F.endsWith(":")&&l.includes(F.slice(0,-1).toLowerCase())&&(J="s")}else try{new rt($[0][0],$.slice(1),t,s),J=$i($[0][0])}catch(q){if(q instanceof SyntaxError&&q.message==="Invalid template name")R=!0;else throw q}R||(e=`${e.slice(0,x+W)}\0${N}${J}${e.slice(m)}`,m=x+W+3+String(N).length,W>1?n.push({0:y.slice(0,W),index:x,pos:x+W,parts:[[]]}):W===1&&e[x-1]==="-"&&n.push({0:"-{",index:x-1,pos:x+1,parts:[[]]}))}else m=h+g.length,g.startsWith("{")&&(p.pos=m,p.parts=[[]]),n.push(..."0"in b?[b]:[],p);let L=n[n.length-1];if(u&&d+e.length<m)for(u=!1;(A=L==null?void 0:L[0])!=null&&A.startsWith("{");)n.pop(),L=n[n.length-1];c=ki(i+(u?Si:"")+(L?`|${il[L[0][0]]}${L.findEqual?"|=":""}`:"")),c.lastIndex=m,p=c.exec(e)}return Le(e,r)}}}),Vo={};oe(Vo,{InputboxToken:()=>Qo});var Qo,Eu=I({"src/paramTag/inputbox.ts"(){"use strict";Ds(),Qn(),G(),zo(),Qo=class extends bt{constructor(e,t,s=C.getConfig(),i=[]){const l=Symbol("InputboxToken"),n=s.excludes.includes("heading")?s:{...s,excludes:[...s.excludes,"heading"]},{length:r}=i;i.push(l),t&&(t=ms(t,n,i,e)),t&&(t=Hs(t,n,i)),i.splice(r,1),super(e,t,n,i,{})}}}}),Ls={};oe(Ls,{NestedToken:()=>Jo});var rl,ll,Jo,_i=I({"src/nested.ts"(){"use strict";var e,t,s;X(),ge(),Ds(),Qn(),G(),V(),ha(),Ye(),rl=new Set(["comment","include","arg","template","magic-word"]),ll=[!1,!0].map(i=>{const l=i?"includeonly":"noinclude";return new RegExp(String.raw`^(?:<${l}(?:\s[^>]*)?/?>|</${l}\s*>)$`,"iu")}),Jo=(s=class extends z{constructor(l,n,r,o,a=[]){if(typeof n=="boolean"){const d=Symbol("NestedToken"),{length:u}=a;a.push(d),l&&(l=ms(l,o,a,n)),l&&(l=Hs(l,o,a)),a.splice(u,1)}else l&&(l=l.replace(n,(d,u,c,p,m)=>{const f=`\0${a.length+1}e`;return new kt(u,c,p,m,o,!1,a),f}));l&&(l=l.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(d,u,c)=>(new pe(c,o,a),`${u}\0${a.length}n`)));super(l,o,a);B(this,e);B(this,t);E(this,e,[...r]),E(this,t,n)}get type(){return"ext-inner"}lint(l=this.getAbsoluteIndex(),n){{const r=super.lint(l,n),o="no-ignored",a=C.lintConfig.getSeverity(o,this.name);if(!a)return r;const d=new de(this,l),u=typeof v(this,t)=="boolean"?ll[v(this,t)?1:0]:/^<!--[\s\S]*-->$/u;return[...r,...this.childNodes.filter(c=>{const{type:p,name:m}=c;if(p==="ext")return!v(this,e).includes(m);if(rl.has(p))return!1;const f=c.toString().trim();return f&&!u.test(f)}).map(c=>{const p=Q(c,d,o,C.msg("invalid-content",this.name),a);return p.suggestions=[Z(p),Rn(p,c.toString())],p})]}}},e=new WeakMap,t=new WeakMap,s)}});function ol(e,t,s,i,l){t=_e(t).trim();let n=t.replace(e==="link"?/\0\d+[tq]\x7F/gu:/\0\d+t\x7F/gu,"").trim();switch(e){case"width":return!n&&!!t||/^(?:\d+x?|\d*x\d+)(?:\s*px)?$/u.test(n);case"link":{if(n){if(Xo(s.protocol).test(n))return Ko(s.protocol).test(n)&&t;n.startsWith("[[")&&n.endsWith("]]")&&(n=n.slice(2,-2))}else return t;const r=C.normalizeTitle(n,0,!1,s,{halfParsed:i,decode:!0,selfLink:!0});return r.valid&&r}case"lang":return(l==="svg"||l==="svgz")&&!/[^a-z\d-]/u.test(n);case"alt":case"class":case"manualthumb":return!0;case"page":return(l==="djvu"||l==="djv"||l==="pdf")&&Number(n)>0;default:return!!n&&!isNaN(n)}}var Xo,Ko,al,ul,Yo,Ru=I({"src/imageParameter.ts"(){"use strict";var e,t,Zo,l;Je(),he(),X(),G(),V(),Xo=ot(n=>new RegExp(String.raw`^(?:${n}|//|\0\d+m\x7F)`,"iu")),Ko=ot(n=>new RegExp(String.raw`^(?:(?:${n}|//)${$t}|\0\d+m\x7F)${_t}$`,"iu")),al=ot(n=>new RegExp(String.raw`^(\s*(?!\s))${n.replace("$1","(.*)")}${n.endsWith("$1")?`(?=$|
11
+ )`:""}(\s*)$`,"u")),ul=new Set(["alt","link","lang","page","caption"]),Yo=(l=class extends z{constructor(r,o,a,d){var n=(...i)=>(super(...i),B(this,t),B(this,e,""),this);let u;const c=Object.entries(a.img).map(([m,f])=>[m,f,al(m)]),p=c.find(([,m,f])=>(u=f.exec(r),u&&(u.length!==4||ol(m,u[2],a,!0,o)!==!1)));if(p&&u){u.length===3?(n(void 0,a,d),E(this,e,r)):(n(u[2],a,d,{}),E(this,e,u[1]+p[0]+u[3])),this.setAttribute("name",p[1]);return}n(r,a.excludes.includes("list")?a:{...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"?ol("link",super.text(),this.getAttribute("config")):void 0}afterBuild(){var r;(r=this.parentNode)!=null&&r.is("gallery-image")&&!ul.has(this.name)&&this.setAttribute("name","invalid"),super.afterBuild()}toString(r){return v(this,e)?v(this,e).replace("$1",super.toString(r)):super.toString(r)}text(){return v(this,e)?v(this,e).replace("$1",super.text()).trim():super.text().trim()}isPlain(){return this.name==="caption"}getAttribute(r){return r==="invalid"?this.name==="invalid":r==="padding"?Math.max(0,v(this,e).indexOf("$1")):super.getAttribute(r)}lint(r=this.getAbsoluteIndex(),o){{const a=super.lint(r,o),{link:d,name:u}=this;if(u==="invalid"){const c="invalid-gallery",p=C.lintConfig.getSeverity(c,"parameter");if(p){const m=te(this,{start:r},c,"invalid-image-parameter",p);m.fix=Z(m,-1),a.push(m)}}else if(typeof d=="object"&&d.encoded){const c="url-encoding",p=C.lintConfig.getSeverity(c,"file");if(p){const m=te(this,{start:r},c,"unnecessary-encoding",p);m.fix=jn(m,this),a.push(m)}}return a}}getValue(){return this.name==="invalid"?this.text():P(this,t,Zo).call(this)||super.text()}print(){return v(this,e)?`<span class="wpb-image-parameter${this.name==="invalid"?" wpb-invalid":""}">${v(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,Zo=function(){return v(this,e)&&!v(this,e).includes("$1")},l)}}),Ti,dl,cl,Ci,Ii,Ni,hl,Li,Jn,ea=I({"src/link/file.ts"(){"use strict";X(),ge(),G(),Ws(),Ru(),Ti=new Map([["manualthumb","Thumb"],["frameless","Frameless"],["framed","Frame"],["thumbnail","Thumb"]]),dl=new Set(["arg"]),cl=new Set(["template","magic-word"]),Ci=new Set(["left","right","center","none"]),Ii=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),Ni=new Set(["tiff","tif","png","gif","jpg","jpeg","webp","xcf","pdf","svg","djvu"]),hl=e=>{if(e===void 0)return[];const t=/-\{|\}-|\|/gu,s=[];let i=t.exec(e),l=0,n=0;for(;i;){const{0:r,index:o}=i;r!=="|"?l+=r==="-{"?1:-1:l===0&&(s.push(e.slice(n,o)),{lastIndex:n}=t),i=t.exec(e)}return s.push(e.slice(n)),s},Li=(e,t)=>e.filter(({childNodes:s})=>{const i=s.filter(l=>l.text().trim());return i.length!==1||!t.has(i[0].type)}),Jn=class extends De{get type(){return"file"}get extension(){return this.getAttribute("title").extension}constructor(e,t,s,i=[],l="|"){super(e,void 0,s,i,l);const{extension:n}=this.getTitle(!0,!0);this.safeAppend(hl(t).map(r=>new Yo(r,n,s,i)))}lint(e=this.getAbsoluteIndex(),t){var s;{const i=super.lint(e,t),l=Li(this.getAllArgs(),dl),n=[...new Set(l.map(({name:w})=>w))],r=n.filter(w=>Ti.has(w)),o=n.filter(w=>Ci.has(w)),a=n.filter(w=>Ii.has(w)),[d]=r,u=d==="framed"||d==="manualthumb",c=new de(this,e),{extension:p}=this;let m="nested-link",f=C.lintConfig.getSeverity(m,"file");if(f&&Ni.has(p)&&this.closest("ext-link-text")&&((s=this.getValue("link"))==null?void 0:s.trim())!==""){const w=te(this,c,m,"link-in-extlink",f),A=this.getArg("link");if(A){const g=e+A.getRelativeIndex();w.fix={desc:C.msg("delink"),range:[g,g+A.toString().length],text:"link="}}else w.fix=Os(w.endIndex-2,"delink","|link=");i.push(w)}if(m="invalid-gallery",f=C.lintConfig.getSeverity(m,"parameter"),f&&u)for(const w of l.filter(({name:A})=>A==="width")){const A=Q(w,c,m,"invalid-image-parameter",f);A.fix=Z(A,-1),i.push(A)}if(l.length===n.length&&r.length<2&&o.length<2&&a.length<2)return i;m="no-duplicate";const _=["unknownImageParameter","imageParameter"].map(w=>C.lintConfig.getSeverity(m,w)),S=(w,A,g,h=!0)=>w.map(b=>{if(f=_[Number(typeof h=="function"?h(b):h)],!f)return!1;const y=Q(b,c,m,C.msg(`${A}-image-parameter`,g),f);return y.suggestions=[Z(y,-1)],y}).filter(b=>b!==!1);for(const w of n){if(w==="invalid"||w==="width"&&u)continue;const A=w==="caption";let g=l.filter(({name:h})=>h===w);if(A&&(g=[...g.slice(0,-1).filter(h=>h.text()),...g.slice(-1)]),g.length>1){let h=!A||!p||Ni.has(p);if(A&&h){const b=Li(g,cl);h=b.length>1&&(y=>b.includes(y))}i.push(...S(g,"duplicate",w,h))}}return r.length>1&&i.push(...S(l.filter(({name:w})=>Ti.has(w)),"conflicting","frame")),o.length>1&&i.push(...S(l.filter(({name:w})=>Ci.has(w)),"conflicting","horizontal-alignment")),a.length>1&&i.push(...S(l.filter(({name:w})=>Ii.has(w)),"conflicting","vertical-alignment")),i}}getAllArgs(){return this.childNodes.slice(1)}getArgs(e){return this.getAllArgs().filter(({name:t})=>e===t)}getArg(e){const t=this.getArgs(e);return t[e==="manualthumb"?0:t.length-1]}getValue(e){var t;return(t=this.getArg(e))==null?void 0:t.getValue()}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t);{const{extension:i}=this;return i&&(s.extension=i),s}}}}}),gl,Fi,pl,yt,ta=I({"src/link/galleryImage.ts"(){"use strict";var e,xn,s;X(),dt(),Ke(),G(),V(),ea(),gl=[We("")],yt=(s=class extends(pl=Jn){constructor(l,n,r,o,a=[]){let d;if(r!==void 0){const{length:u}=a;d=new z(r,o,a);for(let c=0;c<$e-1;c++)d.parseOnce();a.splice(u,1)}super(n,d==null?void 0:d.toString(),o,a);B(this,e);Ie(this,"privateType","imagemap-image");this.setAttribute("bracket",!1),this.privateType=`${l}-image`,this.seal("privateType",!0)}get type(){return this.privateType}getTitle(l){const n=this.type==="imagemap-image";return this.normalizeTitle(this.firstChild.toString(),n?0:6,{halfParsed:!0,temporary:l,decode:!n})}lint(l=this.getAbsoluteIndex(),n){{const r=super.lint(l,n),o="invalid-gallery",a=C.lintConfig.getSeverity(o,"image");if(a&&P(this,e,xn).call(this)){const d=te(this,{start:l},o,"invalid-gallery",a);d.suggestions=[Os(l,"prefix","File:")],r.push(d)}return r}}getAttribute(l){return l==="invalid"?P(this,e,xn).call(this):super.getAttribute(l)}},e=new WeakSet,xn=function(){const{ns:l}=this.getAttribute("title");return l!==6},s),Fi=re(pl),yt=ie(Fi,0,"GalleryImageToken",gl,yt),se(Fi,1,yt)}}),sa={};oe(sa,{GalleryToken:()=>Yt});var fl,ji,ml,Yt,Pu=I({"src/gallery.ts"(){"use strict";var e,ia,vn,i;X(),Vn(),G(),V(),ta(),Ye(),fl=[zs],Yt=(i=class extends(ml=z){constructor(n,r,o=[]){var a;super(void 0,r,o,{});B(this,e);for(const d of(a=n==null?void 0:n.split(`
12
+ `))!=null?a:[]){const u=/^([^|]+)(?:\|(.*))?/u.exec(d);if(!u){super.insertAt(d.trim()?new pe(d,r,o):d);continue}const[,c,p]=u;P(this,e,ia).call(this,c)?super.insertAt(new yt("gallery",c,p,r,o)):super.insertAt(new pe(d,r,o))}}get type(){return"ext-inner"}get widths(){return P(this,e,vn).call(this,"widths")}get heights(){return P(this,e,vn).call(this,"heights")}lint(n=this.getAbsoluteIndex(),r){{const{top:o,left:a}=this.getRootNode().posFromIndex(n),d=[],u="no-ignored",c=["Image","NoImage","Comment"].map(p=>C.lintConfig.getSeverity(u,`gallery${p}`));for(let p=0;p<this.length;p++){const m=this.childNodes[p],f=m.toString(),{length:_}=f,S=f.trim(),{type:w}=m,A=o+p,g=p?0:a;if(m.setAttribute("aIndex",n),w==="noinclude"&&S&&!/^<!--.*-->$/u.test(S)){let[h]=c;if(S.startsWith("|")?[,h]=c:(S.startsWith("<!--")||S.endsWith("-->"))&&([,,h]=c),h){const b=n+_,y={rule:u,message:C.msg("invalid-content","gallery"),severity:h,startIndex:n,endIndex:b,startLine:A,endLine:A,startCol:g,endCol:g+_};y.suggestions=[Z(y),Rn(y,f)],d.push(y)}}else if(w!=="noinclude"&&w!=="text"){const h=m.lint(n,r);h.length>0&&d.push(...h)}n+=_+1}return d}}json(n,r=this.getAbsoluteIndex()){const o=super.json(void 0,r);return Object.assign(o,{widths:this.widths,heights:this.heights}),o}},e=new WeakSet,ia=function(n){return this.normalizeTitle(n,6,{halfParsed:!0,temporary:!0,decode:!0}).valid},vn=function(n){var r,o;{const a=(r=this.parentNode)==null?void 0:r.getAttr(n),d=typeof a=="string"&&((o=/^(\d+)\s*(?:px)?$/u.exec(a))==null?void 0:o[1]);return d&&Number(d)||120}},i),ji=re(ml),Yt=ie(ji,0,"GalleryToken",fl,Yt),se(ji,1,Yt)}}),Xn,na=I({"src/link/index.ts"(){"use strict";Je(),X(),G(),Ws(),Xn=class extends De{get type(){return"link"}get innerText(){return this.length>1?this.lastChild.text():ds(this.firstChild.text().replace(/^\s*:?/u,""))}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i="nested-link",l=C.lintConfig.getSeverity(i);if(l&&this.closest("ext-link-text")){const n=te(this,{start:e},i,"link-in-extlink",l);n.fix=je(n,"delink",this.innerText),s.push(n)}return s}}}}}),xl,vl,gs,Kn=I({"src/magicLink.ts"(){"use strict";var e,t,bn,i;X(),he(),ge(),G(),V(),xl=String.raw`(?:[${Ge}\t]|&nbsp;|&#0*160;|&#[xX]0*[aA]0;)`,vl=new RegExp(`${xl}+`,"gu"),gs=(i=class extends z{constructor(n,r="free-ext-link",o=C.getConfig(),a){super(n,o,a,{});B(this,t);B(this,e);E(this,e,r)}get type(){return v(this,e)}get innerText(){const n=new Map([["!","|"],["=","="]]);let r=ut(this.childNodes.map(o=>{const{type:a}=o,d=String(o.name);return a==="magic-word"&&n.has(d)?n.get(d):o}));return this.type==="magic-link"&&(r=r.replace(vl," ")),r}get link(){const{innerText:n}=this;return this.type==="magic-link"?n.startsWith("ISBN")?`ISBN ${n.slice(5).replace(/[- ]/gu,"").replace(/x$/u,"X")}`:n:wo(n).replace(/\n/gu,"%0A")}lint(n=this.getAbsoluteIndex(),r){{const o=super.lint(n,r),a=new de(this,n),{type:d,childNodes:u}=this;if(d==="magic-link"){const f="invalid-isbn",_=C.lintConfig.getSeverity(f);return _&&P(this,t,bn).call(this)&&o.push(te(this,a,f,"invalid-isbn",_)),o}const c=d==="ext-link-url",p="unterminated-url",m=C.lintConfig.getSeverity(p,c?"pipe":"punctuation");if(m){const f=c?/\|/u:/[,;。:!?()]+/u,_=u.find(S=>S.type==="text"&&f.test(S.data));if(_){const{data:S}=_,w=Q(_,a,p,C.msg("in-url",c?'"|"':"full-width-punctuation"),m),{index:A,0:g}=f.exec(S),h=w.startIndex+A;w.suggestions=c?[hs(h,1)]:[hs(h),{desc:C.msg("encode"),range:[h,h+g.length],text:encodeURI(g)}],o.push(w)}}return o}}getUrl(n){{const{type:r}=this;let{link:o}=this;if(r==="magic-link"){if(o.startsWith("ISBN"))return this.normalizeTitle(`BookSources/${o.slice(5)}`,-1,{temporary:!0}).getUrl(n);o=o.startsWith("RFC")?`https://datatracker.ietf.org/doc/html/rfc${o.slice(4)}`:`https://pubmed.ncbi.nlm.nih.gov/${o.slice(5)}`}else o.startsWith("//")&&(o=`https:${o}`);return new URL(o)}this.lspError("MagicLinkToken.getUrl")}getAttribute(n){return n==="invalid"?P(this,t,bn).call(this):super.getAttribute(n)}},e=new WeakMap,t=new WeakSet,bn=function(){if(this.type==="magic-link"){const{link:n}=this;if(n.startsWith("ISBN")){const r=[...n.slice(5)].map(o=>o==="X"?10:Number(o));return r.length===10?r.reduce((o,a,d)=>o+a*(10-d),0)%11!==0:r.length===13&&(r[12]===10||r.reduce((o,a,d)=>o+a*(d%2?3:1),0)%10!==0)}}return!1},i)}}),bl,Ei,wl,St,ra=I({"src/extLink.ts"(){"use strict";var e,t;dt(),X(),Ke(),G(),V(),Kn(),bl=[We("[")],St=(t=class extends(wl=z){constructor(i,l="",n="",r,o=[]){super(void 0,r,o,{});B(this,e);const a=i&&/^\0\d+f\x7F$/u.test(i)?o[Number(i.slice(1,-2))]:new gs(i,"ext-link-url",r,o);if(this.insertAt(a),E(this,e,l),n){const d=new z(n,r,o,{});d.type="ext-link-text",d.setAttribute("stage",$e-1),this.insertAt(d)}}get type(){return"ext-link"}toString(i){return this.length===1?`[${super.toString(i)}${v(this,e)}]`:`[${super.toString(i,v(this,e))}]`}text(){return`[${super.text(" ")}]`}getGaps(){return v(this,e).length}lint(i=this.getAbsoluteIndex(),l){{const n=super.lint(i,l),r="var-anchor",o=C.lintConfig.getSeverity(r,"extLink");return o&&this.length===1&&this.closest("heading-title")&&n.push(te(this,{start:i},r,"variable-anchor",o)),n}}print(){return super.print(this.length===1?{pre:"[",post:`${v(this,e)}]`}:{pre:"[",sep:v(this,e),post:"]"})}},e=new WeakMap,t),Ei=re(wl),St=ie(Ei,0,"ExtLinkToken",bl,St),se(Ei,1,St)}}),wn,Ou=I({"src/imagemapLink.ts"(){"use strict";V(),Ye(),na(),ra(),wn=class extends z{get type(){return"imagemap-link"}constructor(e,t,s,i,l=[]){super(void 0,i,l),this.append(e,t.length===2?new Xn(...t,i,l):new St(...t,i,l),new pe(s,i,l))}}}}),la={};oe(la,{ImagemapToken:()=>Zt});var yl,Ri,Sl,Zt,Bu=I({"src/imagemap.ts"(){"use strict";X(),Re(),ge(),Vn(),G(),V(),Ye(),ta(),Ou(),yl=[zs],Zt=class extends(Sl=z){get type(){return"ext-inner"}get image(){return this.childNodes.find(Gs("imagemap-image"))}constructor(e,t=C.getConfig(),s=[]){if(super(void 0,t,s,{}),!e)return;const i=e.split(`
13
+ `),l=new Set(t.protocol.split("|")),n=pe;let r=!0,o=!1;for(const a of i){const d=a.trim();if(!(o||!d||d.startsWith("#"))){if(r){const u=a.indexOf("|"),c=u===-1?a:a.slice(0,u),{valid:p,ns:m}=this.normalizeTitle(c,0,{halfParsed:!0,temporary:!0});if(p&&m===6){const f=new yt("imagemap",c,u===-1?void 0:a.slice(u+1),t,s);super.insertAt(f),r=!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("["),c=a.slice(u),p=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(c);if(p){if(this.normalizeTitle(p[1],0,{halfParsed:!0,temporary:!0,selfLink:!0}).valid){super.insertAt(new wn(a.slice(0,u),p.slice(1),c.slice(c.indexOf("]]")+2),t,s));continue}}else if(c.startsWith("[//")||l.has(c.slice(1,c.indexOf(":")+1))||l.has(c.slice(1,c.indexOf("//")+2))){const m=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(c);if(m){super.insertAt(new wn(a.slice(0,u),m.slice(1),c.slice(c.indexOf("]")+1),t,s));continue}}}}super.insertAt(new n(a,t,s))}}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new de(this,e),{childNodes:l,image:n}=this,r="invalid-imagemap",o=C.lintConfig.getSeverity(r,n?"link":"image");return o&&(n?s.push(...l.filter(a=>{const d=a.toString().trim();return a.is("noinclude")&&d&&!d.startsWith("#")}).map(a=>{const d=Q(a,i,r,"invalid-imagemap-link",o);return d.suggestions=[Z(d,-1),je(d,"comment","# ")],d})):s.push(te(this,i,r,"imagemap-without-image",o))),s}}getAttribute(e){return e==="invalid"?!this.image:super.getAttribute(e)}},Ri=re(Sl),Zt=ie(Ri,0,"ImagemapToken",yl,Zt),se(Ri,1,Zt)}}),Al,Pi,kl,At,oa=I({"src/nowiki/comment.ts"(){"use strict";X(),jt(),Ke(),G(),ht(),Al=[ct(!1),We("<!--")],At=class extends(kl=Ee){constructor(t,s,i,l){super(t,i,l);Ie(this,"closed");this.closed=s}get type(){return"comment"}lint(t=this.getAbsoluteIndex()){{if(this.closed)return[];const s="unclosed-comment",i=C.lintConfig.getSeverity(s);if(!i)return[];const l=te(this,{start:t},s,C.msg("unclosed","html-comment"),i);return l.suggestions=[Ve(l.endIndex,"-->")],[l]}}toString(t){return t?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"&lt;!--",post:this.closed?"--&gt;":""})}},Pi=re(kl),At=ie(Pi,0,"CommentToken",Al,At),se(Pi,1,At)}}),aa={};oe(aa,{CommentedToken:()=>ua});var ua,qu=I({"src/commented.ts"(){"use strict";V(),oa(),ua=class extends z{get type(){return"ext-inner"}constructor(e,t,s=[]){if(super(void 0,t,s,{AstText:":",CommentToken:":"}),e){let i=e.indexOf("<!--"),l=i!==-1&&e.indexOf("-->",i+4),n=0;for(;l!==!1&&l!==-1;)i>n&&this.insertAt(e.slice(n,i)),this.insertAt(new At(e.slice(i+4,l),!0,t,s)),n=l+3,i=e.indexOf("<!--",n),l=i!==-1&&e.indexOf("-->",i+4);n<e.length&&this.insertAt(e.slice(n))}}lint(e=this.getAbsoluteIndex()){return super.lint(e,new RegExp(String.raw`<\s*(?:\/\s*)?(${this.name})\b`,"giu"))}}}}),da={};oe(da,{NowikiToken:()=>ca});var $l,_l,ca,Wu=I({"src/nowiki/index.ts"(){"use strict";var e,yn,s;Je(),X(),G(),ht(),$l=ot(i=>new RegExp(String.raw`<\s*(?:/\s*)${i==="nowiki"?"":"?"}(${i})\b`,"giu")),_l=new Set(["languages","section","templatestyles"]),ca=(s=class extends Ee{constructor(){super(...arguments);B(this,e)}get type(){return"ext-inner"}lint(l=this.getAbsoluteIndex()){{const{name:n}=this,r="void-ext",o=C.lintConfig.getSeverity(r,n);if(o&&P(this,e,yn).call(this)){const a=te(this,{start:l},r,C.msg("nothing-in",n),o);return a.suggestions=[Z(a)],[a]}return super.lint(l,$l(n))}}getAttribute(l){return l==="invalid"?P(this,e,yn).call(this):super.getAttribute(l)}},e=new WeakSet,yn=function(){const{name:l,firstChild:{data:n}}=this;return _l.has(l)&&!!n},s)}}),Tl,Oi,Cl,kt,ha=I({"src/tagPair/ext.ts"(){"use strict";X(),ge(),G(),Mn(),V(),Un(),Gn(),Tl=[Us()],kt=class extends(Cl=lt){get type(){return"ext"}constructor(e,t,s,i,l=C.getConfig(),n=!1,r=[]){const o=e.toLowerCase(),a=new Ms(!t||/^\s/u.test(t)?t:` ${t}`,"ext-attrs",o,l,r),d={...l,ext:l.ext.filter(c=>c!==o),excludes:[...l.excludes],inExt:!0};let u;switch(o){case"tab":d.ext=d.ext.filter(c=>c!=="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 z(s,d,r);break;case"pre":{const{PreToken:c}=(Lu(),Y(Wo));u=new c(s,d,r);break}case"dynamicpagelist":{const{ParamTagToken:c}=(zo(),Y(Mo));u=new c(n,s,d,r);break}case"inputbox":{const{InputboxToken:c}=(Eu(),Y(Vo));u=new c(n,s,d,r);break}case"references":{const{NestedToken:c}=(_i(),Y(Ls));d.excludes.push("heading"),u=new c(s,n,["ref"],d,r);break}case"choose":{const{NestedToken:c}=(_i(),Y(Ls));u=new c(s,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],d,r);break}case"combobox":{const{NestedToken:c}=(_i(),Y(Ls));u=new c(s,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],d,r);break}case"gallery":{const{GalleryToken:c}=(Pu(),Y(sa));u=new c(s,d,r);break}case"imagemap":{const{ImagemapToken:c}=(Bu(),Y(la));u=new c(s,d,r);break}case"hiero":{const{CommentedToken:c}=(qu(),Y(aa));u=new c(s,d,r);break}default:{const{NowikiToken:c}=(Wu(),Y(da));u=new c(s,d,r)}}u.setAttribute("name",o),u.type==="plain"&&(u.type="ext-inner"),super(e,a,u,i,l,r),this.seal("closed",!0)}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new de(this,e);if(this.name!=="nowiki"){const r=this.inHtmlAttrs(),o="parsing-order",a=r&&C.lintConfig.getSeverity(o,r===2?"ext":"templateInTable");a&&s.push(te(this,i,o,"ext-in-html",a))}const l="var-anchor",n=C.lintConfig.getSeverity(l,"ref");return n&&this.name==="ref"&&this.closest("heading-title")&&s.push(te(this,i,l,"variable-anchor",n)),s}}},Oi=re(Cl),kt=ie(Oi,0,"ExtToken",Tl,kt),se(Oi,1,kt)}}),ga={};oe(ga,{parseCommentAndExt:()=>ms});var Bi,Il,As,Nl,qi,ms,Ds=I({"parser/commentAndExt.ts"(){"use strict";Je(),he(),Tu(),Ye(),Cu(),Iu(),ha(),oa(),Bi="<onlyinclude>",Il="</onlyinclude>",{length:As}=Bi,Nl=[!1,!0].map(e=>{const t=e?"includeonly":"(?:no|only)include",s=e?"noinclude":"includeonly";return ko(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"))}),qi=e=>{const t=e.indexOf(Bi);return{i:t,j:e.indexOf(Il,t+As)}},ms=(e,t,s,i)=>{if(i){let{i:o,j:a}=qi(e);if(o!==-1&&a!==-1){let d="";const u=c=>{new pe(c,t,s),d+=`\0${s.length-1}n`};for(;o!==-1&&a!==-1;){const c=`\0${s.length}e`;new Qt(e.slice(o+As,a),t,s),o>0&&u(e.slice(0,o)),d+=c,e=e.slice(a+As+1),{i:o,j:a}=qi(e)}return e&&u(e),d}}const{ext:l}=t,n=l.filter(o=>o!=="translate"&&o!=="tvar"),r={...t,ext:n};if(l.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 c=s.length;return new Po(d,u&&Le(u,o),r,s),`\0${c}g`}),e=Le(e,o)}return e.replace(Nl[i?1:0](n),(o,a,d,u,c,p,m,f,_)=>{const S=s.length;let w="n";if(a)w="e",new kt(a,d,u,c,r,p,s);else if(o.startsWith("<!--")){w="c";const A=o.endsWith("-->");new At(Le(o,s,1).slice(4,A?-3:void 0),A,t,s)}else p?new Jt(p,m&&Le(m,s,1),f&&Le(f,s,1),_,t,s):new pe(o,t,s);return`\0${S}${w}`})}}}),Ll,Fl,jl,El,Wi,Rl,es,Uu=I({"src/html.ts"(){"use strict";var e,t,s,i,l;X(),Re(),ge(),Mn(),G(),V(),Ll=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),Fl=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"]),jl=new Set(["strike","big","center","font","tt"]),El=[Us()],es=(l=class extends(Rl=z){constructor(r,o,a,d,u,c){super(void 0,u,c);B(this,e);B(this,t);B(this,s);B(this,i);this.insertAt(o),this.setAttribute("name",r.toLowerCase()),E(this,e,a),E(this,t,d),E(this,s,r)}get type(){return"html"}get selfClosing(){return v(this,t)}get closing(){return v(this,e)}toString(r){return`<${this.closing?"/":""}${v(this,s)}${super.toString(r)}${v(this,t)?"/":""}>`}text(){const{closing:r}=this,o=v(this,s)+(r?"":super.text());return`<${r?"/":""}${o}${v(this,t)?"/":""}>`}getAttribute(r){return r==="invalid"?this.inTableAttrs()===2:r==="padding"?v(this,s).length+(this.closing?2:1):super.getAttribute(r)}lint(r=this.getAbsoluteIndex(),o){var a;{const d=super.lint(r,o),{name:u,parentNode:c,closing:p,selfClosing:m}=this,f=new de(this,r),_=this.inTableAttrs();let S="h1",w=C.lintConfig.getSeverity(S,"html");if(w&&u==="h1"&&!p){const x=te(this,f,S,"<h1>",w);x.suggestions=[{desc:"h2",range:[r+2,r+3],text:"2"}],d.push(x)}if(S="parsing-order",w=_&&C.lintConfig.getSeverity(S,_===2?"html":"templateInTable"),w){const x=te(this,f,S,"html-in-table",w);_===2&&(x.suggestions=[Z(x)]),d.push(x)}if(S="obsolete-tag",w=C.lintConfig.getSeverity(S,u),w&&jl.has(u)&&d.push(te(this,f,S,"obsolete-tag",w)),S="bold-header",w=C.lintConfig.getSeverity(S,u),w&&(u==="b"||u==="strong")&&((a=this.closest("heading-title,ext"))==null?void 0:a.type)==="heading-title"){const x=te(this,f,S,"bold-in-header",w);x.suggestions=[Z(x)],d.push(x)}const{html:[,A,g]}=this.getAttribute("config"),h=g.includes(u),b=A.includes(u),y=!h&&!b;if(S="unmatched-tag",p&&(m||h)||m&&y){if(w=C.lintConfig.getSeverity(S,p?"both":"selfClosing"),w){const x=te(this,f,S,p?"closing-and-self-closing":"invalid-self-closing",w),$=En(r),k={desc:C.msg("no-self-closing"),range:[x.endIndex-2,x.endIndex-1],text:""};b?x.suggestions=[$,k]:p?x.fix=h?$:k:x.suggestions=[k,Ve(x.endIndex,`></${u}>`,-2)],d.push(x)}}else if(!this.findMatchingTag()){const x=te(this,f,S,p?"unmatched-closing":"unclosed-tag"),$=this.closest("magic-word");if($&&Ll.has($.name))w=C.lintConfig.getSeverity(S,"conditional");else if(p)w=C.lintConfig.getSeverity(S,"closing"),x.suggestions=[Z(x)];else{w=C.lintConfig.getSeverity(S,"opening");const k=c==null?void 0:c.childNodes;Fl.has(u)&&(k!=null&&k.slice(0,k.indexOf(this)).some(T=>T.type==="html"&&T.name===u&&!T.findMatchingTag())&&(x.suggestions=[Ve(r+1,"/")]),this.closest("heading-title")&&(x.rule="format-leakage",w=C.lintConfig.getSeverity("format-leakage",u)))}w&&(x.severity=w,d.push(x))}return d}}findMatchingTag(){return at(v(this,i),()=>{const{name:r,parentNode:o,closing:a,selfClosing:d}=this,{html:[,u,c]}=this.getAttribute("config"),p=c.includes(r),m=u.includes(r);if(p||m&&d)return this;if(!o)return;const{childNodes:f}=o,_=f.indexOf(this),S=a?f.slice(0,_).reverse():f.slice(_+1),w=[this],{rev:A}=ve;for(const g of S)if(!(!g.is("html")||g.name!==r||m&&v(g,t)))if(v(g,e)===a)w.push(g);else{const h=w.pop();if(h===this)return g;C.viewOnly&&(E(h,i,[A,g]),E(g,i,[A,h]))}if(C.viewOnly)for(const g of w)E(g,i,[A,void 0])},r=>{E(this,i,r),r[1]&&r[1]!==this&&E(r[1],i,[ve.rev,this])})}print(){return super.print({pre:`&lt;${this.closing?"/":""}${v(this,s)}`,post:`${v(this,t)?"/":""}&gt;`})}json(r,o=this.getAbsoluteIndex()){const a=super.json(void 0,o);return Object.assign(a,{closing:this.closing,selfClosing:v(this,t)}),a}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,l),Wi=re(Rl),es=ie(Wi,0,"HtmlToken",El,es),se(Wi,1,es)}}),pa={};oe(pa,{parseHtml:()=>fa});var Pl,fa,Mu=I({"parser/html.ts"(){"use strict";Gn(),Uu(),Pl=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,fa=(e,t,s)=>{var r;const{html:i}=t;(r=t.htmlElements)!=null||(t.htmlElements=new Set([...i[0],...i[1],...i[2]]));const l=e.split("<");let n=l.shift();for(const o of l){const a=Pl.exec(o),d=a==null?void 0:a[2],u=d==null?void 0:d.toLowerCase();if(!a||!t.htmlElements.has(u)){n+=`<${o}`;continue}const[,c,,p="",m,f]=a,{length:_}=s,S=new Ms(p,"html-attrs",u,t,s),w=S.hasAttr("itemprop");if(u==="meta"&&!(w&&S.hasAttr("content"))||u==="link"&&!(w&&S.hasAttr("href"))){n+=`<${o}`,s.length=_;continue}n+=`\0${s.length}x${f}`,new es(d,S,c==="/",m==="/>",t,s)}return n}}}),Ol,Yn,ma=I({"src/table/base.ts"(){"use strict";Mn(),G(),V(),Ft(),Gn(),Ol=e=>{const t=e.childNodes.map(i=>i.type==="text"?i.data.replace(/\|\|/gu,"{{!!}}").replace(/\|/gu,"{{!}}"):i.toString()).join(""),{childNodes:s}=C.parse(t,e.getAttribute("include"),2,e.getAttribute("config"));e.safeReplaceChildren(s)},Yn=class extends Us(1)(z){constructor(e,t,s,i,l,n=[],r){super(void 0,l,n,r),this.append(new Qe(t,"table-syntax",l,n),new Ms(i,"table-attrs",s,l,n))}escape(){for(const e of this.childNodes)e instanceof Qe?Ol(e):e.escape()}}}}),Bl,Ui,ye,ks,Wt,Ut,Rs,xa=I({"src/table/td.ts"(){"use strict";X(),ge(),Wn(),G(),V(),ma(),Rs=class extends(Ui=Yn,Bl=[Bs(!1)],Ui){constructor(e,t,s,i=[]){var o;let l=/\||\0\d+!\x7F/u.exec(t!=null?t:""),n=l?t.slice(0,l.index):"";/\[\[|-\{/u.test(n)&&(l=null,n=""),super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",n,s,i),se(ks,5,this),He(this,Wt),He(this,ye,""),l&&([mu(this,ye)._]=l);const r=new z(t==null?void 0:t.slice(((o=l==null?void 0:l.index)!=null?o:NaN)+ce(this,ye).length),s,i);r.type="td-inner",r.setAttribute("stage",4),this.insertAt(r)}get type(){return"td"}get rowspan(){return this.getAttr("rowspan")}get colspan(){return this.getAttr("colspan")}get subtype(){return un(this,Wt,Ut).call(this).subtype}afterBuild(){ce(this,ye).includes("\0")&&ke(this,ye,this.buildFromStr(ce(this,ye),0)),super.afterBuild()}toString(e){const{childNodes:[t,s,i]}=this;return t.toString(e)+s.toString(e)+ce(this,ye)+i.toString(e)}text(){const{childNodes:[e,t,s]}=this;return e.text()+t.text()+ce(this,ye)+s.text()}getGaps(e){return e===1?ce(this,ye).length:0}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new de(this,e+this.getRelativeIndex(this.length-1)),l="pipe-like",n=["td","double"].map(r=>C.lintConfig.getSeverity(l,r));for(const r of this.lastChild.childNodes)if(r.type==="text"){const{data:o}=r;if(o.includes("|")){const a=o.includes("||"),d=n[a?1:0];if(d){const u=Q(r,i,l,"pipe-in-table",d);if(a){const c={caption:"|+",td:"|",th:"!"}[this.subtype];u.fix=je(u,"newline",o.replace(/\|\|/gu,`
14
+ ${c}`))}else u.suggestions=[On(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(){super.escape(),this.childNodes[1].toString()&&(ce(this,ye)||ke(this,ye,"{{!}}")),ce(this,ye)==="|"&&ke(this,ye,"{{!}}")}print(){const{childNodes:[e,t,s]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${ce(this,ye)}${s.print()}</span>`}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t);{const{rowspan:i,colspan:l}=this;return Object.assign(s,{subtype:this.subtype},i!==1&&{rowspan:i},l!==1&&{colspan:l}),s}}},ks=re(Ui),ye=new WeakMap,Wt=new WeakSet,Ut=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:l}=this;return{...un(e=l,Wt,Ut).call(e)}},Ut=ie(ks,17,"#getSyntax",Bl,Wt,Ut),Nn(ks,Rs)}}),Zn,va=I({"src/table/trBase.ts"(){"use strict";X(),G(),ma(),xa(),Zn=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 l=rs(i),n="fostered-content",r=l&&C.lintConfig.getSeverity(n,l===2?void 0:"transclusion");if(r){const o=Q(i,{start:e},n,"content-outside-table",r);o.startIndex++,o.startLine++,o.startCol=0,s.push(o)}return s}}getRowCount(){return Number(this.childNodes.some(e=>e instanceof Rs&&e.isIndependent()&&!e.firstChild.text().endsWith("+")))}}}}),ql,Wl,Ul,Ml,Mi,$s,Fs,zu=I({"src/table/index.ts"(){"use strict";X(),Re(),ge(),Wn(),G(),va(),Ft(),ql=(e,t)=>new Array(e).fill(void 0).map((s,i)=>t(i)),Wl=({type:e})=>e==="tr"||e==="table-syntax",Ul=class extends Array{},Fs=class extends(Mi=Zn,Ml=[Bs(!1)],Mi){constructor(e,t,s,i){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,e,"table",t,s,i,{}),se($s,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 de(this,e),l=["unclosed-table","table-layout"],n=l.map(r=>C.lintConfig.getSeverity(r));if(n[0]&&!this.closed&&s.push(Q(this.firstChild,i,l[0],C.msg("unclosed","table"),n[0])),n[1]){const r=this.getLayout(),{length:o}=r;if(o>1){let a=1,d=1/0,u=0;for(;u<o;u++){const c=r[u],p=c.length;if(p<a)break;p<d&&(d=p);const m=c.indexOf(c[p-1])+1;if(m>d)break;m>a&&(a=m)}if(u<o){const c=this.getNthRow(u),p=Q(c,i,l[1],"inconsistent-table",n[1]);p.startIndex++,p.startLine++,p.startCol=0,s.push(p)}}}return s}}close(e=`
16
+ |}`,t){const s=this.getAttribute("config"),i=this.getAttribute("accum");ve.run(()=>{const l=new Qe(t?e:void 0,"table-syntax",s,i);super.insertAt(l)})}getLayout(e){const t=this.getAllRows(),{length:s}=t,i=Ul.from(ql(s,()=>[]));for(let l=0;l<i.length;l++){const n=i[l];let r=0,o=0,a;for(const d of t[l].childNodes.slice(2))if(d.is("td")){if(d.isIndependent()&&(a=d.subtype!=="caption"),a){const u={row:l,column:r},{rowspan:c,colspan:p}=d;for(r++;n[o];)o++;for(let m=l;m<Math.min(l+c,s);m++)for(let f=o;f<o+p;f++)i[m][f]=u;o+=p}}else if(Wl(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 l of this.childNodes.slice(2)){const{type:n}=l;if(n==="tr"&&l.getRowCount()&&(e--,e<0))return l}}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t);return s.closed=this.closed,s}},$s=re(Mi),ie($s,1,"getLayout",Ml,Fs),Nn($s,Fs)}}),ba,Hu=I({"src/table/tr.ts"(){"use strict";va(),ba=class extends Zn{get type(){return"tr"}constructor(e,t,s,i){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,e,"tr",t,s,i)}}}}),er,wa=I({"src/nowiki/listBase.ts"(){"use strict";ht(),er=class extends Ee{get indent(){return this.innerText.split(":").length-1}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t);{const{indent:i}=this;return i&&(s.indent=i),s}}}}}),tr,ya=I({"src/nowiki/dd.ts"(){"use strict";wa(),tr=class extends er{get type(){return"dd"}}}}),Sa={};oe(Sa,{parseTable:()=>Aa});var zl,zi,Aa,Du=I({"parser/table.ts"(){"use strict";V(),zu(),Hu(),xa(),ya(),zl=e=>e.lastChild.constructor!==z,zi=(e,t)=>e.is("td")?t.pop():e,Aa=({firstChild:{data:e},type:t,name:s},i,l)=>{const n=[],r=e.split(`
17
+ `);let o=t==="root"||t==="parameter-value"||t==="ext-inner"&&s==="poem"?"":`
18
+ ${r.shift()}`,a;const d=(u,c)=>{if(!c){o+=u;return}const{lastChild:p}=c;if(zl(c)){const m=new z(u,i,l);m.type="table-inter",m.setAttribute("stage",3),c.insertAt(m)}else p.setText(p.toString()+u)};for(const u of r){a=n.pop();const[c]=/^(?:\s|\0\d+[cno]\x7F)*/u.exec(u),p=u.slice(c.length),m=/^(:*)((?:\s|\0\d+[cn]\x7F)*)(\{\||\{(?:\0\d+[cn]\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(p);if(m){for(;a&&!a.is("td");)a=n.pop();const[,g,h,b,y]=m;g&&new tr(g,i,l),d(`
19
+ ${c}${g&&`\0${l.length-1}d`}${h}\0${l.length}b`,a),n.push(...a?[a]:[],new Fs(b,y,i,l));continue}else if(!a){o+=`
20
+ ${u}`;continue}const f=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(p);if(!f){d(`
21
+ ${u}`,a),n.push(a);continue}const[,_,S,w,A]=f;if(_){for(;!a.is("table");)a=n.pop();a.close(`
22
+ ${c}${_}`,!0),d(A,n[n.length-1])}else if(S){a=zi(a,n),a.is("tr")&&(a=n.pop());const g=new ba(`
23
+ ${c}${S}`,A,i,l);n.push(a,g),a.insertAt(g)}else{a=zi(a,n);const g=w==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu;let h=g.exec(A),b=0,y=`
24
+ ${c}${w}`;const x=$=>{const k=new Rs(y,A.slice(b,h==null?void 0:h.index),i,l);return $.insertAt(k),k};for(;h;)x(a),{lastIndex:b}=g,[y]=h,h=g.exec(A);n.push(a,x(a))}}return o.slice(1)}}}),ka,Gu=I({"src/nowiki/hr.ts"(){"use strict";ht(),ka=class extends Ee{get type(){return"hr"}}}}),Hl,Hi,Dl,ts,Vu=I({"src/nowiki/doubleUnderscore.ts"(){"use strict";jt(),Ke(),ht(),Hl=[ct(),We("__")],ts=class extends(Dl=Ee){get type(){return"double-underscore"}constructor(e,t,s,i){var o,a;super(e,s,i);const l=e.toLowerCase(),{doubleUnderscore:[,,n,r]}=s;this.setAttribute("name",(a=t?(o=r==null?void 0:r[e])==null?void 0:o.toLowerCase():n==null?void 0:n[l])!=null?a:l)}toString(){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}},Hi=re(Dl),ts=ie(Hi,0,"DoubleUnderscoreToken",Hl,ts),se(Hi,1,ts)}}),$a={};oe($a,{parseHrAndDoubleUnderscore:()=>_a});var _a,Qu=I({"parser/hrAndDoubleUnderscore.ts"(){"use strict";Gu(),Vu(),Ho(),_a=({firstChild:{data:e},type:t,name:s},i,l)=>{var a,d,u;const{doubleUnderscore:[n,r,o]}=i;return(a=i.insensitiveDoubleUnderscore)!=null||(i.insensitiveDoubleUnderscore=new Set(n)),(d=i.sensitiveDoubleUnderscore)!=null||(i.sensitiveDoubleUnderscore=new Set(r)),(u=i.regexHrAndDoubleUnderscore)!=null||(i.regexHrAndDoubleUnderscore=new RegExp(`__(${[...n,...r].join("|")})__`,"giu")),t!=="root"&&(t!=="ext-inner"||s!=="poem")&&(e=`\0${e}`),e=e.replace(/^((?:\0\d+[cno]\x7F)*)(-{4,})/gmu,(c,p,m)=>(new ka(m,i,l),`${p}\0${l.length-1}r`)).replace(i.regexHrAndDoubleUnderscore,(c,p)=>{var S;const m=i.sensitiveDoubleUnderscore.has(p),f=p.toLowerCase(),_=i.insensitiveDoubleUnderscore.has(f);return m||_?(new ts(p,m,i,l),`\0${l.length-1}${_&&((S=o==null?void 0:o[f])!=null?S:f)==="toc"?"u":"n"}`):c}),i.excludes.includes("heading")||(e=e.replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(c,p,m,f,_)=>{const S=`${p}\0${l.length}h`;return new wt(m.length,[f,_],i,l),S})),t==="root"||t==="ext-inner"&&s==="poem"?e:e.slice(1)}}}),Ta,Ju=I({"src/nowiki/quote.ts"(){"use strict";var e,t;X(),ge(),G(),ht(),Ta=(t=class extends Ee{constructor(i,l,n,r){super(i,n,r);B(this,e);E(this,e,l)}get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}get closing(){return{...this.bold?{bold:v(this,e).bold}:void 0,...this.italic?{italic:v(this,e).italic}:void 0}}text(){const{parentNode:i,innerText:l}=this;return i!=null&&i.is("image-parameter")&&i.name!=="caption"?"":l}lint(i=this.getAbsoluteIndex()){var l;{const{previousSibling:n,bold:r,closing:o}=this,a=(n==null?void 0:n.type)==="text"?n.data:void 0,d=[],u=new de(this,i),c=["lonely-apos","bold-header"],p=[void 0,"word"].map(f=>C.lintConfig.getSeverity(c[0],f)),m=C.lintConfig.getSeverity(c[1]);if(a!=null&&a.endsWith("'")){const f=p[(o.bold||o.italic)&&/[a-z\d]'$/iu.test(a)?1:0];if(f){const _=te(this,u,c[0],C.msg("lonely","'"),f),{startLine:S,startCol:w}=_,[,{length:A}]=/(?:^|[^'])('+)$/u.exec(a),g=i-A,h={..._,startIndex:g,endIndex:i,endLine:S,startCol:w-A,endCol:w};h.suggestions=[It(g,"&apos;",A),Z(h)],d.push(h)}}if(m&&r&&((l=this.closest("heading-title,ext"))==null?void 0:l.type)==="heading-title"){const f=te(this,u,c[1],"bold-in-header",m);f.suggestions=[Z(f)],d.push(f)}return d}}json(i,l=this.getAbsoluteIndex()){const n=super.json(void 0,l);return Object.assign(n,{bold:this.bold,italic:this.italic}),n}},e=new WeakMap,t)}}),Ca={};oe(Ca,{parseQuotes:()=>sr});var sr,Ia=I({"parser/quotes.ts"(){"use strict";Ju(),sr=(e,t,s,i)=>{var m;const l=e.split(/('{2,})/u),{length:n}=l;if(n===1)return e;let r=0,o=0,a,d,u;for(let f=1;f<n;f+=2){const _=l[f].length;switch(_){case 2:o++;break;case 4:l[f-1]+="'",l[f]="'''";case 3:if(r++,a!==void 0)break;l[f-1].endsWith(" ")?d===void 0&&u===void 0&&(u=f):l[f-1].slice(-2,-1)===" "?a=f:d!=null||(d=f);break;default:l[f-1]+="'".repeat(_-5),l[f]="'''''",o++,r++}}if(o%2===1&&r%2===1){const f=(m=a!=null?a:d)!=null?m:u;f!==void 0&&(l[f]="''",l[f-1]+="'")}let c=!0,p=!0;for(let f=1;f<n;f+=2){const _=l[f].length,S=_!==2,w=_!==3;S&&(c=!c),w&&(p=!p),new Ta(l[f],{bold:S&&c,italic:w&&p},t,s),l[f]=`\0${s.length-1}q`}return l.join("")}}}),Na={};oe(Na,{parseExternalLinks:()=>ir});var ir,La=I({"parser/externalLinks.ts"(){"use strict";he(),ra(),Kn(),ir=(e,t,s,i)=>{var l;return(l=t.regexExternalLinks)!=null||(t.regexExternalLinks=new RegExp(String.raw`\[((?:\0\d+[cn]\x7F)*(?:\0\d+f\x7F|(?:(?:${t.protocol}|//)${$t}|\0\d+m\x7F)${_t}(?=[[\]<>"\t${Ge}]|\0\d)))([${Ge}]*(?![${Ge}]))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),e.replace(t.regexExternalLinks,(n,r,o,a)=>{const{length:d}=s,u=/&[lg]t;/u.exec(r);return u&&(o="",a=r.slice(u.index)+o+a,r=r.slice(0,u.index)),i?(new gs(r,"ext-link-url",t,s),`[\0${d}f${o}${a}]`):(new St(r,o,a,t,s),`\0${d}w`)})}}}),Fa,Xu=I({"src/link/category.ts"(){"use strict";he(),Ws(),Fa=class extends De{get type(){return"category"}get sortkey(){{const{childNodes:[,e]}=this;return e&&as(e.text())}}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t);{const{sortkey:i}=this;return i&&(s.sortkey=i),s}}}}}),ja={};oe(ja,{parseLinks:()=>Sn});var Gl,Sn,Ku=I({"parser/links.ts"(){"use strict";he(),G(),Ia(),La(),na(),ea(),Xu(),Gl=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)([\s\S]*)$/u,Sn=(e,t,s,i)=>{var o;(o=t.regexLinks)!=null||(t.regexLinks=new RegExp(String.raw`^\s*(?:${t.protocol}|//)`,"iu"));const l=t.inExt?/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]]))?\]\]([\s\S]*)$/u:/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])*)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]])?)?\]\]([\s\S]*)$/u,n=e.split("[[");let r=n.shift();for(let a=0;a<n.length;a++){let d=!1,u,c,p,m;const f=n[a],_=l.exec(f);if(_)[,u,c,p,m]=_,m.startsWith("]")&&(p!=null&&p.includes("["))&&(p+="]",m=m.slice(1));else{const b=Gl.exec(f);b&&(d=!0,[,u,c,p]=b)}if(u===void 0||t.regexLinks.test(u)||/\0\d+[exhbru]\x7F/u.test(u)){r+=`[[${f}`;continue}let S=_e(u).trim();const w=S.startsWith(":");if(w&&d){r+=`[[${f}`;continue}else!S&&p&&!p.includes(`
25
+ `)&&(S=_e(p).trim());const{ns:A,valid:g}=C.normalizeTitle(S,0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0});if(g){if(d){if(A!==6){r+=`[[${f}`;continue}let b=!1;for(a++;a<n.length;a++){const y=n[a],x=y.split("]]");if(x.length>2){b=!0,p+=`[[${x[0]}]]${x[1]}`,m=x.slice(2).join("]]");break}else if(x.length===2)p+=`[[${x[0]}]]${x[1]}`;else{p+=`[[${y}`;break}}if(p=Sn(p,t,s,i),!b){r+=`[[${u}${c}${p}`;continue}}}else{r+=`[[${f}`;continue}p&&(p=sr(p,t,s,i));let h=Xn;w||(A===6?(p&&(p=ir(p,t,s,!0)),h=Jn):A===14&&(h=Fa)),p===void 0&&c&&(p=""),r+=`\0${s.length}l${m}`,new h(u,p,t,s,c)}return r}}}),Ea={};oe(Ea,{parseMagicLinks:()=>Ra});var Di,Gi,Vi,Qi,Ra,Yu=I({"parser/magicLinks.ts"(){"use strict";he(),Kn(),Di=String.raw`[${Ge}\t]|&nbsp;|&#0*160;|&#x0*a0;`,Gi=`(?:${Di})+`,Vi=`(?:${Di}|-)`,Qi=String.raw`(?:RFC|PMID)${Gi}\d+\b|ISBN${Gi}(?:97[89]${Vi}?)?(?:\d${Vi}?){9}[\dx]\b`,Ra=(e,t,s)=>{if(!t.regexMagicLinks)try{t.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${t.protocol})(${$t}${_t})|${Qi})`,"giu")}catch{t.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${t.protocol})(${$t}${_t})|${Qi})`,"giu")}return e.replace(t.regexMagicLinks,(i,l,n)=>{let r=l?i.slice(l.length):i;if(n){let o="";const a=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(r);a&&(o=r.slice(a.index),r=r.slice(0,a.index));const d=r.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,u=d.exec(r);if(u){let c=1;u[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(r.slice(0,u.index))&&(c=2),o=r.slice(u.index+c)+o,r=r.slice(0,u.index+c)}return o.length>=n.length?i:(new gs(r,void 0,t,s),`${l}\0${s.length-1}w${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(r))return i;return new gs(r,"magic-link",t,s),`${l}\0${s.length-1}i`})}}}),Pa,Zu=I({"util/html.ts"(){"use strict";Pa=(e,t)=>e.startsWith(t)?t.length:[...t].findIndex((s,i)=>s!==e[i])}}),Oa,ed=I({"src/nowiki/list.ts"(){"use strict";wa(),Oa=class extends er{get type(){return"list"}}}}),Ba={};oe(Ba,{parseList:()=>qa});var qa,td=I({"parser/list.ts"(){"use strict";Zu(),ed(),ya(),qa=(e,t,s,i)=>{const l=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(e);if(!l)return t.lastPrefix="",e;const[n,r,o,a]=l,d=o.replace(/;/gu,":"),u=Pa(d,t.lastPrefix),c=((u>1?o.slice(u-1):o)+a).split(/(?=;)/u),p=c[0].startsWith(";");let m=c.length-(p?0:1);if(u>1){const T=o.slice(0,u-1);if(p){const O=T.split(/(?=;)/u);c.unshift(...O),m+=T.includes(";")?O.length:0}else c[0]=T+c[0]}t.lastPrefix=d;let f=r+c.map((T,O)=>`\0${i.length+O}d`).join("")+e.slice(n.length);for(const T of c)new Oa(T,s,i);if(!m)return f;const{html:[_,,S]}=s,w=/:+|-\{|\0\d+[xq]\x7F/gu;let A=w,g=A.exec(f),h=0,b=!1,y=!1,x=0;const $=(T,O)=>(new tr(T,s,i),`${f.slice(0,O)}\0${i.length-1}d${f.slice(O+T.length)}`),k=T=>{T?h&&h--:h++};for(;g&&m;){const{0:T,index:O}=g;if(T==="-{"){if(!x){const{lastIndex:L}=A;A=/-\{|\}-/gu,A.lastIndex=L}x++}else if(T==="}-"){if(x--,!x){const{lastIndex:L}=A;A=w,A.lastIndex=L}}else if(T.endsWith("x")){const{name:L,closing:j,selfClosing:W}=i[Number(T.slice(1,-2))];(_.includes(L)||!W&&!S.includes(L))&&k(j)}else if(T.endsWith("q")){const{bold:L,italic:j}=i[Number(T.slice(1,-2))];L&&(k(b),b=!b),j&&(k(y),y=!y)}else if(h===0){if(T.length>=m)return $(T.slice(0,m),O);m-=T.length,A.lastIndex=O+4+String(i.length).length,f=$(T,O)}g=A.exec(f)}return f}}}),_s,Vl,Ji,Ql,ss,sd=I({"src/converterFlags.ts"(){"use strict";var e,t;X(),ge(),qs(),G(),V(),Xe(),_s=new Set(["A","T","R","D","-","H","N"]),Vl=[fs()],ss=(t=class extends(Ql=z){constructor(i,l,n=[]){super(void 0,l,n,{});B(this,e);this.safeAppend(i.map(r=>new Se(r,"converter-flag",l,n)))}get type(){return"converter-flags"}afterBuild(){E(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(v(this,e).filter(i=>/\{{3}[^{}]+\}{3}/u.test(i)))}getVariantFlags(){const i=new Set(this.getAttribute("config").variants);return new Set(v(this,e).filter(l=>i.has(l)))}isInvalidFlag(i,l,n,r){return typeof i=="object"&&(i=i.text().trim(),l=this.getVariantFlags(),n=this.getUnknownFlags(),r=new Set(v(this,e).filter(o=>_s.has(o)))),!!i&&!l.has(i)&&!n.has(i)&&(l.size>0||!r.has(i))}lint(i=this.getAbsoluteIndex(),l){{const n=this.getVariantFlags(),r=this.getUnknownFlags(),o=new Set(v(this,e).filter(m=>_s.has(m))),a=v(this,e).filter(m=>!m).length,d=v(this,e).length-r.size-a,u=super.lint(i,l);if(n.size===d||o.size===d)return u;const c="no-ignored",p=C.lintConfig.getSeverity(c,"conversionFlag");if(p){const m=new de(this,i);for(let f=0;f<this.length;f++){const _=this.childNodes[f],S=_.text().trim();if(this.isInvalidFlag(S,n,r,o)){const w=Q(_,m,c,"invalid-conversion-flag",p);n.size===0&&_s.has(S.toUpperCase())?w.fix=Pn(w,S):w.suggestions=[Z(w,f&&-1)],u.push(w)}}}return u}}print(){return super.print({sep:";"})}},e=new WeakMap,t),Ji=re(Ql),ss=ie(Ji,0,"ConverterFlagsToken",Vl,ss),se(Ji,1,ss)}}),js,id=I({"src/converterRule.ts"(){"use strict";G(),V(),Xe(),js=class extends z{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=C.getConfig(),i=[]){super(void 0,s,i);const l=e.indexOf(":"),n=e.slice(0,l).indexOf("=>"),r=n===-1?e.slice(0,l):e.slice(n+2,l);t&&s.variants.includes(r.trim().toLowerCase())?(super.insertAt(new Se(r,"converter-rule-variant",s,i)),super.insertAt(new Se(e.slice(l+1),"converter-rule-to",s,i)),n!==-1&&super.insertAt(new Se(e.slice(0,n),"converter-rule-from",s,i),0)):super.insertAt(new Se(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}}}}),Jl,Xi,Xl,is,nd=I({"src/converter.ts"(){"use strict";he(),Ke(),qe(),V(),sd(),id(),Jl=[Oe,We("-{")],is=class extends(Xl=z){get type(){return"converter"}constructor(e,t,s,i=[]){super(void 0,s,i),this.insertAt(new ss(e,s,i));const[l]=t,n=l.includes(":"),r=new js(l,n,s,i);n&&r.length===1||!n&&t.length===2&&!_e(t[1]).trim()?this.insertAt(new js(t.join(";"),!1,s,i)):this.append(r,...t.slice(1).map(o=>new js(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()}|${ut(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>`}},Xi=re(Xl),is=ie(Xi,0,"ConverterToken",Jl,is),se(Xi,1,is)}}),Wa={};oe(Wa,{parseConverter:()=>Ua});var Ua,rd=I({"parser/converter.ts"(){"use strict";nd(),Ua=(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,l=/-\{|\}-/gu,n=[];let r=i,o=r.exec(e);for(;o;){const{0:d,index:u}=o;if(d==="}-"){const c=n.pop(),{length:p}=s,m=e.slice(c.index+2,u),f=m.indexOf("|"),[_,S]=f===-1?[[],m]:[m.slice(0,f).split(";"),m.slice(f+1)],w=S.replace(/(&[#a-z\d]+);/giu,"$1"),A=w.split(t.regexConverter).map(g=>g.replace(/\x01/gu,";"));new is(_,A,t,s),e=`${e.slice(0,c.index)}\0${p}v${e.slice(u+2)}`,n.length===0&&(r=i),r.lastIndex=c.index+3+String(p).length}else n.push(o),r=l,r.lastIndex=u+2;o=r.exec(e)}return e}}}),ls={};oe(ls,{Token:()=>z});var Kl,z,V=I({"src/index.ts"(){"use strict";var e,t,s,i,l,n,r,o,Ma,za,Ha,Da,Ga,Va,Qa,Ja,Xa,Ka,Ya,Za,h;he(),dt(),X(),Re(),G(),yu(),Au(),Kl=["category","html-attr#id,ext-attr#id,table-attr#id"],z=(h=class extends Dt{constructor(x,$=C.getConfig(),k=[],T){super();B(this,o);B(this,e,"plain");B(this,t,0);B(this,s);B(this,i);B(this,l);B(this,n,!1);B(this,r);typeof x=="string"&&this.insertAt(x),E(this,s,$),E(this,i,k),k.push(this)}get type(){return v(this,e)}set type(x){E(this,e,x)}parseOnce(x=v(this,t),$=!1,k){if(x<v(this,t)||this.length===0||!this.isPlain())return this;if(v(this,t)>=$e)return this;switch(x){case 0:if(this.type==="root"){v(this,i).pop();const T=P(this,o,Ma).call(this);$&&($=!T)}E(this,l,$),P(this,o,za).call(this,$);break;case 1:P(this,o,Ha).call(this);break;case 2:P(this,o,Da).call(this);break;case 3:P(this,o,Ga).call(this);break;case 4:P(this,o,Va).call(this);break;case 5:P(this,o,Qa).call(this,k);break;case 6:P(this,o,Ja).call(this,k);break;case 7:P(this,o,Xa).call(this);break;case 8:P(this,o,Ka).call(this);break;case 9:P(this,o,Ya).call(this);break;case 10:P(this,o,Za).call(this)}if(this.type==="root")for(const T of v(this,i))T==null||T.parseOnce(x,$,k);return lr(this,t)._++,this}buildFromStr(x,$){const k=x.split(/[\0\x7F]/u).map((T,O)=>{if(O%2===0)return new gn(T);if(isNaN(T.slice(-1)))return v(this,i)[Number(T.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${T}`)});return $===0?k.map(String).join(""):$===1?ut(k):k}build(){E(this,t,$e);const{length:x,firstChild:$}=this,k=$==null?void 0:$.toString();if(x===1&&$.type==="text"&&k.includes("\0")&&(ps(this,0,1,this.buildFromStr(k)),this.normalize(),this.type==="root"))for(const T of v(this,i))T==null||T.build()}afterBuild(){if(this.type==="root")for(const x of v(this,i))x==null||x.afterBuild();E(this,n,!0)}parse(x=$e,$,k){for(x=Math.min(x,$e);v(this,t)<x;)this.parseOnce(v(this,t),$,k);return x&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===h}getAttribute(x){var $;switch(x){case"config":return v(this,s);case"include":return($=v(this,l))!=null?$:!!v(this.getRootNode(),l);case"accum":return v(this,i);case"built":return v(this,n);case"stage":return v(this,t);case"invalid":return this.type==="table-inter"&&rs(this)===2;default:return super.getAttribute(x)}}setAttribute(x,$){switch(x){case"stage":v(this,t)===0&&this.type==="root"&&v(this,i).shift(),E(this,t,$);break;default:super.setAttribute(x,$)}}insertAt(x,$=this.length){const k=typeof x=="string"?new gn(x):x;super.insertAt(k,$);const{type:T}=k;return T==="root"&&(k.type="plain"),k}normalizeTitle(x,$=0,k){return C.normalizeTitle(x,$,v(this,l),v(this,s),k)}inTableAttrs(){var x,$;return((x=this.closest("table-attrs,ext"))==null?void 0:x.type)==="table-attrs"&&(($=this.closest("table-attrs,arg,magic-word,template"))!=null&&$.is("table-attrs")?2:1)}inHtmlAttrs(){var x;return(x=this.closest("html-attrs,ext"))!=null&&x.is("html-attrs")?2:this.inTableAttrs()}lint(x=this.getAbsoluteIndex(),$){var k;{let T=super.lint(x,$);if(this.type==="root"){const O=new Map,L="no-duplicate",j=["category","id"].map(F=>C.lintConfig.getSeverity(L,F)),W=Kl.filter((F,U)=>j[U]).join();if(W){for(const F of this.querySelectorAll(W)){let U;if(F.is("category"))U=F.name;else{const H=F.getValue();H&&H!==!0&&(U=`#${H}`)}if(U){const H=O.get(U);H?H.add(F):O.set(U,new Set([F]))}}for(const[F,U]of O)if(U.size>1&&!F.startsWith("#mw-customcollapsible-")){const H=!F.startsWith("#"),D=`duplicate-${H?"category":"id"}`,ee=j[H?0:1];T.push(...[...U].map(ne=>{const ue=te(ne,{start:ne.getAbsoluteIndex()},L,D,ee);return H&&(ue.suggestions=[Z(ue)]),ue}))}}const N=/<!--\s*lint-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->/gu,R=this.toString(),J=[];let q=N.exec(R);for(;q;){const{1:F,index:U}=q,H=(k=q[2])==null?void 0:k.trim();J.push({line:this.posFromIndex(U).top+(F==="disable-line"?0:1),from:F==="disable"?N.lastIndex:void 0,to:F==="enable"?N.lastIndex:void 0,rules:H?new Set(H.split(",").map(D=>D.trim())):void 0}),q=N.exec(R)}if(T=T.filter(({rule:F,startLine:U,startIndex:H})=>{const D={pos:0};for(const{line:ee,from:ne,to:ue,rules:Ce}of J){if(ee>U+1)break;if(Ce&&!Ce.has(F))continue;if(ee===U&&ne===void 0&&ue===void 0)return!1;ne<=H&&ne>D.pos?(D.pos=ne,D.type="from"):ue<=H&&ue>D.pos&&(D.pos=ue,D.type="to")}return D.type!=="from"}),T.some(({fix:F})=>F)){const F=T.map(({fix:D})=>D).filter(Boolean).sort(({range:[D,ee]},{range:[ne,ue]})=>ee===ue?ne-D:ue-ee);let U=1/0,H=R;for(const{range:[D,ee],text:ne}of F)ee<=U&&(H=H.slice(0,D)+ne+H.slice(ee),U=D);Object.assign(T,{output:H})}}return T}}toString(x,$){return x?super.toString(!0,$):at(v(this,r),()=>super.toString(!1,$),k=>{const T=this.getRootNode();T.type==="root"&&v(T,n)&&E(this,r,k)})}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,l=new WeakMap,n=new WeakMap,r=new WeakMap,o=new WeakSet,Ma=function(){const{parseRedirect:x}=(_u(),Y(Eo)),$=this.firstChild.toString(),k=x($,v(this,s),v(this,i));return k&&this.setText(k),!!k},za=function(x){const{parseCommentAndExt:$}=(Ds(),Y(ga));this.setText($(this.firstChild.toString(),v(this,s),v(this,i),x))},Ha=function(){const{parseBraces:x}=(Qn(),Y(Go)),$=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,k=x($,v(this,s),v(this,i));this.setText(this.type==="root"?k:k.slice(1))},Da=function(){if(v(this,s).excludes.includes("html"))return;const{parseHtml:x}=(Mu(),Y(pa));this.setText(x(this.firstChild.toString(),v(this,s),v(this,i)))},Ga=function(){if(v(this,s).excludes.includes("table"))return;const{parseTable:x}=(Du(),Y(Sa));this.setText(x(this,v(this,s),v(this,i)))},Va=function(){if(v(this,s).excludes.includes("hr"))return;const{parseHrAndDoubleUnderscore:x}=(Qu(),Y($a));this.setText(x(this,v(this,s),v(this,i)))},Qa=function(x){const{parseLinks:$}=(Ku(),Y(ja));this.setText($(this.firstChild.toString(),v(this,s),v(this,i),x))},Ja=function(x){if(v(this,s).excludes.includes("quote"))return;const{parseQuotes:$}=(Ia(),Y(Ca)),k=this.firstChild.toString().split(`
26
+ `);for(let T=0;T<k.length;T++)k[T]=$(k[T],v(this,s),v(this,i),x);this.setText(k.join(`
27
+ `))},Xa=function(){if(v(this,s).excludes.includes("extLink"))return;const{parseExternalLinks:x}=(La(),Y(Na));this.setText(x(this.firstChild.toString(),v(this,s),v(this,i)))},Ka=function(){if(v(this,s).excludes.includes("magicLink"))return;const{parseMagicLinks:x}=(Yu(),Y(Ea));this.setText(x(this.firstChild.toString(),v(this,s),v(this,i)))},Ya=function(){if(v(this,s).excludes.includes("list"))return;const{parseList:x}=(td(),Y(Ba)),{firstChild:$,type:k,name:T}=this,O=$.toString().split(`
28
+ `),L={lastPrefix:""};let j=k==="root"||k==="ext-inner"&&T==="poem"?0:1;for(;j<O.length;j++)O[j]=x(O[j],L,v(this,s),v(this,i));this.setText(O.join(`
29
+ `))},Za=function(){if(v(this,s).variants.length>0){const{parseConverter:x}=(rd(),Y(Wa));this.setText(x(this.firstChild.toString(),v(this,s),v(this,i)))}},h)}}),ve,Gs,ps,Re=I({"util/debug.ts"(){"use strict";ve={running:!1,run(e){const{running:t}=this;this.running=!0;try{const{Token:s}=(V(),Y(ls)),i=e();return i instanceof s&&!i.getAttribute("built")&&i.afterBuild(),this.running=t,i}catch(s){throw this.running=t,s}},rev:0},Gs=e=>t=>t.type===e,ps=(e,t,s,i=[])=>{var r,o;let l=e.getChildNodes(),n;l.length===s?(n=l,l=i):n=l.splice(t,s,...i);for(let a=0;a<i.length;a++){const d=i[a];d.setAttribute("parentNode",e),d.setAttribute("nextSibling",l[t+a+1]),d.setAttribute("previousSibling",l[t+a-1])}return(r=l[t-1])==null||r.setAttribute("nextSibling",l[t]),(o=l[t+i.length])==null||o.setAttribute("previousSibling",l[t+i.length-1]),l===i&&e.setAttribute("childNodes",l),n}}}),Yl,Mt,Ki,Yi,Zl,Zi,eo,An,ld=I({"lib/lintConfig.ts"(){"use strict";Fn(),Yl=new Set([0,1,2]),Mt=new Map([[0,!1],[1,"warning"],[2,"error"]]),Ki={"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(Ki),Yi=e=>typeof e=="number"&&Yl.has(e),Zl=e=>Yi(e)||Array.isArray(e)&&e.length===2&&Yi(e[0])&&e[1]&&typeof e[1]=="object",Zi=(e,t,s)=>{if(Ps.includes(t)){if(Zl(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)}`)},eo=class{constructor(e){if(Object.assign(this,JSON.parse(JSON.stringify(Ki))),!!e)for(const[t,s]of Object.entries(e))Zi(this,t,s)}getSeverity(e,t){var i;const s=this[e];return typeof s=="number"?Mt.get(s):t&&(i=Mt.get(s[1][t]))!=null?i:Mt.get(s[0])}},An=e=>new Proxy(new eo(e),{set:Zi})}}),eu={};oe(eu,{Title:()=>tu});var tu,od=I({"lib/title.ts"(){"use strict";var e,t,s,i,l,n;Je(),he(),tu=(n=class{constructor(r,o,a,{temporary:d,decode:u,selfLink:c}={}){B(this,e);B(this,t);B(this,s);B(this,i);B(this,l);Ie(this,"valid");Ie(this,"encoded",!1);const p=r.trim().startsWith("../");if(u&&r.includes("%"))try{const f=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(r);r=ds(r),this.encoded=f}catch{}if(r=as(r).replace(/[_ ]+/gu," ").trim(),p)E(this,i,0);else{let f=o;r.startsWith(":")&&(f=0,r=r.slice(1).trim());const _=r.split(":");if(_.length>1){const S=Tt(_[0]),w=Object.prototype.hasOwnProperty.call(a.nsid,S)&&a.nsid[S];w&&(f=w,r=_.slice(1).join(":").trim())}E(this,i,f)}const m=r.indexOf("#");if(m!==-1){let f=r.slice(m).trim().slice(1);if(f.includes("%"))try{f=ds(f)}catch{}E(this,l,f.replace(/ /gu,"_")),r=r.slice(0,m).trim()}this.valid=!!(r||c&&this.ns===0&&v(this,l)!==void 0)&&as(r)===r&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(p?/^(?:\.\.\/)+(.*)/u.exec(r)[1]:r),this.main=r,E(this,t,a.namespaces),E(this,s,a.articlePath||"/wiki/$1"),v(this,s).includes("$1")||E(this,s,v(this,s)+`${v(this,s).endsWith("/")?"":"/"}$1`),d||Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}})}get ns(){return v(this,i)}get fragment(){return v(this,l)}get main(){return v(this,e)}set main(r){r=r.replace(/_/gu," ").trim(),E(this,e,r&&r[0].toUpperCase()+r.slice(1))}get prefix(){const r=v(this,t)[this.ns];return r+(r&&":")}get title(){return this.getRedirection()[1]}get extension(){const{main:r}=this,o=r.lastIndexOf(".");return o===-1?void 0:r.slice(o+1).toLowerCase()}getRedirection(){return[!1,(this.prefix+this.main).replace(/ /gu,"_")]}setFragment(r){E(this,l,r)}getUrl(r){{typeof r=="string"&&(E(this,s,r),v(this,s).includes("$1")||E(this,s,v(this,s)+`${v(this,s).endsWith("/")?"":"/"}$1`));const{title:o,fragment:a}=this;return o?v(this,s).replace("$1",encodeURIComponent(o)+(a?`#${encodeURIComponent(a)}`:"")):a===void 0?"":`#${encodeURIComponent(a)}`}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,l=new WeakMap,n)}}),su={};oe(su,{LanguageService:()=>iu,isAttr:()=>Es,tasks:()=>kn});var kn,to,so,io,no,en,ro,lo,oo,ao,Es,uo,tn,ft,sn,Me,xe,nn,rn,mt,xt,it,zt,ln,co,iu,ad=I({"lib/lsp.ts"(){"use strict";var e,t,s,i,l,n,r,o,a,d,ns,Ne,$n,_n,Tn,nu,Cn,vt,A;Je(),Fn(),qo(),X(),he(),G(),kn=new WeakMap,to=new Set(["ref"]),so=new Set(["ref","references"]),io=new Set(["name","follow"]),no=new Set(["group"]),en=new Set(["arg-name","template-name","link-target","parameter-key"]),ro=new Set(["ext","html","attr-key","image-parameter","heading-title","heading","magic-word-name",...en]),lo=new Set(["text","comment","noinclude","include"]),oo=["ext","html","table"].map(g=>`${g}-attr#style`).join(),ao=ot(g=>new RegExp(`^(?:${g}|//)`,"iu")),Es=({type:g,parentNode:h,length:b,firstChild:y},x)=>g==="attr-value"&&b===1&&y.type==="text"&&(!x||h.name==="style"),uo=g=>g.is("html-attr")||g.is("table-attr"),tn=g=>g.childNodes.every(({type:h})=>lo.has(h)),ft=(g,h)=>{const{top:b,left:y}=g.posFromIndex(h);return{line:b,character:y}},sn=(g,h,b)=>({start:ft(g,h),end:ft(g,b)}),Me=g=>{const{top:h,left:b,height:y,width:x}=g.getBoundingClientRect();return{start:{line:h,character:b},end:cs(h,b,y,x)}},xe=(g,h,b,{line:y,character:x},$,k)=>[...new Set(g)].map(T=>{var L;const O=(L=k==null?void 0:k(T))==null?void 0:L.description;return{label:T,kind:h,textEdit:{range:{start:{line:y,character:x-b.length},end:{line:y,character:x}},newText:T+($!=null?$:"")},...O&&{documentation:{kind:"markdown",value:O}}}}),nn=(g,h,{line:b,character:y})=>{const x=g.indexFromPos(b,y);return g.caretPositionFromIndex(x+Number(/\w/u.test(h.charAt(x))))},rn=(g,h,b)=>{const{type:y,parentNode:x={}}=g,{name:$,tag:k}=x;return y==="attr-value"&&h.has(k)&&b.has($)?g.toString().trim():NaN},mt=g=>rn(g,to,io),xt=g=>rn(g,so,no),it=(g,h)=>{const b=g==null?void 0:g.getAttr(h);return b!==!0&&b||!1},zt=g=>{const{type:h,name:b,parentNode:y}=g;switch(h){case"heading":return g.level;case"heading-title":return y.level;case"parameter-key":return`${y.parentNode.name}|${y.name}`;case"ext":case"html":case"image-parameter":return b;default:return y.name}},ln=(g,h,b=!1)=>({range:sn(g,...h.range),newText:h.text,title:`${b?"Fix":"Suggestion"}: ${h.desc}`,fix:b}),co=(g,h)=>{const{lintConfig:b}=C;if(h){C.lintConfig={};for(const x of Ps)C.lintConfig[x]=x===h?b[x]:0}const{output:y}=g.lint();return h&&(C.lintConfig=b),y===void 0?[]:[{range:Me(g),newText:y}]},iu=(A=class{constructor(g){B(this,d);B(this,e);B(this,t);B(this,s);B(this,i);B(this,l);B(this,n);B(this,r);B(this,o);B(this,a);Ie(this,"include",!0);Ie(this,"config");Ie(this,"data");kn.set(g,this),Object.defineProperties(this,{config:{enumerable:!1},data:{enumerable:!1}})}destroy(){Object.setPrototypeOf(this,null)}async provideDocumentColors(g,h,b=!0){const y=await P(this,d,Ne).call(this,h);return y.querySelectorAll("attr-value,parameter-value,arg-default").reverse().flatMap(x=>{const{type:$,childNodes:k}=x;return $!=="attr-value"&&!tn(x)?[]:k.filter(T=>T.type==="text").reverse().flatMap(T=>{const{data:O}=T,L=Ao(O,b).filter(([,,,W])=>W);if(L.length===0)return[];const j=T.getAbsoluteIndex();return L.map(([W,N,R])=>{const J=g(W);return J.length===4&&{color:{red:J[0]/255,green:J[1]/255,blue:J[2]/255,alpha:J[3]},range:sn(y,j+N,j+R)}}).filter(Boolean)})})}provideColorPresentations(g){const{color:{red:h,green:b,blue:y,alpha:x},range:$}=g,k=[h,b,y],T=x<1?`rgba(${k.map(O=>Math.round(O*255)).join()},${x})`:`#${k.map(So).join("")}`;return[{label:T,textEdit:{range:$,newText:T}}]}async provideCompletionItems(g,h){var ee,ne,ue,Ce,Be,Ze,fe;const{re:b,allTags:y,functions:x,switches:$,protocols:k,params:T,tags:O,ext:L}=P(this,d,nu).call(this),{line:j,character:W}=h,N=g.split(/\r?\n/u,j+1)[j],R=b.exec((ee=N==null?void 0:N.slice(0,W))!=null?ee:""),[,,J={},q={}]=this.config.doubleUnderscore;if((R==null?void 0:R[1])!==void 0){const M=R[1].startsWith("/");return xe(y,"Class",R[1].slice(M?1:0),h,M&&!(N!=null&&N.slice(W).trim().startsWith(">"))?">":"")}else{if(R!=null&&R[4])return xe($,"Constant",R[4],h,"",M=>{if(this.data)return M=M.slice(2,-2),M in J?M=J[M]:M in q&&(M=q[M]),P(this,d,Cn).call(this,M.toLowerCase())});if((R==null?void 0:R[5])!==void 0)return xe(k,"Reference",R[5],h)}const F=await P(this,d,Ne).call(this,g);let U;if(R!=null&&R[2]){U=F.elementFromPoint(R.index+R[2].length-1,j);const M=(ne=R[3])!=null?ne:"";if(R[2]==="{{{")return xe(F.querySelectorAll("arg").filter(K=>K.name&&K!==U).map(({name:K})=>K),"Variable",M,h);const[le,be]=this.config.parserFunction,me=Array.isArray(be),Te=N.charAt(W),Ue=M.startsWith(":"),Ae=Ue?M.slice(1).trimStart():M;if(R[2]==="[[")return xe(F.querySelectorAll("link,file,category,redirect-target").filter(K=>K!==U).map(({name:K})=>K),"Folder",Ae,h);let gt=x;return Te===":"?gt=x.filter(K=>!K.endsWith(":")):Te===":"&&(gt=x.filter(K=>K.endsWith(":")).map(K=>K.slice(0,-1))),[...xe(gt,"Function",M,h,"",K=>{if(this.data)K in le?K=le[K]:!me&&K in be&&(K=be[K]);else return;return P(this,d,vt).call(this,K.toLowerCase())}),...M.startsWith("#")?[]:xe(F.querySelectorAll("template").filter(K=>K!==U).map(K=>{const{name:et}=K;if(Ue)return et;const{ns:Pe}=K.getAttribute("title");return Pe===0?`:${et}`:Pe===10?et.slice(9):et}),"Folder",Ae,h)]}let H,D;if((R==null?void 0:R[7])===void 0&&(U=F.elementFromPoint(W,j),{type:H,parentNode:D}=U),(R==null?void 0:R[6])!==void 0||H==="image-parameter"){const M=F.indexFromPos(j,W),le=(Ce=(ue=R==null?void 0:R[6])==null?void 0:ue.trimStart())!=null?Ce:v(this,e).slice(U.getAbsoluteIndex(),M).trimStart(),be=v(this,e)[M]==="=";return[...xe(T,"Property",le,h).filter(({label:me})=>!be||!/[= ]$/u.test(me)),...xe(F.querySelectorAll("image-parameter#width").filter(me=>me!==U).map(me=>me.text()),"Unit",le,h)]}else if((R==null?void 0:R[7])!==void 0||H==="attr-key"){const M=(Ze=(Be=R==null?void 0:R[7])==null?void 0:Be.toLowerCase())!=null?Ze:D.tag,le=(fe=R==null?void 0:R[9])!=null?fe:U.toString().slice(0,W-F.posFromIndex(U.getAbsoluteIndex()).left);if(!O.has(M))return;const be=Hn[M],me=Dn[M],Te=me&&xe(me,"Field",le,h);return L.includes(M)&&!be?Te:[...Te!=null?Te:[],...M==="meta"||M==="link"?[]:xe(zn,"Property",le,h),...be?xe(be,"Property",le,h):[],...xe(["data-"],"Variable",le,h),...xe(["xmlns:"],"Interface",le,h)]}else if(H==="parameter-key"||H==="parameter-value"&&D.anon){const M=D.parentNode,{type:le,name:be}=M;if(le==="magic-word"&&be!=="invoke")return;const me=v(this,e).slice(U.getAbsoluteIndex(),F.indexFromPos(j,W)).trimStart(),{module:Te,function:Ue}=M;return me?xe(F.querySelectorAll("parameter").filter(Ae=>Ae===D||Ae.anon||Ae.parentNode.type!==le||Ae.parentNode.name!==be?!1:le==="template"?!0:Ae.parentNode.module===Te&&Ae.parentNode.function===Ue).map(({name:Ae})=>Ae),"Variable",me,h,H==="parameter-value"?"=":""):void 0}else if(Es(U)&&uo(D)){const M=Bn(D.tag,D.name);if(M.length===0)return;const le=v(this,e).slice(U.getAbsoluteIndex(),F.indexFromPos(j,W)).trimStart();return xe(M,"Value",le,h)}}async provideDiagnostics(g,h=!0){const b=await P(this,d,Ne).call(this,g),y=b.lint();return[(h?y:y.filter(({severity:T})=>T==="error")).map(({startLine:T,startCol:O,endLine:L,endCol:j,severity:W,rule:N,message:R,fix:J,suggestions:q})=>({range:{start:{line:T,character:O},end:{line:L,character:j}},severity:W==="error"?1:2,source:"WikiLint",code:N,message:R,data:[...J?[ln(b,J,!0)]:[],...q?q.map(F=>ln(b,F)):[]]})),[],[]].flat(2)}resolveCodeAction(g){if(g.kind!=="source.fixAll")return g;const{rule:h}=g.data;return{...g,edit:{changes:{"":co(v(this,l),h)}}}}async provideFoldingRanges(g){const h=await P(this,d,Ne).call(this,g),{length:b}=h.getLines(),y=[],x=new Array(6),$=h.querySelectorAll("heading-title,table,template,magic-word");for(const k of[...$].reverse())k.getRelativeIndex();for(const k of $){const{offsetHeight:T}=k;if(k.type==="heading-title"||T>2){const{top:O}=h.posFromIndex(k.getAbsoluteIndex());if(k.type==="heading-title"){const{level:L}=k.parentNode;for(let j=L-1;j<6;j++){const W=x[j];W!==void 0&&W<O-1&&y.push({startLine:W,endLine:O-1,kind:"region"}),x[j]=void 0}x[L-1]=O+T-1}else y.push({startLine:O,endLine:O+T-2,kind:"region"})}}for(const k of x)k!==void 0&&k<b-1&&y.push({startLine:k,endLine:b-1,kind:"region"});return y}async provideLinks(g){var $;($=this.config)!=null||(this.config=C.getConfig());const{articlePath:h,protocol:b}=this.config,y=h==null?void 0:h.includes("//"),x=ao(b);return(await P(this,d,Ne).call(this,g)).querySelectorAll(`magic-link,ext-link-url,free-ext-link,attr-value,image-parameter#link${y?",link-target,template-name,invoke-module,magic-word#filepath,magic-word#widget":""}`).reverse().map(k=>{let T;k.is("magic-word")&&({name:T}=k,k=k.childNodes[1].lastChild);const{type:O,parentNode:L,firstChild:j,lastChild:W,childNodes:N,length:R}=k,{tag:J}=L;if(T!=null||(T=L.name),!(O!=="attr-value"||T==="src"&&["templatestyles","img"].includes(J)||T==="cite"&&["blockquote","del","ins","q"].includes(J))||!tn(k))return!1;let q=N.filter(F=>F.type==="text").map(({data:F})=>F).join("").trim();if(!q)return!1;try{if(k.is("magic-link")||k.is("ext-link-url")||k.is("free-ext-link"))q=k.getUrl(h);else if(O==="link-target"&&(L.is("link")||L.is("redirect-target")||L.is("category"))){if(q.startsWith("/"))return!1;q=L.link.getUrl(h)}else if(O==="template-name")q=L.getAttribute("title").getUrl(h);else if(["link-target","invoke-module","parameter-value"].includes(O)||O==="attr-value"&&T==="src"&&J==="templatestyles"||O==="image-parameter"&&!x.test(q)){if(!y||q.startsWith("/"))return!1;let F=0;switch(O){case"attr-value":F=10;break;case"invoke-module":F=828;break;case"parameter-value":F=T==="filepath"?6:274}const U=C.normalizeTitle(q,F,!1,this.config,{temporary:!0});if(!U.valid)return!1;q=U.getUrl()}if(typeof q=="string"&&q.startsWith("//")&&(q=`https:${q}`),q=new URL(q).href,O==="image-parameter"){const F=j.getBoundingClientRect(),{top:U,left:H,height:D,width:ee}=R===1?F:W.getBoundingClientRect();return{range:{start:{line:F.top,character:F.left},end:cs(U,H,D,ee)},target:q}}return{range:Me(k),target:q}}catch{return!1}}).filter(Boolean)}async provideReferences(g,h){const b=await P(this,d,Ne).call(this,g),{offsetNode:y,offset:x}=nn(b,v(this,e),h),$=y.type==="text"?y.parentNode:y,k=x===0&&($.type==="ext-attr-dirty"||$.type==="html-attr-dirty")?$.parentNode.parentNode:$,{type:T}=k,O=mt(k),L=xt(k);if(!O&&!L&&!ro.has(T))return;const j=zt(k),W=b.querySelectorAll(T==="heading-title"?"heading":T).filter(N=>T==="attr-value"?mt(N)===O||xt(N)===L:zt(N)===j).reverse().map(N=>({range:Me(N.type==="parameter-key"?N.parentNode:N)}));return W.length===0?void 0:W}async provideDefinition(g,h){const b=await P(this,d,Ne).call(this,g),y=b.elementFromPoint(h.character,h.line),x=y.is("ext")&&y.name==="ref"?y:y.closest("ext#ref"),$=it(x,"name");if(!$)return;const k=it(x,"group"),T=b.querySelectorAll("ext#ref").filter(O=>O.innerText&&it(O,"name")===$&&it(O,"group")===k).reverse().map(({lastChild:O})=>({range:Me(O)}));return T.length===0?void 0:T}async resolveRenameLocation(g,h){const b=await P(this,d,Ne).call(this,g),y=b.elementFromPoint(h.character,h.line),{type:x}=y,$=mt(y),k=xt(y);return!$&&!k&&(!en.has(x)||x==="parameter-key"&&/^[1-9]\d*$/u.test(y.parentNode.name)||x==="link-target"&&!["link","redirect-target"].includes(y.parentNode.type))?void 0:Me(y)}async provideRenameEdits(g,h,b){const y=await P(this,d,Ne).call(this,g),x=y.elementFromPoint(h.character,h.line),{type:$}=x,k=mt(x),T=k&&it(x.parentNode.parentNode,"group"),O=xt(x),L=zt(x),j=y.querySelectorAll($).filter(W=>{const{type:N}=W.parentNode;return $==="link-target"&&N!=="link"&&N!=="redirect-target"?!1:$==="attr-value"?xt(W)===O||mt(W)===k&&it(W.parentNode.parentNode,"group")===T:zt(W)===L});return j.length===0?void 0:{changes:{"":j.reverse().map(W=>({range:Me(W),newText:b}))}}}async provideHover(g,h){if(!this.data)return;const b=await P(this,d,Ne).call(this,g);let{offsetNode:y,offset:x}=nn(b,v(this,e),h);y.type==="text"&&(x+=y.getRelativeIndex(),y=y.parentNode);const{type:$,parentNode:k,length:T,name:O}=y;let L,j,W,N;if(y.is("double-underscore")&&x>0)L=P(this,d,Cn).call(this,y.name);else if($==="magic-word-name")L=P(this,d,vt).call(this,k.name),j=y.text().trim(),W=k.getAttribute("colon");else if(y.is("magic-word")&&!y.modifier&&T===1&&(x>0||b.posFromIndex(y.getAbsoluteIndex()).left===h.character))L=P(this,d,vt).call(this,O),j=y.firstChild.text().trim(),W=y.getAttribute("colon");else if((y.is("magic-word")||y.is("template"))&&y.modifier&&x>=2&&y.getRelativeIndex(0)>x&&(j=y.modifier.trim().slice(0,-1),L=P(this,d,vt).call(this,j.toLowerCase()),W=":",L)){const R=y.getAbsoluteIndex();N={start:ft(b,R+2),end:ft(b,R+y.modifier.trimEnd().length+1)}}return L&&{contents:{kind:"markdown",value:(L.signatures?`${L.signatures.map(R=>`- **{{ ${j}${R.length===0?"**":`${W}** `}${R.map(({label:J,const:q})=>q?J:`*${J}*`).join(" **|** ")} **}}**`).join(`
29
30
  `)}
30
31
 
31
- `:"")+L.description},range:N!=null?N:Me(w)}}async provideSignatureHelp(g,h){if(!this.data)return;const{line:b,character:w}=h,m=g.split(/\r?\n/u,b+1)[b],{lastChild:_}=await P(this,u,Cn).call(this,`${m.slice(0,w+/^[^{}<]*/u.exec(m.slice(w))[0].length)}}}`);if(!_.is("magic-word")||_.length===1)return;const{name:k,childNodes:T,firstChild:O}=_,L=P(this,u,vt).call(this,k);if(!(L!=null&&L.signatures))return;const j=T.length-1,W=L.signatures.filter(q=>{var F;return(q.length>=j||((F=q[q.length-1])==null?void 0:F.rest))&&q.every(({label:U,const:H},D)=>{var ne;const ee=H&&D<j&&((ne=T[D+1])==null?void 0:ne.text().trim());return!ee||U.toLowerCase().includes(ee.toLowerCase())})});if(W.length===0)return;let N=-1;for(let q=_.getAbsoluteIndex()+_.getAttribute("padding");N<j&&(q+=T[N+1].toString().length+1,!(q>w));N++);const R=O.text().trim(),J=_.getAttribute("colon");return{signatures:W.map(q=>({label:`{{${R}${q.length===0?"":J}${q.map(({label:F})=>F).join("|")}}}`,parameters:q.map(({label:F,const:U})=>({label:F,...U?{documentation:"Predefined parameter"}:void 0})),...q.length<j?{activeParameter:Math.min(N,q.length-1)}:void 0})),activeParameter:N}}async provideInlayHints(g){const h=await P(this,u,Ie).call(this,g);let b=[];for(const w of h.querySelectorAll("template,magic-word#invoke").reverse()){const{type:m,childNodes:_}=w;b=[...b,..._.slice(m==="template"?1:3).filter(({anon:k})=>k).reverse().map(k=>({position:ft(h,k.getAbsoluteIndex()),label:`${k.name}=`,kind:2}))]}return b}findStyleTokens(){return v(this,l).querySelectorAll(aa).filter(({lastChild:g})=>Es(g))}async provideRefactoringAction(g,h){let b,w;if(h){const{start:k,end:T}=h;if(k.line===T.line&&k.character===T.character)return[];b=g.split(/\r?\n/u,T.line+1),w=k.line===T.line?b[T.line].slice(k.character,T.character):`${b[k.line].slice(k.character)}
32
+ `:"")+L.description},range:N!=null?N:Me(y)}}async provideSignatureHelp(g,h){if(!this.data)return;const{line:b,character:y}=h,x=g.split(/\r?\n/u,b+1)[b],{lastChild:$}=await P(this,d,_n).call(this,`${x.slice(0,y+/^[^{}<]*/u.exec(x.slice(y))[0].length)}}}`);if(!$.is("magic-word")||$.length===1)return;const{name:k,childNodes:T,firstChild:O}=$,L=P(this,d,vt).call(this,k);if(!(L!=null&&L.signatures))return;const j=T.length-1,W=L.signatures.filter(q=>{var F;return(q.length>=j||((F=q[q.length-1])==null?void 0:F.rest))&&q.every(({label:U,const:H},D)=>{var ne;const ee=H&&D<j&&((ne=T[D+1])==null?void 0:ne.text().trim());return!ee||U.toLowerCase().includes(ee.toLowerCase())})});if(W.length===0)return;let N=-1;for(let q=$.getAbsoluteIndex()+$.getAttribute("padding");N<j&&(q+=T[N+1].toString().length+1,!(q>y));N++);const R=O.text().trim(),J=$.getAttribute("colon");return{signatures:W.map(q=>({label:`{{${R}${q.length===0?"":J}${q.map(({label:F})=>F).join("|")}}}`,parameters:q.map(({label:F,const:U})=>({label:F,...U?{documentation:"Predefined parameter"}:void 0})),...q.length<j?{activeParameter:Math.min(N,q.length-1)}:void 0})),activeParameter:N}}async provideInlayHints(g){const h=await P(this,d,Ne).call(this,g);let b=[];for(const y of h.querySelectorAll("template,magic-word#invoke").reverse()){const{type:x,childNodes:$}=y;b=[...b,...$.slice(x==="template"?1:3).filter(({anon:k})=>k).reverse().map(k=>({position:ft(h,k.getAbsoluteIndex()),label:`${k.name}=`,kind:2}))]}return b}findStyleTokens(){return v(this,l).querySelectorAll(oo).filter(({lastChild:g})=>Es(g))}async provideRefactoringAction(g,h){let b,y;if(h){const{start:k,end:T}=h;if(k.line===T.line&&k.character===T.character)return[];b=g.split(/\r?\n/u,T.line+1),y=k.line===T.line?b[T.line].slice(k.character,T.character):`${b[k.line].slice(k.character)}
32
33
  ${b.slice(k.line+1,T.line).join(`
33
34
  `)}${b.length===2?"":`
34
- `}${b[T.line].slice(0,T.character)}`}else if(g)b=g.split(/\r?\n/u),w=b.join(`
35
- `),h={start:{line:0,character:0},end:{line:b.length-1,character:b[b.length-1].length}};else return[];const m=await P(this,u,Cn).call(this,w),{viewOnly:_}=C;return C.viewOnly=!1,m.escape(),C.viewOnly=_,[{title:"Escape with magic words",kind:"refactor.rewrite",edit:{changes:{"":[{range:h,newText:m.toString()}]}}}]}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,l=new WeakMap,n=new WeakMap,r=new WeakMap,a=new WeakMap,o=new WeakMap,u=new WeakSet,ns=function(){return v(this,r)===this.config&&v(this,a)===this.include},Ie=async function(g){var h;return g=as(g),!v(this,s)&&P(this,u,ns).call(this)&&v(this,e)===g?v(this,l):(E(this,e,g),(h=v(this,s))!=null||E(this,s,P(this,u,Tn).call(this)),v(this,s))},Tn=async function(){var b;(b=this.config)!=null||(this.config=C.getConfig()),E(this,r,this.config),E(this,a,this.include);const g=v(this,e),h=await C.partialParse(g,()=>v(this,e),this.include,this.config);return P(this,u,ns).call(this)&&v(this,e)===g?(E(this,l,h),E(this,s,void 0),h):(E(this,s,P(this,u,Tn).call(this)),v(this,s))},Cn=async function(g){var h;return g=as(g),!v(this,i)&&P(this,u,ns).call(this)&&v(this,t)===g?v(this,n):(E(this,t,g),(h=v(this,i))!=null||E(this,i,P(this,u,In).call(this)),v(this,i))},In=async function(){var b;(b=this.config)!=null||(this.config=C.getConfig()),E(this,r,this.config),E(this,a,this.include);const g=v(this,t),h=await C.partialParse(g,()=>v(this,t),this.include,this.config);return P(this,u,ns).call(this)&&v(this,t)===g?(E(this,n,h),E(this,i,void 0),h):(E(this,i,P(this,u,In).call(this)),v(this,i))},nu=function(){var g;if(!v(this,o)||v(this,o)[1]!==this.config){(g=this.config)!=null||(this.config=C.getConfig());const{nsid:h,ext:b,html:w,parserFunction:[m,_,...k],doubleUnderscore:T,protocol:O,img:L}=this.config,j=new Set([b,w].flat(2)),W=new RegExp("(?:"+String.raw`<(\/?\w*)`+"|"+String.raw`(\{{2,4}|\[\[)\s*([^|{}<>[\]\s][^|{}<>[\]#]*)?`+"|"+String.raw`(__(?:(?!__)[\p{L}\p{N}_])*)`+"|"+String.raw`(?<!\[)\[([a-z:/]*)`+"|"+String.raw`\[\[\s*(?:${Object.entries(h).filter(([,N])=>N===6).map(([N])=>N).join("|")})\s*:[^[\]{}<>]+\|([^[\]{}<>|=]*)`+"|"+String.raw`<(\w+)(?:\s(?:[^<>{}|=\s]+(?:\s*=\s*(?:[^\s"']\S*|(["']).*?\8))?(?=\s))*)?\s(\w*)`+")$","iu");E(this,o,[{re:W,ext:b,tags:j,allTags:[...j,"onlyinclude","includeonly","noinclude"],functions:[Object.keys(m),Array.isArray(_)?_:Object.keys(_),k].flat(2),switches:T.slice(0,2).flat().map(N=>`__${N}__`),protocols:O.split("|"),params:Object.keys(L).filter(N=>N.endsWith("$1")||!N.includes("$1")).map(N=>N.replace(/\$1$/u,""))},this.config])}return v(this,o)[0]},Nn=function(g){return this.data.behaviorSwitches.find(({aliases:h})=>h.includes(g))},vt=function(g){return this.data.parserFunctions.find(({aliases:h})=>h.some(b=>b.replace(/^#/u,"")===g))},$)}}),ru={};ae(ru,{default:()=>C});lu.exports=Y(ru);var Ts,un,ca,ze,dn,ha,C,G=I({"index.ts"(){En(),Re(),dt(),he(),ld(),Ts=!0,un=$n(),ze={rules:Ps,config:hn,get i18n(){return{...wa,...ca}},set i18n(e){ca=e},get lintConfig(){return un},set lintConfig(e){un=$n(e)},get viewOnly(){return Ts},set viewOnly(e){Ts&&!e&&ve.rev++,Ts=e},getConfig(e){const t=e!=null?e:this.config,{doubleUnderscore:s,ext:i,parserFunction:l,variable:n}=t;for(let r=0;r<2;r++)s.length>r+2&&s[r].length===0&&(s[r]=Object.keys(s[r+2]));return i.includes("translate")&&!n.includes("translationlanguage")&&(n.push("translationlanguage"),Array.isArray(l[1])?l[1].push("TRANSLATIONLANGUAGE"):l[1].TRANSLATIONLANGUAGE="translationlanguage"),{...hn,...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=ze.getConfig(),l){const{Title:n}=(ad(),Y(eu));let r;if(l!=null&&l.halfParsed)r=new n(e,t,i,l);else{const{Token:a}=(V(),Y(ls));r=ve.run(()=>{const o=new a(e,i);o.type="root",o.parseOnce(0,s).parseOnce();const u=new n(o.toString(),t,i,l);o.build();for(const d of["main","fragment"]){const c=u[d];if(c!=null&&c.includes("\0")){const f=o.buildFromStr(c,1);d==="main"?u.main=f:u.setFragment(f)}}return u})}return r},parse(e,t,s=$e,i=ze.getConfig()){e=as(e);let l;typeof s!="number"&&(l=Array.isArray(s)?s:[s],s=Math.max(...l.map(a=>va[a]||$e)));const{Token:n}=(V(),Y(ls));return ve.run(()=>{const a=new n(e,i);return a.type="root",a.parse(s,t)})},async partialParse(e,t,s,i=ze.getConfig()){{const{Token:l}=(V(),Y(ls)),n=typeof setImmediate=="function"?setImmediate:setTimeout,{running:r}=ve;ve.running=!0;const a=new l(as(e),i);a.type="root";let o=0;try{await new Promise(u=>{const d=()=>{t()===e?(o++,n(c,0)):u()},c=()=>{o===$e+1?(a.afterBuild(),u()):(a[o===$e?"build":"parseOnce"](o,s),d())};n(c,0)})}catch(u){throw ve.running=r,u}return ve.running=r,a}},createLanguageService(e={}){var t;{const s=(od(),Y(su)),{LanguageService:i,tasks:l}=s;return(t=l.get(e))!=null?t:new i(e)}throw new Error("Parser.createLanguageService method is only available in the LSP version!")}},dn={},ha=new Set(["lintConfig","normalizeTitle","parse","createLanguageService"]);for(const e in ze)ha.has(e)||(dn[e]={enumerable:!1});Object.defineProperties(ze,dn),Object.assign(typeof globalThis=="object"?globalThis:self,{Parser:ze}),C=ze}});G()});ud();})();
35
+ `}${b[T.line].slice(0,T.character)}`}else if(g)b=g.split(/\r?\n/u),y=b.join(`
36
+ `),h={start:{line:0,character:0},end:{line:b.length-1,character:b[b.length-1].length}};else return[];const x=await P(this,d,_n).call(this,y),{viewOnly:$}=C;return C.viewOnly=!1,x.escape(),C.viewOnly=$,[{title:"Escape with magic words",kind:"refactor.rewrite",edit:{changes:{"":[{range:h,newText:x.toString()}]}}}]}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,l=new WeakMap,n=new WeakMap,r=new WeakMap,o=new WeakMap,a=new WeakMap,d=new WeakSet,ns=function(){return v(this,r)===this.config&&v(this,o)===this.include},Ne=async function(g){var h;return g=os(g),!v(this,s)&&P(this,d,ns).call(this)&&v(this,e)===g?v(this,l):(E(this,e,g),(h=v(this,s))!=null||E(this,s,P(this,d,$n).call(this)),v(this,s))},$n=async function(){var b;(b=this.config)!=null||(this.config=C.getConfig()),E(this,r,this.config),E(this,o,this.include);const g=v(this,e),h=await C.partialParse(g,()=>v(this,e),this.include,this.config);return P(this,d,ns).call(this)&&v(this,e)===g?(E(this,l,h),E(this,s,void 0),h):(E(this,s,P(this,d,$n).call(this)),v(this,s))},_n=async function(g){var h;return g=os(g),!v(this,i)&&P(this,d,ns).call(this)&&v(this,t)===g?v(this,n):(E(this,t,g),(h=v(this,i))!=null||E(this,i,P(this,d,Tn).call(this)),v(this,i))},Tn=async function(){var b;(b=this.config)!=null||(this.config=C.getConfig()),E(this,r,this.config),E(this,o,this.include);const g=v(this,t),h=await C.partialParse(g,()=>v(this,t),this.include,this.config);return P(this,d,ns).call(this)&&v(this,t)===g?(E(this,n,h),E(this,i,void 0),h):(E(this,i,P(this,d,Tn).call(this)),v(this,i))},nu=function(){var g;if(!v(this,a)||v(this,a)[1]!==this.config){(g=this.config)!=null||(this.config=C.getConfig());const{nsid:h,ext:b,html:y,parserFunction:[x,$,...k],doubleUnderscore:T,protocol:O,img:L}=this.config,j=new Set([b,y].flat(2)),W=new RegExp("(?:"+String.raw`<(\/?\w*)`+"|"+String.raw`(\{{2,4}|\[\[)\s*([^|{}<>[\]\s][^|{}<>[\]#]*)?`+"|"+String.raw`(__(?:(?!__)[\p{L}\p{N}_])*)`+"|"+String.raw`(?<!\[)\[([a-z:/]*)`+"|"+String.raw`\[\[\s*(?:${Object.entries(h).filter(([,N])=>N===6).map(([N])=>N).join("|")})\s*:[^[\]{}<>]+\|([^[\]{}<>|=]*)`+"|"+String.raw`<(\w+)(?:\s(?:[^<>{}|=\s]+(?:\s*=\s*(?:[^\s"']\S*|(["']).*?\8))?(?=\s))*)?\s(\w*)`+")$","iu");E(this,a,[{re:W,ext:b,tags:j,allTags:[...j,"onlyinclude","includeonly","noinclude"],functions:[Object.keys(x),Array.isArray($)?$:Object.keys($),k].flat(2),switches:T.slice(0,2).flat().map(N=>`__${N}__`),protocols:O.split("|"),params:Object.keys(L).filter(N=>N.endsWith("$1")||!N.includes("$1")).map(N=>N.replace(/\$1$/u,""))},this.config])}return v(this,a)[0]},Cn=function(g){return this.data.behaviorSwitches.find(({aliases:h})=>h.includes(g))},vt=function(g){return this.data.parserFunctions.find(({aliases:h})=>h.some(b=>b.replace(/^#/u,"")===g))},A)}}),ru={};oe(ru,{default:()=>C});lu.exports=Y(ru);var Ts,on,ho,ze,an,go,C,G=I({"index.ts"(){Fn(),Re(),dt(),he(),ld(),Ts=!0,on=An(),ze={config:dn,get rules(){return Ps},get i18n(){return{...yo,...ho}},set i18n(e){ho=e},get lintConfig(){return on},set lintConfig(e){on=An(e)},get viewOnly(){return Ts},set viewOnly(e){Ts&&!e&&ve.rev++,Ts=e},getConfig(e){const t=e!=null?e:this.config,{doubleUnderscore:s,ext:i,parserFunction:l,variable:n}=t;for(let r=0;r<2;r++)s.length>r+2&&s[r].length===0&&(s[r]=Object.keys(s[r+2]));return i.includes("translate")&&!n.includes("translationlanguage")&&(n.push("translationlanguage"),Array.isArray(l[1])?l[1].push("TRANSLATIONLANGUAGE"):l[1].TRANSLATIONLANGUAGE="translationlanguage"),{...dn,...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=ze.getConfig(),l){const{Title:n}=(od(),Y(eu));let r;if(l!=null&&l.halfParsed)r=new n(e,t,i,l);else{const{Token:o}=(V(),Y(ls));r=ve.run(()=>{const a=new o(e,i);a.type="root",a.parseOnce(0,s).parseOnce();const d=new n(a.toString(),t,i,l);a.build();for(const u of["main","fragment"]){const c=d[u];if(c!=null&&c.includes("\0")){const p=a.buildFromStr(c,1);u==="main"?d.main=p:d.setFragment(p)}}return d})}return r},parse(e,t,s=$e,i=ze.getConfig()){e=os(e);let l;typeof s!="number"&&(l=Array.isArray(s)?s:[s],s=Math.max(...l.map(o=>bo[o]||$e)));const{Token:n}=(V(),Y(ls));return ve.run(()=>{const o=new n(e,i);return o.type="root",o.parse(s,t)})},async partialParse(e,t,s,i=ze.getConfig()){{const{Token:l}=(V(),Y(ls)),n=typeof setImmediate=="function"?setImmediate:setTimeout,{running:r}=ve;ve.running=!0;const o=new l(os(e),i);o.type="root";let a=0;try{await new Promise(d=>{const u=()=>{t()===e?(a++,n(c,0)):d()},c=()=>{a===$e+1?(o.afterBuild(),d()):(o[a===$e?"build":"parseOnce"](a,s),u())};n(c,0)})}catch(d){throw ve.running=r,d}return ve.running=r,o}},createLanguageService(e={}){var t;{const s=(ad(),Y(su)),{LanguageService:i,tasks:l}=s;return(t=l.get(e))!=null?t:new i(e)}throw new Error("Parser.createLanguageService method is only available in the LSP version!")}},an={},go=new Set(["lintConfig","normalizeTitle","parse","createLanguageService"]);for(const e in ze)go.has(e)||(an[e]={enumerable:!1});Object.defineProperties(ze,an),Object.assign(typeof globalThis=="object"?globalThis:self,{Parser:ze}),C=ze}});G()});ud();})();
36
37
  //# sourceMappingURL=bundle-lsp.min.js.map