wikiparser-node 1.34.0 → 1.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/bundle-es8.min.js +25 -25
- package/bundle/bundle-lsp.min.js +22 -22
- package/bundle/bundle.min.js +2 -2
- package/config/default.json +1 -0
- package/dist/bin/config.js +3 -3
- package/dist/parser/magicLinks.js +1 -1
- package/dist/render/html.js +4 -4
- package/dist/src/attribute.js +1 -1
- package/dist/src/nowiki/index.js +8 -8
- package/dist/src/nowiki/noinclude.js +1 -1
- package/extensions/dist/base.js +4 -1
- package/extensions/dist/lsp.js +3 -0
- package/extensions/typings.d.ts +1 -0
- package/logo.png +0 -0
- package/package.json +6 -6
package/bundle/bundle-lsp.min.js
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
"use strict";(()=>{var Vu=Object.defineProperty;var Tr=e=>{throw TypeError(e)};var Qu=(e,t,i)=>t in e?Vu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var Ju=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var je=(e,t,i)=>Qu(e,typeof t!="symbol"?t+"":t,i),ns=(e,t,i)=>t.has(e)||Tr("Cannot "+i);var b=(e,t,i)=>(ns(e,t,"read from private field"),i?i.call(e):t.get(e)),j=(e,t,i)=>t.has(e)?Tr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,i),E=(e,t,i,n)=>(ns(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i),R=(e,t,i)=>(ns(e,t,"access private method"),i);var Cr=(e,t,i,n)=>({set _(r){E(e,t,r,i)},get _(){return b(e,t,n)}});var ec=Ju((ic,Gu)=>{var qa=Object.create,gt=Object.defineProperty,Wa=Object.getOwnPropertyDescriptor,Gn=Object.getOwnPropertyNames,Xu=Object.getPrototypeOf,Ku=Object.prototype.hasOwnProperty,Ma=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Ot=e=>{throw TypeError(e)},Ua=(e,t,i)=>t in e?gt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Ir=(e,t)=>gt(e,"name",{value:t,configurable:!0}),L=(e,t)=>function(){return e&&(t=(0,e[Gn(e)[0]])(e=0)),t},Vn=(e,t)=>function(){return t||(0,e[Gn(e)[0]])((t={exports:{}}).exports,t),t.exports},oe=(e,t)=>{for(var i in t)gt(e,i,{get:t[i],enumerable:!0})},za=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Gn(t))!Ku.call(e,r)&&r!==i&>(e,r,{get:()=>t[r],enumerable:!(n=Wa(t,r))||n.enumerable});return e},Yu=(e,t,i)=>(i=e!=null?qa(Xu(e)):{},za(t||!e||!e.__esModule?gt(i,"default",{value:e,enumerable:!0}):i,e)),se=e=>za(gt({},"__esModule",{value:!0}),e),le=e=>{var t;return[,,,qa((t=e==null?void 0:e[Ma("metadata")])!=null?t:null)]},Ha=["class","method","getter","setter","accessor","field","value","get","set"],Xt=e=>e!==void 0&&typeof e!="function"?Ot("Function expected"):e,Zu=(e,t,i,n,r)=>({kind:Ha[e],name:t,metadata:n,addInitializer:s=>i._?Ot("Already initialized"):r.push(Xt(s||null))}),Qn=(e,t)=>Ua(t,Ma("metadata"),e[3]),ne=(e,t,i,n)=>{for(var r=0,s=e[t>>1],l=s&&s.length;r<l;r++)t&1?s[r].call(i):n=s[r].call(i,n);return n},re=(e,t,i,n,r,s)=>{var l,a,d,u,o,c=t&7,f=!!(t&8),m=!!(t&16),y=c>3?e.length+1:c?f?1:2:0,S=Ha[c+5],$=c>3&&(e[y-1]=[]),_=e[y]||(e[y]=[]),T=c&&(!m&&!f&&(r=r.prototype),c<5&&(c>3||!m)&&Wa(c<4?r:{get[i](){return xe(this,s)},set[i](h){return Ne(this,s,h)}},i));c?m&&c<4&&Ir(s,(c>2?"set ":c>1?"get ":"")+i):Ir(r,i);for(var g=n.length-1;g>=0;g--)u=Zu(c,i,d={},e[3],_),c&&(u.static=f,u.private=m,o=u.access={has:m?h=>td(r,h):h=>i in h},c^3&&(o.get=m?h=>(c^1?xe:$n)(h,r,c^4?s:T.get):h=>h[i]),c>2&&(o.set=m?(h,x)=>Ne(h,r,x,c^4?s:T.set):(h,x)=>h[i]=x)),a=(0,n[g])(c?c<4?m?s:T[S]:c>4?void 0:{get:T.get,set:T.set}:r,u),d._=1,c^4||a===void 0?Xt(a)&&(c>4?$.unshift(a):c?m?s=a:T[S]=a:r=a):typeof a!="object"||a===null?Ot("Object expected"):(Xt(l=a.get)&&(T.get=l),Xt(l=a.set)&&(T.set=l),Xt(l=a.init)&&$.unshift(l));return c||Qn(e,r),T&>(r,i,T),m?c^4?s:T:r},ed=(e,t,i)=>Ua(e,typeof t!="symbol"?t+"":t,i),Jn=(e,t,i)=>t.has(e)||Ot("Cannot "+i),td=(e,t)=>Object(t)!==t?Ot('Cannot use the "in" operator on this value'):e.has(t),xe=(e,t,i)=>(Jn(e,t,"read from private field"),i?i.call(e):t.get(e)),Ye=(e,t,i)=>t.has(e)?Ot("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,i),Ne=(e,t,i,n)=>(Jn(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i),$n=(e,t,i)=>(Jn(e,t,"access private method"),i),id=(e,t,i,n)=>({set _(r){Ne(e,t,r,i)},get _(){return xe(e,t,n)}}),Da,gi,Xn=L({"base.ts"(){"use strict";Da=(()=>{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};return Object.setPrototypeOf(e,null),e})(),gi=(()=>{const e=["arg-in-ext","bold-header","format-leakage","fostered-content","h1","illegal-attr","insecure-style","invalid-gallery","invalid-imagemap","invalid-invoke","invalid-isbn","invalid-json","invalid-url","lonely-apos","lonely-bracket","lonely-http","nested-link","no-arg","no-duplicate","no-ignored","obsolete-attr","obsolete-tag","parsing-order","pipe-like","syntax-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 Pe(e,t,i){return i===1?e.replace(/\0(\d+)g\x7F/gu,(n,r)=>Pe(String(t[r]),t,2)):i===2?e.replace(/\0(\d+)n\x7F/gu,(n,r)=>String(t[r])):e.replace(/\0(\d+)\x7F/gu,(n,r)=>t[r])}var et,rs,Ft,Et,jt,bt,ci,Te,pt,Nr,Lr,Ai,pi,Ga,Fr,Er,fi,Rt,ve=L({"util/string.ts"(){"use strict";et=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,rs=String.raw`[^[\]<>"\0-\x1F\x7F${et}\uFFFD]`,Ft=String.raw`(?:\[[\da-f:.]+\]|${rs})`,Et=String.raw`(?:${rs}|\0\d+[cn!~]\x7F)*`,jt=e=>e.trim().toLowerCase(),bt=(e,t)=>i=>i.replace(e,t),ci=bt(/[\0\x7F]|\r$/gmu,""),Te=bt(/\0\d+[cn]\x7F/gu,""),pt=(e,t="")=>e.map(i=>typeof i=="string"?i:i.text()).join(t),Nr={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},Lr=bt(/&(?:#(\d+|[Xx][\da-fA-F]+)|([lg]t|[LG]T|[lr]brac[ke]|nbsp|amp|AMP|quot|QUOT));/gu,(e,t,i)=>t?String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t)):Nr[i.toLowerCase()]),pi=e=>(Ai!=null||(Ai=Lr),Ai(e)),Ga=bt(/&#(\d+|x[\da-f]+);/giu,(e,t)=>String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t))),Fr={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},Er=(e=/[&<>"{}[\]|]/gu)=>bt(e,t=>`&${Fr[t]};`),fi=Er(/[&<>]/gu),Rt=(e,t={})=>{const{pre:i="",post:n="",sep:r=""}=t;return i+e.map(s=>s.print()).join(r)+n}}}),sd=Vn({"i18n/en.json"(e,t){t.exports={"argument-in-ext":"template argument inside an extension tag","attributes-of-closing-tag":"attributes of a closing tag","bold-apostrophes":"bold apostrophes","bold-in-header":"bold text in a section header",close:null,"closing-and-self-closing":"tag that is both closing and self-closing",comment:null,"conflicting-image-parameter":"conflicting image $1 parameter","content-outside-table":"content to be moved outside the table",decode:null,delink:null,"duplicate-attribute":"duplicate $1 attribute","duplicate-category":"duplicate category","duplicate-id":"duplicate HTML id","duplicate-image-parameter":"duplicate image $1 parameter","duplicate-parameter":"duplicate template parameter",encode:null,escape:null,expand:null,"ext-in-html":"extension tag in HTML tag attributes",frame:null,"full-width-punctuation":"full-width punctuation","header-in-html":"section header in HTML tag attributes","header-like":"header-like syntax in plain text","horizontal-alignment":null,"html-in-table":"HTML tag in table attributes","illegal-attribute-name":"invalid attribute name","illegal-attribute-value":"invalid attribute value","illegal-module":"invalid Scribunto module name","imagemap-without-image":"<imagemap> without an image","in-url":"$1 in URL","inconsistent-table":"inconsistent table layout","insecure-style":"insecure style","invalid-attribute":"element containing an invalid attribute name","invalid-category":"invalid category name","invalid-content":"invalid content in <$1>","invalid-conversion-flag":"invalid conversion flag","invalid-gallery":"invalid gallery image","invalid-gallery-link":"invalid link in gallery image","invalid-image-parameter":"invalid image parameter","invalid-imagemap-link":"invalid link in <imagemap>","invalid-isbn":"invalid ISBN","invalid-parameter":"invalid parameter of <$1>","invalid-self-closing":"invalid self-closing tag","invalid-thumb":"invalid thumbnail filename","invalid-url":"invalid URL","invisible-triple-braces":"invisible content inside triple braces","italic-apostrophes":"italic apostrophes","left-bracket":"opening bracket","link-in-extlink":"internal link in an external link",lonely:'lonely "$1"',"missing-extension":"missing file extension","missing-function":"missing Scribunto module function name",newline:null,"no-self-closing":"no self-closing","nonzero-tabindex":"nonzero tabindex","nothing-in":"nothing should be in <$1>","obsolete-attribute":"obsolete attribute","obsolete-tag":"obsolete HTML tag",open:null,prefix:null,"pipe-in-link":'additional "|" in the link text',"pipe-in-table":'additional "|" in a table cell',"redirect-like":"redirect-like syntax in a list item","ref-in-link":"<ref> in an internal or external link",remove:null,"template-in-link":"template in an internal link target","unbalanced-in-section-header":"unbalanced $1 in a section header",unclosed:"unclosed $1","unclosed-comment":"unclosed HTML comment","unclosed-quotes":"unclosed quotes","unclosed-table":"unclosed table","unclosed-tag":"unclosed tag","unescaped-query":"unescaped query string in an anonymous parameter","unexpected-argument":"unexpected template argument","unmatched-closing":"unmatched closing tag","unnecessary-encoding":"unnecessary percent-encoding in an internal link",uppercase:null,"useless-attribute":"useless attribute","useless-fragment":"useless fragment","useless-link-text":"useless link text","variable-anchor":"variable anchor in a section header","vertical-alignment":null,whitespace:null}}}),nd=Vn({"config/minimum.json"(e,t){t.exports={ext:[],html:[["b","bdi","del","i","ins","u","font","big","small","sub","sup","h1","h2","h3","h4","h5","h6","cite","code","em","s","strike","strong","tt","var","div","center","blockquote","ol","ul","dl","table","caption","pre","ruby","rb","rp","rt","rtc","p","span","abbr","dfn","kbd","samp","data","time","mark","tr","td","th","q","bdo"],["li","dt","dd"],["br","wbr","hr","meta","link"]],namespaces:{0:"",6:"File",10:"Template",14:"Category",828:"Module"},nsid:{"":0,file:6,template:10,category:14,module:828},functionHook:["msgnw"],variable:["!","=","pageid","articlepath","server","servername","scriptpath","stylepath"],parserFunction:[{msgnw:"msgnw",pageid:"pageid",articlepath:"articlepath",server:"server",servername:"servername",scriptpath:"scriptpath",stylepath:"stylepath","#language":"language","#special":"special","#speciale":"speciale","#tag":"tag","#formatdate":"formatdate","#dateformat":"formatdate","#invoke":"invoke","#while":"while","#dowhile":"dowhile","#loop":"loop","#forargs":"forargs","#fornumargs":"fornumargs","#if":"if","#ifeq":"ifeq","#switch":"switch","#ifexist":"ifexist","#ifexpr":"ifexpr","#iferror":"iferror","#time":"time","#timel":"timel","#expr":"expr","#rel2abs":"rel2abs","#titleparts":"titleparts","#categorytree":"categorytree","#urldecode":"urldecode","#choose":"choose","#var":"var","#varexists":"varexists","#var_final":"var_final","#vardefine":"vardefine","#vardefineecho":"vardefineecho","#widget":"widget","#related":"related","#regex":"regex","#regex_var":"regex_var","#regexquote":"regexquote","#regexall":"regexall","#len":"len","#pos":"pos","#rpos":"rpos","#sub":"sub","#count":"count","#rmatch":"rmatch","#rreplace":"rreplace","#replace":"replace","#rsplit":"rsplit","#explode":"explode","#tab":"tab","#seo":"seo","#babel":"babel","#translation":"translation","#commaseparatedlist":"commaseparatedlist","#coordinates":"coordinates","#lst":"lst","#lsth":"lsth","#lstx":"lstx","#assessment":"assessment","#mentor":"mentor","#property":"property","#target":"target","#section":"lst","#section-x":"lstx","#section-h":"lsth","#statements":"statements","#useliquidthreads":"useliquidthreads","#lqtpagelimit":"lqtpagelimit","#avatar":"avatar","#img":"img","#chart":"chart"},{"!":"!","=":"=","#FORMAL":"formal","#bcp47":"bcp47","#dir":"dir","#interwikilink":"interwikilink","#interlanguagelink":"interlanguagelink","#contentmodel":"contentmodel","#timef":"timef","#timefl":"timefl"},["msg","raw"],["subst","safesubst"]],doubleUnderscore:[[],[]],protocol:"bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|matrix:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|wikipedia://|worldwind://|xmpp:",interwiki:[],img:{},redirection:["#redirect"],variants:[]}}}),$e,Va,Qa,Di,_n,Ue=L({"util/constants.ts"(){"use strict";$e=11,Va=sd(),Qa=new Set(["alt","link","lang","page","caption"]),Di=new Set(["tiff","tif","png","gif","jpg","jpeg","webp","xcf","pdf","svg","djvu"]),_n=nd()}});function ct(e){const t=new Map,i=new WeakMap;return n=>{const r=typeof n=="string"?t:i;if(r.has(n)){const l=r.get(n);return l.lastIndex=0,l}const s=e(n);return r.set(n,s),s}}var mi,Ja,jr,Xa,qi,$i,Rr,Ka,Ve=L({"../common/dist/index.mjs"(){"use strict";mi=e=>decodeURIComponent(e.replace(/%(?![\da-f]{2})/giu,"%25")),Ja=e=>Math.round(e*255).toString(16).padStart(2,"0"),jr=(()=>{const e=String.raw`#(?:[\da-f]{3,4}|(?:[\da-f]{2}){3,4})(?![\p{L}\p{N}_])`,t=String.raw`(?:\d*\.)?\d+%?`,i=String.raw`(?:\d*\.)?\d+(?:deg|grad|rad|turn)?`,n=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*\)`,r=String.raw`hsla?\(\s*(?:${String.raw`${i}\s+${t}\s+${t}(?:\s*\/\s*${t})?`}|${String.raw`${i}${String.raw`\s*,\s*(?:\d*\.)?\d+%`.repeat(2)}(?:\s*,\s*${t})?`})\s*\)`;return{full:new RegExp(String.raw`(^|[^\p{L}\p{N}_])(${e}|${n}|${r})`,"giu"),rgb:new RegExp(String.raw`(^|[^\p{L}\p{N}_])(${e}|${n})`,"giu")}})(),Xa=(e,t=!0)=>{const i=[],n=jr[t?"full":"rgb"];n.lastIndex=0;let r=n.exec(e),s=0;for(;r;){const l=r.index+r[1].length;l>s&&i.push([e.slice(s,l),s,l,!1]),{lastIndex:s}=n,i.push([r[2],l,s,e[l-1]!=="&"||!/^#\d+$/u.test(r[2])]),r=n.exec(e)}return e.length>s&&i.push([e.slice(s),s,e.length,!1]),i},qi=e=>{const t=[];let i=0;for(const n of e.split(`
|
|
2
|
-
`)){const r=i+n.length;t.push([n,i,r]),i=r+1}return t},$i=e=>e&&Number(e[1]),Rr=(e,t)=>{var n;let i;for(const r of t){const{line:s,column:l,position:a}=r;a==null?s?(i!=null||(i=qi(e)),(n=r.column)!=null||(r.column=1),r.position=i[s-1][1]+(r.column-1)):(r.position=0,r.line=1,r.column=1):(!s||!l)&&(i!=null||(i=qi(e)),r.line=i.findIndex(([,,d])=>a<=d)+1,r.column=a-i[r.line-1][1]+1)}return t},Ka=(e,t)=>{if(t||e.trim())try{JSON.parse(e)}catch(i){const{message:n}=i,r=$i(/\bline (\d+)/u.exec(n)),s=$i(/\bcolumn (\d+)/u.exec(n)),l=$i(/\bposition (\d+)/u.exec(n));return Rr(e,[{message:n,line:r,column:s,position:l,severity:"error"}])}return[]}}}),fe,ye=L({"lib/rect.ts"(){"use strict";var e,t,i,n,Tn,s;fe=(s=class{constructor(l,a){j(this,n);j(this,e);j(this,t);j(this,i);E(this,e,l),E(this,t,a)}get start(){return b(this,t)}get top(){return R(this,n,Tn).call(this).top}get left(){return R(this,n,Tn).call(this).left}},e=new WeakMap,t=new WeakMap,i=new WeakMap,n=new WeakSet,Tn=function(){var l;return(l=b(this,i))!=null||E(this,i,b(this,e).getRootNode().posFromIndex(b(this,t))),b(this,i)},s)}}),Pr,Or,hi,xi,ls,Y,G,qe,Ji,ee,Kn,tt,Yn,Zn,er,vi,Pt,tr,ht,ir,Q=L({"util/lint.ts"(){"use strict";Ve(),Ie(),ye(),D(),Pr=new Set(["tr","td","th","caption"]),Or=new Set(["Template:!!","Template:!-"]),hi=e=>{const t=e.childNodes.find(i=>i.text().trim());if(!t||t.type==="text"&&t.data.trim().startsWith("!")||t.is("magic-word")&&t.name==="!"||t.is("template")&&Or.has(t.name)||t.is("html")&&Pr.has(t.name))return!1;if(t.is("arg"))return t.length>1&&hi(t.childNodes[1]);if(t.is("magic-word"))try{const i=t.getPossibleValues().map(hi);return i.includes(2)?2:i.includes(1)&&1}catch{}return t.is("template")||t.is("magic-word")&&t.name==="invoke"?1:2},xi=(e,t,i,n)=>({line:e+i-1,character:(i===1?t:0)+n}),ls=e=>(t,i,n,r,s="error")=>{const{start:l}=i,{top:a,left:d}=i instanceof fe?i:new fe(t,l),{offsetHeight:u,offsetWidth:o}=t,{startIndex:c,startLine:f,startCol:m}=e(t,l,a,d),{line:y,character:S}=xi(f,m,u,o);return{rule:n,message:F.msg(r),severity:s,startIndex:c,endIndex:c+t.toString().length,startLine:f,endLine:y,startCol:m,endCol:S}},Y=ls((e,t,i,n)=>{const r=e.getRelativeIndex(),{top:s,left:l}=e.parentNode.posFromIndex(r);return{startIndex:t+r,startLine:i+s,startCol:s?l:n+l}}),G=ls((e,t,i,n)=>({startIndex:t,startLine:i,startCol:n})),qe=(e,t,i,n=0)=>({desc:F.msg(t),range:[e.startIndex+n,e.endIndex],text:i}),Ji=(e,t,i)=>({desc:F.msg(t),range:[e,e],text:i}),ee=(e,t=0,i="")=>typeof e=="number"?{desc:F.msg("remove"),range:[e,e+t],text:i}:qe(e,"remove",i,t),Kn=(e,t)=>qe(e,"decode",mi(t.text().replace(/%(?=21|3[ce]|5[bd]|7[b-d])/giu,"%25"))),tt=(e,t,i=0)=>({desc:F.msg("close"),range:[e+i,e],text:t}),Yn=e=>({desc:F.msg("open"),range:[e+1,e+2],text:""}),Zn=(e,t)=>qe(e,"comment",`<!--${t}-->`),er=(e,t)=>qe(e,"uppercase",t.toUpperCase()),vi=(e,t=0)=>({desc:F.msg("whitespace"),range:[e,e+t],text:" "}),Pt=(e,t,i=1)=>({desc:F.msg("escape"),range:[e,e+i],text:t.repeat(i)}),tr=(e,t)=>({desc:F.msg("escape"),range:[e,e+t.length],text:t.replace(/\|/gu,"|")}),ht=(e,t,i,n)=>{if(e&&(n||F.viewOnly&&e[0]===pe.rev))return e[1];const r=t();return(n||F.viewOnly)&&i([pe.rev,r]),r},ir=(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"]:[]}}),Br,sr,Ya=L({"util/selector.ts"(){"use strict";Br=e=>{if(e.includes("#")){const t=e.indexOf("#"),i=e.slice(0,t),n=e.slice(t+1);return(r,s)=>(t===0||r===i)&&s===n}return t=>t===e},sr=(e,t,i)=>{if(e=e.trim(),!e)return(()=>!0);const n=e.split(",").map(r=>r.trim()).filter(r=>r!=="").map(Br);return(({type:r,name:s})=>n.some(l=>l(r,s)))}}}),rd=Vn({"../node_modules/binary-search/index.js"(e,t){t.exports=function(i,n,r,s,l){var a,d;if(s===void 0)s=0;else if(s=s|0,s<0||s>=i.length)throw new RangeError("invalid lower bound");if(l===void 0)l=i.length-1;else if(l=l|0,l<s||l>=i.length)throw new RangeError("invalid upper bound");for(;s<=l;)if(a=s+(l-s>>>1),d=+r(i[a],n,a,i),d<0)s=a+1;else if(d>0)l=a-1;else return a;return~s}}}),qr,Za,ld=L({"util/search.ts"(){"use strict";qr=Yu(rd()),Za=(e,t,i)=>{const n=(0,qr.default)(e,t,i);return n<0?~n:n}}}),Xi,nr=L({"mixin/cached.ts"(){"use strict";Q(),Xi=(e=!0)=>t=>{const i=new WeakMap;return function(...n){return ht(i.get(this),()=>t.apply(this,n),r=>{i.set(this,r)},e)}}}}),eo,ad=L({"mixin/nodeLike.ts"(){"use strict";eo=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}}}),Wr,Mr,_i,Wt,Mt,Ti,Ut,zt,Ht,lt,to=L({"lib/node.ts"(){"use strict";Ve(),ld(),Q(),Ie(),nr(),ad(),D(),Mr=[eo],Wr=[Xi(!1)],lt=class{constructor(){ne(Ht,5,this),ed(this,"childNodes",[]),Ye(this,_i),Ye(this,Wt),Ye(this,Mt),Ye(this,Ti),Ye(this,Ut),Ye(this,zt,{})}get parentNode(){return xe(this,_i)}get nextSibling(){return xe(this,Wt)}get previousSibling(){return xe(this,Mt)}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":Ne(this,_i,t),t||(Ne(this,Wt,void 0),Ne(this,Mt,void 0));break;case"nextSibling":Ne(this,Wt,t);break;case"previousSibling":Ne(this,Mt,t);break;case"aIndex":F.viewOnly&&Ne(this,Ut,[pe.rev,t]);break;default:this[e]=t}}getRootNode(){return ht(xe(this,Ti),()=>{var e,t;return(t=(e=this.parentNode)==null?void 0:e.getRootNode())!=null?t:this},e=>{const[,t]=e;t.type==="root"&&Ne(this,Ti,e)})}indexFromPos(e,t){{if(e<0||t<0)return;const i=this.getLines();if(e>=i.length)return;const[,n,r]=i[e],s=n+t;return s>r?void 0:s}}posFromIndex(e){{const{length:t}=String(this);if(e+=e<0?t:0,e>=0&&e<=t){const i=this.getLines(),n=Za(i,e,([,,r],s)=>r-s);return{top:n,left:e-i[n][1]}}return}}getDimension(){{const e=this.getLines(),t=e[e.length-1];return{height:e.length,width:t[2]-t[1]}}}getGaps(e){return 0}getRelativeIndex(e){if(e===void 0){const{parentNode:t}=this;return t?t.getRelativeIndex(t.childNodes.indexOf(this)):0}return ht(xe(this,zt)[e],()=>{const{childNodes:t}=this,i=e+(e<0?t.length:0);let n=this.getAttribute("padding");for(let r=0;r<i;r++)F.viewOnly&&(xe(this,zt)[r]=[pe.rev,n]),n+=t[r].toString().length+this.getGaps(r);return n},t=>{xe(this,zt)[e]=t})}getAbsoluteIndex(){return ht(xe(this,Ut),()=>{const{parentNode:e}=this;return e?e.getAbsoluteIndex()+this.getRelativeIndex():0},e=>{Ne(this,Ut,e)})}getBoundingClientRect(){return{...this.getDimension(),...this.getRootNode().posFromIndex(this.getAbsoluteIndex())}}is(e){return this.type===e}getLines(){return qi(String(this))}seal(e,t){{if(F.internal)return;const i=!t&&!!this[e];i||Object.defineProperty(this,e,{enumerable:i,configurable:!0})}}lspError(e){throw new Error(`${e} method is only available in the LSP version!`)}},Ht=le(null),_i=new WeakMap,Wt=new WeakMap,Mt=new WeakMap,Ti=new WeakMap,Ut=new WeakMap,zt=new WeakMap,re(Ht,1,"getLines",Wr,lt),lt=re(Ht,0,"AstNode",Mr,lt),ne(Ht,1,lt)}}),io,od=L({"mixin/elementLike.ts"(){"use strict";Ya(),io=e=>{var t,Cn;{class n extends e{constructor(){super(...arguments);j(this,t)}getElementBy(l){const a=[...this.childNodes].reverse();for(;a.length>0;){const d=a.pop(),{type:u,childNodes:o}=d;if(u!=="text"){if(l(d))return d;for(let c=o.length-1;c>=0;c--)a.push(o[c])}}}querySelector(l){return this.getElementBy(R(this,t,Cn).call(this,l))}getElementsBy(l){const a=[...this.childNodes].reverse(),d=[];for(;a.length>0;){const u=a.pop(),{type:o,childNodes:c}=u;if(o!=="text"){l(u)&&d.push(u);for(let f=c.length-1;f>=0;f--)a.push(c[f])}}return d}querySelectorAll(l){return this.getElementsBy(R(this,t,Cn).call(this,l))}escape(){for(const l of this.childNodes)l.escape()}}return t=new WeakSet,Cn=function(l){return sr(l,this)},n}}}}),Ur,as,zr,Kt,ud=L({"lib/element.ts"(){"use strict";ve(),Ie(),Ya(),to(),od(),Ur=[io],Kt=class extends(zr=lt){get length(){return this.childNodes.length}text(e){return pt(this.childNodes,e)}removeAt(e){return yi(this,e,1)[0]}insertAt(e,t=this.length){return yi(this,t,0,[e]),e}closest(e){const t=sr(e,this);let{parentNode:i}=this;for(;i;){if(t(i))return i;({parentNode:i}=i)}}isInside(e){var t;return((t=this.closest(`${e},ext`))==null?void 0:t.type)===e}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 i=this.childNodes[t],{data:n}=i;return i.replaceData(e),n}toString(e,t=""){return this.childNodes.map(i=>i.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 i=this,n=0,r=0;for(;i.type!=="text";){const{childNodes:s}=i;n+=i.getAttribute("padding");for(let l=0;n<=e&&l<s.length;l++){const a=s[l],{nextSibling:d}=a,u=a.toString(),o=u.length;if(a.setAttribute("aIndex",n),n+=o,n>e||n===e&&o>0&&(!d||d.type==="text"||a.type!=="text"&&(u.trim()||!d.toString().trim()))){i=a,n-=o,r=n;break}n+=i.getGaps(l)}if(i.childNodes===s)return{offsetNode:i,offset:e-r}}return{offsetNode:i,offset:e-r}}this.lspError("AstElement.caretPositionFromIndex")}elementFromIndex(e){var t;{const i=(t=this.caretPositionFromIndex(e))==null?void 0:t.offsetNode;return(i==null?void 0:i.type)==="text"?i.parentNode:i}this.lspError("AstElement.elementFromIndex")}elementFromPoint(e,t){return this.elementFromIndex(this.indexFromPos(t,e))}lint(e=this.getAbsoluteIndex(),t){{const i=[];for(let n=0,r=e+this.getAttribute("padding");n<this.length;n++){const s=this.childNodes[n];s.setAttribute("aIndex",r);const l=s.lint(r,t);l.length>0&&Array.prototype.push.apply(i,l),r+=s.toString().length+this.getGaps(n)}return i}}print(e={}){{const t=e.class;return this.toString()?(t===""?"":`<span class="wpb-${t!=null?t:this.type}${this.getAttribute("invalid")?" wpb-invalid":""}">`)+Rt(this.childNodes,e)+(t===""?"":"</span>"):""}}json(e,t=this.getAbsoluteIndex()){{const i={...this,type:this.type,range:[t,t+this.toString().length],childNodes:[]};for(let n=0,r=t+this.getAttribute("padding");n<this.length;n++){const s=this.childNodes[n],{length:l}=s.toString();s.setAttribute("aIndex",r),i.childNodes.push(s.type==="text"?{data:s.data,range:[r,r+l]}:s.json(void 0,r)),r+=l+this.getGaps(n)}return i}}},as=le(zr),Kt=re(as,0,"AstElement",Ur,Kt),ne(as,1,Kt)}}),wi,Ki=L({"mixin/gapped.ts"(){"use strict";wi=(e=1)=>t=>{class i extends t{getGaps(){return e}}return i}}}),Ce,Le=L({"mixin/noEscape.ts"(){"use strict";Ce=e=>{{class t extends e{escape(){}}return t}}}}),Hr,so,dd=L({"src/parameter.ts"(){"use strict";ve(),Q(),D(),V(),Hr=new RegExp(`https?://${Ft}${Et}$`,"iu"),so=class extends U{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,i,n=[]){super(void 0,i,n);const r=new U(typeof e=="number"?void 0:e,i,n,{}),s=new U(t,i,n);r.type="parameter-key",r.setAttribute("stage",2),s.type="parameter-value",s.setAttribute("stage",2),this.append(r,s)}trimName(e,t=!0){const i=(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",i),i}afterBuild(){if(!this.anon){const{parentNode:e,firstChild:t}=this,i=this.trimName(t);e&&e.getArgs(i,!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 i;{const n=super.lint(e,t),r="unescaped",{lintConfig:s}=F,l=s.getSeverity(r);if(l){const{firstChild:a}=this,d=(i=Hr.exec(a.text()))==null?void 0:i[0];try{if(d&&new URL(d).search){const u=Y(a,{start:e},r,"unescaped-query",l);u.startIndex=u.endIndex,u.startLine=u.endLine,u.startCol=u.endCol,u.endIndex++,u.endCol++,(s.computeEditInfo||s.fix)&&(u.fix=Pt(u.startIndex,"{{=}}")),n.push(u)}}catch{}}return n}}print(){return super.print({sep:this.anon?"":"="})}json(e,t=this.getAbsoluteIndex()){{const i=super.json(void 0,t);return Object.assign(i,{anon:this.anon},this.duplicated&&{duplicated:!0}),i}}}}}),Me,ft=L({"src/atom.ts"(){"use strict";var e,t;V(),Me=(t=class extends U{constructor(n,r,s,l,a){super(n,s,l,a);j(this,e);E(this,e,r)}get type(){return b(this,e)}set type(n){E(this,e,n)}getAttribute(n){var r;return n==="invalid"?this.type==="converter-flag"&&!!((r=this.parentNode)!=null&&r.isInvalidFlag(this)):super.getAttribute(n)}},e=new WeakMap,t)}}),Ge,mt=L({"src/syntax.ts"(){"use strict";var e,t;V(),Ge=(t=class extends U{constructor(n,r,s,l,a){super(n,s,l,a);j(this,e);E(this,e,r)}get type(){return b(this,e)}lint(n=this.getAbsoluteIndex()){return super.lint(n,!1)}},e=new WeakMap,t)}}),no={};oe(no,{TranscludeToken:()=>at});var Dr,os,Gr,at,ro=L({"src/transclude.ts"(){"use strict";var e,t,i,n,r,s,Yt,lo,d;ve(),Q(),Ie(),ye(),Ki(),Le(),D(),V(),dd(),ft(),mt(),Dr=[Ce,wi()],at=(d=class extends(Gr=U){constructor(o,c,f,m=[]){var w,A;let y;const S=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(o);S&&(y=Number(S[1]),o=o.replace(`\0${y}h`,m[y].toString().replace(/^\n/u,"")));super(void 0,f,m,{});j(this,s);je(this,"modifier","");j(this,e,"template");j(this,t,":");j(this,i,!1);j(this,n,new Map);j(this,r);const{parserFunction:$,variable:_,functionHook:T}=f,g=(w=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(o))==null?void 0:w[0];if(g)this.setAttribute("modifier",g),o=o.slice(g.length);else if(o.includes(":")){const[C,...N]=o.split(":"),[B]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((A=N[0])!=null?A:"");this.setModifier(`${C}:${B}`)&&(o=N.join(":").slice(B.length))}const h=o.search(/[::]/u),x=o[h]===":",p=h!==-1;if(p||c.length===0&&!b(this,i)){const C=p?o.slice(0,h):o,N=p&&o.slice(h+1),B=Te(C),q=p?B.slice(B.search(/\S/u))+(x?":":""):B.trim(),[,O,P]=qu(q,$),I=!("functionHook"in f)||T.includes(P),W=_.includes(P);if(p?P&&I:W){this.setAttribute("name",P),E(this,e,"magic-word"),x&&E(this,t,":");const J=new Ge(C,"magic-word-name",f,m);if(super.insertAt(J),N!==!1&&c.unshift([N]),this.name==="invoke")for(let X=0;X<2;X++){const z=c.shift();if(!z)break;const H=new Me(z.join("="),`invoke-${X?"function":"module"}`,f,m);super.insertAt(H)}}}if(this.type==="template"){const C=Te(o).trim();if(!this.normalizeTitle(C,10,{halfParsed:!0,temporary:!0}).valid)throw m.pop(),new SyntaxError("Invalid template name");const N=new Me(o,"template-name",f,m,{});super.insertAt(N)}typeof y=="number"&&(m[y]=void 0);const k=this.isTemplate();let v=1;for(let C=0;C<c.length;C++){const N=c[C];k||this.name==="switch"&&C>0||this.name==="tag"&&C>1||(N[0]=N.join("="),N.length=1),N.length===1&&(N.unshift(v),v++),this.insertAt(new so(...N,f,m))}this.seal("modifier")}get type(){return b(this,e)}get module(){return this.type==="magic-word"&&this.name==="invoke"?R(this,s,Yt).call(this).title:void 0}get function(){var o;return this.type==="magic-word"&&this.name==="invoke"?(o=this.childNodes[2])==null?void 0:o.text().trim():void 0}setModifier(o){const{parserFunction:[,,c,f]}=this.getAttribute("config"),m=Te(o).trim();if(o&&!m.endsWith(":"))return!1;const y=m.slice(0,-1).toLowerCase(),S=c.includes(y),$=f.includes(y);return(b(this,i)?S:$||!o)||(pe.running||this.length>1)&&(S||$||!o)?(this.setAttribute("modifier",o),E(this,i,S),!!o):!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,r,R(this,s,Yt).call(this)),this.setAttribute("name",b(this,r).title))}toString(o){const{childNodes:c,length:f,firstChild:m,modifier:y,type:S}=this;return`{{${y}${S==="magic-word"?m.toString(o)+(f===1?"":b(this,t))+c.slice(1).map($=>$.toString(o)).join("|"):super.toString(o,"|")}}}`}text(){const{childNodes:o,length:c,firstChild:f,modifier:m,type:y,name:S}=this;return y==="magic-word"&&S==="vardefine"?"":`{{${m}${y==="magic-word"?f.text()+(c===1?"":b(this,t))+pt(o.slice(1),"|"):super.text("|")}}}`}getAttribute(o){switch(o){case"padding":return this.modifier.length+2;case"title":return b(this,r);case"colon":return b(this,t);case"invalid":return this.type==="magic-word"&&this.name==="invoke"&&(this.length===2||!R(this,s,Yt).call(this).valid);default:return super.getAttribute(o)}}lint(o=this.getAbsoluteIndex(),c){{const f=super.lint(o,c);if(!this.isTemplate())return f;const{type:m,childNodes:y,length:S}=this,$=new fe(this,o),{lintConfig:_}=F,{computeEditInfo:T}=_,g=m==="magic-word";let h="no-ignored",x=_.getSeverity(h,"fragment");if(g&&!R(this,s,Yt).call(this).valid)h="invalid-invoke",x=_.getSeverity(h,"name"),x&&f.push(Y(y[1],$,h,"illegal-module",x));else if(x){const p=y[g?1:0],k=p.childNodes.findIndex(w=>w.type==="text"&&pi(w.data).includes("#")),v=p.childNodes[k];if(v){const w=Y(p,$,h,"useless-fragment",x);T&&(w.suggestions=[ee(w,p.getRelativeIndex(k)+v.data.indexOf("#"))]),f.push(w)}}if(h="invalid-invoke",x=_.getSeverity(h,"function"),x&&g&&S===2)return f.push(G(this,$,h,"missing-function",x)),f;if(h="no-duplicate",x=_.getSeverity(h,"parameter"),x){const p=this.getDuplicatedArgs().filter(([,v])=>!v[0].querySelector("ext")),k="duplicate-parameter";for(const[,v]of p)Array.prototype.push.apply(f,v.map(w=>{const A=Y(w,$,h,k,x);return T&&(A.suggestions=[ee(A,-1)]),A}))}return f}}insertAt(o,c=this.length){return super.insertAt(o,c),o.anon?R(this,s,lo).call(this,o):o.name&&this.getArgs(o.name,!1,!1).add(o),o}getAllArgs(){return this.childNodes.filter(ss("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:o})=>o)}getArgs(o,c,f=!0){const m=String(o).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");let y;return b(this,n).has(m)?y=b(this,n).get(m):(y=new Set(this.getAllArgs().filter(({name:S})=>m===S)),b(this,n).set(m,y)),y}getDuplicatedArgs(){return[...b(this,n)].filter(([,{size:o}])=>o>1).map(([o,c])=>[o,[...c]])}getPossibleValues(){const{type:o,name:c,childNodes:f}=this;if(o==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let m,y;switch(c){case"if":case"ifexist":case"ifexpr":case"iferror":m=2;break;case"ifeq":m=3;break;case"switch":{const S=f.slice(2),$=S[S.length-1];y=[...S.filter(({anon:_})=>!_),...$!=null&&$.anon?[$]:[]].map(({lastChild:_})=>_);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}y!=null||(y=f.slice(m,m+2).map(({lastChild:S})=>S));for(let S=0;S<y.length;){const{length:$,0:_}=y[S].childNodes.filter(T=>T.text().trim());if($===0)y.splice(S,1);else if($>1||!_.is("magic-word"))S++;else try{const T=_.getPossibleValues();Array.prototype.splice.apply(y,[S,1,...T]),S+=T.length}catch{S++}}return y}print(){{const{childNodes:o,length:c,firstChild:f,modifier:m,type:y}=this;return`<span class="wpb-${y}${this.getAttribute("invalid")?" wpb-invalid":""}">{{${y==="magic-word"?fi(m)+f.print()+(c===1?"":b(this,t))+Rt(o.slice(1),{sep:"|"}):(m?`<span class="wpb-magic-word">${fi(m)}</span>`:"")+Rt(o,{sep:"|"})}}}</span>`}}},e=new WeakMap,t=new WeakMap,i=new WeakMap,n=new WeakMap,r=new WeakMap,s=new WeakSet,Yt=function(){const o=this.type==="template";return this.normalizeTitle((o?"":"Module:")+Te(this.childNodes[o?0:1].text()),10,{temporary:!0,...!o&&{page:""}})},lo=function(o){const c=this.getAnonArgs(),f=typeof o!="number";for(let m=f?c.indexOf(o):o-1;m<c.length;m++){const y=c[m],{name:S}=y,$=String(m+1);(S!==$||y===o)&&(y.setAttribute("name",$),this.getArgs($,!1,!1).add(y))}},d),os=le(Gr),at=re(os,0,"TranscludeToken",Dr,at),ne(os,1,at)}}),Ci,us,Vr,Qr,Jr,Xr,ds,Kr,In,cd=L({"lib/text.ts"(){"use strict";var e,Nn,i;ve(),Q(),Ie(),D(),to(),Ci=String.raw`[${et}\t]*`,us=String.raw`<(?:/[^\S\n]*)?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|\n={2,}`,Vr=new RegExp(String.raw`${us}|https?[:/]/+|(?:rfc|pmid)(?=[-::]?${Ci}\d)|isbn(?=[-::]?${Ci}(?:\d(?:${Ci}|-)){6})`,"giu"),Qr=new RegExp(us,"giu"),Jr=new Set(["attr-value","ext-link-text","link-text"]),Xr={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},ds=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"]),Kr=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch{return/\w/u}})(),In=(i=class extends lt{constructor(s){super();j(this,e);je(this,"data","");this.data=s}get type(){return"text"}toString(s){var l;return s&&!((l=this.parentNode)!=null&&l.getAttribute("built"))?Te(this.data):this.data}text(){return this.data}lint(s=this.getAbsoluteIndex(),l){var a,d,u;{if(l===!1)return[];const{data:o,parentNode:c,nextSibling:f,previousSibling:m}=this;if(!c)throw new Error("An isolated text node cannot be linted!");const{type:y,parentNode:S}=c;if(y==="attr-value"){const{name:O,tag:P}=S;if(P==="ref"&&(O==="name"||O==="follow")||O==="group"&&(P==="ref"||P==="references")||P==="choose"&&(O==="before"||O==="after"))return[]}if(l!=null||(l=c.isPlain()&&!Jr.has(y)?Vr:Qr),o.search(l)===-1)return[];l.lastIndex=0;const $=[],_=f==null?void 0:f.type,T=f==null?void 0:f.name,g=m==null?void 0:m.type,h=this.getRootNode(),x=h.toString(),{ext:p,html:k,variants:v}=h.getAttribute("config"),{top:w,left:A}=h.posFromIndex(s),{lintConfig:C}=F,N=C.rules["tag-like"],B=typeof N=="object"&&N[1]?new Set(Object.keys(N[1]).filter(O=>O!=="invalid"&&O!=="disallowed")):new Set,q=new Set(["onlyinclude","noinclude","includeonly",...p,...k[0],...k[1],...k[2],...B,...C.getSeverity("tag-like","disallowed")?ds:[]]);for(let O=l.exec(o);O;O=l.exec(o)){let{index:P,0:I}=O;const[,W,J]=O,X=I==="["&&y==="ext-link-text";if(I.startsWith("<")&&!q.has(W.toLowerCase())||X&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(o.slice(P+1))||f!=null&&f.is("ext")&&T==="nowiki"&&((a=f.innerText)!=null&&a.includes("]"))))continue;if(J&&J!=="]"){const{length:me}=J;P+=me,I=I.slice(me)}else I.startsWith(`
|
|
3
|
-
==`)&&(P++,I=I.slice(1));I=I.toLowerCase();const[z]=I,H=I==="rfc"||I==="pmid"||I==="isbn",Z=z==="{",ie=z==="}",ue=z==="[",be=z==="]";let{length:de}=I;be&&(P||de>1)&&l.lastIndex--;let ae=s+P,Se=ae+de,ce,M,K,ke;const he=x[Se],Fe=x[ae-1],Je=Z||ue,Ae=I==="{"&&Fe==="-"&&v.length>0,te=I==="}"&&he==="-"&&v.length>0,st=ue&&_==="free-ext-link"&&!
|
|
1
|
+
"use strict";(()=>{var Vu=Object.defineProperty;var Tr=e=>{throw TypeError(e)};var Qu=(e,t,i)=>t in e?Vu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var Ju=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var je=(e,t,i)=>Qu(e,typeof t!="symbol"?t+"":t,i),ns=(e,t,i)=>t.has(e)||Tr("Cannot "+i);var b=(e,t,i)=>(ns(e,t,"read from private field"),i?i.call(e):t.get(e)),j=(e,t,i)=>t.has(e)?Tr("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,i),E=(e,t,i,n)=>(ns(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i),R=(e,t,i)=>(ns(e,t,"access private method"),i);var Cr=(e,t,i,n)=>({set _(r){E(e,t,r,i)},get _(){return b(e,t,n)}});var ec=Ju((ic,Gu)=>{var qa=Object.create,gt=Object.defineProperty,Wa=Object.getOwnPropertyDescriptor,Gn=Object.getOwnPropertyNames,Xu=Object.getPrototypeOf,Ku=Object.prototype.hasOwnProperty,Ma=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Ot=e=>{throw TypeError(e)},Ua=(e,t,i)=>t in e?gt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Ir=(e,t)=>gt(e,"name",{value:t,configurable:!0}),L=(e,t)=>function(){return e&&(t=(0,e[Gn(e)[0]])(e=0)),t},Vn=(e,t)=>function(){return t||(0,e[Gn(e)[0]])((t={exports:{}}).exports,t),t.exports},oe=(e,t)=>{for(var i in t)gt(e,i,{get:t[i],enumerable:!0})},za=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Gn(t))!Ku.call(e,r)&&r!==i&>(e,r,{get:()=>t[r],enumerable:!(n=Wa(t,r))||n.enumerable});return e},Yu=(e,t,i)=>(i=e!=null?qa(Xu(e)):{},za(t||!e||!e.__esModule?gt(i,"default",{value:e,enumerable:!0}):i,e)),se=e=>za(gt({},"__esModule",{value:!0}),e),le=e=>{var t;return[,,,qa((t=e==null?void 0:e[Ma("metadata")])!=null?t:null)]},Ha=["class","method","getter","setter","accessor","field","value","get","set"],Xt=e=>e!==void 0&&typeof e!="function"?Ot("Function expected"):e,Zu=(e,t,i,n,r)=>({kind:Ha[e],name:t,metadata:n,addInitializer:s=>i._?Ot("Already initialized"):r.push(Xt(s||null))}),Qn=(e,t)=>Ua(t,Ma("metadata"),e[3]),ne=(e,t,i,n)=>{for(var r=0,s=e[t>>1],l=s&&s.length;r<l;r++)t&1?s[r].call(i):n=s[r].call(i,n);return n},re=(e,t,i,n,r,s)=>{var l,a,d,o,u,c=t&7,f=!!(t&8),m=!!(t&16),y=c>3?e.length+1:c?f?1:2:0,S=Ha[c+5],$=c>3&&(e[y-1]=[]),_=e[y]||(e[y]=[]),T=c&&(!m&&!f&&(r=r.prototype),c<5&&(c>3||!m)&&Wa(c<4?r:{get[i](){return xe(this,s)},set[i](h){return Ne(this,s,h)}},i));c?m&&c<4&&Ir(s,(c>2?"set ":c>1?"get ":"")+i):Ir(r,i);for(var g=n.length-1;g>=0;g--)o=Zu(c,i,d={},e[3],_),c&&(o.static=f,o.private=m,u=o.access={has:m?h=>td(r,h):h=>i in h},c^3&&(u.get=m?h=>(c^1?xe:$n)(h,r,c^4?s:T.get):h=>h[i]),c>2&&(u.set=m?(h,x)=>Ne(h,r,x,c^4?s:T.set):(h,x)=>h[i]=x)),a=(0,n[g])(c?c<4?m?s:T[S]:c>4?void 0:{get:T.get,set:T.set}:r,o),d._=1,c^4||a===void 0?Xt(a)&&(c>4?$.unshift(a):c?m?s=a:T[S]=a:r=a):typeof a!="object"||a===null?Ot("Object expected"):(Xt(l=a.get)&&(T.get=l),Xt(l=a.set)&&(T.set=l),Xt(l=a.init)&&$.unshift(l));return c||Qn(e,r),T&>(r,i,T),m?c^4?s:T:r},ed=(e,t,i)=>Ua(e,typeof t!="symbol"?t+"":t,i),Jn=(e,t,i)=>t.has(e)||Ot("Cannot "+i),td=(e,t)=>Object(t)!==t?Ot('Cannot use the "in" operator on this value'):e.has(t),xe=(e,t,i)=>(Jn(e,t,"read from private field"),i?i.call(e):t.get(e)),Ye=(e,t,i)=>t.has(e)?Ot("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,i),Ne=(e,t,i,n)=>(Jn(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i),$n=(e,t,i)=>(Jn(e,t,"access private method"),i),id=(e,t,i,n)=>({set _(r){Ne(e,t,r,i)},get _(){return xe(e,t,n)}}),Da,gi,Xn=L({"base.ts"(){"use strict";Da=(()=>{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};return Object.setPrototypeOf(e,null),e})(),gi=(()=>{const e=["arg-in-ext","bold-header","format-leakage","fostered-content","h1","illegal-attr","insecure-style","invalid-gallery","invalid-imagemap","invalid-invoke","invalid-isbn","invalid-json","invalid-url","lonely-apos","lonely-bracket","lonely-http","nested-link","no-arg","no-duplicate","no-ignored","obsolete-attr","obsolete-tag","parsing-order","pipe-like","syntax-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 Pe(e,t,i){return i===1?e.replace(/\0(\d+)g\x7F/gu,(n,r)=>Pe(String(t[r]),t,2)):i===2?e.replace(/\0(\d+)n\x7F/gu,(n,r)=>String(t[r])):e.replace(/\0(\d+)\x7F/gu,(n,r)=>t[r])}var et,rs,Ft,Et,jt,bt,ci,Te,pt,Nr,Lr,Ai,pi,Ga,Fr,Er,fi,Rt,ve=L({"util/string.ts"(){"use strict";et=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,rs=String.raw`[^[\]<>"\0-\x1F\x7F${et}\uFFFD]`,Ft=String.raw`(?:\[[\da-f:.]+\]|${rs})`,Et=String.raw`(?:${rs}|\0\d+[cn!~]\x7F)*`,jt=e=>e.trim().toLowerCase(),bt=(e,t)=>i=>i.replace(e,t),ci=bt(/[\0\x7F]|\r$/gmu,""),Te=bt(/\0\d+[cn]\x7F/gu,""),pt=(e,t="")=>e.map(i=>typeof i=="string"?i:i.text()).join(t),Nr={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},Lr=bt(/&(?:#(\d+|[Xx][\da-fA-F]+)|([lg]t|[LG]T|[lr]brac[ke]|nbsp|amp|AMP|quot|QUOT));/gu,(e,t,i)=>t?String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t)):Nr[i.toLowerCase()]),pi=e=>(Ai!=null||(Ai=Lr),Ai(e)),Ga=bt(/&#(\d+|x[\da-f]+);/giu,(e,t)=>String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t))),Fr={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},Er=(e=/[&<>"{}[\]|]/gu)=>bt(e,t=>`&${Fr[t]};`),fi=Er(/[&<>]/gu),Rt=(e,t={})=>{const{pre:i="",post:n="",sep:r=""}=t;return i+e.map(s=>s.print()).join(r)+n}}}),sd=Vn({"i18n/en.json"(e,t){t.exports={"argument-in-ext":"template argument inside an extension tag","attributes-of-closing-tag":"attributes of a closing tag","bold-apostrophes":"bold apostrophes","bold-in-header":"bold text in a section header",close:null,"closing-and-self-closing":"tag that is both closing and self-closing",comment:null,"conflicting-image-parameter":"conflicting image $1 parameter","content-outside-table":"content to be moved outside the table",decode:null,delink:null,"duplicate-attribute":"duplicate $1 attribute","duplicate-category":"duplicate category","duplicate-id":"duplicate HTML id","duplicate-image-parameter":"duplicate image $1 parameter","duplicate-parameter":"duplicate template parameter",encode:null,escape:null,expand:null,"ext-in-html":"extension tag in HTML tag attributes",frame:null,"full-width-punctuation":"full-width punctuation","header-in-html":"section header in HTML tag attributes","header-like":"header-like syntax in plain text","horizontal-alignment":null,"html-in-table":"HTML tag in table attributes","illegal-attribute-name":"invalid attribute name","illegal-attribute-value":"invalid attribute value","illegal-module":"invalid Scribunto module name","imagemap-without-image":"<imagemap> without an image","in-url":"$1 in URL","inconsistent-table":"inconsistent table layout","insecure-style":"insecure style","invalid-attribute":"element containing an invalid attribute name","invalid-category":"invalid category name","invalid-content":"invalid content in <$1>","invalid-conversion-flag":"invalid conversion flag","invalid-gallery":"invalid gallery image","invalid-gallery-link":"invalid link in gallery image","invalid-image-parameter":"invalid image parameter","invalid-imagemap-link":"invalid link in <imagemap>","invalid-isbn":"invalid ISBN","invalid-parameter":"invalid parameter of <$1>","invalid-self-closing":"invalid self-closing tag","invalid-thumb":"invalid thumbnail filename","invalid-url":"invalid URL","invisible-triple-braces":"invisible content inside triple braces","italic-apostrophes":"italic apostrophes","left-bracket":"opening bracket","link-in-extlink":"internal link in an external link",lonely:'lonely "$1"',"missing-extension":"missing file extension","missing-function":"missing Scribunto module function name",newline:null,"no-self-closing":"no self-closing","nonzero-tabindex":"nonzero tabindex","nothing-in":"nothing should be in <$1>","obsolete-attribute":"obsolete attribute","obsolete-tag":"obsolete HTML tag",open:null,prefix:null,"pipe-in-link":'additional "|" in the link text',"pipe-in-table":'additional "|" in a table cell',"redirect-like":"redirect-like syntax in a list item","ref-in-link":"<ref> in an internal or external link",remove:null,"template-in-link":"template in an internal link target","unbalanced-in-section-header":"unbalanced $1 in a section header",unclosed:"unclosed $1","unclosed-comment":"unclosed HTML comment","unclosed-quotes":"unclosed quotes","unclosed-table":"unclosed table","unclosed-tag":"unclosed tag","unescaped-query":"unescaped query string in an anonymous parameter","unexpected-argument":"unexpected template argument","unmatched-closing":"unmatched closing tag","unnecessary-encoding":"unnecessary percent-encoding in an internal link",uppercase:null,"useless-attribute":"useless attribute","useless-fragment":"useless fragment","useless-link-text":"useless link text","variable-anchor":"variable anchor in a section header","vertical-alignment":null,whitespace:null}}}),nd=Vn({"config/minimum.json"(e,t){t.exports={ext:[],html:[["b","bdi","del","i","ins","u","font","big","small","sub","sup","h1","h2","h3","h4","h5","h6","cite","code","em","s","strike","strong","tt","var","div","center","blockquote","ol","ul","dl","table","caption","pre","ruby","rb","rp","rt","rtc","p","span","abbr","dfn","kbd","samp","data","time","mark","tr","td","th","q","bdo"],["li","dt","dd"],["br","wbr","hr","meta","link"]],namespaces:{0:"",6:"File",10:"Template",14:"Category",828:"Module"},nsid:{"":0,file:6,template:10,category:14,module:828},functionHook:["msgnw"],variable:["!","=","pageid","articlepath","server","servername","scriptpath","stylepath"],parserFunction:[{msgnw:"msgnw",pageid:"pageid",articlepath:"articlepath",server:"server",servername:"servername",scriptpath:"scriptpath",stylepath:"stylepath","#language":"language","#special":"special","#speciale":"speciale","#tag":"tag","#formatdate":"formatdate","#dateformat":"formatdate","#invoke":"invoke","#while":"while","#dowhile":"dowhile","#loop":"loop","#forargs":"forargs","#fornumargs":"fornumargs","#if":"if","#ifeq":"ifeq","#switch":"switch","#ifexist":"ifexist","#ifexpr":"ifexpr","#iferror":"iferror","#time":"time","#timel":"timel","#expr":"expr","#rel2abs":"rel2abs","#titleparts":"titleparts","#categorytree":"categorytree","#urldecode":"urldecode","#choose":"choose","#var":"var","#varexists":"varexists","#var_final":"var_final","#vardefine":"vardefine","#vardefineecho":"vardefineecho","#widget":"widget","#related":"related","#regex":"regex","#regex_var":"regex_var","#regexquote":"regexquote","#regexall":"regexall","#len":"len","#pos":"pos","#rpos":"rpos","#sub":"sub","#count":"count","#rmatch":"rmatch","#rreplace":"rreplace","#replace":"replace","#rsplit":"rsplit","#explode":"explode","#tab":"tab","#seo":"seo","#babel":"babel","#translation":"translation","#commaseparatedlist":"commaseparatedlist","#coordinates":"coordinates","#lst":"lst","#lsth":"lsth","#lstx":"lstx","#assessment":"assessment","#mentor":"mentor","#property":"property","#target":"target","#section":"lst","#section-x":"lstx","#section-h":"lsth","#statements":"statements","#useliquidthreads":"useliquidthreads","#lqtpagelimit":"lqtpagelimit","#avatar":"avatar","#img":"img","#chart":"chart"},{"!":"!","=":"=","#FORMAL":"formal","#bcp47":"bcp47","#dir":"dir","#interwikilink":"interwikilink","#interlanguagelink":"interlanguagelink","#contentmodel":"contentmodel","#timef":"timef","#timefl":"timefl"},["msg","raw"],["subst","safesubst"]],doubleUnderscore:[[],[]],protocol:"bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|matrix:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|wikipedia://|worldwind://|xmpp:",interwiki:[],img:{},redirection:["#redirect"],variants:[]}}}),$e,Va,Qa,Di,_n,Ue=L({"util/constants.ts"(){"use strict";$e=11,Va=sd(),Qa=new Set(["alt","link","lang","page","caption"]),Di=new Set(["tiff","tif","png","gif","jpg","jpeg","webp","xcf","pdf","svg","djvu"]),_n=nd()}});function ct(e){const t=new Map,i=new WeakMap;return n=>{const r=typeof n=="string"?t:i;if(r.has(n)){const l=r.get(n);return l.lastIndex=0,l}const s=e(n);return r.set(n,s),s}}var mi,Ja,jr,Xa,qi,$i,Rr,Ka,Ve=L({"../common/dist/index.mjs"(){"use strict";mi=e=>decodeURIComponent(e.replace(/%(?![\da-f]{2})/giu,"%25")),Ja=e=>Math.round(e*255).toString(16).padStart(2,"0"),jr=(()=>{const e=String.raw`#(?:[\da-f]{3,4}|(?:[\da-f]{2}){3,4})(?![\p{L}\p{N}_])`,t=String.raw`(?:\d*\.)?\d+%?`,i=String.raw`(?:\d*\.)?\d+(?:deg|grad|rad|turn)?`,n=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*\)`,r=String.raw`hsla?\(\s*(?:${String.raw`${i}\s+${t}\s+${t}(?:\s*\/\s*${t})?`}|${String.raw`${i}${String.raw`\s*,\s*(?:\d*\.)?\d+%`.repeat(2)}(?:\s*,\s*${t})?`})\s*\)`;return{full:new RegExp(String.raw`(^|[^\p{L}\p{N}_])(${e}|${n}|${r})`,"giu"),rgb:new RegExp(String.raw`(^|[^\p{L}\p{N}_])(${e}|${n})`,"giu")}})(),Xa=(e,t=!0)=>{const i=[],n=jr[t?"full":"rgb"];n.lastIndex=0;let r=n.exec(e),s=0;for(;r;){const l=r.index+r[1].length;l>s&&i.push([e.slice(s,l),s,l,!1]),{lastIndex:s}=n,i.push([r[2],l,s,e[l-1]!=="&"||!/^#\d+$/u.test(r[2])]),r=n.exec(e)}return e.length>s&&i.push([e.slice(s),s,e.length,!1]),i},qi=e=>{const t=[];let i=0;for(const n of e.split(`
|
|
2
|
+
`)){const r=i+n.length;t.push([n,i,r]),i=r+1}return t},$i=e=>e&&Number(e[1]),Rr=(e,t)=>{var r;let i;const n=s=>{i!=null||(i=qi(e));const l=i.findIndex(([,,a])=>s<=a)+1;return{line:l,column:s-i[l-1][1]+1}};for(const s of t){const{line:l,column:a,from:d,to:o}=s;d==null?l?(i!=null||(i=qi(e)),(r=s.column)!=null||(s.column=1),s.from=i[l-1][1]+(s.column-1)):(s.from=0,s.line=1,s.column=1):(!l||!a)&&Object.assign(s,n(d)),o!==void 0&&({line:s.endLine,column:s.endColumn}=n(o)),s.position=s.from}return t},Ka=(e,t)=>{if(t||e.trim())try{JSON.parse(e)}catch(i){const{message:n}=i,r=$i(/\bline (\d+)/u.exec(n)),s=$i(/\bcolumn (\d+)/u.exec(n)),l=$i(/\bposition (\d+)/u.exec(n));return Rr(e,[{message:n,line:r,column:s,from:l,severity:"error"}])}return[]}}}),fe,ye=L({"lib/rect.ts"(){"use strict";var e,t,i,n,Tn,s;fe=(s=class{constructor(l,a){j(this,n);j(this,e);j(this,t);j(this,i);E(this,e,l),E(this,t,a)}get start(){return b(this,t)}get top(){return R(this,n,Tn).call(this).top}get left(){return R(this,n,Tn).call(this).left}},e=new WeakMap,t=new WeakMap,i=new WeakMap,n=new WeakSet,Tn=function(){var l;return(l=b(this,i))!=null||E(this,i,b(this,e).getRootNode().posFromIndex(b(this,t))),b(this,i)},s)}}),Pr,Or,hi,xi,ls,Y,G,qe,Ji,ee,Kn,tt,Yn,Zn,er,vi,Pt,tr,ht,ir,Q=L({"util/lint.ts"(){"use strict";Ve(),Ie(),ye(),D(),Pr=new Set(["tr","td","th","caption"]),Or=new Set(["Template:!!","Template:!-"]),hi=e=>{const t=e.childNodes.find(i=>i.text().trim());if(!t||t.type==="text"&&t.data.trim().startsWith("!")||t.is("magic-word")&&t.name==="!"||t.is("template")&&Or.has(t.name)||t.is("html")&&Pr.has(t.name))return!1;if(t.is("arg"))return t.length>1&&hi(t.childNodes[1]);if(t.is("magic-word"))try{const i=t.getPossibleValues().map(hi);return i.includes(2)?2:i.includes(1)&&1}catch{}return t.is("template")||t.is("magic-word")&&t.name==="invoke"?1:2},xi=(e,t,i,n)=>({line:e+i-1,character:(i===1?t:0)+n}),ls=e=>(t,i,n,r,s="error")=>{const{start:l}=i,{top:a,left:d}=i instanceof fe?i:new fe(t,l),{offsetHeight:o,offsetWidth:u}=t,{startIndex:c,startLine:f,startCol:m}=e(t,l,a,d),{line:y,character:S}=xi(f,m,o,u);return{rule:n,message:F.msg(r),severity:s,startIndex:c,endIndex:c+t.toString().length,startLine:f,endLine:y,startCol:m,endCol:S}},Y=ls((e,t,i,n)=>{const r=e.getRelativeIndex(),{top:s,left:l}=e.parentNode.posFromIndex(r);return{startIndex:t+r,startLine:i+s,startCol:s?l:n+l}}),G=ls((e,t,i,n)=>({startIndex:t,startLine:i,startCol:n})),qe=(e,t,i,n=0)=>({desc:F.msg(t),range:[e.startIndex+n,e.endIndex],text:i}),Ji=(e,t,i)=>({desc:F.msg(t),range:[e,e],text:i}),ee=(e,t=0,i="")=>typeof e=="number"?{desc:F.msg("remove"),range:[e,e+t],text:i}:qe(e,"remove",i,t),Kn=(e,t)=>qe(e,"decode",mi(t.text().replace(/%(?=21|3[ce]|5[bd]|7[b-d])/giu,"%25"))),tt=(e,t,i=0)=>({desc:F.msg("close"),range:[e+i,e],text:t}),Yn=e=>({desc:F.msg("open"),range:[e+1,e+2],text:""}),Zn=(e,t)=>qe(e,"comment",`<!--${t}-->`),er=(e,t)=>qe(e,"uppercase",t.toUpperCase()),vi=(e,t=0)=>({desc:F.msg("whitespace"),range:[e,e+t],text:" "}),Pt=(e,t,i=1)=>({desc:F.msg("escape"),range:[e,e+i],text:t.repeat(i)}),tr=(e,t)=>({desc:F.msg("escape"),range:[e,e+t.length],text:t.replace(/\|/gu,"|")}),ht=(e,t,i,n)=>{if(e&&(n||F.viewOnly&&e[0]===pe.rev))return e[1];const r=t();return(n||F.viewOnly)&&i([pe.rev,r]),r},ir=(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"]:[]}}),Br,sr,Ya=L({"util/selector.ts"(){"use strict";Br=e=>{if(e.includes("#")){const t=e.indexOf("#"),i=e.slice(0,t),n=e.slice(t+1);return(r,s)=>(t===0||r===i)&&s===n}return t=>t===e},sr=(e,t,i)=>{if(e=e.trim(),!e)return(()=>!0);const n=e.split(",").map(r=>r.trim()).filter(r=>r!=="").map(Br);return(({type:r,name:s})=>n.some(l=>l(r,s)))}}}),rd=Vn({"../node_modules/binary-search/index.js"(e,t){t.exports=function(i,n,r,s,l){var a,d;if(s===void 0)s=0;else if(s=s|0,s<0||s>=i.length)throw new RangeError("invalid lower bound");if(l===void 0)l=i.length-1;else if(l=l|0,l<s||l>=i.length)throw new RangeError("invalid upper bound");for(;s<=l;)if(a=s+(l-s>>>1),d=+r(i[a],n,a,i),d<0)s=a+1;else if(d>0)l=a-1;else return a;return~s}}}),qr,Za,ld=L({"util/search.ts"(){"use strict";qr=Yu(rd()),Za=(e,t,i)=>{const n=(0,qr.default)(e,t,i);return n<0?~n:n}}}),Xi,nr=L({"mixin/cached.ts"(){"use strict";Q(),Xi=(e=!0)=>t=>{const i=new WeakMap;return function(...n){return ht(i.get(this),()=>t.apply(this,n),r=>{i.set(this,r)},e)}}}}),eo,ad=L({"mixin/nodeLike.ts"(){"use strict";eo=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}}}),Wr,Mr,_i,Wt,Mt,Ti,Ut,zt,Ht,lt,to=L({"lib/node.ts"(){"use strict";Ve(),ld(),Q(),Ie(),nr(),ad(),D(),Mr=[eo],Wr=[Xi(!1)],lt=class{constructor(){ne(Ht,5,this),ed(this,"childNodes",[]),Ye(this,_i),Ye(this,Wt),Ye(this,Mt),Ye(this,Ti),Ye(this,Ut),Ye(this,zt,{})}get parentNode(){return xe(this,_i)}get nextSibling(){return xe(this,Wt)}get previousSibling(){return xe(this,Mt)}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":Ne(this,_i,t),t||(Ne(this,Wt,void 0),Ne(this,Mt,void 0));break;case"nextSibling":Ne(this,Wt,t);break;case"previousSibling":Ne(this,Mt,t);break;case"aIndex":F.viewOnly&&Ne(this,Ut,[pe.rev,t]);break;default:this[e]=t}}getRootNode(){return ht(xe(this,Ti),()=>{var e,t;return(t=(e=this.parentNode)==null?void 0:e.getRootNode())!=null?t:this},e=>{const[,t]=e;t.type==="root"&&Ne(this,Ti,e)})}indexFromPos(e,t){{if(e<0||t<0)return;const i=this.getLines();if(e>=i.length)return;const[,n,r]=i[e],s=n+t;return s>r?void 0:s}}posFromIndex(e){{const{length:t}=String(this);if(e+=e<0?t:0,e>=0&&e<=t){const i=this.getLines(),n=Za(i,e,([,,r],s)=>r-s);return{top:n,left:e-i[n][1]}}return}}getDimension(){{const e=this.getLines(),t=e[e.length-1];return{height:e.length,width:t[2]-t[1]}}}getGaps(e){return 0}getRelativeIndex(e){if(e===void 0){const{parentNode:t}=this;return t?t.getRelativeIndex(t.childNodes.indexOf(this)):0}return ht(xe(this,zt)[e],()=>{const{childNodes:t}=this,i=e+(e<0?t.length:0);let n=this.getAttribute("padding");for(let r=0;r<i;r++)F.viewOnly&&(xe(this,zt)[r]=[pe.rev,n]),n+=t[r].toString().length+this.getGaps(r);return n},t=>{xe(this,zt)[e]=t})}getAbsoluteIndex(){return ht(xe(this,Ut),()=>{const{parentNode:e}=this;return e?e.getAbsoluteIndex()+this.getRelativeIndex():0},e=>{Ne(this,Ut,e)})}getBoundingClientRect(){return{...this.getDimension(),...this.getRootNode().posFromIndex(this.getAbsoluteIndex())}}is(e){return this.type===e}getLines(){return qi(String(this))}seal(e,t){{if(F.internal)return;const i=!t&&!!this[e];i||Object.defineProperty(this,e,{enumerable:i,configurable:!0})}}lspError(e){throw new Error(`${e} method is only available in the LSP version!`)}},Ht=le(null),_i=new WeakMap,Wt=new WeakMap,Mt=new WeakMap,Ti=new WeakMap,Ut=new WeakMap,zt=new WeakMap,re(Ht,1,"getLines",Wr,lt),lt=re(Ht,0,"AstNode",Mr,lt),ne(Ht,1,lt)}}),io,od=L({"mixin/elementLike.ts"(){"use strict";Ya(),io=e=>{var t,Cn;{class n extends e{constructor(){super(...arguments);j(this,t)}getElementBy(l){const a=[...this.childNodes].reverse();for(;a.length>0;){const d=a.pop(),{type:o,childNodes:u}=d;if(o!=="text"){if(l(d))return d;for(let c=u.length-1;c>=0;c--)a.push(u[c])}}}querySelector(l){return this.getElementBy(R(this,t,Cn).call(this,l))}getElementsBy(l){const a=[...this.childNodes].reverse(),d=[];for(;a.length>0;){const o=a.pop(),{type:u,childNodes:c}=o;if(u!=="text"){l(o)&&d.push(o);for(let f=c.length-1;f>=0;f--)a.push(c[f])}}return d}querySelectorAll(l){return this.getElementsBy(R(this,t,Cn).call(this,l))}escape(){for(const l of this.childNodes)l.escape()}}return t=new WeakSet,Cn=function(l){return sr(l,this)},n}}}}),Ur,as,zr,Kt,ud=L({"lib/element.ts"(){"use strict";ve(),Ie(),Ya(),to(),od(),Ur=[io],Kt=class extends(zr=lt){get length(){return this.childNodes.length}text(e){return pt(this.childNodes,e)}removeAt(e){return yi(this,e,1)[0]}insertAt(e,t=this.length){return yi(this,t,0,[e]),e}closest(e){const t=sr(e,this);let{parentNode:i}=this;for(;i;){if(t(i))return i;({parentNode:i}=i)}}isInside(e){var t;return((t=this.closest(`${e},ext`))==null?void 0:t.type)===e}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 i=this.childNodes[t],{data:n}=i;return i.replaceData(e),n}toString(e,t=""){return this.childNodes.map(i=>i.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 i=this,n=0,r=0;for(;i.type!=="text";){const{childNodes:s}=i;n+=i.getAttribute("padding");for(let l=0;n<=e&&l<s.length;l++){const a=s[l],{nextSibling:d}=a,o=a.toString(),u=o.length;if(a.setAttribute("aIndex",n),n+=u,n>e||n===e&&u>0&&(!d||d.type==="text"||a.type!=="text"&&(o.trim()||!d.toString().trim()))){i=a,n-=u,r=n;break}n+=i.getGaps(l)}if(i.childNodes===s)return{offsetNode:i,offset:e-r}}return{offsetNode:i,offset:e-r}}this.lspError("AstElement.caretPositionFromIndex")}elementFromIndex(e){var t;{const i=(t=this.caretPositionFromIndex(e))==null?void 0:t.offsetNode;return(i==null?void 0:i.type)==="text"?i.parentNode:i}this.lspError("AstElement.elementFromIndex")}elementFromPoint(e,t){return this.elementFromIndex(this.indexFromPos(t,e))}lint(e=this.getAbsoluteIndex(),t){{const i=[];for(let n=0,r=e+this.getAttribute("padding");n<this.length;n++){const s=this.childNodes[n];s.setAttribute("aIndex",r);const l=s.lint(r,t);l.length>0&&Array.prototype.push.apply(i,l),r+=s.toString().length+this.getGaps(n)}return i}}print(e={}){{const t=e.class;return this.toString()?(t===""?"":`<span class="wpb-${t!=null?t:this.type}${this.getAttribute("invalid")?" wpb-invalid":""}">`)+Rt(this.childNodes,e)+(t===""?"":"</span>"):""}}json(e,t=this.getAbsoluteIndex()){{const i={...this,type:this.type,range:[t,t+this.toString().length],childNodes:[]};for(let n=0,r=t+this.getAttribute("padding");n<this.length;n++){const s=this.childNodes[n],{length:l}=s.toString();s.setAttribute("aIndex",r),i.childNodes.push(s.type==="text"?{data:s.data,range:[r,r+l]}:s.json(void 0,r)),r+=l+this.getGaps(n)}return i}}},as=le(zr),Kt=re(as,0,"AstElement",Ur,Kt),ne(as,1,Kt)}}),wi,Ki=L({"mixin/gapped.ts"(){"use strict";wi=(e=1)=>t=>{class i extends t{getGaps(){return e}}return i}}}),Ce,Le=L({"mixin/noEscape.ts"(){"use strict";Ce=e=>{{class t extends e{escape(){}}return t}}}}),Hr,so,dd=L({"src/parameter.ts"(){"use strict";ve(),Q(),D(),V(),Hr=new RegExp(`https?://${Ft}${Et}$`,"iu"),so=class extends U{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,i,n=[]){super(void 0,i,n);const r=new U(typeof e=="number"?void 0:e,i,n,{}),s=new U(t,i,n);r.type="parameter-key",r.setAttribute("stage",2),s.type="parameter-value",s.setAttribute("stage",2),this.append(r,s)}trimName(e,t=!0){const i=(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",i),i}afterBuild(){if(!this.anon){const{parentNode:e,firstChild:t}=this,i=this.trimName(t);e&&e.getArgs(i,!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 i;{const n=super.lint(e,t),r="unescaped",{lintConfig:s}=F,l=s.getSeverity(r);if(l){const{firstChild:a}=this,d=(i=Hr.exec(a.text()))==null?void 0:i[0];try{if(d&&new URL(d).search){const o=Y(a,{start:e},r,"unescaped-query",l);o.startIndex=o.endIndex,o.startLine=o.endLine,o.startCol=o.endCol,o.endIndex++,o.endCol++,(s.computeEditInfo||s.fix)&&(o.fix=Pt(o.startIndex,"{{=}}")),n.push(o)}}catch{}}return n}}print(){return super.print({sep:this.anon?"":"="})}json(e,t=this.getAbsoluteIndex()){{const i=super.json(void 0,t);return Object.assign(i,{anon:this.anon},this.duplicated&&{duplicated:!0}),i}}}}}),Me,ft=L({"src/atom.ts"(){"use strict";var e,t;V(),Me=(t=class extends U{constructor(n,r,s,l,a){super(n,s,l,a);j(this,e);E(this,e,r)}get type(){return b(this,e)}set type(n){E(this,e,n)}getAttribute(n){var r;return n==="invalid"?this.type==="converter-flag"&&!!((r=this.parentNode)!=null&&r.isInvalidFlag(this)):super.getAttribute(n)}},e=new WeakMap,t)}}),Ge,mt=L({"src/syntax.ts"(){"use strict";var e,t;V(),Ge=(t=class extends U{constructor(n,r,s,l,a){super(n,s,l,a);j(this,e);E(this,e,r)}get type(){return b(this,e)}lint(n=this.getAbsoluteIndex()){return super.lint(n,!1)}},e=new WeakMap,t)}}),no={};oe(no,{TranscludeToken:()=>at});var Dr,os,Gr,at,ro=L({"src/transclude.ts"(){"use strict";var e,t,i,n,r,s,Yt,lo,d;ve(),Q(),Ie(),ye(),Ki(),Le(),D(),V(),dd(),ft(),mt(),Dr=[Ce,wi()],at=(d=class extends(Gr=U){constructor(u,c,f,m=[]){var w,A;let y;const S=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(u);S&&(y=Number(S[1]),u=u.replace(`\0${y}h`,m[y].toString().replace(/^\n/u,"")));super(void 0,f,m,{});j(this,s);je(this,"modifier","");j(this,e,"template");j(this,t,":");j(this,i,!1);j(this,n,new Map);j(this,r);const{parserFunction:$,variable:_,functionHook:T}=f,g=(w=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(u))==null?void 0:w[0];if(g)this.setAttribute("modifier",g),u=u.slice(g.length);else if(u.includes(":")){const[C,...N]=u.split(":"),[B]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((A=N[0])!=null?A:"");this.setModifier(`${C}:${B}`)&&(u=N.join(":").slice(B.length))}const h=u.search(/[::]/u),x=u[h]===":",p=h!==-1;if(p||c.length===0&&!b(this,i)){const C=p?u.slice(0,h):u,N=p&&u.slice(h+1),B=Te(C),q=p?B.slice(B.search(/\S/u))+(x?":":""):B.trim(),[,O,P]=qu(q,$),I=!("functionHook"in f)||T.includes(P),W=_.includes(P);if(p?P&&I:W){this.setAttribute("name",P),E(this,e,"magic-word"),x&&E(this,t,":");const J=new Ge(C,"magic-word-name",f,m);if(super.insertAt(J),N!==!1&&c.unshift([N]),this.name==="invoke")for(let X=0;X<2;X++){const z=c.shift();if(!z)break;const H=new Me(z.join("="),`invoke-${X?"function":"module"}`,f,m);super.insertAt(H)}}}if(this.type==="template"){const C=Te(u).trim();if(!this.normalizeTitle(C,10,{halfParsed:!0,temporary:!0}).valid)throw m.pop(),new SyntaxError("Invalid template name");const N=new Me(u,"template-name",f,m,{});super.insertAt(N)}typeof y=="number"&&(m[y]=void 0);const k=this.isTemplate();let v=1;for(let C=0;C<c.length;C++){const N=c[C];k||this.name==="switch"&&C>0||this.name==="tag"&&C>1||(N[0]=N.join("="),N.length=1),N.length===1&&(N.unshift(v),v++),this.insertAt(new so(...N,f,m))}this.seal("modifier")}get type(){return b(this,e)}get module(){return this.type==="magic-word"&&this.name==="invoke"?R(this,s,Yt).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,f]}=this.getAttribute("config"),m=Te(u).trim();if(u&&!m.endsWith(":"))return!1;const y=m.slice(0,-1).toLowerCase(),S=c.includes(y),$=f.includes(y);return(b(this,i)?S:$||!u)||(pe.running||this.length>1)&&(S||$||!u)?(this.setAttribute("modifier",u),E(this,i,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,r,R(this,s,Yt).call(this)),this.setAttribute("name",b(this,r).title))}toString(u){const{childNodes:c,length:f,firstChild:m,modifier:y,type:S}=this;return`{{${y}${S==="magic-word"?m.toString(u)+(f===1?"":b(this,t))+c.slice(1).map($=>$.toString(u)).join("|"):super.toString(u,"|")}}}`}text(){const{childNodes:u,length:c,firstChild:f,modifier:m,type:y,name:S}=this;return y==="magic-word"&&S==="vardefine"?"":`{{${m}${y==="magic-word"?f.text()+(c===1?"":b(this,t))+pt(u.slice(1),"|"):super.text("|")}}}`}getAttribute(u){switch(u){case"padding":return this.modifier.length+2;case"title":return b(this,r);case"colon":return b(this,t);case"invalid":return this.type==="magic-word"&&this.name==="invoke"&&(this.length===2||!R(this,s,Yt).call(this).valid);default:return super.getAttribute(u)}}lint(u=this.getAbsoluteIndex(),c){{const f=super.lint(u,c);if(!this.isTemplate())return f;const{type:m,childNodes:y,length:S}=this,$=new fe(this,u),{lintConfig:_}=F,{computeEditInfo:T}=_,g=m==="magic-word";let h="no-ignored",x=_.getSeverity(h,"fragment");if(g&&!R(this,s,Yt).call(this).valid)h="invalid-invoke",x=_.getSeverity(h,"name"),x&&f.push(Y(y[1],$,h,"illegal-module",x));else if(x){const p=y[g?1:0],k=p.childNodes.findIndex(w=>w.type==="text"&&pi(w.data).includes("#")),v=p.childNodes[k];if(v){const w=Y(p,$,h,"useless-fragment",x);T&&(w.suggestions=[ee(w,p.getRelativeIndex(k)+v.data.indexOf("#"))]),f.push(w)}}if(h="invalid-invoke",x=_.getSeverity(h,"function"),x&&g&&S===2)return f.push(G(this,$,h,"missing-function",x)),f;if(h="no-duplicate",x=_.getSeverity(h,"parameter"),x){const p=this.getDuplicatedArgs().filter(([,v])=>!v[0].querySelector("ext")),k="duplicate-parameter";for(const[,v]of p)Array.prototype.push.apply(f,v.map(w=>{const A=Y(w,$,h,k,x);return T&&(A.suggestions=[ee(A,-1)]),A}))}return f}}insertAt(u,c=this.length){return super.insertAt(u,c),u.anon?R(this,s,lo).call(this,u):u.name&&this.getArgs(u.name,!1,!1).add(u),u}getAllArgs(){return this.childNodes.filter(ss("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:u})=>u)}getArgs(u,c,f=!0){const m=String(u).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");let y;return b(this,n).has(m)?y=b(this,n).get(m):(y=new Set(this.getAllArgs().filter(({name:S})=>m===S)),b(this,n).set(m,y)),y}getDuplicatedArgs(){return[...b(this,n)].filter(([,{size:u}])=>u>1).map(([u,c])=>[u,[...c]])}getPossibleValues(){const{type:u,name:c,childNodes:f}=this;if(u==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let m,y;switch(c){case"if":case"ifexist":case"ifexpr":case"iferror":m=2;break;case"ifeq":m=3;break;case"switch":{const S=f.slice(2),$=S[S.length-1];y=[...S.filter(({anon:_})=>!_),...$!=null&&$.anon?[$]:[]].map(({lastChild:_})=>_);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}y!=null||(y=f.slice(m,m+2).map(({lastChild:S})=>S));for(let S=0;S<y.length;){const{length:$,0:_}=y[S].childNodes.filter(T=>T.text().trim());if($===0)y.splice(S,1);else if($>1||!_.is("magic-word"))S++;else try{const T=_.getPossibleValues();Array.prototype.splice.apply(y,[S,1,...T]),S+=T.length}catch{S++}}return y}print(){{const{childNodes:u,length:c,firstChild:f,modifier:m,type:y}=this;return`<span class="wpb-${y}${this.getAttribute("invalid")?" wpb-invalid":""}">{{${y==="magic-word"?fi(m)+f.print()+(c===1?"":b(this,t))+Rt(u.slice(1),{sep:"|"}):(m?`<span class="wpb-magic-word">${fi(m)}</span>`:"")+Rt(u,{sep:"|"})}}}</span>`}}},e=new WeakMap,t=new WeakMap,i=new WeakMap,n=new WeakMap,r=new WeakMap,s=new WeakSet,Yt=function(){const u=this.type==="template";return this.normalizeTitle((u?"":"Module:")+Te(this.childNodes[u?0:1].text()),10,{temporary:!0,...!u&&{page:""}})},lo=function(u){const c=this.getAnonArgs(),f=typeof u!="number";for(let m=f?c.indexOf(u):u-1;m<c.length;m++){const y=c[m],{name:S}=y,$=String(m+1);(S!==$||y===u)&&(y.setAttribute("name",$),this.getArgs($,!1,!1).add(y))}},d),os=le(Gr),at=re(os,0,"TranscludeToken",Dr,at),ne(os,1,at)}}),Ci,us,Vr,Qr,Jr,Xr,ds,Kr,In,cd=L({"lib/text.ts"(){"use strict";var e,Nn,i;ve(),Q(),Ie(),D(),to(),Ci=String.raw`[${et}\t]*`,us=String.raw`<(?:/[^\S\n]*)?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|\n={2,}`,Vr=new RegExp(String.raw`${us}|https?[:/]/+|(?:rfc|pmid)(?=[-::]?${Ci}\d)|isbn(?=[-::]?${Ci}(?:\d(?:${Ci}|-)){6})`,"giu"),Qr=new RegExp(us,"giu"),Jr=new Set(["attr-value","ext-link-text","link-text"]),Xr={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},ds=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"]),Kr=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch{return/\w/u}})(),In=(i=class extends lt{constructor(s){super();j(this,e);je(this,"data","");this.data=s}get type(){return"text"}toString(s){var l;return s&&!((l=this.parentNode)!=null&&l.getAttribute("built"))?Te(this.data):this.data}text(){return this.data}lint(s=this.getAbsoluteIndex(),l){var a,d,o;{if(l===!1)return[];const{data:u,parentNode:c,nextSibling:f,previousSibling:m}=this;if(!c)throw new Error("An isolated text node cannot be linted!");const{type:y,parentNode:S}=c;if(y==="attr-value"){const{name:O,tag:P}=S;if(P==="ref"&&(O==="name"||O==="follow")||O==="group"&&(P==="ref"||P==="references")||P==="choose"&&(O==="before"||O==="after"))return[]}if(l!=null||(l=c.isPlain()&&!Jr.has(y)?Vr:Qr),u.search(l)===-1)return[];l.lastIndex=0;const $=[],_=f==null?void 0:f.type,T=f==null?void 0:f.name,g=m==null?void 0:m.type,h=this.getRootNode(),x=h.toString(),{ext:p,html:k,variants:v}=h.getAttribute("config"),{top:w,left:A}=h.posFromIndex(s),{lintConfig:C}=F,N=C.rules["tag-like"],B=typeof N=="object"&&N[1]?new Set(Object.keys(N[1]).filter(O=>O!=="invalid"&&O!=="disallowed")):new Set,q=new Set(["onlyinclude","noinclude","includeonly",...p,...k[0],...k[1],...k[2],...B,...C.getSeverity("tag-like","disallowed")?ds:[]]);for(let O=l.exec(u);O;O=l.exec(u)){let{index:P,0:I}=O;const[,W,J]=O,X=I==="["&&y==="ext-link-text";if(I.startsWith("<")&&!q.has(W.toLowerCase())||X&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(u.slice(P+1))||f!=null&&f.is("ext")&&T==="nowiki"&&((a=f.innerText)!=null&&a.includes("]"))))continue;if(J&&J!=="]"){const{length:me}=J;P+=me,I=I.slice(me)}else I.startsWith(`
|
|
3
|
+
==`)&&(P++,I=I.slice(1));I=I.toLowerCase();const[z]=I,H=I==="rfc"||I==="pmid"||I==="isbn",Z=z==="{",ie=z==="}",ue=z==="[",be=z==="]";let{length:de}=I;be&&(P||de>1)&&l.lastIndex--;let ae=s+P,Se=ae+de,ce,M,K,ke;const he=x[Se],Fe=x[ae-1],Je=Z||ue,Ae=I==="{"&&Fe==="-"&&v.length>0,te=I==="}"&&he==="-"&&v.length>0,st=ue&&_==="free-ext-link"&&!u.slice(P+1).trim()||be&&g==="free-ext-link"&&!u.slice(0,P).includes("]");if(H)ce="lonely-http",I=I.toUpperCase(),M=C.getSeverity(ce,I);else if(z==="<"){ce="tag-like";let me;/^<\/?\s/u.test(I)||!/[\s/>]/u.test(he!=null?he:"")?me="invalid":B.has(W)?me=W:ds.has(W)&&!p.includes(W)&&(me="disallowed"),M=C.getSeverity(ce,me)}else if(z==="=")ce="syntax-like",M=C.getSeverity(ce,"heading");else if(Ae||te)ce="lonely-bracket",M=C.getSeverity(ce,"converter"),Ae&&P>0?(I="-{",P--,ae--,de=2):te&&P<u.length-1&&(I="}-",Se++,de=2);else if(st)ce="lonely-bracket",M=C.getSeverity(ce,"extLink");else if(Je||ie||be)if(ce="lonely-bracket",de>1||Z&&he===z||ie&&Fe===z)M=C.getSeverity(ce,"double");else{if(!X){const me=Xr[z],Ee=Je?u.slice(P+1):u.slice(0,P);if(Z&&((d=me.exec(Ee))==null?void 0:d[0])==="}"||ie&&((o=me.exec(Ee))==null?void 0:o[0])==="{")continue;if(!Ee.includes(z)){const He=Je?"nextSibling":"previousSibling";let Be=this[He];for(;Be&&(Be.type!=="text"||!me.test(Be.data));)Be=Be[He];if(Be&&me.exec(Be.data)[0]!==z)continue}}M=C.getSeverity(ce,"single")}else ce="lonely-http",M=C.getSeverity(ce);if(!M)continue;const qt=this.posFromIndex(P),{line:$r,character:_r}=xi(w,A,qt.top+1,qt.left);if(z==="="){const me=u.indexOf(`
|
|
4
4
|
`,P);let Ee=f,He;if(me===-1){let Be=0;for(;Ee&&!(Ee.type==="text"&&(Be=Ee.data.indexOf(`
|
|
5
|
-
`),Be!==-1));)Ee=Ee.nextSibling;if(!Ee)continue;He=Ee.data.slice(0,Be)}else He=o.slice(P+de,me);if(!/(?:^|[^=])=+\s*(?:\S\s*)?$/u.test(He))continue;me===-1?(Se=Ee.getAbsoluteIndex()+He.length,{top:K,left:ke}=h.posFromIndex(Se)):(Se+=He.length,de+=He.length)}const nt={rule:ce,message:F.msg(z==="="?"header-like":"lonely",H||z==="h"||Ae||te?I:z),severity:M,startIndex:ae,endIndex:Se,startLine:$r,endLine:K!=null?K:$r,startCol:_r,endCol:ke!=null?ke:_r+de};if(C.computeEditInfo)if(z==="<")nt.suggestions=[Pt(ae,"<")];else if(z==="h"&&y!=="link-text"&&Kr.test(Fe||""))nt.suggestions=[vi(ae)];else if(X){const me=c.getAbsoluteIndex()+c.toString().length;nt.suggestions=[Pt(me,"]")]}else if(I==="]"&&st){const me=s-m.toString().length;nt.suggestions=[Ji(me,"left-bracket","[")]}else H&&(nt.suggestions=[...O[0]===I?[]:[er(nt,I)],...he===":"||he===":"?[vi(Se,1)]:[]]);$.push(nt)}return $}}replaceData(s){R(this,e,Nn).call(this,s)}splitText(s){{const{parentNode:l,data:a}=this;if(!l)throw new Error("The text node to be split has no parent node!");const d=new i(a.slice(s));return yi(l,l.childNodes.indexOf(this)+1,0,[d]),this.setAttribute("data",a.slice(0,s)),d}this.lspError("AstText.splitText")}escape(){{const{parentNode:s}=this;if(!s)throw new Error("The text node to be escaped has no parent node!");const{TranscludeToken:l}=(ro(),se(no)),a=s.getAttribute("config"),d=s.childNodes.indexOf(this)+1,u=f=>Math.max(this.data.lastIndexOf("=",f),this.data.lastIndexOf("|",f));let o=u();const c=(()=>new l(this.data[o]==="="?"=":"!",[],a));for(;o>=0;o=u(o-1))o<this.data.length-1&&this.splitText(o+1),s.insertAt(pe.run(c),d),R(this,e,Nn).call(this,this.data.slice(0,o))}}print(){return fi(this.data)}},e=new WeakSet,Nn=function(s){this.setAttribute("data",s)},i)}}),it,xt=L({"mixin/hidden.ts"(){"use strict";it=(e=!0,t=!0)=>i=>{class n extends i{text(){return""}lint(s){return e?[]:super.lint(s)}}return n}}}),ze,Qe=L({"mixin/padded.ts"(){"use strict";ze=({length:e})=>t=>{class i extends t{getAttribute(r){return r==="padding"?e:super.getAttribute(r)}}return i}}}),Yr,cs,Zr,De,Si=L({"src/link/base.ts"(){"use strict";var e,t,i,n,ao,s;Q(),Ue(),Ie(),ye(),Qe(),Le(),D(),V(),ft(),Yr=[Ce,ze("[[")],De=(s=class extends(Zr=U){constructor(a,d,u,o=[],c="|"){super(void 0,u,o,{});j(this,n);j(this,e,!0);j(this,t);j(this,i);if(this.insertAt(new Me(a,"link-target",u,o,{})),d!==void 0){const f=new U(d,u,o,{});f.type="link-text",f.setAttribute("stage",$e-1),this.insertAt(f)}E(this,t,c)}get link(){return b(this,i)}get fragment(){return b(this,i).fragment}afterBuild(){E(this,i,this.getTitle()),b(this,t).includes("\0")&&E(this,t,this.buildFromStr(b(this,t),0)),R(this,n,ao).call(this),super.afterBuild()}setAttribute(a,d){a==="bracket"?E(this,e,d):a==="title"?E(this,i,d):super.setAttribute(a,d)}toString(a){const d=super.toString(a,b(this,t));return b(this,e)?`[[${d}]]`:d}text(){const a=super.text("|");return b(this,e)?`[[${a}]]`:a}getAttribute(a){return a==="title"?b(this,i):super.getAttribute(a)}getGaps(a){return a===0?b(this,t).length:1}lint(a=this.getAbsoluteIndex(),d){{const u=super.lint(a,d),{childNodes:[o,c],type:f}=this,{encoded:m,fragment:y}=b(this,i),{lintConfig:S}=F,{computeEditInfo:$,fix:_}=S,T=new fe(this,a);let g="unknown-page",h=S.getSeverity(g);if(h&&o.childNodes.some(({type:x})=>x==="template")&&u.push(Y(o,T,g,"template-in-link",h)),g="url-encoding",h=S.getSeverity(g),h&&m){const x=Y(o,T,g,"unnecessary-encoding",h);($||_)&&(x.fix=Kn(x,o)),u.push(x)}if(g="pipe-like",h=S.getSeverity(g,"link"),h&&(f==="link"||f==="category")){const x=c==null?void 0:c.childNodes.findIndex(k=>k.type==="text"&&k.data.includes("|")),p=c==null?void 0:c.childNodes[x];if(p){const k=Y(c,T,g,"pipe-in-link",h);if($){const v=k.startIndex+c.getRelativeIndex(x);k.suggestions=[tr(v,p.data)]}u.push(k)}}if(g="no-ignored",h=S.getSeverity(g,"fragment"),h&&y!==void 0&&!Bu(f)){const x=Y(o,T,g,"useless-fragment",h);if($||_){const p=o.childNodes.findIndex(v=>v.type==="text"&&v.data.includes("#")),k=o.childNodes[p];k&&(x.fix=ee(x,o.getRelativeIndex(p)+k.data.indexOf("#")))}u.push(x)}return u}}getTitle(a,d){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:d,temporary:a,decode:!0,selfLink:!0})}print(){return super.print(b(this,e)?{pre:"[[",post:"]]",sep:b(this,t)}:{sep:b(this,t)})}json(a,d=this.getAbsoluteIndex()){{const u=super.json(void 0,d),{type:o,fragment:c}=this;return c!==void 0&&(o==="link"||o==="redirect-target")&&(u.fragment=c),u}}},e=new WeakMap,t=new WeakMap,i=new WeakMap,n=new WeakSet,ao=function(){this.type!=="ext-inner"&&this.setAttribute("name",b(this,i).title)},s),cs=le(Zr),De=re(cs,0,"LinkBaseToken",Yr,De),ne(cs,1,De)}}),el,hs,tl,We,vt=L({"src/nowiki/base.ts"(){"use strict";Le(),V(),el=[Ce],We=class extends(tl=U){get innerText(){return this.firstChild.data}constructor(e="",t,i){super(e,t,i)}},hs=le(tl),We=re(hs,0,"NowikiBaseToken",el,We),ne(hs,1,We)}}),il,gs,sl,Oe,Bt=L({"src/nowiki/noinclude.ts"(){"use strict";Q(),xt(),D(),vt(),il=[it(!1)],Oe=class extends(sl=We){get type(){return"noinclude"}toString(e){return e?"":super.toString()}lint(e=this.getAbsoluteIndex()){{const{lintConfig:t}=F,i="no-ignored",n=t.getSeverity(i,"include");if(n){const{innerText:r}=this,s=/^<(noinclude|includeonly|onlyinclude)\s+(?:[^\s>/]|\/(?!>))[^>]*>$/iu.exec(r);if(s){const l=G(this,{start:e},i,"useless-attribute",n),{computeEditInfo:a}=t,d=s[1].length+1,u=r.endsWith("/>")?2:1;return l.startIndex+=d,l.startCol+=d,l.endIndex-=u,l.endCol-=u,a&&(l.suggestions=[ee(l)]),[l]}}return[]}}},gs=le(sl),Oe=re(gs,0,"NoincludeToken",il,Oe),ne(gs,1,Oe)}}),oo,hd=L({"src/link/redirectTarget.ts"(){"use strict";Q(),D(),Si(),Bt(),oo=class extends De{get type(){return"redirect-target"}constructor(e,t,i,n){super(e,void 0,i,n),t!==void 0&&this.insertAt(new Oe(t,i,n))}getTitle(){return this.normalizeTitle(this.firstChild.toString(),0,{halfParsed:!0,decode:!0,page:""})}lint(e=this.getAbsoluteIndex()){{const t=super.lint(e,!1),i="no-ignored",{lintConfig:n}=F,r=n.getSeverity(i,"redirect");if(r&&this.length===2){const s=Y(this.lastChild,{start:e},i,"useless-link-text",r);s.startIndex--,s.startCol--,(n.computeEditInfo||n.fix)&&(s.fix=ee(s)),t.push(s)}return t}}}}}),nl,ps,rl,Zt,gd=L({"src/redirect.ts"(){"use strict";var e,t,i;xt(),Le(),V(),mt(),hd(),nl=[it(!1,!1),Ce],Zt=(i=class extends(rl=U){constructor(r,s,l,a,d,u,o=[]){super(void 0,u,o);j(this,e);j(this,t);E(this,e,r),E(this,t,d),this.append(new Ge(s,"redirect-syntax",u,o),new oo(l,a==null?void 0:a.slice(1),u,o))}get type(){return"redirect"}getAttribute(r){return r==="padding"?b(this,e).length:super.getAttribute(r)}toString(r){return b(this,e)+super.toString(r)+b(this,t)}lint(r=this.getAbsoluteIndex()){{const s=r+b(this,e).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",s),this.lastChild.lint(s)}}print(){return super.print({pre:b(this,e),post:b(this,t)})}},e=new WeakMap,t=new WeakMap,i),ps=le(rl),Zt=re(ps,0,"RedirectToken",nl,Zt),ne(ps,1,Zt)}}),uo={};oe(uo,{parseRedirect:()=>co});var co,pd=L({"parser/redirect.ts"(){"use strict";D(),gd(),co=(e,t,i)=>{var r;(r=t.regexRedirect)!=null||(t.regexRedirect=new RegExp(String.raw`^(\s*)((?:${t.redirection.join("|")})\s*(?::\s*)?)\[\[([^\n|\]]+)(\|.*?)?\]\](\s*)`,"iu"));const n=t.regexRedirect.exec(e);return n&&F.normalizeTitle(n[3],0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,page:""}).valid?(e=`\0${i.length}o${e.slice(n[0].length)}`,new Zt(...n.slice(1),t,i),e):!1}}}),ll,fs,al,ei,fd=L({"src/onlyinclude.ts"(){"use strict";Qe(),Le(),V(),ll=[Ce,ze("<onlyinclude>")],ei=class extends(al=U){get type(){return"onlyinclude"}toString(e){return`<onlyinclude>${super.toString(e)}</onlyinclude>`}isPlain(){return!0}print(){return super.print({pre:'<span class="wpb-ext"><onlyinclude></span>',post:'<span class="wpb-ext"></onlyinclude></span>'})}},fs=le(al),ei=re(fs,0,"OnlyincludeToken",ll,ei),ne(fs,1,ei)}}),ol,ms,ul,ot,rr=L({"src/tagPair/index.ts"(){"use strict";var e,t,i;Ki(),Le(),V(),ol=[wi(),Ce],ot=(i=class extends(ul=U){constructor(r,s,l,a,d,u=[]){super(void 0,d);j(this,e);j(this,t);je(this,"closed");this.setAttribute("name",r.toLowerCase()),E(this,e,[r,a||r]),this.closed=a!=="",E(this,t,a===void 0),this.append(s,l);const o=typeof s=="string"?-1:u.indexOf(s);u.splice(o===-1?1/0:o,0,this)}get innerText(){return b(this,t)?void 0:this.lastChild.text()}get selfClosing(){return b(this,t)}toString(r){const{firstChild:s,lastChild:l}=this,[a,d]=b(this,e);return b(this,t)?`<${a}${s.toString(r)}/>`:`<${a}${s.toString(r)}>${l.toString(r)}${this.closed?`</${d}>`:""}`}text(){const[r,s]=b(this,e);return b(this,t)?`<${r}${this.firstChild.text()}/>`:`<${r}${super.text(">")}${this.closed?`</${s}>`:""}`}getAttribute(r){return r==="padding"?b(this,e)[0].length+1:super.getAttribute(r)}print(){{const[r,s]=b(this,e);return super.print(b(this,t)?{pre:`<${r}`,post:"/>"}:{pre:`<${r}`,sep:">",post:this.closed?`</${s}>`:""})}}json(r,s=this.getAbsoluteIndex()){{const l=super.json(void 0,s);return l.selfClosing=b(this,t),l}}},e=new WeakMap,t=new WeakMap,i),ms=le(ul),ot=re(ms,0,"TagPairToken",ol,ot),ne(ms,1,ot)}}),dl,xs,cl,ti,md=L({"src/tagPair/include.ts"(){"use strict";Q(),ye(),xt(),D(),rr(),dl=[it(!1)],ti=class extends(cl=ot){get type(){return"include"}constructor(e,t="",i,n,r,s){super(e,t,i!=null?i:"",i===void 0||n!=null?n:"",r,s)}toString(e){return e?"":super.toString()}lint(e=this.getAbsoluteIndex()){{const t=[],{firstChild:i,closed:n,name:r}=this,s=new fe(this,e),l=["no-ignored","unclosed-comment"],{lintConfig:a}=F,{computeEditInfo:d}=a,u=l.map(o=>a.getSeverity(o,"include"));if(u[0]&&i.data.trim()){const o=Y(i,s,l[0],"useless-attribute",u[0]);d&&(o.suggestions=[ee(o)]),t.push(o)}if(u[1]&&!n){const o=G(this,s,l[1],F.msg("unclosed",`<${r}>`),u[1]);d&&(o.suggestions=[tt(o.endIndex,`</${r}>`)]),t.push(o)}return t}}},xs=le(cl),ti=re(xs,0,"IncludeToken",dl,ti),ne(xs,1,ti)}}),Yi,lr=L({"mixin/attributesParent.ts"(){"use strict";Yi=(e=0)=>t=>{var i,Ln;{class r extends t{constructor(){super(...arguments);j(this,i)}hasAttr(a){return R(this,i,Ln).call(this).hasAttr(a)}getAttr(a){return R(this,i,Ln).call(this).getAttr(a)}}return i=new WeakSet,Ln=function(){return this.childNodes[e]},r}}}}),ge,vs,bs,Dt,Ii,ys,Gt,ws,Ss,ks,Ni,As,$s,_s,Xe,ar,or,ur,ho,dr,cr=L({"util/sharable.ts"(){"use strict";ge=new Set(["align"]),vs=new Set(["cite"]),bs=new Set(["cite","datetime"]),Dt=new Set(["width"]),Ii=new Set(["axis","align","bgcolor","height","width","valign"]),ys=new Set([...Ii,"abbr","headers","scope","rowspan","colspan"]),Gt=new Set(["type"]),ws=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),Ss=new Set(["clear"]),ks=new Set(["bgcolor","align","valign"]),Ni=new Set(["id","qid","forcemathmode","type","display"]),As=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),$s=new Set(["weight"]),_s=new Set(["width","height","zoom","latitude","longitude","align","mapstyle","lang","alt","text"]),Xe=new Set,ar=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"]),or={div:ge,h1:ge,h2:ge,h3:ge,h4:ge,h5:ge,h6:ge,blockquote:vs,q:vs,p:ge,br:Ss,pre:Dt,ins:bs,del:bs,ul:Gt,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...ws,"border"]),caption:ge,tr:ks,td:ys,th:ys,font:new Set(["size","color","face"]),hr:Dt,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:Gt,poem:ge,categorytree:ge,combooption:ge,img:new Set(["alt","src","width","height","loading","srcset"])},ur={pre:new Set(["format"]),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:Xe,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:$s,choicetemplate:$s,imagemap:Xe,inputbox:Xe,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:Xe,poll:new Set(["id","show-results-before-voting"]),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([...Ni,"chem"]),chem:Ni,ce:Ni,hiero:Xe,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:As,syntaxhighlight:As,templatedata:Xe,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:Xe,mapframe:new Set([..._s,"frameless"]),maplink:new Set([..._s,"class"]),rss:new Set(["template","templatename","max","highlight","filter","filterout","reverse","date","item-max-length"]),"page-collection":new Set(["lang","name","description","end-date"])},ho={table:ws,td:new Set([...Ii,"scope"]),th:Ii,br:Ss,caption:ge,div:ge,hr:Dt,h1:ge,h2:ge,h3:ge,h4:ge,h5:ge,h6:ge,li:Gt,p:ge,pre:Dt,tr:ks,ul:Gt},dr={dynamicpagelist:["category","notcategory","namespace","count","offset","imagewidth","imageheight","imagesperrow","mode","gallerycaption","galleryshowfilesize","galleryshowfilename","order","ordermethod","redirects","stablepages","qualitypages","suppresserrors","addfirstcategorydate","shownamespace","ignoresubpages","googlehack","nofollow"],inputbox:["preloadparams[]","type","width","preload","preloadtitle","page","editintro","useve","usedt","summary","nosummary","minor","break","default","placeholder","bgcolor","buttonlabel","searchbuttonlabel","fulltextbutton","namespaces","labeltext","hidden","id","inline","prefix","dir","searchengine","searchtype","searchfilter","tour","arialabel"]}}}),hl,gl,pl,fl,Wi,xd=L({"src/attribute.ts"(){"use strict";var e,t,i,n,r,go,Fn,a;Q(),ve(),Ue(),cr(),ye(),D(),V(),ft(),hl=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,gl=/(?:^|\s|\*\/)(?:javascript|vbscript)(?:\W|$)/iu,pl=new Set(["ext","arg","magic-word","template"]),fl=new Set(["about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),Wi=(a=class extends U{constructor(u,o,c,f,m,y="",S,$=[]){const _=new Me(c,"attr-key",m,$);let T;if(c==="title"||o==="img"&&c==="alt")T=new U(S,m,$,{}),T.type="attr-value",T.setAttribute("stage",$e-1);else if(o==="gallery"&&c==="caption"||o==="ref"&&c==="details"||(o==="mapframe"||o==="maplink")&&c==="text"||o==="choose"&&(c==="before"||c==="after")){const g={...m,excludes:[...m.excludes,"heading","html","table","hr","list"]};T=new U(S,g,$,{}),T.type="attr-value",T.setAttribute("stage",1)}else T=new Me(S,"attr-value",m,$,{});super(void 0,m,$);j(this,r);j(this,e);j(this,t);j(this,i);j(this,n);E(this,e,u),this.append(_,T),E(this,i,y),E(this,n,[...f]),E(this,t,o),this.setAttribute("name",jt(Te(c)))}get type(){return b(this,e)}get tag(){return b(this,t)}get balanced(){return!b(this,i)||b(this,n)[0]===b(this,n)[1]}afterBuild(){b(this,i).includes("\0")&&E(this,i,this.buildFromStr(b(this,i),0)),this.parentNode&&E(this,t,this.parentNode.name),R(this,r,go).call(this),super.afterBuild()}toString(u){const[o="",c=""]=b(this,n);return b(this,i)?super.toString(u,b(this,i)+o)+c:this.firstChild.toString(u)}text(){return b(this,i)?`${super.text(`${b(this,i).trim()}"`)}"`:this.firstChild.text()}getGaps(){var u,o;return b(this,i)?b(this,i).length+((o=(u=b(this,n)[0])==null?void 0:u.length)!=null?o:0):0}lint(u=this.getAbsoluteIndex(),o){var c;{const f=super.lint(u,o),{balanced:m,firstChild:y,lastChild:S,name:$,tag:_}=this,T=new fe(this,u),g=["unclosed-quote","obsolete-attr"],{lintConfig:h}=F,x=g.map(k=>h.getSeverity(k,$));if(x[0]&&!m){const k=Y(S,T,g[0],"unclosed-quotes",x[0]);k.startIndex--,k.startCol--,h.computeEditInfo&&(k.suggestions=[tt(k.endIndex,b(this,n)[0])]),f.push(k)}const p=R(this,r,Fn).call(this,u,T);return p&&f.push(p),x[1]&&((c=ho[_])!=null&&c.has($))&&f.push(Y(y,T,g[1],"obsolete-attribute",x[1])),f}}getValue(){return b(this,i)?this.lastChild.text().trim():this.type==="ext-attr"||""}escape(){this.type!=="ext-attr"&&(E(this,i,"{{=}}"),this.lastChild.escape())}getAttribute(u){return u==="invalid"?R(this,r,Fn).call(this):super.getAttribute(u)}print(){{const[u="",o=""]=b(this,n);return b(this,i)?super.print({sep:fi(b(this,i))+u,post:o}):super.print()}}json(u,o=this.getAbsoluteIndex()){{const c=super.json(void 0,o);return c.tag=this.tag,c}}},e=new WeakMap,t=new WeakMap,i=new WeakMap,n=new WeakMap,r=new WeakSet,go=function(){this.setAttribute("name",jt(this.firstChild.text()))},Fn=function(u,o){const{firstChild:c,lastChild:f,type:m,name:y,tag:S,parentNode:$}=this,_=!f.childNodes.some(({type:w})=>pl.has(w)),T=this.getValue(),g=ur[S],h=or[S],{length:x}=this.toString();let p="illegal-attr",k,v;if({lintConfig:k}=F,{computeEditInfo:v}=k,!(g!=null&&g.has(y))&&!(h!=null&&h.has(y))&&(m==="ext-attr"?g||h:!/\{\{[^{]+\}\}/u.test(y))&&(m==="ext-attr"&&!h||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(y)&&(S==="meta"||S==="link"||!ar.has(y)))||(y==="itemtype"||y==="itemid"||y==="itemref")&&!($!=null&&$.hasAttr("itemscope"))){if(u===void 0)return!0;{const w=k.getSeverity(p,"unknown");if(w){const A=Y(c,o,p,"illegal-attribute-name",w);return v&&(A.suggestions=[ee(u,x)]),A}}}else if(y==="style"&&typeof T=="string"&&hl.test(T)){if(u===void 0)return!0;{p="insecure-style";const w=k.getSeverity(p);return w&&Y(f,o,p,"insecure-style",w)}}else if(y==="tabindex"&&typeof T=="string"&&T!=="0"){if(u===void 0)return!0;{const w=k.getSeverity(p,"tabindex");if(w){const A=Y(f,o,p,"nonzero-tabindex",w);return v&&(A.suggestions=[ee(u,x),qe(A,"0 tabindex","0")]),A}}}else if(typeof T=="string"&&((/^xmlns:[\w:.-]+$/u.test(y)||fl.has(y))&&gl.test(T)||_&&(y==="href"||S==="img"&&y==="src")&&!new RegExp(String.raw`^(?:${this.getAttribute("config").protocol}|//)\S+$`,"iu").test(T))){if(u===void 0)return!0;{const w=k.getSeverity(p,"value");return w&&Y(f,o,p,"illegal-attribute-value",w)}}else if(_&&m!=="ext-attr"){const w=ir(S,y),A=String(T).toLowerCase();if(w.length>0&&w.every(C=>C!==A)){if(u===void 0)return!0;{const C=k.getSeverity(p,"value");return C&&Y(f,o,p,"illegal-attribute-value",C)}}}return!1},a)}}),Ts,ml,xl,Zi,hr=L({"src/attributes.ts"(){"use strict";var e,t,Mi,n;Q(),ve(),ye(),D(),V(),ft(),xd(),Ts=r=>r.slice(0,-1),ml=r=>`${Ts(r)}-dirty`,xl=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch{return/[^\W_]/u}})(),Zi=(n=class extends U{constructor(s,l,a,d,u=[]){super(void 0,d,u,{});j(this,t);j(this,e);if(E(this,e,l),this.setAttribute("name",a),s){const o=/([^\s/](?:(?!\0\d+~\x7F)[^\s/=])*)(?:((?:\s(?:\s|\0\d+[cn]\x7F)*)?(?:=|\0\d+~\x7F)(?:\s|\0\d+[cn]\x7F)*)(?:(["'])([\s\S]*?)(\3|$)|(\S*)))?/gu;let c="",f=o.exec(s),m=0;const y=(()=>{c&&(super.insertAt(new Me(c,ml(l),d,u,{})),c="")});for(;f;){const{index:S,0:$,1:_,2:T,3:g,4:h,5:x,6:p}=f;if(c+=s.slice(m,S),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(Te(_).trim())){const k=h!=null?h:p,v=[g,x],w=new Wi(Ts(l),a,_,v,d,T,k,u);y(),super.insertAt(w)}else c+=$;({lastIndex:m}=o),f=o.exec(s)}c+=s.slice(m),y()}}get type(){return b(this,e)}afterBuild(){const{parentNode:s}=this;s!=null&&s.is("td")&&this.setAttribute("name",s.subtype),super.afterBuild()}getAttrTokens(s){return this.childNodes.filter(l=>l instanceof Wi&&(!s||l.name===jt(s)))}hasAttr(s){return this.getAttrTokens(s).length>0}getAttrToken(s){{const l=this.getAttrTokens(s);return l[l.length-1]}}getAttr(s){var l;return(l=this.getAttrToken(s))==null?void 0:l.getValue()}lint(s=this.getAbsoluteIndex(),l){{const a=super.lint(s,l),{parentNode:d,childNodes:u}=this,o=new Map,c=new Set,f=new fe(this,s),m=["no-ignored","no-duplicate"],{lintConfig:y}=F,{computeEditInfo:S,fix:$}=y,_=["closingTag","invalidAttributes","nonWordAttributes"].map(g=>y.getSeverity(m[0],g));if(_[0]&&R(this,t,Mi).call(this)){const g=G(this,f,m[0],"attributes-of-closing-tag",_[0]);if(S){const h=d.getAbsoluteIndex();g.suggestions=[ee(g),Yn(h)]}a.push(g)}for(const g of u)if(g instanceof Wi){const{name:h}=g;o.has(h)?(c.add(h),o.get(h).push(g)):o.set(h,[g])}else{const h=g.text().trim(),x=_[xl.test(h)?1:2];if(h&&x){const p=Y(g,f,m[0],"invalid-attribute",x);S&&(p.suggestions=[ee(p,0," ")]),a.push(p)}}const T=y.getSeverity(m[1],"attribute");if(T&&c.size>0)for(const g of c){const h=o.get(g).map(x=>{const p=x.getValue();return[x,p===!0?"":p]});Array.prototype.push.apply(a,h.map(([x,p],k)=>{const v=Y(x,f,m[1],F.msg("duplicate-attribute",g),T);if(S||$){const w=ee(v);!p||h.slice(0,k).some(([,A])=>A===p)?v.fix=w:S&&(v.suggestions=[w])}return v}))}return a}}escape(){this.type!=="ext-attrs"&&super.escape()}getAttribute(s){return s==="invalid"?R(this,t,Mi).call(this):super.getAttribute(s)}print(){return this.toString()?`<span class="wpb-${this.type}${R(this,t,Mi).call(this)?" wpb-invalid":""}">${this.childNodes.map(s=>s.print(s instanceof Me?{class:s.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}},e=new WeakMap,t=new WeakSet,Mi=function(){const{parentNode:s}=this;return(s==null?void 0:s.type)==="html"&&s.closing&&this.text().trim()!==""},n)}}),po={};oe(po,{PreToken:()=>fo});var fo,vd=L({"src/pre.ts"(){"use strict";Ue(),V(),Bt(),fo=class extends U{get type(){return"ext-inner"}constructor(e,t,i=[]){if(e){const n=/<nowiki>/giu,r=/<\/nowiki>/giu,{length:s}=n.source;let l=n.exec(e);l&&(r.lastIndex=l.index+s);let a=r.exec(e),d=0,u="";for(;l&&a;)new Oe(l[0],t,i,!0),new Oe(a[0],t,i,!0),u+=`${e.slice(d,l.index)}\0${i.length-1}n${e.slice(l.index+s,a.index)}\0${i.length}n`,d=a.index+s+1,n.lastIndex=d,l=n.exec(e),l&&(r.lastIndex=l.index+s),a=r.exec(e);e=u+e.slice(d)}super(e,t,i,{}),this.setAttribute("stage",$e-1)}isPlain(){return!0}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*\/\s*(pre)\b/giu)}}}}),es,gr=L({"src/multiLine/index.ts"(){"use strict";V(),es=class extends U{get type(){return"ext-inner"}toString(e){return super.toString(e,`
|
|
5
|
+
`),Be!==-1));)Ee=Ee.nextSibling;if(!Ee)continue;He=Ee.data.slice(0,Be)}else He=u.slice(P+de,me);if(!/(?:^|[^=])=+\s*(?:\S\s*)?$/u.test(He))continue;me===-1?(Se=Ee.getAbsoluteIndex()+He.length,{top:K,left:ke}=h.posFromIndex(Se)):(Se+=He.length,de+=He.length)}const nt={rule:ce,message:F.msg(z==="="?"header-like":"lonely",H||z==="h"||Ae||te?I:z),severity:M,startIndex:ae,endIndex:Se,startLine:$r,endLine:K!=null?K:$r,startCol:_r,endCol:ke!=null?ke:_r+de};if(C.computeEditInfo)if(z==="<")nt.suggestions=[Pt(ae,"<")];else if(z==="h"&&y!=="link-text"&&Kr.test(Fe||""))nt.suggestions=[vi(ae)];else if(X){const me=c.getAbsoluteIndex()+c.toString().length;nt.suggestions=[Pt(me,"]")]}else if(I==="]"&&st){const me=s-m.toString().length;nt.suggestions=[Ji(me,"left-bracket","[")]}else H&&(nt.suggestions=[...O[0]===I?[]:[er(nt,I)],...he===":"||he===":"?[vi(Se,1)]:[]]);$.push(nt)}return $}}replaceData(s){R(this,e,Nn).call(this,s)}splitText(s){{const{parentNode:l,data:a}=this;if(!l)throw new Error("The text node to be split has no parent node!");const d=new i(a.slice(s));return yi(l,l.childNodes.indexOf(this)+1,0,[d]),this.setAttribute("data",a.slice(0,s)),d}this.lspError("AstText.splitText")}escape(){{const{parentNode:s}=this;if(!s)throw new Error("The text node to be escaped has no parent node!");const{TranscludeToken:l}=(ro(),se(no)),a=s.getAttribute("config"),d=s.childNodes.indexOf(this)+1,o=f=>Math.max(this.data.lastIndexOf("=",f),this.data.lastIndexOf("|",f));let u=o();const c=(()=>new l(this.data[u]==="="?"=":"!",[],a));for(;u>=0;u=o(u-1))u<this.data.length-1&&this.splitText(u+1),s.insertAt(pe.run(c),d),R(this,e,Nn).call(this,this.data.slice(0,u))}}print(){return fi(this.data)}},e=new WeakSet,Nn=function(s){this.setAttribute("data",s)},i)}}),it,xt=L({"mixin/hidden.ts"(){"use strict";it=(e=!0,t=!0)=>i=>{class n extends i{text(){return""}lint(s){return e?[]:super.lint(s)}}return n}}}),ze,Qe=L({"mixin/padded.ts"(){"use strict";ze=({length:e})=>t=>{class i extends t{getAttribute(r){return r==="padding"?e:super.getAttribute(r)}}return i}}}),Yr,cs,Zr,De,Si=L({"src/link/base.ts"(){"use strict";var e,t,i,n,ao,s;Q(),Ue(),Ie(),ye(),Qe(),Le(),D(),V(),ft(),Yr=[Ce,ze("[[")],De=(s=class extends(Zr=U){constructor(a,d,o,u=[],c="|"){super(void 0,o,u,{});j(this,n);j(this,e,!0);j(this,t);j(this,i);if(this.insertAt(new Me(a,"link-target",o,u,{})),d!==void 0){const f=new U(d,o,u,{});f.type="link-text",f.setAttribute("stage",$e-1),this.insertAt(f)}E(this,t,c)}get link(){return b(this,i)}get fragment(){return b(this,i).fragment}afterBuild(){E(this,i,this.getTitle()),b(this,t).includes("\0")&&E(this,t,this.buildFromStr(b(this,t),0)),R(this,n,ao).call(this),super.afterBuild()}setAttribute(a,d){a==="bracket"?E(this,e,d):a==="title"?E(this,i,d):super.setAttribute(a,d)}toString(a){const d=super.toString(a,b(this,t));return b(this,e)?`[[${d}]]`:d}text(){const a=super.text("|");return b(this,e)?`[[${a}]]`:a}getAttribute(a){return a==="title"?b(this,i):super.getAttribute(a)}getGaps(a){return a===0?b(this,t).length:1}lint(a=this.getAbsoluteIndex(),d){{const o=super.lint(a,d),{childNodes:[u,c],type:f}=this,{encoded:m,fragment:y}=b(this,i),{lintConfig:S}=F,{computeEditInfo:$,fix:_}=S,T=new fe(this,a);let g="unknown-page",h=S.getSeverity(g);if(h&&u.childNodes.some(({type:x})=>x==="template")&&o.push(Y(u,T,g,"template-in-link",h)),g="url-encoding",h=S.getSeverity(g),h&&m){const x=Y(u,T,g,"unnecessary-encoding",h);($||_)&&(x.fix=Kn(x,u)),o.push(x)}if(g="pipe-like",h=S.getSeverity(g,"link"),h&&(f==="link"||f==="category")){const x=c==null?void 0:c.childNodes.findIndex(k=>k.type==="text"&&k.data.includes("|")),p=c==null?void 0:c.childNodes[x];if(p){const k=Y(c,T,g,"pipe-in-link",h);if($){const v=k.startIndex+c.getRelativeIndex(x);k.suggestions=[tr(v,p.data)]}o.push(k)}}if(g="no-ignored",h=S.getSeverity(g,"fragment"),h&&y!==void 0&&!Bu(f)){const x=Y(u,T,g,"useless-fragment",h);if($||_){const p=u.childNodes.findIndex(v=>v.type==="text"&&v.data.includes("#")),k=u.childNodes[p];k&&(x.fix=ee(x,u.getRelativeIndex(p)+k.data.indexOf("#")))}o.push(x)}return o}}getTitle(a,d){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:d,temporary:a,decode:!0,selfLink:!0})}print(){return super.print(b(this,e)?{pre:"[[",post:"]]",sep:b(this,t)}:{sep:b(this,t)})}json(a,d=this.getAbsoluteIndex()){{const o=super.json(void 0,d),{type:u,fragment:c}=this;return c!==void 0&&(u==="link"||u==="redirect-target")&&(o.fragment=c),o}}},e=new WeakMap,t=new WeakMap,i=new WeakMap,n=new WeakSet,ao=function(){this.type!=="ext-inner"&&this.setAttribute("name",b(this,i).title)},s),cs=le(Zr),De=re(cs,0,"LinkBaseToken",Yr,De),ne(cs,1,De)}}),el,hs,tl,We,vt=L({"src/nowiki/base.ts"(){"use strict";Le(),V(),el=[Ce],We=class extends(tl=U){get innerText(){return this.firstChild.data}constructor(e="",t,i){super(e,t,i)}},hs=le(tl),We=re(hs,0,"NowikiBaseToken",el,We),ne(hs,1,We)}}),il,gs,sl,Oe,Bt=L({"src/nowiki/noinclude.ts"(){"use strict";Q(),xt(),D(),vt(),il=[it(!1)],Oe=class extends(sl=We){get type(){return"noinclude"}toString(e){return e?"":super.toString()}lint(e=this.getAbsoluteIndex()){{const{lintConfig:t}=F,i="no-ignored",n=t.getSeverity(i,"include");if(n){const{innerText:r}=this,s=/^<(includeonly|(?:no|only)include)\s+(?:[^\s>/]|\/(?!>))[^>]*>$/iu.exec(r);if(s){const l=G(this,{start:e},i,"useless-attribute",n),{computeEditInfo:a}=t,d=s[1].length+1,o=r.endsWith("/>")?2:1;return l.startIndex+=d,l.startCol+=d,l.endIndex-=o,l.endCol-=o,a&&(l.suggestions=[ee(l)]),[l]}}return[]}}},gs=le(sl),Oe=re(gs,0,"NoincludeToken",il,Oe),ne(gs,1,Oe)}}),oo,hd=L({"src/link/redirectTarget.ts"(){"use strict";Q(),D(),Si(),Bt(),oo=class extends De{get type(){return"redirect-target"}constructor(e,t,i,n){super(e,void 0,i,n),t!==void 0&&this.insertAt(new Oe(t,i,n))}getTitle(){return this.normalizeTitle(this.firstChild.toString(),0,{halfParsed:!0,decode:!0,page:""})}lint(e=this.getAbsoluteIndex()){{const t=super.lint(e,!1),i="no-ignored",{lintConfig:n}=F,r=n.getSeverity(i,"redirect");if(r&&this.length===2){const s=Y(this.lastChild,{start:e},i,"useless-link-text",r);s.startIndex--,s.startCol--,(n.computeEditInfo||n.fix)&&(s.fix=ee(s)),t.push(s)}return t}}}}}),nl,ps,rl,Zt,gd=L({"src/redirect.ts"(){"use strict";var e,t,i;xt(),Le(),V(),mt(),hd(),nl=[it(!1,!1),Ce],Zt=(i=class extends(rl=U){constructor(r,s,l,a,d,o,u=[]){super(void 0,o,u);j(this,e);j(this,t);E(this,e,r),E(this,t,d),this.append(new Ge(s,"redirect-syntax",o,u),new oo(l,a==null?void 0:a.slice(1),o,u))}get type(){return"redirect"}getAttribute(r){return r==="padding"?b(this,e).length:super.getAttribute(r)}toString(r){return b(this,e)+super.toString(r)+b(this,t)}lint(r=this.getAbsoluteIndex()){{const s=r+b(this,e).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",s),this.lastChild.lint(s)}}print(){return super.print({pre:b(this,e),post:b(this,t)})}},e=new WeakMap,t=new WeakMap,i),ps=le(rl),Zt=re(ps,0,"RedirectToken",nl,Zt),ne(ps,1,Zt)}}),uo={};oe(uo,{parseRedirect:()=>co});var co,pd=L({"parser/redirect.ts"(){"use strict";D(),gd(),co=(e,t,i)=>{var r;(r=t.regexRedirect)!=null||(t.regexRedirect=new RegExp(String.raw`^(\s*)((?:${t.redirection.join("|")})\s*(?::\s*)?)\[\[([^\n|\]]+)(\|.*?)?\]\](\s*)`,"iu"));const n=t.regexRedirect.exec(e);return n&&F.normalizeTitle(n[3],0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,page:""}).valid?(e=`\0${i.length}o${e.slice(n[0].length)}`,new Zt(...n.slice(1),t,i),e):!1}}}),ll,fs,al,ei,fd=L({"src/onlyinclude.ts"(){"use strict";Qe(),Le(),V(),ll=[Ce,ze("<onlyinclude>")],ei=class extends(al=U){get type(){return"onlyinclude"}toString(e){return`<onlyinclude>${super.toString(e)}</onlyinclude>`}isPlain(){return!0}print(){return super.print({pre:'<span class="wpb-ext"><onlyinclude></span>',post:'<span class="wpb-ext"></onlyinclude></span>'})}},fs=le(al),ei=re(fs,0,"OnlyincludeToken",ll,ei),ne(fs,1,ei)}}),ol,ms,ul,ot,rr=L({"src/tagPair/index.ts"(){"use strict";var e,t,i;Ki(),Le(),V(),ol=[wi(),Ce],ot=(i=class extends(ul=U){constructor(r,s,l,a,d,o=[]){super(void 0,d);j(this,e);j(this,t);je(this,"closed");this.setAttribute("name",r.toLowerCase()),E(this,e,[r,a||r]),this.closed=a!=="",E(this,t,a===void 0),this.append(s,l);const u=typeof s=="string"?-1:o.indexOf(s);o.splice(u===-1?1/0:u,0,this)}get innerText(){return b(this,t)?void 0:this.lastChild.text()}get selfClosing(){return b(this,t)}toString(r){const{firstChild:s,lastChild:l}=this,[a,d]=b(this,e);return b(this,t)?`<${a}${s.toString(r)}/>`:`<${a}${s.toString(r)}>${l.toString(r)}${this.closed?`</${d}>`:""}`}text(){const[r,s]=b(this,e);return b(this,t)?`<${r}${this.firstChild.text()}/>`:`<${r}${super.text(">")}${this.closed?`</${s}>`:""}`}getAttribute(r){return r==="padding"?b(this,e)[0].length+1:super.getAttribute(r)}print(){{const[r,s]=b(this,e);return super.print(b(this,t)?{pre:`<${r}`,post:"/>"}:{pre:`<${r}`,sep:">",post:this.closed?`</${s}>`:""})}}json(r,s=this.getAbsoluteIndex()){{const l=super.json(void 0,s);return l.selfClosing=b(this,t),l}}},e=new WeakMap,t=new WeakMap,i),ms=le(ul),ot=re(ms,0,"TagPairToken",ol,ot),ne(ms,1,ot)}}),dl,xs,cl,ti,md=L({"src/tagPair/include.ts"(){"use strict";Q(),ye(),xt(),D(),rr(),dl=[it(!1)],ti=class extends(cl=ot){get type(){return"include"}constructor(e,t="",i,n,r,s){super(e,t,i!=null?i:"",i===void 0||n!=null?n:"",r,s)}toString(e){return e?"":super.toString()}lint(e=this.getAbsoluteIndex()){{const t=[],{firstChild:i,closed:n,name:r}=this,s=new fe(this,e),l=["no-ignored","unclosed-comment"],{lintConfig:a}=F,{computeEditInfo:d}=a,o=l.map(u=>a.getSeverity(u,"include"));if(o[0]&&i.data.trim()){const u=Y(i,s,l[0],"useless-attribute",o[0]);d&&(u.suggestions=[ee(u)]),t.push(u)}if(o[1]&&!n){const u=G(this,s,l[1],F.msg("unclosed",`<${r}>`),o[1]);d&&(u.suggestions=[tt(u.endIndex,`</${r}>`)]),t.push(u)}return t}}},xs=le(cl),ti=re(xs,0,"IncludeToken",dl,ti),ne(xs,1,ti)}}),Yi,lr=L({"mixin/attributesParent.ts"(){"use strict";Yi=(e=0)=>t=>{var i,Ln;{class r extends t{constructor(){super(...arguments);j(this,i)}hasAttr(a){return R(this,i,Ln).call(this).hasAttr(a)}getAttr(a){return R(this,i,Ln).call(this).getAttr(a)}}return i=new WeakSet,Ln=function(){return this.childNodes[e]},r}}}}),ge,vs,bs,Dt,Ii,ys,Gt,ws,Ss,ks,Ni,As,$s,_s,Xe,ar,or,ur,ho,dr,cr=L({"util/sharable.ts"(){"use strict";ge=new Set(["align"]),vs=new Set(["cite"]),bs=new Set(["cite","datetime"]),Dt=new Set(["width"]),Ii=new Set(["axis","align","bgcolor","height","width","valign"]),ys=new Set([...Ii,"abbr","headers","scope","rowspan","colspan"]),Gt=new Set(["type"]),ws=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),Ss=new Set(["clear"]),ks=new Set(["bgcolor","align","valign"]),Ni=new Set(["id","qid","forcemathmode","type","display"]),As=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),$s=new Set(["weight"]),_s=new Set(["width","height","zoom","latitude","longitude","align","mapstyle","lang","alt","text"]),Xe=new Set,ar=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"]),or={div:ge,h1:ge,h2:ge,h3:ge,h4:ge,h5:ge,h6:ge,blockquote:vs,q:vs,p:ge,br:Ss,pre:Dt,ins:bs,del:bs,ul:Gt,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...ws,"border"]),caption:ge,tr:ks,td:ys,th:ys,font:new Set(["size","color","face"]),hr:Dt,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:Gt,poem:ge,categorytree:ge,combooption:ge,img:new Set(["alt","src","width","height","loading","srcset"])},ur={pre:new Set(["format"]),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:Xe,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:$s,choicetemplate:$s,imagemap:Xe,inputbox:Xe,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:Xe,poll:new Set(["id","show-results-before-voting"]),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([...Ni,"chem"]),chem:Ni,ce:Ni,hiero:Xe,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:As,syntaxhighlight:As,templatedata:Xe,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:Xe,mapframe:new Set([..._s,"frameless"]),maplink:new Set([..._s,"class"]),rss:new Set(["template","templatename","max","highlight","filter","filterout","reverse","date","item-max-length"]),"page-collection":new Set(["lang","name","description","end-date"])},ho={table:ws,td:new Set([...Ii,"scope"]),th:Ii,br:Ss,caption:ge,div:ge,hr:Dt,h1:ge,h2:ge,h3:ge,h4:ge,h5:ge,h6:ge,li:Gt,p:ge,pre:Dt,tr:ks,ul:Gt},dr={dynamicpagelist:["category","notcategory","namespace","count","offset","imagewidth","imageheight","imagesperrow","mode","gallerycaption","galleryshowfilesize","galleryshowfilename","order","ordermethod","redirects","stablepages","qualitypages","suppresserrors","addfirstcategorydate","shownamespace","ignoresubpages","googlehack","nofollow"],inputbox:["preloadparams[]","type","width","preload","preloadtitle","page","editintro","useve","usedt","summary","nosummary","minor","break","default","placeholder","bgcolor","buttonlabel","searchbuttonlabel","fulltextbutton","namespaces","labeltext","hidden","id","inline","prefix","dir","searchengine","searchtype","searchfilter","tour","arialabel"]}}}),hl,gl,pl,fl,Wi,xd=L({"src/attribute.ts"(){"use strict";var e,t,i,n,r,go,Fn,a;Q(),ve(),Ue(),cr(),ye(),D(),V(),ft(),hl=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,gl=/(?:^|\s|\*\/)(?:java|vb)script(?:\W|$)/iu,pl=new Set(["ext","arg","magic-word","template"]),fl=new Set(["about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),Wi=(a=class extends U{constructor(o,u,c,f,m,y="",S,$=[]){const _=new Me(c,"attr-key",m,$);let T;if(c==="title"||u==="img"&&c==="alt")T=new U(S,m,$,{}),T.type="attr-value",T.setAttribute("stage",$e-1);else if(u==="gallery"&&c==="caption"||u==="ref"&&c==="details"||(u==="mapframe"||u==="maplink")&&c==="text"||u==="choose"&&(c==="before"||c==="after")){const g={...m,excludes:[...m.excludes,"heading","html","table","hr","list"]};T=new U(S,g,$,{}),T.type="attr-value",T.setAttribute("stage",1)}else T=new Me(S,"attr-value",m,$,{});super(void 0,m,$);j(this,r);j(this,e);j(this,t);j(this,i);j(this,n);E(this,e,o),this.append(_,T),E(this,i,y),E(this,n,[...f]),E(this,t,u),this.setAttribute("name",jt(Te(c)))}get type(){return b(this,e)}get tag(){return b(this,t)}get balanced(){return!b(this,i)||b(this,n)[0]===b(this,n)[1]}afterBuild(){b(this,i).includes("\0")&&E(this,i,this.buildFromStr(b(this,i),0)),this.parentNode&&E(this,t,this.parentNode.name),R(this,r,go).call(this),super.afterBuild()}toString(o){const[u="",c=""]=b(this,n);return b(this,i)?super.toString(o,b(this,i)+u)+c:this.firstChild.toString(o)}text(){return b(this,i)?`${super.text(`${b(this,i).trim()}"`)}"`:this.firstChild.text()}getGaps(){var o,u;return b(this,i)?b(this,i).length+((u=(o=b(this,n)[0])==null?void 0:o.length)!=null?u:0):0}lint(o=this.getAbsoluteIndex(),u){var c;{const f=super.lint(o,u),{balanced:m,firstChild:y,lastChild:S,name:$,tag:_}=this,T=new fe(this,o),g=["unclosed-quote","obsolete-attr"],{lintConfig:h}=F,x=g.map(k=>h.getSeverity(k,$));if(x[0]&&!m){const k=Y(S,T,g[0],"unclosed-quotes",x[0]);k.startIndex--,k.startCol--,h.computeEditInfo&&(k.suggestions=[tt(k.endIndex,b(this,n)[0])]),f.push(k)}const p=R(this,r,Fn).call(this,o,T);return p&&f.push(p),x[1]&&((c=ho[_])!=null&&c.has($))&&f.push(Y(y,T,g[1],"obsolete-attribute",x[1])),f}}getValue(){return b(this,i)?this.lastChild.text().trim():this.type==="ext-attr"||""}escape(){this.type!=="ext-attr"&&(E(this,i,"{{=}}"),this.lastChild.escape())}getAttribute(o){return o==="invalid"?R(this,r,Fn).call(this):super.getAttribute(o)}print(){{const[o="",u=""]=b(this,n);return b(this,i)?super.print({sep:fi(b(this,i))+o,post:u}):super.print()}}json(o,u=this.getAbsoluteIndex()){{const c=super.json(void 0,u);return c.tag=this.tag,c}}},e=new WeakMap,t=new WeakMap,i=new WeakMap,n=new WeakMap,r=new WeakSet,go=function(){this.setAttribute("name",jt(this.firstChild.text()))},Fn=function(o,u){const{firstChild:c,lastChild:f,type:m,name:y,tag:S,parentNode:$}=this,_=!f.childNodes.some(({type:w})=>pl.has(w)),T=this.getValue(),g=ur[S],h=or[S],{length:x}=this.toString();let p="illegal-attr",k,v;if({lintConfig:k}=F,{computeEditInfo:v}=k,!(g!=null&&g.has(y))&&!(h!=null&&h.has(y))&&(m==="ext-attr"?g||h:!/\{\{[^{]+\}\}/u.test(y))&&(m==="ext-attr"&&!h||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(y)&&(S==="meta"||S==="link"||!ar.has(y)))||(y==="itemtype"||y==="itemid"||y==="itemref")&&!($!=null&&$.hasAttr("itemscope"))){if(o===void 0)return!0;{const w=k.getSeverity(p,"unknown");if(w){const A=Y(c,u,p,"illegal-attribute-name",w);return v&&(A.suggestions=[ee(o,x)]),A}}}else if(y==="style"&&typeof T=="string"&&hl.test(T)){if(o===void 0)return!0;{p="insecure-style";const w=k.getSeverity(p);return w&&Y(f,u,p,"insecure-style",w)}}else if(y==="tabindex"&&typeof T=="string"&&T!=="0"){if(o===void 0)return!0;{const w=k.getSeverity(p,"tabindex");if(w){const A=Y(f,u,p,"nonzero-tabindex",w);return v&&(A.suggestions=[ee(o,x),qe(A,"0 tabindex","0")]),A}}}else if(typeof T=="string"&&((/^xmlns:[\w:.-]+$/u.test(y)||fl.has(y))&&gl.test(T)||_&&(y==="href"||S==="img"&&y==="src")&&!new RegExp(String.raw`^(?:${this.getAttribute("config").protocol}|//)\S+$`,"iu").test(T))){if(o===void 0)return!0;{const w=k.getSeverity(p,"value");return w&&Y(f,u,p,"illegal-attribute-value",w)}}else if(_&&m!=="ext-attr"){const w=ir(S,y),A=String(T).toLowerCase();if(w.length>0&&w.every(C=>C!==A)){if(o===void 0)return!0;{const C=k.getSeverity(p,"value");return C&&Y(f,u,p,"illegal-attribute-value",C)}}}return!1},a)}}),Ts,ml,xl,Zi,hr=L({"src/attributes.ts"(){"use strict";var e,t,Mi,n;Q(),ve(),ye(),D(),V(),ft(),xd(),Ts=r=>r.slice(0,-1),ml=r=>`${Ts(r)}-dirty`,xl=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch{return/[^\W_]/u}})(),Zi=(n=class extends U{constructor(s,l,a,d,o=[]){super(void 0,d,o,{});j(this,t);j(this,e);if(E(this,e,l),this.setAttribute("name",a),s){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="",f=u.exec(s),m=0;const y=(()=>{c&&(super.insertAt(new Me(c,ml(l),d,o,{})),c="")});for(;f;){const{index:S,0:$,1:_,2:T,3:g,4:h,5:x,6:p}=f;if(c+=s.slice(m,S),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(Te(_).trim())){const k=h!=null?h:p,v=[g,x],w=new Wi(Ts(l),a,_,v,d,T,k,o);y(),super.insertAt(w)}else c+=$;({lastIndex:m}=u),f=u.exec(s)}c+=s.slice(m),y()}}get type(){return b(this,e)}afterBuild(){const{parentNode:s}=this;s!=null&&s.is("td")&&this.setAttribute("name",s.subtype),super.afterBuild()}getAttrTokens(s){return this.childNodes.filter(l=>l instanceof Wi&&(!s||l.name===jt(s)))}hasAttr(s){return this.getAttrTokens(s).length>0}getAttrToken(s){{const l=this.getAttrTokens(s);return l[l.length-1]}}getAttr(s){var l;return(l=this.getAttrToken(s))==null?void 0:l.getValue()}lint(s=this.getAbsoluteIndex(),l){{const a=super.lint(s,l),{parentNode:d,childNodes:o}=this,u=new Map,c=new Set,f=new fe(this,s),m=["no-ignored","no-duplicate"],{lintConfig:y}=F,{computeEditInfo:S,fix:$}=y,_=["closingTag","invalidAttributes","nonWordAttributes"].map(g=>y.getSeverity(m[0],g));if(_[0]&&R(this,t,Mi).call(this)){const g=G(this,f,m[0],"attributes-of-closing-tag",_[0]);if(S){const h=d.getAbsoluteIndex();g.suggestions=[ee(g),Yn(h)]}a.push(g)}for(const g of o)if(g instanceof Wi){const{name:h}=g;u.has(h)?(c.add(h),u.get(h).push(g)):u.set(h,[g])}else{const h=g.text().trim(),x=_[xl.test(h)?1:2];if(h&&x){const p=Y(g,f,m[0],"invalid-attribute",x);S&&(p.suggestions=[ee(p,0," ")]),a.push(p)}}const T=y.getSeverity(m[1],"attribute");if(T&&c.size>0)for(const g of c){const h=u.get(g).map(x=>{const p=x.getValue();return[x,p===!0?"":p]});Array.prototype.push.apply(a,h.map(([x,p],k)=>{const v=Y(x,f,m[1],F.msg("duplicate-attribute",g),T);if(S||$){const w=ee(v);!p||h.slice(0,k).some(([,A])=>A===p)?v.fix=w:S&&(v.suggestions=[w])}return v}))}return a}}escape(){this.type!=="ext-attrs"&&super.escape()}getAttribute(s){return s==="invalid"?R(this,t,Mi).call(this):super.getAttribute(s)}print(){return this.toString()?`<span class="wpb-${this.type}${R(this,t,Mi).call(this)?" wpb-invalid":""}">${this.childNodes.map(s=>s.print(s instanceof Me?{class:s.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}},e=new WeakMap,t=new WeakSet,Mi=function(){const{parentNode:s}=this;return(s==null?void 0:s.type)==="html"&&s.closing&&this.text().trim()!==""},n)}}),po={};oe(po,{PreToken:()=>fo});var fo,vd=L({"src/pre.ts"(){"use strict";Ue(),V(),Bt(),fo=class extends U{get type(){return"ext-inner"}constructor(e,t,i=[]){if(e){const n=/<nowiki>/giu,r=/<\/nowiki>/giu,{length:s}=n.source;let l=n.exec(e);l&&(r.lastIndex=l.index+s);let a=r.exec(e),d=0,o="";for(;l&&a;)new Oe(l[0],t,i,!0),new Oe(a[0],t,i,!0),o+=`${e.slice(d,l.index)}\0${i.length-1}n${e.slice(l.index+s,a.index)}\0${i.length}n`,d=a.index+s+1,n.lastIndex=d,l=n.exec(e),l&&(r.lastIndex=l.index+s),a=r.exec(e);e=o+e.slice(d)}super(e,t,i,{}),this.setAttribute("stage",$e-1)}isPlain(){return!0}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*\/\s*(pre)\b/giu)}}}}),es,gr=L({"src/multiLine/index.ts"(){"use strict";V(),es=class extends U{get type(){return"ext-inner"}toString(e){return super.toString(e,`
|
|
6
6
|
`)}text(){return super.text(`
|
|
7
7
|
`).replace(/\n\s*\n/gu,`
|
|
8
8
|
`)}getGaps(){return 1}print(){return super.print({sep:`
|
|
9
|
-
`})}}}}),mo,bd=L({"src/paramLine.ts"(){"use strict";Q(),cr(),D(),V(),mo=class extends U{get type(){return"param-line"}constructor(e,t,i,n,r){super(t,i,n,r),this.setAttribute("name",e)}lint(e=this.getAbsoluteIndex()){{const t="no-ignored",{lintConfig:i}=F,{name:n,childNodes:r}=this,s=i.getSeverity(t,n);if(!s)return[];const l=F.msg("invalid-parameter",n);if(r.some(({type:c})=>c==="ext"))return[G(this,{start:e},t,l,s)];const a=r.filter(({type:c})=>c!=="comment"&&c!=="include"&&c!=="noinclude"),d=n==="inputbox",
|
|
10
|
-
`).map(l=>s?l:ki(l,n,r,t)).map(l=>new mo(e,l,n,r,{}))),r.splice(r.indexOf(this),1),r.push(this)}}}}),vl,Cs,bl,_t,bo=L({"src/heading.ts"(){"use strict";var e,t,Ui,n;Q(),Ie(),ye(),Le(),D(),V(),mt(),vl=[Ce],_t=(n=class extends(bl=U){constructor(s,l,a,d=[]){super(void 0,a,d);j(this,t);j(this,e);E(this,e,s);const
|
|
9
|
+
`})}}}}),mo,bd=L({"src/paramLine.ts"(){"use strict";Q(),cr(),D(),V(),mo=class extends U{get type(){return"param-line"}constructor(e,t,i,n,r){super(t,i,n,r),this.setAttribute("name",e)}lint(e=this.getAbsoluteIndex()){{const t="no-ignored",{lintConfig:i}=F,{name:n,childNodes:r}=this,s=i.getSeverity(t,n);if(!s)return[];const l=F.msg("invalid-parameter",n);if(r.some(({type:c})=>c==="ext"))return[G(this,{start:e},t,l,s)];const a=r.filter(({type:c})=>c!=="comment"&&c!=="include"&&c!=="noinclude"),d=n==="inputbox",o=d?a.findIndex(({type:c})=>c!=="text"):-1;let u=a.slice(0,o===-1?void 0:o).map(String).join("").trim();if(u){d&&(u=u.toLowerCase());const c=u.indexOf("="),f=u.slice(0,c===-1?void 0:c).trim(),m=dr[n];if(c===-1?o===-1||!m.some(y=>y.startsWith(f)):!m.includes(f)){const y=G(this,{start:e},t,l,s);return i.computeEditInfo&&(y.suggestions=[ee(y)]),[y]}}return super.lint(e,!1)}}}}}),xo={};oe(xo,{ParamTagToken:()=>pr});var pr,vo=L({"src/multiLine/paramTag.ts"(){"use strict";is(),gr(),bd(),pr=class extends es{constructor(e,t,i,n,r=[],s){super(void 0,n,r,{}),i&&this.safeAppend(i.split(`
|
|
10
|
+
`).map(l=>s?l:ki(l,n,r,t)).map(l=>new mo(e,l,n,r,{}))),r.splice(r.indexOf(this),1),r.push(this)}}}}),vl,Cs,bl,_t,bo=L({"src/heading.ts"(){"use strict";var e,t,Ui,n;Q(),Ie(),ye(),Le(),D(),V(),mt(),vl=[Ce],_t=(n=class extends(bl=U){constructor(s,l,a,d=[]){super(void 0,a,d);j(this,t);j(this,e);E(this,e,s);const o=new U(l[0],a,d);o.type="heading-title",o.setAttribute("stage",2);const u=new Ge(l[1],"heading-trail",a,d);this.append(o,u)}get type(){return"heading"}get level(){return b(this,e)}toString(s){const l=R(this,t,Ui).call(this);return l+this.firstChild.toString(s)+l+this.lastChild.toString(s)}text(){const s=R(this,t,Ui).call(this);return s+this.firstChild.text()+s}getAttribute(s){return s==="invalid"?this.inHtmlAttrs()===2:s==="padding"?this.level:super.getAttribute(s)}getGaps(){return this.level}lint(s=this.getAbsoluteIndex(),l){{const a=super.lint(s,l),{firstChild:d,level:o}=this,u=d.toString(),c=u.startsWith("="),f=c||u.endsWith("="),m=new fe(this,s),y=this.inHtmlAttrs(),S=["h1","unbalanced-header","format-leakage"],{lintConfig:$}=F,{computeEditInfo:_,fix:T}=$,g=S.map(h=>$.getSeverity(h,"apostrophe"));if(g[0]&&this.level===1){const h=Y(d,m,S[0],"<h1>",g[0]);_&&!f&&(h.suggestions=[qe(h,"h2",`=${u}=`)]),a.push(h)}if(g[1]&&f){const h=F.msg("unbalanced-in-section-header",'"="'),x=Y(d,m,S[1],h,g[1]);if(!(!_||u==="="))if(c){const[p]=/^=+/u.exec(u),k=o+p.length;x.suggestions=[{desc:`h${o}`,range:[x.startIndex,x.startIndex+p.length],text:""}],k<7&&x.suggestions.push({desc:`h${k}`,range:[x.endIndex,x.endIndex],text:p})}else{const p=/[^=](=+)$/u.exec(u)[1],k=o+p.length;x.suggestions=[{desc:`h${o}`,range:[x.endIndex-p.length,x.endIndex],text:""}],k<7&&x.suggestions.push({desc:`h${k}`,range:[x.startIndex,x.startIndex],text:p})}a.push(x)}if(y){const h="parsing-order",x=$.getSeverity(h,y===2?"heading":"templateInTable");x&&a.push(G(this,m,h,"header-in-html",x))}if(g[2]){const h=this.getRootNode().toString(),x=d.childNodes.filter(ss("quote")),p=x.filter(({bold:v})=>v),k=x.filter(({italic:v})=>v);if(p.length%2){const v=Y(p[p.length-1],{...m,start:s+o,left:m.left+o},S[2],F.msg("unbalanced-in-section-header","bold-apostrophes"),g[2]);if(_||T){const w=s+o+u.length,A=ee(v);h.slice(v.endIndex,w).trim()?_&&(v.suggestions=[A,tt(w,"'''")]):p.length===1&&k.length===0?v.fix=A:_&&(v.suggestions=[A])}a.push(v)}if(k.length%2){const v=Y(k[k.length-1],{start:s+o},S[2],F.msg("unbalanced-in-section-header","italic-apostrophes"),g[2]);if(_||T){const w=s+o+u.length;h.slice(v.endIndex,w).trim()?_&&(v.suggestions=[tt(w,"''")]):k.length===1&&p.length===0?v.fix=ee(v):_&&(v.suggestions=[ee(v)])}a.push(v)}}return a}}print(){{const s=R(this,t,Ui).call(this);return super.print({pre:s,sep:s})}}json(s,l=this.getAbsoluteIndex()){{const a=super.json(void 0,l);return a.level=this.level,a}}},e=new WeakMap,t=new WeakSet,Ui=function(){return"=".repeat(this.level)},n),Cs=le(bl),_t=re(Cs,0,"HeadingToken",vl,_t),ne(Cs,1,_t)}}),yl,Is,wl,ii,yd=L({"src/hidden.ts"(){"use strict";xt(),Le(),V(),yl=[it(),Ce],ii=class extends(wl=U){get type(){return"hidden"}getAttribute(e){return e==="invalid"||super.getAttribute(e)}},Is=le(wl),ii=re(Is,0,"HiddenToken",yl,ii),ne(Is,1,ii)}}),Sl,Ns,kl,si,wd=L({"src/arg.ts"(){"use strict";var e,yo,i;ve(),Q(),ye(),Qe(),Ki(),Le(),D(),V(),ft(),yd(),Sl=[Ce,ze("{{{"),wi()],si=(i=class extends(kl=U){constructor(r,s,l=[]){super(void 0,s,l,{});j(this,e);for(let a=0;a<r.length;a++){const d=r[a];if(a===0){const o=new Me(d,"arg-name",s,l,{});super.insertAt(o)}else if(a>1){const o=new ii(d,s,l);super.insertAt(o)}else{const o=new U(d,s,l);o.type="arg-default",o.setAttribute("stage",2),super.insertAt(o)}}}get type(){return"arg"}get default(){var r,s;return(s=(r=this.childNodes[1])==null?void 0:r.text())!=null?s:!1}toString(r){return`{{{${super.toString(r,"|")}}}}`}text(){return`{{{${pt(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){R(this,e,yo).call(this),super.afterBuild()}lint(r=this.getAbsoluteIndex(),s){{const{childNodes:[l,a,...d]}=this;l.setAttribute("aIndex",r+3);const o=l.lint(r+3,s);if(a){const $=r+4+l.toString().length;a.setAttribute("aIndex",$);const _=a.lint($,s);_.length>0&&Array.prototype.push.apply(o,_)}const u=["no-ignored","no-arg"],{lintConfig:c}=F,{computeEditInfo:f}=c,m=new fe(this,r),y=u.map($=>c.getSeverity($,"arg"));if(y[0]&&d.length>0&&Array.prototype.push.apply(o,d.map($=>{const _=Y($,m,u[0],"invisible-triple-braces",y[0]);return _.startIndex--,_.startCol--,f&&(_.suggestions=[ee(_),Pt(_.startIndex,"{{!}}")]),_})),y[1]&&!this.getAttribute("include")){const $=G(this,m,u[1],"unexpected-argument",y[1]);f&&a&&($.suggestions=[qe($,"expand",a.text())]),o.push($)}const S=this.closest("ext");if(S){const $="arg-in-ext",_=c.getSeverity($,S.name);_&&o.push(G(this,m,$,"argument-in-ext",_))}return o}}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(r,s=this.getAbsoluteIndex()){{const l=super.json(void 0,s);return l.default=this.default,l}}},e=new WeakSet,yo=function(){this.setAttribute("name",this.firstChild.text().trim())},i),Ns=le(kl),si=re(Ns,0,"ArgToken",Sl,si),ne(Ns,1,si)}}),wo={};oe(wo,{parseBraces:()=>ts});var Al,Ls,Li,Fs,Es,js,$l,Rs,ts,fr=L({"parser/braces.ts"(){"use strict";Ve(),ve(),bo(),ro(),wd(),Al={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},Ls=String.raw`\[(?!\[)`,Li=String.raw`\n(?![=\0])`,Fs=String.raw`|\{{2,}`,Es=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),js=ct(e=>new RegExp(e,"gmu")),$l=new RegExp(String.raw`\{\{((?:[^\n{}[]|${Ls}|${Li})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${Li})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${Ls}|${Li})*\}-`,"gu"),Rs=e=>{const t=jt(Te(e));return Es.has(t)?Es.get(t):/^(?:filepath|(?:full|canonical)urle?):./u.test(t)?"m":/^#vardefine:./u.test(t)?"n":"t"},ts=(e,t,i)=>{var y,S,$,_,T;const n=String.raw`${t.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,r]}=t,s=[],l=[],a=(g,h,x,p)=>{h[h.length-1].push(Pe(g.slice(x,p),l))};let d;do d!==void 0&&(e=d),d=e.replace($l,(g,h,x)=>{if(h!==void 0||typeof x=="string")try{const{length:p}=i,k=(h!=null?h:x).split("|");return new at(Pe(k[0],l),k.slice(1).map(v=>{const w=v.indexOf("=");return(w===-1?[v]:[v.slice(0,w),v.slice(w+1)]).map(A=>Pe(A,l))}),t,i),`\0${p}${Rs(k[0])}`}catch(p){if(!(p instanceof SyntaxError)||p.message!=="Invalid template name")throw p}return l.push(Pe(g,l)),`\0${l.length-1}`});while(d!==e);e=d;const o=e.lastIndexOf("}}")-e.length;let u=o+e.length!==-1,c=js(n+(u?Fs:"")),f=c.exec(e),m;for(;f||m!==void 0&&m<=e.length&&((S=(y=s[s.length-1])==null?void 0:y[0])!=null&&S.startsWith("="));){if(f!=null&&f[1]){const[,{length:B}]=f;f[0]=f[0].slice(B),f.index+=B}const{0:g,index:h}=f!=null?f:{0:`
|
|
11
11
|
`,index:e.length},x=($=s.pop())!=null?$:{},{0:p,index:k,parts:v,findEqual:w,pos:A}=x,C=g==="="&&w;if(g==="]]"||g==="}-")m=h+2;else if(g===`
|
|
12
12
|
`){m=h+1;const{pos:B,findEqual:q}=(_=s[s.length-1])!=null?_:{};if(B===void 0||q||Te(e.slice(B,k))!==""){const O=/^(={1,6})(.+)\1((?:\s|\0\d+[cn]\x7F)*)$/u.exec(e.slice(k,h));O&&(O[2]=Pe(O[2],l),O[2].includes(`
|
|
13
|
-
`)||(e=`${e.slice(0,k)}\0${i.length}h${e.slice(h)}`,m=k+4+String(i.length).length,new _t(O[1].length,O.slice(2),t,i)))}}else if(g==="|"||C)m=h+1,a(e,v,A,h),g==="|"&&v.push([]),x.pos=m,x.findEqual=g==="|",s.push(x);else if(g.startsWith("}}")){const B=g.slice(0,Math.min(p.length,3)),q=p.length-B.length,{length:O}=i;m=h+B.length,a(e,v,A,h);let P=!1,I="t";if(B.length===3){const W=v.map(X=>X.join("=")),J=W.length>1&&Te(W[1]).trim();new si(W,t,i),J&&J.endsWith(":")&&r.includes(J.slice(0,-1).toLowerCase())&&(I="s")}else try{new at(v[0][0],v.slice(1),t,i),I=Rs(v[0][0])}catch(W){if(W instanceof SyntaxError&&W.message==="Invalid template name")P=!0;else throw W}P||(e=`${e.slice(0,k+q)}\0${O}${I}${e.slice(m)}`,m=k+q+3+String(O).length,q>1?s.push({0:p.slice(0,q),index:k,pos:k+q,parts:[[]]}):q===1&&e[k-1]==="-"&&s.push({0:"-{",index:k-1,pos:k+1,parts:[[]]}))}else m=h+g.length,g.startsWith("{")&&(f.pos=m,f.parts=[[]]),s.push(..."0"in x?[x]:[],f);let N=s[s.length-1];if(o
|
|
14
|
-
)`:""}(\s*)$`,"u")),Nl=s=>{if(s)s.startsWith("//")&&(s=`https:${s}`);else return s;return new URL(s).href},Ll=[Ce],ni=(r=class extends(Fl=U){constructor(l,a,d,u
|
|
15
|
-
`))!=null?d:[]){const
|
|
16
|
-
`),r=new Set(t.protocol.split("|"));let s=!0,l=!1;for(const a of n){const d=a.trim();if(!(l||!d||d.startsWith("#"))){if(s){const u=a.indexOf("|"),o=u===-1?a:a.slice(0,u),c=this.normalizeTitle(o,0,{halfParsed:!0,temporary:!0,page:""});if(c.valid&&c.ns===6){const f=new Tt("imagemap",o,u===-1?void 0:a.slice(u+1),t,i);super.insertAt(f),s=!1;continue}else l=!0}else if(a.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(a);continue}else if(a.includes("[")){const u=a.indexOf("["),o=a.slice(u),c=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(o);if(c){if(this.normalizeTitle(c[1],0,{halfParsed:!0,temporary:!0,selfLink:!0,page:""}).valid){super.insertAt(new Pn(a.slice(0,u),c.slice(1),o.slice(o.indexOf("]]")+2),t,i));continue}}else if(o.startsWith("[//")||r.has(o.slice(1,o.indexOf(":")+1))||r.has(o.slice(1,o.indexOf("//")+2))){const f=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(o);if(f){super.insertAt(new Pn(a.slice(0,u),f.slice(1),o.slice(o.indexOf("]")+1),t,i));continue}}}}super.insertAt(new Gi(a,t,i))}}lint(e=this.getAbsoluteIndex(),t){{const i=super.lint(e,t),n=new fe(this,e),{childNodes:r,image:s}=this,l="invalid-imagemap",{lintConfig:a}=F,d=a.getSeverity(l,s?"link":"image");return d&&(s?Array.prototype.push.apply(i,r.filter(u=>{const o=u.toString().trim();return u.is("noinclude")&&o&&!o.startsWith("#")}).map(u=>{const o=Y(u,n,l,"invalid-imagemap-link",d);return a.computeEditInfo&&(o.suggestions=[ee(o,-1),qe(o,"comment","# ")]),o})):i.push(G(this,n,l,"imagemap-without-image",d))),i}}getAttribute(e){return e==="invalid"?!this.image:super.getAttribute(e)}}}}),Ul,Hs,zl,It,Bo=L({"src/nowiki/comment.ts"(){"use strict";Q(),xt(),Qe(),D(),vt(),Ul=[it(!1),ze("<!--")],It=class extends(zl=We){constructor(t,i,n,r){super(t,n,r);je(this,"closed");this.closed=i}get type(){return"comment"}lint(t=this.getAbsoluteIndex()){{if(this.closed)return[];const i="unclosed-comment",{lintConfig:n}=F,r=n.getSeverity(i);if(!r)return[];const s=G(this,{start:t},i,"unclosed-comment",r);return n.computeEditInfo&&(s.suggestions=[tt(s.endIndex,"-->")]),[s]}}toString(t){return t?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"<!--",post:this.closed?"-->":""})}},Hs=le(zl),It=re(Hs,0,"CommentToken",Ul,It),ne(Hs,1,It)}}),qo={};oe(qo,{CommentedToken:()=>Wo});var Wo,Td=L({"src/commented.ts"(){"use strict";V(),Bo(),Wo=class extends U{get type(){return"ext-inner"}constructor(e,t,i=[]){if(super(void 0,t,i,{AstText:":",CommentToken:":"}),e){let n=e.indexOf("<!--"),r=n!==-1&&e.indexOf("-->",n+4),s=0;for(;r!==!1&&r!==-1;)n>s&&this.insertAt(e.slice(s,n)),this.insertAt(new It(e.slice(n+4,r),!0,t,i)),s=r+3,n=e.indexOf("<!--",s),r=n!==-1&&e.indexOf("-->",n+4);s<e.length&&this.insertAt(e.slice(s))}}lint(e=this.getAbsoluteIndex()){return super.lint(e,new RegExp(String.raw`<\s*(?:\/\s*)?(${this.name})\b`,"giu"))}}}}),Mo={};oe(Mo,{CategorytreeToken:()=>ri});var Hl,Ds,Dl,ri,Cd=L({"src/link/categorytree.ts"(){"use strict";Q(),Qe(),D(),Si(),Hl=[ze("")],ri=class extends(Dl=De){get type(){return"ext-inner"}constructor(e,t,i,n=[]){super(e,t,i,n),this.setAttribute("bracket",!1)}getTitle(){const e=this.firstChild.toString().trim(),t={halfParsed:!0},i=this.normalizeTitle(e,14,t);return i.valid&&i.ns===14?i:this.normalizeTitle(`Category:${e}`,0,t)}lint(e=this.getAbsoluteIndex()){{const t="no-ignored",i=F.lintConfig.getSeverity(t,"categorytree");if(i){const{link:n}=this;if(!n.valid||n.ns!==14)return[G(this,{start:e},t,"invalid-category",i)]}return super.lint(e,!1)}}},Ds=le(Dl),ri=re(Ds,0,"CategorytreeToken",Hl,ri),ne(Ds,1,ri)}}),Uo={};oe(Uo,{NowikiToken:()=>zo});var Gl,Vl,zo,Id=L({"src/nowiki/index.ts"(){"use strict";var e,On,i;Ve(),Q(),ye(),D(),vt(),Gl=ct(n=>new RegExp(String.raw`<\s*(?:/\s*)${n==="nowiki"?"":"?"}(${n})\b`,"giu")),Vl=new Set(["languages","section","templatestyles"]),zo=(i=class extends We{constructor(){super(...arguments);j(this,e)}get type(){return"ext-inner"}lint(r=this.getAbsoluteIndex()){{const{name:s,innerText:l}=this,{lintConfig:a}=F;let d="void-ext",u=a.getSeverity(d,s);if(u&&R(this,e,On).call(this)){const o=G(this,{start:r},d,F.msg("nothing-in",s),u);return a.computeEditInfo&&(o.suggestions=[ee(o)]),[o]}{d="invalid-json";const o=a.getSeverity(d);if(s==="templatedata"&&o)return Ka(l).map(({message:c,position:f,line:m,column:y})=>{u=o;const S=new fe(this,r),$=r+f,_=S.top+m-1,T=(m>1?0:S.left)+y-1;return{rule:d,message:c,severity:u,startIndex:$,endIndex:$,startLine:_,endLine:_,startCol:T,endCol:T}}).filter(c=>c!==!1)}return super.lint(r,Gl(s))}}getAttribute(r){return r==="invalid"?R(this,e,On).call(this):super.getAttribute(r)}},e=new WeakSet,On=function(){const{name:r,firstChild:{data:s}}=this;return Vl.has(r)&&!!s},i)}}),Ql,Gs,Jl,Nt,Ho=L({"src/tagPair/ext.ts"(){"use strict";Q(),ye(),D(),lr(),V(),rr(),hr(),Ql=[Yi()],Nt=class extends(Jl=ot){get type(){return"ext"}constructor(e,t,i,n,r=F.getConfig(),s=!1,l=[]){const a=e.toLowerCase(),d=new Zi(!t||/^\s/u.test(t)?t:` ${t}`,"ext-attrs",a,r,l),u={...r,ext:r.ext.filter(c=>c!==a),excludes:[...r.excludes],inExt:!0};let o;switch(a){case"pre":if(d.getAttr("format")!=="wikitext"){const{PreToken:c}=(vd(),se(po));o=new c(i,u,l);break}case"indicator":case"poem":case"ref":case"option":case"combooption":case"tab":case"tabs":case"poll":case"seo":case"langconvert":case"phonos":a==="poem"?u.excludes.push("heading"):a==="tab"&&(u.ext=u.ext.filter(c=>c!=="tabs")),o=new U(i,u,l);break;case"dynamicpagelist":{const{ParamTagToken:c}=(vo(),se(xo));o=new c(a,s,i,u,l);break}case"inputbox":{const{InputboxToken:c}=(Sd(),se(So));o=new c(a,s,i,u,l);break}case"references":{const{NestedToken:c}=(Ps(),se(zi));u.excludes.push("heading"),o=new c(i,s,["ref"],u,l);break}case"choose":{const{NestedToken:c}=(Ps(),se(zi));o=new c(i,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],u,l);break}case"combobox":{const{NestedToken:c}=(Ps(),se(zi));o=new c(i,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],u,l);break}case"gallery":{const{GalleryToken:c}=(Ad(),se(Lo));o=new c(i,u,l);break}case"imagemap":{const{ImagemapToken:c}=(_d(),se(Po));o=new c(i,u,l);break}case"hiero":{const{CommentedToken:c}=(Td(),se(qo));o=new c(i,u,l);break}case"categorytree":{const{CategorytreeToken:c}=(Cd(),se(Mo));o=new c(i,void 0,u,l);break}default:{const{NowikiToken:c}=(Id(),se(Uo));o=new c(i,u,l)}}o.setAttribute("name",a),o.type==="plain"&&(o.type="ext-inner"),super(e,d,o,n,r,l),this.seal("closed",!0)}lint(e=this.getAbsoluteIndex(),t){{const i=super.lint(e,t),{lintConfig:n}=F,r=new fe(this,e);if(this.name!=="nowiki"){const s=this.inHtmlAttrs(),l="parsing-order",a=s&&n.getSeverity(l,s===2?"ext":"templateInTable");a&&i.push(G(this,r,l,"ext-in-html",a))}if(this.name==="ref"){let s="var-anchor",l=n.getSeverity(s,"ref");l&&this.closest("heading-title")&&i.push(G(this,r,s,"variable-anchor",l)),s="nested-link",l=n.getSeverity(s,"ref"),l&&this.closest("link-text,ext-link-text")&&i.push(G(this,r,s,"ref-in-link",l))}return i}}},Gs=le(Jl),Nt=re(Gs,0,"ExtToken",Ql,Nt),ne(Gs,1,Nt)}}),br,Do=L({"src/tag/index.ts"(){"use strict";var e,t,i,n;Q(),Ie(),V(),D(),br=(n=class extends U{constructor(s,l,a,d,u){super(void 0,d,u);j(this,e);j(this,t);j(this,i);this.insertAt(l),E(this,e,a),E(this,t,s)}get closing(){return b(this,e)}toString(s){return`<${b(this,e)?"/":""}${b(this,t)}${super.toString(s)}${this.selfClosing?"/":""}>`}text(s=""){const{closing:l}=this;return`<${l&&!s?"/":""}${b(this,t)}${l?"":super.text()}${s}>`}getAttribute(s){return s==="padding"?b(this,t).length+(b(this,e)?2:1):super.getAttribute(s)}findMatchingTag(){return ht(b(this,i),()=>{const{type:s,name:l,parentNode:a,closing:d,selfClosing:u}=this;let o=!1,c=!1;if(s==="html"){const{html:[,_,T]}=this.getAttribute("config");o=T.includes(l),c=_.includes(l)}if(o||c&&u)return this;if(!a)return;const{childNodes:f}=a,m=f.indexOf(this),y=d?f.slice(0,m).reverse():f.slice(m+1),S=[this],{rev:$}=pe;for(const _ of y)if(!(!_.is(s)||s==="html"&&(_.name!==l||c&&_.selfClosing)))if(b(_,e)===d){if(s==="tvar")return;S.push(_)}else{const T=S.pop();if(T===this)return _;F.viewOnly&&(E(T,i,[$,_]),E(_,i,[$,T]))}if(F.viewOnly)for(const _ of S)E(_,i,[$,void 0])},s=>{E(this,i,s),s[1]&&s[1]!==this&&E(s[1],i,[pe.rev,this])})}print(){return super.print({pre:`<${b(this,e)?"/":""}${b(this,t)}`,post:`${this.selfClosing?"/":""}>`})}json(s,l=this.getAbsoluteIndex()){{const a=super.json(void 0,l);return a.closing=b(this,e),a}}},e=new WeakMap,t=new WeakMap,i=new WeakMap,n)}}),Xl,Vs,Kl,Ze,Nd=L({"src/tag/tvar.ts"(){"use strict";xt(),Le(),Do(),mt(),Xl=[it(),Ce],Ze=class extends(Kl=br){get type(){return"tvar"}constructor(e,t,i,n,r){const s=new Ge(t,"tvar-name",n,r);super(e,s,i,n,r)}},Vs=le(Kl),Ze=re(Vs,0,"TvarToken",Xl,Ze),ne(Vs,1,Ze)}}),Go={};oe(Go,{TranslateToken:()=>Vo});var Vo,Ld=L({"src/tagPair/translate.ts"(){"use strict";var e,Qo,i;V(),rr(),mt(),Nd(),Vo=(i=class extends ot{constructor(r,s,l,a=[]){const d=new Ge(r,"translate-attr",l,a);s=s==null?void 0:s.replace(/<tvar(\|[^>]+)>([\s\S]*?)<\/>/gu,(o,c,f)=>(new Ze("tvar",c,!1,l,a),new Ze("","",!0,l,a),`\0${a.length-2}n${f}\0${a.length}n`)).replace(/<(tvar)(\s+name\s*=(?:\s*(?:(["'])[\s\S]*?\3|[^"'\s>]+))?\s*)>([\s\S]*?)<\/(tvar)(\s*)>/giu,(o,c,f,m,y,S,$)=>(new Ze(c,f,!1,l,a),new Ze(S,$,!0,l,a),`\0${a.length-2}n${y}\0${a.length}n`));const u=new U(s,l,a);u.type="translate-inner";super("translate",d,u,"translate",l,a);j(this,e);this.seal("closed",!0)}get type(){return"translate"}get selfClosing(){return!1}toString(r){return r?this.lastChild.toString(!0):super.toString()}text(){return this.lastChild.text()}print(){return`<span class="wpb-ext"><translate${R(this,e,Qo).call(this)?'<span class="wpb-ext-attrs"> <span class="wpb-ext-attr"><span class="wpb-attr-key">nowrap</span></span></span>':""}>${this.lastChild.print({class:"ext-inner"})}</translate></span>`}},e=new WeakSet,Qo=function(){return this.firstChild.toString()===" nowrap"},i)}}),Jo={};oe(Jo,{parseCommentAndExt:()=>ki});var Qs,Yl,Fi,Zl,Js,ki,is=L({"parser/commentAndExt.ts"(){"use strict";Ve(),ve(),fd(),Bt(),md(),Ho(),Bo(),Qs="<onlyinclude>",Yl="</onlyinclude>",{length:Fi}=Qs,Zl=[!1,!0].map(e=>{const t=e?"includeonly":"(?:no|only)include",i=e?"noinclude":"includeonly";return ct(n=>new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${t}(?:\s[^>]*)?/?>|</${t}\s*>|<(${n})(\s[^>]*?)?(?:/>|>([\s\S]*?)</(${"\\1"}\s*)>)|<(${i})(\s[^>]*?)?(?:/>|>([\s\S]*?)(?:</(${i}\s*)>|$))`,"giu"))}),Js=e=>{const t=e.indexOf(Qs);return{i:t,j:e.indexOf(Yl,t+Fi)}},ki=(e,t,i,n)=>{if(n){let{i:d,j:u}=Js(e);if(d!==-1&&u!==-1){let o="";const c=f=>{new Oe(f,t,i),o+=`\0${i.length-1}n`};for(;d!==-1&&u!==-1;){const f=`\0${i.length}g`;new ei(e.slice(d+Fi,u),t,i),d>0&&c(e.slice(0,d)),o+=f,e=e.slice(u+Fi+1),{i:d,j:u}=Js(e)}return e&&c(e),o}}const{ext:r}=t;let s=r,l=t;if(r.includes("translate")){const{TranslateToken:d}=(Ld(),se(Go)),u=[];s=r.filter(o=>o!=="translate"&&o!=="tvar"),l={...t,ext:s},e=e.replace(/<nowiki>[\s\S]*?<\/nowiki>/giu,o=>(u.push(o),`\0${u.length-1}`)).replace(/<translate( nowrap)?>([\s\S]*?)<\/translate>/gu,(o,c,f)=>{const m=i.length;return new d(c,f&&Pe(f,u),l,i),`\0${m}g`}),e=Pe(e,u)}const a=Zl[n?1:0](s.join("|"));return a.lastIndex=0,a.test(e)?e.replace(a,(d,u,o,c,f,m,y,S,$)=>{const _=i.length;let T="n";if(u)T="e",new Nt(u,o,c,f,l,m,i);else if(d.startsWith("<!--")){T="c";const g=d.endsWith("-->");new It(Pe(d,i,1).slice(4,g?-3:void 0),g,t,i)}else m?new ti(m,y&&Pe(y,i,1),S&&Pe(S,i,1),$,t,i):new Oe(d,t,i,!0);return`\0${_}${T}`}):e}}}),ea,ta,ia,sa,Xs,na,li,Fd=L({"src/tag/html.ts"(){"use strict";var e,t;Q(),ye(),lr(),D(),Do(),ea=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),ta=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"]),ia=new Set(["strike","big","center","font","tt"]),sa=[Yi()],li=(t=class extends(na=br){constructor(n,r,s,l,a,d){super(n,r,s,a,d);j(this,e);this.setAttribute("name",n.toLowerCase()),E(this,e,l)}get type(){return"html"}get selfClosing(){return b(this,e)}text(){const{closing:n,selfClosing:r,name:s}=this,{html:[,,l]}=this.getAttribute("config");return l.includes(s)?n&&s!=="br"?"":super.text("/"):super.text(r&&!n?"/":"")}lint(n=this.getAbsoluteIndex(),r){{const s=super.lint(n,r),{name:l,parentNode:a,closing:d,selfClosing:u}=this,o=new fe(this,n),{lintConfig:c}=F,{computeEditInfo:f,fix:m}=c,y=this.inTableAttrs();let S="h1",$=c.getSeverity(S,"html");if($&&l==="h1"&&!d){const p=G(this,o,S,"<h1>",$);f&&(p.suggestions=[{desc:"h2",range:[n+2,n+3],text:"2"}]),s.push(p)}if(S="parsing-order",$=y&&c.getSeverity(S,y===2?"html":"templateInTable"),$){const p=G(this,o,S,"html-in-table",$);f&&y===2&&(p.suggestions=[ee(p)]),s.push(p)}if(S="obsolete-tag",$=c.getSeverity(S,l),$&&ia.has(l)&&s.push(G(this,o,S,"obsolete-tag",$)),S="bold-header",$=c.getSeverity(S,l),$&&(l==="b"||l==="strong")&&this.isInside("heading-title")){const p=G(this,o,S,"bold-in-header",$);f&&(p.suggestions=[ee(p)]),s.push(p)}const{html:[,_,T]}=this.getAttribute("config"),g=T.includes(l),h=_.includes(l),x=!g&&!h;if(S="unmatched-tag",d&&(u||g)||u&&x){if($=c.getSeverity(S,d?"both":"selfClosing"),$){const p=G(this,o,S,d?"closing-and-self-closing":"invalid-self-closing",$);if(f||m){const k=Yn(n),v={desc:F.msg("no-self-closing"),range:[p.endIndex-2,p.endIndex-1],text:""};h?f&&(p.suggestions=[k,v]):d?p.fix=g?k:v:f&&(p.suggestions=[v,tt(p.endIndex,`></${l}>`,-2)])}s.push(p)}}else if(!this.findMatchingTag()){const p=G(this,o,S,d?"unmatched-closing":"unclosed-tag"),k=this.closest("magic-word");if(k&&ea.has(k.name))$=c.getSeverity(S,"conditional");else if(d)$=c.getSeverity(S,"closing"),p.suggestions=[ee(p)];else{$=c.getSeverity(S,"opening");const v=a==null?void 0:a.childNodes;ta.has(l)&&(v!=null&&v.slice(0,v.indexOf(this)).some(w=>w.is("html")&&w.name===l&&!w.findMatchingTag())&&(p.suggestions=[tt(n+1,"/")]),this.isInside("heading-title")&&(p.rule="format-leakage",$=c.getSeverity("format-leakage",l)))}$&&(p.severity=$,s.push(p))}return s}}getAttribute(n){return n==="invalid"?this.inTableAttrs()===2:super.getAttribute(n)}json(n,r=this.getAbsoluteIndex()){{const s=super.json(void 0,r);return s.selfClosing=b(this,e),s}}},e=new WeakMap,t),Xs=le(na),li=re(Xs,0,"HtmlToken",sa,li),ne(Xs,1,li)}}),Xo={};oe(Xo,{parseHtml:()=>Ko});var ra,Ko,Ed=L({"parser/html.ts"(){"use strict";hr(),Fd(),ra=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,Ko=(e,t,i)=>{var l;const{html:n}=t;(l=t.htmlElements)!=null||(t.htmlElements=new Set([...n[0],...n[1],...n[2]]));const r=e.split("<");let s=r.shift();for(const a of r){const d=ra.exec(a),u=d==null?void 0:d[2],o=u==null?void 0:u.toLowerCase();if(!d||!t.htmlElements.has(o)){s+=`<${a}`;continue}const[,c,,f="",m,y]=d,{length:S}=i,$=new Zi(f,"html-attrs",o,t,i),_=$.hasAttr("itemprop");if(o==="meta"&&!(_&&$.hasAttr("content"))||o==="link"&&!(_&&$.hasAttr("href"))){s+=`<${a}`,i.length=S;continue}s+=`\0${i.length}x${y}`,new li(u,$,c==="/",m==="/>",t,i)}return s}}}),la,aa,Ks,oa,Lt,Yo=L({"src/table/base.ts"(){"use strict";Ie(),lr(),D(),V(),mt(),hr(),la=e=>{const t=e.childNodes.map(n=>n.type==="text"?n.data.replace(/\|{1,2}/gu,({length:r})=>`{{${"!".repeat(r)}}}`):n.toString()).join(""),{childNodes:i}=F.parseWithRef(t,e,2);pe.run(()=>{e.safeReplaceChildren(i)})},aa=[Yi(1)],Lt=class extends(oa=U){constructor(e,t,i,n,r,s=[],l){super(void 0,r,s,l),this.append(new Ge(t,"table-syntax",r,s),new Zi(n,"table-attrs",i,r,s))}escape(){for(const e of this.childNodes)e instanceof Ge?la(e):e.escape()}},Ks=le(oa),Lt=re(Ks,0,"TableBaseToken",aa,Lt),ne(Ks,1,Lt)}}),ua,Ys,_e,Ei,Vt,Qt,Vi,Zo=L({"src/table/td.ts"(){"use strict";Q(),ye(),nr(),D(),V(),Yo(),Vi=class extends(Ys=Lt,ua=[Xi(!1)],Ys){constructor(e,t,i,n=[]){var a;let r=/\||\0\d+!\x7F/u.exec(t!=null?t:""),s=r?t.slice(0,r.index):"";/\[\[|-\{/u.test(s)&&(r=null,s=""),super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",s,i,n),ne(Ei,5,this),Ye(this,Vt),Ye(this,_e,""),r&&([id(this,_e)._]=r);const l=new U(t==null?void 0:t.slice(((a=r==null?void 0:r.index)!=null?a:NaN)+xe(this,_e).length),i,n);l.type="td-inner",l.setAttribute("stage",4),this.insertAt(l)}get type(){return"td"}get rowspan(){return this.getAttr("rowspan")}get colspan(){return this.getAttr("colspan")}get subtype(){return $n(this,Vt,Qt).call(this).subtype}afterBuild(){xe(this,_e).includes("\0")&&Ne(this,_e,this.buildFromStr(xe(this,_e),0)),super.afterBuild()}toString(e){const{childNodes:[t,i,n]}=this;return t.toString(e)+i.toString(e)+xe(this,_e)+n.toString(e)}text(){const{childNodes:[e,t,i]}=this;return e.text()+t.text()+xe(this,_e)+i.text()}getGaps(e){return e===1?xe(this,_e).length:0}lint(e=this.getAbsoluteIndex(),t){{const i=super.lint(e,t),n=new fe(this,e+this.getRelativeIndex(this.length-1)),r="pipe-like",{lintConfig:s}=F,{computeEditInfo:l,fix:a}=s,d=["td","double"].map(u=>s.getSeverity(r,u));for(const u of this.lastChild.childNodes)if(u.type==="text"){const{data:o}=u;if(o.includes("|")){const c=o.includes("||"),f=d[c?1:0];if(f){const m=Y(u,n,r,"pipe-in-table",f);if(l||a)if(c){const y={caption:"|+",td:"|",th:"!"}[this.subtype];m.fix=qe(m,"newline",o.replace(/\|\|/gu,`
|
|
17
|
-
${y}`))}else l&&(m.suggestions=[tr(m.startIndex,
|
|
18
|
-
`)}getAttr(e){{const t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}}escape(){super.escape(),this.childNodes[1].toString()&&(xe(this,_e)||Ne(this,_e,"{{!}}")),xe(this,_e)==="|"&&Ne(this,_e,"{{!}}")}print(){{const{childNodes:[e,t,i]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${xe(this,_e)}${i.print()}</span>`}}json(e,t=this.getAbsoluteIndex()){{const i=super.json(void 0,t),{rowspan:n,colspan:r}=this;return Object.assign(i,{subtype:this.subtype},n!==1&&{rowspan:n},r!==1&&{colspan:r}),i}}},Ei=le(Ys),_e=new WeakMap,Vt=new WeakSet,Qt=function(){var e;const t=this.firstChild.text(),i=t.slice(-1);let n="td";if(i==="!"?n="th":i==="+"&&(n="caption"),this.isIndependent())return{subtype:n};const{previousSibling:r}=this;return{...$n(e=r,Vt,Qt).call(e)}},Qt=re(Ei,17,"#getSyntax",ua,Vt,Qt),Qn(Ei,Vi)}}),yr,eu=L({"src/table/trBase.ts"(){"use strict";Q(),D(),Yo(),Zo(),yr=class extends Lt{lint(e=this.getAbsoluteIndex(),t){{const i=super.lint(e,t),n=this.childNodes.find(({type:a})=>a==="table-inter");if(!n)return i;const r=hi(n),s="fostered-content",l=r&&F.lintConfig.getSeverity(s,r===2?void 0:"transclusion");if(l){const a=Y(n,{start:e},s,"content-outside-table",l);a.startIndex++,a.startLine++,a.startCol=0,i.push(a)}return i}}getRowCount(){return Number(this.childNodes.some(e=>e instanceof Vi&&e.isIndependent()&&!e.firstChild.text().endsWith("+")))}}}}),da,ca,Zs,ji,Hi,jd=L({"src/table/index.ts"(){"use strict";Q(),Ie(),ye(),nr(),D(),eu(),mt(),da=class extends Array{},Hi=class extends(Zs=yr,ca=[Xi(!1)],Zs){constructor(e,t,i,n){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,e,"table",t,i,n,{}),ne(ji,5,this)}get type(){return"table"}get closed(){return this.lastChild.is("table-syntax")}lint(e=this.getAbsoluteIndex(),t){{const i=super.lint(e,t),n=new fe(this,e),r=["unclosed-table","table-layout"],s=r.map(l=>F.lintConfig.getSeverity(l));if(s[0]&&!this.closed&&i.push(Y(this.firstChild,n,r[0],"unclosed-table",s[0])),s[1]){const l=this.getLayout(),{length:a}=l;if(a>1){let d=1,
|
|
19
|
-
|}`,t){pe.run(()=>{const i=new Ge(t?e:void 0,"table-syntax",this.getAttribute("config"),this.getAttribute("accum"));super.insertAt(i)})}getLayout(e){{const t=this.getAllRows(),{length:i}=t,n=da.from(Wu(i,()=>[]));for(let r=0;r<n.length;r++){const s=n[r];let l=0,a=0,d;for(const
|
|
13
|
+
`)||(e=`${e.slice(0,k)}\0${i.length}h${e.slice(h)}`,m=k+4+String(i.length).length,new _t(O[1].length,O.slice(2),t,i)))}}else if(g==="|"||C)m=h+1,a(e,v,A,h),g==="|"&&v.push([]),x.pos=m,x.findEqual=g==="|",s.push(x);else if(g.startsWith("}}")){const B=g.slice(0,Math.min(p.length,3)),q=p.length-B.length,{length:O}=i;m=h+B.length,a(e,v,A,h);let P=!1,I="t";if(B.length===3){const W=v.map(X=>X.join("=")),J=W.length>1&&Te(W[1]).trim();new si(W,t,i),J&&J.endsWith(":")&&r.includes(J.slice(0,-1).toLowerCase())&&(I="s")}else try{new at(v[0][0],v.slice(1),t,i),I=Rs(v[0][0])}catch(W){if(W instanceof SyntaxError&&W.message==="Invalid template name")P=!0;else throw W}P||(e=`${e.slice(0,k+q)}\0${O}${I}${e.slice(m)}`,m=k+q+3+String(O).length,q>1?s.push({0:p.slice(0,q),index:k,pos:k+q,parts:[[]]}):q===1&&e[k-1]==="-"&&s.push({0:"-{",index:k-1,pos:k+1,parts:[[]]}))}else m=h+g.length,g.startsWith("{")&&(f.pos=m,f.parts=[[]]),s.push(..."0"in x?[x]:[],f);let N=s[s.length-1];if(u&&o+e.length<m)for(u=!1;(T=N==null?void 0:N[0])!=null&&T.startsWith("{");)s.pop(),N=s[s.length-1];c=js(n+(u?Fs:"")+(N?`|${Al[N[0][0]]}${N.findEqual?"|=":""}`:"")),c.lastIndex=m,f=c.exec(e)}return Pe(e,l)}}}),So={};oe(So,{InputboxToken:()=>ko});var ko,Sd=L({"src/multiLine/inputbox.ts"(){"use strict";is(),fr(),vo(),ko=class extends pr{constructor(e,t,i,n,r=[]){const s=Symbol("InputboxToken"),l=n.excludes.includes("heading")?n:{...n,excludes:[...n.excludes,"heading"]},{length:a}=r;r.push(s),i&&(i=ki(i,l,r,t)),i&&(i=ts(i,l,r)),r.splice(a,1),super(e,t,i,l,r,{})}}}}),zi={};oe(zi,{NestedToken:()=>Ao});var _l,Tl,Ao,Ps=L({"src/nested.ts"(){"use strict";var e,t,i;Q(),ye(),is(),fr(),D(),V(),Ho(),Bt(),_l=new Set(["comment","include","arg","template","magic-word"]),Tl=[!1,!0].map(n=>{const r=n?"includeonly":"noinclude";return new RegExp(String.raw`^(?:<${r}(?:\s[^>]*)?/?>|</${r}\s*>)$`,"iu")}),Ao=(i=class extends U{constructor(r,s,l,a,d=[]){if(typeof s=="boolean"){const o=Symbol("NestedToken"),{length:u}=d;d.push(o),r&&(r=ki(r,a,d,s)),r&&(r=ts(r,a,d)),d.splice(u,1)}else r&&(r=r.replace(s,(o,u,c,f,m)=>{const y=`\0${d.length+1}e`;return new Nt(u,c,f,m,a,!1,d),y}));r&&(r=r.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(o,u,c)=>(new Oe(c,a,d),`${u}\0${d.length}n`)));super(r,a,d);j(this,e);j(this,t);E(this,e,[...l]),E(this,t,s)}get type(){return"ext-inner"}lint(r=this.getAbsoluteIndex(),s){{const l=super.lint(r,s),a="no-ignored",{lintConfig:d}=F,o=d.getSeverity(a,this.name);if(!o)return l;const u=new fe(this,r),c=typeof b(this,t)=="boolean"?Tl[b(this,t)?1:0]:/^<!--[\s\S]*-->$/u;return[...l,...this.childNodes.filter(f=>{const{type:m,name:y}=f;if(m==="ext")return!b(this,e).includes(y);if(_l.has(m))return!1;const S=f.toString().trim();return S&&!c.test(S)}).map(f=>{const m=Y(f,u,a,F.msg("invalid-content",this.name),o);return d.computeEditInfo&&(m.suggestions=[ee(m),Zn(m,f.toString())]),m})]}}},e=new WeakMap,t=new WeakMap,i)}});function Cl(e,t,i,n,r){t=Te(t).trim();let s=t.replace(e==="link"?/\0\d+[tq]\x7F/gu:/\0\d+t\x7F/gu,"").trim();switch(e){case"width":return!s&&!!t||/^(?:\d+x?|\d*x\d+)(?:\s*px)?$/u.test(s);case"link":{const l=n==="gallery-image";if(s){if($o(i.protocol).test(s))return _o(i.protocol).test(s)?t:l;s.startsWith("[[")&&s.endsWith("]]")&&(s=s.slice(2,-2))}else return t;const a=F.normalizeTitle(s,0,!1,i,{halfParsed:r,decode:!0,selfLink:!0,page:""});return a.valid?a:l}case"lang":return(n==="svg"||n==="svgz")&&!/[^a-z\d-]/u.test(s);case"alt":case"class":case"manualthumb":return!0;case"page":return(n==="djvu"||n==="djv"||n==="pdf")&&Number(s)>0;default:return!!s&&!isNaN(s)}}var $o,_o,Il,Nl,Ll,Os,Fl,ni,kd=L({"src/imageParameter.ts"(){"use strict";var e,t,To,r;Ve(),ve(),Q(),Ue(),Ie(),Le(),D(),V(),$o=ct(s=>new RegExp(String.raw`^(?:${s}|//|\0\d+m\x7F)`,"iu")),_o=ct(s=>new RegExp(String.raw`^(?:(?:${s}|//)${Ft}|\0\d+m\x7F)${Et}$`,"iu")),Il=ct(s=>new RegExp(String.raw`^(\s*(?!\s))${s.replace("$1","(.*)")}${s.endsWith("$1")?`(?=$|
|
|
14
|
+
)`:""}(\s*)$`,"u")),Nl=s=>{if(s)s.startsWith("//")&&(s=`https:${s}`);else return s;return new URL(s).href},Ll=[Ce],ni=(r=class extends(Fl=U){constructor(l,a,d,o,u){var s=(...n)=>(super(...n),j(this,t),j(this,e,""),this);let c;const f=Object.entries(o.img).map(([y,S])=>[y,S,Il(y)]),m=f.find(([,y,S])=>(c=S.exec(l),c&&(c.length!==4||Cl(y,c[2],o,y==="link"?d:a,!0)!==!1)));if(m&&c){c.length===3?(s(void 0,o,u),E(this,e,l)):(s(c[2],o,u,{}),E(this,e,c[1]+m[0]+c[3])),this.setAttribute("name",m[1]),m[1]==="alt"&&this.setAttribute("stage",$e-1);return}s(l,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 thumb(){return this.name==="manualthumb"?this.normalizeTitle(`File:${super.text().trim()}`,6,{page:""}):void 0}get link(){{if(this.name!=="link")return;const l=super.text().trim();return pe.run(()=>{var o;const a=new U(l,this.getAttribute("config"));if(a.parseOnce(0,this.getAttribute("include")).parseOnce(),/^\0\d+m\x7F/u.test(a.firstChild.toString()))return l;const d=Cl("link",l,this.getAttribute("config"),(o=this.parentNode)==null?void 0:o.type);return d===!0?void 0:d},F)}}afterBuild(){var l;(l=this.parentNode)!=null&&l.is("gallery-image")&&!Qa.has(this.name)&&this.setAttribute("name","invalid"),super.afterBuild()}toString(l){return b(this,e)?b(this,e).replace("$1",super.toString(l)):super.toString(l)}text(){return b(this,e)?b(this,e).replace("$1",super.text()).trim():super.text().trim()}isPlain(){return this.name==="caption"||this.name==="alt"}getAttribute(l){return l==="invalid"?this.name==="invalid":l==="padding"?Math.max(0,b(this,e).indexOf("$1")):super.getAttribute(l)}lint(l=this.getAbsoluteIndex(),a){{const d=super.lint(l,a),{lintConfig:o}=F,{computeEditInfo:u,fix:c}=o,{link:f,name:m}=this,y=m==="width"&&this.getValue();if(m==="invalid"||y&&y.endsWith("px")){const S="invalid-gallery",$=o.getSeverity(S,"parameter");if($){const _=G(this,{start:l},S,"invalid-image-parameter",$);(u||c)&&(_.fix=y?ee(_,0,y):ee(_,-1)),d.push(_)}}else if(m==="link"){if(f===void 0){const S="invalid-gallery",$=o.getSeverity(S,"link");$&&d.push(G(this,{start:l},S,"invalid-gallery-link",$))}else if(typeof f=="string"){const S="invalid-url",$=o.getSeverity(S);if($&&!this.querySelector("magic-word"))try{Nl(f)}catch{d.push(G(this,{start:l},S,"invalid-url",$))}}else if(f.encoded){const S="url-encoding",$=o.getSeverity(S,"file");if($){const _=G(this,{start:l},S,"unnecessary-encoding",$);(u||c)&&(_.fix=Kn(_,this)),d.push(_)}}}else if(m==="manualthumb"){const S="invalid-gallery",$=o.getSeverity(S,"thumb");if($&&!this.querySelector("arg,magic-word,template")){const{valid:_,ns:T,extension:g}=this.thumb;(!_||T!==6||!Di.has(g))&&d.push(G(this,{start:l},S,"invalid-thumb",$))}}return d}}getValue(){return this.name==="invalid"?this.text():R(this,t,To).call(this)||super.text()}print(){return b(this,e)?`<span class="wpb-image-parameter${this.name==="invalid"?" wpb-invalid":""}">${b(this,e).replace("$1",`<span class="wpb-image-caption">${Rt(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}},e=new WeakMap,t=new WeakSet,To=function(){return b(this,e)&&!b(this,e).includes("$1")},r),Os=le(Fl),ni=re(Os,0,"ImageParameterToken",Ll,ni),ne(Os,1,ni)}}),Bs,El,jl,qs,Ws,Rl,Ms,mr,Co=L({"src/link/file.ts"(){"use strict";Q(),Ue(),ye(),D(),Si(),kd(),Bs=new Map([["manualthumb","Thumb"],["frameless","Frameless"],["framed","Frame"],["thumbnail","Thumb"]]),El=new Set(["arg"]),jl=new Set(["template","magic-word"]),qs=new Set(["left","right","center","none"]),Ws=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),Rl=e=>{if(e===void 0)return[];const t=/-\{|\}-|\|/gu,i=[];let n=t.exec(e),r=0,s=0;for(;n;){const{0:l,index:a}=n;l!=="|"?r+=l==="-{"?1:-1:r===0&&(i.push(e.slice(s,a)),{lastIndex:s}=t),n=t.exec(e)}return i.push(e.slice(s)),i},Ms=(e,t)=>e.filter(({childNodes:i})=>!i.some(n=>n.text().trim()&&t.has(n.type))),mr=class extends De{get type(){return"file"}get extension(){return this.getAttribute("title").extension}constructor(e,t,i,n=[],r="|",s){super(e,void 0,i,n,r);const{extension:l}=this.getTitle(!0,!0);this.safeAppend(Rl(t).map(a=>new ni(a,l,s,i,n)))}lint(e=this.getAbsoluteIndex(),t){var i;{const n=super.lint(e,t),r=Ms(this.getAllArgs(),El),s=[...new Set(r.map(({name:p})=>p))],l=s.filter(p=>Bs.has(p)),a=s.filter(p=>qs.has(p)),d=s.filter(p=>Ws.has(p)),[o]=l,u=o==="framed"||o==="manualthumb",c=new fe(this,e),{lintConfig:f}=F,{computeEditInfo:m,fix:y}=f,{ns:S,extension:$}=this.getAttribute("title"),{firstChild:_}=this;let T="nested-link",g=f.getSeverity(T,"file");if(g&&Di.has($)&&this.isInside("ext-link-text")&&((i=this.getValue("link"))==null?void 0:i.trim())!==""){const p=G(this,c,T,"link-in-extlink",g);if(m||y){const k=this.getArg("link");if(k){const v=e+k.getRelativeIndex();p.fix={desc:F.msg("delink"),range:[v,v+k.toString().length],text:"link="}}else p.fix=Ji(p.endIndex-2,"delink","|link=")}n.push(p)}if(T="invalid-gallery",g=f.getSeverity(T,"extension"),g&&S===6&&!$&&!_.querySelector("arg,magic-word,template")&&n.push(G(this,c,T,"missing-extension",g)),g=f.getSeverity(T,"parameter"),g&&u)for(const p of r.filter(({name:k})=>k==="width")){const k=Y(p,c,T,"invalid-image-parameter",g);(m||y)&&(k.fix=ee(k,-1)),n.push(k)}if(r.length===s.length&&l.length<2&&a.length<2&&d.length<2)return n;T="no-duplicate";const h=["unknownImageParameter","imageParameter"].map(p=>f.getSeverity(T,p)),x=(p,k,v,w=!0)=>p.map(A=>{if(g=h[Number(typeof w=="function"?w(A):w)],!g)return!1;const C=Y(A,c,T,F.msg(`${k}-image-parameter`,v),g);return m&&(C.suggestions=[ee(C,-1)]),C}).filter(A=>A!==!1);for(const p of s){if(p==="invalid"||p==="width"&&u)continue;const k=p==="caption";let v=r.filter(({name:w})=>w===p);if(k&&(v=[...v.slice(0,-1).filter(w=>w.text()),...v.slice(-1)]),v.length>1){let w=!k||!$||Di.has($);if(k&&w){const A=Ms(v,jl);w=A.length>1&&(C=>A.includes(C))}Array.prototype.push.apply(n,x(v,"duplicate",p,w))}}return l.length>1&&Array.prototype.push.apply(n,x(r.filter(({name:p})=>Bs.has(p)),"conflicting","frame")),a.length>1&&Array.prototype.push.apply(n,x(r.filter(({name:p})=>qs.has(p)),"conflicting","horizontal-alignment")),d.length>1&&Array.prototype.push.apply(n,x(r.filter(({name:p})=>Ws.has(p)),"conflicting","vertical-alignment")),n}}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 i=super.json(void 0,t),{extension:n}=this;return n&&(i.extension=n),i}}}}}),Pl,Us,Ol,Tt,Io=L({"src/link/galleryImage.ts"(){"use strict";var e,En,i;Q(),Ue(),Qe(),D(),V(),Co(),Pl=[ze("")],Tt=(i=class extends(Ol=mr){constructor(r,s,l,a,d=[]){let o;if(l!==void 0){const{length:c}=d;o=new U(l,a,d);for(let f=0;f<$e-1;f++)o.parseOnce();d.splice(c,1)}const u=`${r}-image`;super(s,o==null?void 0:o.firstChild.toString(),a,d,void 0,u);j(this,e);je(this,"privateType","imagemap-image");this.setAttribute("bracket",!1),this.privateType=u,this.seal("privateType",!0)}get type(){return this.privateType}getTitle(r){const s=this.type==="imagemap-image";return this.normalizeTitle(this.firstChild.toString(),s?0:6,{halfParsed:!0,temporary:r,decode:!s,page:""})}lint(r=this.getAbsoluteIndex(),s){{const l=super.lint(r,s),a="invalid-gallery",{lintConfig:d}=F,o=d.getSeverity(a,"image");if(o&&R(this,e,En).call(this)){const u=G(this,{start:r},a,"invalid-gallery",o);d.computeEditInfo&&(u.suggestions=[Ji(r,"prefix","File:")]),l.push(u)}return l}}getAttribute(r){return r==="invalid"?R(this,e,En).call(this):super.getAttribute(r)}},e=new WeakSet,En=function(){return this.getAttribute("title").ns!==6},i),Us=le(Ol),Tt=re(Us,0,"GalleryImageToken",Pl,Tt),ne(Us,1,Tt)}}),Gi,No=L({"src/nowiki/commentLine.ts"(){"use strict";Bt(),Gi=class extends Oe{}}}),Lo={};oe(Lo,{GalleryToken:()=>Fo});var Fo,Ad=L({"src/multiLine/gallery.ts"(){"use strict";var e,Eo,jn,n;Q(),D(),gr(),Io(),No(),Fo=(n=class extends es{constructor(s,l,a=[]){var d;super(void 0,l,a,{});j(this,e);for(const o of(d=s==null?void 0:s.split(`
|
|
15
|
+
`))!=null?d:[]){const u=/^([^|]+)(?:\|(.*))?/u.exec(o);if(!u){super.insertAt(o.trim()?new Gi(o,l,a):o);continue}const[,c,f]=u;R(this,e,Eo).call(this,c)?super.insertAt(new Tt("gallery",c,f,l,a)):super.insertAt(new Gi(o,l,a))}}get widths(){return R(this,e,jn).call(this,"widths")}get heights(){return R(this,e,jn).call(this,"heights")}lint(s=this.getAbsoluteIndex(),l){{const{top:a,left:d}=this.getRootNode().posFromIndex(s),o=[],u="no-ignored",{lintConfig:c}=F,f=["Image","NoImage","Comment"].map(m=>c.getSeverity(u,`gallery${m}`));for(let m=0;m<this.length;m++){const y=this.childNodes[m],S=y.toString(),{length:$}=S,_=S.trim(),{type:T}=y,g=a+m,h=m?0:d;if(y.setAttribute("aIndex",s),T==="noinclude"&&_&&!/^<!--.*-->$/u.test(_)){let[x]=f;if(_.startsWith("|")?[,x]=f:(_.startsWith("<!--")||_.endsWith("-->"))&&([,,x]=f),x){const p=s+$,k={rule:u,message:F.msg("invalid-content","gallery"),severity:x,startIndex:s,endIndex:p,startLine:g,endLine:g,startCol:h,endCol:h+$};c.computeEditInfo&&(k.suggestions=[ee(k),Zn(k,S)]),o.push(k)}}else if(T!=="noinclude"&&T!=="text"){const x=y.lint(s,l);x.length>0&&Array.prototype.push.apply(o,x)}s+=$+1}return o}}json(s,l=this.getAbsoluteIndex()){{const a=super.json(void 0,l);return Object.assign(a,{widths:this.widths,heights:this.heights}),a}}},e=new WeakSet,Eo=function(s){return this.normalizeTitle(s,6,{halfParsed:!0,temporary:!0,decode:!0,page:""}).valid},jn=function(s){var l,a;{const d=(l=this.parentNode)==null?void 0:l.getAttr(s),o=typeof d=="string"&&((a=/^(\d+)\s*(?:px)?$/u.exec(d))==null?void 0:a[1]);return o&&Number(o)||120}},n)}}),xr,jo=L({"src/link/index.ts"(){"use strict";Ve(),Q(),D(),Si(),xr=class extends De{get type(){return"link"}get innerText(){return this.length>1?this.lastChild.text():mi(this.firstChild.text().replace(/^\s*:?/u,""))}lint(e=this.getAbsoluteIndex(),t){{const i=super.lint(e,t),n="nested-link",{lintConfig:r}=F,s=r.getSeverity(n);if(s&&this.isInside("ext-link-text")){const l=G(this,{start:e},n,"link-in-extlink",s);(r.computeEditInfo||r.fix)&&(l.fix=qe(l,"delink",this.innerText)),i.push(l)}return i}}}}}),Bl,ql,bi,vr=L({"src/magicLink.ts"(){"use strict";var e,t,Rn,n;Q(),ve(),ye(),D(),V(),Bl=String.raw`(?:[${et}\t]| |�*160;|&#[xX]0*[aA]0;)`,ql=new RegExp(`${Bl}+`,"gu"),bi=(n=class extends U{constructor(s,l="free-ext-link",a=F.getConfig(),d){super(s,a,d,{});j(this,t);j(this,e);E(this,e,l)}get type(){return b(this,e)}get innerText(){const s=new Map([["!","|"],["=","="]]);let l=pt(this.childNodes.map(a=>{const{type:d}=a,o=String(a.name);return d==="magic-word"&&s.has(o)?s.get(o):a}));return this.type==="magic-link"&&(l=l.replace(ql," ")),l}get link(){const{innerText:s}=this;return this.type==="magic-link"?s.startsWith("ISBN")?`ISBN ${s.slice(5).replace(/[- ]/gu,"").replace(/x$/u,"X")}`:s:Ga(s).replace(/\n/gu,"%0A")}lint(s=this.getAbsoluteIndex(),l){{const a=super.lint(s,l),d=new fe(this,s),{lintConfig:o}=F,{type:u,childNodes:c}=this;if(u==="magic-link"){const S="invalid-isbn",$=o.getSeverity(S);return $&&R(this,t,Rn).call(this)&&a.push(G(this,d,S,"invalid-isbn",$)),a}let f="invalid-url",m=o.getSeverity(f);if(m&&!this.querySelector("magic-word"))try{this.getUrl()}catch{a.push(G(this,d,f,"invalid-url",m))}const y=u==="ext-link-url";if(f="unterminated-url",m=o.getSeverity(f,y?"pipe":"punctuation"),m){const S=y?/\|/u:/[,;。:!?()]+/u,$=c.find(_=>_.type==="text"&&S.test(_.data));if($){const{data:_}=$,T=Y($,d,f,F.msg("in-url",y?'"|"':"full-width-punctuation"),m);if(o.computeEditInfo){const{index:g,0:h}=S.exec(_),x=T.startIndex+g;T.suggestions=y?[vi(x,1)]:[vi(x),{desc:F.msg("encode"),range:[x,x+h.length],text:encodeURI(h)}]}a.push(T)}}return a}}getUrl(s){{const{type:l}=this;let{link:a}=this;if(l==="magic-link"){if(a.startsWith("ISBN"))return this.normalizeTitle(`BookSources/${a.slice(5)}`,-1,{temporary:!0}).getUrl(s);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(s){return s==="invalid"?R(this,t,Rn).call(this):super.getAttribute(s)}},e=new WeakMap,t=new WeakSet,Rn=function(){if(this.type==="magic-link"){const{link:s}=this;if(s.startsWith("ISBN")){const l=[...s.slice(5)].map(a=>a==="X"?10:Number(a));return l.length===10?l.reduce((a,d,o)=>a+d*(10-o),0)%11!==0:l.length===13&&(l[12]===10||l.reduce((a,d,o)=>a+d*(o%2?3:1),0)%10!==0)}}return!1},n)}}),Wl,zs,Ml,Ct,Ro=L({"src/extLink.ts"(){"use strict";var e,t;Ue(),Q(),Qe(),D(),V(),vr(),Wl=[ze("[")],Ct=(t=class extends(Ml=U){constructor(n,r="",s="",l,a=[]){super(void 0,l,a,{});j(this,e);const d=n&&/^\0\d+f\x7F$/u.test(n)?a[Number(n.slice(1,-2))]:new bi(n,"ext-link-url",l,a);if(this.insertAt(d),E(this,e,r),s){const o=new U(s,l,a,{});o.type="ext-link-text",o.setAttribute("stage",$e-1),this.insertAt(o)}}get type(){return"ext-link"}toString(n){return this.length===1?`[${super.toString(n)}${b(this,e)}]`:`[${super.toString(n,b(this,e))}]`}text(){return`[${super.text(" ")}]`}getGaps(){return b(this,e).length}lint(n=this.getAbsoluteIndex(),r){{const s=super.lint(n,r),l="var-anchor",a=F.lintConfig.getSeverity(l,"extLink");return a&&this.length===1&&this.isInside("heading-title")&&s.push(G(this,{start:n},l,"variable-anchor",a)),s}}print(){return super.print(this.length===1?{pre:"[",post:`${b(this,e)}]`}:{pre:"[",sep:b(this,e),post:"]"})}},e=new WeakMap,t),zs=le(Ml),Ct=re(zs,0,"ExtLinkToken",Wl,Ct),ne(zs,1,Ct)}}),Pn,$d=L({"src/imagemapLink.ts"(){"use strict";V(),Bt(),jo(),Ro(),Pn=class extends U{get type(){return"imagemap-link"}constructor(e,t,i,n,r=[]){super(void 0,n,r),this.append(e,t.length===2?new xr(...t,n,r):new Ct(...t,n,r),new Oe(i,n,r))}}}}),Po={};oe(Po,{ImagemapToken:()=>Oo});var Oo,_d=L({"src/multiLine/imagemap.ts"(){"use strict";Q(),Ie(),ye(),D(),gr(),No(),Io(),$d(),Oo=class extends es{get image(){return this.childNodes.find(ss("imagemap-image"))}constructor(e,t=F.getConfig(),i=[]){if(super(void 0,t,i,{}),!e)return;const n=e.split(`
|
|
16
|
+
`),r=new Set(t.protocol.split("|"));let s=!0,l=!1;for(const a of n){const d=a.trim();if(!(l||!d||d.startsWith("#"))){if(s){const o=a.indexOf("|"),u=o===-1?a:a.slice(0,o),c=this.normalizeTitle(u,0,{halfParsed:!0,temporary:!0,page:""});if(c.valid&&c.ns===6){const f=new Tt("imagemap",u,o===-1?void 0:a.slice(o+1),t,i);super.insertAt(f),s=!1;continue}else l=!0}else if(a.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(a);continue}else if(a.includes("[")){const o=a.indexOf("["),u=a.slice(o),c=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(u);if(c){if(this.normalizeTitle(c[1],0,{halfParsed:!0,temporary:!0,selfLink:!0,page:""}).valid){super.insertAt(new Pn(a.slice(0,o),c.slice(1),u.slice(u.indexOf("]]")+2),t,i));continue}}else if(u.startsWith("[//")||r.has(u.slice(1,u.indexOf(":")+1))||r.has(u.slice(1,u.indexOf("//")+2))){const f=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(u);if(f){super.insertAt(new Pn(a.slice(0,o),f.slice(1),u.slice(u.indexOf("]")+1),t,i));continue}}}}super.insertAt(new Gi(a,t,i))}}lint(e=this.getAbsoluteIndex(),t){{const i=super.lint(e,t),n=new fe(this,e),{childNodes:r,image:s}=this,l="invalid-imagemap",{lintConfig:a}=F,d=a.getSeverity(l,s?"link":"image");return d&&(s?Array.prototype.push.apply(i,r.filter(o=>{const u=o.toString().trim();return o.is("noinclude")&&u&&!u.startsWith("#")}).map(o=>{const u=Y(o,n,l,"invalid-imagemap-link",d);return a.computeEditInfo&&(u.suggestions=[ee(u,-1),qe(u,"comment","# ")]),u})):i.push(G(this,n,l,"imagemap-without-image",d))),i}}getAttribute(e){return e==="invalid"?!this.image:super.getAttribute(e)}}}}),Ul,Hs,zl,It,Bo=L({"src/nowiki/comment.ts"(){"use strict";Q(),xt(),Qe(),D(),vt(),Ul=[it(!1),ze("<!--")],It=class extends(zl=We){constructor(t,i,n,r){super(t,n,r);je(this,"closed");this.closed=i}get type(){return"comment"}lint(t=this.getAbsoluteIndex()){{if(this.closed)return[];const i="unclosed-comment",{lintConfig:n}=F,r=n.getSeverity(i);if(!r)return[];const s=G(this,{start:t},i,"unclosed-comment",r);return n.computeEditInfo&&(s.suggestions=[tt(s.endIndex,"-->")]),[s]}}toString(t){return t?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"<!--",post:this.closed?"-->":""})}},Hs=le(zl),It=re(Hs,0,"CommentToken",Ul,It),ne(Hs,1,It)}}),qo={};oe(qo,{CommentedToken:()=>Wo});var Wo,Td=L({"src/commented.ts"(){"use strict";V(),Bo(),Wo=class extends U{get type(){return"ext-inner"}constructor(e,t,i=[]){if(super(void 0,t,i,{AstText:":",CommentToken:":"}),e){let n=e.indexOf("<!--"),r=n!==-1&&e.indexOf("-->",n+4),s=0;for(;r!==!1&&r!==-1;)n>s&&this.insertAt(e.slice(s,n)),this.insertAt(new It(e.slice(n+4,r),!0,t,i)),s=r+3,n=e.indexOf("<!--",s),r=n!==-1&&e.indexOf("-->",n+4);s<e.length&&this.insertAt(e.slice(s))}}lint(e=this.getAbsoluteIndex()){return super.lint(e,new RegExp(String.raw`<\s*(?:\/\s*)?(${this.name})\b`,"giu"))}}}}),Mo={};oe(Mo,{CategorytreeToken:()=>ri});var Hl,Ds,Dl,ri,Cd=L({"src/link/categorytree.ts"(){"use strict";Q(),Qe(),D(),Si(),Hl=[ze("")],ri=class extends(Dl=De){get type(){return"ext-inner"}constructor(e,t,i,n=[]){super(e,t,i,n),this.setAttribute("bracket",!1)}getTitle(){const e=this.firstChild.toString().trim(),t={halfParsed:!0},i=this.normalizeTitle(e,14,t);return i.valid&&i.ns===14?i:this.normalizeTitle(`Category:${e}`,0,t)}lint(e=this.getAbsoluteIndex()){{const t="no-ignored",i=F.lintConfig.getSeverity(t,"categorytree");if(i){const{link:n}=this;if(!n.valid||n.ns!==14)return[G(this,{start:e},t,"invalid-category",i)]}return super.lint(e,!1)}}},Ds=le(Dl),ri=re(Ds,0,"CategorytreeToken",Hl,ri),ne(Ds,1,ri)}}),Uo={};oe(Uo,{NowikiToken:()=>zo});var Gl,Vl,zo,Id=L({"src/nowiki/index.ts"(){"use strict";var e,On,i;Ve(),Q(),ye(),D(),vt(),Gl=ct(n=>new RegExp(String.raw`<\s*(?:/\s*)${n==="nowiki"?"":"?"}(${n})\b`,"giu")),Vl=new Set(["languages","section","templatestyles"]),zo=(i=class extends We{constructor(){super(...arguments);j(this,e)}get type(){return"ext-inner"}lint(r=this.getAbsoluteIndex()){{const{name:s,innerText:l}=this,{lintConfig:a}=F;let d="void-ext",o=a.getSeverity(d,s);if(o&&R(this,e,On).call(this)){const u=G(this,{start:r},d,F.msg("nothing-in",s),o);return a.computeEditInfo&&(u.suggestions=[ee(u)]),[u]}{d="invalid-json";const u=a.getSeverity(d);if(s==="templatedata"&&u)return Ka(l).map(({message:c,from:f,to:m=f,line:y,endLine:S=y,column:$,endColumn:_=$})=>{o=u;const T=new fe(this,r);return{rule:d,message:c,severity:o,startIndex:r+f,endIndex:r+m,startLine:T.top+y-1,endLine:T.top+S-1,startCol:(y>1?0:T.left)+$-1,endCol:(S>1?0:T.left)+_-1}}).filter(c=>c!==!1)}return super.lint(r,Gl(s))}}getAttribute(r){return r==="invalid"?R(this,e,On).call(this):super.getAttribute(r)}},e=new WeakSet,On=function(){const{name:r,firstChild:{data:s}}=this;return Vl.has(r)&&!!s},i)}}),Ql,Gs,Jl,Nt,Ho=L({"src/tagPair/ext.ts"(){"use strict";Q(),ye(),D(),lr(),V(),rr(),hr(),Ql=[Yi()],Nt=class extends(Jl=ot){get type(){return"ext"}constructor(e,t,i,n,r=F.getConfig(),s=!1,l=[]){const a=e.toLowerCase(),d=new Zi(!t||/^\s/u.test(t)?t:` ${t}`,"ext-attrs",a,r,l),o={...r,ext:r.ext.filter(c=>c!==a),excludes:[...r.excludes],inExt:!0};let u;switch(a){case"pre":if(d.getAttr("format")!=="wikitext"){const{PreToken:c}=(vd(),se(po));u=new c(i,o,l);break}case"indicator":case"poem":case"ref":case"option":case"combooption":case"tab":case"tabs":case"poll":case"seo":case"langconvert":case"phonos":a==="poem"?o.excludes.push("heading"):a==="tab"&&(o.ext=o.ext.filter(c=>c!=="tabs")),u=new U(i,o,l);break;case"dynamicpagelist":{const{ParamTagToken:c}=(vo(),se(xo));u=new c(a,s,i,o,l);break}case"inputbox":{const{InputboxToken:c}=(Sd(),se(So));u=new c(a,s,i,o,l);break}case"references":{const{NestedToken:c}=(Ps(),se(zi));o.excludes.push("heading"),u=new c(i,s,["ref"],o,l);break}case"choose":{const{NestedToken:c}=(Ps(),se(zi));u=new c(i,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],o,l);break}case"combobox":{const{NestedToken:c}=(Ps(),se(zi));u=new c(i,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],o,l);break}case"gallery":{const{GalleryToken:c}=(Ad(),se(Lo));u=new c(i,o,l);break}case"imagemap":{const{ImagemapToken:c}=(_d(),se(Po));u=new c(i,o,l);break}case"hiero":{const{CommentedToken:c}=(Td(),se(qo));u=new c(i,o,l);break}case"categorytree":{const{CategorytreeToken:c}=(Cd(),se(Mo));u=new c(i,void 0,o,l);break}default:{const{NowikiToken:c}=(Id(),se(Uo));u=new c(i,o,l)}}u.setAttribute("name",a),u.type==="plain"&&(u.type="ext-inner"),super(e,d,u,n,r,l),this.seal("closed",!0)}lint(e=this.getAbsoluteIndex(),t){{const i=super.lint(e,t),{lintConfig:n}=F,r=new fe(this,e);if(this.name!=="nowiki"){const s=this.inHtmlAttrs(),l="parsing-order",a=s&&n.getSeverity(l,s===2?"ext":"templateInTable");a&&i.push(G(this,r,l,"ext-in-html",a))}if(this.name==="ref"){let s="var-anchor",l=n.getSeverity(s,"ref");l&&this.closest("heading-title")&&i.push(G(this,r,s,"variable-anchor",l)),s="nested-link",l=n.getSeverity(s,"ref"),l&&this.closest("link-text,ext-link-text")&&i.push(G(this,r,s,"ref-in-link",l))}return i}}},Gs=le(Jl),Nt=re(Gs,0,"ExtToken",Ql,Nt),ne(Gs,1,Nt)}}),br,Do=L({"src/tag/index.ts"(){"use strict";var e,t,i,n;Q(),Ie(),V(),D(),br=(n=class extends U{constructor(s,l,a,d,o){super(void 0,d,o);j(this,e);j(this,t);j(this,i);this.insertAt(l),E(this,e,a),E(this,t,s)}get closing(){return b(this,e)}toString(s){return`<${b(this,e)?"/":""}${b(this,t)}${super.toString(s)}${this.selfClosing?"/":""}>`}text(s=""){const{closing:l}=this;return`<${l&&!s?"/":""}${b(this,t)}${l?"":super.text()}${s}>`}getAttribute(s){return s==="padding"?b(this,t).length+(b(this,e)?2:1):super.getAttribute(s)}findMatchingTag(){return ht(b(this,i),()=>{const{type:s,name:l,parentNode:a,closing:d,selfClosing:o}=this;let u=!1,c=!1;if(s==="html"){const{html:[,_,T]}=this.getAttribute("config");u=T.includes(l),c=_.includes(l)}if(u||c&&o)return this;if(!a)return;const{childNodes:f}=a,m=f.indexOf(this),y=d?f.slice(0,m).reverse():f.slice(m+1),S=[this],{rev:$}=pe;for(const _ of y)if(!(!_.is(s)||s==="html"&&(_.name!==l||c&&_.selfClosing)))if(b(_,e)===d){if(s==="tvar")return;S.push(_)}else{const T=S.pop();if(T===this)return _;F.viewOnly&&(E(T,i,[$,_]),E(_,i,[$,T]))}if(F.viewOnly)for(const _ of S)E(_,i,[$,void 0])},s=>{E(this,i,s),s[1]&&s[1]!==this&&E(s[1],i,[pe.rev,this])})}print(){return super.print({pre:`<${b(this,e)?"/":""}${b(this,t)}`,post:`${this.selfClosing?"/":""}>`})}json(s,l=this.getAbsoluteIndex()){{const a=super.json(void 0,l);return a.closing=b(this,e),a}}},e=new WeakMap,t=new WeakMap,i=new WeakMap,n)}}),Xl,Vs,Kl,Ze,Nd=L({"src/tag/tvar.ts"(){"use strict";xt(),Le(),Do(),mt(),Xl=[it(),Ce],Ze=class extends(Kl=br){get type(){return"tvar"}constructor(e,t,i,n,r){const s=new Ge(t,"tvar-name",n,r);super(e,s,i,n,r)}},Vs=le(Kl),Ze=re(Vs,0,"TvarToken",Xl,Ze),ne(Vs,1,Ze)}}),Go={};oe(Go,{TranslateToken:()=>Vo});var Vo,Ld=L({"src/tagPair/translate.ts"(){"use strict";var e,Qo,i;V(),rr(),mt(),Nd(),Vo=(i=class extends ot{constructor(r,s,l,a=[]){const d=new Ge(r,"translate-attr",l,a);s=s==null?void 0:s.replace(/<tvar(\|[^>]+)>([\s\S]*?)<\/>/gu,(u,c,f)=>(new Ze("tvar",c,!1,l,a),new Ze("","",!0,l,a),`\0${a.length-2}n${f}\0${a.length}n`)).replace(/<(tvar)(\s+name\s*=(?:\s*(?:(["'])[\s\S]*?\3|[^"'\s>]+))?\s*)>([\s\S]*?)<\/(tvar)(\s*)>/giu,(u,c,f,m,y,S,$)=>(new Ze(c,f,!1,l,a),new Ze(S,$,!0,l,a),`\0${a.length-2}n${y}\0${a.length}n`));const o=new U(s,l,a);o.type="translate-inner";super("translate",d,o,"translate",l,a);j(this,e);this.seal("closed",!0)}get type(){return"translate"}get selfClosing(){return!1}toString(r){return r?this.lastChild.toString(!0):super.toString()}text(){return this.lastChild.text()}print(){return`<span class="wpb-ext"><translate${R(this,e,Qo).call(this)?'<span class="wpb-ext-attrs"> <span class="wpb-ext-attr"><span class="wpb-attr-key">nowrap</span></span></span>':""}>${this.lastChild.print({class:"ext-inner"})}</translate></span>`}},e=new WeakSet,Qo=function(){return this.firstChild.toString()===" nowrap"},i)}}),Jo={};oe(Jo,{parseCommentAndExt:()=>ki});var Qs,Yl,Fi,Zl,Js,ki,is=L({"parser/commentAndExt.ts"(){"use strict";Ve(),ve(),fd(),Bt(),md(),Ho(),Bo(),Qs="<onlyinclude>",Yl="</onlyinclude>",{length:Fi}=Qs,Zl=[!1,!0].map(e=>{const t=e?"includeonly":"(?:no|only)include",i=e?"noinclude":"includeonly";return ct(n=>new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${t}(?:\s[^>]*)?/?>|</${t}\s*>|<(${n})(\s[^>]*?)?(?:/>|>([\s\S]*?)</(${"\\1"}\s*)>)|<(${i})(\s[^>]*?)?(?:/>|>([\s\S]*?)(?:</(${i}\s*)>|$))`,"giu"))}),Js=e=>{const t=e.indexOf(Qs);return{i:t,j:e.indexOf(Yl,t+Fi)}},ki=(e,t,i,n)=>{if(n){let{i:d,j:o}=Js(e);if(d!==-1&&o!==-1){let u="";const c=f=>{new Oe(f,t,i),u+=`\0${i.length-1}n`};for(;d!==-1&&o!==-1;){const f=`\0${i.length}g`;new ei(e.slice(d+Fi,o),t,i),d>0&&c(e.slice(0,d)),u+=f,e=e.slice(o+Fi+1),{i:d,j:o}=Js(e)}return e&&c(e),u}}const{ext:r}=t;let s=r,l=t;if(r.includes("translate")){const{TranslateToken:d}=(Ld(),se(Go)),o=[];s=r.filter(u=>u!=="translate"&&u!=="tvar"),l={...t,ext:s},e=e.replace(/<nowiki>[\s\S]*?<\/nowiki>/giu,u=>(o.push(u),`\0${o.length-1}`)).replace(/<translate( nowrap)?>([\s\S]*?)<\/translate>/gu,(u,c,f)=>{const m=i.length;return new d(c,f&&Pe(f,o),l,i),`\0${m}g`}),e=Pe(e,o)}const a=Zl[n?1:0](s.join("|"));return a.lastIndex=0,a.test(e)?e.replace(a,(d,o,u,c,f,m,y,S,$)=>{const _=i.length;let T="n";if(o)T="e",new Nt(o,u,c,f,l,m,i);else if(d.startsWith("<!--")){T="c";const g=d.endsWith("-->");new It(Pe(d,i,1).slice(4,g?-3:void 0),g,t,i)}else m?new ti(m,y&&Pe(y,i,1),S&&Pe(S,i,1),$,t,i):new Oe(d,t,i,!0);return`\0${_}${T}`}):e}}}),ea,ta,ia,sa,Xs,na,li,Fd=L({"src/tag/html.ts"(){"use strict";var e,t;Q(),ye(),lr(),D(),Do(),ea=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),ta=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"]),ia=new Set(["strike","big","center","font","tt"]),sa=[Yi()],li=(t=class extends(na=br){constructor(n,r,s,l,a,d){super(n,r,s,a,d);j(this,e);this.setAttribute("name",n.toLowerCase()),E(this,e,l)}get type(){return"html"}get selfClosing(){return b(this,e)}text(){const{closing:n,selfClosing:r,name:s}=this,{html:[,,l]}=this.getAttribute("config");return l.includes(s)?n&&s!=="br"?"":super.text("/"):super.text(r&&!n?"/":"")}lint(n=this.getAbsoluteIndex(),r){{const s=super.lint(n,r),{name:l,parentNode:a,closing:d,selfClosing:o}=this,u=new fe(this,n),{lintConfig:c}=F,{computeEditInfo:f,fix:m}=c,y=this.inTableAttrs();let S="h1",$=c.getSeverity(S,"html");if($&&l==="h1"&&!d){const p=G(this,u,S,"<h1>",$);f&&(p.suggestions=[{desc:"h2",range:[n+2,n+3],text:"2"}]),s.push(p)}if(S="parsing-order",$=y&&c.getSeverity(S,y===2?"html":"templateInTable"),$){const p=G(this,u,S,"html-in-table",$);f&&y===2&&(p.suggestions=[ee(p)]),s.push(p)}if(S="obsolete-tag",$=c.getSeverity(S,l),$&&ia.has(l)&&s.push(G(this,u,S,"obsolete-tag",$)),S="bold-header",$=c.getSeverity(S,l),$&&(l==="b"||l==="strong")&&this.isInside("heading-title")){const p=G(this,u,S,"bold-in-header",$);f&&(p.suggestions=[ee(p)]),s.push(p)}const{html:[,_,T]}=this.getAttribute("config"),g=T.includes(l),h=_.includes(l),x=!g&&!h;if(S="unmatched-tag",d&&(o||g)||o&&x){if($=c.getSeverity(S,d?"both":"selfClosing"),$){const p=G(this,u,S,d?"closing-and-self-closing":"invalid-self-closing",$);if(f||m){const k=Yn(n),v={desc:F.msg("no-self-closing"),range:[p.endIndex-2,p.endIndex-1],text:""};h?f&&(p.suggestions=[k,v]):d?p.fix=g?k:v:f&&(p.suggestions=[v,tt(p.endIndex,`></${l}>`,-2)])}s.push(p)}}else if(!this.findMatchingTag()){const p=G(this,u,S,d?"unmatched-closing":"unclosed-tag"),k=this.closest("magic-word");if(k&&ea.has(k.name))$=c.getSeverity(S,"conditional");else if(d)$=c.getSeverity(S,"closing"),p.suggestions=[ee(p)];else{$=c.getSeverity(S,"opening");const v=a==null?void 0:a.childNodes;ta.has(l)&&(v!=null&&v.slice(0,v.indexOf(this)).some(w=>w.is("html")&&w.name===l&&!w.findMatchingTag())&&(p.suggestions=[tt(n+1,"/")]),this.isInside("heading-title")&&(p.rule="format-leakage",$=c.getSeverity("format-leakage",l)))}$&&(p.severity=$,s.push(p))}return s}}getAttribute(n){return n==="invalid"?this.inTableAttrs()===2:super.getAttribute(n)}json(n,r=this.getAbsoluteIndex()){{const s=super.json(void 0,r);return s.selfClosing=b(this,e),s}}},e=new WeakMap,t),Xs=le(na),li=re(Xs,0,"HtmlToken",sa,li),ne(Xs,1,li)}}),Xo={};oe(Xo,{parseHtml:()=>Ko});var ra,Ko,Ed=L({"parser/html.ts"(){"use strict";hr(),Fd(),ra=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,Ko=(e,t,i)=>{var l;const{html:n}=t;(l=t.htmlElements)!=null||(t.htmlElements=new Set([...n[0],...n[1],...n[2]]));const r=e.split("<");let s=r.shift();for(const a of r){const d=ra.exec(a),o=d==null?void 0:d[2],u=o==null?void 0:o.toLowerCase();if(!d||!t.htmlElements.has(u)){s+=`<${a}`;continue}const[,c,,f="",m,y]=d,{length:S}=i,$=new Zi(f,"html-attrs",u,t,i),_=$.hasAttr("itemprop");if(u==="meta"&&!(_&&$.hasAttr("content"))||u==="link"&&!(_&&$.hasAttr("href"))){s+=`<${a}`,i.length=S;continue}s+=`\0${i.length}x${y}`,new li(o,$,c==="/",m==="/>",t,i)}return s}}}),la,aa,Ks,oa,Lt,Yo=L({"src/table/base.ts"(){"use strict";Ie(),lr(),D(),V(),mt(),hr(),la=e=>{const t=e.childNodes.map(n=>n.type==="text"?n.data.replace(/\|{1,2}/gu,({length:r})=>`{{${"!".repeat(r)}}}`):n.toString()).join(""),{childNodes:i}=F.parseWithRef(t,e,2);pe.run(()=>{e.safeReplaceChildren(i)})},aa=[Yi(1)],Lt=class extends(oa=U){constructor(e,t,i,n,r,s=[],l){super(void 0,r,s,l),this.append(new Ge(t,"table-syntax",r,s),new Zi(n,"table-attrs",i,r,s))}escape(){for(const e of this.childNodes)e instanceof Ge?la(e):e.escape()}},Ks=le(oa),Lt=re(Ks,0,"TableBaseToken",aa,Lt),ne(Ks,1,Lt)}}),ua,Ys,_e,Ei,Vt,Qt,Vi,Zo=L({"src/table/td.ts"(){"use strict";Q(),ye(),nr(),D(),V(),Yo(),Vi=class extends(Ys=Lt,ua=[Xi(!1)],Ys){constructor(e,t,i,n=[]){var a;let r=/\||\0\d+!\x7F/u.exec(t!=null?t:""),s=r?t.slice(0,r.index):"";/\[\[|-\{/u.test(s)&&(r=null,s=""),super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",s,i,n),ne(Ei,5,this),Ye(this,Vt),Ye(this,_e,""),r&&([id(this,_e)._]=r);const l=new U(t==null?void 0:t.slice(((a=r==null?void 0:r.index)!=null?a:NaN)+xe(this,_e).length),i,n);l.type="td-inner",l.setAttribute("stage",4),this.insertAt(l)}get type(){return"td"}get rowspan(){return this.getAttr("rowspan")}get colspan(){return this.getAttr("colspan")}get subtype(){return $n(this,Vt,Qt).call(this).subtype}afterBuild(){xe(this,_e).includes("\0")&&Ne(this,_e,this.buildFromStr(xe(this,_e),0)),super.afterBuild()}toString(e){const{childNodes:[t,i,n]}=this;return t.toString(e)+i.toString(e)+xe(this,_e)+n.toString(e)}text(){const{childNodes:[e,t,i]}=this;return e.text()+t.text()+xe(this,_e)+i.text()}getGaps(e){return e===1?xe(this,_e).length:0}lint(e=this.getAbsoluteIndex(),t){{const i=super.lint(e,t),n=new fe(this,e+this.getRelativeIndex(this.length-1)),r="pipe-like",{lintConfig:s}=F,{computeEditInfo:l,fix:a}=s,d=["td","double"].map(o=>s.getSeverity(r,o));for(const o of this.lastChild.childNodes)if(o.type==="text"){const{data:u}=o;if(u.includes("|")){const c=u.includes("||"),f=d[c?1:0];if(f){const m=Y(o,n,r,"pipe-in-table",f);if(l||a)if(c){const y={caption:"|+",td:"|",th:"!"}[this.subtype];m.fix=qe(m,"newline",u.replace(/\|\|/gu,`
|
|
17
|
+
${y}`))}else l&&(m.suggestions=[tr(m.startIndex,u)]);i.push(m)}}}return i}}isIndependent(){return this.firstChild.text().startsWith(`
|
|
18
|
+
`)}getAttr(e){{const t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}}escape(){super.escape(),this.childNodes[1].toString()&&(xe(this,_e)||Ne(this,_e,"{{!}}")),xe(this,_e)==="|"&&Ne(this,_e,"{{!}}")}print(){{const{childNodes:[e,t,i]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${xe(this,_e)}${i.print()}</span>`}}json(e,t=this.getAbsoluteIndex()){{const i=super.json(void 0,t),{rowspan:n,colspan:r}=this;return Object.assign(i,{subtype:this.subtype},n!==1&&{rowspan:n},r!==1&&{colspan:r}),i}}},Ei=le(Ys),_e=new WeakMap,Vt=new WeakSet,Qt=function(){var e;const t=this.firstChild.text(),i=t.slice(-1);let n="td";if(i==="!"?n="th":i==="+"&&(n="caption"),this.isIndependent())return{subtype:n};const{previousSibling:r}=this;return{...$n(e=r,Vt,Qt).call(e)}},Qt=re(Ei,17,"#getSyntax",ua,Vt,Qt),Qn(Ei,Vi)}}),yr,eu=L({"src/table/trBase.ts"(){"use strict";Q(),D(),Yo(),Zo(),yr=class extends Lt{lint(e=this.getAbsoluteIndex(),t){{const i=super.lint(e,t),n=this.childNodes.find(({type:a})=>a==="table-inter");if(!n)return i;const r=hi(n),s="fostered-content",l=r&&F.lintConfig.getSeverity(s,r===2?void 0:"transclusion");if(l){const a=Y(n,{start:e},s,"content-outside-table",l);a.startIndex++,a.startLine++,a.startCol=0,i.push(a)}return i}}getRowCount(){return Number(this.childNodes.some(e=>e instanceof Vi&&e.isIndependent()&&!e.firstChild.text().endsWith("+")))}}}}),da,ca,Zs,ji,Hi,jd=L({"src/table/index.ts"(){"use strict";Q(),Ie(),ye(),nr(),D(),eu(),mt(),da=class extends Array{},Hi=class extends(Zs=yr,ca=[Xi(!1)],Zs){constructor(e,t,i,n){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,e,"table",t,i,n,{}),ne(ji,5,this)}get type(){return"table"}get closed(){return this.lastChild.is("table-syntax")}lint(e=this.getAbsoluteIndex(),t){{const i=super.lint(e,t),n=new fe(this,e),r=["unclosed-table","table-layout"],s=r.map(l=>F.lintConfig.getSeverity(l));if(s[0]&&!this.closed&&i.push(Y(this.firstChild,n,r[0],"unclosed-table",s[0])),s[1]){const l=this.getLayout(),{length:a}=l;if(a>1){let d=1,o=1/0,u=0;for(;u<a;u++){const c=l[u],f=c.length;if(f<d)break;f<o&&(o=f);const m=c.indexOf(c[f-1])+1;if(m>o)break;m>d&&(d=m)}if(u<a){const c=this.getNthRow(u),f=Y(c,n,r[1],"inconsistent-table",s[1]);f.startIndex++,f.startLine++,f.startCol=0,i.push(f)}}}return i}}close(e=`
|
|
19
|
+
|}`,t){pe.run(()=>{const i=new Ge(t?e:void 0,"table-syntax",this.getAttribute("config"),this.getAttribute("accum"));super.insertAt(i)})}getLayout(e){{const t=this.getAllRows(),{length:i}=t,n=da.from(Wu(i,()=>[]));for(let r=0;r<n.length;r++){const s=n[r];let l=0,a=0,d;for(const o of t[r].childNodes.slice(2))if(o.is("td")){if(o.isIndependent()&&(d=o.subtype!=="caption"),d){const u={row:r,column:l},{rowspan:c,colspan:f}=o;for(l++;s[a];)a++;for(let m=r;m<Math.min(r+c,i);m++)for(let y=a;y<a+f;y++)n[m][y]=u;a+=f}}else if(Ou(o))break}return n}}getAllRows(){return[...super.getRowCount()?[this]:[],...this.childNodes.slice(1).filter(e=>e.is("tr")&&e.getRowCount()>0)]}getNthRow(e,t,i){{const n=super.getRowCount();if(e===0&&n)return this;n&&e--;for(const r of this.childNodes.slice(2)){const{type:s}=r;if(s==="tr"&&r.getRowCount()&&(e--,e<0))return r}return}}json(e,t=this.getAbsoluteIndex()){{const i=super.json(void 0,t);return i.closed=this.closed,i}}},ji=le(Zs),re(ji,1,"getLayout",ca,Hi),Qn(ji,Hi)}}),tu,Rd=L({"src/table/tr.ts"(){"use strict";eu(),tu=class extends yr{get type(){return"tr"}constructor(e,t,i,n){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,e,"tr",t,i,n)}}}}),wr,iu=L({"src/nowiki/listBase.ts"(){"use strict";vt(),wr=class extends We{get indent(){return this.innerText.split(":").length-1}json(e,t=this.getAbsoluteIndex()){{const i=super.json(void 0,t),{indent:n}=this;return n&&(i.indent=n),i}}}}}),Sr,su=L({"src/nowiki/dd.ts"(){"use strict";iu(),Sr=class extends wr{get type(){return"dd"}}}}),nu={};oe(nu,{parseTable:()=>ru});var ha,en,ru,Pd=L({"parser/table.ts"(){"use strict";V(),jd(),Rd(),Zo(),su(),ha=e=>e.lastChild.constructor!==U,en=(e,t)=>e.is("td")?t.pop():e,ru=({firstChild:{data:e},type:t,name:i},n,r)=>{const s=[],l=e.split(`
|
|
20
20
|
`);let a=t==="root"||t==="parameter-value"||t==="ext-inner"&&i==="poem"?"":`
|
|
21
|
-
${l.shift()}`,d;const
|
|
21
|
+
${l.shift()}`,d;const o=(u,c)=>{if(!c){a+=u;return}const{lastChild:f}=c;if(ha(c)){const m=new U(u,n,r);m.type="table-inter",m.setAttribute("stage",3),c.insertAt(m)}else f.setText(f.toString()+u)};for(const u of l){d=s.pop();const[c]=/^(?:\s|\0\d+[cno]\x7F)*/u.exec(u),f=u.slice(c.length),m=/^(:*)((?:\s|\0\d+[cn]\x7F)*)(\{\||\{(?:\0\d+[cn]\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(f);if(m){for(;d&&!d.is("td");)d=s.pop();const[,g,h,x,p]=m;g&&new Sr(g,n,r),o(`
|
|
22
22
|
${c}${g&&`\0${r.length-1}d`}${h}\0${r.length}b`,d),s.push(...d?[d]:[],new Hi(x,p,n,r));continue}else if(!d){a+=`
|
|
23
|
-
${
|
|
24
|
-
${
|
|
25
|
-
${c}${S}`,!0),
|
|
23
|
+
${u}`;continue}const y=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(f);if(!y){o(`
|
|
24
|
+
${u}`,d),s.push(d);continue}const[,S,$,_,T]=y;if(S){for(;!d.is("table");)d=s.pop();d.close(`
|
|
25
|
+
${c}${S}`,!0),o(T,s[s.length-1])}else if($){d=en(d,s),d.is("tr")&&(d=s.pop());const g=new tu(`
|
|
26
26
|
${c}${$}`,T,n,r);s.push(d,g),d.insertAt(g)}else{d=en(d,s);const g=_==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu;let h=g.exec(T),x=0,p=`
|
|
27
|
-
${c}${_}`;const k=v=>{const w=new Vi(p,T.slice(x,h==null?void 0:h.index),n,r);return v.insertAt(w),w};for(;h;)k(d),{lastIndex:x}=g,[p]=h,h=g.exec(T);s.push(d,k(d))}}return a.slice(1)}}}),ut,lu=L({"../cm-util/dist/index.mjs"(){"use strict";ut=e=>!/^_{2}.+_{2}$/u.test(e)}}),au,Od=L({"src/nowiki/hr.ts"(){"use strict";vt(),au=class extends We{get type(){return"hr"}}}}),ga,tn,pa,ai,Bd=L({"src/nowiki/doubleUnderscore.ts"(){"use strict";var e,t;xt(),Qe(),vt(),ga=[it(),ze("__")],ai=(t=class extends(pa=We){constructor(n,r,s,l,a){var c,f;super(n,l,a);j(this,e);const d=n.toLowerCase(),{doubleUnderscore:[,,u
|
|
28
|
-
`)&&(_=Te(m).trim());const{ns:g,valid:h}=F.normalizeTitle(_,0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0,page:n});if(h){if(o){if(g!==6){a+=`[[${S}`;continue}let p=!1;for(u++;u<l.length;u++){const k=l[u],v=k.split("]]");if(v.length>2){p=!0,m+=`[[${v[0]}]]${v[1]}`,y=v.slice(2).join("]]");break}else if(v.length===2)m+=`[[${v[0]}]]${v[1]}`;else{m+=`[[${k}`;break}}if(m=Bn(m,t,i,n,r),!p){a+=`[[${c}${f}${m}`;continue}}}else{a+=`[[${S}`;continue}m&&(m=kr(m,t,i,r));let x=xr;T||(g===6?(m&&(m=Ar(m,t,i,!0)),x=mr):g===14&&(x=fu)),m===void 0&&f&&(m=""),a+=`\0${i.length}l${y}`,new x(c,m,t,i,f)}return a}}}),xu={};oe(xu,{parseMagicLinks:()=>vu});var sn,nn,rn,ln,vu,zd=L({"parser/magicLinks.ts"(){"use strict";ve(),vr(),sn=String.raw`[${et}\t]| |�*160;|�*a0;`,nn=`(?:${sn})+`,rn=`(?:${sn}|-)`,ln=String.raw`(?:RFC|PMID)${nn}\d+\b|ISBN${nn}(?:97[89]${rn}?)?(?:\d${rn}?){9}[\dx]\b`,vu=(e,t,i)=>{if(!t.regexMagicLinks)try{t.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${t.protocol})(${Ft}${Et})|${ln})`,"giu")}catch{t.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${t.protocol})(${Ft}${Et})|${ln})`,"giu")}return e.replace(t.regexMagicLinks,(n,r,s)=>{let l=r?n.slice(r.length):n;if(s){let a="";const d=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(l);d&&(a=l.slice(d.index),l=l.slice(0,d.index));const u=l.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,o=u.exec(l);if(o){let c=1;o[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(l.slice(0,o.index))&&(c=2),a=l.slice(o.index+c)+a,l=l.slice(0,o.index+c)}return a.length>=s.length?n:(new bi(l,void 0,t,i),`${r}\0${i.length-1}w${a}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(l))return n;return new bi(l,"magic-link",t,i),`${r}\0${i.length-1}i`})}}}),bu,Hd=L({"util/html.ts"(){"use strict";bu=(e,t)=>e.startsWith(t)?t.length:[...t].findIndex((i,n)=>i!==e[n])}}),ma,yu,Dd=L({"src/nowiki/list.ts"(){"use strict";Q(),D(),iu(),ma=new Set(["link","category","file"]),yu=class extends wr{get type(){return"list"}lint(e=this.getAbsoluteIndex()){var t;{const i="syntax-like",n=F.lintConfig.getSeverity(i,"redirect"),{innerText:r}=this;if(n&&r==="#"){let{nextSibling:s}=this;if((s==null?void 0:s.type)==="text"&&ma.has((t=s.nextSibling)==null?void 0:t.type)&&new RegExp(String.raw`^(?:${this.getAttribute("config").redirection.join("|")})\s*(?::\s*)?$`,"iu").test(`#${s.data}`)){const a=G(s,{start:e+1},i,"redirect-like",n);return a.startIndex--,a.startCol--,a.endIndex+=2,a.endCol+=2,[a]}}return[]}}}}}),wu={};oe(wu,{parseList:()=>Su});var Su,Gd=L({"parser/list.ts"(){"use strict";Hd(),Dd(),su(),Su=(e,t,i,n)=>{const r=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(e);if(!r)return t.lastPrefix="",e;const[s,l,a,d]=r,u=a.replace(/;/gu,":"),o=bu(u,t.lastPrefix),c=((o>1?a.slice(o-1):a)+d).split(/(?=;)/u),f=c[0].startsWith(";");let m=c.length-(f?0:1);if(o>1){const A=a.slice(0,o-1);if(f){const C=A.split(/(?=;)/u);c.unshift(...C),m+=A.includes(";")?C.length:0}else c[0]=A+c[0]}t.lastPrefix=u;let y=l+c.map((A,C)=>`\0${n.length+C}d`).join("")+e.slice(s.length);for(const A of c)new yu(A,i,n);if(!m)return y;const{html:[S,,$]}=i,_=/:+|-\{|\0\d+[xq]\x7F/gu;let T=_,g=T.exec(y),h=0,x=!1,p=!1,k=0;const v=(A,C)=>(new Sr(A,i,n),`${y.slice(0,C)}\0${n.length-1}d${y.slice(C+A.length)}`),w=A=>{A?h&&h--:h++};for(;g&&m;){const{0:A,index:C}=g;if(A==="-{"){if(!k){const{lastIndex:N}=T;T=/-\{|\}-/gu,T.lastIndex=N}k++}else if(A==="}-"){if(k--,!k){const{lastIndex:N}=T;T=_,T.lastIndex=N}}else if(A.endsWith("x")){const{name:N,closing:B,selfClosing:q}=n[Number(A.slice(1,-2))];(S.includes(N)||!q&&!$.includes(N))&&w(B)}else if(A.endsWith("q")){const{bold:N,italic:B}=n[Number(A.slice(1,-2))];N&&(w(x),x=!x),B&&(w(p),p=!p)}else if(h===0){if(A.length>=m)return v(A.slice(0,m),C);m-=A.length,T.lastIndex=C+4+String(n.length).length,y=v(A,C)}g=T.exec(y)}return y}}}),Ri,xa,an,va,oi,Vd=L({"src/converterFlags.ts"(){"use strict";var e,t;Q(),ye(),Ki(),Le(),D(),V(),ft(),Ri=new Set(["A","T","R","D","-","H","N"]),xa=[wi(),Ce],oi=(t=class extends(va=U){constructor(n,r,s=[]){super(void 0,r,s,{});j(this,e);this.safeAppend(n.map(l=>new Me(l,"converter-flag",r,s)))}get type(){return"converter-flags"}afterBuild(){E(this,e,this.childNodes.map(n=>n.text().trim())),super.afterBuild()}toString(n){return super.toString(n,";")}text(){return super.text(";")}getUnknownFlags(){return new Set(b(this,e).filter(n=>/\{{3}[^{}]+\}{3}/u.test(n)))}getVariantFlags(){const n=new Set(this.getAttribute("config").variants);return new Set(b(this,e).filter(r=>n.has(r)))}isInvalidFlag(n,r,s,l){return typeof n=="object"&&(n=n.text().trim(),r=this.getVariantFlags(),s=this.getUnknownFlags(),l=new Set(b(this,e).filter(a=>Ri.has(a)))),!!n&&!r.has(n)&&!s.has(n)&&(r.size>0||!l.has(n))}lint(n=this.getAbsoluteIndex(),r){{const s=this.getVariantFlags(),l=this.getUnknownFlags(),a=new Set(b(this,e).filter($=>Ri.has($))),d=b(this,e).filter($=>!$).length,u=b(this,e).length-l.size-d,{lintConfig:o}=F,{computeEditInfo:c,fix:f}=o,m=super.lint(n,r);if(s.size===u||a.size===u)return m;const y="no-ignored",S=o.getSeverity(y,"conversionFlag");if(S){const $=new fe(this,n);for(let _=0;_<this.length;_++){const T=this.childNodes[_],g=T.text().trim();if(this.isInvalidFlag(g,s,l,a)){const h=Y(T,$,y,"invalid-conversion-flag",S);(c||f)&&(s.size===0&&Ri.has(g.toUpperCase())?h.fix=er(h,g):c&&(h.suggestions=[ee(h,_&&-1)])),m.push(h)}}}return m}}print(){return super.print({sep:";"})}},e=new WeakMap,t),an=le(va),oi=re(an,0,"ConverterFlagsToken",xa,oi),ne(an,1,oi)}}),Pi,ba,on,ya,dt,Qd=L({"src/converterRule.ts"(){"use strict";Ue(),Le(),D(),V(),ft(),Pi=(e,t,i,n)=>{const r=new U(e,i,n);return r.type=`converter-rule-${t}`,r.setAttribute("stage",$e),r},ba=[Ce],dt=class extends(ya=U){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,i=F.getConfig(),n=[]){super(void 0,i,n,{});const r=e.indexOf(":"),s=e.slice(0,r).indexOf("=>"),l=s===-1?e.slice(0,r):e.slice(s+2,r);t&&i.variants.includes(l.trim().toLowerCase())?(super.insertAt(new Me(l,"converter-rule-variant",i,n)),super.insertAt(Pi(e.slice(r+1),"to",i,n)),s!==-1&&super.insertAt(Pi(e.slice(0,s),"from",i,n),0)):super.insertAt(Pi(e,"to",i,n))}toString(e){const{childNodes:t,firstChild:i,lastChild:n}=this;return t.length===3?`${i.toString(e)}=>${t[1].toString(e)}:${n.toString(e)}`:super.toString(e,":")}text(){const{childNodes:e,firstChild:t,lastChild:i}=this;return e.length===3?`${t.text()}=>${e[1].text()}:${i.text()}`:super.text(":")}getGaps(e){return e===0&&this.length===3?2:1}print(){{const{childNodes:e}=this;if(e.length===3){const[t,i,n]=e;return`<span class="wpb-converter-rule">${t.print()}=>${i.print()}:${n.print()}</span>`}return super.print({sep:":"})}}json(e,t=this.getAbsoluteIndex()){{const i=super.json(void 0,t);return i.variant=this.variant,i}}},on=le(ya),dt=re(on,0,"ConverterRuleToken",ba,dt),ne(on,1,dt)}}),wa,un,Sa,ui,Jd=L({"src/converter.ts"(){"use strict";ve(),Qe(),Le(),V(),Vd(),Qd(),wa=[Ce,ze("-{")],ui=class extends(Sa=U){get type(){return"converter"}constructor(e,t,i,n=[]){super(void 0,i,n),this.insertAt(new oi(e,i,n));const[r]=t,s=r.includes(":"),l=new dt(r,s,i,n);(s?l.length===1:t.length===2&&!Te(t[1]).trim())?this.insertAt(new dt(t.join(";"),!1,i,n)):this.safeAppend([l,...t.slice(1).map(a=>new dt(a,!0,i,n))])}toString(e){const{childNodes:[t,...i]}=this;return`-{${t.toString(e)}${t.length>0?"|":""}${i.map(n=>n.toString(e)).join(";")}}-`}text(){const{childNodes:[e,...t]}=this;return`-{${e.text()}|${pt(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?"|":""}${Rt(t,{sep:";"})}}-</span>`}}},un=le(Sa),ui=re(un,0,"ConverterToken",wa,ui),ne(un,1,ui)}}),ku={};oe(ku,{parseConverter:()=>Au});var Au,Xd=L({"parser/converter.ts"(){"use strict";Jd(),Au=(e,t,i)=>{var d;(d=t.regexConverter)!=null||(t.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${t.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"iu"));const n=/-\{/gu,r=/-\{|\}-/gu,s=[];let l=n,a=l.exec(e);for(;a;){const{0:u,index:o}=a;if(u==="}-"){const c=s.pop(),{length:f}=i,m=e.slice(c.index+2,o),y=m.indexOf("|"),[S,$]=y===-1?[[],m]:[m.slice(0,y).split(";"),m.slice(y+1)],_=$.replace(/(&[#a-z\d]+);/giu,"$1"),T=_.split(t.regexConverter).map(g=>g.replace(/\x01/gu,";"));new ui(S,T,t,i),e=`${e.slice(0,c.index)}\0${f}v${e.slice(o+2)}`,s.length===0&&(l=n),l.lastIndex=c.index+3+String(f).length}else s.push(a),l=r,l.lastIndex=o+2;a=l.exec(e)}return e}}}),Qi={};oe(Qi,{Token:()=>U});var ka,U,V=L({"src/index.ts"(){"use strict";var e,t,i,n,r,s,l,a,d,$u,_u,Tu,Cu,Iu,Nu,Lu,Fu,Eu,ju,Ru,Pu,x;ve(),Ue(),Q(),Ie(),D(),ud(),cd(),ka=["category","html-attr#id,ext-attr#id,table-attr#id"],U=(x=class extends Kt{constructor(v,w=F.getConfig(),A=[],C){super();j(this,d);j(this,e,"plain");j(this,t,0);j(this,i);j(this,n);j(this,r);j(this,s,!1);j(this,l);j(this,a);typeof v=="string"&&this.insertAt(v),E(this,i,w),E(this,n,A),A.push(this)}get type(){return b(this,e)}set type(v){E(this,e,v)}get pageName(){return b(this.getRootNode(),a)}set pageName(v){if(v){const w=this.normalizeTitle(v,0,{temporary:!0,page:""});E(this,a,w.valid?w.title:void 0)}else E(this,a,v===""?"":void 0)}parseOnce(v=b(this,t),w=!1,A){if(v<b(this,t)||this.length!==1||!this.isPlain())return this;if(b(this,t)>=$e)return this;switch(v){case 0:if(this.type==="root"){b(this,n).pop();const C=R(this,d,$u).call(this);w&&(w=!C)}E(this,r,w),R(this,d,_u).call(this,w);break;case 1:R(this,d,Tu).call(this);break;case 2:R(this,d,Cu).call(this);break;case 3:R(this,d,Iu).call(this);break;case 4:R(this,d,Nu).call(this);break;case 5:R(this,d,Lu).call(this,A);break;case 6:R(this,d,Fu).call(this,A);break;case 7:R(this,d,Eu).call(this);break;case 8:R(this,d,ju).call(this);break;case 9:R(this,d,Ru).call(this);break;case 10:R(this,d,Pu).call(this)}if(this.type==="root")for(const C of b(this,n))C==null||C.parseOnce(v,w,A);return Cr(this,t)._++,this}buildFromStr(v,w){const A=v.split(/[\0\x7F]/u).map((C,N)=>{if(N%2===0)return C&&new In(C);const B=Number(C.slice(0,-1));return b(this,n)[B]}).filter(C=>C!=="");return w===0?A.map(String).join(""):w===1?pt(A):A}build(){E(this,t,$e);const{length:v,firstChild:w}=this,A=w==null?void 0:w.toString();if(v===1&&w.type==="text"&&A.includes("\0")&&(yi(this,0,1,this.buildFromStr(A)),this.type==="root"))for(const C of b(this,n))C==null||C.build()}afterBuild(){if(this.type==="root")for(const v of b(this,n))v==null||v.afterBuild();E(this,s,!0)}parse(v=$e,w,A){for(v=Math.min(v,$e);b(this,t)<v;)this.parseOnce(b(this,t),w,A);return v&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===x}getAttribute(v){var w;switch(v){case"config":return b(this,i);case"include":return(w=b(this,r))!=null?w:!!b(this.getRootNode(),r);case"accum":return b(this,n);case"built":return b(this,s);case"stage":return b(this,t);case"invalid":return this.type==="table-inter"&&hi(this)===2;default:return super.getAttribute(v)}}setAttribute(v,w){switch(v){case"stage":b(this,t)===0&&this.type==="root"&&b(this,n).shift(),E(this,t,w);break;default:super.setAttribute(v,w)}}insertAt(v,w=this.length){const A=typeof v=="string"?new In(v):v,{length:C}=this;w+=w<0?C:0,super.insertAt(A,w);const{type:N}=A;return N==="root"&&(A.type="plain"),A}normalizeTitle(v,w=0,A){return F.normalizeTitle(v,w,this.getAttribute("include"),b(this,i),{page:this.pageName,...A})}inTableAttrs(){var v;return this.isInside("table-attrs")&&((v=this.closest("table-attrs,arg,parameter"))!=null&&v.is("table-attrs")?2:1)}inHtmlAttrs(){return this.isInside("html-attrs")?2:this.inTableAttrs()}lint(v=this.getAbsoluteIndex(),w){var A;{const{lintConfig:C}=F,{computeEditInfo:N,fix:B,ignoreDisables:q,configurationComment:O}=C;let P=super.lint(v,w);if(this.type==="root"){const I=new Map,W="no-duplicate",J=["category","id"].map(H=>C.getSeverity(W,H)),X=this.toString(),z=ka.filter((H,Z)=>J[Z]).join();if(z){for(const H of this.querySelectorAll(z)){let Z;if(H.is("category"))Z=H.name;else{const ie=H.getValue();ie&&ie!==!0&&(Z=`#${ie}`)}if(Z){const ie=I.get(Z);ie?ie.add(H):I.set(Z,new Set([H]))}}for(const[H,Z]of I)if(Z.size>1&&!H.startsWith("#mw-customcollapsible-")){const ie=!H.startsWith("#"),ue=`duplicate-${ie?"category":"id"}`,be=J[ie?0:1];P.push(...[...Z].map(de=>{const ae=G(de,{start:de.getAbsoluteIndex()},W,ue,be);return N&&ie&&(ae.suggestions=[ee(ae)]),ae}))}}if(!q){const H=new RegExp(String.raw`<!--\s*${O}-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->`,"gu"),Z=[];let ie=H.exec(X);for(;ie;){const{1:ue,index:be}=ie,de=(A=ie[2])==null?void 0:A.trim();let ae;(ue==="disable-line"||ue==="disable-next-line")&&(ae=this.posFromIndex(be).top+(ue==="disable-line"?0:1)),Z.push({line:ae,from:ue==="disable"?H.lastIndex:void 0,to:ue==="enable"?H.lastIndex:void 0,rules:de?new Set(de.split(",").map(Se=>Se.trim())):void 0}),ie=H.exec(X)}P=P.filter(({rule:ue,startLine:be,startIndex:de})=>{const ae={pos:0};for(const{line:Se,from:ce,to:M,rules:K}of Z){if(Se&&Se>be+1)break;if(K&&!K.has(ue))continue;if(Se===be)return!1;ce<=de&&ce>ae.pos?(ae.pos=ce,ae.type="from"):M<=de&&M>ae.pos&&(ae.pos=M,ae.type="to")}return ae.type!=="from"})}if(B&&P.some(({fix:H})=>H)){const H=P.map(({fix:ue})=>ue).filter(ue=>ue!==void 0).sort(({range:[ue,be]},{range:[de,ae]})=>be===ae?de-ue:ae-be);let Z=1/0,ie=X;for(const{range:[ue,be],text:de}of H)be<=Z&&(ie=ie.slice(0,ue)+de+ie.slice(be),Z=ue);Object.assign(P,{output:ie})}if(!N)for(const H of P)delete H.fix,delete H.suggestions}return P}}toString(v,w){return v?super.toString(!0,w):ht(b(this,l),()=>super.toString(!1,w),A=>{const C=this.getRootNode();C.type==="root"&&b(C,s)&&E(this,l,A)})}},e=new WeakMap,t=new WeakMap,i=new WeakMap,n=new WeakMap,r=new WeakMap,s=new WeakMap,l=new WeakMap,a=new WeakMap,d=new WeakSet,$u=function(){const{parseRedirect:v}=(pd(),se(uo)),w=this.firstChild.toString(),A=v(w,b(this,i),b(this,n));return A!==!1&&this.setText(A),!!A},_u=function(v){const{parseCommentAndExt:w}=(is(),se(Jo));this.setText(w(this.firstChild.toString(),b(this,i),b(this,n),v))},Tu=function(){const{parseBraces:v}=(fr(),se(wo)),w=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,A=v(w,b(this,i),b(this,n));this.setText(this.type==="root"?A:A.slice(1))},Cu=function(){if(b(this,i).excludes.includes("html"))return;const{parseHtml:v}=(Ed(),se(Xo));this.setText(v(this.firstChild.toString(),b(this,i),b(this,n)))},Iu=function(){if(b(this,i).excludes.includes("table"))return;const{parseTable:v}=(Pd(),se(nu));this.setText(v(this,b(this,i),b(this,n)))},Nu=function(){if(b(this,i).excludes.includes("hr"))return;const{parseHrAndDoubleUnderscore:v}=(qd(),se(ou));this.setText(v(this,b(this,i),b(this,n)))},Lu=function(v){const{parseLinks:w}=(Ud(),se(mu));this.setText(w(this.firstChild.toString(),b(this,i),b(this,n),this.pageName,v))},Fu=function(v){const{parseQuotes:w}=(hu(),se(cu)),A=this.firstChild.toString().split(`
|
|
27
|
+
${c}${_}`;const k=v=>{const w=new Vi(p,T.slice(x,h==null?void 0:h.index),n,r);return v.insertAt(w),w};for(;h;)k(d),{lastIndex:x}=g,[p]=h,h=g.exec(T);s.push(d,k(d))}}return a.slice(1)}}}),ut,lu=L({"../cm-util/dist/index.mjs"(){"use strict";ut=e=>!/^_{2}.+_{2}$/u.test(e)}}),au,Od=L({"src/nowiki/hr.ts"(){"use strict";vt(),au=class extends We{get type(){return"hr"}}}}),ga,tn,pa,ai,Bd=L({"src/nowiki/doubleUnderscore.ts"(){"use strict";var e,t;xt(),Qe(),vt(),ga=[it(),ze("__")],ai=(t=class extends(pa=We){constructor(n,r,s,l,a){var c,f;super(n,l,a);j(this,e);const d=n.toLowerCase(),{doubleUnderscore:[,,o,u]}=l;this.setAttribute("name",(f=r?(c=u==null?void 0:u[n])==null?void 0:c.toLowerCase():o==null?void 0:o[d])!=null?f:d),E(this,e,s)}get type(){return"double-underscore"}toString(){const n=b(this,e)?"__":"__";return n+this.innerText+n}print(){{const n=b(this,e)?"__":"__";return super.print({pre:n,post:n})}}},e=new WeakMap,t),tn=le(pa),ai=re(tn,0,"DoubleUnderscoreToken",ga,ai),ne(tn,1,ai)}}),ou={};oe(ou,{parseHrAndDoubleUnderscore:()=>uu});var uu,qd=L({"parser/hrAndDoubleUnderscore.ts"(){"use strict";lu(),Od(),Bd(),bo(),uu=({firstChild:{data:e},type:t,name:i},n,r)=>{var o,u,c;const{doubleUnderscore:[s,l,a]}=n,d=[...s,...l];return(o=n.insensitiveDoubleUnderscore)!=null||(n.insensitiveDoubleUnderscore=new Set(s.filter(ut))),(u=n.sensitiveDoubleUnderscore)!=null||(n.sensitiveDoubleUnderscore=new Set(l.filter(ut))),(c=n.regexHrAndDoubleUnderscore)!=null||(n.regexHrAndDoubleUnderscore=new RegExp(String.raw`^((?:\0\d+[cno]\x7F)*)(-{4,})|__(${d.filter(ut).join("|")})__|_{2}(${d.filter(f=>!ut(f)).map(f=>f.slice(2,-2)).join("|")})_{2}`,"gimu")),t!=="root"&&(t!=="ext-inner"||i!=="poem")&&(e=`\0${e}`),e=e.replace(n.regexHrAndDoubleUnderscore,(f,m,y,S,$)=>{var x;if(y)return new au(y,n,r),`${m}\0${r.length-1}r`;const _=S!=null?S:$,T=n.sensitiveDoubleUnderscore.has(_),g=_.toLowerCase(),h=n.insensitiveDoubleUnderscore.has(g);return T||h?(new ai(_,T,!!$,n,r),`\0${r.length-1}${h&&((x=a==null?void 0:a[g])!=null?x:g)==="toc"?"u":"n"}`):f}),n.excludes.includes("heading")||(e=e.replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(f,m,y,S,$)=>{const _=`${m}\0${r.length}h`;return new _t(y.length,[S,$],n,r),_})),t==="root"||t==="ext-inner"&&i==="poem"?e:e.slice(1)}}}),du,Wd=L({"src/nowiki/quote.ts"(){"use strict";var e,t;Q(),ye(),D(),vt(),du=(t=class extends We{constructor(n,r,s,l){super(n,s,l);j(this,e);E(this,e,r)}get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}get closing(){return{...this.bold?{bold:b(this,e).bold}:void 0,...this.italic?{italic:b(this,e).italic}:void 0}}text(){const{parentNode:n,innerText:r}=this;return n!=null&&n.is("image-parameter")&&n.name!=="caption"?"":r}lint(n=this.getAbsoluteIndex()){{const{previousSibling:r,bold:s,closing:l}=this,a=(r==null?void 0:r.type)==="text"?r.data:void 0,d=[],o=new fe(this,n),u=["lonely-apos","bold-header"],{lintConfig:c}=F,{computeEditInfo:f}=c,m=[void 0,"word"].map(S=>c.getSeverity(u[0],S)),y=c.getSeverity(u[1]);if(a!=null&&a.endsWith("'")){const S=m[(l.bold||l.italic)&&/[a-z\d]'$/iu.test(a)?1:0];if(S){const $=G(this,o,u[0],F.msg("lonely","'"),S),{startLine:_,startCol:T}=$,[,{length:g}]=/(?:^|[^'])('+)$/u.exec(a),h=n-g,x={...$,startIndex:h,endIndex:n,endLine:_,startCol:T-g,endCol:T};f&&(x.suggestions=[Pt(h,"'",g),ee(x)]),d.push(x)}}if(y&&s&&this.isInside("heading-title")){const S=G(this,o,u[1],"bold-in-header",y);f&&(S.suggestions=[ee(S)]),d.push(S)}return d}}json(n,r=this.getAbsoluteIndex()){{const s=super.json(void 0,r);return Object.assign(s,{bold:this.bold,italic:this.italic}),s}}},e=new WeakMap,t)}}),cu={};oe(cu,{parseQuotes:()=>kr});var kr,hu=L({"parser/quotes.ts"(){"use strict";Wd(),kr=(e,t,i,n)=>{var m;const r=e.split(/('{2,})/u),{length:s}=r;if(s===1)return e;let l=0,a=0,d,o,u;for(let y=1;y<s;y+=2){const S=r[y].length;switch(S){case 2:a++;break;case 4:r[y-1]+="'",r[y]="'''";case 3:if(l++,d!==void 0)break;r[y-1].endsWith(" ")?o===void 0&&u===void 0&&(u=y):r[y-1].slice(-2,-1)===" "?d=y:o!=null||(o=y);break;default:r[y-1]+="'".repeat(S-5),r[y]="'''''",a++,l++}}if(a%2===1&&l%2===1){const y=(m=d!=null?d:o)!=null?m:u;y!==void 0&&(r[y]="''",r[y-1]+="'")}let c=!1,f=!1;for(let y=1;y<s;y+=2){const S=r[y].length,$=S!==2,_=S!==3,T=new du(r[y],{bold:$&&!!c,italic:_&&!!f},t,i);$&&(c=!c&&T),_&&(f=!f&&T),r[y]=`\0${i.length-1}q`}return r.join("")}}}),gu={};oe(gu,{parseExternalLinks:()=>Ar});var Ar,pu=L({"parser/externalLinks.ts"(){"use strict";ve(),Ro(),vr(),Ar=(e,t,i,n)=>{var r;return(r=t.regexExternalLinks)!=null||(t.regexExternalLinks=new RegExp(String.raw`\[((?:\0\d+[cn]\x7F)*(?:\0\d+f\x7F|(?:(?:${t.protocol}|//)${Ft}|\0\d+m\x7F)${Et}(?=[[\]<>"\t${et}]|\0\d)))([${et}]*(?![${et}]))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),e.replace(t.regexExternalLinks,(s,l,a,d)=>{const{length:o}=i,u=/&[lg]t;/u.exec(l);return u&&(a="",d=l.slice(u.index)+a+d,l=l.slice(0,u.index)),n?(new bi(l,"ext-link-url",t,i),`[\0${o}f${a}${d}]`):(new Ct(l,a,d,t,i),`\0${o}w`)})}}}),fu,Md=L({"src/link/category.ts"(){"use strict";Si(),ve(),fu=class extends De{get type(){return"category"}get sortkey(){{const{childNodes:[,e]}=this;return e&&pi(e.text())}}json(e,t=this.getAbsoluteIndex()){{const i=super.json(void 0,t),{sortkey:n}=this;return n&&(i.sortkey=n),i}}}}}),mu={};oe(mu,{parseLinks:()=>Bn});var fa,Bn,Ud=L({"parser/links.ts"(){"use strict";ve(),D(),hu(),pu(),jo(),Co(),Md(),fa=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)([\s\S]*)$/u,Bn=(e,t,i,n,r)=>{var d;(d=t.regexLinks)!=null||(t.regexLinks=new RegExp(String.raw`^\s*(?:${t.protocol}|//)`,"iu"));const s=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,l=e.split("[[");let a=l.shift();for(let o=0;o<l.length;o++){let u=!1,c,f,m,y;const S=l[o],$=s.exec(S);if($)[,c,f,m,y]=$,y.startsWith("]")&&(m!=null&&m.includes("["))&&(m+="]",y=y.slice(1));else{const p=fa.exec(S);p&&(u=!0,[,c,f,m]=p)}if(c===void 0||t.regexLinks.test(c)||/\0\d+[exhbru]\x7F/u.test(c)){a+=`[[${S}`;continue}let _=Te(c).trim();const T=_.startsWith(":");if(T&&u){a+=`[[${S}`;continue}else!_&&m&&!m.includes(`
|
|
28
|
+
`)&&(_=Te(m).trim());const{ns:g,valid:h}=F.normalizeTitle(_,0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0,page:n});if(h){if(u){if(g!==6){a+=`[[${S}`;continue}let p=!1;for(o++;o<l.length;o++){const k=l[o],v=k.split("]]");if(v.length>2){p=!0,m+=`[[${v[0]}]]${v[1]}`,y=v.slice(2).join("]]");break}else if(v.length===2)m+=`[[${v[0]}]]${v[1]}`;else{m+=`[[${k}`;break}}if(m=Bn(m,t,i,n,r),!p){a+=`[[${c}${f}${m}`;continue}}}else{a+=`[[${S}`;continue}m&&(m=kr(m,t,i,r));let x=xr;T||(g===6?(m&&(m=Ar(m,t,i,!0)),x=mr):g===14&&(x=fu)),m===void 0&&f&&(m=""),a+=`\0${i.length}l${y}`,new x(c,m,t,i,f)}return a}}}),xu={};oe(xu,{parseMagicLinks:()=>vu});var sn,nn,rn,ln,vu,zd=L({"parser/magicLinks.ts"(){"use strict";ve(),vr(),sn=String.raw`[${et}\t]| |�*160;|�*a0;`,nn=`(?:${sn})+`,rn=`(?:${sn}|-)`,ln=String.raw`(?:RFC|PMID)${nn}\d+\b|ISBN${nn}(?:97[89]${rn}?)?(?:\d${rn}?){9}[\dx]\b`,vu=(e,t,i)=>{if(!t.regexMagicLinks)try{t.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${t.protocol})(${Ft}${Et})|${ln})`,"giu")}catch{t.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${t.protocol})(${Ft}${Et})|${ln})`,"giu")}return e.replace(t.regexMagicLinks,(n,r,s)=>{let l=r?n.slice(r.length):n;if(s){let a="";const d=/&(?:[lg]t|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(l);d&&(a=l.slice(d.index),l=l.slice(0,d.index));const o=l.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,u=o.exec(l);if(u){let c=1;u[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(l.slice(0,u.index))&&(c=2),a=l.slice(u.index+c)+a,l=l.slice(0,u.index+c)}return a.length>=s.length?n:(new bi(l,void 0,t,i),`${r}\0${i.length-1}w${a}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(l))return n;return new bi(l,"magic-link",t,i),`${r}\0${i.length-1}i`})}}}),bu,Hd=L({"util/html.ts"(){"use strict";bu=(e,t)=>e.startsWith(t)?t.length:[...t].findIndex((i,n)=>i!==e[n])}}),ma,yu,Dd=L({"src/nowiki/list.ts"(){"use strict";Q(),D(),iu(),ma=new Set(["link","category","file"]),yu=class extends wr{get type(){return"list"}lint(e=this.getAbsoluteIndex()){var t;{const i="syntax-like",n=F.lintConfig.getSeverity(i,"redirect"),{innerText:r}=this;if(n&&r==="#"){let{nextSibling:s}=this;if((s==null?void 0:s.type)==="text"&&ma.has((t=s.nextSibling)==null?void 0:t.type)&&new RegExp(String.raw`^(?:${this.getAttribute("config").redirection.join("|")})\s*(?::\s*)?$`,"iu").test(`#${s.data}`)){const a=G(s,{start:e+1},i,"redirect-like",n);return a.startIndex--,a.startCol--,a.endIndex+=2,a.endCol+=2,[a]}}return[]}}}}}),wu={};oe(wu,{parseList:()=>Su});var Su,Gd=L({"parser/list.ts"(){"use strict";Hd(),Dd(),su(),Su=(e,t,i,n)=>{const r=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(e);if(!r)return t.lastPrefix="",e;const[s,l,a,d]=r,o=a.replace(/;/gu,":"),u=bu(o,t.lastPrefix),c=((u>1?a.slice(u-1):a)+d).split(/(?=;)/u),f=c[0].startsWith(";");let m=c.length-(f?0:1);if(u>1){const A=a.slice(0,u-1);if(f){const C=A.split(/(?=;)/u);c.unshift(...C),m+=A.includes(";")?C.length:0}else c[0]=A+c[0]}t.lastPrefix=o;let y=l+c.map((A,C)=>`\0${n.length+C}d`).join("")+e.slice(s.length);for(const A of c)new yu(A,i,n);if(!m)return y;const{html:[S,,$]}=i,_=/:+|-\{|\0\d+[xq]\x7F/gu;let T=_,g=T.exec(y),h=0,x=!1,p=!1,k=0;const v=(A,C)=>(new Sr(A,i,n),`${y.slice(0,C)}\0${n.length-1}d${y.slice(C+A.length)}`),w=A=>{A?h&&h--:h++};for(;g&&m;){const{0:A,index:C}=g;if(A==="-{"){if(!k){const{lastIndex:N}=T;T=/-\{|\}-/gu,T.lastIndex=N}k++}else if(A==="}-"){if(k--,!k){const{lastIndex:N}=T;T=_,T.lastIndex=N}}else if(A.endsWith("x")){const{name:N,closing:B,selfClosing:q}=n[Number(A.slice(1,-2))];(S.includes(N)||!q&&!$.includes(N))&&w(B)}else if(A.endsWith("q")){const{bold:N,italic:B}=n[Number(A.slice(1,-2))];N&&(w(x),x=!x),B&&(w(p),p=!p)}else if(h===0){if(A.length>=m)return v(A.slice(0,m),C);m-=A.length,T.lastIndex=C+4+String(n.length).length,y=v(A,C)}g=T.exec(y)}return y}}}),Ri,xa,an,va,oi,Vd=L({"src/converterFlags.ts"(){"use strict";var e,t;Q(),ye(),Ki(),Le(),D(),V(),ft(),Ri=new Set(["A","T","R","D","-","H","N"]),xa=[wi(),Ce],oi=(t=class extends(va=U){constructor(n,r,s=[]){super(void 0,r,s,{});j(this,e);this.safeAppend(n.map(l=>new Me(l,"converter-flag",r,s)))}get type(){return"converter-flags"}afterBuild(){E(this,e,this.childNodes.map(n=>n.text().trim())),super.afterBuild()}toString(n){return super.toString(n,";")}text(){return super.text(";")}getUnknownFlags(){return new Set(b(this,e).filter(n=>/\{{3}[^{}]+\}{3}/u.test(n)))}getVariantFlags(){const n=new Set(this.getAttribute("config").variants);return new Set(b(this,e).filter(r=>n.has(r)))}isInvalidFlag(n,r,s,l){return typeof n=="object"&&(n=n.text().trim(),r=this.getVariantFlags(),s=this.getUnknownFlags(),l=new Set(b(this,e).filter(a=>Ri.has(a)))),!!n&&!r.has(n)&&!s.has(n)&&(r.size>0||!l.has(n))}lint(n=this.getAbsoluteIndex(),r){{const s=this.getVariantFlags(),l=this.getUnknownFlags(),a=new Set(b(this,e).filter($=>Ri.has($))),d=b(this,e).filter($=>!$).length,o=b(this,e).length-l.size-d,{lintConfig:u}=F,{computeEditInfo:c,fix:f}=u,m=super.lint(n,r);if(s.size===o||a.size===o)return m;const y="no-ignored",S=u.getSeverity(y,"conversionFlag");if(S){const $=new fe(this,n);for(let _=0;_<this.length;_++){const T=this.childNodes[_],g=T.text().trim();if(this.isInvalidFlag(g,s,l,a)){const h=Y(T,$,y,"invalid-conversion-flag",S);(c||f)&&(s.size===0&&Ri.has(g.toUpperCase())?h.fix=er(h,g):c&&(h.suggestions=[ee(h,_&&-1)])),m.push(h)}}}return m}}print(){return super.print({sep:";"})}},e=new WeakMap,t),an=le(va),oi=re(an,0,"ConverterFlagsToken",xa,oi),ne(an,1,oi)}}),Pi,ba,on,ya,dt,Qd=L({"src/converterRule.ts"(){"use strict";Ue(),Le(),D(),V(),ft(),Pi=(e,t,i,n)=>{const r=new U(e,i,n);return r.type=`converter-rule-${t}`,r.setAttribute("stage",$e),r},ba=[Ce],dt=class extends(ya=U){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,i=F.getConfig(),n=[]){super(void 0,i,n,{});const r=e.indexOf(":"),s=e.slice(0,r).indexOf("=>"),l=s===-1?e.slice(0,r):e.slice(s+2,r);t&&i.variants.includes(l.trim().toLowerCase())?(super.insertAt(new Me(l,"converter-rule-variant",i,n)),super.insertAt(Pi(e.slice(r+1),"to",i,n)),s!==-1&&super.insertAt(Pi(e.slice(0,s),"from",i,n),0)):super.insertAt(Pi(e,"to",i,n))}toString(e){const{childNodes:t,firstChild:i,lastChild:n}=this;return t.length===3?`${i.toString(e)}=>${t[1].toString(e)}:${n.toString(e)}`:super.toString(e,":")}text(){const{childNodes:e,firstChild:t,lastChild:i}=this;return e.length===3?`${t.text()}=>${e[1].text()}:${i.text()}`:super.text(":")}getGaps(e){return e===0&&this.length===3?2:1}print(){{const{childNodes:e}=this;if(e.length===3){const[t,i,n]=e;return`<span class="wpb-converter-rule">${t.print()}=>${i.print()}:${n.print()}</span>`}return super.print({sep:":"})}}json(e,t=this.getAbsoluteIndex()){{const i=super.json(void 0,t);return i.variant=this.variant,i}}},on=le(ya),dt=re(on,0,"ConverterRuleToken",ba,dt),ne(on,1,dt)}}),wa,un,Sa,ui,Jd=L({"src/converter.ts"(){"use strict";ve(),Qe(),Le(),V(),Vd(),Qd(),wa=[Ce,ze("-{")],ui=class extends(Sa=U){get type(){return"converter"}constructor(e,t,i,n=[]){super(void 0,i,n),this.insertAt(new oi(e,i,n));const[r]=t,s=r.includes(":"),l=new dt(r,s,i,n);(s?l.length===1:t.length===2&&!Te(t[1]).trim())?this.insertAt(new dt(t.join(";"),!1,i,n)):this.safeAppend([l,...t.slice(1).map(a=>new dt(a,!0,i,n))])}toString(e){const{childNodes:[t,...i]}=this;return`-{${t.toString(e)}${t.length>0?"|":""}${i.map(n=>n.toString(e)).join(";")}}-`}text(){const{childNodes:[e,...t]}=this;return`-{${e.text()}|${pt(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?"|":""}${Rt(t,{sep:";"})}}-</span>`}}},un=le(Sa),ui=re(un,0,"ConverterToken",wa,ui),ne(un,1,ui)}}),ku={};oe(ku,{parseConverter:()=>Au});var Au,Xd=L({"parser/converter.ts"(){"use strict";Jd(),Au=(e,t,i)=>{var d;(d=t.regexConverter)!=null||(t.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${t.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"iu"));const n=/-\{/gu,r=/-\{|\}-/gu,s=[];let l=n,a=l.exec(e);for(;a;){const{0:o,index:u}=a;if(o==="}-"){const c=s.pop(),{length:f}=i,m=e.slice(c.index+2,u),y=m.indexOf("|"),[S,$]=y===-1?[[],m]:[m.slice(0,y).split(";"),m.slice(y+1)],_=$.replace(/(&[#a-z\d]+);/giu,"$1"),T=_.split(t.regexConverter).map(g=>g.replace(/\x01/gu,";"));new ui(S,T,t,i),e=`${e.slice(0,c.index)}\0${f}v${e.slice(u+2)}`,s.length===0&&(l=n),l.lastIndex=c.index+3+String(f).length}else s.push(a),l=r,l.lastIndex=u+2;a=l.exec(e)}return e}}}),Qi={};oe(Qi,{Token:()=>U});var ka,U,V=L({"src/index.ts"(){"use strict";var e,t,i,n,r,s,l,a,d,$u,_u,Tu,Cu,Iu,Nu,Lu,Fu,Eu,ju,Ru,Pu,x;ve(),Ue(),Q(),Ie(),D(),ud(),cd(),ka=["category","html-attr#id,ext-attr#id,table-attr#id"],U=(x=class extends Kt{constructor(v,w=F.getConfig(),A=[],C){super();j(this,d);j(this,e,"plain");j(this,t,0);j(this,i);j(this,n);j(this,r);j(this,s,!1);j(this,l);j(this,a);typeof v=="string"&&this.insertAt(v),E(this,i,w),E(this,n,A),A.push(this)}get type(){return b(this,e)}set type(v){E(this,e,v)}get pageName(){return b(this.getRootNode(),a)}set pageName(v){if(v){const w=this.normalizeTitle(v,0,{temporary:!0,page:""});E(this,a,w.valid?w.title:void 0)}else E(this,a,v===""?"":void 0)}parseOnce(v=b(this,t),w=!1,A){if(v<b(this,t)||this.length!==1||!this.isPlain())return this;if(b(this,t)>=$e)return this;switch(v){case 0:if(this.type==="root"){b(this,n).pop();const C=R(this,d,$u).call(this);w&&(w=!C)}E(this,r,w),R(this,d,_u).call(this,w);break;case 1:R(this,d,Tu).call(this);break;case 2:R(this,d,Cu).call(this);break;case 3:R(this,d,Iu).call(this);break;case 4:R(this,d,Nu).call(this);break;case 5:R(this,d,Lu).call(this,A);break;case 6:R(this,d,Fu).call(this,A);break;case 7:R(this,d,Eu).call(this);break;case 8:R(this,d,ju).call(this);break;case 9:R(this,d,Ru).call(this);break;case 10:R(this,d,Pu).call(this)}if(this.type==="root")for(const C of b(this,n))C==null||C.parseOnce(v,w,A);return Cr(this,t)._++,this}buildFromStr(v,w){const A=v.split(/[\0\x7F]/u).map((C,N)=>{if(N%2===0)return C&&new In(C);const B=Number(C.slice(0,-1));return b(this,n)[B]}).filter(C=>C!=="");return w===0?A.map(String).join(""):w===1?pt(A):A}build(){E(this,t,$e);const{length:v,firstChild:w}=this,A=w==null?void 0:w.toString();if(v===1&&w.type==="text"&&A.includes("\0")&&(yi(this,0,1,this.buildFromStr(A)),this.type==="root"))for(const C of b(this,n))C==null||C.build()}afterBuild(){if(this.type==="root")for(const v of b(this,n))v==null||v.afterBuild();E(this,s,!0)}parse(v=$e,w,A){for(v=Math.min(v,$e);b(this,t)<v;)this.parseOnce(b(this,t),w,A);return v&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===x}getAttribute(v){var w;switch(v){case"config":return b(this,i);case"include":return(w=b(this,r))!=null?w:!!b(this.getRootNode(),r);case"accum":return b(this,n);case"built":return b(this,s);case"stage":return b(this,t);case"invalid":return this.type==="table-inter"&&hi(this)===2;default:return super.getAttribute(v)}}setAttribute(v,w){switch(v){case"stage":b(this,t)===0&&this.type==="root"&&b(this,n).shift(),E(this,t,w);break;default:super.setAttribute(v,w)}}insertAt(v,w=this.length){const A=typeof v=="string"?new In(v):v,{length:C}=this;w+=w<0?C:0,super.insertAt(A,w);const{type:N}=A;return N==="root"&&(A.type="plain"),A}normalizeTitle(v,w=0,A){return F.normalizeTitle(v,w,this.getAttribute("include"),b(this,i),{page:this.pageName,...A})}inTableAttrs(){var v;return this.isInside("table-attrs")&&((v=this.closest("table-attrs,arg,parameter"))!=null&&v.is("table-attrs")?2:1)}inHtmlAttrs(){return this.isInside("html-attrs")?2:this.inTableAttrs()}lint(v=this.getAbsoluteIndex(),w){var A;{const{lintConfig:C}=F,{computeEditInfo:N,fix:B,ignoreDisables:q,configurationComment:O}=C;let P=super.lint(v,w);if(this.type==="root"){const I=new Map,W="no-duplicate",J=["category","id"].map(H=>C.getSeverity(W,H)),X=this.toString(),z=ka.filter((H,Z)=>J[Z]).join();if(z){for(const H of this.querySelectorAll(z)){let Z;if(H.is("category"))Z=H.name;else{const ie=H.getValue();ie&&ie!==!0&&(Z=`#${ie}`)}if(Z){const ie=I.get(Z);ie?ie.add(H):I.set(Z,new Set([H]))}}for(const[H,Z]of I)if(Z.size>1&&!H.startsWith("#mw-customcollapsible-")){const ie=!H.startsWith("#"),ue=`duplicate-${ie?"category":"id"}`,be=J[ie?0:1];P.push(...[...Z].map(de=>{const ae=G(de,{start:de.getAbsoluteIndex()},W,ue,be);return N&&ie&&(ae.suggestions=[ee(ae)]),ae}))}}if(!q){const H=new RegExp(String.raw`<!--\s*${O}-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->`,"gu"),Z=[];let ie=H.exec(X);for(;ie;){const{1:ue,index:be}=ie,de=(A=ie[2])==null?void 0:A.trim();let ae;(ue==="disable-line"||ue==="disable-next-line")&&(ae=this.posFromIndex(be).top+(ue==="disable-line"?0:1)),Z.push({line:ae,from:ue==="disable"?H.lastIndex:void 0,to:ue==="enable"?H.lastIndex:void 0,rules:de?new Set(de.split(",").map(Se=>Se.trim())):void 0}),ie=H.exec(X)}P=P.filter(({rule:ue,startLine:be,startIndex:de})=>{const ae={pos:0};for(const{line:Se,from:ce,to:M,rules:K}of Z){if(Se&&Se>be+1)break;if(K&&!K.has(ue))continue;if(Se===be)return!1;ce<=de&&ce>ae.pos?(ae.pos=ce,ae.type="from"):M<=de&&M>ae.pos&&(ae.pos=M,ae.type="to")}return ae.type!=="from"})}if(B&&P.some(({fix:H})=>H)){const H=P.map(({fix:ue})=>ue).filter(ue=>ue!==void 0).sort(({range:[ue,be]},{range:[de,ae]})=>be===ae?de-ue:ae-be);let Z=1/0,ie=X;for(const{range:[ue,be],text:de}of H)be<=Z&&(ie=ie.slice(0,ue)+de+ie.slice(be),Z=ue);Object.assign(P,{output:ie})}if(!N)for(const H of P)delete H.fix,delete H.suggestions}return P}}toString(v,w){return v?super.toString(!0,w):ht(b(this,l),()=>super.toString(!1,w),A=>{const C=this.getRootNode();C.type==="root"&&b(C,s)&&E(this,l,A)})}},e=new WeakMap,t=new WeakMap,i=new WeakMap,n=new WeakMap,r=new WeakMap,s=new WeakMap,l=new WeakMap,a=new WeakMap,d=new WeakSet,$u=function(){const{parseRedirect:v}=(pd(),se(uo)),w=this.firstChild.toString(),A=v(w,b(this,i),b(this,n));return A!==!1&&this.setText(A),!!A},_u=function(v){const{parseCommentAndExt:w}=(is(),se(Jo));this.setText(w(this.firstChild.toString(),b(this,i),b(this,n),v))},Tu=function(){const{parseBraces:v}=(fr(),se(wo)),w=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,A=v(w,b(this,i),b(this,n));this.setText(this.type==="root"?A:A.slice(1))},Cu=function(){if(b(this,i).excludes.includes("html"))return;const{parseHtml:v}=(Ed(),se(Xo));this.setText(v(this.firstChild.toString(),b(this,i),b(this,n)))},Iu=function(){if(b(this,i).excludes.includes("table"))return;const{parseTable:v}=(Pd(),se(nu));this.setText(v(this,b(this,i),b(this,n)))},Nu=function(){if(b(this,i).excludes.includes("hr"))return;const{parseHrAndDoubleUnderscore:v}=(qd(),se(ou));this.setText(v(this,b(this,i),b(this,n)))},Lu=function(v){const{parseLinks:w}=(Ud(),se(mu));this.setText(w(this.firstChild.toString(),b(this,i),b(this,n),this.pageName,v))},Fu=function(v){const{parseQuotes:w}=(hu(),se(cu)),A=this.firstChild.toString().split(`
|
|
29
29
|
`);for(let C=0;C<A.length;C++)A[C]=w(A[C],b(this,i),b(this,n),v);this.setText(A.join(`
|
|
30
30
|
`))},Eu=function(){const{parseExternalLinks:v}=(pu(),se(gu));this.setText(v(this.firstChild.toString(),b(this,i),b(this,n)))},ju=function(){const{parseMagicLinks:v}=(zd(),se(xu));this.setText(v(this.firstChild.toString(),b(this,i),b(this,n)))},Ru=function(){if(b(this,i).excludes.includes("list"))return;const{parseList:v}=(Gd(),se(wu)),{firstChild:w,type:A,name:C}=this,N=w.toString().split(`
|
|
31
31
|
`),B={lastPrefix:""};let q=A==="root"||A==="ext-inner"&&C==="poem"?0:1;for(;q<N.length;q++)N[q]=v(N[q],B,b(this,i),b(this,n));this.setText(N.join(`
|
|
32
|
-
`))},Pu=function(){if(b(this,i).variants.length>0){const{parseConverter:v}=(Xd(),se(ku));this.setText(v(this.firstChild.toString(),b(this,i),b(this,n)))}},x)}}),pe,ss,Ou,Bu,yi,qu,Wu,Ie=L({"util/debug.ts"(){"use strict";pe={running:!1,run(e,t){const{running:i}=this;this.running=!0;const n=t==null?void 0:t.internal;t&&(t.internal=!0);const r=()=>{this.running=i,t&&(t.internal=n)};try{const{Token:s}=(V(),se(Qi)),l=e();return l instanceof s&&!l.getAttribute("built")&&l.afterBuild(),r(),l}catch(s){throw r(),s}},internal(e,t){const{internal:i}=t;t.internal=!0;const n=e();return t.internal=i,n},rev:0},ss=e=>t=>t.type===e,Ou=({type:e})=>e==="tr"||e==="table-syntax",Bu=e=>e==="redirect-target"||e==="link",yi=(e,t,i,n=[])=>{var l,a;let r=e.getChildNodes(),s;r.length===i?(s=r,r=n):s=Array.prototype.splice.apply(r,[t,i,...n]);for(let d=0;d<n.length;d++){const u=n[d];u.setAttribute("parentNode",e),u.setAttribute("nextSibling",r[t+d+1]),u.setAttribute("previousSibling",r[t+d-1])}return(l=r[t-1])==null||l.setAttribute("nextSibling",r[t]),(a=r[t+n.length])==null||a.setAttribute("previousSibling",r[t+n.length-1]),r===n&&e.setAttribute("childNodes",r),s},qu=(e,t)=>{const i=e.toLowerCase(),[n,r]=t,s=Object.prototype.hasOwnProperty.call(r,e);return[i,s,s?r[e]:Object.prototype.hasOwnProperty.call(n,i)&&n[i]]},Wu=(e,t)=>Array.from({length:e},(i,n)=>t(n))}}),yt,dn,Oi,cn,Aa,hn,$a,_a,qn,Kd=L({"lib/lintConfig.ts"(){"use strict";var e,t;Xn(),yt=new Map([[0,!1],[1,"warning"],[2,"error"],[!1,!1],["off",!1],["warning","warning"],["error","error"]]),dn={"arg-in-ext":1,"bold-header":[1,{}],"format-leakage":[1,{}],"fostered-content":[1,{}],h1:[1,{}],"illegal-attr":[2,{}],"insecure-style":2,"invalid-gallery":[2,{parameter:1}],"invalid-imagemap":[2,{}],"invalid-invoke":[2,{}],"invalid-isbn":2,"invalid-json":[2,{duplicate:1}],"invalid-url":1,"lonely-apos":[1,{}],"lonely-bracket":[1,{extLink:2}],"lonely-http":[1,{}],"nested-link":[2,{}],"no-arg":1,"no-duplicate":[2,{category:1,id:1,unknownImageParameter:1}],"no-ignored":[2,{fragment:1,galleryComment:1,galleryNoImage:1,include:1,nonWordAttributes:1,redirect:1}],"obsolete-attr":1,"obsolete-tag":1,"parsing-order":[2,{templateInTable:1}],"pipe-like":[1,{double:2}],"syntax-like":[2,{}],"table-layout":1,"tag-like":[2,{disallowed:1,invalid:1}],"unbalanced-header":2,"unclosed-comment":[1,{}],"unclosed-quote":1,"unclosed-table":2,unescaped:2,"unknown-page":1,"unmatched-tag":[1,{both:2,selfClosing:2}],"unterminated-url":[1,{}],"url-encoding":[1,{}],"var-anchor":[1,{}],"void-ext":[2,{}]},Object.freeze(dn),Oi={configurationComment:"lint",ignoreDisables:!1,fix:!0,computeEditInfo:!0},Object.freeze(Oi),cn=i=>yt.has(i),Aa=i=>cn(i)||Array.isArray(i)&&cn(i[0])&&(i.length===1||typeof i[1]=="object"),hn=(i,n,r)=>{if(gi.includes(n)){if(r===void 0)return!1;if(Aa(r))return i[n]=r,!0}else throw new RangeError(`Unknown lint rule: ${n}`);throw new RangeError(`Invalid lint config for ${n}: ${JSON.stringify(r)}`)},$a=typeof structuredClone=="function"?structuredClone:(i=>JSON.parse(JSON.stringify(i))),_a=class{constructor(i){if(Object.assign(this,$a(dn)),!!i)for(const[n,r]of Object.entries(i))hn(this,n,r)}getSeverity(i,n){var s,l;const r=this[i];return typeof r!="object"?yt.get(r):n&&(l=yt.get((s=r[1])==null?void 0:s[n]))!=null?l:yt.get(r[0])}},qn=(t=class{constructor(i){j(this,e);if(Object.assign(this,Oi),i&&!("rules"in i)&&Object.keys(i).some(n=>gi.includes(n)))this.rules=i;else{const{rules:n,...r}=i!=null?i:{};this.rules=n;for(const[s,l]of Object.entries(r))l!==void 0&&Object.prototype.hasOwnProperty.call(Oi,s)&&(this[s]=l)}}get rules(){return b(this,e)}set rules(i){E(this,e,new Proxy(new _a(i),{set:hn,deleteProperty(){return!1}}))}getSeverity(i,n){return b(this,e).getSeverity(i,n)}},e=new WeakMap,t)}}),gn,Wn,Yd=L({"lib/title.ts"(){"use strict";var e,t,i,n,r,s,Mu,a;Ve(),ve(),gn=d=>{const[,{length:u},o]=/^((?:\.\.\/)*)([\s\S]*)/u.exec(d);return[u/3,o]},Wn=(a=class{constructor(d,u,o,{temporary:c,decode:f,selfLink:m,page:y}={}){j(this,s);j(this,e);j(this,t);j(this,i);j(this,n);j(this,r);je(this,"page");je(this,"valid");je(this,"encoded",!1);this.page=y;const S=d.trim(),$=S.startsWith("../");if(f&&d.includes("%"))try{const h=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(d);d=mi(d),this.encoded=h}catch{}if(d=pi(d).replace(/[_ ]+/gu," ").trim(),$||y&&S.startsWith("/"))E(this,n,0);else{let h=u;d.startsWith(":")&&(h=0,d=d.slice(1).trim());const x=d.split(":");if(x.length>1){const p=jt(x[0]),k=Object.prototype.hasOwnProperty.call(o.nsid,p)&&o.nsid[p];k&&(h=k,d=x.slice(1).join(":").trim())}E(this,n,h)}const _=d.indexOf("#");if(_!==-1){let h=d.slice(_).trim().slice(1);if(h.includes("%"))try{h=mi(h)}catch{}E(this,r,h.replace(/ /gu,"_")),d=d.slice(0,_).trim()}const[T,g]=$?gn(d):[0,d];this.valid=!!(d||m&&this.ns===0&&b(this,r)!==void 0)&&pi(d)===d&&(T===0||y===void 0||y.split("/",T+1).length>T)&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(g),this.main=d,E(this,t,o.namespaces),E(this,i,o.articlePath||"/wiki/$1"),b(this,i).includes("$1")||E(this,i,b(this,i)+`${b(this,i).endsWith("/")?"":"/"}$1`),c||Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}})}get ns(){return b(this,n)}get fragment(){return b(this,r)}get main(){return b(this,e)}set main(d){d=d.replace(/_/gu," ").trim(),E(this,e,d&&d[0].toUpperCase()+d.slice(1))}get prefix(){const d=b(this,t)[this.ns];return d+(d&&":")}get title(){return this.getRedirection()[1]}get extension(){const{main:d}=this,u=d.lastIndexOf(".");return u===-1?void 0:d.slice(u+1).toLowerCase()}getRedirection(){const{prefix:d}=this,u=d;return R(this,s,Mu).call(this,u)}setFragment(d){E(this,r,d)}getUrl(d){{typeof d=="string"&&(E(this,i,d),b(this,i).includes("$1")||E(this,i,b(this,i)+`${b(this,i).endsWith("/")?"":"/"}$1`));const{title:u,fragment:o}=this;return u?b(this,i).replace("$1",encodeURIComponent(u)+(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,i=new WeakMap,n=new WeakMap,r=new WeakMap,s=new WeakSet,Mu=function(d){var o,c;let u=(d+this.main).replace(/ /gu,"_");if(u.startsWith("/"))u=((o=this.page)!=null?o:"")+u.replace(/(.)\/$/u,"$1");else if(u.startsWith("../")&&((c=this.page)!=null&&c.includes("/"))){const[f,m]=gn(u),y=this.page.split("/");y.length>f&&(u=y.slice(0,-f).join("/")+(m&&"/")+m)}return[!1,u]},a)}}),Uu={};oe(Uu,{LanguageService:()=>zu,tasks:()=>Mn});var Mn,Ta,Ca,Ia,Na,pn,La,Fa,Ea,ja,fn,Ra,mn,wt,xn,Ke,we,vn,bn,St,kt,rt,Jt,yn,Pa,wn,zu,Zd=L({"lib/lsp.ts"(){"use strict";var e,t,i,n,r,s,l,a,d,u,di,Re,Un,zn,Hn,Hu,Dn,$t,T;Ve(),lu(),Xn(),cr(),Q(),ve(),Ie(),Ue(),D(),V(),Mn=new WeakMap,Ta=new Set(["ref"]),Ca=new Set(["ref","references"]),Ia=new Set(["name","follow"]),Na=new Set(["group"]),pn=new Set(["arg-name","template-name","link-target","parameter-key"]),La=new Set(["ext","html","attr-key","image-parameter","heading-title","heading","magic-word-name",...pn]),Fa=new Set(["text","comment","noinclude","include"]),Ea=["ext","html","table"].map(g=>`${g}-attr#style`).join(),ja=ct(g=>new RegExp(`^(?:${g}|//)`,"iu")),fn=({type:g,parentNode:h,length:x,firstChild:p},k)=>g==="attr-value"&&x===1&&p.type==="text"&&(!k||h.name==="style"),Ra=g=>g.is("html-attr")||g.is("table-attr"),mn=g=>g.childNodes.every(({type:h})=>Fa.has(h)),wt=(g,h)=>{const{top:x,left:p}=g.posFromIndex(h);return{line:x,character:p}},xn=(g,h,x)=>({start:wt(g,h),end:wt(g,x)}),Ke=g=>{const{top:h,left:x,height:p,width:k}=g.getBoundingClientRect();return{start:{line:h,character:x},end:xi(h,x,p,k)}},we=(g,h,x,{line:p,character:k},v,w)=>[...new Set(g)].map(A=>{var N;const C=(N=w==null?void 0:w(A))==null?void 0:N.description;return{label:A,kind:h,textEdit:{range:{start:{line:p,character:k-x.length},end:{line:p,character:k}},newText:A+(v!=null?v:"")},...C&&{documentation:{kind:"markdown",value:C}}}}),vn=(g,h,{line:x,character:p})=>{const k=g.indexFromPos(x,p);return g.caretPositionFromIndex(k+Number(/\w/u.test(h.charAt(k))))},bn=(g,h,x)=>{const{type:p,parentNode:k={}}=g,{name:v,tag:w}=k;return p==="attr-value"&&h.has(w)&&x.has(v)?g.toString().trim():NaN},St=g=>bn(g,Ta,Ia),kt=g=>bn(g,Ca,Na),rt=(g,h)=>{const x=g==null?void 0:g.getAttr(h);return x!==!0&&x||!1},Jt=g=>{const{type:h,name:x,parentNode:p}=g;switch(h){case"heading":return g.level;case"heading-title":return p.level;case"parameter-key":return`${p.parentNode.name}|${p.name}`;case"ext":case"html":case"image-parameter":return x;default:return p.name}},yn=(g,h,x=!1)=>({range:xn(g,...h.range),newText:h.text,title:`${x?"Fix":"Suggestion"}: ${h.desc}`,fix:x}),Pa=(g,h)=>{const{lintConfig:x}=F,{rules:p,fix:k,computeEditInfo:v}=x;if(x.fix=!0,x.computeEditInfo=!1,h){x.rules=void 0;for(const A of gi)x.rules[A]=A===h?p[A]:0}const{output:w}=g.lint();return x.fix=k,x.computeEditInfo=v,h&&(x.rules=p),w===void 0?[]:[{range:Ke(g),newText:w}]},wn=async(g,h,x,p=F.getConfig())=>{const k=typeof setImmediate=="function"?setImmediate:setTimeout,{running:v}=pe;pe.running=!0;const{internal:w}=F;F.internal=!0;const A=()=>{pe.running=v,F.internal=w},C=new U(ci(g),p);C.type="root";let N=0;try{await new Promise(B=>{const q=()=>{h()===g?(N++,k(O,0)):B()},O=()=>{N===$e+1?(C.afterBuild(),B()):(C[N===$e?"build":"parseOnce"](N,x),q())};k(O,0)})}catch(B){throw A(),B}return A(),C},zu=(T=class{constructor(g){j(this,u);j(this,e);j(this,t);j(this,i);j(this,n);j(this,r);j(this,s);j(this,l);j(this,a);j(this,d);je(this,"include",!0);je(this,"config");je(this,"data");Mn.set(g,this),Object.defineProperties(this,{config:{enumerable:!1},data:{enumerable:!1}})}destroy(){Object.setPrototypeOf(this,null)}async provideDocumentColors(g,h,x=!0){const p=await R(this,u,Re).call(this,h);return p.querySelectorAll("attr-value,parameter-value,arg-default").reverse().flatMap(k=>{const{type:v,childNodes:w}=k;return v!=="attr-value"&&!mn(k)?[]:w.filter(A=>A.type==="text").reverse().flatMap(A=>{const{data:C}=A,N=Xa(C,x).filter(([,,,q])=>q);if(N.length===0)return[];const B=A.getAbsoluteIndex();return N.map(([q,O,P])=>{const I=g(q);return I.length===4&&{color:{red:I[0]/255,green:I[1]/255,blue:I[2]/255,alpha:I[3]},range:xn(p,B+O,B+P)}}).filter(q=>q!==!1)})})}provideColorPresentations(g){const{color:{red:h,green:x,blue:p,alpha:k},range:v}=g,w=[h,x,p],A=k<1?`rgba(${w.map(C=>Math.round(C*255)).join()},${k})`:`#${w.map(Ja).join("")}`;return[{label:A,textEdit:{range:v,newText:A}}]}async provideCompletionItems(g,h){var ie,ue,be,de,ae,Se,ce;const{re:x,allTags:p,functions:k,switches:v,jaSwitches:w,protocols:A,params:C,tags:N,ext:B}=R(this,u,Hu).call(this),{line:q,character:O}=h,P=g.split(/\r?\n/u,q+1)[q],I=x.exec((ie=P==null?void 0:P.slice(0,O))!=null?ie:""),[,,W={},J={}]=this.config.doubleUnderscore;if((I==null?void 0:I[1])!==void 0){const M=I[1].startsWith("/");return we(p,"Class",I[1].slice(M?1:0),h,M&&!(P!=null&&P.slice(O).trim().startsWith(">"))?">":"")}else if(I!=null&&I[4]||I!=null&&I[5]&&w.length>0){const M=I[5]!==void 0;return we(M?w:v,"Constant",I[M?5:4],h,"",K=>{if(this.data)M||(K=K.slice(2,-2));else return;return K in W?K=W[K]:K in J&&(K=J[K]),R(this,u,Dn).call(this,K.toLowerCase())})}else if((I==null?void 0:I[6])!==void 0)return we(A,"Reference",I[6],h);const X=await R(this,u,Re).call(this,g);let z;if(I!=null&&I[2]){z=X.elementFromPoint(I.index+I[2].length-1,q);const M=(ue=I[3])!=null?ue:"";if(I[2]==="{{{")return we(X.querySelectorAll("arg").filter(te=>te.name&&te!==z).map(({name:te})=>te),"Variable",M,h);const[K,ke]=this.config.parserFunction,he=P.charAt(O),Fe=M.startsWith(":"),Je=Fe?M.slice(1).trimStart():M;if(I[2]==="[[")return we(X.querySelectorAll("link,file,category,redirect-target").filter(te=>te!==z).map(({name:te})=>te),"Folder",Je,h);let Ae=k;return he===":"?Ae=k.filter(te=>!te.endsWith(":")):he===":"&&(Ae=k.filter(te=>te.endsWith(":")).map(te=>te.slice(0,-1))),[...we(Ae,"Function",M,h,"",te=>{if(this.data)te in K?te=K[te]:te in ke&&(te=ke[te]);else return;return R(this,u,$t).call(this,te.toLowerCase())}),...M.startsWith("#")?[]:we(X.querySelectorAll("template").filter(te=>te!==z).map(te=>{const{name:st}=te;if(Fe)return st;const{ns:qt}=te.getAttribute("title");return qt===0?`:${st}`:qt===10?st.slice(9):st}),"Folder",Je,h)]}let H,Z;if((I==null?void 0:I[8])===void 0&&(z=X.elementFromPoint(O,q),{type:H,parentNode:Z}=z),(I==null?void 0:I[7])!==void 0||H==="image-parameter"){const M=X.indexFromPos(q,O),K=(de=(be=I==null?void 0:I[7])==null?void 0:be.trimStart())!=null?de:b(this,e).slice(z.getAbsoluteIndex(),M).trimStart(),ke=b(this,e)[M]==="=";return[...we(C,"Property",K,h).filter(({label:he})=>!ke||!/[= ]$/u.test(he)),...we(X.querySelectorAll("image-parameter#width").filter(he=>he!==z).map(he=>he.text()),"Unit",K,h)]}else if((I==null?void 0:I[8])!==void 0||H==="attr-key"){const M=(Se=(ae=I==null?void 0:I[8])==null?void 0:ae.toLowerCase())!=null?Se:Z.tag,K=(ce=I==null?void 0:I[10])!=null?ce:z.toString().slice(0,O-X.posFromIndex(z.getAbsoluteIndex()).left);if(!N.has(M))return;const ke=or[M],he=ur[M],Fe=he&&we(he,"Field",K,h);return B.includes(M)&&!ke?Fe:[...Fe!=null?Fe:[],...M==="meta"||M==="link"?[]:we(ar,"Property",K,h),...ke?we(ke,"Property",K,h):[],...we(["data-"],"Variable",K,h),...we(["xmlns:"],"Interface",K,h)]}else if(H==="parameter-key"||H==="parameter-value"&&Z.anon){const M=Z.parentNode,{type:K,name:ke}=M;if(K==="magic-word"&&ke!=="invoke")return;const he=b(this,e).slice(z.getAbsoluteIndex(),X.indexFromPos(q,O)).trimStart(),{module:Fe,function:Je}=M;return he?we(X.querySelectorAll("parameter").filter(Ae=>Ae===Z||Ae.anon||Ae.parentNode.type!==K||Ae.parentNode.name!==ke?!1:K==="template"?!0:Ae.parentNode.module===Fe&&Ae.parentNode.function===Je).map(({name:Ae})=>Ae),"Variable",he,h,H==="parameter-value"?"=":""):void 0}else if(H==="param-line"){const M=b(this,e).slice(z.getAbsoluteIndex(),X.indexFromPos(q,O)).trimStart();return/^[a-z]+$/iu.test(M)?we(dr[z.name],"Property",M,h):void 0}else if(fn(z)&&Ra(Z)){const M=ir(Z.tag,Z.name);if(M.length===0)return;const K=b(this,e).slice(z.getAbsoluteIndex(),X.indexFromPos(q,O)).trimStart();return we(M,"Value",K,h)}}async provideDiagnostics(g,h=!0){const x=await R(this,u,Re).call(this,g),{lintConfig:p}=F,k=p.fix;p.fix=!1;const v=x.lint();return p.fix=k,[(h?v:v.filter(({severity:N})=>N==="error")).map(({startLine:N,startCol:B,endLine:q,endCol:O,severity:P,rule:I,message:W,fix:J,suggestions:X})=>({range:{start:{line:N,character:B},end:{line:q,character:O}},severity:P==="error"?1:2,source:"WikiLint",code:I,message:W,data:[...J?[yn(x,J,!0)]:[],...X?X.map(z=>yn(x,z)):[]]})),[],[]].flat(2)}resolveCodeAction(g){if(g.kind!=="source.fixAll")return g;const{rule:h}=g.data;return{...g,edit:{changes:{"":Pa(b(this,r),h)}}}}async provideFoldingRanges(g){const h=await R(this,u,Re).call(this,g),{length:x}=h.getLines(),p=[],k=new Array(6),v=h.querySelectorAll("heading-title,table,template,magic-word");for(const w of[...v].reverse())w.getRelativeIndex();for(const w of v){const{offsetHeight:A}=w;if(w.type==="heading-title"||A>2){const{top:C}=h.posFromIndex(w.getAbsoluteIndex());if(w.type==="heading-title"){const{level:N}=w.parentNode;for(let B=N-1;B<6;B++){const q=k[B];q!==void 0&&q<C-1&&p.push({startLine:q,endLine:C-1,kind:"region"}),k[B]=void 0}k[N-1]=C+A-1}else p.push({startLine:C,endLine:C+A-2,kind:"region"})}}for(const w of k)w!==void 0&&w<x-1&&p.push({startLine:w,endLine:x-1,kind:"region"});return p}async provideLinks(g){var v;(v=this.config)!=null||(this.config=F.getConfig());const{articlePath:h,protocol:x}=this.config,p=h==null?void 0:h.includes("//"),k=ja(x);return(await R(this,u,Re).call(this,g)).querySelectorAll(`magic-link,ext-link-url,free-ext-link,attr-value${p?",link-target,template-name,invoke-module,magic-word#filepath,magic-word#widget":""},image-parameter#link,image-parameter#manualthumb`).reverse().map(w=>{let A;w.is("magic-word")?({name:A}=w,w=w.childNodes[1].lastChild):w.is("image-parameter")&&({name:A}=w);const{type:C,parentNode:N,firstChild:B,lastChild:q,childNodes:O,length:P}=w,{tag:I}=N;if(A!=null||(A=N.name),!(C!=="attr-value"||A==="cite"&&["blockquote","del","ins","q"].includes(I)||A==="src"&&["templatestyles","img"].includes(I)||A==="templatename"&&I==="rss"||A==="file"&&I==="phonos")||!mn(w))return!1;let W=O.filter(J=>J.type==="text").map(({data:J})=>J).join("").trim();if(!W)return!1;try{if(w.is("magic-link")||w.is("ext-link-url")||w.is("free-ext-link"))W=w.getUrl(h);else if(C==="link-target"&&(N.is("link")||N.is("redirect-target")||N.is("category"))){if(/^(?:\.\.)?\//u.test(W))return!1;W=N.link.getUrl(h)}else if(C==="link-target"||C==="template-name")W=N.getAttribute("title").getUrl(h);else if(["invoke-module","parameter-value"].includes(C)||C==="attr-value"&&(A==="src"&&I==="templatestyles"||A==="templatename"&&I==="rss"||A==="file"&&I==="phonos")||C==="image-parameter"&&(A==="manualthumb"||!k.test(W))){if(!p||W.startsWith("/"))return!1;C==="image-parameter"&&A==="manualthumb"||C==="parameter-value"&&A==="filepath"||C==="attr-value"&&I==="phonos"?W=`File:${W}`:C==="parameter-value"?W=`Widget:${W}`:C==="invoke-module"&&(W=`Module:${W}`);const J=F.normalizeTitle(W,C==="attr-value"?10:0,!1,this.config,{temporary:!0});if(!J.valid)return!1;W=J.getUrl()}if(typeof W=="string"&&W.startsWith("//")&&(W=`https:${W}`),W=new URL(W).href,C==="image-parameter"){const J=B.getBoundingClientRect(),{top:X,left:z,height:H,width:Z}=P===1?J:q.getBoundingClientRect();return{range:{start:{line:J.top,character:J.left},end:xi(X,z,H,Z)},target:W}}return{range:Ke(w),target:W}}catch{return!1}}).filter(w=>w!==!1)}async provideReferences(g,h){const x=await R(this,u,Re).call(this,g),{offsetNode:p,offset:k}=vn(x,b(this,e),h),v=p.type==="text"?p.parentNode:p,w=k===0&&(v.is("ext-attr-dirty")||v.is("html-attr-dirty"))?v.parentNode.parentNode:v,{type:A}=w,C=St(w),N=kt(w);if(!C&&!N&&!La.has(A))return;const B=Jt(w),q=x.querySelectorAll(A==="heading-title"?"heading":A).filter(O=>A==="attr-value"?St(O)===C||kt(O)===N:Jt(O)===B).reverse().map(O=>({range:Ke(O.type==="parameter-key"?O.parentNode:O)}));return q.length===0?void 0:q}async provideDefinition(g,h){const x=await R(this,u,Re).call(this,g),p=x.elementFromPoint(h.character,h.line),k=p.is("ext")&&p.name==="ref"?p:p.closest("ext#ref"),v=rt(k,"name");if(!v)return;const w=rt(k,"group"),A=x.querySelectorAll("ext#ref").filter(C=>C.innerText&&rt(C,"name")===v&&rt(C,"group")===w).reverse().map(({lastChild:C})=>({range:Ke(C)}));return A.length===0?void 0:A}async resolveRenameLocation(g,h){const x=await R(this,u,Re).call(this,g),p=x.elementFromPoint(h.character,h.line),{type:k}=p,v=St(p),w=kt(p);return!v&&!w&&(!pn.has(k)||k==="parameter-key"&&/^[1-9]\d*$/u.test(p.parentNode.name)||k==="link-target"&&!["link","redirect-target"].includes(p.parentNode.type))?void 0:Ke(p)}async provideRenameEdits(g,h,x){const p=await R(this,u,Re).call(this,g),k=p.elementFromPoint(h.character,h.line),{type:v}=k,w=St(k),A=w&&rt(k.parentNode.parentNode,"group"),C=kt(k),N=Jt(k),B=p.querySelectorAll(v).filter(q=>{const{type:O}=q.parentNode;return v==="link-target"&&O!=="link"&&O!=="redirect-target"?!1:v==="attr-value"?kt(q)===C||St(q)===w&&rt(q.parentNode.parentNode,"group")===A:Jt(q)===N});return B.length===0?void 0:{changes:{"":B.reverse().map(q=>({range:Ke(q),newText:x}))}}}async provideHover(g,h){if(!this.data)return;const x=await R(this,u,Re).call(this,g);let{offsetNode:p,offset:k}=vn(x,b(this,e),h);p.type==="text"&&(k+=p.getRelativeIndex(),p=p.parentNode);const{type:v,parentNode:w,length:A,name:C}=p;let N,B,q,O;if(p.is("double-underscore")&&k>0)N=R(this,u,Dn).call(this,p.name);else if(v==="magic-word-name")N=R(this,u,$t).call(this,w.name),B=p.text().trim(),q=w.getAttribute("colon");else if(p.is("magic-word")&&!p.modifier&&A===1&&(k>0||x.posFromIndex(p.getAbsoluteIndex()).left===h.character))N=R(this,u,$t).call(this,C),B=p.firstChild.text().trim(),q=p.getAttribute("colon");else if((p.is("magic-word")||p.is("template"))&&p.modifier&&k>=2&&p.getRelativeIndex(0)>k&&(B=p.modifier.trim().slice(0,-1),N=R(this,u,$t).call(this,B.toLowerCase()),q=":",N)){const P=p.getAbsoluteIndex();O={start:wt(x,P+2),end:wt(x,P+p.modifier.trimEnd().length+1)}}return N&&{contents:{kind:"markdown",value:(N.signatures?`${N.signatures.map(P=>`- **{{ ${B}${P.length===0?"**":`${q}** `}${P.map(({label:I,const:W})=>W?I:`*${I}*`).join(" **|** ")} **}}**`).join(`
|
|
32
|
+
`))},Pu=function(){if(b(this,i).variants.length>0){const{parseConverter:v}=(Xd(),se(ku));this.setText(v(this.firstChild.toString(),b(this,i),b(this,n)))}},x)}}),pe,ss,Ou,Bu,yi,qu,Wu,Ie=L({"util/debug.ts"(){"use strict";pe={running:!1,run(e,t){const{running:i}=this;this.running=!0;const n=t==null?void 0:t.internal;t&&(t.internal=!0);const r=()=>{this.running=i,t&&(t.internal=n)};try{const{Token:s}=(V(),se(Qi)),l=e();return l instanceof s&&!l.getAttribute("built")&&l.afterBuild(),r(),l}catch(s){throw r(),s}},internal(e,t){const{internal:i}=t;t.internal=!0;const n=e();return t.internal=i,n},rev:0},ss=e=>t=>t.type===e,Ou=({type:e})=>e==="tr"||e==="table-syntax",Bu=e=>e==="redirect-target"||e==="link",yi=(e,t,i,n=[])=>{var l,a;let r=e.getChildNodes(),s;r.length===i?(s=r,r=n):s=Array.prototype.splice.apply(r,[t,i,...n]);for(let d=0;d<n.length;d++){const o=n[d];o.setAttribute("parentNode",e),o.setAttribute("nextSibling",r[t+d+1]),o.setAttribute("previousSibling",r[t+d-1])}return(l=r[t-1])==null||l.setAttribute("nextSibling",r[t]),(a=r[t+n.length])==null||a.setAttribute("previousSibling",r[t+n.length-1]),r===n&&e.setAttribute("childNodes",r),s},qu=(e,t)=>{const i=e.toLowerCase(),[n,r]=t,s=Object.prototype.hasOwnProperty.call(r,e);return[i,s,s?r[e]:Object.prototype.hasOwnProperty.call(n,i)&&n[i]]},Wu=(e,t)=>Array.from({length:e},(i,n)=>t(n))}}),yt,dn,Oi,cn,Aa,hn,$a,_a,qn,Kd=L({"lib/lintConfig.ts"(){"use strict";var e,t;Xn(),yt=new Map([[0,!1],[1,"warning"],[2,"error"],[!1,!1],["off",!1],["warning","warning"],["error","error"]]),dn={"arg-in-ext":1,"bold-header":[1,{}],"format-leakage":[1,{}],"fostered-content":[1,{}],h1:[1,{}],"illegal-attr":[2,{}],"insecure-style":2,"invalid-gallery":[2,{parameter:1}],"invalid-imagemap":[2,{}],"invalid-invoke":[2,{}],"invalid-isbn":2,"invalid-json":[2,{duplicate:1}],"invalid-url":1,"lonely-apos":[1,{}],"lonely-bracket":[1,{extLink:2}],"lonely-http":[1,{}],"nested-link":[2,{}],"no-arg":1,"no-duplicate":[2,{category:1,id:1,unknownImageParameter:1}],"no-ignored":[2,{fragment:1,galleryComment:1,galleryNoImage:1,include:1,nonWordAttributes:1,redirect:1}],"obsolete-attr":1,"obsolete-tag":1,"parsing-order":[2,{templateInTable:1}],"pipe-like":[1,{double:2}],"syntax-like":[2,{}],"table-layout":1,"tag-like":[2,{disallowed:1,invalid:1}],"unbalanced-header":2,"unclosed-comment":[1,{}],"unclosed-quote":1,"unclosed-table":2,unescaped:2,"unknown-page":1,"unmatched-tag":[1,{both:2,selfClosing:2}],"unterminated-url":[1,{}],"url-encoding":[1,{}],"var-anchor":[1,{}],"void-ext":[2,{}]},Object.freeze(dn),Oi={configurationComment:"lint",ignoreDisables:!1,fix:!0,computeEditInfo:!0},Object.freeze(Oi),cn=i=>yt.has(i),Aa=i=>cn(i)||Array.isArray(i)&&cn(i[0])&&(i.length===1||typeof i[1]=="object"),hn=(i,n,r)=>{if(gi.includes(n)){if(r===void 0)return!1;if(Aa(r))return i[n]=r,!0}else throw new RangeError(`Unknown lint rule: ${n}`);throw new RangeError(`Invalid lint config for ${n}: ${JSON.stringify(r)}`)},$a=typeof structuredClone=="function"?structuredClone:(i=>JSON.parse(JSON.stringify(i))),_a=class{constructor(i){if(Object.assign(this,$a(dn)),!!i)for(const[n,r]of Object.entries(i))hn(this,n,r)}getSeverity(i,n){var s,l;const r=this[i];return typeof r!="object"?yt.get(r):n&&(l=yt.get((s=r[1])==null?void 0:s[n]))!=null?l:yt.get(r[0])}},qn=(t=class{constructor(i){j(this,e);if(Object.assign(this,Oi),i&&!("rules"in i)&&Object.keys(i).some(n=>gi.includes(n)))this.rules=i;else{const{rules:n,...r}=i!=null?i:{};this.rules=n;for(const[s,l]of Object.entries(r))l!==void 0&&Object.prototype.hasOwnProperty.call(Oi,s)&&(this[s]=l)}}get rules(){return b(this,e)}set rules(i){E(this,e,new Proxy(new _a(i),{set:hn,deleteProperty(){return!1}}))}getSeverity(i,n){return b(this,e).getSeverity(i,n)}},e=new WeakMap,t)}}),gn,Wn,Yd=L({"lib/title.ts"(){"use strict";var e,t,i,n,r,s,Mu,a;Ve(),ve(),gn=d=>{const[,{length:o},u]=/^((?:\.\.\/)*)([\s\S]*)/u.exec(d);return[o/3,u]},Wn=(a=class{constructor(d,o,u,{temporary:c,decode:f,selfLink:m,page:y}={}){j(this,s);j(this,e);j(this,t);j(this,i);j(this,n);j(this,r);je(this,"page");je(this,"valid");je(this,"encoded",!1);this.page=y;const S=d.trim(),$=S.startsWith("../");if(f&&d.includes("%"))try{const h=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(d);d=mi(d),this.encoded=h}catch{}if(d=pi(d).replace(/[_ ]+/gu," ").trim(),$||y&&S.startsWith("/"))E(this,n,0);else{let h=o;d.startsWith(":")&&(h=0,d=d.slice(1).trim());const x=d.split(":");if(x.length>1){const p=jt(x[0]),k=Object.prototype.hasOwnProperty.call(u.nsid,p)&&u.nsid[p];k&&(h=k,d=x.slice(1).join(":").trim())}E(this,n,h)}const _=d.indexOf("#");if(_!==-1){let h=d.slice(_).trim().slice(1);if(h.includes("%"))try{h=mi(h)}catch{}E(this,r,h.replace(/ /gu,"_")),d=d.slice(0,_).trim()}const[T,g]=$?gn(d):[0,d];this.valid=!!(d||m&&this.ns===0&&b(this,r)!==void 0)&&pi(d)===d&&(T===0||y===void 0||y.split("/",T+1).length>T)&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(g),this.main=d,E(this,t,u.namespaces),E(this,i,u.articlePath||"/wiki/$1"),b(this,i).includes("$1")||E(this,i,b(this,i)+`${b(this,i).endsWith("/")?"":"/"}$1`),c||Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}})}get ns(){return b(this,n)}get fragment(){return b(this,r)}get main(){return b(this,e)}set main(d){d=d.replace(/_/gu," ").trim(),E(this,e,d&&d[0].toUpperCase()+d.slice(1))}get prefix(){const d=b(this,t)[this.ns];return d+(d&&":")}get title(){return this.getRedirection()[1]}get extension(){const{main:d}=this,o=d.lastIndexOf(".");return o===-1?void 0:d.slice(o+1).toLowerCase()}getRedirection(){const{prefix:d}=this,o=d;return R(this,s,Mu).call(this,o)}setFragment(d){E(this,r,d)}getUrl(d){{typeof d=="string"&&(E(this,i,d),b(this,i).includes("$1")||E(this,i,b(this,i)+`${b(this,i).endsWith("/")?"":"/"}$1`));const{title:o,fragment:u}=this;return o?b(this,i).replace("$1",encodeURIComponent(o)+(u?`#${encodeURIComponent(u)}`:"")):u===void 0?"":`#${encodeURIComponent(u)}`}throw new Error("Title.getUrl method is only available in the LSP version!")}},e=new WeakMap,t=new WeakMap,i=new WeakMap,n=new WeakMap,r=new WeakMap,s=new WeakSet,Mu=function(d){var u,c;let o=(d+this.main).replace(/ /gu,"_");if(o.startsWith("/"))o=((u=this.page)!=null?u:"")+o.replace(/(.)\/$/u,"$1");else if(o.startsWith("../")&&((c=this.page)!=null&&c.includes("/"))){const[f,m]=gn(o),y=this.page.split("/");y.length>f&&(o=y.slice(0,-f).join("/")+(m&&"/")+m)}return[!1,o]},a)}}),Uu={};oe(Uu,{LanguageService:()=>zu,tasks:()=>Mn});var Mn,Ta,Ca,Ia,Na,pn,La,Fa,Ea,ja,fn,Ra,mn,wt,xn,Ke,we,vn,bn,St,kt,rt,Jt,yn,Pa,wn,zu,Zd=L({"lib/lsp.ts"(){"use strict";var e,t,i,n,r,s,l,a,d,o,di,Re,Un,zn,Hn,Hu,Dn,$t,T;Ve(),lu(),Xn(),cr(),Q(),ve(),Ie(),Ue(),D(),V(),Mn=new WeakMap,Ta=new Set(["ref"]),Ca=new Set(["ref","references"]),Ia=new Set(["name","follow"]),Na=new Set(["group"]),pn=new Set(["arg-name","template-name","link-target","parameter-key"]),La=new Set(["ext","html","attr-key","image-parameter","heading-title","heading","magic-word-name",...pn]),Fa=new Set(["text","comment","noinclude","include"]),Ea=["ext","html","table"].map(g=>`${g}-attr#style`).join(),ja=ct(g=>new RegExp(`^(?:${g}|//)`,"iu")),fn=({type:g,parentNode:h,length:x,firstChild:p},k)=>g==="attr-value"&&x===1&&p.type==="text"&&(!k||h.name==="style"),Ra=g=>g.is("html-attr")||g.is("table-attr"),mn=g=>g.childNodes.every(({type:h})=>Fa.has(h)),wt=(g,h)=>{const{top:x,left:p}=g.posFromIndex(h);return{line:x,character:p}},xn=(g,h,x)=>({start:wt(g,h),end:wt(g,x)}),Ke=g=>{const{top:h,left:x,height:p,width:k}=g.getBoundingClientRect();return{start:{line:h,character:x},end:xi(h,x,p,k)}},we=(g,h,x,{line:p,character:k},v,w)=>[...new Set(g)].map(A=>{var N;const C=(N=w==null?void 0:w(A))==null?void 0:N.description;return{label:A,kind:h,textEdit:{range:{start:{line:p,character:k-x.length},end:{line:p,character:k}},newText:A+(v!=null?v:"")},...C&&{documentation:{kind:"markdown",value:C}}}}),vn=(g,h,{line:x,character:p})=>{const k=g.indexFromPos(x,p);return g.caretPositionFromIndex(k+Number(/\w/u.test(h.charAt(k))))},bn=(g,h,x)=>{const{type:p,parentNode:k={}}=g,{name:v,tag:w}=k;return p==="attr-value"&&h.has(w)&&x.has(v)?g.toString().trim():NaN},St=g=>bn(g,Ta,Ia),kt=g=>bn(g,Ca,Na),rt=(g,h)=>{const x=g==null?void 0:g.getAttr(h);return x!==!0&&x||!1},Jt=g=>{const{type:h,name:x,parentNode:p}=g;switch(h){case"heading":return g.level;case"heading-title":return p.level;case"parameter-key":return`${p.parentNode.name}|${p.name}`;case"ext":case"html":case"image-parameter":return x;default:return p.name}},yn=(g,h,x=!1)=>({range:xn(g,...h.range),newText:h.text,title:`${x?"Fix":"Suggestion"}: ${h.desc}`,fix:x}),Pa=(g,h)=>{const{lintConfig:x}=F,{rules:p,fix:k,computeEditInfo:v}=x;if(x.fix=!0,x.computeEditInfo=!1,h){x.rules=void 0;for(const A of gi)x.rules[A]=A===h?p[A]:0}const{output:w}=g.lint();return x.fix=k,x.computeEditInfo=v,h&&(x.rules=p),w===void 0?[]:[{range:Ke(g),newText:w}]},wn=async(g,h,x,p=F.getConfig())=>{const k=typeof setImmediate=="function"?setImmediate:setTimeout,{running:v}=pe;pe.running=!0;const{internal:w}=F;F.internal=!0;const A=()=>{pe.running=v,F.internal=w},C=new U(ci(g),p);C.type="root";let N=0;try{await new Promise(B=>{const q=()=>{h()===g?(N++,k(O,0)):B()},O=()=>{N===$e+1?(C.afterBuild(),B()):(C[N===$e?"build":"parseOnce"](N,x),q())};k(O,0)})}catch(B){throw A(),B}return A(),C},zu=(T=class{constructor(g){j(this,o);j(this,e);j(this,t);j(this,i);j(this,n);j(this,r);j(this,s);j(this,l);j(this,a);j(this,d);je(this,"include",!0);je(this,"config");je(this,"data");Mn.set(g,this),Object.defineProperties(this,{config:{enumerable:!1},data:{enumerable:!1}})}destroy(){Object.setPrototypeOf(this,null)}async provideDocumentColors(g,h,x=!0){const p=await R(this,o,Re).call(this,h);return p.querySelectorAll("attr-value,parameter-value,arg-default").reverse().flatMap(k=>{const{type:v,childNodes:w}=k;return v!=="attr-value"&&!mn(k)?[]:w.filter(A=>A.type==="text").reverse().flatMap(A=>{const{data:C}=A,N=Xa(C,x).filter(([,,,q])=>q);if(N.length===0)return[];const B=A.getAbsoluteIndex();return N.map(([q,O,P])=>{const I=g(q);return I.length===4&&{color:{red:I[0]/255,green:I[1]/255,blue:I[2]/255,alpha:I[3]},range:xn(p,B+O,B+P)}}).filter(q=>q!==!1)})})}provideColorPresentations(g){const{color:{red:h,green:x,blue:p,alpha:k},range:v}=g,w=[h,x,p],A=k<1?`rgba(${w.map(C=>Math.round(C*255)).join()},${k})`:`#${w.map(Ja).join("")}`;return[{label:A,textEdit:{range:v,newText:A}}]}async provideCompletionItems(g,h){var ie,ue,be,de,ae,Se,ce;const{re:x,allTags:p,functions:k,switches:v,jaSwitches:w,protocols:A,params:C,tags:N,ext:B}=R(this,o,Hu).call(this),{line:q,character:O}=h,P=g.split(/\r?\n/u,q+1)[q],I=x.exec((ie=P==null?void 0:P.slice(0,O))!=null?ie:""),[,,W={},J={}]=this.config.doubleUnderscore;if((I==null?void 0:I[1])!==void 0){const M=I[1].startsWith("/");return we(p,"Class",I[1].slice(M?1:0),h,M&&!(P!=null&&P.slice(O).trim().startsWith(">"))?">":"")}else if(I!=null&&I[4]||I!=null&&I[5]&&w.length>0){const M=I[5]!==void 0;return we(M?w:v,"Constant",I[M?5:4],h,"",K=>{if(this.data)M||(K=K.slice(2,-2));else return;return K in W?K=W[K]:K in J&&(K=J[K]),R(this,o,Dn).call(this,K.toLowerCase())})}else if((I==null?void 0:I[6])!==void 0)return we(A,"Reference",I[6],h);const X=await R(this,o,Re).call(this,g);let z;if(I!=null&&I[2]){z=X.elementFromPoint(I.index+I[2].length-1,q);const M=(ue=I[3])!=null?ue:"";if(I[2]==="{{{")return we(X.querySelectorAll("arg").filter(te=>te.name&&te!==z).map(({name:te})=>te),"Variable",M,h);const[K,ke]=this.config.parserFunction,he=P.charAt(O),Fe=M.startsWith(":"),Je=Fe?M.slice(1).trimStart():M;if(I[2]==="[[")return we(X.querySelectorAll("link,file,category,redirect-target").filter(te=>te!==z).map(({name:te})=>te),"Folder",Je,h);let Ae=k;return he===":"?Ae=k.filter(te=>!te.endsWith(":")):he===":"&&(Ae=k.filter(te=>te.endsWith(":")).map(te=>te.slice(0,-1))),[...we(Ae,"Function",M,h,"",te=>{if(this.data)te in K?te=K[te]:te in ke&&(te=ke[te]);else return;return R(this,o,$t).call(this,te.toLowerCase())}),...M.startsWith("#")?[]:we(X.querySelectorAll("template").filter(te=>te!==z).map(te=>{const{name:st}=te;if(Fe)return st;const{ns:qt}=te.getAttribute("title");return qt===0?`:${st}`:qt===10?st.slice(9):st}),"Folder",Je,h)]}let H,Z;if((I==null?void 0:I[8])===void 0&&(z=X.elementFromPoint(O,q),{type:H,parentNode:Z}=z),(I==null?void 0:I[7])!==void 0||H==="image-parameter"){const M=X.indexFromPos(q,O),K=(de=(be=I==null?void 0:I[7])==null?void 0:be.trimStart())!=null?de:b(this,e).slice(z.getAbsoluteIndex(),M).trimStart(),ke=b(this,e)[M]==="=";return[...we(C,"Property",K,h).filter(({label:he})=>!ke||!/[= ]$/u.test(he)),...we(X.querySelectorAll("image-parameter#width").filter(he=>he!==z).map(he=>he.text()),"Unit",K,h)]}else if((I==null?void 0:I[8])!==void 0||H==="attr-key"){const M=(Se=(ae=I==null?void 0:I[8])==null?void 0:ae.toLowerCase())!=null?Se:Z.tag,K=(ce=I==null?void 0:I[10])!=null?ce:z.toString().slice(0,O-X.posFromIndex(z.getAbsoluteIndex()).left);if(!N.has(M))return;const ke=or[M],he=ur[M],Fe=he&&we(he,"Field",K,h);return B.includes(M)&&!ke?Fe:[...Fe!=null?Fe:[],...M==="meta"||M==="link"?[]:we(ar,"Property",K,h),...ke?we(ke,"Property",K,h):[],...we(["data-"],"Variable",K,h),...we(["xmlns:"],"Interface",K,h)]}else if(H==="parameter-key"||H==="parameter-value"&&Z.anon){const M=Z.parentNode,{type:K,name:ke}=M;if(K==="magic-word"&&ke!=="invoke")return;const he=b(this,e).slice(z.getAbsoluteIndex(),X.indexFromPos(q,O)).trimStart(),{module:Fe,function:Je}=M;return he?we(X.querySelectorAll("parameter").filter(Ae=>Ae===Z||Ae.anon||Ae.parentNode.type!==K||Ae.parentNode.name!==ke?!1:K==="template"?!0:Ae.parentNode.module===Fe&&Ae.parentNode.function===Je).map(({name:Ae})=>Ae),"Variable",he,h,H==="parameter-value"?"=":""):void 0}else if(H==="param-line"){const M=b(this,e).slice(z.getAbsoluteIndex(),X.indexFromPos(q,O)).trimStart();return/^[a-z]+$/iu.test(M)?we(dr[z.name],"Property",M,h):void 0}else if(fn(z)&&Ra(Z)){const M=ir(Z.tag,Z.name);if(M.length===0)return;const K=b(this,e).slice(z.getAbsoluteIndex(),X.indexFromPos(q,O)).trimStart();return we(M,"Value",K,h)}}async provideDiagnostics(g,h=!0){const x=await R(this,o,Re).call(this,g),{lintConfig:p}=F,k=p.fix;p.fix=!1;const v=x.lint();return p.fix=k,[(h?v:v.filter(({severity:N})=>N==="error")).map(({startLine:N,startCol:B,endLine:q,endCol:O,severity:P,rule:I,message:W,fix:J,suggestions:X})=>({range:{start:{line:N,character:B},end:{line:q,character:O}},severity:P==="error"?1:2,source:"WikiLint",code:I,message:W,data:[...J?[yn(x,J,!0)]:[],...X?X.map(z=>yn(x,z)):[]]})),[],[]].flat(2)}resolveCodeAction(g){if(g.kind!=="source.fixAll")return g;const{rule:h}=g.data;return{...g,edit:{changes:{"":Pa(b(this,r),h)}}}}async provideFoldingRanges(g){const h=await R(this,o,Re).call(this,g),{length:x}=h.getLines(),p=[],k=new Array(6),v=h.querySelectorAll("heading-title,table,template,magic-word");for(const w of[...v].reverse())w.getRelativeIndex();for(const w of v){const{offsetHeight:A}=w;if(w.type==="heading-title"||A>2){const{top:C}=h.posFromIndex(w.getAbsoluteIndex());if(w.type==="heading-title"){const{level:N}=w.parentNode;for(let B=N-1;B<6;B++){const q=k[B];q!==void 0&&q<C-1&&p.push({startLine:q,endLine:C-1,kind:"region"}),k[B]=void 0}k[N-1]=C+A-1}else p.push({startLine:C,endLine:C+A-2,kind:"region"})}}for(const w of k)w!==void 0&&w<x-1&&p.push({startLine:w,endLine:x-1,kind:"region"});return p}async provideLinks(g){var v;(v=this.config)!=null||(this.config=F.getConfig());const{articlePath:h,protocol:x}=this.config,p=h==null?void 0:h.includes("//"),k=ja(x);return(await R(this,o,Re).call(this,g)).querySelectorAll(`magic-link,ext-link-url,free-ext-link,attr-value${p?",link-target,template-name,invoke-module,magic-word#filepath,magic-word#widget":""},image-parameter#link,image-parameter#manualthumb`).reverse().map(w=>{let A;w.is("magic-word")?({name:A}=w,w=w.childNodes[1].lastChild):w.is("image-parameter")&&({name:A}=w);const{type:C,parentNode:N,firstChild:B,lastChild:q,childNodes:O,length:P}=w,{tag:I}=N;if(A!=null||(A=N.name),!(C!=="attr-value"||A==="cite"&&["blockquote","del","ins","q"].includes(I)||A==="src"&&["templatestyles","img"].includes(I)||A==="templatename"&&I==="rss"||A==="file"&&I==="phonos")||!mn(w))return!1;let W=O.filter(J=>J.type==="text").map(({data:J})=>J).join("").trim();if(!W)return!1;try{if(w.is("magic-link")||w.is("ext-link-url")||w.is("free-ext-link"))W=w.getUrl(h);else if(C==="link-target"&&(N.is("link")||N.is("redirect-target")||N.is("category"))){if(/^(?:\.\.)?\//u.test(W))return!1;W=N.link.getUrl(h)}else if(C==="link-target"||C==="template-name")W=N.getAttribute("title").getUrl(h);else if(["invoke-module","parameter-value"].includes(C)||C==="attr-value"&&(A==="src"&&I==="templatestyles"||A==="templatename"&&I==="rss"||A==="file"&&I==="phonos")||C==="image-parameter"&&(A==="manualthumb"||!k.test(W))){if(!p||W.startsWith("/"))return!1;C==="image-parameter"&&A==="manualthumb"||C==="parameter-value"&&A==="filepath"||C==="attr-value"&&I==="phonos"?W=`File:${W}`:C==="parameter-value"?W=`Widget:${W}`:C==="invoke-module"&&(W=`Module:${W}`);const J=F.normalizeTitle(W,C==="attr-value"?10:0,!1,this.config,{temporary:!0});if(!J.valid)return!1;W=J.getUrl()}if(typeof W=="string"&&W.startsWith("//")&&(W=`https:${W}`),W=new URL(W).href,C==="image-parameter"){const J=B.getBoundingClientRect(),{top:X,left:z,height:H,width:Z}=P===1?J:q.getBoundingClientRect();return{range:{start:{line:J.top,character:J.left},end:xi(X,z,H,Z)},target:W}}return{range:Ke(w),target:W}}catch{return!1}}).filter(w=>w!==!1)}async provideReferences(g,h){const x=await R(this,o,Re).call(this,g),{offsetNode:p,offset:k}=vn(x,b(this,e),h),v=p.type==="text"?p.parentNode:p,w=k===0&&(v.is("ext-attr-dirty")||v.is("html-attr-dirty"))?v.parentNode.parentNode:v,{type:A}=w,C=St(w),N=kt(w);if(!C&&!N&&!La.has(A))return;const B=Jt(w),q=x.querySelectorAll(A==="heading-title"?"heading":A).filter(O=>A==="attr-value"?St(O)===C||kt(O)===N:Jt(O)===B).reverse().map(O=>({range:Ke(O.type==="parameter-key"?O.parentNode:O)}));return q.length===0?void 0:q}async provideDefinition(g,h){const x=await R(this,o,Re).call(this,g),p=x.elementFromPoint(h.character,h.line),k=p.is("ext")&&p.name==="ref"?p:p.closest("ext#ref"),v=rt(k,"name");if(!v)return;const w=rt(k,"group"),A=x.querySelectorAll("ext#ref").filter(C=>C.innerText&&rt(C,"name")===v&&rt(C,"group")===w).reverse().map(({lastChild:C})=>({range:Ke(C)}));return A.length===0?void 0:A}async resolveRenameLocation(g,h){const x=await R(this,o,Re).call(this,g),p=x.elementFromPoint(h.character,h.line),{type:k}=p,v=St(p),w=kt(p);return!v&&!w&&(!pn.has(k)||k==="parameter-key"&&/^[1-9]\d*$/u.test(p.parentNode.name)||k==="link-target"&&!["link","redirect-target"].includes(p.parentNode.type))?void 0:Ke(p)}async provideRenameEdits(g,h,x){const p=await R(this,o,Re).call(this,g),k=p.elementFromPoint(h.character,h.line),{type:v}=k,w=St(k),A=w&&rt(k.parentNode.parentNode,"group"),C=kt(k),N=Jt(k),B=p.querySelectorAll(v).filter(q=>{const{type:O}=q.parentNode;return v==="link-target"&&O!=="link"&&O!=="redirect-target"?!1:v==="attr-value"?kt(q)===C||St(q)===w&&rt(q.parentNode.parentNode,"group")===A:Jt(q)===N});return B.length===0?void 0:{changes:{"":B.reverse().map(q=>({range:Ke(q),newText:x}))}}}async provideHover(g,h){if(!this.data)return;const x=await R(this,o,Re).call(this,g);let{offsetNode:p,offset:k}=vn(x,b(this,e),h);p.type==="text"&&(k+=p.getRelativeIndex(),p=p.parentNode);const{type:v,parentNode:w,length:A,name:C}=p;let N,B,q,O;if(p.is("double-underscore")&&k>0)N=R(this,o,Dn).call(this,p.name);else if(v==="magic-word-name")N=R(this,o,$t).call(this,w.name),B=p.text().trim(),q=w.getAttribute("colon");else if(p.is("magic-word")&&!p.modifier&&A===1&&(k>0||x.posFromIndex(p.getAbsoluteIndex()).left===h.character))N=R(this,o,$t).call(this,C),B=p.firstChild.text().trim(),q=p.getAttribute("colon");else if((p.is("magic-word")||p.is("template"))&&p.modifier&&k>=2&&p.getRelativeIndex(0)>k&&(B=p.modifier.trim().slice(0,-1),N=R(this,o,$t).call(this,B.toLowerCase()),q=":",N)){const P=p.getAbsoluteIndex();O={start:wt(x,P+2),end:wt(x,P+p.modifier.trimEnd().length+1)}}return N&&{contents:{kind:"markdown",value:(N.signatures?`${N.signatures.map(P=>`- **{{ ${B}${P.length===0?"**":`${q}** `}${P.map(({label:I,const:W})=>W?I:`*${I}*`).join(" **|** ")} **}}**`).join(`
|
|
33
33
|
`)}
|
|
34
34
|
|
|
35
|
-
`:"")+N.description},range:O!=null?O:Ke(p)}}async provideSignatureHelp(g,h){if(!this.data)return;const{line:x,character:p}=h,k=g.split(/\r?\n/u,x+1)[x],{lastChild:v}=await R(this,
|
|
35
|
+
`:"")+N.description},range:O!=null?O:Ke(p)}}async provideSignatureHelp(g,h){if(!this.data)return;const{line:x,character:p}=h,k=g.split(/\r?\n/u,x+1)[x],{lastChild:v}=await R(this,o,zn).call(this,`${k.slice(0,p+/^[^{}<]*/u.exec(k.slice(p))[0].length)}}}`);if(!v.is("magic-word")||v.length===1)return;const{name:w,childNodes:A,firstChild:C}=v,N=R(this,o,$t).call(this,w);if(!(N!=null&&N.signatures))return;const B=A.length-1,q=N.signatures.filter(W=>{var J;return(W.length>=B||((J=W[W.length-1])==null?void 0:J.rest))&&W.every(({label:X,const:z},H)=>{var ie;const Z=z&&H<B&&((ie=A[H+1])==null?void 0:ie.text().trim());return!Z||X.toLowerCase().includes(Z.toLowerCase())})});if(q.length===0)return;let O=-1;for(let W=v.getAbsoluteIndex()+v.getAttribute("padding");O<B&&(W+=A[O+1].toString().length+1,!(W>p));O++);const P=C.text().trim(),I=v.getAttribute("colon");return{signatures:q.map(W=>({label:`{{${P}${W.length===0?"":I}${W.map(({label:J})=>J).join("|")}}}`,parameters:W.map(({label:J,const:X})=>({label:J,...X?{documentation:"Predefined parameter"}:void 0})),...W.length<B?{activeParameter:Math.min(O,W.length-1)}:void 0})),activeParameter:O}}async provideInlayHints(g){const h=await R(this,o,Re).call(this,g);let x=[];for(const p of h.querySelectorAll("template,magic-word#invoke").reverse()){const{type:k,childNodes:v}=p;x=[...x,...v.slice(k==="template"?1:3).filter(({anon:w})=>w).reverse().map(w=>({position:wt(h,w.getAbsoluteIndex()),label:`${w.name}=`,kind:2}))]}return x}findStyleTokens(){return b(this,r).querySelectorAll(Ea).filter(({lastChild:g})=>fn(g))}async provideRefactoringAction(g,h){let x,p;if(h){const{start:w,end:A}=h;if(w.line===A.line&&w.character===A.character)return[];x=g.split(/\r?\n/u,A.line+1),p=w.line===A.line?x[A.line].slice(w.character,A.character):`${x[w.line].slice(w.character)}
|
|
36
36
|
${x.slice(w.line+1,A.line).join(`
|
|
37
37
|
`)}${x.length===2?"":`
|
|
38
38
|
`}${x[A.line].slice(0,A.character)}`}else if(g)x=g.split(/\r?\n/u),p=x.join(`
|
|
39
|
-
`),h={start:{line:0,character:0},end:{line:x.length-1,character:x[x.length-1].length}};else return[];const k=await R(this,
|
|
39
|
+
`),h={start:{line:0,character:0},end:{line:x.length-1,character:x[x.length-1].length}};else return[];const k=await R(this,o,zn).call(this,p),{viewOnly:v}=F;return F.viewOnly=!1,pe.internal(()=>{k.escape()},F),F.viewOnly=v,[{title:"Escape with magic words",kind:"refactor.rewrite",edit:{changes:{"":[{range:h,newText:k.toString()}]}}}]}findTemplateTokens(){return b(this,r).querySelectorAll("template")}},e=new WeakMap,t=new WeakMap,i=new WeakMap,n=new WeakMap,r=new WeakMap,s=new WeakMap,l=new WeakMap,a=new WeakMap,d=new WeakMap,o=new WeakSet,di=function(){return b(this,l)===this.config&&b(this,a)===this.include},Re=async function(g){var h;return g=ci(g),!b(this,i)&&R(this,o,di).call(this)&&b(this,e)===g?b(this,r):(E(this,e,g),(h=b(this,i))!=null||E(this,i,R(this,o,Un).call(this)),b(this,i))},Un=async function(){var x;(x=this.config)!=null||(this.config=F.getConfig()),E(this,l,this.config),E(this,a,this.include);const g=b(this,e),h=await wn(g,()=>b(this,e),this.include,this.config);return R(this,o,di).call(this)&&b(this,e)===g?(E(this,r,h),E(this,i,void 0),h):(E(this,i,R(this,o,Un).call(this)),b(this,i))},zn=async function(g){var h;return g=ci(g),!b(this,n)&&R(this,o,di).call(this)&&b(this,t)===g?b(this,s):(E(this,t,g),(h=b(this,n))!=null||E(this,n,R(this,o,Hn).call(this)),b(this,n))},Hn=async function(){var x;(x=this.config)!=null||(this.config=F.getConfig()),E(this,l,this.config),E(this,a,this.include);const g=b(this,t),h=await wn(g,()=>b(this,t),this.include,this.config);return R(this,o,di).call(this)&&b(this,t)===g?(E(this,s,h),E(this,n,void 0),h):(E(this,n,R(this,o,Hn).call(this)),b(this,n))},Hu=function(){var g;if(!b(this,d)||b(this,d)[1]!==this.config){(g=this.config)!=null||(this.config=F.getConfig());const{nsid:h,ext:x,html:p,parserFunction:[k,v,...w],doubleUnderscore:A,protocol:C,img:N}=this.config,B=new Set([x,p].flat(2)),q=new RegExp("(?:"+String.raw`<(\/?\w*)`+"|"+String.raw`(\{{2,4}|\[\[)\s*([^|{}<>[\]\s][^|{}<>[\]#]*)?`+"|"+String.raw`(_(?:_(?:(?!__|_{2})[\p{L}\p{N}_])*)?)`+"|"+String.raw`(_(?:_(?:(?!__|_{2})[\p{L}\p{N}_])*)?)`+"|"+String.raw`(?<!\[)\[([a-z:/]*)`+"|"+String.raw`\[\[\s*(?:${Object.entries(h).filter(([,P])=>P===6).map(([P])=>P).join("|")})\s*:[^[\]{}<>]+\|([^[\]{}<>|=]*)`+"|"+String.raw`<(\w+)(?:\s(?:[^<>{}|=\s]+(?:\s*=\s*(?:[^\s"']\S*|(["']).*?\9))?(?=\s))*)?\s(\w*)`+")$","iu"),O=A.slice(0,2).flat();E(this,d,[{re:q,ext:x,tags:B,allTags:[...B,"onlyinclude","includeonly","noinclude"],functions:[Object.keys(k),Object.keys(v),w].flat(2),switches:O.filter(ut).map(P=>`__${P}__`),jaSwitches:O.filter(P=>!ut(P)),protocols:C.split("|"),params:Object.keys(N).filter(P=>P.endsWith("$1")||!P.includes("$1")).map(P=>P.replace(/\$1$/u,""))},this.config])}return b(this,d)[0]},Dn=function(g){return this.data.behaviorSwitches.find(({aliases:h})=>h.includes(g))},$t=function(g){return this.data.parserFunctions.find(({aliases:h})=>h.some(x=>x.replace(/^#/u,"")===g))},T)}}),Du={};oe(Du,{default:()=>F});Gu.exports=se(Du);var Bi,Sn,Oa,kn,At,An,Ba,F,D=L({"index.ts"(){Xn(),Ie(),Ue(),ve(),Kd(),Yd(),Bi=!0,Sn=new qn,kn=(e,t,i)=>typeof e=="string"?[!!t,i,e]:[!!e,t,i],At={config:_n,get rules(){return gi},get i18n(){return{...Va,...Oa}},set i18n(e){Oa=e},get lintConfig(){return Sn},set lintConfig(e){Sn=new qn(e)},get viewOnly(){return Bi},set viewOnly(e){Bi&&!e&&pe.rev++,Bi=e},internal:!1,getConfig(e){const t=e!=null?e:this.config,{doubleUnderscore:i,ext:n,parserFunction:r,variable:s}=t;for(let l=0;l<2;l++)i.length>l+2&&i[l].length===0&&(i[l]=Object.keys(i[l+2]));return n.includes("translate")&&!s.includes("translationlanguage")&&(s.push("translationlanguage"),r[1].TRANSLATIONLANGUAGE="translationlanguage"),{..._n,...t,excludes:[]}},msg(e,t=""){var i;return e&&((i=this.i18n[e])!=null?i:e).replace("$1",this.msg(t))},normalizeTitle(e,t=0,i,n=At.getConfig(),r){let s;if(r!=null&&r.halfParsed)s=new Wn(e,t,n,r);else{const{Token:l}=(V(),se(Qi));s=pe.run(()=>{const a=new l(e,n);a.type="root",a.pageName=r==null?void 0:r.page,a.parseOnce(0,i).parseOnce();const d=new Wn(a.firstChild.toString(),t,n,r);a.build();for(const o of["main","fragment"]){const u=d[o];if(u!=null&&u.includes("\0")){const c=a.buildFromStr(u,1);o==="main"?d.main=c:d.setFragment(c)}}return d},this)}return s},parse(e,t,i,n,r){e=ci(e);let s,l,a,d;typeof t=="string"?(s=!!i,l=n,a=r,d=t):(s=!!t,l=i,a=n,d=r),l!=null||(l=$e),a!=null||(a=this.getConfig());let o;typeof l!="number"&&(o=Array.isArray(l)?l:[l],l=Math.max(...o.map(f=>Da[f]||$e)));const{Token:u}=(V(),se(Qi));return pe.run(()=>{const f=new u(e,a);return f.type="root",f.pageName=d,f.parse(l,s)})},parseWithRef(e,t,i,n=t.getAttribute("include")){return this.parse(e,n,i,t.getAttribute("config"),t.pageName)},createLanguageService(e={}){var t;{const{LanguageService:i,tasks:n}=(Zd(),se(Uu));return(t=n.get(e))!=null?t:new i(e)}},lint(e,t,i,n){{const[r,s,l]=kn(t,i,n);return pe.internal(()=>this.parse(e,r,void 0,s,l).lint(),this)}},print(e,t,i,n){{const[r,s,l]=kn(t,i,n);return pe.internal(()=>this.parse(e,r,void 0,s,l).print(),this)}}},An={},Ba=new Set(["lintConfig","normalizeTitle","parse","createLanguageService"]);for(const e of Object.keys(At))Ba.has(e)||(An[e]={enumerable:!1});Object.defineProperties(At,An),Object.assign(typeof globalThis=="object"?globalThis:self,{Parser:At}),F=At}});D()});ec();})();
|
|
40
40
|
//# sourceMappingURL=bundle-lsp.min.js.map
|