wikiparser-node 1.28.0 → 1.28.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/bundle-es8.min.js +24 -24
- package/bundle/bundle-lsp.min.js +28 -28
- package/bundle/bundle.min.js +22 -22
- package/config/default.json +15 -16
- package/config/jawiki.json +15 -16
- package/dist/base.d.mts +1 -1
- package/dist/base.d.ts +1 -1
- package/dist/base.js +1 -0
- package/dist/base.mjs +1 -0
- package/dist/bin/config.js +11 -11
- package/dist/lib/lintConfig.js +2 -0
- package/dist/lib/lsp.js +4 -1
- package/dist/parser/commentAndExt.js +4 -1
- package/dist/parser/hrAndDoubleUnderscore.js +9 -8
- package/dist/src/arg.js +2 -3
- package/dist/src/attribute.js +1 -0
- package/dist/src/imageParameter.js +49 -19
- package/dist/src/link/file.js +1 -4
- package/dist/src/magicLink.js +12 -1
- package/dist/src/nowiki/doubleUnderscore.d.ts +2 -1
- package/dist/src/nowiki/doubleUnderscore.js +10 -4
- package/dist/src/tagPair/ext.js +10 -3
- package/extensions/dist/base.js +1 -1
- package/i18n/en.json +2 -0
- package/i18n/zh-hans.json +2 -0
- package/i18n/zh-hant.json +2 -0
- package/package.json +4 -4
package/bundle/bundle-lsp.min.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
"use strict";(()=>{var hu=Object.defineProperty;var or=e=>{throw TypeError(e)};var gu=(e,t,s)=>t in e?hu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var pu=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ne=(e,t,s)=>gu(e,typeof t!="symbol"?t+"":t,s),Xs=(e,t,s)=>t.has(e)||or("Cannot "+s);var w=(e,t,s)=>(Xs(e,t,"read from private field"),s?s.call(e):t.get(e)),P=(e,t,s)=>t.has(e)?or("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),E=(e,t,s,i)=>(Xs(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),R=(e,t,s)=>(Xs(e,t,"access private method"),s);var ar=(e,t,s,i)=>({set _(r){E(e,t,r,s)},get _(){return w(e,t,i)}});var md=pu((vd,cu)=>{var fu=Object.create,Et=Object.defineProperty,go=Object.getOwnPropertyDescriptor,Nn=Object.getOwnPropertyNames,mu=Object.prototype.hasOwnProperty,po=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),jt=e=>{throw TypeError(e)},fo=(e,t,s)=>t in e?Et(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,ur=(e,t)=>Et(e,"name",{value:t,configurable:!0}),C=(e,t)=>function(){return e&&(t=(0,e[Nn(e)[0]])(e=0)),t},mo=(e,t)=>function(){return t||(0,e[Nn(e)[0]])((t={exports:{}}).exports,t),t.exports},oe=(e,t)=>{for(var s in t)Et(e,s,{get:t[s],enumerable:!0})},xu=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Nn(t))!mu.call(e,r)&&r!==s&&Et(e,r,{get:()=>t[r],enumerable:!(i=go(t,r))||i.enumerable});return e},te=e=>xu(Et({},"__esModule",{value:!0}),e),ae=e=>{var t;return[,,,fu((t=e==null?void 0:e[po("metadata")])!=null?t:null)]},xo=["class","method","getter","setter","accessor","field","value","get","set"],Gt=e=>e!==void 0&&typeof e!="function"?jt("Function expected"):e,vu=(e,t,s,i,r)=>({kind:xo[e],name:t,metadata:i,addInitializer:n=>s._?jt("Already initialized"):r.push(Gt(n||null))}),Ln=(e,t)=>fo(t,po("metadata"),e[3]),re=(e,t,s,i)=>{for(var r=0,n=e[t>>1],l=n&&n.length;r<l;r++)t&1?n[r].call(s):i=n[r].call(s,i);return i},le=(e,t,s,i,r,n)=>{var l,o,d,a,u,c=t&7,p=!!(t&8),m=!!(t&16),b=c>3?e.length+1:c?p?1:2:0,_=xo[c+5],A=c>3&&(e[b-1]=[]),$=e[b]||(e[b]=[]),T=c&&(!m&&!p&&(r=r.prototype),c<5&&(c>3||!m)&&go(c<4?r:{get[s](){return pe(this,n)},set[s](g){return ke(this,n,g)}},s));c?m&&c<4&&ur(n,(c>2?"set ":c>1?"get ":"")+s):ur(r,s);for(var f=i.length-1;f>=0;f--)a=vu(c,s,d={},e[3],$),c&&(a.static=p,a.private=m,u=a.access={has:m?g=>wu(r,g):g=>s in g},c^3&&(u.get=m?g=>(c^1?pe:dn)(g,r,c^4?n:T.get):g=>g[s]),c>2&&(u.set=m?(g,x)=>ke(g,r,x,c^4?n:T.set):(g,x)=>g[s]=x)),o=(0,i[f])(c?c<4?m?n:T[_]:c>4?void 0:{get:T.get,set:T.set}:r,a),d._=1,c^4||o===void 0?Gt(o)&&(c>4?A.unshift(o):c?m?n=o:T[_]=o:r=o):typeof o!="object"||o===null?jt("Object expected"):(Gt(l=o.get)&&(T.get=l),Gt(l=o.set)&&(T.set=l),Gt(l=o.init)&&A.unshift(l));return c||Ln(e,r),T&&Et(r,s,T),m?c^4?n:T:r},bu=(e,t,s)=>fo(e,typeof t!="symbol"?t+"":t,s),Fn=(e,t,s)=>t.has(e)||jt("Cannot "+s),wu=(e,t)=>Object(t)!==t?jt('Cannot use the "in" operator on this value'):e.has(t),pe=(e,t,s)=>(Fn(e,t,"read from private field"),s?s.call(e):t.get(e)),De=(e,t,s)=>t.has(e)?jt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),ke=(e,t,s,i)=>(Fn(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),dn=(e,t,s)=>(Fn(e,t,"access private method"),s),yu=(e,t,s,i)=>({set _(r){ke(e,t,r,s)},get _(){return pe(e,t,i)}}),vo,os,En=C({"base.ts"(){"use strict";vo=(()=>{const e={redirect:1,onlyinclude:1,noinclude:1,include:1,comment:1,ext:1,arg:2,"magic-word":2,template:2,heading:2,html:3,table:4,hr:5,"double-underscore":5,link:6,category:6,file:6,quote:7,"ext-link":8,"free-ext-link":9,"magic-link":9,list:10,dd:10,converter:11,"list-range":11};return Object.setPrototypeOf(e,null),e})(),os=(()=>{const e=["bold-header","format-leakage","fostered-content","h1","illegal-attr","insecure-style","invalid-gallery","invalid-imagemap","invalid-invoke","invalid-isbn","lonely-apos","lonely-bracket","lonely-http","nested-link","no-arg","no-duplicate","no-ignored","obsolete-attr","obsolete-tag","parsing-order","pipe-like","table-layout","tag-like","unbalanced-header","unclosed-comment","unclosed-quote","unclosed-table","unescaped","unknown-page","unmatched-tag","unterminated-url","url-encoding","var-anchor","void-ext"];return Object.freeze(e),e})()}});function Fe(e,t,s){return s===1?e.replace(/\0(\d+)g\x7F/gu,(i,r)=>Fe(String(t[r]),t,2)):s===2?e.replace(/\0(\d+)n\x7F/gu,(i,r)=>String(t[r])):e.replace(/\0(\d+)\x7F/gu,(i,r)=>t[r])}var Qe,Ks,Ct,It,Nt,mt,as,_e,dt,dr,cr,us,bo,hr,gr,ds,Lt,fe=C({"util/string.ts"(){"use strict";Qe=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,Ks=String.raw`[^[\]<>"\0-\x1F\x7F${Qe}\uFFFD]`,Ct=String.raw`(?:\[[\da-f:.]+\]|${Ks})`,It=String.raw`(?:${Ks}|\0\d+[cn!~]\x7F)*`,Nt=e=>e.trim().toLowerCase(),mt=(e,t)=>s=>s.replace(e,t),as=mt(/[\0\x7F]|\r$/gmu,""),_e=mt(/\0\d+[cn]\x7F/gu,""),dt=(e,t="")=>e.map(s=>typeof s=="string"?s:s.text()).join(t),dr={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},cr=mt(/&(?:#(\d+|[Xx][\da-fA-F]+)|([lg]t|[LG]T|[lr]brac[ke]|nbsp|amp|AMP|quot|QUOT));/gu,(e,t,s)=>t?String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t)):dr[s.toLowerCase()]),us=e=>cr(e),bo=mt(/&#(\d+|x[\da-f]+);/giu,(e,t)=>String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t))),hr={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},gr=e=>mt(e,t=>`&${hr[t]};`),ds=gr(/[&<>]/gu),Lt=(e,t={})=>{const{pre:s="",post:i="",sep:r=""}=t;return s+e.map(n=>n.print()).join(r)+i}}}),Su=mo({"i18n/en.json"(e,t){t.exports={"attributes-of-closing-tag":"attributes of a closing tag","bold-apostrophes":"bold apostrophes","bold-in-header":"bold text in a section header",close:null,"closing-and-self-closing":"tag that is both closing and self-closing",comment:null,"conflicting-image-parameter":"conflicting image $1 parameter","content-outside-table":"content to be moved outside the table",decode:null,delink:null,"duplicate-attribute":"duplicate $1 attribute","duplicate-category":"duplicate category","duplicate-id":"duplicate HTML id","duplicate-image-parameter":"duplicate image $1 parameter","duplicate-parameter":"duplicate template parameter",encode:null,escape:null,expand:null,"ext-in-html":"extension tag in HTML tag attributes",frame:null,"full-width-punctuation":"full-width punctuation","header-in-html":"section header in HTML tag attributes","horizontal-alignment":null,"html-in-table":"HTML tag in table attributes","illegal-attribute-name":"invalid attribute name","illegal-attribute-value":"invalid attribute value","illegal-module":"invalid Scribunto module name","imagemap-without-image":"<imagemap> without an image","in-url":"$1 in URL","inconsistent-table":"inconsistent table layout","insecure-style":"insecure style","invalid-attribute":"element containing an invalid attribute name","invalid-content":"invalid content in <$1>","invalid-conversion-flag":"invalid conversion flag","invalid-gallery":"invalid gallery image","invalid-image-parameter":"invalid image parameter","invalid-imagemap-link":"invalid link in <imagemap>","invalid-isbn":"invalid ISBN","invalid-parameter":"invalid parameter of <$1>","invalid-self-closing":"invalid self-closing tag","invisible-triple-braces":"invisible content inside triple braces","italic-apostrophes":"italic apostrophes","left-bracket":"opening bracket","link-in-extlink":"internal link in an external link",lonely:'lonely "$1"',"missing-extension":"missing file extension","missing-function":"missing Scribunto module function name",newline:null,"no-self-closing":"no self-closing","nonzero-tabindex":"nonzero tabindex","nothing-in":"nothing should be in <$1>","obsolete-attribute":"obsolete attribute","obsolete-tag":"obsolete HTML tag",open:null,prefix:null,"pipe-in-link":'additional "|" in the link text',"pipe-in-table":'additional "|" in a table cell',remove:null,"template-in-link":"template in an internal link target","unbalanced-in-section-header":"unbalanced $1 in a section header",unclosed:"unclosed $1","unclosed-comment":"unclosed HTML comment","unclosed-quotes":"unclosed quotes","unclosed-table":"unclosed table","unclosed-tag":"unclosed tag","unescaped-query":"unescaped query string in an anonymous parameter","unexpected-argument":"unexpected template argument","unmatched-closing":"unmatched closing tag","unnecessary-encoding":"unnecessary percent-encoding in an internal link",uppercase:null,"useless-attribute":"useless attribute","useless-fragment":"useless fragment","useless-link-text":"useless link text","variable-anchor":"variable anchor in a section header","vertical-alignment":null,whitespace:null}}}),Au=mo({"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:[]}}}),Ae,wo,cn,Xe=C({"util/constants.ts"(){"use strict";Ae=11,wo=Su(),cn=Au()}});function at(e){const t=new Map,s=new WeakMap;return i=>{const r=typeof i=="string"?t:s;if(r.has(i)){const l=r.get(i);return l.lastIndex=0,l}const n=e(i);return r.set(i,n),n}}var cs,yo,pr,So,Ao,Ke=C({"../common/dist/index.mjs"(){"use strict";cs=e=>decodeURIComponent(e.replace(/%(?![\da-f]{2})/giu,"%25")),yo=e=>Math.round(e*255).toString(16).padStart(2,"0"),pr=(()=>{const e=String.raw`#(?:[\da-f]{3,4}|(?:[\da-f]{2}){3,4})(?![\p{L}\p{N}_])`,t=String.raw`(?:\d*\.)?\d+%?`,s=String.raw`(?:\d*\.)?\d+(?:deg|grad|rad|turn)?`,i=String.raw`rgba?\(\s*(?:${String.raw`${new Array(3).fill(t).join(String.raw`\s+`)}(?:\s*\/\s*${t})?`}|${String.raw`${new Array(3).fill(t).join(String.raw`\s*,\s*`)}(?:\s*,\s*${t})?`})\s*\)`,r=String.raw`hsla?\(\s*(?:${String.raw`${s}\s+${t}\s+${t}(?:\s*\/\s*${t})?`}|${String.raw`${s}${String.raw`\s*,\s*(?:\d*\.)?\d+%`.repeat(2)}(?:\s*,\s*${t})?`})\s*\)`;return{full:new RegExp(String.raw`(^|[^\p{L}\p{N}_])(${e}|${i}|${r})`,"giu"),rgb:new RegExp(String.raw`(^|[^\p{L}\p{N}_])(${e}|${i})`,"giu")}})(),So=(e,t=!0)=>{const s=[],i=pr[t?"full":"rgb"];i.lastIndex=0;let r=i.exec(e),n=0;for(;r;){const l=r.index+r[1].length;l>n&&s.push([e.slice(n,l),n,l,!1]),{lastIndex:n}=i,s.push([r[2],l,n,e[l-1]!=="&"||!/^#\d+$/u.test(r[2])]),r=i.exec(e)}return e.length>n&&s.push([e.slice(n),n,e.length,!1]),s},Ao=at}}),ce,me=C({"lib/rect.ts"(){"use strict";var e,t,s,i,hn,n;ce=(n=class{constructor(l,o){P(this,i);P(this,e);P(this,t);P(this,s);E(this,e,l),E(this,t,o)}get start(){return w(this,t)}get top(){return R(this,i,hn).call(this).top}get left(){return R(this,i,hn).call(this).left}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakSet,hn=function(){var l;return(l=w(this,s))!=null||E(this,s,w(this,e).getRootNode().posFromIndex(w(this,t))),w(this,s)},n)}}),fr,mr,rs,hs,Ys,J,ie,Re,qs,Y,jn,Je,Rn,Pn,On,gs,Ft,Bn,ut,qn,K=C({"util/lint.ts"(){"use strict";Ke(),Oe(),me(),G(),fr=new Set(["tr","td","th","caption"]),mr=new Set(["Template:!!","Template:!-"]),rs=e=>{const t=e.childNodes.find(s=>s.text().trim());if(!t||t.type==="text"&&t.data.trim().startsWith("!")||t.is("magic-word")&&t.name==="!"||t.is("template")&&mr.has(t.name)||t.is("html")&&fr.has(t.name))return!1;if(t.is("arg"))return t.length>1&&rs(t.childNodes[1]);if(t.is("magic-word"))try{const s=t.getPossibleValues().map(rs);return s.includes(2)?2:s.includes(1)&&1}catch{}return t.is("template")||t.is("magic-word")&&t.name==="invoke"?1:2},hs=(e,t,s,i)=>({line:e+s-1,character:(s===1?t:0)+i}),Ys=e=>(t,s,i,r,n="error")=>{const{start:l}=s,{top:o,left:d}=s instanceof ce?s:new ce(t,l),{offsetHeight:a,offsetWidth:u}=t,{startIndex:c,startLine:p,startCol:m}=e(t,l,o,d),{line:b,character:_}=hs(p,m,a,u);return{rule:i,message:N.msg(r),severity:n,startIndex:c,endIndex:c+t.toString().length,startLine:p,endLine:b,startCol:m,endCol:_}},J=Ys((e,t,s,i)=>{const r=e.getRelativeIndex(),{top:n,left:l}=e.parentNode.posFromIndex(r);return{startIndex:t+r,startLine:s+n,startCol:n?l:i+l}}),ie=Ys((e,t,s,i)=>({startIndex:t,startLine:s,startCol:i})),Re=(e,t,s,i=0)=>({desc:N.msg(t),range:[e.startIndex+i,e.endIndex],text:s}),qs=(e,t,s)=>({desc:N.msg(t),range:[e,e],text:s}),Y=(e,t=0,s="")=>typeof e=="number"?{desc:N.msg("remove"),range:[e,e+t],text:s}:Re(e,"remove",s,t),jn=(e,t)=>Re(e,"decode",cs(t.text().replace(/%(?=21|3[ce]|5[bd]|7[b-d])/giu,"%25"))),Je=(e,t,s=0)=>({desc:N.msg("close"),range:[e+s,e],text:t}),Rn=e=>({desc:N.msg("open"),range:[e+1,e+2],text:""}),Pn=(e,t)=>Re(e,"comment",`<!--${t}-->`),On=(e,t)=>Re(e,"uppercase",t.toUpperCase()),gs=(e,t=0)=>({desc:N.msg("whitespace"),range:[e,e+t],text:" "}),Ft=(e,t,s=1)=>({desc:N.msg("escape"),range:[e,e+s],text:t.repeat(s)}),Bn=(e,t)=>({desc:N.msg("escape"),range:[e,e+t.length],text:t.replace(/\|/gu,"|")}),ut=(e,t,s,i)=>{if(e&&(i||N.viewOnly&&e[0]===be.rev))return e[1];const r=t();return(i||N.viewOnly)&&s([be.rev,r]),r},qn=(e,t)=>e==="ol"&&t==="type"?["1","a","A","i","I"]:e==="th"&&t==="scope"?["row","col","rowgroup","colgroup"]:t==="dir"?["ltr","rtl","auto"]:t==="aria-hidden"?["true","false"]:[]}}),xr,Wn,ko=C({"parser/selector.ts"(){"use strict";xr=(e,t,s)=>{if(e.includes("#")){const i=e.indexOf("#");return(i===0||e.slice(0,i)===t)&&e.slice(i+1)===s}return!e||e===t},Wn=(e,t,s)=>{const i=e.split(",");return(({type:r,name:n})=>i.some(l=>xr(l.trim(),r,n)))}}}),Ws,Mn=C({"mixin/cached.ts"(){"use strict";K(),Ws=(e=!0)=>t=>{const s=new WeakMap;return function(...i){return ut(s.get(this),()=>t.apply(this,i),r=>{s.set(this,r)},e)}}}}),$o,ku=C({"mixin/nodeLike.ts"(){"use strict";$o=e=>{class t extends e{get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get offsetHeight(){return this.getDimension().height}get offsetWidth(){return this.getDimension().width}}return t}}}),vr,br,vs,Ot,Bt,bs,qt,Wt,Mt,rt,_o=C({"lib/node.ts"(){"use strict";K(),Oe(),Mn(),ku(),G(),br=[$o],vr=[Ws(!1)],rt=class{constructor(){re(Mt,5,this),bu(this,"childNodes",[]),De(this,vs),De(this,Ot),De(this,Bt),De(this,bs),De(this,qt),De(this,Wt,{})}get parentNode(){return pe(this,vs)}get nextSibling(){return pe(this,Ot)}get previousSibling(){return pe(this,Bt)}getChildNodes(){const{childNodes:e}=this;return Object.isFrozen(e)?[...e]:e}getAttribute(e){return e==="padding"?0:this[e]}setAttribute(e,t){switch(e){case"parentNode":ke(this,vs,t),t||(ke(this,Ot,void 0),ke(this,Bt,void 0));break;case"nextSibling":ke(this,Ot,t);break;case"previousSibling":ke(this,Bt,t);break;case"aIndex":N.viewOnly&&ke(this,qt,[be.rev,t]);break;default:this[e]=t}}getRootNode(){return ut(pe(this,bs),()=>{var e,t;return(t=(e=this.parentNode)==null?void 0:e.getRootNode())!=null?t:this},e=>{const[,t]=e;t.type==="root"&&ke(this,bs,e)})}indexFromPos(e,t){{if(e<0||t<0)return;const s=this.getLines();if(e>=s.length)return;const[,i,r]=s[e],n=i+t;return n>r?void 0:n}this.lspError("AstNode.indexFromPos")}posFromIndex(e){{const{length:t}=String(this);if(e+=e<0?t:0,e>=0&&e<=t){const s=this.getLines(),i=s.findIndex(([,,r])=>e<=r);return{top:i,left:e-s[i][1]}}return}}getDimension(){{const e=this.getLines(),t=e[e.length-1];return{height:e.length,width:t[2]-t[1]}}}getGaps(e){return 0}getRelativeIndex(e){if(e===void 0){const{parentNode:t}=this;return t?t.getRelativeIndex(t.childNodes.indexOf(this)):0}return ut(pe(this,Wt)[e],()=>{const{childNodes:t}=this,s=e+(e<0?t.length:0);let i=this.getAttribute("padding");for(let r=0;r<s;r++)N.viewOnly&&(pe(this,Wt)[r]=[be.rev,i]),i+=t[r].toString().length+this.getGaps(r);return i},t=>{pe(this,Wt)[e]=t})}getAbsoluteIndex(){return ut(pe(this,qt),()=>{const{parentNode:e}=this;return e?e.getAbsoluteIndex()+this.getRelativeIndex():0},e=>{ke(this,qt,e)})}getBoundingClientRect(){return{...this.getDimension(),...this.getRootNode().posFromIndex(this.getAbsoluteIndex())}}is(e){return this.type===e}getLines(){{const e=[];let t=0;for(const s of String(this).split(`
|
|
2
|
-
`)){const i=t+s.length;e.push([s,t,i]),t=i+1}return e}}seal(e,t){const s=!t&&!!this[e];Object.defineProperty(this,e,{enumerable:s,configurable:!0})}lspError(e){throw new Error(`${e} method is only available in the LSP version!`)}},Mt=ae(null),vs=new WeakMap,Ot=new WeakMap,Bt=new WeakMap,bs=new WeakMap,qt=new WeakMap,Wt=new WeakMap,le(Mt,1,"getLines",vr,rt),rt=le(Mt,0,"AstNode",br,rt),re(Mt,1,rt)}}),To,$u=C({"mixin/elementLike.ts"(){"use strict";ko(),To=e=>{var t,gn;{class i extends e{constructor(){super(...arguments);P(this,t)}getElementBy(l){for(const o of this.childNodes){if(o.type==="text")continue;if(l(o))return o;const d=o.getElementBy(l);if(d)return d}}querySelector(l){return this.getElementBy(R(this,t,gn).call(this,l))}getElementsBy(l,o=[]){for(const d of this.childNodes)d.type!=="text"&&(l(d)&&o.push(d),d.getElementsBy(l,o));return o}querySelectorAll(l){return this.getElementsBy(R(this,t,gn).call(this,l))}escape(){for(const l of this.childNodes)l.escape()}}return t=new WeakSet,gn=function(l){return Wn(l,this)},i}}}}),wr,Zs,yr,Vt,_u=C({"lib/element.ts"(){"use strict";fe(),Oe(),ko(),_o(),$u(),wr=[To],Vt=class extends(yr=rt){get length(){return this.childNodes.length}text(e){return dt(this.childNodes,e)}normalize(){const e=this.getChildNodes(),t=s=>{var i,r;e.splice(s,1),(i=e[s-1])==null||i.setAttribute("nextSibling",e[s]),(r=e[s])==null||r.setAttribute("previousSibling",e[s-1])};for(let s=e.length-1;s>=0;s--){const{type:i,data:r}=e[s];i!=="text"||e.length===1||this.getGaps(s-(s&&1))||r===""&&t(s)}this.setAttribute("childNodes",e)}removeAt(e){return fs(this,e,1)[0]}insertAt(e,t=this.length){return fs(this,t,0,[e]),e}closest(e){const t=Wn(e,this);let{parentNode:s}=this;for(;s;){if(t(s))return s;({parentNode:s}=s)}}append(...e){this.safeAppend(e)}safeAppend(e){for(const t of e)this.insertAt(t)}safeReplaceChildren(e){for(let t=this.length-1;t>=0;t--)this.removeAt(t);this.safeAppend(e)}setText(e,t=0){t+=t<0?this.length:0;const s=this.childNodes[t],{data:i}=s;return s.replaceData(e),i}toString(e,t=""){return this.childNodes.map(s=>s.toString(e)).join(t)}caretPositionFromIndex(e){{if(e===void 0)return;const{length:t}=this.toString();if(e>t||e<-t)return;e+=e<0?t:0;let s=this,i=0,r=0;for(;s.type!=="text";){const{childNodes:n}=s;i+=s.getAttribute("padding");for(let l=0;i<=e&&l<n.length;l++){const o=n[l],{nextSibling:d}=o,a=o.toString(),u=a.length;if(o.setAttribute("aIndex",i),i+=u,i>e||i===e&&u>0&&(!d||d.type==="text"||o.type!=="text"&&(a.trim()||!d.toString().trim()))){s=o,i-=u,r=i;break}i+=s.getGaps(l)}if(s.childNodes===n)return{offsetNode:s,offset:e-r}}return{offsetNode:s,offset:e-r}}this.lspError("AstElement.caretPositionFromIndex")}elementFromIndex(e){var t;{const s=(t=this.caretPositionFromIndex(e))==null?void 0:t.offsetNode;return(s==null?void 0:s.type)==="text"?s.parentNode:s}this.lspError("AstElement.elementFromIndex")}elementFromPoint(e,t){return this.elementFromIndex(this.indexFromPos(t,e))}lint(e=this.getAbsoluteIndex(),t){{const s=[];for(let i=0,r=e+this.getAttribute("padding");i<this.length;i++){const n=this.childNodes[i];n.setAttribute("aIndex",r);const l=n.lint(r,t);l.length>0&&s.push(...l),r+=n.toString().length+this.getGaps(i)}return s}}print(e={}){const t=e.class;return this.toString()?(t===""?"":`<span class="wpb-${t!=null?t:this.type}${this.getAttribute("invalid")?" wpb-invalid":""}">`)+Lt(this.childNodes,e)+(t===""?"":"</span>"):""}json(e,t=this.getAbsoluteIndex()){{const s={...this,type:this.type,range:[t,t+this.toString().length],childNodes:[]};for(let i=0,r=t+this.getAttribute("padding");i<this.length;i++){const n=this.childNodes[i],{length:l}=n.toString();n.setAttribute("aIndex",r),s.childNodes.push(n.type==="text"?{data:n.data,range:[r,r+l]}:n.json(void 0,r)),r+=l+this.getGaps(i)}return s}}},Zs=ae(yr),Vt=le(Zs,0,"AstElement",wr,Vt),re(Zs,1,Vt)}}),ms,Ms=C({"mixin/gapped.ts"(){"use strict";ms=(e=1)=>t=>{class s extends t{getGaps(){return e}}return s}}}),Be,We=C({"mixin/noEscape.ts"(){"use strict";Be=e=>{{class t extends e{escape(){}}return t}}}}),Sr,Co,Tu=C({"src/parameter.ts"(){"use strict";fe(),K(),G(),X(),Sr=new RegExp(`https?://${Ct}${It}$`,"iu"),Co=class extends H{get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){var e;try{return!!((e=this.parentNode)!=null&&e.getDuplicatedArgs().some(([t])=>t===this.name))}catch{return!1}}constructor(e,t,s,i=[]){super(void 0,s,i);const r=new H(typeof e=="number"?void 0:e,s,i,{}),n=new H(t,s,i);r.type="parameter-key",r.setAttribute("stage",2),n.type="parameter-value",n.setAttribute("stage",2),this.append(r,n)}trimName(e,t=!0){const s=(typeof e=="string"?e:e.toString(!0)).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");return this.setAttribute("name",s),s}afterBuild(){if(!this.anon){const{parentNode:e,firstChild:t}=this,s=this.trimName(t);e&&e.getArgs(s,!1,!1).add(this)}super.afterBuild()}toString(e){return this.anon?this.lastChild.toString(e):super.toString(e,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(e=this.getAbsoluteIndex(),t){var s;{const i=super.lint(e,t),r="unescaped",{lintConfig:n}=N,l=n.getSeverity(r);if(l){const{firstChild:o}=this,d=(s=Sr.exec(o.text()))==null?void 0:s[0];try{if(d&&new URL(d).search){const a=J(o,{start:e},r,"unescaped-query",l);a.startIndex=a.endIndex,a.startLine=a.endLine,a.startCol=a.endCol,a.endIndex++,a.endCol++,(n.computeEditInfo||n.fix)&&(a.fix=Ft(a.startIndex,"{{=}}")),i.push(a)}}catch{}}return i}}print(){return super.print({sep:this.anon?"":"="})}json(e,t=this.getAbsoluteIndex()){{const s=super.json(void 0,t);return Object.assign(s,{anon:this.anon},this.duplicated&&{duplicated:!0}),s}}}}}),$e,ct=C({"src/atom.ts"(){"use strict";var e,t;X(),$e=(t=class extends H{constructor(i,r,n,l,o){super(i,n,l,o);P(this,e);E(this,e,r)}get type(){return w(this,e)}set type(i){E(this,e,i)}getAttribute(i){var r;return i==="invalid"?this.type==="converter-flag"&&!!((r=this.parentNode)!=null&&r.isInvalidFlag(this)):super.getAttribute(i)}},e=new WeakMap,t)}}),qe,ht=C({"src/syntax.ts"(){"use strict";var e,t;X(),qe=(t=class extends H{constructor(i,r,n,l,o){super(i,n,l,o);P(this,e);E(this,e,r)}get type(){return w(this,e)}lint(i=this.getAbsoluteIndex()){return super.lint(i,!1)}},e=new WeakMap,t)}}),Io={};oe(Io,{TranscludeToken:()=>lt});var Ar,ei,kr,lt,No=C({"src/transclude.ts"(){"use strict";var e,t,s,i,r,n,Qt,Lo,d;fe(),K(),Oe(),me(),Ms(),We(),G(),X(),Tu(),ct(),ht(),Ar=[Be,ms()],lt=(d=class extends(kr=H){constructor(u,c,p,m=[]){var k,L;let b;const _=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(u);_&&(b=Number(_[1]),u=u.replace(`\0${b}h`,m[b].toString().replace(/^\n/u,"")));super(void 0,p,m,{});P(this,n);Ne(this,"modifier","");P(this,e,"template");P(this,t,":");P(this,s,!1);P(this,i,new Map);P(this,r);const{parserFunction:[A,$],variable:T,functionHook:f}=p,g=(k=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(u))==null?void 0:k[0];if(g)this.setAttribute("modifier",g),u=u.slice(g.length);else if(u.includes(":")){const[I,...j]=u.split(":"),[B]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((L=j[0])!=null?L:"");this.setModifier(`${I}:${B}`)&&(u=j.join(":").slice(B.length))}const x=u.search(/[::]/u),v=u[x]===":",h=x!==-1;if(h||c.length===0&&!w(this,s)){const I=h?u.slice(0,x):u,j=h&&u.slice(x+1),B=_e(I),O=h?B.slice(B.search(/\S/u))+(v?":":""):B.trim(),F=O.toLowerCase(),D=Array.isArray($),W=D?$.includes(O):Object.prototype.hasOwnProperty.call($,O),q=!D&&W?$[O]:Object.prototype.hasOwnProperty.call(A,F)&&A[F],z=D&&W||!("functionHook"in p)||f.includes(q),M=D&&W||T.includes(q);if(h?q&&z:M){this.setAttribute("name",q||F.replace(/^#|:$/u,"")),E(this,e,"magic-word"),v&&E(this,t,":");const V=new qe(I,"magic-word-name",p,m);if(super.insertAt(V),j!==!1&&c.unshift([j]),this.name==="invoke")for(let Q=0;Q<2;Q++){const se=c.shift();if(!se)break;const ue=new $e(se.join("="),`invoke-${Q?"function":"module"}`,p,m);super.insertAt(ue)}}}if(this.type==="template"){const I=_e(u).trim();if(!this.normalizeTitle(I,10,{halfParsed:!0,temporary:!0}).valid)throw m.pop(),new SyntaxError("Invalid template name");const j=new $e(u,"template-name",p,m,{});super.insertAt(j)}typeof b=="number"&&(m[b]=void 0);const S=this.isTemplate();let y=1;for(let I=0;I<c.length;I++){const j=c[I];S||this.name==="switch"&&I>0||this.name==="tag"&&I>1||(j[0]=j.join("="),j.length=1),j.length===1&&(j.unshift(y),y++),this.insertAt(new Co(...j,p,m))}this.seal("modifier")}get type(){return w(this,e)}get module(){return this.type==="magic-word"&&this.name==="invoke"?R(this,n,Qt).call(this).title:void 0}get function(){var u;return this.type==="magic-word"&&this.name==="invoke"?(u=this.childNodes[2])==null?void 0:u.text().trim():void 0}setModifier(u){const{parserFunction:[,,c,p]}=this.getAttribute("config"),m=_e(u).trim();if(u&&!m.endsWith(":"))return!1;const b=m.slice(0,-1).toLowerCase(),_=c.includes(b),A=p.includes(b);return w(this,s)&&_||!w(this,s)&&(A||!u)||(be.running||this.length>1)&&(_||A||!u)?(this.setAttribute("modifier",u),E(this,s,_),!!u):!1}isTemplate(){return this.type==="template"||this.name==="invoke"}afterBuild(){this.modifier.includes("\0")&&this.setAttribute("modifier",this.buildFromStr(this.modifier,0)),super.afterBuild(),this.isTemplate()&&this.type==="template"&&(E(this,r,R(this,n,Qt).call(this)),this.setAttribute("name",w(this,r).title))}toString(u){const{childNodes:c,length:p,firstChild:m,modifier:b,type:_}=this;return`{{${b}${_==="magic-word"?m.toString(u)+(p===1?"":w(this,t))+c.slice(1).map(A=>A.toString(u)).join("|"):super.toString(u,"|")}}}`}text(){const{childNodes:u,length:c,firstChild:p,modifier:m,type:b,name:_}=this;return b==="magic-word"&&_==="vardefine"?"":`{{${m}${b==="magic-word"?p.text()+(c===1?"":w(this,t))+dt(u.slice(1),"|"):super.text("|")}}}`}getAttribute(u){switch(u){case"padding":return this.modifier.length+2;case"title":return w(this,r);case"colon":return w(this,t);case"invalid":return this.type==="magic-word"&&this.name==="invoke"&&(this.length===2||!R(this,n,Qt).call(this).valid);default:return super.getAttribute(u)}}lint(u=this.getAbsoluteIndex(),c){{const p=super.lint(u,c);if(!this.isTemplate())return p;const{type:m,childNodes:b,length:_}=this,A=new ce(this,u),{lintConfig:$}=N,{computeEditInfo:T}=$,f=m==="magic-word";let g="no-ignored",x=$.getSeverity(g,"fragment");if(f&&!R(this,n,Qt).call(this).valid)g="invalid-invoke",x=$.getSeverity(g,"name"),x&&p.push(J(b[1],A,g,"illegal-module",x));else if(x){const v=b[f?1:0],h=v.childNodes.findIndex(y=>y.type==="text"&&us(y.data).includes("#")),S=v.childNodes[h];if(S){const y=J(v,A,g,"useless-fragment",x);T&&(y.suggestions=[Y(y,v.getRelativeIndex(h)+S.data.indexOf("#"))]),p.push(y)}}if(g="invalid-invoke",x=$.getSeverity(g,"function"),x&&f&&_===2)return p.push(ie(this,A,g,"missing-function",x)),p;if(g="no-duplicate",x=$.getSeverity(g,"parameter"),x){const v=this.getDuplicatedArgs().filter(([,S])=>!S[0].querySelector("ext")),h="duplicate-parameter";for(const[,S]of v)p.push(...S.map(y=>{const k=J(y,A,g,h,x);return T&&(k.suggestions=[Y(k,-1)]),k}))}return p}}insertAt(u,c=this.length){return super.insertAt(u,c),u.anon?R(this,n,Lo).call(this,u):u.name&&this.getArgs(u.name,!1,!1).add(u),u}getAllArgs(){return this.childNodes.filter(Qs("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:u})=>u)}getArgs(u,c,p=!0){const m=String(u).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");let b;return w(this,i).has(m)?b=w(this,i).get(m):(b=new Set(this.getAllArgs().filter(({name:_})=>m===_)),w(this,i).set(m,b)),b}getDuplicatedArgs(){return[...w(this,i)].filter(([,{size:u}])=>u>1).map(([u,c])=>[u,[...c]])}getPossibleValues(){const{type:u,name:c,childNodes:p}=this;if(u==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let m,b;switch(c){case"if":case"ifexist":case"ifexpr":case"iferror":m=2;break;case"ifeq":m=3;break;case"switch":{const _=p.slice(2),A=_[_.length-1];b=[..._.filter(({anon:$})=>!$),...A!=null&&A.anon?[A]:[]].map(({lastChild:$})=>$);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}b!=null||(b=p.slice(m,m+2).map(({lastChild:_})=>_));for(let _=0;_<b.length;){const{length:A,0:$}=b[_].childNodes.filter(T=>T.text().trim());if(A===0)b.splice(_,1);else if(A>1||$.type!=="magic-word")_++;else try{const T=$.getPossibleValues();b.splice(_,1,...T),_+=T.length}catch{_++}}return b}print(){const{childNodes:u,length:c,firstChild:p,modifier:m,type:b}=this;return`<span class="wpb-${b}${this.getAttribute("invalid")?" wpb-invalid":""}">{{${b==="magic-word"?ds(m)+p.print()+(c===1?"":w(this,t))+Lt(u.slice(1),{sep:"|"}):(m?`<span class="wpb-magic-word">${ds(m)}</span>`:"")+Lt(u,{sep:"|"})}}}</span>`}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakMap,n=new WeakSet,Qt=function(){const u=this.type==="template";return this.normalizeTitle(this.childNodes[u?0:1].text(),u?10:828,{temporary:!0})},Lo=function(u){const c=this.getAnonArgs(),p=typeof u!="number";for(let m=p?c.indexOf(u):u-1;m<c.length;m++){const b=c[m],{name:_}=b,A=String(m+1);(_!==A||b===u)&&(b.setAttribute("name",A),this.getArgs(A,!1,!1).add(b))}},d),ei=ae(kr),lt=le(ei,0,"TranscludeToken",Ar,lt),re(ei,1,lt)}}),ws,ti,si,$r,_r,Tr,Cr,ii,Ir,pn,Cu=C({"lib/text.ts"(){"use strict";var e,fn,s;fe(),K(),Oe(),G(),_o(),ws=String.raw`[${Qe}\t]*`,ti=String.raw`[^\S\n]*`,si=String.raw`<${ti}(?:/${ti})?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|(?:rfc|pmid)(?=[-::]?${ws}\d)|isbn(?=[-::]?${ws}(?:\d(?:${ws}|-)){6})`,$r=new RegExp(String.raw`${si}|https?[:/]/+`,"giu"),_r=new RegExp(si,"giu"),Tr=new Set(["attr-value","ext-link-text","link-text"]),Cr={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},ii=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"]),Ir=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch{return/\w/u}})(),pn=(s=class extends rt{constructor(n){super();P(this,e);Ne(this,"data","");this.data=n}get type(){return"text"}toString(n){var l;return n&&!((l=this.parentNode)!=null&&l.getAttribute("built"))?_e(this.data):this.data}text(){return this.data}lint(n=this.getAbsoluteIndex(),l){var o,d,a;{if(l===!1)return[];const{data:u,parentNode:c,nextSibling:p,previousSibling:m}=this;if(!c)throw new Error("An isolated text node cannot be linted!");const{type:b,name:_,parentNode:A}=c;if(b==="attr-value"){const{name:F,tag:D}=A;if(D==="ref"&&(F==="name"||F==="follow")||F==="group"&&(D==="ref"||D==="references")||D==="choose"&&(F==="before"||F==="after"))return[]}if(l!=null||(l=b==="free-ext-link"||b==="ext-link-url"||b==="ext-link-text"||b==="image-parameter"&&_==="link"||b==="attr-value"?_r:$r),u.search(l)===-1)return[];l.lastIndex=0;const $=[],T=p==null?void 0:p.type,f=p==null?void 0:p.name,g=m==null?void 0:m.type,x=this.getRootNode(),v=x.toString(),{ext:h,html:S,variants:y}=x.getAttribute("config"),{top:k,left:L}=x.posFromIndex(n),{lintConfig:I}=N,j=I.rules["tag-like"],B=typeof j=="object"&&j[1]?new Set(Object.keys(j[1]).filter(F=>F!=="invalid"&&F!=="disallowed")):new Set,O=new Set(["onlyinclude","noinclude","includeonly",...h,...S[0],...S[1],...S[2],...B,...I.getSeverity("tag-like","disallowed")?ii:[]]);for(let F=l.exec(u);F;F=l.exec(u)){const[,D,W]=F;let{index:q,0:z}=F;if(W&&W!=="]"){const{length:we}=W;q+=we,z=z.slice(we)}z=z.toLowerCase();const[M]=z,V=M==="r"||M==="p"||M==="i",Q=M==="{",se=M==="}",ue=M==="[",he=M==="]";let{length:ne}=z;if(M==="<"&&!O.has(D.toLowerCase())||ue&&b==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(u.slice(q+1))||p!=null&&p.is("ext")&&f==="nowiki"&&((o=p.innerText)!=null&&o.includes("]")))||V&&(!c.isPlain()||Tr.has(b)))continue;he&&(q||ne>1)&&l.lastIndex--;let Ce=n+q,Ie=Ce+ne,U,Z;const ge=v[Ie],xe=v[Ce-1],Te=Q||ue,Ue=Q&&xe==="-"&&y.length>0,ye=se&&ge==="-"&&y.length>0,ft=ue&&T==="free-ext-link"&&!u.slice(q+1).trim()||he&&g==="free-ext-link"&&!u.slice(0,q).includes("]");if(V)U="lonely-http",z=z.toUpperCase(),Z=I.getSeverity(U,z);else if(M==="<"){U="tag-like";let we;/^<\/?\s/u.test(z)||!/[\s/>]/u.test(ge!=null?ge:"")?we="invalid":B.has(D)?we=D:ii.has(D)&&!h.includes(D)&&(we="disallowed"),Z=I.getSeverity(U,we)}else if(Ue||ye)U="lonely-bracket",Z=I.getSeverity(U,"converter"),Ue&&q>0?(z="-{",q--,Ce--,ne=2):ye&&q<u.length-1&&(z="}-",Ie++,ne=2);else if(ft)U="lonely-bracket",Z=I.getSeverity(U,"extLink");else if(Te||se||he)if(U="lonely-bracket",ne>1||Q&&ge===M||se&&xe===M)Z=I.getSeverity(U,"double");else{if(!ue||b!=="ext-link-text"){const we=Cr[M],Js=Te?u.slice(q+1):u.slice(0,q);if(Q&&((d=we.exec(Js))==null?void 0:d[0])==="}"||se&&((a=we.exec(Js))==null?void 0:a[0])==="{")continue;if(!Js.includes(M)){const lr=Te?"nextSibling":"previousSibling";let st=this[lr];for(;st&&(st.type!=="text"||!we.test(st.data));)st=st[lr];if(st&&we.exec(st.data)[0]!==M)continue}}Z=I.getSeverity(U,"single")}else U="lonely-http",Z=I.getSeverity(U);if(!Z)continue;const ee=this.posFromIndex(q),{line:et,character:Pt}=hs(k,L,ee.top+1,ee.left),tt={rule:U,message:N.msg("lonely",V||M==="h"||Ue||ye?z:M),severity:Z,startIndex:Ce,endIndex:Ie,startLine:et,endLine:et,startCol:Pt,endCol:Pt+ne};if(I.computeEditInfo)if(M==="<")tt.suggestions=[Ft(Ce,"<")];else if(M==="h"&&b!=="link-text"&&Ir.test(xe||""))tt.suggestions=[gs(Ce)];else if(ue&&b==="ext-link-text"){const we=c.getAbsoluteIndex()+c.toString().length;tt.suggestions=[Ft(we,"]")]}else if(he&&ft){const we=n-m.toString().length;tt.suggestions=[qs(we,"left-bracket","[")]}else V&&(tt.suggestions=[...F[0]===z?[]:[On(tt,z)],...ge===":"||ge===":"?[gs(Ie,1)]:[]]);$.push(tt)}return $}}replaceData(n){R(this,e,fn).call(this,n)}splitText(n){{const{parentNode:l,data:o}=this;if(!l)throw new Error("The text node to be split has no parent node!");const d=new s(o.slice(n));return fs(l,l.childNodes.indexOf(this)+1,0,[d]),this.setAttribute("data",o.slice(0,n)),d}this.lspError("AstText.splitText")}escape(){{const{parentNode:n}=this;if(!n)throw new Error("The text node to be escaped has no parent node!");const{TranscludeToken:l}=(No(),te(Io)),o=n.getAttribute("config"),d=n.childNodes.indexOf(this)+1,a=p=>Math.max(this.data.lastIndexOf("=",p),this.data.lastIndexOf("|",p));let u=a();const c=(()=>new l(this.data[u]==="="?"=":"!",[],o));for(;u>=0;u=a(u-1))u<this.data.length-1&&this.splitText(u+1),n.insertAt(be.run(c),d),R(this,e,fn).call(this,this.data.slice(0,u))}}print(){return ds(this.data)}},e=new WeakSet,fn=function(n){this.setAttribute("data",n)},s)}}),Ye,gt=C({"mixin/hidden.ts"(){"use strict";Ye=(e=!0,t=!0)=>s=>{class i extends s{text(){return""}lint(n){return e?[]:super.lint(n)}}return i}}}),Me,Ze=C({"mixin/padded.ts"(){"use strict";Me=({length:e})=>t=>{{class s extends t{getAttribute(r){return r==="padding"?e:super.getAttribute(r)}}return s}}}}),Nr,Lr,ni,Fr,Ge,Us=C({"src/link/base.ts"(){"use strict";var e,t,s,i;K(),Xe(),me(),Ze(),We(),G(),X(),ct(),Nr=r=>r==="redirect-target"||r==="link",Lr=[Be,Me("[[")],Ge=(i=class extends(Fr=H){constructor(n,l,o,d=[],a="|"){super(void 0,o,d,{});P(this,e,!0);P(this,t);P(this,s);if(this.insertAt(new $e(n,"link-target",o,d,{})),l!==void 0){const u=new H(l,o,d,{});u.type="link-text",u.setAttribute("stage",Ae-1),this.insertAt(u)}E(this,t,a)}get link(){return w(this,s)}get fragment(){return w(this,s).fragment}afterBuild(){E(this,s,this.getTitle()),w(this,t).includes("\0")&&E(this,t,this.buildFromStr(w(this,t),0)),this.setAttribute("name",w(this,s).title),super.afterBuild()}setAttribute(n,l){n==="bracket"?E(this,e,l):n==="title"?E(this,s,l):super.setAttribute(n,l)}toString(n){const l=super.toString(n,w(this,t));return w(this,e)?`[[${l}]]`:l}text(){const n=super.text("|");return w(this,e)?`[[${n}]]`:n}getAttribute(n){return n==="title"?w(this,s):super.getAttribute(n)}getGaps(n){return n===0?w(this,t).length:1}lint(n=this.getAbsoluteIndex(),l){{const o=super.lint(n,l),{childNodes:[d,a],type:u}=this,{encoded:c,fragment:p}=w(this,s),{lintConfig:m}=N,{computeEditInfo:b,fix:_}=m,A=new ce(this,n);let $="unknown-page",T=m.getSeverity($);if(T&&d.childNodes.some(({type:f})=>f==="template")&&o.push(J(d,A,$,"template-in-link",T)),$="url-encoding",T=m.getSeverity($),T&&c){const f=J(d,A,$,"unnecessary-encoding",T);(b||_)&&(f.fix=jn(f,d)),o.push(f)}if($="pipe-like",T=m.getSeverity($,"link"),T&&(u==="link"||u==="category")){const f=a==null?void 0:a.childNodes.findIndex(x=>x.type==="text"&&x.data.includes("|")),g=a==null?void 0:a.childNodes[f];if(g){const x=J(a,A,$,"pipe-in-link",T);if(b){const v=x.startIndex+a.getRelativeIndex(f);x.suggestions=[Bn(v,g.data)]}o.push(x)}}if($="no-ignored",T=m.getSeverity($,"fragment"),T&&p!==void 0&&!Nr(u)){const f=J(d,A,$,"useless-fragment",T);if(b||_){const g=d.childNodes.findIndex(v=>v.type==="text"&&v.data.includes("#")),x=d.childNodes[g];x&&(f.fix=Y(f,d.getRelativeIndex(g)+x.data.indexOf("#")))}o.push(f)}return o}}getTitle(n,l){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:l,temporary:n,decode:!0,selfLink:!0})}print(){return super.print(w(this,e)?{pre:"[[",post:"]]",sep:w(this,t)}:{sep:w(this,t)})}json(n,l=this.getAbsoluteIndex()){{const o=super.json(void 0,l),{type:d,fragment:a}=this;return a!==void 0&&(d==="link"||d==="redirect-target")&&(o.fragment=a),o}}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i),ni=ae(Fr),Ge=le(ni,0,"LinkBaseToken",Lr,Ge),re(ni,1,Ge)}}),Er,ri,jr,Pe,pt=C({"src/nowiki/base.ts"(){"use strict";We(),X(),Er=[Be],Pe=class extends(jr=H){get innerText(){return this.firstChild.data}constructor(e="",t,s){super(e,t,s)}},ri=ae(jr),Pe=le(ri,0,"NowikiBaseToken",Er,Pe),re(ri,1,Pe)}}),Rr,li,Pr,Ee,Rt=C({"src/nowiki/noinclude.ts"(){"use strict";gt(),pt(),Rr=[Ye()],Ee=class extends(Pr=Pe){get type(){return"noinclude"}toString(e){return e?"":super.toString()}},li=ae(Pr),Ee=le(li,0,"NoincludeToken",Rr,Ee),re(li,1,Ee)}}),Fo,Iu=C({"src/link/redirectTarget.ts"(){"use strict";K(),G(),Us(),Rt(),Fo=class extends Ge{get type(){return"redirect-target"}constructor(e,t,s,i){super(e,void 0,s,i),t!==void 0&&this.insertAt(new Ee(t,s,i))}getTitle(){return this.normalizeTitle(this.firstChild.toString(),0,{halfParsed:!0,decode:!0})}lint(e=this.getAbsoluteIndex()){{const t=super.lint(e,!1),s="no-ignored",{lintConfig:i}=N,r=i.getSeverity(s,"redirect");if(r&&this.length===2){const n=J(this.lastChild,{start:e},s,"useless-link-text",r);n.startIndex--,n.startCol--,(i.computeEditInfo||i.fix)&&(n.fix=Y(n)),t.push(n)}return t}}}}}),Or,oi,Br,Jt,Nu=C({"src/redirect.ts"(){"use strict";var e,t,s;gt(),We(),X(),ht(),Iu(),Or=[Ye(!1,!1),Be],Jt=(s=class extends(Br=H){constructor(r,n,l,o,d,a,u=[]){super(void 0,a,u);P(this,e);P(this,t);E(this,e,r),E(this,t,d),this.append(new qe(n,"redirect-syntax",a,u),new Fo(l,o==null?void 0:o.slice(1),a,u))}get type(){return"redirect"}getAttribute(r){return r==="padding"?w(this,e).length:super.getAttribute(r)}toString(r){return w(this,e)+super.toString(r)+w(this,t)}lint(r=this.getAbsoluteIndex()){{const n=r+w(this,e).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",n),this.lastChild.lint(n)}}print(){return super.print({pre:w(this,e),post:w(this,t)})}},e=new WeakMap,t=new WeakMap,s),oi=ae(Br),Jt=le(oi,0,"RedirectToken",Or,Jt),re(oi,1,Jt)}}),Eo={};oe(Eo,{parseRedirect:()=>jo});var jo,Lu=C({"parser/redirect.ts"(){"use strict";G(),Nu(),jo=(e,t,s)=>{var r;(r=t.regexRedirect)!=null||(t.regexRedirect=new RegExp(String.raw`^(\s*)((?:${t.redirection.join("|")})\s*(?::\s*)?)\[\[([^\n|\]]+)(\|.*?)?\]\](\s*)`,"iu"));const i=t.regexRedirect.exec(e);return i&&N.normalizeTitle(i[3],0,!1,t,{halfParsed:!0,temporary:!0,decode:!0}).valid?(e=`\0${s.length}o${e.slice(i[0].length)}`,new Jt(...i.slice(1),t,s),e):!1}}}),qr,ai,Wr,Xt,Fu=C({"src/onlyinclude.ts"(){"use strict";Ze(),We(),X(),qr=[Be,Me("<onlyinclude>")],Xt=class extends(Wr=H){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>'})}},ai=ae(Wr),Xt=le(ai,0,"OnlyincludeToken",qr,Xt),re(ai,1,Xt)}}),Mr,ui,Ur,ot,Un=C({"src/tagPair/index.ts"(){"use strict";var e,t;Ms(),We(),X(),Mr=[ms(),Be],ot=(t=class extends(Ur=H){constructor(i,r,n,l,o,d=[]){super(void 0,o);P(this,e);Ne(this,"closed");Ne(this,"selfClosing");this.setAttribute("name",i.toLowerCase()),E(this,e,[i,l||i]),this.closed=l!=="",this.selfClosing=l===void 0,this.append(r,n);const a=typeof r=="string"?-1:d.indexOf(r);d.splice(a===-1?1/0:a,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(i){const{selfClosing:r,firstChild:n,lastChild:l}=this,[o,d]=w(this,e);return r?`<${o}${n.toString(i)}/>`:`<${o}${n.toString(i)}>${l.toString(i)}${this.closed?`</${d}>`:""}`}text(){const[i,r]=w(this,e);return this.selfClosing?`<${i}${this.firstChild.text()}/>`:`<${i}${super.text(">")}${this.closed?`</${r}>`:""}`}getAttribute(i){return i==="padding"?w(this,e)[0].length+1:super.getAttribute(i)}print(){const[i,r]=w(this,e);return super.print(this.selfClosing?{pre:`<${i}`,post:"/>"}:{pre:`<${i}`,sep:">",post:this.closed?`</${r}>`:""})}},e=new WeakMap,t),ui=ae(Ur),ot=le(ui,0,"TagPairToken",Mr,ot),re(ui,1,ot)}}),zn,Ro=C({"src/tag/index.ts"(){"use strict";var e,t,s,i;K(),Oe(),G(),X(),zn=(i=class extends H{constructor(n,l,o,d,a){super(void 0,d,a);P(this,e);P(this,t);P(this,s);this.insertAt(l),E(this,e,o),E(this,t,n)}get closing(){return w(this,e)}toString(n){return`<${w(this,e)?"/":""}${w(this,t)}${super.toString(n)}${this.selfClosing?"/":""}>`}text(n=""){const{closing:l}=this;return`<${l&&!n?"/":""}${w(this,t)}${l?"":super.text()}${n}>`}getAttribute(n){return n==="padding"?w(this,t).length+(w(this,e)?2:1):super.getAttribute(n)}findMatchingTag(){return ut(w(this,s),()=>{const{type:n,name:l,parentNode:o,closing:d,selfClosing:a}=this;let u=!1,c=!1;if(n==="html"){const{html:[,$,T]}=this.getAttribute("config");u=T.includes(l),c=$.includes(l)}if(u||c&&a)return this;if(!o)return;const{childNodes:p}=o,m=p.indexOf(this),b=d?p.slice(0,m).reverse():p.slice(m+1),_=[this],{rev:A}=be;for(const $ of b)if(!(!$.is(n)||n==="html"&&($.name!==l||c&&$.selfClosing)))if(w($,e)===d){if(n==="tvar")return;_.push($)}else{const T=_.pop();if(T===this)return $;N.viewOnly&&(E(T,s,[A,$]),E($,s,[A,T]))}if(N.viewOnly)for(const $ of _)E($,s,[A,void 0])},n=>{E(this,s,n),n[1]&&n[1]!==this&&E(n[1],s,[be.rev,this])})}print(){return super.print({pre:`<${w(this,e)?"/":""}${w(this,t)}`,post:`${this.selfClosing?"/":""}>`})}json(n,l=this.getAbsoluteIndex()){{const o=super.json(void 0,l);return o.closing=w(this,e),o}}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i)}}),zr,di,Hr,Ve,Eu=C({"src/tag/tvar.ts"(){"use strict";gt(),Ro(),ht(),zr=[Ye()],Ve=class extends(Hr=zn){get type(){return"tvar"}constructor(e,t,s,i,r){const n=new qe(t,"tvar-name",i,r);super(e,n,s,i,r)}},di=ae(Hr),Ve=le(di,0,"TvarToken",zr,Ve),re(di,1,Ve)}}),Po,ju=C({"src/tagPair/translate.ts"(){"use strict";var e,Oo,s;X(),Un(),ht(),Eu(),Po=(s=class extends ot{constructor(r,n,l,o=[]){const d=new qe(r,"translate-attr",l,o);n=n==null?void 0:n.replace(/<tvar(\|[^>]+)>([\s\S]*?)<\/>/gu,(u,c,p)=>(new Ve("tvar",c,!1,l,o),new Ve("","",!0,l,o),`\0${o.length-2}n${p}\0${o.length}n`)).replace(/<(tvar)(\s+name\s*=(?:\s*(?:(["'])[\s\S]*?\3|[^"'\s>]+))?\s*)>([\s\S]*?)<\/(tvar)(\s*)>/giu,(u,c,p,m,b,_,A)=>(new Ve(c,p,!1,l,o),new Ve(_,A,!0,l,o),`\0${o.length-2}n${b}\0${o.length}n`));const a=new H(n,l,o);a.type="translate-inner";super("translate",d,a,"translate",l,o);P(this,e);this.seal("closed",!0),this.seal("selfClosing",!0)}get type(){return"translate"}toString(r){return r?this.lastChild.toString(!0):super.toString()}text(){return this.lastChild.text()}print(){return`<span class="wpb-ext"><translate${R(this,e,Oo).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,Oo=function(){return this.firstChild.toString()===" nowrap"},s)}}),Dr,ci,Gr,Kt,Ru=C({"src/tagPair/include.ts"(){"use strict";K(),me(),gt(),G(),Un(),Dr=[Ye(!1)],Kt=class extends(Gr=ot){get type(){return"include"}constructor(e,t="",s,i,r,n){super(e,t,s!=null?s:"",s===void 0||i!=null?i:"",r,n)}toString(e){return e?"":super.toString()}lint(e=this.getAbsoluteIndex()){{const t=[],{firstChild:s,closed:i,name:r}=this,n=new ce(this,e),l=["no-ignored","unclosed-comment"],{lintConfig:o}=N,{computeEditInfo:d}=o,a=l.map(u=>o.getSeverity(u,"include"));if(a[0]&&s.data.trim()){const u=J(s,n,l[0],"useless-attribute",a[0]);d&&(u.suggestions=[Y(u)]),t.push(u)}if(a[1]&&!i){const u=ie(this,n,l[1],N.msg("unclosed",`<${r}>`),a[1]);d&&(u.suggestions=[Je(u.endIndex,`</${r}>`)]),t.push(u)}return t}}},ci=ae(Gr),Kt=le(ci,0,"IncludeToken",Dr,Kt),re(ci,1,Kt)}}),zs,Hn=C({"mixin/attributesParent.ts"(){"use strict";zs=(e=0)=>t=>{var s,mn;{class r extends t{constructor(){super(...arguments);P(this,s)}hasAttr(o){return R(this,s,mn).call(this).hasAttr(o)}getAttr(o){return R(this,s,mn).call(this).getAttr(o)}}return s=new WeakSet,mn=function(){return this.childNodes[e]},r}}}}),de,hi,gi,Ut,ys,pi,it,fi,mi,xi,Ss,vi,je,Dn,Gn,Vn,Bo,qo=C({"util/sharable.ts"(){"use strict";de=new Set(["align"]),hi=new Set(["cite"]),gi=new Set(["cite","datetime"]),Ut=new Set(["width"]),ys=new Set(["axis","align","bgcolor","height","width","valign"]),pi=new Set([...ys,"abbr","headers","scope","rowspan","colspan"]),it=new Set(["type"]),fi=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),mi=new Set(["clear"]),xi=new Set(["bgcolor","align","valign"]),Ss=new Set(["qid","forcemathmode","type","display"]),vi=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),je=new Set,Dn=new Set(["id","class","style","lang","dir","title","tabindex","aria-describedby","aria-flowto","aria-hidden","aria-label","aria-labelledby","aria-level","aria-owns","role","about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),Gn={div:de,h1:de,h2:de,h3:de,h4:de,h5:de,h6:de,blockquote:hi,q:hi,p:de,br:mi,pre:Ut,ins:gi,del:gi,ul:it,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...fi,"border"]),caption:de,tr:xi,td:pi,th:pi,font:new Set(["size","color","face"]),hr:Ut,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:it,poem:de,categorytree:de,combooption:de,math:je,chem:je,ce:je,img:new Set(["alt","src","width","height","loading","srcset"])},Vn={gallery:new Set(["mode","showfilename","caption","perrow","widths","heights","showthumbnails"]),poem:new Set(["compact"]),categorytree:new Set(["hideroot","onlyroot","depth","mode","hideprefix","namespaces","showcount","notranslations"]),combooption:new Set(["name","for","inline"]),nowiki:je,indicator:new Set(["name"]),langconvert:new Set(["from","to"]),ref:new Set(["group","name","follow","dir","details"]),references:new Set(["group","responsive"]),charinsert:new Set(["label"]),choose:new Set(["uncached","before","after"]),option:new Set(["weight"]),imagemap:je,inputbox:je,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:je,poll:new Set(["id","show-results-before-voting"]),sm2:it,flashmp3:it,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([...Ss,"chem"]),chem:Ss,ce:Ss,hiero:je,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:vi,syntaxhighlight:vi,templatedata:je,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:je},Bo={table:fi,td:new Set([...ys,"scope"]),th:ys,br:mi,caption:de,div:de,hr:Ut,h1:de,h2:de,h3:de,h4:de,h5:de,h6:de,li:it,p:de,pre:Ut,tr:xi,ul:it}}}),Vr,Qr,Jr,Xr,Ns,Pu=C({"src/attribute.ts"(){"use strict";var e,t,s,i,r,Wo,xn,o;K(),fe(),Xe(),qo(),me(),G(),X(),ct(),Vr=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,Qr=/(?:^|\s|\*\/)(?:javascript|vbscript)(?:\W|$)/iu,Jr=new Set(["ext","arg","magic-word","template"]),Xr=new Set(["about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),Ns=(o=class extends H{constructor(a,u,c,p="",m,b=[],_=N.getConfig(),A=[]){const $=new $e(c,"attr-key",_,A);let T;if(c==="title"||u==="img"&&c==="alt")T=new H(m,_,A,{}),T.type="attr-value",T.setAttribute("stage",Ae-1);else if(u==="gallery"&&c==="caption"||u==="choose"&&(c==="before"||c==="after")){const f={..._,excludes:[..._.excludes,"heading","html","table","hr","list"]};T=new H(m,f,A,{}),T.type="attr-value",T.setAttribute("stage",1)}else T=new $e(m,"attr-value",_,A,{});super(void 0,_,A);P(this,r);P(this,e);P(this,t);P(this,s);P(this,i);E(this,e,a),this.append($,T),E(this,s,p),E(this,i,[...b]),E(this,t,u),this.setAttribute("name",Nt(_e(c)))}get type(){return w(this,e)}get tag(){return w(this,t)}get balanced(){return!w(this,s)||w(this,i)[0]===w(this,i)[1]}afterBuild(){w(this,s).includes("\0")&&E(this,s,this.buildFromStr(w(this,s),0)),this.parentNode&&E(this,t,this.parentNode.name),R(this,r,Wo).call(this),super.afterBuild()}toString(a){const[u="",c=""]=w(this,i);return w(this,s)?super.toString(a,w(this,s)+u)+c:this.firstChild.toString(a)}text(){return w(this,s)?`${super.text(`${w(this,s).trim()}"`)}"`:this.firstChild.text()}getGaps(){var a,u;return w(this,s)?w(this,s).length+((u=(a=w(this,i)[0])==null?void 0:a.length)!=null?u:0):0}lint(a=this.getAbsoluteIndex(),u){var c;{const p=super.lint(a,u),{balanced:m,firstChild:b,lastChild:_,name:A,tag:$}=this,T=new ce(this,a),f=["unclosed-quote","obsolete-attr"],{lintConfig:g}=N,x=f.map(h=>g.getSeverity(h,A));if(x[0]&&!m){const h=J(_,T,f[0],"unclosed-quotes",x[0]);h.startIndex--,h.startCol--,g.computeEditInfo&&(h.suggestions=[Je(h.endIndex,w(this,i)[0])]),p.push(h)}const v=R(this,r,xn).call(this,a,T);return v&&p.push(v),x[1]&&((c=Bo[$])!=null&&c.has(A))&&p.push(J(b,T,f[1],"obsolete-attribute",x[1])),p}}getValue(){return w(this,s)?this.lastChild.text().trim():this.type==="ext-attr"||""}escape(){E(this,s,"{{=}}"),this.lastChild.escape()}getAttribute(a){return a==="invalid"?R(this,r,xn).call(this):super.getAttribute(a)}print(){const[a="",u=""]=w(this,i);return w(this,s)?super.print({sep:ds(w(this,s))+a,post:u}):super.print()}json(a,u=this.getAbsoluteIndex()){{const c=super.json(void 0,u);return c.tag=this.tag,c}}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakSet,Wo=function(){this.setAttribute("name",Nt(this.firstChild.text()))},xn=function(a,u){const{firstChild:c,lastChild:p,type:m,name:b,tag:_,parentNode:A}=this,$=!p.childNodes.some(({type:y})=>Jr.has(y)),T=this.getValue(),f=Vn[_],g=Gn[_],{length:x}=this.toString();let v="illegal-attr",h,S;if({lintConfig:h}=N,{computeEditInfo:S}=h,!(f!=null&&f.has(b))&&!(g!=null&&g.has(b))&&(m==="ext-attr"?f||g:!/\{\{[^{]+\}\}/u.test(b))&&(m==="ext-attr"&&!g||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(b)&&(_==="meta"||_==="link"||!Dn.has(b)))||(b==="itemtype"||b==="itemid"||b==="itemref")&&!(A!=null&&A.hasAttr("itemscope"))){if(a===void 0)return!0;{const y=h.getSeverity(v,"unknown");if(y){const k=J(c,u,v,"illegal-attribute-name",y);return S&&(k.suggestions=[Y(a,x)]),k}}}else if(b==="style"&&typeof T=="string"&&Vr.test(T)){if(a===void 0)return!0;{v="insecure-style";const y=h.getSeverity(v);return y&&J(p,u,v,"insecure-style",y)}}else if(b==="tabindex"&&typeof T=="string"&&T!=="0"){if(a===void 0)return!0;{const y=h.getSeverity(v,"tabindex");if(y){const k=J(p,u,v,"nonzero-tabindex",y);return S&&(k.suggestions=[Y(a,x),Re(k,"0 tabindex","0")]),k}}}else if(typeof T=="string"&&((/^xmlns:[\w:.-]+$/u.test(b)||Xr.has(b))&&Qr.test(T)||$&&(b==="href"||_==="img"&&b==="src")&&!new RegExp(String.raw`^(?:${this.getAttribute("config").protocol}|//)\S+$`,"iu").test(T))){if(a===void 0)return!0;{const y=h.getSeverity(v,"value");return y&&J(p,u,v,"illegal-attribute-value",y)}}else if($&&m!=="ext-attr"){const y=qn(_,b),k=String(T).toLowerCase();if(y.length>0&&y.every(L=>L!==k)){if(a===void 0)return!0;{const L=h.getSeverity(v,"value");return L&&J(p,u,v,"illegal-attribute-value",L)}}}return!1},o)}}),bi,Kr,Yr,Hs,Qn=C({"src/attributes.ts"(){"use strict";var e,t,Ls,i;K(),fe(),me(),G(),X(),ct(),Pu(),bi=r=>r.slice(0,-1),Kr=r=>`${bi(r)}-dirty`,Yr=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch{return/[^\W_]/u}})(),Hs=(i=class extends H{constructor(n,l,o,d,a=[]){super(void 0,d,a,{});P(this,t);P(this,e);if(E(this,e,l),this.setAttribute("name",o),n){const u=/([^\s/](?:(?!\0\d+~\x7F)[^\s/=])*)(?:((?:\s(?:\s|\0\d+[cn]\x7F)*)?(?:=|\0\d+~\x7F)(?:\s|\0\d+[cn]\x7F)*)(?:(["'])([\s\S]*?)(\3|$)|(\S*)))?/gu;let c="",p=u.exec(n),m=0;const b=(()=>{c&&(super.insertAt(new $e(c,Kr(l),d,a,{})),c="")});for(;p;){const{index:_,0:A,1:$,2:T,3:f,4:g,5:x,6:v}=p;if(c+=n.slice(m,_),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(_e($).trim())){const h=g!=null?g:v,S=[f,x],y=new Ns(bi(l),o,$,T,h,S,d,a);b(),super.insertAt(y)}else c+=A;({lastIndex:m}=u),p=u.exec(n)}c+=n.slice(m),b()}}get type(){return w(this,e)}afterBuild(){const{parentNode:n}=this;n!=null&&n.is("td")&&this.setAttribute("name",n.subtype),super.afterBuild()}getAttrTokens(n){return this.childNodes.filter(l=>l instanceof Ns&&(!n||l.name===Nt(n)))}hasAttr(n){return this.getAttrTokens(n).length>0}getAttrToken(n){{const l=this.getAttrTokens(n);return l[l.length-1]}}getAttr(n){var l;return(l=this.getAttrToken(n))==null?void 0:l.getValue()}lint(n=this.getAbsoluteIndex(),l){{const o=super.lint(n,l),{parentNode:d,childNodes:a}=this,u=new Map,c=new Set,p=new ce(this,n),m=["no-ignored","no-duplicate"],{lintConfig:b}=N,{computeEditInfo:_,fix:A}=b,$=["closingTag","invalidAttributes","nonWordAttributes"].map(f=>b.getSeverity(m[0],f));if($[0]&&R(this,t,Ls).call(this)){const f=ie(this,p,m[0],"attributes-of-closing-tag",$[0]);if(_){const g=d.getAbsoluteIndex();f.suggestions=[Y(f),Rn(g)]}o.push(f)}for(const f of a)if(f instanceof Ns){const{name:g}=f;u.has(g)?(c.add(g),u.get(g).push(f)):u.set(g,[f])}else{const g=f.text().trim(),x=$[Yr.test(g)?1:2];if(g&&x){const v=J(f,p,m[0],"invalid-attribute",x);_&&(v.suggestions=[Y(v,0," ")]),o.push(v)}}const T=b.getSeverity(m[1],"attribute");if(T&&c.size>0)for(const f of c){const g=u.get(f).map(x=>{const v=x.getValue();return[x,v===!0?"":v]});o.push(...g.map(([x,v],h)=>{const S=J(x,p,m[1],N.msg("duplicate-attribute",f),T);if(_||A){const y=Y(S);!v||g.slice(0,h).some(([,k])=>k===v)?S.fix=y:_&&(S.suggestions=[y])}return S}))}return o}}getAttribute(n){return n==="invalid"?R(this,t,Ls).call(this):super.getAttribute(n)}print(){return this.toString()?`<span class="wpb-${this.type}${R(this,t,Ls).call(this)?" wpb-invalid":""}">${this.childNodes.map(n=>n.print(n instanceof $e?{class:n.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}},e=new WeakMap,t=new WeakSet,Ls=function(){const{parentNode:n}=this;return(n==null?void 0:n.type)==="html"&&n.closing&&this.text().trim()!==""},i)}}),Mo={};oe(Mo,{PreToken:()=>Uo});var Uo,Ou=C({"src/pre.ts"(){"use strict";Xe(),X(),Rt(),Uo=class extends H{get type(){return"ext-inner"}constructor(e,t,s=[]){if(e){const i=/<nowiki>/giu,r=/<\/nowiki>/giu,{length:n}=i.source;let l=i.exec(e);l&&(r.lastIndex=l.index+n);let o=r.exec(e),d=0,a="";for(;l&&o;)new Ee(l[0],t,s,!0),new Ee(o[0],t,s,!0),a+=`${e.slice(d,l.index)}\0${s.length-1}n${e.slice(l.index+n,o.index)}\0${s.length}n`,d=o.index+n+1,i.lastIndex=d,l=i.exec(e),l&&(r.lastIndex=l.index+n),o=r.exec(e);e=a+e.slice(d)}super(e,t,s,{}),this.setAttribute("stage",Ae-1)}isPlain(){return!0}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*\/\s*(pre)\b/giu)}}}}),Ds,Jn=C({"src/multiLine/index.ts"(){"use strict";X(),Ds=class extends H{get type(){return"ext-inner"}toString(e){return super.toString(e,`
|
|
1
|
+
"use strict";(()=>{var fu=Object.defineProperty;var ar=e=>{throw TypeError(e)};var mu=(e,t,s)=>t in e?fu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var xu=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ne=(e,t,s)=>mu(e,typeof t!="symbol"?t+"":t,s),Ks=(e,t,s)=>t.has(e)||ar("Cannot "+s);var w=(e,t,s)=>(Ks(e,t,"read from private field"),s?s.call(e):t.get(e)),P=(e,t,s)=>t.has(e)?ar("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),F=(e,t,s,i)=>(Ks(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),R=(e,t,s)=>(Ks(e,t,"access private method"),s);var ur=(e,t,s,i)=>({set _(r){F(e,t,r,s)},get _(){return w(e,t,i)}});var bd=xu((yd,pu)=>{var vu=Object.create,jt=Object.defineProperty,fo=Object.getOwnPropertyDescriptor,Ln=Object.getOwnPropertyNames,bu=Object.prototype.hasOwnProperty,mo=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Rt=e=>{throw TypeError(e)},xo=(e,t,s)=>t in e?jt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,dr=(e,t)=>jt(e,"name",{value:t,configurable:!0}),C=(e,t)=>function(){return e&&(t=(0,e[Ln(e)[0]])(e=0)),t},vo=(e,t)=>function(){return t||(0,e[Ln(e)[0]])((t={exports:{}}).exports,t),t.exports},oe=(e,t)=>{for(var s in t)jt(e,s,{get:t[s],enumerable:!0})},wu=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Ln(t))!bu.call(e,r)&&r!==s&&jt(e,r,{get:()=>t[r],enumerable:!(i=fo(t,r))||i.enumerable});return e},se=e=>wu(jt({},"__esModule",{value:!0}),e),ae=e=>{var t;return[,,,vu((t=e==null?void 0:e[mo("metadata")])!=null?t:null)]},bo=["class","method","getter","setter","accessor","field","value","get","set"],Vt=e=>e!==void 0&&typeof e!="function"?Rt("Function expected"):e,yu=(e,t,s,i,r)=>({kind:bo[e],name:t,metadata:i,addInitializer:n=>s._?Rt("Already initialized"):r.push(Vt(n||null))}),Fn=(e,t)=>xo(t,mo("metadata"),e[3]),re=(e,t,s,i)=>{for(var r=0,n=e[t>>1],l=n&&n.length;r<l;r++)t&1?n[r].call(s):i=n[r].call(s,i);return i},le=(e,t,s,i,r,n)=>{var l,o,d,a,u,c=t&7,p=!!(t&8),m=!!(t&16),b=c>3?e.length+1:c?p?1:2:0,_=bo[c+5],A=c>3&&(e[b-1]=[]),k=e[b]||(e[b]=[]),T=c&&(!m&&!p&&(r=r.prototype),c<5&&(c>3||!m)&&fo(c<4?r:{get[s](){return pe(this,n)},set[s](g){return ke(this,n,g)}},s));c?m&&c<4&&dr(n,(c>2?"set ":c>1?"get ":"")+s):dr(r,s);for(var f=i.length-1;f>=0;f--)a=yu(c,s,d={},e[3],k),c&&(a.static=p,a.private=m,u=a.access={has:m?g=>Au(r,g):g=>s in g},c^3&&(u.get=m?g=>(c^1?pe:cn)(g,r,c^4?n:T.get):g=>g[s]),c>2&&(u.set=m?(g,x)=>ke(g,r,x,c^4?n:T.set):(g,x)=>g[s]=x)),o=(0,i[f])(c?c<4?m?n:T[_]:c>4?void 0:{get:T.get,set:T.set}:r,a),d._=1,c^4||o===void 0?Vt(o)&&(c>4?A.unshift(o):c?m?n=o:T[_]=o:r=o):typeof o!="object"||o===null?Rt("Object expected"):(Vt(l=o.get)&&(T.get=l),Vt(l=o.set)&&(T.set=l),Vt(l=o.init)&&A.unshift(l));return c||Fn(e,r),T&&jt(r,s,T),m?c^4?n:T:r},Su=(e,t,s)=>xo(e,typeof t!="symbol"?t+"":t,s),En=(e,t,s)=>t.has(e)||Rt("Cannot "+s),Au=(e,t)=>Object(t)!==t?Rt('Cannot use the "in" operator on this value'):e.has(t),pe=(e,t,s)=>(En(e,t,"read from private field"),s?s.call(e):t.get(e)),De=(e,t,s)=>t.has(e)?Rt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),ke=(e,t,s,i)=>(En(e,t,"write to private field"),i?i.call(e,s):t.set(e,s),s),cn=(e,t,s)=>(En(e,t,"access private method"),s),ku=(e,t,s,i)=>({set _(r){ke(e,t,r,s)},get _(){return pe(e,t,i)}}),wo,as,jn=C({"base.ts"(){"use strict";wo=(()=>{const e={redirect:1,onlyinclude:1,noinclude:1,include:1,comment:1,ext:1,arg:2,"magic-word":2,template:2,heading:2,html:3,table:4,hr:5,"double-underscore":5,link:6,category:6,file:6,quote:7,"ext-link":8,"free-ext-link":9,"magic-link":9,list:10,dd:10,converter:11,"list-range":11};return Object.setPrototypeOf(e,null),e})(),as=(()=>{const e=["bold-header","format-leakage","fostered-content","h1","illegal-attr","insecure-style","invalid-gallery","invalid-imagemap","invalid-invoke","invalid-isbn","invalid-url","lonely-apos","lonely-bracket","lonely-http","nested-link","no-arg","no-duplicate","no-ignored","obsolete-attr","obsolete-tag","parsing-order","pipe-like","table-layout","tag-like","unbalanced-header","unclosed-comment","unclosed-quote","unclosed-table","unescaped","unknown-page","unmatched-tag","unterminated-url","url-encoding","var-anchor","void-ext"];return Object.freeze(e),e})()}});function Fe(e,t,s){return s===1?e.replace(/\0(\d+)g\x7F/gu,(i,r)=>Fe(String(t[r]),t,2)):s===2?e.replace(/\0(\d+)n\x7F/gu,(i,r)=>String(t[r])):e.replace(/\0(\d+)\x7F/gu,(i,r)=>t[r])}var Qe,Ys,It,Nt,Lt,mt,us,_e,dt,cr,hr,ds,yo,gr,pr,cs,Ft,fe=C({"util/string.ts"(){"use strict";Qe=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,Ys=String.raw`[^[\]<>"\0-\x1F\x7F${Qe}\uFFFD]`,It=String.raw`(?:\[[\da-f:.]+\]|${Ys})`,Nt=String.raw`(?:${Ys}|\0\d+[cn!~]\x7F)*`,Lt=e=>e.trim().toLowerCase(),mt=(e,t)=>s=>s.replace(e,t),us=mt(/[\0\x7F]|\r$/gmu,""),_e=mt(/\0\d+[cn]\x7F/gu,""),dt=(e,t="")=>e.map(s=>typeof s=="string"?s:s.text()).join(t),cr={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},hr=mt(/&(?:#(\d+|[Xx][\da-fA-F]+)|([lg]t|[LG]T|[lr]brac[ke]|nbsp|amp|AMP|quot|QUOT));/gu,(e,t,s)=>t?String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t)):cr[s.toLowerCase()]),ds=e=>hr(e),yo=mt(/&#(\d+|x[\da-f]+);/giu,(e,t)=>String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t))),gr={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},pr=e=>mt(e,t=>`&${gr[t]};`),cs=pr(/[&<>]/gu),Ft=(e,t={})=>{const{pre:s="",post:i="",sep:r=""}=t;return s+e.map(n=>n.print()).join(r)+i}}}),$u=vo({"i18n/en.json"(e,t){t.exports={"attributes-of-closing-tag":"attributes of a closing tag","bold-apostrophes":"bold apostrophes","bold-in-header":"bold text in a section header",close:null,"closing-and-self-closing":"tag that is both closing and self-closing",comment:null,"conflicting-image-parameter":"conflicting image $1 parameter","content-outside-table":"content to be moved outside the table",decode:null,delink:null,"duplicate-attribute":"duplicate $1 attribute","duplicate-category":"duplicate category","duplicate-id":"duplicate HTML id","duplicate-image-parameter":"duplicate image $1 parameter","duplicate-parameter":"duplicate template parameter",encode:null,escape:null,expand:null,"ext-in-html":"extension tag in HTML tag attributes",frame:null,"full-width-punctuation":"full-width punctuation","header-in-html":"section header in HTML tag attributes","horizontal-alignment":null,"html-in-table":"HTML tag in table attributes","illegal-attribute-name":"invalid attribute name","illegal-attribute-value":"invalid attribute value","illegal-module":"invalid Scribunto module name","imagemap-without-image":"<imagemap> without an image","in-url":"$1 in URL","inconsistent-table":"inconsistent table layout","insecure-style":"insecure style","invalid-attribute":"element containing an invalid attribute name","invalid-content":"invalid content in <$1>","invalid-conversion-flag":"invalid conversion flag","invalid-gallery":"invalid gallery image","invalid-image-parameter":"invalid image parameter","invalid-imagemap-link":"invalid link in <imagemap>","invalid-isbn":"invalid ISBN","invalid-parameter":"invalid parameter of <$1>","invalid-self-closing":"invalid self-closing tag","invalid-url":"invalid URL","invisible-triple-braces":"invisible content inside triple braces","italic-apostrophes":"italic apostrophes","left-bracket":"opening bracket","link-in-extlink":"internal link in an external link",lonely:'lonely "$1"',"missing-extension":"missing file extension","missing-function":"missing Scribunto module function name",newline:null,"no-self-closing":"no self-closing","nonzero-tabindex":"nonzero tabindex","nothing-in":"nothing should be in <$1>","obsolete-attribute":"obsolete attribute","obsolete-tag":"obsolete HTML tag",open:null,prefix:null,"pipe-in-link":'additional "|" in the link text',"pipe-in-table":'additional "|" in a table cell',"ref-in-link":"<ref> in an internal or external link",remove:null,"template-in-link":"template in an internal link target","unbalanced-in-section-header":"unbalanced $1 in a section header",unclosed:"unclosed $1","unclosed-comment":"unclosed HTML comment","unclosed-quotes":"unclosed quotes","unclosed-table":"unclosed table","unclosed-tag":"unclosed tag","unescaped-query":"unescaped query string in an anonymous parameter","unexpected-argument":"unexpected template argument","unmatched-closing":"unmatched closing tag","unnecessary-encoding":"unnecessary percent-encoding in an internal link",uppercase:null,"useless-attribute":"useless attribute","useless-fragment":"useless fragment","useless-link-text":"useless link text","variable-anchor":"variable anchor in a section header","vertical-alignment":null,whitespace:null}}}),_u=vo({"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:[]}}}),Ae,So,hn,Xe=C({"util/constants.ts"(){"use strict";Ae=11,So=$u(),hn=_u()}});function at(e){const t=new Map,s=new WeakMap;return i=>{const r=typeof i=="string"?t:s;if(r.has(i)){const l=r.get(i);return l.lastIndex=0,l}const n=e(i);return r.set(i,n),n}}var hs,Ao,fr,ko,$o,Ke=C({"../common/dist/index.mjs"(){"use strict";hs=e=>decodeURIComponent(e.replace(/%(?![\da-f]{2})/giu,"%25")),Ao=e=>Math.round(e*255).toString(16).padStart(2,"0"),fr=(()=>{const e=String.raw`#(?:[\da-f]{3,4}|(?:[\da-f]{2}){3,4})(?![\p{L}\p{N}_])`,t=String.raw`(?:\d*\.)?\d+%?`,s=String.raw`(?:\d*\.)?\d+(?:deg|grad|rad|turn)?`,i=String.raw`rgba?\(\s*(?:${String.raw`${new Array(3).fill(t).join(String.raw`\s+`)}(?:\s*\/\s*${t})?`}|${String.raw`${new Array(3).fill(t).join(String.raw`\s*,\s*`)}(?:\s*,\s*${t})?`})\s*\)`,r=String.raw`hsla?\(\s*(?:${String.raw`${s}\s+${t}\s+${t}(?:\s*\/\s*${t})?`}|${String.raw`${s}${String.raw`\s*,\s*(?:\d*\.)?\d+%`.repeat(2)}(?:\s*,\s*${t})?`})\s*\)`;return{full:new RegExp(String.raw`(^|[^\p{L}\p{N}_])(${e}|${i}|${r})`,"giu"),rgb:new RegExp(String.raw`(^|[^\p{L}\p{N}_])(${e}|${i})`,"giu")}})(),ko=(e,t=!0)=>{const s=[],i=fr[t?"full":"rgb"];i.lastIndex=0;let r=i.exec(e),n=0;for(;r;){const l=r.index+r[1].length;l>n&&s.push([e.slice(n,l),n,l,!1]),{lastIndex:n}=i,s.push([r[2],l,n,e[l-1]!=="&"||!/^#\d+$/u.test(r[2])]),r=i.exec(e)}return e.length>n&&s.push([e.slice(n),n,e.length,!1]),s},$o=at}}),ce,me=C({"lib/rect.ts"(){"use strict";var e,t,s,i,gn,n;ce=(n=class{constructor(l,o){P(this,i);P(this,e);P(this,t);P(this,s);F(this,e,l),F(this,t,o)}get start(){return w(this,t)}get top(){return R(this,i,gn).call(this).top}get left(){return R(this,i,gn).call(this).left}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakSet,gn=function(){var l;return(l=w(this,s))!=null||F(this,s,w(this,e).getRootNode().posFromIndex(w(this,t))),w(this,s)},n)}}),mr,xr,ls,gs,Zs,J,Y,Pe,Ws,Z,Rn,Je,Pn,On,Bn,ps,Et,qn,ut,Wn,K=C({"util/lint.ts"(){"use strict";Ke(),je(),me(),G(),mr=new Set(["tr","td","th","caption"]),xr=new Set(["Template:!!","Template:!-"]),ls=e=>{const t=e.childNodes.find(s=>s.text().trim());if(!t||t.type==="text"&&t.data.trim().startsWith("!")||t.is("magic-word")&&t.name==="!"||t.is("template")&&xr.has(t.name)||t.is("html")&&mr.has(t.name))return!1;if(t.is("arg"))return t.length>1&&ls(t.childNodes[1]);if(t.is("magic-word"))try{const s=t.getPossibleValues().map(ls);return s.includes(2)?2:s.includes(1)&&1}catch{}return t.is("template")||t.is("magic-word")&&t.name==="invoke"?1:2},gs=(e,t,s,i)=>({line:e+s-1,character:(s===1?t:0)+i}),Zs=e=>(t,s,i,r,n="error")=>{const{start:l}=s,{top:o,left:d}=s instanceof ce?s:new ce(t,l),{offsetHeight:a,offsetWidth:u}=t,{startIndex:c,startLine:p,startCol:m}=e(t,l,o,d),{line:b,character:_}=gs(p,m,a,u);return{rule:i,message:N.msg(r),severity:n,startIndex:c,endIndex:c+t.toString().length,startLine:p,endLine:b,startCol:m,endCol:_}},J=Zs((e,t,s,i)=>{const r=e.getRelativeIndex(),{top:n,left:l}=e.parentNode.posFromIndex(r);return{startIndex:t+r,startLine:s+n,startCol:n?l:i+l}}),Y=Zs((e,t,s,i)=>({startIndex:t,startLine:s,startCol:i})),Pe=(e,t,s,i=0)=>({desc:N.msg(t),range:[e.startIndex+i,e.endIndex],text:s}),Ws=(e,t,s)=>({desc:N.msg(t),range:[e,e],text:s}),Z=(e,t=0,s="")=>typeof e=="number"?{desc:N.msg("remove"),range:[e,e+t],text:s}:Pe(e,"remove",s,t),Rn=(e,t)=>Pe(e,"decode",hs(t.text().replace(/%(?=21|3[ce]|5[bd]|7[b-d])/giu,"%25"))),Je=(e,t,s=0)=>({desc:N.msg("close"),range:[e+s,e],text:t}),Pn=e=>({desc:N.msg("open"),range:[e+1,e+2],text:""}),On=(e,t)=>Pe(e,"comment",`<!--${t}-->`),Bn=(e,t)=>Pe(e,"uppercase",t.toUpperCase()),ps=(e,t=0)=>({desc:N.msg("whitespace"),range:[e,e+t],text:" "}),Et=(e,t,s=1)=>({desc:N.msg("escape"),range:[e,e+s],text:t.repeat(s)}),qn=(e,t)=>({desc:N.msg("escape"),range:[e,e+t.length],text:t.replace(/\|/gu,"|")}),ut=(e,t,s,i)=>{if(e&&(i||N.viewOnly&&e[0]===xe.rev))return e[1];const r=t();return(i||N.viewOnly)&&s([xe.rev,r]),r},Wn=(e,t)=>e==="ol"&&t==="type"?["1","a","A","i","I"]:e==="th"&&t==="scope"?["row","col","rowgroup","colgroup"]:t==="dir"?["ltr","rtl","auto"]:t==="aria-hidden"?["true","false"]:[]}}),vr,Un,_o=C({"parser/selector.ts"(){"use strict";vr=(e,t,s)=>{if(e.includes("#")){const i=e.indexOf("#");return(i===0||e.slice(0,i)===t)&&e.slice(i+1)===s}return!e||e===t},Un=(e,t,s)=>{const i=e.split(",");return(({type:r,name:n})=>i.some(l=>vr(l.trim(),r,n)))}}}),Us,Mn=C({"mixin/cached.ts"(){"use strict";K(),Us=(e=!0)=>t=>{const s=new WeakMap;return function(...i){return ut(s.get(this),()=>t.apply(this,i),r=>{s.set(this,r)},e)}}}}),To,Tu=C({"mixin/nodeLike.ts"(){"use strict";To=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}}}),br,wr,bs,Bt,qt,ws,Wt,Ut,Mt,rt,Co=C({"lib/node.ts"(){"use strict";K(),je(),Mn(),Tu(),G(),wr=[To],br=[Us(!1)],rt=class{constructor(){re(Mt,5,this),Su(this,"childNodes",[]),De(this,bs),De(this,Bt),De(this,qt),De(this,ws),De(this,Wt),De(this,Ut,{})}get parentNode(){return pe(this,bs)}get nextSibling(){return pe(this,Bt)}get previousSibling(){return pe(this,qt)}getChildNodes(){const{childNodes:e}=this;return Object.isFrozen(e)?[...e]:e}getAttribute(e){return e==="padding"?0:this[e]}setAttribute(e,t){switch(e){case"parentNode":ke(this,bs,t),t||(ke(this,Bt,void 0),ke(this,qt,void 0));break;case"nextSibling":ke(this,Bt,t);break;case"previousSibling":ke(this,qt,t);break;case"aIndex":N.viewOnly&&ke(this,Wt,[xe.rev,t]);break;default:this[e]=t}}getRootNode(){return ut(pe(this,ws),()=>{var e,t;return(t=(e=this.parentNode)==null?void 0:e.getRootNode())!=null?t:this},e=>{const[,t]=e;t.type==="root"&&ke(this,ws,e)})}indexFromPos(e,t){{if(e<0||t<0)return;const s=this.getLines();if(e>=s.length)return;const[,i,r]=s[e],n=i+t;return n>r?void 0:n}this.lspError("AstNode.indexFromPos")}posFromIndex(e){{const{length:t}=String(this);if(e+=e<0?t:0,e>=0&&e<=t){const s=this.getLines(),i=s.findIndex(([,,r])=>e<=r);return{top:i,left:e-s[i][1]}}return}}getDimension(){{const e=this.getLines(),t=e[e.length-1];return{height:e.length,width:t[2]-t[1]}}}getGaps(e){return 0}getRelativeIndex(e){if(e===void 0){const{parentNode:t}=this;return t?t.getRelativeIndex(t.childNodes.indexOf(this)):0}return ut(pe(this,Ut)[e],()=>{const{childNodes:t}=this,s=e+(e<0?t.length:0);let i=this.getAttribute("padding");for(let r=0;r<s;r++)N.viewOnly&&(pe(this,Ut)[r]=[xe.rev,i]),i+=t[r].toString().length+this.getGaps(r);return i},t=>{pe(this,Ut)[e]=t})}getAbsoluteIndex(){return ut(pe(this,Wt),()=>{const{parentNode:e}=this;return e?e.getAbsoluteIndex()+this.getRelativeIndex():0},e=>{ke(this,Wt,e)})}getBoundingClientRect(){return{...this.getDimension(),...this.getRootNode().posFromIndex(this.getAbsoluteIndex())}}is(e){return this.type===e}getLines(){{const e=[];let t=0;for(const s of String(this).split(`
|
|
2
|
+
`)){const i=t+s.length;e.push([s,t,i]),t=i+1}return e}}seal(e,t){const s=!t&&!!this[e];Object.defineProperty(this,e,{enumerable:s,configurable:!0})}lspError(e){throw new Error(`${e} method is only available in the LSP version!`)}},Mt=ae(null),bs=new WeakMap,Bt=new WeakMap,qt=new WeakMap,ws=new WeakMap,Wt=new WeakMap,Ut=new WeakMap,le(Mt,1,"getLines",br,rt),rt=le(Mt,0,"AstNode",wr,rt),re(Mt,1,rt)}}),Io,Cu=C({"mixin/elementLike.ts"(){"use strict";_o(),Io=e=>{var t,pn;{class i extends e{constructor(){super(...arguments);P(this,t)}getElementBy(l){for(const o of this.childNodes){if(o.type==="text")continue;if(l(o))return o;const d=o.getElementBy(l);if(d)return d}}querySelector(l){return this.getElementBy(R(this,t,pn).call(this,l))}getElementsBy(l,o=[]){for(const d of this.childNodes)d.type!=="text"&&(l(d)&&o.push(d),d.getElementsBy(l,o));return o}querySelectorAll(l){return this.getElementsBy(R(this,t,pn).call(this,l))}escape(){for(const l of this.childNodes)l.escape()}}return t=new WeakSet,pn=function(l){return Un(l,this)},i}}}}),yr,ei,Sr,Qt,Iu=C({"lib/element.ts"(){"use strict";fe(),je(),_o(),Co(),Cu(),yr=[Io],Qt=class extends(Sr=rt){get length(){return this.childNodes.length}text(e){return dt(this.childNodes,e)}normalize(){const e=this.getChildNodes(),t=s=>{var i,r;e.splice(s,1),(i=e[s-1])==null||i.setAttribute("nextSibling",e[s]),(r=e[s])==null||r.setAttribute("previousSibling",e[s-1])};for(let s=e.length-1;s>=0;s--){const{type:i,data:r}=e[s];i!=="text"||e.length===1||this.getGaps(s-(s&&1))||r===""&&t(s)}this.setAttribute("childNodes",e)}removeAt(e){return ms(this,e,1)[0]}insertAt(e,t=this.length){return ms(this,t,0,[e]),e}closest(e){const t=Un(e,this);let{parentNode:s}=this;for(;s;){if(t(s))return s;({parentNode:s}=s)}}append(...e){this.safeAppend(e)}safeAppend(e){for(const t of e)this.insertAt(t)}safeReplaceChildren(e){for(let t=this.length-1;t>=0;t--)this.removeAt(t);this.safeAppend(e)}setText(e,t=0){t+=t<0?this.length:0;const s=this.childNodes[t],{data:i}=s;return s.replaceData(e),i}toString(e,t=""){return this.childNodes.map(s=>s.toString(e)).join(t)}caretPositionFromIndex(e){{if(e===void 0)return;const{length:t}=this.toString();if(e>t||e<-t)return;e+=e<0?t:0;let s=this,i=0,r=0;for(;s.type!=="text";){const{childNodes:n}=s;i+=s.getAttribute("padding");for(let l=0;i<=e&&l<n.length;l++){const o=n[l],{nextSibling:d}=o,a=o.toString(),u=a.length;if(o.setAttribute("aIndex",i),i+=u,i>e||i===e&&u>0&&(!d||d.type==="text"||o.type!=="text"&&(a.trim()||!d.toString().trim()))){s=o,i-=u,r=i;break}i+=s.getGaps(l)}if(s.childNodes===n)return{offsetNode:s,offset:e-r}}return{offsetNode:s,offset:e-r}}this.lspError("AstElement.caretPositionFromIndex")}elementFromIndex(e){var t;{const s=(t=this.caretPositionFromIndex(e))==null?void 0:t.offsetNode;return(s==null?void 0:s.type)==="text"?s.parentNode:s}this.lspError("AstElement.elementFromIndex")}elementFromPoint(e,t){return this.elementFromIndex(this.indexFromPos(t,e))}lint(e=this.getAbsoluteIndex(),t){{const s=[];for(let i=0,r=e+this.getAttribute("padding");i<this.length;i++){const n=this.childNodes[i];n.setAttribute("aIndex",r);const l=n.lint(r,t);l.length>0&&s.push(...l),r+=n.toString().length+this.getGaps(i)}return s}}print(e={}){const t=e.class;return this.toString()?(t===""?"":`<span class="wpb-${t!=null?t:this.type}${this.getAttribute("invalid")?" wpb-invalid":""}">`)+Ft(this.childNodes,e)+(t===""?"":"</span>"):""}json(e,t=this.getAbsoluteIndex()){{const s={...this,type:this.type,range:[t,t+this.toString().length],childNodes:[]};for(let i=0,r=t+this.getAttribute("padding");i<this.length;i++){const n=this.childNodes[i],{length:l}=n.toString();n.setAttribute("aIndex",r),s.childNodes.push(n.type==="text"?{data:n.data,range:[r,r+l]}:n.json(void 0,r)),r+=l+this.getGaps(i)}return s}}},ei=ae(Sr),Qt=le(ei,0,"AstElement",yr,Qt),re(ei,1,Qt)}}),xs,Ms=C({"mixin/gapped.ts"(){"use strict";xs=(e=1)=>t=>{class s extends t{getGaps(){return e}}return s}}}),Be,We=C({"mixin/noEscape.ts"(){"use strict";Be=e=>{{class t extends e{escape(){}}return t}}}}),Ar,No,Nu=C({"src/parameter.ts"(){"use strict";fe(),K(),G(),X(),Ar=new RegExp(`https?://${It}${Nt}$`,"iu"),No=class extends H{get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){var e;try{return!!((e=this.parentNode)!=null&&e.getDuplicatedArgs().some(([t])=>t===this.name))}catch{return!1}}constructor(e,t,s,i=[]){super(void 0,s,i);const r=new H(typeof e=="number"?void 0:e,s,i,{}),n=new H(t,s,i);r.type="parameter-key",r.setAttribute("stage",2),n.type="parameter-value",n.setAttribute("stage",2),this.append(r,n)}trimName(e,t=!0){const s=(typeof e=="string"?e:e.toString(!0)).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");return this.setAttribute("name",s),s}afterBuild(){if(!this.anon){const{parentNode:e,firstChild:t}=this,s=this.trimName(t);e&&e.getArgs(s,!1,!1).add(this)}super.afterBuild()}toString(e){return this.anon?this.lastChild.toString(e):super.toString(e,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(e=this.getAbsoluteIndex(),t){var s;{const i=super.lint(e,t),r="unescaped",{lintConfig:n}=N,l=n.getSeverity(r);if(l){const{firstChild:o}=this,d=(s=Ar.exec(o.text()))==null?void 0:s[0];try{if(d&&new URL(d).search){const a=J(o,{start:e},r,"unescaped-query",l);a.startIndex=a.endIndex,a.startLine=a.endLine,a.startCol=a.endCol,a.endIndex++,a.endCol++,(n.computeEditInfo||n.fix)&&(a.fix=Et(a.startIndex,"{{=}}")),i.push(a)}}catch{}}return i}}print(){return super.print({sep:this.anon?"":"="})}json(e,t=this.getAbsoluteIndex()){{const s=super.json(void 0,t);return Object.assign(s,{anon:this.anon},this.duplicated&&{duplicated:!0}),s}}}}}),$e,ct=C({"src/atom.ts"(){"use strict";var e,t;X(),$e=(t=class extends H{constructor(i,r,n,l,o){super(i,n,l,o);P(this,e);F(this,e,r)}get type(){return w(this,e)}set type(i){F(this,e,i)}getAttribute(i){var r;return i==="invalid"?this.type==="converter-flag"&&!!((r=this.parentNode)!=null&&r.isInvalidFlag(this)):super.getAttribute(i)}},e=new WeakMap,t)}}),qe,ht=C({"src/syntax.ts"(){"use strict";var e,t;X(),qe=(t=class extends H{constructor(i,r,n,l,o){super(i,n,l,o);P(this,e);F(this,e,r)}get type(){return w(this,e)}lint(i=this.getAbsoluteIndex()){return super.lint(i,!1)}},e=new WeakMap,t)}}),Lo={};oe(Lo,{TranscludeToken:()=>lt});var kr,ti,$r,lt,Fo=C({"src/transclude.ts"(){"use strict";var e,t,s,i,r,n,Jt,Eo,d;fe(),K(),je(),me(),Ms(),We(),G(),X(),Nu(),ct(),ht(),kr=[Be,xs()],lt=(d=class extends($r=H){constructor(u,c,p,m=[]){var $,L;let b;const _=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(u);_&&(b=Number(_[1]),u=u.replace(`\0${b}h`,m[b].toString().replace(/^\n/u,"")));super(void 0,p,m,{});P(this,n);Ne(this,"modifier","");P(this,e,"template");P(this,t,":");P(this,s,!1);P(this,i,new Map);P(this,r);const{parserFunction:[A,k],variable:T,functionHook:f}=p,g=($=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(u))==null?void 0:$[0];if(g)this.setAttribute("modifier",g),u=u.slice(g.length);else if(u.includes(":")){const[I,...j]=u.split(":"),[B]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((L=j[0])!=null?L:"");this.setModifier(`${I}:${B}`)&&(u=j.join(":").slice(B.length))}const x=u.search(/[::]/u),v=u[x]===":",h=x!==-1;if(h||c.length===0&&!w(this,s)){const I=h?u.slice(0,x):u,j=h&&u.slice(x+1),B=_e(I),O=h?B.slice(B.search(/\S/u))+(v?":":""):B.trim(),E=O.toLowerCase(),D=Array.isArray(k),W=D?k.includes(O):Object.prototype.hasOwnProperty.call(k,O),q=!D&&W?k[O]:Object.prototype.hasOwnProperty.call(A,E)&&A[E],z=D&&W||!("functionHook"in p)||f.includes(q),U=D&&W||T.includes(q);if(h?q&&z:U){this.setAttribute("name",q||E.replace(/^#|:$/u,"")),F(this,e,"magic-word"),v&&F(this,t,":");const V=new qe(I,"magic-word-name",p,m);if(super.insertAt(V),j!==!1&&c.unshift([j]),this.name==="invoke")for(let Q=0;Q<2;Q++){const ie=c.shift();if(!ie)break;const ue=new $e(ie.join("="),`invoke-${Q?"function":"module"}`,p,m);super.insertAt(ue)}}}if(this.type==="template"){const I=_e(u).trim();if(!this.normalizeTitle(I,10,{halfParsed:!0,temporary:!0}).valid)throw m.pop(),new SyntaxError("Invalid template name");const j=new $e(u,"template-name",p,m,{});super.insertAt(j)}typeof b=="number"&&(m[b]=void 0);const S=this.isTemplate();let y=1;for(let I=0;I<c.length;I++){const j=c[I];S||this.name==="switch"&&I>0||this.name==="tag"&&I>1||(j[0]=j.join("="),j.length=1),j.length===1&&(j.unshift(y),y++),this.insertAt(new No(...j,p,m))}this.seal("modifier")}get type(){return w(this,e)}get module(){return this.type==="magic-word"&&this.name==="invoke"?R(this,n,Jt).call(this).title:void 0}get function(){var u;return this.type==="magic-word"&&this.name==="invoke"?(u=this.childNodes[2])==null?void 0:u.text().trim():void 0}setModifier(u){const{parserFunction:[,,c,p]}=this.getAttribute("config"),m=_e(u).trim();if(u&&!m.endsWith(":"))return!1;const b=m.slice(0,-1).toLowerCase(),_=c.includes(b),A=p.includes(b);return w(this,s)&&_||!w(this,s)&&(A||!u)||(xe.running||this.length>1)&&(_||A||!u)?(this.setAttribute("modifier",u),F(this,s,_),!!u):!1}isTemplate(){return this.type==="template"||this.name==="invoke"}afterBuild(){this.modifier.includes("\0")&&this.setAttribute("modifier",this.buildFromStr(this.modifier,0)),super.afterBuild(),this.isTemplate()&&this.type==="template"&&(F(this,r,R(this,n,Jt).call(this)),this.setAttribute("name",w(this,r).title))}toString(u){const{childNodes:c,length:p,firstChild:m,modifier:b,type:_}=this;return`{{${b}${_==="magic-word"?m.toString(u)+(p===1?"":w(this,t))+c.slice(1).map(A=>A.toString(u)).join("|"):super.toString(u,"|")}}}`}text(){const{childNodes:u,length:c,firstChild:p,modifier:m,type:b,name:_}=this;return b==="magic-word"&&_==="vardefine"?"":`{{${m}${b==="magic-word"?p.text()+(c===1?"":w(this,t))+dt(u.slice(1),"|"):super.text("|")}}}`}getAttribute(u){switch(u){case"padding":return this.modifier.length+2;case"title":return w(this,r);case"colon":return w(this,t);case"invalid":return this.type==="magic-word"&&this.name==="invoke"&&(this.length===2||!R(this,n,Jt).call(this).valid);default:return super.getAttribute(u)}}lint(u=this.getAbsoluteIndex(),c){{const p=super.lint(u,c);if(!this.isTemplate())return p;const{type:m,childNodes:b,length:_}=this,A=new ce(this,u),{lintConfig:k}=N,{computeEditInfo:T}=k,f=m==="magic-word";let g="no-ignored",x=k.getSeverity(g,"fragment");if(f&&!R(this,n,Jt).call(this).valid)g="invalid-invoke",x=k.getSeverity(g,"name"),x&&p.push(J(b[1],A,g,"illegal-module",x));else if(x){const v=b[f?1:0],h=v.childNodes.findIndex(y=>y.type==="text"&&ds(y.data).includes("#")),S=v.childNodes[h];if(S){const y=J(v,A,g,"useless-fragment",x);T&&(y.suggestions=[Z(y,v.getRelativeIndex(h)+S.data.indexOf("#"))]),p.push(y)}}if(g="invalid-invoke",x=k.getSeverity(g,"function"),x&&f&&_===2)return p.push(Y(this,A,g,"missing-function",x)),p;if(g="no-duplicate",x=k.getSeverity(g,"parameter"),x){const v=this.getDuplicatedArgs().filter(([,S])=>!S[0].querySelector("ext")),h="duplicate-parameter";for(const[,S]of v)p.push(...S.map(y=>{const $=J(y,A,g,h,x);return T&&($.suggestions=[Z($,-1)]),$}))}return p}}insertAt(u,c=this.length){return super.insertAt(u,c),u.anon?R(this,n,Eo).call(this,u):u.name&&this.getArgs(u.name,!1,!1).add(u),u}getAllArgs(){return this.childNodes.filter(Js("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:u})=>u)}getArgs(u,c,p=!0){const m=String(u).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");let b;return w(this,i).has(m)?b=w(this,i).get(m):(b=new Set(this.getAllArgs().filter(({name:_})=>m===_)),w(this,i).set(m,b)),b}getDuplicatedArgs(){return[...w(this,i)].filter(([,{size:u}])=>u>1).map(([u,c])=>[u,[...c]])}getPossibleValues(){const{type:u,name:c,childNodes:p}=this;if(u==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let m,b;switch(c){case"if":case"ifexist":case"ifexpr":case"iferror":m=2;break;case"ifeq":m=3;break;case"switch":{const _=p.slice(2),A=_[_.length-1];b=[..._.filter(({anon:k})=>!k),...A!=null&&A.anon?[A]:[]].map(({lastChild:k})=>k);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}b!=null||(b=p.slice(m,m+2).map(({lastChild:_})=>_));for(let _=0;_<b.length;){const{length:A,0:k}=b[_].childNodes.filter(T=>T.text().trim());if(A===0)b.splice(_,1);else if(A>1||k.type!=="magic-word")_++;else try{const T=k.getPossibleValues();b.splice(_,1,...T),_+=T.length}catch{_++}}return b}print(){const{childNodes:u,length:c,firstChild:p,modifier:m,type:b}=this;return`<span class="wpb-${b}${this.getAttribute("invalid")?" wpb-invalid":""}">{{${b==="magic-word"?cs(m)+p.print()+(c===1?"":w(this,t))+Ft(u.slice(1),{sep:"|"}):(m?`<span class="wpb-magic-word">${cs(m)}</span>`:"")+Ft(u,{sep:"|"})}}}</span>`}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakMap,n=new WeakSet,Jt=function(){const u=this.type==="template";return this.normalizeTitle(this.childNodes[u?0:1].text(),u?10:828,{temporary:!0})},Eo=function(u){const c=this.getAnonArgs(),p=typeof u!="number";for(let m=p?c.indexOf(u):u-1;m<c.length;m++){const b=c[m],{name:_}=b,A=String(m+1);(_!==A||b===u)&&(b.setAttribute("name",A),this.getArgs(A,!1,!1).add(b))}},d),ti=ae($r),lt=le(ti,0,"TranscludeToken",kr,lt),re(ti,1,lt)}}),ys,si,ii,_r,Tr,Cr,Ir,ni,Nr,fn,Lu=C({"lib/text.ts"(){"use strict";var e,mn,s;fe(),K(),je(),G(),Co(),ys=String.raw`[${Qe}\t]*`,si=String.raw`[^\S\n]*`,ii=String.raw`<${si}(?:/${si})?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|(?:rfc|pmid)(?=[-::]?${ys}\d)|isbn(?=[-::]?${ys}(?:\d(?:${ys}|-)){6})`,_r=new RegExp(String.raw`${ii}|https?[:/]/+`,"giu"),Tr=new RegExp(ii,"giu"),Cr=new Set(["attr-value","ext-link-text","link-text"]),Ir={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},ni=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"]),Nr=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch{return/\w/u}})(),fn=(s=class extends rt{constructor(n){super();P(this,e);Ne(this,"data","");this.data=n}get type(){return"text"}toString(n){var l;return n&&!((l=this.parentNode)!=null&&l.getAttribute("built"))?_e(this.data):this.data}text(){return this.data}lint(n=this.getAbsoluteIndex(),l){var o,d,a;{if(l===!1)return[];const{data:u,parentNode:c,nextSibling:p,previousSibling:m}=this;if(!c)throw new Error("An isolated text node cannot be linted!");const{type:b,name:_,parentNode:A}=c;if(b==="attr-value"){const{name:E,tag:D}=A;if(D==="ref"&&(E==="name"||E==="follow")||E==="group"&&(D==="ref"||D==="references")||D==="choose"&&(E==="before"||E==="after"))return[]}if(l!=null||(l=b==="free-ext-link"||b==="ext-link-url"||b==="ext-link-text"||b==="image-parameter"&&_==="link"||b==="attr-value"?Tr:_r),u.search(l)===-1)return[];l.lastIndex=0;const k=[],T=p==null?void 0:p.type,f=p==null?void 0:p.name,g=m==null?void 0:m.type,x=this.getRootNode(),v=x.toString(),{ext:h,html:S,variants:y}=x.getAttribute("config"),{top:$,left:L}=x.posFromIndex(n),{lintConfig:I}=N,j=I.rules["tag-like"],B=typeof j=="object"&&j[1]?new Set(Object.keys(j[1]).filter(E=>E!=="invalid"&&E!=="disallowed")):new Set,O=new Set(["onlyinclude","noinclude","includeonly",...h,...S[0],...S[1],...S[2],...B,...I.getSeverity("tag-like","disallowed")?ni:[]]);for(let E=l.exec(u);E;E=l.exec(u)){const[,D,W]=E;let{index:q,0:z}=E;if(W&&W!=="]"){const{length:we}=W;q+=we,z=z.slice(we)}z=z.toLowerCase();const[U]=z,V=U==="r"||U==="p"||U==="i",Q=U==="{",ie=U==="}",ue=U==="[",he=U==="]";let{length:ne}=z;if(U==="<"&&!O.has(D.toLowerCase())||ue&&b==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(u.slice(q+1))||p!=null&&p.is("ext")&&f==="nowiki"&&((o=p.innerText)!=null&&o.includes("]")))||V&&(!c.isPlain()||Cr.has(b)))continue;he&&(q||ne>1)&&l.lastIndex--;let Ce=n+q,Ie=Ce+ne,M,ee;const ge=v[Ie],ve=v[Ce-1],Te=Q||ue,Me=Q&&ve==="-"&&y.length>0,ye=ie&&ge==="-"&&y.length>0,ft=ue&&T==="free-ext-link"&&!u.slice(q+1).trim()||he&&g==="free-ext-link"&&!u.slice(0,q).includes("]");if(V)M="lonely-http",z=z.toUpperCase(),ee=I.getSeverity(M,z);else if(U==="<"){M="tag-like";let we;/^<\/?\s/u.test(z)||!/[\s/>]/u.test(ge!=null?ge:"")?we="invalid":B.has(D)?we=D:ni.has(D)&&!h.includes(D)&&(we="disallowed"),ee=I.getSeverity(M,we)}else if(Me||ye)M="lonely-bracket",ee=I.getSeverity(M,"converter"),Me&&q>0?(z="-{",q--,Ce--,ne=2):ye&&q<u.length-1&&(z="}-",Ie++,ne=2);else if(ft)M="lonely-bracket",ee=I.getSeverity(M,"extLink");else if(Te||ie||he)if(M="lonely-bracket",ne>1||Q&&ge===U||ie&&ve===U)ee=I.getSeverity(M,"double");else{if(!ue||b!=="ext-link-text"){const we=Ir[U],Xs=Te?u.slice(q+1):u.slice(0,q);if(Q&&((d=we.exec(Xs))==null?void 0:d[0])==="}"||ie&&((a=we.exec(Xs))==null?void 0:a[0])==="{")continue;if(!Xs.includes(U)){const or=Te?"nextSibling":"previousSibling";let st=this[or];for(;st&&(st.type!=="text"||!we.test(st.data));)st=st[or];if(st&&we.exec(st.data)[0]!==U)continue}}ee=I.getSeverity(M,"single")}else M="lonely-http",ee=I.getSeverity(M);if(!ee)continue;const te=this.posFromIndex(q),{line:et,character:Ot}=gs($,L,te.top+1,te.left),tt={rule:M,message:N.msg("lonely",V||U==="h"||Me||ye?z:U),severity:ee,startIndex:Ce,endIndex:Ie,startLine:et,endLine:et,startCol:Ot,endCol:Ot+ne};if(I.computeEditInfo)if(U==="<")tt.suggestions=[Et(Ce,"<")];else if(U==="h"&&b!=="link-text"&&Nr.test(ve||""))tt.suggestions=[ps(Ce)];else if(ue&&b==="ext-link-text"){const we=c.getAbsoluteIndex()+c.toString().length;tt.suggestions=[Et(we,"]")]}else if(he&&ft){const we=n-m.toString().length;tt.suggestions=[Ws(we,"left-bracket","[")]}else V&&(tt.suggestions=[...E[0]===z?[]:[Bn(tt,z)],...ge===":"||ge===":"?[ps(Ie,1)]:[]]);k.push(tt)}return k}}replaceData(n){R(this,e,mn).call(this,n)}splitText(n){{const{parentNode:l,data:o}=this;if(!l)throw new Error("The text node to be split has no parent node!");const d=new s(o.slice(n));return ms(l,l.childNodes.indexOf(this)+1,0,[d]),this.setAttribute("data",o.slice(0,n)),d}this.lspError("AstText.splitText")}escape(){{const{parentNode:n}=this;if(!n)throw new Error("The text node to be escaped has no parent node!");const{TranscludeToken:l}=(Fo(),se(Lo)),o=n.getAttribute("config"),d=n.childNodes.indexOf(this)+1,a=p=>Math.max(this.data.lastIndexOf("=",p),this.data.lastIndexOf("|",p));let u=a();const c=(()=>new l(this.data[u]==="="?"=":"!",[],o));for(;u>=0;u=a(u-1))u<this.data.length-1&&this.splitText(u+1),n.insertAt(xe.run(c),d),R(this,e,mn).call(this,this.data.slice(0,u))}}print(){return cs(this.data)}},e=new WeakSet,mn=function(n){this.setAttribute("data",n)},s)}}),Ye,gt=C({"mixin/hidden.ts"(){"use strict";Ye=(e=!0,t=!0)=>s=>{class i extends s{text(){return""}lint(n){return e?[]:super.lint(n)}}return i}}}),Ue,Ze=C({"mixin/padded.ts"(){"use strict";Ue=({length:e})=>t=>{{class s extends t{getAttribute(r){return r==="padding"?e:super.getAttribute(r)}}return s}}}}),Lr,Fr,ri,Er,Ge,zs=C({"src/link/base.ts"(){"use strict";var e,t,s,i;K(),Xe(),me(),Ze(),We(),G(),X(),ct(),Lr=r=>r==="redirect-target"||r==="link",Fr=[Be,Ue("[[")],Ge=(i=class extends(Er=H){constructor(n,l,o,d=[],a="|"){super(void 0,o,d,{});P(this,e,!0);P(this,t);P(this,s);if(this.insertAt(new $e(n,"link-target",o,d,{})),l!==void 0){const u=new H(l,o,d,{});u.type="link-text",u.setAttribute("stage",Ae-1),this.insertAt(u)}F(this,t,a)}get link(){return w(this,s)}get fragment(){return w(this,s).fragment}afterBuild(){F(this,s,this.getTitle()),w(this,t).includes("\0")&&F(this,t,this.buildFromStr(w(this,t),0)),this.setAttribute("name",w(this,s).title),super.afterBuild()}setAttribute(n,l){n==="bracket"?F(this,e,l):n==="title"?F(this,s,l):super.setAttribute(n,l)}toString(n){const l=super.toString(n,w(this,t));return w(this,e)?`[[${l}]]`:l}text(){const n=super.text("|");return w(this,e)?`[[${n}]]`:n}getAttribute(n){return n==="title"?w(this,s):super.getAttribute(n)}getGaps(n){return n===0?w(this,t).length:1}lint(n=this.getAbsoluteIndex(),l){{const o=super.lint(n,l),{childNodes:[d,a],type:u}=this,{encoded:c,fragment:p}=w(this,s),{lintConfig:m}=N,{computeEditInfo:b,fix:_}=m,A=new ce(this,n);let k="unknown-page",T=m.getSeverity(k);if(T&&d.childNodes.some(({type:f})=>f==="template")&&o.push(J(d,A,k,"template-in-link",T)),k="url-encoding",T=m.getSeverity(k),T&&c){const f=J(d,A,k,"unnecessary-encoding",T);(b||_)&&(f.fix=Rn(f,d)),o.push(f)}if(k="pipe-like",T=m.getSeverity(k,"link"),T&&(u==="link"||u==="category")){const f=a==null?void 0:a.childNodes.findIndex(x=>x.type==="text"&&x.data.includes("|")),g=a==null?void 0:a.childNodes[f];if(g){const x=J(a,A,k,"pipe-in-link",T);if(b){const v=x.startIndex+a.getRelativeIndex(f);x.suggestions=[qn(v,g.data)]}o.push(x)}}if(k="no-ignored",T=m.getSeverity(k,"fragment"),T&&p!==void 0&&!Lr(u)){const f=J(d,A,k,"useless-fragment",T);if(b||_){const g=d.childNodes.findIndex(v=>v.type==="text"&&v.data.includes("#")),x=d.childNodes[g];x&&(f.fix=Z(f,d.getRelativeIndex(g)+x.data.indexOf("#")))}o.push(f)}return o}}getTitle(n,l){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:l,temporary:n,decode:!0,selfLink:!0})}print(){return super.print(w(this,e)?{pre:"[[",post:"]]",sep:w(this,t)}:{sep:w(this,t)})}json(n,l=this.getAbsoluteIndex()){{const o=super.json(void 0,l),{type:d,fragment:a}=this;return a!==void 0&&(d==="link"||d==="redirect-target")&&(o.fragment=a),o}}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i),ri=ae(Er),Ge=le(ri,0,"LinkBaseToken",Fr,Ge),re(ri,1,Ge)}}),jr,li,Rr,Oe,pt=C({"src/nowiki/base.ts"(){"use strict";We(),X(),jr=[Be],Oe=class extends(Rr=H){get innerText(){return this.firstChild.data}constructor(e="",t,s){super(e,t,s)}},li=ae(Rr),Oe=le(li,0,"NowikiBaseToken",jr,Oe),re(li,1,Oe)}}),Pr,oi,Or,Ee,Pt=C({"src/nowiki/noinclude.ts"(){"use strict";gt(),pt(),Pr=[Ye()],Ee=class extends(Or=Oe){get type(){return"noinclude"}toString(e){return e?"":super.toString()}},oi=ae(Or),Ee=le(oi,0,"NoincludeToken",Pr,Ee),re(oi,1,Ee)}}),jo,Fu=C({"src/link/redirectTarget.ts"(){"use strict";K(),G(),zs(),Pt(),jo=class extends Ge{get type(){return"redirect-target"}constructor(e,t,s,i){super(e,void 0,s,i),t!==void 0&&this.insertAt(new Ee(t,s,i))}getTitle(){return this.normalizeTitle(this.firstChild.toString(),0,{halfParsed:!0,decode:!0})}lint(e=this.getAbsoluteIndex()){{const t=super.lint(e,!1),s="no-ignored",{lintConfig:i}=N,r=i.getSeverity(s,"redirect");if(r&&this.length===2){const n=J(this.lastChild,{start:e},s,"useless-link-text",r);n.startIndex--,n.startCol--,(i.computeEditInfo||i.fix)&&(n.fix=Z(n)),t.push(n)}return t}}}}}),Br,ai,qr,Xt,Eu=C({"src/redirect.ts"(){"use strict";var e,t,s;gt(),We(),X(),ht(),Fu(),Br=[Ye(!1,!1),Be],Xt=(s=class extends(qr=H){constructor(r,n,l,o,d,a,u=[]){super(void 0,a,u);P(this,e);P(this,t);F(this,e,r),F(this,t,d),this.append(new qe(n,"redirect-syntax",a,u),new jo(l,o==null?void 0:o.slice(1),a,u))}get type(){return"redirect"}getAttribute(r){return r==="padding"?w(this,e).length:super.getAttribute(r)}toString(r){return w(this,e)+super.toString(r)+w(this,t)}lint(r=this.getAbsoluteIndex()){{const n=r+w(this,e).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",n),this.lastChild.lint(n)}}print(){return super.print({pre:w(this,e),post:w(this,t)})}},e=new WeakMap,t=new WeakMap,s),ai=ae(qr),Xt=le(ai,0,"RedirectToken",Br,Xt),re(ai,1,Xt)}}),Ro={};oe(Ro,{parseRedirect:()=>Po});var Po,ju=C({"parser/redirect.ts"(){"use strict";G(),Eu(),Po=(e,t,s)=>{var r;(r=t.regexRedirect)!=null||(t.regexRedirect=new RegExp(String.raw`^(\s*)((?:${t.redirection.join("|")})\s*(?::\s*)?)\[\[([^\n|\]]+)(\|.*?)?\]\](\s*)`,"iu"));const i=t.regexRedirect.exec(e);return i&&N.normalizeTitle(i[3],0,!1,t,{halfParsed:!0,temporary:!0,decode:!0}).valid?(e=`\0${s.length}o${e.slice(i[0].length)}`,new Xt(...i.slice(1),t,s),e):!1}}}),Wr,ui,Ur,Kt,Ru=C({"src/onlyinclude.ts"(){"use strict";Ze(),We(),X(),Wr=[Be,Ue("<onlyinclude>")],Kt=class extends(Ur=H){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>'})}},ui=ae(Ur),Kt=le(ui,0,"OnlyincludeToken",Wr,Kt),re(ui,1,Kt)}}),Mr,di,zr,ot,zn=C({"src/tagPair/index.ts"(){"use strict";var e,t;Ms(),We(),X(),Mr=[xs(),Be],ot=(t=class extends(zr=H){constructor(i,r,n,l,o,d=[]){super(void 0,o);P(this,e);Ne(this,"closed");Ne(this,"selfClosing");this.setAttribute("name",i.toLowerCase()),F(this,e,[i,l||i]),this.closed=l!=="",this.selfClosing=l===void 0,this.append(r,n);const a=typeof r=="string"?-1:d.indexOf(r);d.splice(a===-1?1/0:a,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(i){const{selfClosing:r,firstChild:n,lastChild:l}=this,[o,d]=w(this,e);return r?`<${o}${n.toString(i)}/>`:`<${o}${n.toString(i)}>${l.toString(i)}${this.closed?`</${d}>`:""}`}text(){const[i,r]=w(this,e);return this.selfClosing?`<${i}${this.firstChild.text()}/>`:`<${i}${super.text(">")}${this.closed?`</${r}>`:""}`}getAttribute(i){return i==="padding"?w(this,e)[0].length+1:super.getAttribute(i)}print(){const[i,r]=w(this,e);return super.print(this.selfClosing?{pre:`<${i}`,post:"/>"}:{pre:`<${i}`,sep:">",post:this.closed?`</${r}>`:""})}},e=new WeakMap,t),di=ae(zr),ot=le(di,0,"TagPairToken",Mr,ot),re(di,1,ot)}}),Hn,Oo=C({"src/tag/index.ts"(){"use strict";var e,t,s,i;K(),je(),G(),X(),Hn=(i=class extends H{constructor(n,l,o,d,a){super(void 0,d,a);P(this,e);P(this,t);P(this,s);this.insertAt(l),F(this,e,o),F(this,t,n)}get closing(){return w(this,e)}toString(n){return`<${w(this,e)?"/":""}${w(this,t)}${super.toString(n)}${this.selfClosing?"/":""}>`}text(n=""){const{closing:l}=this;return`<${l&&!n?"/":""}${w(this,t)}${l?"":super.text()}${n}>`}getAttribute(n){return n==="padding"?w(this,t).length+(w(this,e)?2:1):super.getAttribute(n)}findMatchingTag(){return ut(w(this,s),()=>{const{type:n,name:l,parentNode:o,closing:d,selfClosing:a}=this;let u=!1,c=!1;if(n==="html"){const{html:[,k,T]}=this.getAttribute("config");u=T.includes(l),c=k.includes(l)}if(u||c&&a)return this;if(!o)return;const{childNodes:p}=o,m=p.indexOf(this),b=d?p.slice(0,m).reverse():p.slice(m+1),_=[this],{rev:A}=xe;for(const k of b)if(!(!k.is(n)||n==="html"&&(k.name!==l||c&&k.selfClosing)))if(w(k,e)===d){if(n==="tvar")return;_.push(k)}else{const T=_.pop();if(T===this)return k;N.viewOnly&&(F(T,s,[A,k]),F(k,s,[A,T]))}if(N.viewOnly)for(const k of _)F(k,s,[A,void 0])},n=>{F(this,s,n),n[1]&&n[1]!==this&&F(n[1],s,[xe.rev,this])})}print(){return super.print({pre:`<${w(this,e)?"/":""}${w(this,t)}`,post:`${this.selfClosing?"/":""}>`})}json(n,l=this.getAbsoluteIndex()){{const o=super.json(void 0,l);return o.closing=w(this,e),o}}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i)}}),Hr,ci,Dr,Ve,Pu=C({"src/tag/tvar.ts"(){"use strict";gt(),Oo(),ht(),Hr=[Ye()],Ve=class extends(Dr=Hn){get type(){return"tvar"}constructor(e,t,s,i,r){const n=new qe(t,"tvar-name",i,r);super(e,n,s,i,r)}},ci=ae(Dr),Ve=le(ci,0,"TvarToken",Hr,Ve),re(ci,1,Ve)}}),Bo,Ou=C({"src/tagPair/translate.ts"(){"use strict";var e,qo,s;X(),zn(),ht(),Pu(),Bo=(s=class extends ot{constructor(r,n,l,o=[]){const d=new qe(r,"translate-attr",l,o);n=n==null?void 0:n.replace(/<tvar(\|[^>]+)>([\s\S]*?)<\/>/gu,(u,c,p)=>(new Ve("tvar",c,!1,l,o),new Ve("","",!0,l,o),`\0${o.length-2}n${p}\0${o.length}n`)).replace(/<(tvar)(\s+name\s*=(?:\s*(?:(["'])[\s\S]*?\3|[^"'\s>]+))?\s*)>([\s\S]*?)<\/(tvar)(\s*)>/giu,(u,c,p,m,b,_,A)=>(new Ve(c,p,!1,l,o),new Ve(_,A,!0,l,o),`\0${o.length-2}n${b}\0${o.length}n`));const a=new H(n,l,o);a.type="translate-inner";super("translate",d,a,"translate",l,o);P(this,e);this.seal("closed",!0),this.seal("selfClosing",!0)}get type(){return"translate"}toString(r){return r?this.lastChild.toString(!0):super.toString()}text(){return this.lastChild.text()}print(){return`<span class="wpb-ext"><translate${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"},s)}}),Gr,hi,Vr,Yt,Bu=C({"src/tagPair/include.ts"(){"use strict";K(),me(),gt(),G(),zn(),Gr=[Ye(!1)],Yt=class extends(Vr=ot){get type(){return"include"}constructor(e,t="",s,i,r,n){super(e,t,s!=null?s:"",s===void 0||i!=null?i:"",r,n)}toString(e){return e?"":super.toString()}lint(e=this.getAbsoluteIndex()){{const t=[],{firstChild:s,closed:i,name:r}=this,n=new ce(this,e),l=["no-ignored","unclosed-comment"],{lintConfig:o}=N,{computeEditInfo:d}=o,a=l.map(u=>o.getSeverity(u,"include"));if(a[0]&&s.data.trim()){const u=J(s,n,l[0],"useless-attribute",a[0]);d&&(u.suggestions=[Z(u)]),t.push(u)}if(a[1]&&!i){const u=Y(this,n,l[1],N.msg("unclosed",`<${r}>`),a[1]);d&&(u.suggestions=[Je(u.endIndex,`</${r}>`)]),t.push(u)}return t}}},hi=ae(Vr),Yt=le(hi,0,"IncludeToken",Gr,Yt),re(hi,1,Yt)}}),Hs,Dn=C({"mixin/attributesParent.ts"(){"use strict";Hs=(e=0)=>t=>{var s,xn;{class r extends t{constructor(){super(...arguments);P(this,s)}hasAttr(o){return R(this,s,xn).call(this).hasAttr(o)}getAttr(o){return R(this,s,xn).call(this).getAttr(o)}}return s=new WeakSet,xn=function(){return this.childNodes[e]},r}}}}),de,gi,pi,zt,Ss,fi,it,mi,xi,vi,As,bi,Re,Gn,Vn,Qn,Wo,Uo=C({"util/sharable.ts"(){"use strict";de=new Set(["align"]),gi=new Set(["cite"]),pi=new Set(["cite","datetime"]),zt=new Set(["width"]),Ss=new Set(["axis","align","bgcolor","height","width","valign"]),fi=new Set([...Ss,"abbr","headers","scope","rowspan","colspan"]),it=new Set(["type"]),mi=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),xi=new Set(["clear"]),vi=new Set(["bgcolor","align","valign"]),As=new Set(["qid","forcemathmode","type","display"]),bi=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),Re=new Set,Gn=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"]),Vn={div:de,h1:de,h2:de,h3:de,h4:de,h5:de,h6:de,blockquote:gi,q:gi,p:de,br:xi,pre:zt,ins:pi,del:pi,ul:it,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...mi,"border"]),caption:de,tr:vi,td:fi,th:fi,font:new Set(["size","color","face"]),hr:zt,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:it,poem:de,categorytree:de,combooption:de,math:Re,chem:Re,ce:Re,img:new Set(["alt","src","width","height","loading","srcset"])},Qn={gallery:new Set(["mode","showfilename","caption","perrow","widths","heights","showthumbnails"]),poem:new Set(["compact"]),categorytree:new Set(["hideroot","onlyroot","depth","mode","hideprefix","namespaces","showcount","notranslations"]),combooption:new Set(["name","for","inline"]),nowiki:Re,indicator:new Set(["name"]),langconvert:new Set(["from","to"]),ref:new Set(["group","name","follow","dir","details"]),references:new Set(["group","responsive"]),charinsert:new Set(["label"]),choose:new Set(["uncached","before","after"]),option:new Set(["weight"]),imagemap:Re,inputbox:Re,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:Re,poll:new Set(["id","show-results-before-voting"]),sm2:it,flashmp3:it,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([...As,"chem"]),chem:As,ce:As,hiero:Re,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:bi,syntaxhighlight:bi,templatedata:Re,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:Re},Wo={table:mi,td:new Set([...Ss,"scope"]),th:Ss,br:xi,caption:de,div:de,hr:zt,h1:de,h2:de,h3:de,h4:de,h5:de,h6:de,li:it,p:de,pre:zt,tr:vi,ul:it}}}),Qr,Jr,Xr,Kr,Ls,qu=C({"src/attribute.ts"(){"use strict";var e,t,s,i,r,Mo,vn,o;K(),fe(),Xe(),Uo(),me(),G(),X(),ct(),Qr=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,Jr=/(?:^|\s|\*\/)(?:javascript|vbscript)(?:\W|$)/iu,Xr=new Set(["ext","arg","magic-word","template"]),Kr=new Set(["about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),Ls=(o=class extends H{constructor(a,u,c,p="",m,b=[],_=N.getConfig(),A=[]){const k=new $e(c,"attr-key",_,A);let T;if(c==="title"||u==="img"&&c==="alt")T=new H(m,_,A,{}),T.type="attr-value",T.setAttribute("stage",Ae-1);else if(u==="gallery"&&c==="caption"||u==="ref"&&c==="details"||u==="choose"&&(c==="before"||c==="after")){const f={..._,excludes:[..._.excludes,"heading","html","table","hr","list"]};T=new H(m,f,A,{}),T.type="attr-value",T.setAttribute("stage",1)}else T=new $e(m,"attr-value",_,A,{});super(void 0,_,A);P(this,r);P(this,e);P(this,t);P(this,s);P(this,i);F(this,e,a),this.append(k,T),F(this,s,p),F(this,i,[...b]),F(this,t,u),this.setAttribute("name",Lt(_e(c)))}get type(){return w(this,e)}get tag(){return w(this,t)}get balanced(){return!w(this,s)||w(this,i)[0]===w(this,i)[1]}afterBuild(){w(this,s).includes("\0")&&F(this,s,this.buildFromStr(w(this,s),0)),this.parentNode&&F(this,t,this.parentNode.name),R(this,r,Mo).call(this),super.afterBuild()}toString(a){const[u="",c=""]=w(this,i);return w(this,s)?super.toString(a,w(this,s)+u)+c:this.firstChild.toString(a)}text(){return w(this,s)?`${super.text(`${w(this,s).trim()}"`)}"`:this.firstChild.text()}getGaps(){var a,u;return w(this,s)?w(this,s).length+((u=(a=w(this,i)[0])==null?void 0:a.length)!=null?u:0):0}lint(a=this.getAbsoluteIndex(),u){var c;{const p=super.lint(a,u),{balanced:m,firstChild:b,lastChild:_,name:A,tag:k}=this,T=new ce(this,a),f=["unclosed-quote","obsolete-attr"],{lintConfig:g}=N,x=f.map(h=>g.getSeverity(h,A));if(x[0]&&!m){const h=J(_,T,f[0],"unclosed-quotes",x[0]);h.startIndex--,h.startCol--,g.computeEditInfo&&(h.suggestions=[Je(h.endIndex,w(this,i)[0])]),p.push(h)}const v=R(this,r,vn).call(this,a,T);return v&&p.push(v),x[1]&&((c=Wo[k])!=null&&c.has(A))&&p.push(J(b,T,f[1],"obsolete-attribute",x[1])),p}}getValue(){return w(this,s)?this.lastChild.text().trim():this.type==="ext-attr"||""}escape(){F(this,s,"{{=}}"),this.lastChild.escape()}getAttribute(a){return a==="invalid"?R(this,r,vn).call(this):super.getAttribute(a)}print(){const[a="",u=""]=w(this,i);return w(this,s)?super.print({sep:cs(w(this,s))+a,post:u}):super.print()}json(a,u=this.getAbsoluteIndex()){{const c=super.json(void 0,u);return c.tag=this.tag,c}}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakSet,Mo=function(){this.setAttribute("name",Lt(this.firstChild.text()))},vn=function(a,u){const{firstChild:c,lastChild:p,type:m,name:b,tag:_,parentNode:A}=this,k=!p.childNodes.some(({type:y})=>Xr.has(y)),T=this.getValue(),f=Qn[_],g=Vn[_],{length:x}=this.toString();let v="illegal-attr",h,S;if({lintConfig:h}=N,{computeEditInfo:S}=h,!(f!=null&&f.has(b))&&!(g!=null&&g.has(b))&&(m==="ext-attr"?f||g:!/\{\{[^{]+\}\}/u.test(b))&&(m==="ext-attr"&&!g||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(b)&&(_==="meta"||_==="link"||!Gn.has(b)))||(b==="itemtype"||b==="itemid"||b==="itemref")&&!(A!=null&&A.hasAttr("itemscope"))){if(a===void 0)return!0;{const y=h.getSeverity(v,"unknown");if(y){const $=J(c,u,v,"illegal-attribute-name",y);return S&&($.suggestions=[Z(a,x)]),$}}}else if(b==="style"&&typeof T=="string"&&Qr.test(T)){if(a===void 0)return!0;{v="insecure-style";const y=h.getSeverity(v);return y&&J(p,u,v,"insecure-style",y)}}else if(b==="tabindex"&&typeof T=="string"&&T!=="0"){if(a===void 0)return!0;{const y=h.getSeverity(v,"tabindex");if(y){const $=J(p,u,v,"nonzero-tabindex",y);return S&&($.suggestions=[Z(a,x),Pe($,"0 tabindex","0")]),$}}}else if(typeof T=="string"&&((/^xmlns:[\w:.-]+$/u.test(b)||Kr.has(b))&&Jr.test(T)||k&&(b==="href"||_==="img"&&b==="src")&&!new RegExp(String.raw`^(?:${this.getAttribute("config").protocol}|//)\S+$`,"iu").test(T))){if(a===void 0)return!0;{const y=h.getSeverity(v,"value");return y&&J(p,u,v,"illegal-attribute-value",y)}}else if(k&&m!=="ext-attr"){const y=Wn(_,b),$=String(T).toLowerCase();if(y.length>0&&y.every(L=>L!==$)){if(a===void 0)return!0;{const L=h.getSeverity(v,"value");return L&&J(p,u,v,"illegal-attribute-value",L)}}}return!1},o)}}),wi,Yr,Zr,Ds,Jn=C({"src/attributes.ts"(){"use strict";var e,t,Fs,i;K(),fe(),me(),G(),X(),ct(),qu(),wi=r=>r.slice(0,-1),Yr=r=>`${wi(r)}-dirty`,Zr=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch{return/[^\W_]/u}})(),Ds=(i=class extends H{constructor(n,l,o,d,a=[]){super(void 0,d,a,{});P(this,t);P(this,e);if(F(this,e,l),this.setAttribute("name",o),n){const u=/([^\s/](?:(?!\0\d+~\x7F)[^\s/=])*)(?:((?:\s(?:\s|\0\d+[cn]\x7F)*)?(?:=|\0\d+~\x7F)(?:\s|\0\d+[cn]\x7F)*)(?:(["'])([\s\S]*?)(\3|$)|(\S*)))?/gu;let c="",p=u.exec(n),m=0;const b=(()=>{c&&(super.insertAt(new $e(c,Yr(l),d,a,{})),c="")});for(;p;){const{index:_,0:A,1:k,2:T,3:f,4:g,5:x,6:v}=p;if(c+=n.slice(m,_),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(_e(k).trim())){const h=g!=null?g:v,S=[f,x],y=new Ls(wi(l),o,k,T,h,S,d,a);b(),super.insertAt(y)}else c+=A;({lastIndex:m}=u),p=u.exec(n)}c+=n.slice(m),b()}}get type(){return w(this,e)}afterBuild(){const{parentNode:n}=this;n!=null&&n.is("td")&&this.setAttribute("name",n.subtype),super.afterBuild()}getAttrTokens(n){return this.childNodes.filter(l=>l instanceof Ls&&(!n||l.name===Lt(n)))}hasAttr(n){return this.getAttrTokens(n).length>0}getAttrToken(n){{const l=this.getAttrTokens(n);return l[l.length-1]}}getAttr(n){var l;return(l=this.getAttrToken(n))==null?void 0:l.getValue()}lint(n=this.getAbsoluteIndex(),l){{const o=super.lint(n,l),{parentNode:d,childNodes:a}=this,u=new Map,c=new Set,p=new ce(this,n),m=["no-ignored","no-duplicate"],{lintConfig:b}=N,{computeEditInfo:_,fix:A}=b,k=["closingTag","invalidAttributes","nonWordAttributes"].map(f=>b.getSeverity(m[0],f));if(k[0]&&R(this,t,Fs).call(this)){const f=Y(this,p,m[0],"attributes-of-closing-tag",k[0]);if(_){const g=d.getAbsoluteIndex();f.suggestions=[Z(f),Pn(g)]}o.push(f)}for(const f of a)if(f instanceof Ls){const{name:g}=f;u.has(g)?(c.add(g),u.get(g).push(f)):u.set(g,[f])}else{const g=f.text().trim(),x=k[Zr.test(g)?1:2];if(g&&x){const v=J(f,p,m[0],"invalid-attribute",x);_&&(v.suggestions=[Z(v,0," ")]),o.push(v)}}const T=b.getSeverity(m[1],"attribute");if(T&&c.size>0)for(const f of c){const g=u.get(f).map(x=>{const v=x.getValue();return[x,v===!0?"":v]});o.push(...g.map(([x,v],h)=>{const S=J(x,p,m[1],N.msg("duplicate-attribute",f),T);if(_||A){const y=Z(S);!v||g.slice(0,h).some(([,$])=>$===v)?S.fix=y:_&&(S.suggestions=[y])}return S}))}return o}}getAttribute(n){return n==="invalid"?R(this,t,Fs).call(this):super.getAttribute(n)}print(){return this.toString()?`<span class="wpb-${this.type}${R(this,t,Fs).call(this)?" wpb-invalid":""}">${this.childNodes.map(n=>n.print(n instanceof $e?{class:n.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}},e=new WeakMap,t=new WeakSet,Fs=function(){const{parentNode:n}=this;return(n==null?void 0:n.type)==="html"&&n.closing&&this.text().trim()!==""},i)}}),zo={};oe(zo,{PreToken:()=>Ho});var Ho,Wu=C({"src/pre.ts"(){"use strict";Xe(),X(),Pt(),Ho=class extends H{get type(){return"ext-inner"}constructor(e,t,s=[]){if(e){const i=/<nowiki>/giu,r=/<\/nowiki>/giu,{length:n}=i.source;let l=i.exec(e);l&&(r.lastIndex=l.index+n);let o=r.exec(e),d=0,a="";for(;l&&o;)new Ee(l[0],t,s,!0),new Ee(o[0],t,s,!0),a+=`${e.slice(d,l.index)}\0${s.length-1}n${e.slice(l.index+n,o.index)}\0${s.length}n`,d=o.index+n+1,i.lastIndex=d,l=i.exec(e),l&&(r.lastIndex=l.index+n),o=r.exec(e);e=a+e.slice(d)}super(e,t,s,{}),this.setAttribute("stage",Ae-1)}isPlain(){return!0}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*\/\s*(pre)\b/giu)}}}}),Gs,Xn=C({"src/multiLine/index.ts"(){"use strict";X(),Gs=class extends H{get type(){return"ext-inner"}toString(e){return super.toString(e,`
|
|
3
3
|
`)}text(){return super.text(`
|
|
4
4
|
`).replace(/\n\s*\n/gu,`
|
|
5
5
|
`)}getGaps(){return 1}print(){return super.print({sep:`
|
|
6
|
-
`})}}}}),
|
|
7
|
-
`).map(n=>r?n:
|
|
8
|
-
`,index:e.length},x=(A=n.pop())!=null?A:{},{0:v,index:h,parts:S,findEqual:y,pos
|
|
9
|
-
`){m=g+1;const{pos:j,findEqual:B}=(
|
|
10
|
-
`)||(e=`${e.slice(0,h)}\0${s.length}h${e.slice(g)}`,m=h+4+String(s.length).length,new St(O[1].length,O.slice(2),t,s)))}}else if(f==="|"||L)m=g+1,o(e,S
|
|
11
|
-
)`:""}(\s*)$`,"u")),
|
|
12
|
-
`))!=null?d:[]){const u=/^([^|]+)(?:\|(.*))?/u.exec(a);if(!u){super.insertAt(a.trim()?new
|
|
13
|
-
`),r=new Set(t.protocol.split("|"));let n=!0,l=!1;for(const o of i){const d=o.trim();if(!(l||!d||d.startsWith("#"))){if(n){const a=o.indexOf("|"),u=a===-1?o:o.slice(0,a),{valid:c,ns:p}=this.normalizeTitle(u,0,{halfParsed:!0,temporary:!0});if(c&&p===6){const m=new At("imagemap",u,a===-1?void 0:o.slice(a+1),t,s);super.insertAt(m),n=!1;continue}else l=!0}else if(o.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(o);continue}else if(o.includes("[")){const a=o.indexOf("["),u=o.slice(a),c=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(u);if(c){if(this.normalizeTitle(c[1],0,{halfParsed:!0,temporary:!0,selfLink:!0}).valid){super.insertAt(new yn(o.slice(0,a),c.slice(1),u.slice(u.indexOf("]]")+2),t,s));continue}}else if(u.startsWith("[//")||r.has(u.slice(1,u.indexOf(":")+1))||r.has(u.slice(1,u.indexOf("//")+2))){const p=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(u);if(p){super.insertAt(new yn(o.slice(0,a),p.slice(1),u.slice(u.indexOf("]")+1),t,s));continue}}}}super.insertAt(new Os(o,t,s))}}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new ce(this,e),{childNodes:r,image:n}=this,l="invalid-imagemap",{lintConfig:o}=N,d=o.getSeverity(l,n?"link":"image");return d&&(n?s.push(...r.filter(a=>{const u=a.toString().trim();return a.is("noinclude")&&u&&!u.startsWith("#")}).map(a=>{const u=J(a,i,l,"invalid-imagemap-link",d);return o.computeEditInfo&&(u.suggestions=[Y(u,-1),Re(u,"comment","# ")]),u})):s.push(ie(this,i,l,"imagemap-without-image",d))),s}}getAttribute(e){return e==="invalid"?!this.image:super.getAttribute(e)}}}}),yl,Pi,Sl,$t,ha=C({"src/nowiki/comment.ts"(){"use strict";K(),gt(),Ze(),G(),pt(),yl=[Ye(!1),Me("<!--")],$t=class extends(Sl=Pe){constructor(t,s,i,r){super(t,i,r);Ne(this,"closed");this.closed=s}get type(){return"comment"}lint(t=this.getAbsoluteIndex()){{if(this.closed)return[];const s="unclosed-comment",{lintConfig:i}=N,r=i.getSeverity(s);if(!r)return[];const n=ie(this,{start:t},s,"unclosed-comment",r);return i.computeEditInfo&&(n.suggestions=[Je(n.endIndex,"-->")]),[n]}}toString(t){return t?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"<!--",post:this.closed?"-->":""})}},Pi=ae(Sl),$t=le(Pi,0,"CommentToken",yl,$t),re(Pi,1,$t)}}),ga={};oe(ga,{CommentedToken:()=>pa});var pa,Gu=C({"src/commented.ts"(){"use strict";X(),ha(),pa=class extends H{get type(){return"ext-inner"}constructor(e,t,s=[]){if(super(void 0,t,s,{AstText:":",CommentToken:":"}),e){let i=e.indexOf("<!--"),r=i!==-1&&e.indexOf("-->",i+4),n=0;for(;r!==!1&&r!==-1;)i>n&&this.insertAt(e.slice(n,i)),this.insertAt(new $t(e.slice(i+4,r),!0,t,s)),n=r+3,i=e.indexOf("<!--",n),r=i!==-1&&e.indexOf("-->",i+4);n<e.length&&this.insertAt(e.slice(n))}}lint(e=this.getAbsoluteIndex()){return super.lint(e,new RegExp(String.raw`<\s*(?:\/\s*)?(${this.name})\b`,"giu"))}}}}),fa={};oe(fa,{NowikiToken:()=>ma});var Al,kl,ma,Vu=C({"src/nowiki/index.ts"(){"use strict";var e,Sn,s;Ke(),K(),G(),pt(),Al=at(i=>new RegExp(String.raw`<\s*(?:/\s*)${i==="nowiki"?"":"?"}(${i})\b`,"giu")),kl=new Set(["languages","section","templatestyles"]),ma=(s=class extends Pe{constructor(){super(...arguments);P(this,e)}get type(){return"ext-inner"}lint(r=this.getAbsoluteIndex()){{const{name:n}=this,l="void-ext",{lintConfig:o}=N,d=o.getSeverity(l,n);if(d&&R(this,e,Sn).call(this)){const a=ie(this,{start:r},l,N.msg("nothing-in",n),d);return o.computeEditInfo&&(a.suggestions=[Y(a)]),[a]}return super.lint(r,Al(n))}}getAttribute(r){return r==="invalid"?R(this,e,Sn).call(this):super.getAttribute(r)}},e=new WeakSet,Sn=function(){const{name:r,firstChild:{data:n}}=this;return kl.has(r)&&!!n},s)}}),$l,Oi,_l,_t,xa=C({"src/tagPair/ext.ts"(){"use strict";K(),me(),G(),Hn(),X(),Un(),Qn(),$l=[zs()],_t=class extends(_l=ot){get type(){return"ext"}constructor(e,t,s,i,r=N.getConfig(),n=!1,l=[]){const o=e.toLowerCase(),d=new Hs(!t||/^\s/u.test(t)?t:` ${t}`,"ext-attrs",o,r,l),a={...r,ext:r.ext.filter(c=>c!==o),excludes:[...r.excludes],inExt:!0};let u;switch(o){case"tab":a.ext=a.ext.filter(c=>c!=="tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":case"langconvert":case"phonos":o==="poem"&&a.excludes.push("heading"),u=new H(s,a,l);break;case"pre":{const{PreToken:c}=(Ou(),te(Mo));u=new c(s,a,l);break}case"dynamicpagelist":{const{ParamTagToken:c}=(Do(),te(Ho));u=new c(n,s,a,l);break}case"inputbox":{const{InputboxToken:c}=(Mu(),te(Jo));u=new c(n,s,a,l);break}case"references":{const{NestedToken:c}=(Ci(),te(Es));a.excludes.push("heading"),u=new c(s,n,["ref"],a,l);break}case"choose":{const{NestedToken:c}=(Ci(),te(Es));u=new c(s,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],a,l);break}case"combobox":{const{NestedToken:c}=(Ci(),te(Es));u=new c(s,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],a,l);break}case"gallery":{const{GalleryToken:c}=(zu(),te(ra));u=new c(s,a,l);break}case"imagemap":{const{ImagemapToken:c}=(Du(),te(da));u=new c(s,a,l);break}case"hiero":{const{CommentedToken:c}=(Gu(),te(ga));u=new c(s,a,l);break}default:{const{NowikiToken:c}=(Vu(),te(fa));u=new c(s,a,l)}}u.setAttribute("name",o),u.type==="plain"&&(u.type="ext-inner"),super(e,d,u,i,r,l),this.seal("closed",!0)}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),{lintConfig:i}=N,r=new ce(this,e);if(this.name!=="nowiki"){const o=this.inHtmlAttrs(),d="parsing-order",a=o&&i.getSeverity(d,o===2?"ext":"templateInTable");a&&s.push(ie(this,r,d,"ext-in-html",a))}const n="var-anchor",l=i.getSeverity(n,"ref");return l&&this.name==="ref"&&this.closest("heading-title")&&s.push(ie(this,r,n,"variable-anchor",l)),s}}},Oi=ae(_l),_t=le(Oi,0,"ExtToken",$l,_t),re(Oi,1,_t)}}),va={};oe(va,{parseCommentAndExt:()=>xs});var Bi,Tl,ks,Cl,qi,xs,Vs=C({"parser/commentAndExt.ts"(){"use strict";Ke(),fe(),Fu(),Rt(),ju(),Ru(),xa(),ha(),Bi="<onlyinclude>",Tl="</onlyinclude>",{length:ks}=Bi,Cl=[!1,!0].map(e=>{const t=e?"includeonly":"(?:no|only)include",s=e?"noinclude":"includeonly";return Ao(i=>new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${t}(?:\s[^>]*)?/?>|</${t}\s*>|<(${i.join("|")})(\s[^>]*?)?(?:/>|>([\s\S]*?)</(${"\\1"}\s*)>)|<(${s})(\s[^>]*?)?(?:/>|>([\s\S]*?)(?:</(${s}\s*)>|$))`,"giu"))}),qi=e=>{const t=e.indexOf(Bi);return{i:t,j:e.indexOf(Tl,t+ks)}},xs=(e,t,s,i)=>{if(i){let{i:o,j:d}=qi(e);if(o!==-1&&d!==-1){let a="";const u=c=>{new Ee(c,t,s),a+=`\0${s.length-1}n`};for(;o!==-1&&d!==-1;){const c=`\0${s.length}e`;new Xt(e.slice(o+ks,d),t,s),o>0&&u(e.slice(0,o)),a+=c,e=e.slice(d+ks+1),{i:o,j:d}=qi(e)}return e&&u(e),a}}const{ext:r}=t,n=r.filter(o=>o!=="translate"&&o!=="tvar"),l={...t,ext:n};if(r.includes("translate")){const o=[];e=e.replace(/<nowiki>[\s\S]*?<\/nowiki>/giu,d=>(o.push(d),`\0${o.length-1}`)).replace(/<translate( nowrap)?>([\s\S]+?)?<\/translate>/gu,(d,a,u)=>{const c=s.length;return new Po(a,u&&Fe(u,o),l,s),`\0${c}g`}),e=Fe(e,o)}return e.replace(Cl[i?1:0](n),(o,d,a,u,c,p,m,b,_)=>{const A=s.length;let $="n";if(d)$="e",new _t(d,a,u,c,l,p,s);else if(o.startsWith("<!--")){$="c";const T=o.endsWith("-->");new $t(Fe(o,s,1).slice(4,T?-3:void 0),T,t,s)}else p?new Kt(p,m&&Fe(m,s,1),b&&Fe(b,s,1),_,t,s):new Ee(o,t,s,!0);return`\0${A}${$}`})}}}),Il,Nl,Ll,Fl,Wi,El,es,Qu=C({"src/tag/html.ts"(){"use strict";var e,t;K(),me(),Hn(),G(),Ro(),Il=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),Nl=new Set(["b","big","center","cite","code","del","dfn","em","font","i","ins","kbd","mark","pre","q","s","samp","small","strike","strong","sub","sup","tt","u","var"]),Ll=new Set(["strike","big","center","font","tt"]),Fl=[zs()],es=(t=class extends(El=zn){constructor(i,r,n,l,o,d){super(i,r,n,o,d);P(this,e);this.setAttribute("name",i.toLowerCase()),E(this,e,l)}get type(){return"html"}get selfClosing(){return w(this,e)}text(){const{closing:i,selfClosing:r,name:n}=this,{html:[,,l]}=this.getAttribute("config");return l.includes(n)?i&&n!=="br"?"":super.text("/"):super.text(r&&!i?"/":"")}lint(i=this.getAbsoluteIndex(),r){var n;{const l=super.lint(i,r),{name:o,parentNode:d,closing:a,selfClosing:u}=this,c=new ce(this,i),{lintConfig:p}=N,{computeEditInfo:m,fix:b}=p,_=this.inTableAttrs();let A="h1",$=p.getSeverity(A,"html");if($&&o==="h1"&&!a){const h=ie(this,c,A,"<h1>",$);m&&(h.suggestions=[{desc:"h2",range:[i+2,i+3],text:"2"}]),l.push(h)}if(A="parsing-order",$=_&&p.getSeverity(A,_===2?"html":"templateInTable"),$){const h=ie(this,c,A,"html-in-table",$);m&&_===2&&(h.suggestions=[Y(h)]),l.push(h)}if(A="obsolete-tag",$=p.getSeverity(A,o),$&&Ll.has(o)&&l.push(ie(this,c,A,"obsolete-tag",$)),A="bold-header",$=p.getSeverity(A,o),$&&(o==="b"||o==="strong")&&((n=this.closest("heading-title,ext"))==null?void 0:n.type)==="heading-title"){const h=ie(this,c,A,"bold-in-header",$);m&&(h.suggestions=[Y(h)]),l.push(h)}const{html:[,T,f]}=this.getAttribute("config"),g=f.includes(o),x=T.includes(o),v=!g&&!x;if(A="unmatched-tag",a&&(u||g)||u&&v){if($=p.getSeverity(A,a?"both":"selfClosing"),$){const h=ie(this,c,A,a?"closing-and-self-closing":"invalid-self-closing",$);if(m||b){const S=Rn(i),y={desc:N.msg("no-self-closing"),range:[h.endIndex-2,h.endIndex-1],text:""};x?m&&(h.suggestions=[S,y]):a?h.fix=g?S:y:m&&(h.suggestions=[y,Je(h.endIndex,`></${o}>`,-2)])}l.push(h)}}else if(!this.findMatchingTag()){const h=ie(this,c,A,a?"unmatched-closing":"unclosed-tag"),S=this.closest("magic-word");if(S&&Il.has(S.name))$=p.getSeverity(A,"conditional");else if(a)$=p.getSeverity(A,"closing"),h.suggestions=[Y(h)];else{$=p.getSeverity(A,"opening");const y=d==null?void 0:d.childNodes;Nl.has(o)&&(y!=null&&y.slice(0,y.indexOf(this)).some(k=>k.type==="html"&&k.name===o&&!k.findMatchingTag())&&(h.suggestions=[Je(i+1,"/")]),this.closest("heading-title")&&(h.rule="format-leakage",$=p.getSeverity("format-leakage",o)))}$&&(h.severity=$,l.push(h))}return l}}getAttribute(i){return i==="invalid"?this.inTableAttrs()===2:super.getAttribute(i)}json(i,r=this.getAbsoluteIndex()){{const n=super.json(void 0,r);return n.selfClosing=w(this,e),n}}},e=new WeakMap,t),Wi=ae(El),es=le(Wi,0,"HtmlToken",Fl,es),re(Wi,1,es)}}),ba={};oe(ba,{parseHtml:()=>wa});var jl,wa,Ju=C({"parser/html.ts"(){"use strict";Qn(),Qu(),jl=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,wa=(e,t,s)=>{var l;const{html:i}=t;(l=t.htmlElements)!=null||(t.htmlElements=new Set([...i[0],...i[1],...i[2]]));const r=e.split("<");let n=r.shift();for(const o of r){const d=jl.exec(o),a=d==null?void 0:d[2],u=a==null?void 0:a.toLowerCase();if(!d||!t.htmlElements.has(u)){n+=`<${o}`;continue}const[,c,,p="",m,b]=d,{length:_}=s,A=new Hs(p,"html-attrs",u,t,s),$=A.hasAttr("itemprop");if(u==="meta"&&!($&&A.hasAttr("content"))||u==="link"&&!($&&A.hasAttr("href"))){n+=`<${o}`,s.length=_;continue}n+=`\0${s.length}x${b}`,new es(a,A,c==="/",m==="/>",t,s)}return n}}}),Rl,Pl,Mi,Ol,Tt,ya=C({"src/table/base.ts"(){"use strict";Hn(),G(),X(),ht(),Qn(),Rl=e=>{const t=e.childNodes.map(i=>i.type==="text"?i.data.replace(/\|\|/gu,"{{!!}}").replace(/\|/gu,"{{!}}"):i.toString()).join(""),{childNodes:s}=N.parse(t,e.getAttribute("include"),2,e.getAttribute("config"));e.safeReplaceChildren(s)},Pl=[zs(1)],Tt=class extends(Ol=H){constructor(e,t,s,i,r,n=[],l){super(void 0,r,n,l),this.append(new qe(t,"table-syntax",r,n),new Hs(i,"table-attrs",s,r,n))}escape(){for(const e of this.childNodes)e instanceof qe?Rl(e):e.escape()}},Mi=ae(Ol),Tt=le(Mi,0,"TableBaseToken",Pl,Tt),re(Mi,1,Tt)}}),Bl,Ui,Se,$s,zt,Ht,Bs,Sa=C({"src/table/td.ts"(){"use strict";K(),me(),Mn(),G(),X(),ya(),Bs=class extends(Ui=Tt,Bl=[Ws(!1)],Ui){constructor(e,t,s,i=[]){var o;let r=/\||\0\d+!\x7F/u.exec(t!=null?t:""),n=r?t.slice(0,r.index):"";/\[\[|-\{/u.test(n)&&(r=null,n=""),super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",n,s,i),re($s,5,this),De(this,zt),De(this,Se,""),r&&([yu(this,Se)._]=r);const l=new H(t==null?void 0:t.slice(((o=r==null?void 0:r.index)!=null?o:NaN)+pe(this,Se).length),s,i);l.type="td-inner",l.setAttribute("stage",4),this.insertAt(l)}get type(){return"td"}get rowspan(){return this.getAttr("rowspan")}get colspan(){return this.getAttr("colspan")}get subtype(){return dn(this,zt,Ht).call(this).subtype}afterBuild(){pe(this,Se).includes("\0")&&ke(this,Se,this.buildFromStr(pe(this,Se),0)),super.afterBuild()}toString(e){const{childNodes:[t,s,i]}=this;return t.toString(e)+s.toString(e)+pe(this,Se)+i.toString(e)}text(){const{childNodes:[e,t,s]}=this;return e.text()+t.text()+pe(this,Se)+s.text()}getGaps(e){return e===1?pe(this,Se).length:0}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new ce(this,e+this.getRelativeIndex(this.length-1)),r="pipe-like",{lintConfig:n}=N,{computeEditInfo:l,fix:o}=n,d=["td","double"].map(a=>n.getSeverity(r,a));for(const a of this.lastChild.childNodes)if(a.type==="text"){const{data:u}=a;if(u.includes("|")){const c=u.includes("||"),p=d[c?1:0];if(p){const m=J(a,i,r,"pipe-in-table",p);if(l||o)if(c){const b={caption:"|+",td:"|",th:"!"}[this.subtype];m.fix=Re(m,"newline",u.replace(/\|\|/gu,`
|
|
14
|
-
${b}`))}else l&&(m.suggestions=[
|
|
15
|
-
`)}getAttr(e){{const t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}}escape(){super.escape(),this.childNodes[1].toString()&&(pe(this,Se)||ke(this,Se,"{{!}}")),pe(this,Se)==="|"&&ke(this,Se,"{{!}}")}print(){const{childNodes:[e,t,s]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${pe(this,Se)}${s.print()}</span>`}json(e,t=this.getAbsoluteIndex()){{const s=super.json(void 0,t),{rowspan:i,colspan:r}=this;return Object.assign(s,{subtype:this.subtype},i!==1&&{rowspan:i},r!==1&&{colspan:r}),s}}}
|
|
16
|
-
|}`,t){const s=this.getAttribute("config"),i=this.getAttribute("accum");
|
|
6
|
+
`})}}}}),Do,Uu=C({"src/paramLine.ts"(){"use strict";X(),Do=class extends H{get type(){return"param-line"}}}}),Go={};oe(Go,{ParamTagToken:()=>Kn});var Kn,Vo=C({"src/multiLine/paramTag.ts"(){"use strict";K(),me(),Qs(),G(),Xn(),Uu(),Kn=class extends Gs{constructor(e,t,s=N.getConfig(),i=[],r){super(void 0,s,i,{}),t&&this.append(...t.split(`
|
|
7
|
+
`).map(n=>r?n:vs(n,s,i,e)).map(n=>new Do(n,s,i,{}))),i.splice(i.indexOf(this),1),i.push(this)}lint(e=this.getAbsoluteIndex()){{const t="no-ignored",{lintConfig:s}=N,i=s.getSeverity(t,this.name);if(!i)return[];const r=new ce(this,e),n=N.msg("invalid-parameter",this.name),l=[];for(const o of this.childNodes){o.setAttribute("aIndex",e);const d=o.childNodes.filter(({type:a})=>a!=="comment"&&a!=="include"&&a!=="noinclude");if(d.some(({type:a})=>a==="ext"))l.push(J(o,r,t,n,i));else{const a=d.findIndex(({type:c})=>c!=="text"),u=d.slice(0,a===-1?void 0:a).map(String).join("");if(u&&!(a===-1?/^[a-z]+(?:\[\])?\s*=/iu:/^[a-z]+(?:\[\])?\s*(?:=|$)/iu).test(u)){const c=J(o,r,t,n,i);s.computeEditInfo&&(c.suggestions=[Z(c)]),l.push(c)}else{const c=o.lint(e,!1);c.length>0&&l.push(...c)}}e+=o.toString().length+1}return l}}}}}),el,yi,tl,St,Qo=C({"src/heading.ts"(){"use strict";var e,t,Es,i;K(),je(),me(),We(),G(),X(),ht(),el=[Be],St=(i=class extends(tl=H){constructor(n,l,o,d=[]){super(void 0,o,d);P(this,t);P(this,e);F(this,e,n);const a=new H(l[0],o,d);a.type="heading-title",a.setAttribute("stage",2);const u=new qe(l[1],"heading-trail",o,d);this.append(a,u)}get type(){return"heading"}get level(){return w(this,e)}toString(n){const l=R(this,t,Es).call(this);return l+this.firstChild.toString(n)+l+this.lastChild.toString(n)}text(){const n=R(this,t,Es).call(this);return n+this.firstChild.text()+n}getAttribute(n){return n==="invalid"?this.inHtmlAttrs()===2:n==="padding"?this.level:super.getAttribute(n)}getGaps(){return this.level}lint(n=this.getAbsoluteIndex(),l){{const o=super.lint(n,l),{firstChild:d,level:a}=this,u=d.toString(),c=u.startsWith("="),p=c||u.endsWith("="),m=new ce(this,n),b=this.inHtmlAttrs(),_=["h1","unbalanced-header","format-leakage"],{lintConfig:A}=N,{computeEditInfo:k,fix:T}=A,f=_.map(g=>A.getSeverity(g,"apostrophe"));if(f[0]&&this.level===1){const g=J(d,m,_[0],"<h1>",f[0]);k&&!p&&(g.suggestions=[Pe(g,"h2",`=${u}=`)]),o.push(g)}if(f[1]&&p){const g=N.msg("unbalanced-in-section-header",'"="'),x=J(d,m,_[1],g,f[1]);if(!(!k||u==="="))if(c){const[v]=/^=+/u.exec(u),h=a+v.length;x.suggestions=[{desc:`h${a}`,range:[x.startIndex,x.startIndex+v.length],text:""}],h<7&&x.suggestions.push({desc:`h${h}`,range:[x.endIndex,x.endIndex],text:v})}else{const v=/[^=](=+)$/u.exec(u)[1],h=a+v.length;x.suggestions=[{desc:`h${a}`,range:[x.endIndex-v.length,x.endIndex],text:""}],h<7&&x.suggestions.push({desc:`h${h}`,range:[x.startIndex,x.startIndex],text:v})}o.push(x)}if(b){const g="parsing-order",x=A.getSeverity(g,b===2?"heading":"templateInTable");x&&o.push(Y(this,m,g,"header-in-html",x))}if(f[2]){const g=this.getRootNode().toString(),x=d.childNodes.filter(Js("quote")),v=x.filter(({bold:S})=>S),h=x.filter(({italic:S})=>S);if(v.length%2){const S=J(v[v.length-1],{...m,start:n+a,left:m.left+a},_[2],N.msg("unbalanced-in-section-header","bold-apostrophes"),f[2]);if(k||T){const y=n+a+u.length,$=Z(S);g.slice(S.endIndex,y).trim()?k&&(S.suggestions=[$,Je(y,"'''")]):v.length===1&&h.length===0?S.fix=$:k&&(S.suggestions=[$])}o.push(S)}if(h.length%2){const S=J(h[h.length-1],{start:n+a},_[2],N.msg("unbalanced-in-section-header","italic-apostrophes"),f[2]);if(k||T){const y=n+a+u.length;g.slice(S.endIndex,y).trim()?k&&(S.suggestions=[Je(y,"''")]):h.length===1&&v.length===0?S.fix=Z(S):k&&(S.suggestions=[Z(S)])}o.push(S)}}return o}}print(){const n=R(this,t,Es).call(this);return super.print({pre:n,sep:n})}json(n,l=this.getAbsoluteIndex()){{const o=super.json(void 0,l);return o.level=this.level,o}}},e=new WeakMap,t=new WeakSet,Es=function(){return"=".repeat(this.level)},i),yi=ae(tl),St=le(yi,0,"HeadingToken",el,St),re(yi,1,St)}}),sl,Si,il,Zt,Mu=C({"src/hidden.ts"(){"use strict";gt(),X(),sl=[Ye()],Zt=class extends(il=H){get type(){return"hidden"}getAttribute(e){return e==="invalid"||super.getAttribute(e)}},Si=ae(il),Zt=le(Si,0,"HiddenToken",sl,Zt),re(Si,1,Zt)}}),nl,Ai,rl,es,zu=C({"src/arg.ts"(){"use strict";var e,Jo,s;fe(),K(),me(),Ze(),Ms(),We(),G(),X(),ct(),Mu(),nl=[Be,Ue("{{{"),xs()],es=(s=class extends(rl=H){constructor(r,n,l=[]){super(void 0,n,l,{});P(this,e);for(let o=0;o<r.length;o++){const d=r[o];if(o===0){const a=new $e(d,"arg-name",n,l,{});super.insertAt(a)}else if(o>1){const a=new Zt(d,n,l);super.insertAt(a)}else{const a=new H(d,n,l);a.type="arg-default",a.setAttribute("stage",2),super.insertAt(a)}}}get type(){return"arg"}get default(){var r,n;return(n=(r=this.childNodes[1])==null?void 0:r.text())!=null?n:!1}toString(r){return`{{{${super.toString(r,"|")}}}}`}text(){return`{{{${dt(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){R(this,e,Jo).call(this),super.afterBuild()}lint(r=this.getAbsoluteIndex(),n){{const{childNodes:[l,o,...d]}=this;l.setAttribute("aIndex",r+3);const a=l.lint(r+3,n);if(o){const _=r+4+l.toString().length;o.setAttribute("aIndex",_);const A=o.lint(_,n);A.length>0&&a.push(...A)}const u=["no-ignored","no-arg"],{lintConfig:c}=N,{computeEditInfo:p}=c,m=new ce(this,r),b=u.map(_=>c.getSeverity(_,"arg"));if(b[0]&&d.length>0&&a.push(...d.map(_=>{const A=J(_,m,u[0],"invisible-triple-braces",b[0]);return A.startIndex--,A.startCol--,p&&(A.suggestions=[Z(A),Et(A.startIndex,"{{!}}")]),A})),b[1]&&!this.getAttribute("include")){const _=Y(this,m,u[1],"unexpected-argument",b[1]);p&&o&&(_.suggestions=[Pe(_,"expand",o.text())]),a.push(_)}return a}}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(r,n=this.getAbsoluteIndex()){{const l=super.json(void 0,n);return l.default=this.default,l}}},e=new WeakSet,Jo=function(){this.setAttribute("name",this.firstChild.text().trim())},s),Ai=ae(rl),es=le(Ai,0,"ArgToken",nl,es),re(Ai,1,es)}}),Xo={};oe(Xo,{parseBraces:()=>Vs});var ll,ki,ks,$i,_i,Ti,ol,Ci,Vs,Yn=C({"parser/braces.ts"(){"use strict";Ke(),fe(),Qo(),Fo(),zu(),ll={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},ki=String.raw`\[(?!\[)`,ks=String.raw`\n(?![=\0])`,$i=String.raw`|\{{2,}`,_i=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),Ti=at(e=>new RegExp(e,"gmu")),ol=new RegExp(String.raw`\{\{((?:[^\n{}[]|${ki}|${ks})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${ks})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${ki}|${ks})*\}-`,"gu"),Ci=e=>{const t=Lt(_e(e));return _i.has(t)?_i.get(t):/^(?:filepath|(?:full|canonical)urle?):./u.test(t)?"m":/^#vardefine:./u.test(t)?"n":"t"},Vs=(e,t,s)=>{var b,_,A,k,T;const i=String.raw`${t.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,r]}=t,n=[],l=[],o=(f,g,x,v)=>{g[g.length-1].push(Fe(f.slice(x,v),l))};let d;do d!==void 0&&(e=d),d=e.replace(ol,(f,g,x)=>{if(g!==void 0||typeof x=="string")try{const{length:v}=s,h=(g!=null?g:x).split("|");return new lt(Fe(h[0],l),h.slice(1).map(S=>{const y=S.indexOf("=");return(y===-1?[S]:[S.slice(0,y),S.slice(y+1)]).map($=>Fe($,l))}),t,s),`\0${v}${Ci(h[0])}`}catch(v){if(!(v instanceof SyntaxError)||v.message!=="Invalid template name")throw v}return l.push(Fe(f,l)),`\0${l.length-1}`});while(d!==e);e=d;const a=e.lastIndexOf("}}")-e.length;let u=a+e.length!==-1,c=Ti(i+(u?$i:"")),p=c.exec(e),m;for(;p||m!==void 0&&m<=e.length&&((_=(b=n[n.length-1])==null?void 0:b[0])!=null&&_.startsWith("="));){if(p!=null&&p[1]){const[,{length:j}]=p;p[0]=p[0].slice(j),p.index+=j}const{0:f,index:g}=p!=null?p:{0:`
|
|
8
|
+
`,index:e.length},x=(A=n.pop())!=null?A:{},{0:v,index:h,parts:S,findEqual:y,pos:$}=x,L=f==="="&&y;if(f==="]]"||f==="}-")m=g+2;else if(f===`
|
|
9
|
+
`){m=g+1;const{pos:j,findEqual:B}=(k=n[n.length-1])!=null?k:{};if(j===void 0||B||_e(e.slice(j,h))!==""){const O=/^(={1,6})(.+)\1((?:\s|\0\d+[cn]\x7F)*)$/u.exec(e.slice(h,g));O&&(O[2]=Fe(O[2],l),O[2].includes(`
|
|
10
|
+
`)||(e=`${e.slice(0,h)}\0${s.length}h${e.slice(g)}`,m=h+4+String(s.length).length,new St(O[1].length,O.slice(2),t,s)))}}else if(f==="|"||L)m=g+1,o(e,S,$,g),f==="|"&&S.push([]),x.pos=m,x.findEqual=f==="|",n.push(x);else if(f.startsWith("}}")){const j=f.slice(0,Math.min(v.length,3)),B=v.length-j.length,{length:O}=s;m=g+j.length,o(e,S,$,g);let E=!1,D="t";if(j.length===3){const W=S.map(z=>z.join("=")),q=W.length>1&&_e(W[1]).trim();new es(W,t,s),q&&q.endsWith(":")&&r.includes(q.slice(0,-1).toLowerCase())&&(D="s")}else try{new lt(S[0][0],S.slice(1),t,s),D=Ci(S[0][0])}catch(W){if(W instanceof SyntaxError&&W.message==="Invalid template name")E=!0;else throw W}E||(e=`${e.slice(0,h+B)}\0${O}${D}${e.slice(m)}`,m=h+B+3+String(O).length,B>1?n.push({0:v.slice(0,B),index:h,pos:h+B,parts:[[]]}):B===1&&e[h-1]==="-"&&n.push({0:"-{",index:h-1,pos:h+1,parts:[[]]}))}else m=g+f.length,f.startsWith("{")&&(p.pos=m,p.parts=[[]]),n.push(..."0"in x?[x]:[],p);let I=n[n.length-1];if(u&&a+e.length<m)for(u=!1;(T=I==null?void 0:I[0])!=null&&T.startsWith("{");)n.pop(),I=n[n.length-1];c=Ti(i+(u?$i:"")+(I?`|${ll[I[0][0]]}${I.findEqual?"|=":""}`:"")),c.lastIndex=m,p=c.exec(e)}return Fe(e,l)}}}),Ko={};oe(Ko,{InputboxToken:()=>Yo});var Yo,Hu=C({"src/multiLine/inputbox.ts"(){"use strict";Qs(),Yn(),G(),Vo(),Yo=class extends Kn{constructor(e,t,s=N.getConfig(),i=[]){const r=Symbol("InputboxToken"),n=s.excludes.includes("heading")?s:{...s,excludes:[...s.excludes,"heading"]},{length:l}=i;i.push(r),t&&(t=vs(t,n,i,e)),t&&(t=Vs(t,n,i)),i.splice(l,1),super(e,t,n,i,{})}}}}),js={};oe(js,{NestedToken:()=>Zo});var al,ul,Zo,Ii=C({"src/nested.ts"(){"use strict";var e,t,s;K(),me(),Qs(),Yn(),G(),X(),ba(),Pt(),al=new Set(["comment","include","arg","template","magic-word"]),ul=[!1,!0].map(i=>{const r=i?"includeonly":"noinclude";return new RegExp(String.raw`^(?:<${r}(?:\s[^>]*)?/?>|</${r}\s*>)$`,"iu")}),Zo=(s=class extends H{constructor(r,n,l,o,d=[]){if(typeof n=="boolean"){const a=Symbol("NestedToken"),{length:u}=d;d.push(a),r&&(r=vs(r,o,d,n)),r&&(r=Vs(r,o,d)),d.splice(u,1)}else r&&(r=r.replace(n,(a,u,c,p,m)=>{const b=`\0${d.length+1}e`;return new _t(u,c,p,m,o,!1,d),b}));r&&(r=r.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(a,u,c)=>(new Ee(c,o,d),`${u}\0${d.length}n`)));super(r,o,d);P(this,e);P(this,t);F(this,e,[...l]),F(this,t,n)}get type(){return"ext-inner"}lint(r=this.getAbsoluteIndex(),n){{const l=super.lint(r,n),o="no-ignored",{lintConfig:d}=N,a=d.getSeverity(o,this.name);if(!a)return l;const u=new ce(this,r),c=typeof w(this,t)=="boolean"?ul[w(this,t)?1:0]:/^<!--[\s\S]*-->$/u;return[...l,...this.childNodes.filter(p=>{const{type:m,name:b}=p;if(m==="ext")return!w(this,e).includes(b);if(al.has(m))return!1;const _=p.toString().trim();return _&&!c.test(_)}).map(p=>{const m=J(p,u,o,N.msg("invalid-content",this.name),a);return d.computeEditInfo&&(m.suggestions=[Z(m),On(m,p.toString())]),m})]}}},e=new WeakMap,t=new WeakMap,s)}});function dl(e,t,s,i,r){t=_e(t).trim();let n=t.replace(e==="link"?/\0\d+[tq]\x7F/gu:/\0\d+t\x7F/gu,"").trim();switch(e){case"width":return!n&&!!t||/^(?:\d+x?|\d*x\d+)(?:\s*px)?$/u.test(n);case"link":{if(n){if(ea(s.protocol).test(n))return ta(s.protocol).test(n)&&t;n.startsWith("[[")&&n.endsWith("]]")&&(n=n.slice(2,-2))}else return t;const l=N.normalizeTitle(n,0,!1,s,{halfParsed:i,decode:!0,selfLink:!0});return l.valid&&l}case"lang":return(r==="svg"||r==="svgz")&&!/[^a-z\d-]/u.test(n);case"alt":case"class":case"manualthumb":return!0;case"page":return(r==="djvu"||r==="djv"||r==="pdf")&&Number(n)>0;default:return!!n&&!isNaN(n)}}var ea,ta,cl,hl,gl,sa,Du=C({"src/imageParameter.ts"(){"use strict";var e,t,ia,r;Ke(),fe(),K(),Xe(),je(),G(),X(),ea=at(n=>new RegExp(String.raw`^(?:${n}|//|\0\d+m\x7F)`,"iu")),ta=at(n=>new RegExp(String.raw`^(?:(?:${n}|//)${It}|\0\d+m\x7F)${Nt}$`,"iu")),cl=at(n=>new RegExp(String.raw`^(\s*(?!\s))${n.replace("$1","(.*)")}${n.endsWith("$1")?`(?=$|
|
|
11
|
+
)`:""}(\s*)$`,"u")),hl=new Set(["alt","link","lang","page","caption"]),gl=n=>{if(n)n.startsWith("//")&&(n=`https:${n}`);else return n;return new URL(n).href},sa=(r=class extends H{constructor(l,o,d,a){var n=(...i)=>(super(...i),P(this,t),P(this,e,""),this);let u;const c=Object.entries(d.img).map(([m,b])=>[m,b,cl(m)]),p=c.find(([,m,b])=>(u=b.exec(l),u&&(u.length!==4||dl(m,u[2],d,!0,o)!==!1)));if(p&&u){u.length===3?(n(void 0,d,a),F(this,e,l)):(n(u[2],d,a,{}),F(this,e,u[1]+p[0]+u[3])),this.setAttribute("name",p[1]),p[1]==="alt"&&this.setAttribute("stage",Ae-1);return}n(l,d.excludes.includes("list")?d:{...d,excludes:[...d.excludes,"list"]},a),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get type(){return"image-parameter"}get link(){{if(this.name!=="link")return;const l=super.text().trim();return xe.run(()=>{const o=new H(l,this.getAttribute("config"));return o.parseOnce(0,this.getAttribute("include")).parseOnce(),/^\0\d+m\x7F/u.test(o.toString())?l:dl("link",l,this.getAttribute("config"))})}}afterBuild(){var l;(l=this.parentNode)!=null&&l.is("gallery-image")&&!hl.has(this.name)&&this.setAttribute("name","invalid"),super.afterBuild()}toString(l){return w(this,e)?w(this,e).replace("$1",super.toString(l)):super.toString(l)}text(){return w(this,e)?w(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,w(this,e).indexOf("$1")):super.getAttribute(l)}lint(l=this.getAbsoluteIndex(),o){{const d=super.lint(l,o),{lintConfig:a}=N,{computeEditInfo:u,fix:c}=a,{link:p,name:m}=this,b=m==="width"&&this.getValue();if(m==="invalid"||b&&b.endsWith("px")){const _="invalid-gallery",A=a.getSeverity(_,"parameter");if(A){const k=Y(this,{start:l},_,"invalid-image-parameter",A);(u||c)&&(k.fix=b?Z(k,0,b):Z(k,-1)),d.push(k)}}else if(m==="link"){if(typeof p=="string"){const _="invalid-url",A=a.getSeverity(_);if(A&&!this.querySelector("magic-word"))try{gl(p)}catch{d.push(Y(this,{start:l},_,"invalid-url",A))}}else if(p.encoded){const _="url-encoding",A=a.getSeverity(_,"file");if(A){const k=Y(this,{start:l},_,"unnecessary-encoding",A);(u||c)&&(k.fix=Rn(k,this)),d.push(k)}}}return d}}getValue(){return this.name==="invalid"?this.text():R(this,t,ia).call(this)||super.text()}print(){return w(this,e)?`<span class="wpb-image-parameter${this.name==="invalid"?" wpb-invalid":""}">${w(this,e).replace("$1",`<span class="wpb-image-caption">${Ft(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}},e=new WeakMap,t=new WeakSet,ia=function(){return w(this,e)&&!w(this,e).includes("$1")},r)}}),Ni,pl,fl,Li,Fi,Ei,ml,ji,Zn,na=C({"src/link/file.ts"(){"use strict";K(),me(),G(),zs(),Du(),Ni=new Map([["manualthumb","Thumb"],["frameless","Frameless"],["framed","Frame"],["thumbnail","Thumb"]]),pl=new Set(["arg"]),fl=new Set(["template","magic-word"]),Li=new Set(["left","right","center","none"]),Fi=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),Ei=new Set(["tiff","tif","png","gif","jpg","jpeg","webp","xcf","pdf","svg","djvu"]),ml=e=>{if(e===void 0)return[];const t=/-\{|\}-|\|/gu,s=[];let i=t.exec(e),r=0,n=0;for(;i;){const{0:l,index:o}=i;l!=="|"?r+=l==="-{"?1:-1:r===0&&(s.push(e.slice(n,o)),{lastIndex:n}=t),i=t.exec(e)}return s.push(e.slice(n)),s},ji=(e,t)=>e.filter(({childNodes:s})=>!s.some(i=>i.text().trim()&&t.has(i.type))),Zn=class extends Ge{get type(){return"file"}get extension(){return this.getAttribute("title").extension}constructor(e,t,s,i=[],r="|"){super(e,void 0,s,i,r);const{extension:n}=this.getTitle(!0,!0);this.safeAppend(ml(t).map(l=>new sa(l,n,s,i)))}lint(e=this.getAbsoluteIndex(),t){var s;{const i=super.lint(e,t),r=ji(this.getAllArgs(),pl),n=[...new Set(r.map(({name:v})=>v))],l=n.filter(v=>Ni.has(v)),o=n.filter(v=>Li.has(v)),d=n.filter(v=>Fi.has(v)),[a]=l,u=a==="framed"||a==="manualthumb",c=new ce(this,e),{lintConfig:p}=N,{computeEditInfo:m,fix:b}=p,{ns:_,extension:A}=this.getAttribute("title"),{firstChild:k}=this;let T="nested-link",f=p.getSeverity(T,"file");if(f&&Ei.has(A)&&this.closest("ext-link-text")&&((s=this.getValue("link"))==null?void 0:s.trim())!==""){const v=Y(this,c,T,"link-in-extlink",f);if(m||b){const h=this.getArg("link");if(h){const S=e+h.getRelativeIndex();v.fix={desc:N.msg("delink"),range:[S,S+h.toString().length],text:"link="}}else v.fix=Ws(v.endIndex-2,"delink","|link=")}i.push(v)}if(T="invalid-gallery",f=p.getSeverity(T,"extension"),f&&_===6&&!A&&!k.querySelector("arg,magic-word,template")&&i.push(Y(this,c,T,"missing-extension",f)),f=p.getSeverity(T,"parameter"),f&&u)for(const v of r.filter(({name:h})=>h==="width")){const h=J(v,c,T,"invalid-image-parameter",f);(m||b)&&(h.fix=Z(h,-1)),i.push(h)}if(r.length===n.length&&l.length<2&&o.length<2&&d.length<2)return i;T="no-duplicate";const g=["unknownImageParameter","imageParameter"].map(v=>p.getSeverity(T,v)),x=(v,h,S,y=!0)=>v.map($=>{if(f=g[Number(typeof y=="function"?y($):y)],!f)return!1;const L=J($,c,T,N.msg(`${h}-image-parameter`,S),f);return m&&(L.suggestions=[Z(L,-1)]),L}).filter($=>$!==!1);for(const v of n){if(v==="invalid"||v==="width"&&u)continue;const h=v==="caption";let S=r.filter(({name:y})=>y===v);if(h&&(S=[...S.slice(0,-1).filter(y=>y.text()),...S.slice(-1)]),S.length>1){let y=!h||!A||Ei.has(A);if(h&&y){const $=ji(S,fl);y=$.length>1&&(L=>$.includes(L))}i.push(...x(S,"duplicate",v,y))}}return l.length>1&&i.push(...x(r.filter(({name:v})=>Ni.has(v)),"conflicting","frame")),o.length>1&&i.push(...x(r.filter(({name:v})=>Li.has(v)),"conflicting","horizontal-alignment")),d.length>1&&i.push(...x(r.filter(({name:v})=>Fi.has(v)),"conflicting","vertical-alignment")),i}}getAllArgs(){return this.childNodes.slice(1)}getArgs(e){return this.getAllArgs().filter(({name:t})=>e===t)}getArg(e){{const t=this.getArgs(e);return t[e==="manualthumb"?0:t.length-1]}}getValue(e){var t;return(t=this.getArg(e))==null?void 0:t.getValue()}json(e,t=this.getAbsoluteIndex()){{const s=super.json(void 0,t),{extension:i}=this;return i&&(s.extension=i),s}}}}}),xl,Ri,vl,At,ra=C({"src/link/galleryImage.ts"(){"use strict";var e,bn,s;K(),Xe(),Ze(),G(),X(),na(),xl=[Ue("")],At=(s=class extends(vl=Zn){constructor(r,n,l,o,d=[]){let a;if(l!==void 0){const{length:u}=d;a=new H(l,o,d);for(let c=0;c<Ae-1;c++)a.parseOnce();d.splice(u,1)}super(n,a==null?void 0:a.toString(),o,d);P(this,e);Ne(this,"privateType","imagemap-image");this.setAttribute("bracket",!1),this.privateType=`${r}-image`,this.seal("privateType",!0)}get type(){return this.privateType}getTitle(r){const n=this.type==="imagemap-image";return this.normalizeTitle(this.firstChild.toString(),n?0:6,{halfParsed:!0,temporary:r,decode:!n})}lint(r=this.getAbsoluteIndex(),n){{const l=super.lint(r,n),o="invalid-gallery",{lintConfig:d}=N,a=d.getSeverity(o,"image");if(a&&R(this,e,bn).call(this)){const u=Y(this,{start:r},o,"invalid-gallery",a);d.computeEditInfo&&(u.suggestions=[Ws(r,"prefix","File:")]),l.push(u)}return l}}getAttribute(r){return r==="invalid"?R(this,e,bn).call(this):super.getAttribute(r)}},e=new WeakSet,bn=function(){const{ns:r}=this.getAttribute("title");return r!==6},s),Ri=ae(vl),At=le(Ri,0,"GalleryImageToken",xl,At),re(Ri,1,At)}}),Bs,la=C({"src/nowiki/commentLine.ts"(){"use strict";Pt(),Bs=class extends Ee{}}}),oa={};oe(oa,{GalleryToken:()=>aa});var aa,Gu=C({"src/multiLine/gallery.ts"(){"use strict";var e,ua,wn,i;K(),G(),Xn(),ra(),la(),aa=(i=class extends Gs{constructor(n,l,o=[]){var d;super(void 0,l,o,{});P(this,e);for(const a of(d=n==null?void 0:n.split(`
|
|
12
|
+
`))!=null?d:[]){const u=/^([^|]+)(?:\|(.*))?/u.exec(a);if(!u){super.insertAt(a.trim()?new Bs(a,l,o):a);continue}const[,c,p]=u;R(this,e,ua).call(this,c)?super.insertAt(new At("gallery",c,p,l,o)):super.insertAt(new Bs(a,l,o))}}get widths(){return R(this,e,wn).call(this,"widths")}get heights(){return R(this,e,wn).call(this,"heights")}lint(n=this.getAbsoluteIndex(),l){{const{top:o,left:d}=this.getRootNode().posFromIndex(n),a=[],u="no-ignored",{lintConfig:c}=N,p=["Image","NoImage","Comment"].map(m=>c.getSeverity(u,`gallery${m}`));for(let m=0;m<this.length;m++){const b=this.childNodes[m],_=b.toString(),{length:A}=_,k=_.trim(),{type:T}=b,f=o+m,g=m?0:d;if(b.setAttribute("aIndex",n),T==="noinclude"&&k&&!/^<!--.*-->$/u.test(k)){let[x]=p;if(k.startsWith("|")?[,x]=p:(k.startsWith("<!--")||k.endsWith("-->"))&&([,,x]=p),x){const v=n+A,h={rule:u,message:N.msg("invalid-content","gallery"),severity:x,startIndex:n,endIndex:v,startLine:f,endLine:f,startCol:g,endCol:g+A};c.computeEditInfo&&(h.suggestions=[Z(h),On(h,_)]),a.push(h)}}else if(T!=="noinclude"&&T!=="text"){const x=b.lint(n,l);x.length>0&&a.push(...x)}n+=A+1}return a}}json(n,l=this.getAbsoluteIndex()){{const o=super.json(void 0,l);return Object.assign(o,{widths:this.widths,heights:this.heights}),o}}},e=new WeakSet,ua=function(n){return this.normalizeTitle(n,6,{halfParsed:!0,temporary:!0,decode:!0}).valid},wn=function(n){var l,o;{const d=(l=this.parentNode)==null?void 0:l.getAttr(n),a=typeof d=="string"&&((o=/^(\d+)\s*(?:px)?$/u.exec(d))==null?void 0:o[1]);return a&&Number(a)||120}},i)}}),er,da=C({"src/link/index.ts"(){"use strict";Ke(),K(),G(),zs(),er=class extends Ge{get type(){return"link"}get innerText(){return this.length>1?this.lastChild.text():hs(this.firstChild.text().replace(/^\s*:?/u,""))}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i="nested-link",{lintConfig:r}=N,n=r.getSeverity(i);if(n&&this.closest("ext-link-text")){const l=Y(this,{start:e},i,"link-in-extlink",n);(r.computeEditInfo||r.fix)&&(l.fix=Pe(l,"delink",this.innerText)),s.push(l)}return s}}}}}),bl,wl,fs,tr=C({"src/magicLink.ts"(){"use strict";var e,t,yn,i;K(),fe(),me(),G(),X(),bl=String.raw`(?:[${Qe}\t]| |�*160;|&#[xX]0*[aA]0;)`,wl=new RegExp(`${bl}+`,"gu"),fs=(i=class extends H{constructor(n,l="free-ext-link",o=N.getConfig(),d){super(n,o,d,{});P(this,t);P(this,e);F(this,e,l)}get type(){return w(this,e)}get innerText(){const n=new Map([["!","|"],["=","="]]);let l=dt(this.childNodes.map(o=>{const{type:d}=o,a=String(o.name);return d==="magic-word"&&n.has(a)?n.get(a):o}));return this.type==="magic-link"&&(l=l.replace(wl," ")),l}get link(){const{innerText:n}=this;return this.type==="magic-link"?n.startsWith("ISBN")?`ISBN ${n.slice(5).replace(/[- ]/gu,"").replace(/x$/u,"X")}`:n:yo(n).replace(/\n/gu,"%0A")}lint(n=this.getAbsoluteIndex(),l){{const o=super.lint(n,l),d=new ce(this,n),{lintConfig:a}=N,{type:u,childNodes:c}=this;if(u==="magic-link"){const _="invalid-isbn",A=a.getSeverity(_);return A&&R(this,t,yn).call(this)&&o.push(Y(this,d,_,"invalid-isbn",A)),o}let p="invalid-url",m=a.getSeverity(p);if(m&&!this.querySelector("magic-word"))try{this.getUrl()}catch{o.push(Y(this,d,p,"invalid-url",m))}const b=u==="ext-link-url";if(p="unterminated-url",m=a.getSeverity(p,b?"pipe":"punctuation"),m){const _=b?/\|/u:/[,;。:!?()]+/u,A=c.find(k=>k.type==="text"&&_.test(k.data));if(A){const{data:k}=A,T=J(A,d,p,N.msg("in-url",b?'"|"':"full-width-punctuation"),m);if(a.computeEditInfo){const{index:f,0:g}=_.exec(k),x=T.startIndex+f;T.suggestions=b?[ps(x,1)]:[ps(x),{desc:N.msg("encode"),range:[x,x+g.length],text:encodeURI(g)}]}o.push(T)}}return o}}getUrl(n){{const{type:l}=this;let{link:o}=this;if(l==="magic-link"){if(o.startsWith("ISBN"))return this.normalizeTitle(`BookSources/${o.slice(5)}`,-1,{temporary:!0}).getUrl(n);o=o.startsWith("RFC")?`https://datatracker.ietf.org/doc/html/rfc${o.slice(4)}`:`https://pubmed.ncbi.nlm.nih.gov/${o.slice(5)}`}else o.startsWith("//")&&(o=`https:${o}`);return new URL(o)}this.lspError("MagicLinkToken.getUrl")}getAttribute(n){return n==="invalid"?R(this,t,yn).call(this):super.getAttribute(n)}},e=new WeakMap,t=new WeakSet,yn=function(){if(this.type==="magic-link"){const{link:n}=this;if(n.startsWith("ISBN")){const l=[...n.slice(5)].map(o=>o==="X"?10:Number(o));return l.length===10?l.reduce((o,d,a)=>o+d*(10-a),0)%11!==0:l.length===13&&(l[12]===10||l.reduce((o,d,a)=>o+d*(a%2?3:1),0)%10!==0)}}return!1},i)}}),yl,Pi,Sl,kt,ca=C({"src/extLink.ts"(){"use strict";var e,t;Xe(),K(),Ze(),G(),X(),tr(),yl=[Ue("[")],kt=(t=class extends(Sl=H){constructor(i,r="",n="",l,o=[]){super(void 0,l,o,{});P(this,e);const d=i&&/^\0\d+f\x7F$/u.test(i)?o[Number(i.slice(1,-2))]:new fs(i,"ext-link-url",l,o);if(this.insertAt(d),F(this,e,r),n){const a=new H(n,l,o,{});a.type="ext-link-text",a.setAttribute("stage",Ae-1),this.insertAt(a)}}get type(){return"ext-link"}toString(i){return this.length===1?`[${super.toString(i)}${w(this,e)}]`:`[${super.toString(i,w(this,e))}]`}text(){return`[${super.text(" ")}]`}getGaps(){return w(this,e).length}lint(i=this.getAbsoluteIndex(),r){{const n=super.lint(i,r),l="var-anchor",o=N.lintConfig.getSeverity(l,"extLink");return o&&this.length===1&&this.closest("heading-title")&&n.push(Y(this,{start:i},l,"variable-anchor",o)),n}}print(){return super.print(this.length===1?{pre:"[",post:`${w(this,e)}]`}:{pre:"[",sep:w(this,e),post:"]"})}},e=new WeakMap,t),Pi=ae(Sl),kt=le(Pi,0,"ExtLinkToken",yl,kt),re(Pi,1,kt)}}),Sn,Vu=C({"src/imagemapLink.ts"(){"use strict";X(),Pt(),da(),ca(),Sn=class extends H{get type(){return"imagemap-link"}constructor(e,t,s,i,r=[]){super(void 0,i,r),this.append(e,t.length===2?new er(...t,i,r):new kt(...t,i,r),new Ee(s,i,r))}}}}),ha={};oe(ha,{ImagemapToken:()=>ga});var ga,Qu=C({"src/multiLine/imagemap.ts"(){"use strict";K(),je(),me(),G(),Xn(),la(),ra(),Vu(),ga=class extends Gs{get image(){return this.childNodes.find(Js("imagemap-image"))}constructor(e,t=N.getConfig(),s=[]){if(super(void 0,t,s,{}),!e)return;const i=e.split(`
|
|
13
|
+
`),r=new Set(t.protocol.split("|"));let n=!0,l=!1;for(const o of i){const d=o.trim();if(!(l||!d||d.startsWith("#"))){if(n){const a=o.indexOf("|"),u=a===-1?o:o.slice(0,a),{valid:c,ns:p}=this.normalizeTitle(u,0,{halfParsed:!0,temporary:!0});if(c&&p===6){const m=new At("imagemap",u,a===-1?void 0:o.slice(a+1),t,s);super.insertAt(m),n=!1;continue}else l=!0}else if(o.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(o);continue}else if(o.includes("[")){const a=o.indexOf("["),u=o.slice(a),c=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(u);if(c){if(this.normalizeTitle(c[1],0,{halfParsed:!0,temporary:!0,selfLink:!0}).valid){super.insertAt(new Sn(o.slice(0,a),c.slice(1),u.slice(u.indexOf("]]")+2),t,s));continue}}else if(u.startsWith("[//")||r.has(u.slice(1,u.indexOf(":")+1))||r.has(u.slice(1,u.indexOf("//")+2))){const p=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(u);if(p){super.insertAt(new Sn(o.slice(0,a),p.slice(1),u.slice(u.indexOf("]")+1),t,s));continue}}}}super.insertAt(new Bs(o,t,s))}}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new ce(this,e),{childNodes:r,image:n}=this,l="invalid-imagemap",{lintConfig:o}=N,d=o.getSeverity(l,n?"link":"image");return d&&(n?s.push(...r.filter(a=>{const u=a.toString().trim();return a.is("noinclude")&&u&&!u.startsWith("#")}).map(a=>{const u=J(a,i,l,"invalid-imagemap-link",d);return o.computeEditInfo&&(u.suggestions=[Z(u,-1),Pe(u,"comment","# ")]),u})):s.push(Y(this,i,l,"imagemap-without-image",d))),s}}getAttribute(e){return e==="invalid"?!this.image:super.getAttribute(e)}}}}),Al,Oi,kl,$t,pa=C({"src/nowiki/comment.ts"(){"use strict";K(),gt(),Ze(),G(),pt(),Al=[Ye(!1),Ue("<!--")],$t=class extends(kl=Oe){constructor(t,s,i,r){super(t,i,r);Ne(this,"closed");this.closed=s}get type(){return"comment"}lint(t=this.getAbsoluteIndex()){{if(this.closed)return[];const s="unclosed-comment",{lintConfig:i}=N,r=i.getSeverity(s);if(!r)return[];const n=Y(this,{start:t},s,"unclosed-comment",r);return i.computeEditInfo&&(n.suggestions=[Je(n.endIndex,"-->")]),[n]}}toString(t){return t?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"<!--",post:this.closed?"-->":""})}},Oi=ae(kl),$t=le(Oi,0,"CommentToken",Al,$t),re(Oi,1,$t)}}),fa={};oe(fa,{CommentedToken:()=>ma});var ma,Ju=C({"src/commented.ts"(){"use strict";X(),pa(),ma=class extends H{get type(){return"ext-inner"}constructor(e,t,s=[]){if(super(void 0,t,s,{AstText:":",CommentToken:":"}),e){let i=e.indexOf("<!--"),r=i!==-1&&e.indexOf("-->",i+4),n=0;for(;r!==!1&&r!==-1;)i>n&&this.insertAt(e.slice(n,i)),this.insertAt(new $t(e.slice(i+4,r),!0,t,s)),n=r+3,i=e.indexOf("<!--",n),r=i!==-1&&e.indexOf("-->",i+4);n<e.length&&this.insertAt(e.slice(n))}}lint(e=this.getAbsoluteIndex()){return super.lint(e,new RegExp(String.raw`<\s*(?:\/\s*)?(${this.name})\b`,"giu"))}}}}),xa={};oe(xa,{NowikiToken:()=>va});var $l,_l,va,Xu=C({"src/nowiki/index.ts"(){"use strict";var e,An,s;Ke(),K(),G(),pt(),$l=at(i=>new RegExp(String.raw`<\s*(?:/\s*)${i==="nowiki"?"":"?"}(${i})\b`,"giu")),_l=new Set(["languages","section","templatestyles"]),va=(s=class extends Oe{constructor(){super(...arguments);P(this,e)}get type(){return"ext-inner"}lint(r=this.getAbsoluteIndex()){{const{name:n}=this,l="void-ext",{lintConfig:o}=N,d=o.getSeverity(l,n);if(d&&R(this,e,An).call(this)){const a=Y(this,{start:r},l,N.msg("nothing-in",n),d);return o.computeEditInfo&&(a.suggestions=[Z(a)]),[a]}return super.lint(r,$l(n))}}getAttribute(r){return r==="invalid"?R(this,e,An).call(this):super.getAttribute(r)}},e=new WeakSet,An=function(){const{name:r,firstChild:{data:n}}=this;return _l.has(r)&&!!n},s)}}),Tl,Bi,Cl,_t,ba=C({"src/tagPair/ext.ts"(){"use strict";K(),me(),G(),Dn(),X(),zn(),Jn(),Tl=[Hs()],_t=class extends(Cl=ot){get type(){return"ext"}constructor(e,t,s,i,r=N.getConfig(),n=!1,l=[]){const o=e.toLowerCase(),d=new Ds(!t||/^\s/u.test(t)?t:` ${t}`,"ext-attrs",o,r,l),a={...r,ext:r.ext.filter(c=>c!==o),excludes:[...r.excludes],inExt:!0};let u;switch(o){case"tab":a.ext=a.ext.filter(c=>c!=="tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":case"langconvert":case"phonos":o==="poem"&&a.excludes.push("heading"),u=new H(s,a,l);break;case"pre":{const{PreToken:c}=(Wu(),se(zo));u=new c(s,a,l);break}case"dynamicpagelist":{const{ParamTagToken:c}=(Vo(),se(Go));u=new c(n,s,a,l);break}case"inputbox":{const{InputboxToken:c}=(Hu(),se(Ko));u=new c(n,s,a,l);break}case"references":{const{NestedToken:c}=(Ii(),se(js));a.excludes.push("heading"),u=new c(s,n,["ref"],a,l);break}case"choose":{const{NestedToken:c}=(Ii(),se(js));u=new c(s,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],a,l);break}case"combobox":{const{NestedToken:c}=(Ii(),se(js));u=new c(s,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],a,l);break}case"gallery":{const{GalleryToken:c}=(Gu(),se(oa));u=new c(s,a,l);break}case"imagemap":{const{ImagemapToken:c}=(Qu(),se(ha));u=new c(s,a,l);break}case"hiero":{const{CommentedToken:c}=(Ju(),se(fa));u=new c(s,a,l);break}default:{const{NowikiToken:c}=(Xu(),se(xa));u=new c(s,a,l)}}u.setAttribute("name",o),u.type==="plain"&&(u.type="ext-inner"),super(e,d,u,i,r,l),this.seal("closed",!0)}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),{lintConfig:i}=N,r=new ce(this,e);if(this.name!=="nowiki"){const n=this.inHtmlAttrs(),l="parsing-order",o=n&&i.getSeverity(l,n===2?"ext":"templateInTable");o&&s.push(Y(this,r,l,"ext-in-html",o))}if(this.name==="ref"){let n="var-anchor",l=i.getSeverity(n,"ref");l&&this.closest("heading-title")&&s.push(Y(this,r,n,"variable-anchor",l)),n="nested-link",l=i.getSeverity(n,"ref"),l&&this.closest("link,ext-link-text")&&s.push(Y(this,r,n,"ref-in-link",l))}return s}}},Bi=ae(Cl),_t=le(Bi,0,"ExtToken",Tl,_t),re(Bi,1,_t)}}),wa={};oe(wa,{parseCommentAndExt:()=>vs});var qi,Il,$s,Nl,Wi,vs,Qs=C({"parser/commentAndExt.ts"(){"use strict";Ke(),fe(),Ru(),Pt(),Ou(),Bu(),ba(),pa(),qi="<onlyinclude>",Il="</onlyinclude>",{length:$s}=qi,Nl=[!1,!0].map(e=>{const t=e?"includeonly":"(?:no|only)include",s=e?"noinclude":"includeonly";return $o(i=>new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${t}(?:\s[^>]*)?/?>|</${t}\s*>|<(${i.join("|")})(\s[^>]*?)?(?:/>|>([\s\S]*?)</(${"\\1"}\s*)>)|<(${s})(\s[^>]*?)?(?:/>|>([\s\S]*?)(?:</(${s}\s*)>|$))`,"giu"))}),Wi=e=>{const t=e.indexOf(qi);return{i:t,j:e.indexOf(Il,t+$s)}},vs=(e,t,s,i)=>{if(i){let{i:o,j:d}=Wi(e);if(o!==-1&&d!==-1){let a="";const u=c=>{new Ee(c,t,s),a+=`\0${s.length-1}n`};for(;o!==-1&&d!==-1;){const c=`\0${s.length}e`;new Kt(e.slice(o+$s,d),t,s),o>0&&u(e.slice(0,o)),a+=c,e=e.slice(d+$s+1),{i:o,j:d}=Wi(e)}return e&&u(e),a}}const{ext:r}=t;let n=r,l=t;if(r.includes("translate")){n=r.filter(d=>d!=="translate"&&d!=="tvar"),l={...t,ext:n};const o=[];e=e.replace(/<nowiki>[\s\S]*?<\/nowiki>/giu,d=>(o.push(d),`\0${o.length-1}`)).replace(/<translate( nowrap)?>([\s\S]+?)?<\/translate>/gu,(d,a,u)=>{const c=s.length;return new Bo(a,u&&Fe(u,o),l,s),`\0${c}g`}),e=Fe(e,o)}return e.replace(Nl[i?1:0](n),(o,d,a,u,c,p,m,b,_)=>{const A=s.length;let k="n";if(d)k="e",new _t(d,a,u,c,l,p,s);else if(o.startsWith("<!--")){k="c";const T=o.endsWith("-->");new $t(Fe(o,s,1).slice(4,T?-3:void 0),T,t,s)}else p?new Yt(p,m&&Fe(m,s,1),b&&Fe(b,s,1),_,t,s):new Ee(o,t,s,!0);return`\0${A}${k}`})}}}),Ll,Fl,El,jl,Ui,Rl,ts,Ku=C({"src/tag/html.ts"(){"use strict";var e,t;K(),me(),Dn(),G(),Oo(),Ll=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),Fl=new Set(["b","big","center","cite","code","del","dfn","em","font","i","ins","kbd","mark","pre","q","s","samp","small","strike","strong","sub","sup","tt","u","var"]),El=new Set(["strike","big","center","font","tt"]),jl=[Hs()],ts=(t=class extends(Rl=Hn){constructor(i,r,n,l,o,d){super(i,r,n,o,d);P(this,e);this.setAttribute("name",i.toLowerCase()),F(this,e,l)}get type(){return"html"}get selfClosing(){return w(this,e)}text(){const{closing:i,selfClosing:r,name:n}=this,{html:[,,l]}=this.getAttribute("config");return l.includes(n)?i&&n!=="br"?"":super.text("/"):super.text(r&&!i?"/":"")}lint(i=this.getAbsoluteIndex(),r){var n;{const l=super.lint(i,r),{name:o,parentNode:d,closing:a,selfClosing:u}=this,c=new ce(this,i),{lintConfig:p}=N,{computeEditInfo:m,fix:b}=p,_=this.inTableAttrs();let A="h1",k=p.getSeverity(A,"html");if(k&&o==="h1"&&!a){const h=Y(this,c,A,"<h1>",k);m&&(h.suggestions=[{desc:"h2",range:[i+2,i+3],text:"2"}]),l.push(h)}if(A="parsing-order",k=_&&p.getSeverity(A,_===2?"html":"templateInTable"),k){const h=Y(this,c,A,"html-in-table",k);m&&_===2&&(h.suggestions=[Z(h)]),l.push(h)}if(A="obsolete-tag",k=p.getSeverity(A,o),k&&El.has(o)&&l.push(Y(this,c,A,"obsolete-tag",k)),A="bold-header",k=p.getSeverity(A,o),k&&(o==="b"||o==="strong")&&((n=this.closest("heading-title,ext"))==null?void 0:n.type)==="heading-title"){const h=Y(this,c,A,"bold-in-header",k);m&&(h.suggestions=[Z(h)]),l.push(h)}const{html:[,T,f]}=this.getAttribute("config"),g=f.includes(o),x=T.includes(o),v=!g&&!x;if(A="unmatched-tag",a&&(u||g)||u&&v){if(k=p.getSeverity(A,a?"both":"selfClosing"),k){const h=Y(this,c,A,a?"closing-and-self-closing":"invalid-self-closing",k);if(m||b){const S=Pn(i),y={desc:N.msg("no-self-closing"),range:[h.endIndex-2,h.endIndex-1],text:""};x?m&&(h.suggestions=[S,y]):a?h.fix=g?S:y:m&&(h.suggestions=[y,Je(h.endIndex,`></${o}>`,-2)])}l.push(h)}}else if(!this.findMatchingTag()){const h=Y(this,c,A,a?"unmatched-closing":"unclosed-tag"),S=this.closest("magic-word");if(S&&Ll.has(S.name))k=p.getSeverity(A,"conditional");else if(a)k=p.getSeverity(A,"closing"),h.suggestions=[Z(h)];else{k=p.getSeverity(A,"opening");const y=d==null?void 0:d.childNodes;Fl.has(o)&&(y!=null&&y.slice(0,y.indexOf(this)).some($=>$.type==="html"&&$.name===o&&!$.findMatchingTag())&&(h.suggestions=[Je(i+1,"/")]),this.closest("heading-title")&&(h.rule="format-leakage",k=p.getSeverity("format-leakage",o)))}k&&(h.severity=k,l.push(h))}return l}}getAttribute(i){return i==="invalid"?this.inTableAttrs()===2:super.getAttribute(i)}json(i,r=this.getAbsoluteIndex()){{const n=super.json(void 0,r);return n.selfClosing=w(this,e),n}}},e=new WeakMap,t),Ui=ae(Rl),ts=le(Ui,0,"HtmlToken",jl,ts),re(Ui,1,ts)}}),ya={};oe(ya,{parseHtml:()=>Sa});var Pl,Sa,Yu=C({"parser/html.ts"(){"use strict";Jn(),Ku(),Pl=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,Sa=(e,t,s)=>{var l;const{html:i}=t;(l=t.htmlElements)!=null||(t.htmlElements=new Set([...i[0],...i[1],...i[2]]));const r=e.split("<");let n=r.shift();for(const o of r){const d=Pl.exec(o),a=d==null?void 0:d[2],u=a==null?void 0:a.toLowerCase();if(!d||!t.htmlElements.has(u)){n+=`<${o}`;continue}const[,c,,p="",m,b]=d,{length:_}=s,A=new Ds(p,"html-attrs",u,t,s),k=A.hasAttr("itemprop");if(u==="meta"&&!(k&&A.hasAttr("content"))||u==="link"&&!(k&&A.hasAttr("href"))){n+=`<${o}`,s.length=_;continue}n+=`\0${s.length}x${b}`,new ts(a,A,c==="/",m==="/>",t,s)}return n}}}),Ol,Bl,Mi,ql,Tt,Aa=C({"src/table/base.ts"(){"use strict";Dn(),G(),X(),ht(),Jn(),Ol=e=>{const t=e.childNodes.map(i=>i.type==="text"?i.data.replace(/\|\|/gu,"{{!!}}").replace(/\|/gu,"{{!}}"):i.toString()).join(""),{childNodes:s}=N.parse(t,e.getAttribute("include"),2,e.getAttribute("config"));e.safeReplaceChildren(s)},Bl=[Hs(1)],Tt=class extends(ql=H){constructor(e,t,s,i,r,n=[],l){super(void 0,r,n,l),this.append(new qe(t,"table-syntax",r,n),new Ds(i,"table-attrs",s,r,n))}escape(){for(const e of this.childNodes)e instanceof qe?Ol(e):e.escape()}},Mi=ae(ql),Tt=le(Mi,0,"TableBaseToken",Bl,Tt),re(Mi,1,Tt)}}),Wl,zi,Se,_s,Ht,Dt,qs,ka=C({"src/table/td.ts"(){"use strict";K(),me(),Mn(),G(),X(),Aa(),qs=class extends(zi=Tt,Wl=[Us(!1)],zi){constructor(e,t,s,i=[]){var o;let r=/\||\0\d+!\x7F/u.exec(t!=null?t:""),n=r?t.slice(0,r.index):"";/\[\[|-\{/u.test(n)&&(r=null,n=""),super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",n,s,i),re(_s,5,this),De(this,Ht),De(this,Se,""),r&&([ku(this,Se)._]=r);const l=new H(t==null?void 0:t.slice(((o=r==null?void 0:r.index)!=null?o:NaN)+pe(this,Se).length),s,i);l.type="td-inner",l.setAttribute("stage",4),this.insertAt(l)}get type(){return"td"}get rowspan(){return this.getAttr("rowspan")}get colspan(){return this.getAttr("colspan")}get subtype(){return cn(this,Ht,Dt).call(this).subtype}afterBuild(){pe(this,Se).includes("\0")&&ke(this,Se,this.buildFromStr(pe(this,Se),0)),super.afterBuild()}toString(e){const{childNodes:[t,s,i]}=this;return t.toString(e)+s.toString(e)+pe(this,Se)+i.toString(e)}text(){const{childNodes:[e,t,s]}=this;return e.text()+t.text()+pe(this,Se)+s.text()}getGaps(e){return e===1?pe(this,Se).length:0}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new ce(this,e+this.getRelativeIndex(this.length-1)),r="pipe-like",{lintConfig:n}=N,{computeEditInfo:l,fix:o}=n,d=["td","double"].map(a=>n.getSeverity(r,a));for(const a of this.lastChild.childNodes)if(a.type==="text"){const{data:u}=a;if(u.includes("|")){const c=u.includes("||"),p=d[c?1:0];if(p){const m=J(a,i,r,"pipe-in-table",p);if(l||o)if(c){const b={caption:"|+",td:"|",th:"!"}[this.subtype];m.fix=Pe(m,"newline",u.replace(/\|\|/gu,`
|
|
14
|
+
${b}`))}else l&&(m.suggestions=[qn(m.startIndex,u)]);s.push(m)}}}return s}}isIndependent(){return this.firstChild.text().startsWith(`
|
|
15
|
+
`)}getAttr(e){{const t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}}escape(){super.escape(),this.childNodes[1].toString()&&(pe(this,Se)||ke(this,Se,"{{!}}")),pe(this,Se)==="|"&&ke(this,Se,"{{!}}")}print(){const{childNodes:[e,t,s]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${pe(this,Se)}${s.print()}</span>`}json(e,t=this.getAbsoluteIndex()){{const s=super.json(void 0,t),{rowspan:i,colspan:r}=this;return Object.assign(s,{subtype:this.subtype},i!==1&&{rowspan:i},r!==1&&{colspan:r}),s}}},_s=ae(zi),Se=new WeakMap,Ht=new WeakSet,Dt=function(){var e;const t=this.firstChild.text(),s=t.slice(-1);let i="td";if(s==="!"?i="th":s==="+"&&(i="caption"),this.isIndependent())return{subtype:i};const{previousSibling:r}=this;return{...cn(e=r,Ht,Dt).call(e)}},Dt=le(_s,17,"#getSyntax",Wl,Ht,Dt),Fn(_s,qs)}}),sr,$a=C({"src/table/trBase.ts"(){"use strict";K(),G(),Aa(),ka(),sr=class extends Tt{lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=this.childNodes.find(({type:o})=>o==="table-inter");if(!i)return s;const r=ls(i),n="fostered-content",l=r&&N.lintConfig.getSeverity(n,r===2?void 0:"transclusion");if(l){const o=J(i,{start:e},n,"content-outside-table",l);o.startIndex++,o.startLine++,o.startCol=0,s.push(o)}return s}}getRowCount(){return Number(this.childNodes.some(e=>e instanceof qs&&e.isIndependent()&&!e.firstChild.text().endsWith("+")))}}}}),Ul,Ml,zl,Hl,Hi,Ts,Rs,Zu=C({"src/table/index.ts"(){"use strict";K(),je(),me(),Mn(),G(),$a(),ht(),Ul=(e,t)=>new Array(e).fill(void 0).map((s,i)=>t(i)),Ml=({type:e})=>e==="tr"||e==="table-syntax",zl=class extends Array{},Rs=class extends(Hi=sr,Hl=[Us(!1)],Hi){constructor(e,t,s,i){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,e,"table",t,s,i,{}),re(Ts,5,this)}get type(){return"table"}get closed(){return this.lastChild.is("table-syntax")}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new ce(this,e),r=["unclosed-table","table-layout"],n=r.map(l=>N.lintConfig.getSeverity(l));if(n[0]&&!this.closed&&s.push(J(this.firstChild,i,r[0],"unclosed-table",n[0])),n[1]){const l=this.getLayout(),{length:o}=l;if(o>1){let d=1,a=1/0,u=0;for(;u<o;u++){const c=l[u],p=c.length;if(p<d)break;p<a&&(a=p);const m=c.indexOf(c[p-1])+1;if(m>a)break;m>d&&(d=m)}if(u<o){const c=this.getNthRow(u),p=J(c,i,r[1],"inconsistent-table",n[1]);p.startIndex++,p.startLine++,p.startCol=0,s.push(p)}}}return s}}close(e=`
|
|
16
|
+
|}`,t){const s=this.getAttribute("config"),i=this.getAttribute("accum");xe.run(()=>{const r=new qe(t?e:void 0,"table-syntax",s,i);super.insertAt(r)})}getLayout(e){{const t=this.getAllRows(),{length:s}=t,i=zl.from(Ul(s,()=>[]));for(let r=0;r<i.length;r++){const n=i[r];let l=0,o=0,d;for(const a of t[r].childNodes.slice(2))if(a.is("td")){if(a.isIndependent()&&(d=a.subtype!=="caption"),d){const u={row:r,column:l},{rowspan:c,colspan:p}=a;for(l++;n[o];)o++;for(let m=r;m<Math.min(r+c,s);m++)for(let b=o;b<o+p;b++)i[m][b]=u;o+=p}}else if(Ml(a))break}return i}}getAllRows(){return[...super.getRowCount()?[this]:[],...this.childNodes.slice(1).filter(e=>e.is("tr")&&e.getRowCount()>0)]}getNthRow(e,t,s){{const i=super.getRowCount();if(e===0&&i)return this;i&&e--;for(const r of this.childNodes.slice(2)){const{type:n}=r;if(n==="tr"&&r.getRowCount()&&(e--,e<0))return r}return}}json(e,t=this.getAbsoluteIndex()){{const s=super.json(void 0,t);return s.closed=this.closed,s}}},Ts=ae(Hi),le(Ts,1,"getLayout",Hl,Rs),Fn(Ts,Rs)}}),_a,ed=C({"src/table/tr.ts"(){"use strict";$a(),_a=class extends sr{get type(){return"tr"}constructor(e,t,s,i){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,e,"tr",t,s,i)}}}}),ir,Ta=C({"src/nowiki/listBase.ts"(){"use strict";pt(),ir=class extends Oe{get indent(){return this.innerText.split(":").length-1}json(e,t=this.getAbsoluteIndex()){{const s=super.json(void 0,t),{indent:i}=this;return i&&(s.indent=i),s}}}}}),nr,Ca=C({"src/nowiki/dd.ts"(){"use strict";Ta(),nr=class extends ir{get type(){return"dd"}}}}),Ia={};oe(Ia,{parseTable:()=>Na});var Dl,Di,Na,td=C({"parser/table.ts"(){"use strict";X(),Zu(),ed(),ka(),Ca(),Dl=e=>e.lastChild.constructor!==H,Di=(e,t)=>e.is("td")?t.pop():e,Na=({firstChild:{data:e},type:t,name:s},i,r)=>{const n=[],l=e.split(`
|
|
17
17
|
`);let o=t==="root"||t==="parameter-value"||t==="ext-inner"&&s==="poem"?"":`
|
|
18
|
-
${l.shift()}`,d;const a=(u,c)=>{if(!c){o+=u;return}const{lastChild:p}=c;if(
|
|
19
|
-
${c}${f&&`\0${r.length-1}d`}${g}\0${r.length}b`,d),n.push(...d?[d]:[],new
|
|
18
|
+
${l.shift()}`,d;const a=(u,c)=>{if(!c){o+=u;return}const{lastChild:p}=c;if(Dl(c)){const m=new H(u,i,r);m.type="table-inter",m.setAttribute("stage",3),c.insertAt(m)}else p.setText(p.toString()+u)};for(const u of l){d=n.pop();const[c]=/^(?:\s|\0\d+[cno]\x7F)*/u.exec(u),p=u.slice(c.length),m=/^(:*)((?:\s|\0\d+[cn]\x7F)*)(\{\||\{(?:\0\d+[cn]\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(p);if(m){for(;d&&!d.is("td");)d=n.pop();const[,f,g,x,v]=m;f&&new nr(f,i,r),a(`
|
|
19
|
+
${c}${f&&`\0${r.length-1}d`}${g}\0${r.length}b`,d),n.push(...d?[d]:[],new Rs(x,v,i,r));continue}else if(!d){o+=`
|
|
20
20
|
${u}`;continue}const b=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(p);if(!b){a(`
|
|
21
|
-
${u}`,d),n.push(d);continue}const[,_,A
|
|
22
|
-
${c}${_}`,!0),a(T,n[n.length-1])}else if(A){d=
|
|
23
|
-
${c}${A}`,T,i,r);n.push(d,f),d.insertAt(f)}else{d=
|
|
24
|
-
${c}${
|
|
25
|
-
`)&&(A=_e(p).trim());const{ns:T,valid:f}=N.normalizeTitle(A,0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0});if(f){if(a){if(T!==6){l+=`[[${b}`;continue}let x=!1;for(d++;d<n.length;d++){const v=n[d],h=v.split("]]");if(h.length>2){x=!0,p+=`[[${h[0]}]]${h[1]}`,m=h.slice(2).join("]]");break}else if(h.length===2)p+=`[[${h[0]}]]${h[1]}`;else{p+=`[[${v}`;break}}if(p=An(p,t,s,i),!x){l+=`[[${u}${c}${p}`;continue}}}else{l+=`[[${b}`;continue}p&&(p=nr(p,t,s,i));let g=Zn;$||(T===6?(p&&(p=rr(p,t,s,!0)),g=Yn):T===14&&(g=Oa)),p===void 0&&c&&(p=""),l+=`\0${s.length}l${m}`,new g(u,p,t,s,c)}return l}}}),qa={};oe(qa,{parseMagicLinks:()=>Wa});var Gi,Vi,Qi,Ji,Wa,rd=C({"parser/magicLinks.ts"(){"use strict";fe(),er(),Gi=String.raw`[${Qe}\t]| |�*160;|�*a0;`,Vi=`(?:${Gi})+`,Qi=`(?:${Gi}|-)`,Ji=String.raw`(?:RFC|PMID)${Vi}\d+\b|ISBN${Vi}(?:97[89]${Qi}?)?(?:\d${Qi}?){9}[\dx]\b`,Wa=(e,t,s)=>{if(!t.regexMagicLinks)try{t.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${t.protocol})(${Ct}${It})|${Ji})`,"giu")}catch{t.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${t.protocol})(${Ct}${It})|${Ji})`,"giu")}return e.replace(t.regexMagicLinks,(i,r,n)=>{let l=r?i.slice(r.length):i;if(n){let o="";const d=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(l);d&&(o=l.slice(d.index),l=l.slice(0,d.index));const a=l.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,u=a.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),o=l.slice(u.index+c)+o,l=l.slice(0,u.index+c)}return o.length>=n.length?i:(new ps(l,void 0,t,s),`${r}\0${s.length-1}w${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(l))return i;return new ps(l,"magic-link",t,s),`${r}\0${s.length-1}i`})}}}),Ma,ld=C({"util/html.ts"(){"use strict";Ma=(e,t)=>e.startsWith(t)?t.length:[...t].findIndex((s,i)=>s!==e[i])}}),Ua,od=C({"src/nowiki/list.ts"(){"use strict";$a(),Ua=class extends sr{get type(){return"list"}}}}),za={};oe(za,{parseList:()=>Ha});var Ha,ad=C({"parser/list.ts"(){"use strict";ld(),od(),_a(),Ha=(e,t,s,i)=>{const r=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(e);if(!r)return t.lastPrefix="",e;const[n,l,o,d]=r,a=o.replace(/;/gu,":"),u=Ma(a,t.lastPrefix),c=((u>1?o.slice(u-1):o)+d).split(/(?=;)/u),p=c[0].startsWith(";");let m=c.length-(p?0:1);if(u>1){const k=o.slice(0,u-1);if(p){const L=k.split(/(?=;)/u);c.unshift(...L),m+=k.includes(";")?L.length:0}else c[0]=k+c[0]}t.lastPrefix=a;let b=l+c.map((k,L)=>`\0${i.length+L}d`).join("")+e.slice(n.length);for(const k of c)new Ua(k,s,i);if(!m)return b;const{html:[_,,A]}=s,$=/:+|-\{|\0\d+[xq]\x7F/gu;let T=$,f=T.exec(b),g=0,x=!1,v=!1,h=0;const S=(k,L)=>(new ir(k,s,i),`${b.slice(0,L)}\0${i.length-1}d${b.slice(L+k.length)}`),y=k=>{k?g&&g--:g++};for(;f&&m;){const{0:k,index:L}=f;if(k==="-{"){if(!h){const{lastIndex:I}=T;T=/-\{|\}-/gu,T.lastIndex=I}h++}else if(k==="}-"){if(h--,!h){const{lastIndex:I}=T;T=$,T.lastIndex=I}}else if(k.endsWith("x")){const{name:I,closing:j,selfClosing:B}=i[Number(k.slice(1,-2))];(_.includes(I)||!B&&!A.includes(I))&&y(j)}else if(k.endsWith("q")){const{bold:I,italic:j}=i[Number(k.slice(1,-2))];I&&(y(x),x=!x),j&&(y(v),v=!v)}else if(g===0){if(k.length>=m)return S(k.slice(0,m),L);m-=k.length,T.lastIndex=L+4+String(i.length).length,b=S(k,L)}f=T.exec(b)}return b}}}),Ts,Vl,Xi,Ql,ss,ud=C({"src/converterFlags.ts"(){"use strict";var e,t;K(),me(),Ms(),G(),X(),ct(),Ts=new Set(["A","T","R","D","-","H","N"]),Vl=[ms()],ss=(t=class extends(Ql=H){constructor(i,r,n=[]){super(void 0,r,n,{});P(this,e);this.safeAppend(i.map(l=>new $e(l,"converter-flag",r,n)))}get type(){return"converter-flags"}afterBuild(){E(this,e,this.childNodes.map(i=>i.text().trim())),super.afterBuild()}toString(i){return super.toString(i,";")}text(){return super.text(";")}getUnknownFlags(){return new Set(w(this,e).filter(i=>/\{{3}[^{}]+\}{3}/u.test(i)))}getVariantFlags(){const i=new Set(this.getAttribute("config").variants);return new Set(w(this,e).filter(r=>i.has(r)))}isInvalidFlag(i,r,n,l){return typeof i=="object"&&(i=i.text().trim(),r=this.getVariantFlags(),n=this.getUnknownFlags(),l=new Set(w(this,e).filter(o=>Ts.has(o)))),!!i&&!r.has(i)&&!n.has(i)&&(r.size>0||!l.has(i))}lint(i=this.getAbsoluteIndex(),r){{const n=this.getVariantFlags(),l=this.getUnknownFlags(),o=new Set(w(this,e).filter(A=>Ts.has(A))),d=w(this,e).filter(A=>!A).length,a=w(this,e).length-l.size-d,{lintConfig:u}=N,{computeEditInfo:c,fix:p}=u,m=super.lint(i,r);if(n.size===a||o.size===a)return m;const b="no-ignored",_=u.getSeverity(b,"conversionFlag");if(_){const A=new ce(this,i);for(let $=0;$<this.length;$++){const T=this.childNodes[$],f=T.text().trim();if(this.isInvalidFlag(f,n,l,o)){const g=J(T,A,b,"invalid-conversion-flag",_);(c||p)&&(n.size===0&&Ts.has(f.toUpperCase())?g.fix=On(g,f):c&&(g.suggestions=[Y(g,$&&-1)])),m.push(g)}}}return m}}print(){return super.print({sep:";"})}},e=new WeakMap,t),Xi=ae(Ql),ss=le(Xi,0,"ConverterFlagsToken",Vl,ss),re(Xi,1,ss)}}),Rs,dd=C({"src/converterRule.ts"(){"use strict";G(),X(),ct(),Rs=class extends H{get type(){return"converter-rule"}get variant(){var e,t;return(t=(e=this.childNodes[this.length-2])==null?void 0:e.text().trim().toLowerCase())!=null?t:""}constructor(e,t=!0,s=N.getConfig(),i=[]){super(void 0,s,i);const r=e.indexOf(":"),n=e.slice(0,r).indexOf("=>"),l=n===-1?e.slice(0,r):e.slice(n+2,r);t&&s.variants.includes(l.trim().toLowerCase())?(super.insertAt(new $e(l,"converter-rule-variant",s,i)),super.insertAt(new $e(e.slice(r+1),"converter-rule-to",s,i)),n!==-1&&super.insertAt(new $e(e.slice(0,n),"converter-rule-from",s,i),0)):super.insertAt(new $e(e,"converter-rule-to",s,i))}toString(e){const{childNodes:t,firstChild:s,lastChild:i}=this;return t.length===3?`${s.toString(e)}=>${t[1].toString(e)}:${i.toString(e)}`:super.toString(e,":")}text(){const{childNodes:e,firstChild:t,lastChild:s}=this;return e.length===3?`${t.text()}=>${e[1].text()}:${s.text()}`:super.text(":")}getGaps(e){return e===0&&this.length===3?2:1}print(){const{childNodes:e}=this;if(e.length===3){const[t,s,i]=e;return`<span class="wpb-converter-rule">${t.print()}=>${s.print()}:${i.print()}</span>`}return super.print({sep:":"})}json(e,t=this.getAbsoluteIndex()){{const s=super.json(void 0,t);return s.variant=this.variant,s}}}}}),Jl,Ki,Xl,is,cd=C({"src/converter.ts"(){"use strict";fe(),Ze(),We(),X(),ud(),dd(),Jl=[Be,Me("-{")],is=class extends(Xl=H){get type(){return"converter"}constructor(e,t,s,i=[]){super(void 0,s,i),this.insertAt(new ss(e,s,i));const[r]=t,n=r.includes(":"),l=new Rs(r,n,s,i);n&&l.length===1||!n&&t.length===2&&!_e(t[1]).trim()?this.insertAt(new Rs(t.join(";"),!1,s,i)):this.append(l,...t.slice(1).map(o=>new Rs(o,!0,s,i)))}toString(e){const{childNodes:[t,...s]}=this;return`-{${t.toString(e)}${t.length>0?"|":""}${s.map(i=>i.toString(e)).join(";")}}-`}text(){const{childNodes:[e,...t]}=this;return`-{${e.text()}|${dt(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?"|":""}${Lt(t,{sep:";"})}}-</span>`}},Ki=ae(Xl),is=le(Ki,0,"ConverterToken",Jl,is),re(Ki,1,is)}}),Da={};oe(Da,{parseConverter:()=>Ga});var Ga,hd=C({"parser/converter.ts"(){"use strict";cd(),Ga=(e,t,s)=>{var d;(d=t.regexConverter)!=null||(t.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${t.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"iu"));const i=/-\{/gu,r=/-\{|\}-/gu,n=[];let l=i,o=l.exec(e);for(;o;){const{0:a,index:u}=o;if(a==="}-"){const c=n.pop(),{length:p}=s,m=e.slice(c.index+2,u),b=m.indexOf("|"),[_,A]=b===-1?[[],m]:[m.slice(0,b).split(";"),m.slice(b+1)],$=A.replace(/(&[#a-z\d]+);/giu,"$1"),T=$.split(t.regexConverter).map(f=>f.replace(/\x01/gu,";"));new is(_,T,t,s),e=`${e.slice(0,c.index)}\0${p}v${e.slice(u+2)}`,n.length===0&&(l=i),l.lastIndex=c.index+3+String(p).length}else n.push(o),l=r,l.lastIndex=u+2;o=l.exec(e)}return e}}}),ls={};oe(ls,{Token:()=>H});var Kl,H,X=C({"src/index.ts"(){"use strict";var e,t,s,i,r,n,l,o,Va,Qa,Ja,Xa,Ka,Ya,Za,eu,tu,su,iu,nu,g;fe(),Xe(),K(),Oe(),G(),_u(),Cu(),Kl=["category","html-attr#id,ext-attr#id,table-attr#id"],H=(g=class extends Vt{constructor(h,S=N.getConfig(),y=[],k){super();P(this,o);P(this,e,"plain");P(this,t,0);P(this,s);P(this,i);P(this,r);P(this,n,!1);P(this,l);typeof h=="string"&&this.insertAt(h),E(this,s,S),E(this,i,y),y.push(this)}get type(){return w(this,e)}set type(h){E(this,e,h)}parseOnce(h=w(this,t),S=!1,y){if(h<w(this,t)||this.length===0||!this.isPlain())return this;if(w(this,t)>=Ae)return this;switch(h){case 0:if(this.type==="root"){w(this,i).pop();const k=R(this,o,Va).call(this);S&&(S=!k)}E(this,r,S),R(this,o,Qa).call(this,S);break;case 1:R(this,o,Ja).call(this);break;case 2:R(this,o,Xa).call(this);break;case 3:R(this,o,Ka).call(this);break;case 4:R(this,o,Ya).call(this);break;case 5:R(this,o,Za).call(this,y);break;case 6:R(this,o,eu).call(this,y);break;case 7:R(this,o,tu).call(this);break;case 8:R(this,o,su).call(this);break;case 9:R(this,o,iu).call(this);break;case 10:R(this,o,nu).call(this)}if(this.type==="root")for(const k of w(this,i))k==null||k.parseOnce(h,S,y);return ar(this,t)._++,this}buildFromStr(h,S){const y=h.split(/[\0\x7F]/u).map((k,L)=>{if(L%2===0)return new pn(k);if(isNaN(k.slice(-1)))return w(this,i)[Number(k.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${k}`)});return S===0?y.map(String).join(""):S===1?dt(y):y}build(){E(this,t,Ae);const{length:h,firstChild:S}=this,y=S==null?void 0:S.toString();if(h===1&&S.type==="text"&&y.includes("\0")&&(fs(this,0,1,this.buildFromStr(y)),this.normalize(),this.type==="root"))for(const k of w(this,i))k==null||k.build()}afterBuild(){if(this.type==="root")for(const h of w(this,i))h==null||h.afterBuild();E(this,n,!0)}parse(h=Ae,S,y){for(h=Math.min(h,Ae);w(this,t)<h;)this.parseOnce(w(this,t),S,y);return h&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===g}getAttribute(h){var S;switch(h){case"config":return w(this,s);case"include":return(S=w(this,r))!=null?S:!!w(this.getRootNode(),r);case"accum":return w(this,i);case"built":return w(this,n);case"stage":return w(this,t);case"invalid":return this.type==="table-inter"&&rs(this)===2;default:return super.getAttribute(h)}}setAttribute(h,S){switch(h){case"stage":w(this,t)===0&&this.type==="root"&&w(this,i).shift(),E(this,t,S);break;default:super.setAttribute(h,S)}}insertAt(h,S=this.length){const y=typeof h=="string"?new pn(h):h;super.insertAt(y,S);const{type:k}=y;return k==="root"&&(y.type="plain"),y}normalizeTitle(h,S=0,y){return N.normalizeTitle(h,S,w(this,r),w(this,s),y)}inTableAttrs(){var h,S;return((h=this.closest("table-attrs,ext"))==null?void 0:h.type)==="table-attrs"&&((S=this.closest("table-attrs,arg,magic-word,template"))!=null&&S.is("table-attrs")?2:1)}inHtmlAttrs(){var h;return(h=this.closest("html-attrs,ext"))!=null&&h.is("html-attrs")?2:this.inTableAttrs()}lint(h=this.getAbsoluteIndex(),S){var y;{const{lintConfig:k}=N,{computeEditInfo:L,fix:I,ignoreDisables:j,configurationComment:B}=k;let O=super.lint(h,S);if(this.type==="root"){const F=new Map,D="no-duplicate",W=["category","id"].map(M=>k.getSeverity(D,M)),q=this.toString(),z=Kl.filter((M,V)=>W[V]).join();if(z){for(const M of this.querySelectorAll(z)){let V;if(M.is("category"))V=M.name;else{const Q=M.getValue();Q&&Q!==!0&&(V=`#${Q}`)}if(V){const Q=F.get(V);Q?Q.add(M):F.set(V,new Set([M]))}}for(const[M,V]of F)if(V.size>1&&!M.startsWith("#mw-customcollapsible-")){const Q=!M.startsWith("#"),se=`duplicate-${Q?"category":"id"}`,ue=W[Q?0:1];O.push(...[...V].map(he=>{const ne=ie(he,{start:he.getAbsoluteIndex()},D,se,ue);return L&&Q&&(ne.suggestions=[Y(ne)]),ne}))}}if(!j){const M=new RegExp(String.raw`<!--\s*${B}-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->`,"gu"),V=[];let Q=M.exec(q);for(;Q;){const{1:se,index:ue}=Q,he=(y=Q[2])==null?void 0:y.trim();V.push({line:this.posFromIndex(ue).top+(se==="disable-line"?0:1),from:se==="disable"?M.lastIndex:void 0,to:se==="enable"?M.lastIndex:void 0,rules:he?new Set(he.split(",").map(ne=>ne.trim())):void 0}),Q=M.exec(q)}O=O.filter(({rule:se,startLine:ue,startIndex:he})=>{const ne={pos:0};for(const{line:Ce,from:Ie,to:U,rules:Z}of V){if(Ce>ue+1)break;if(Z&&!Z.has(se))continue;if(Ce===ue&&Ie===void 0&&U===void 0)return!1;Ie<=he&&Ie>ne.pos?(ne.pos=Ie,ne.type="from"):U<=he&&U>ne.pos&&(ne.pos=U,ne.type="to")}return ne.type!=="from"})}if(I&&O.some(({fix:M})=>M)){const M=O.map(({fix:se})=>se).filter(Boolean).sort(({range:[se,ue]},{range:[he,ne]})=>ue===ne?he-se:ne-ue);let V=1/0,Q=q;for(const{range:[se,ue],text:he}of M)ue<=V&&(Q=Q.slice(0,se)+he+Q.slice(ue),V=se);Object.assign(O,{output:Q})}if(!L)for(const M of O)delete M.fix,delete M.suggestions}return O}}toString(h,S){return h?super.toString(!0,S):ut(w(this,l),()=>super.toString(!1,S),y=>{const k=this.getRootNode();k.type==="root"&&w(k,n)&&E(this,l,y)})}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakMap,n=new WeakMap,l=new WeakMap,o=new WeakSet,Va=function(){const{parseRedirect:h}=(Lu(),te(Eo)),S=this.firstChild.toString(),y=h(S,w(this,s),w(this,i));return y&&this.setText(y),!!y},Qa=function(h){const{parseCommentAndExt:S}=(Vs(),te(va));this.setText(S(this.firstChild.toString(),w(this,s),w(this,i),h))},Ja=function(){const{parseBraces:h}=(Kn(),te(Qo)),S=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,y=h(S,w(this,s),w(this,i));this.setText(this.type==="root"?y:y.slice(1))},Xa=function(){if(w(this,s).excludes.includes("html"))return;const{parseHtml:h}=(Ju(),te(ba));this.setText(h(this.firstChild.toString(),w(this,s),w(this,i)))},Ka=function(){if(w(this,s).excludes.includes("table"))return;const{parseTable:h}=(Yu(),te(Ta));this.setText(h(this,w(this,s),w(this,i)))},Ya=function(){if(w(this,s).excludes.includes("hr"))return;const{parseHrAndDoubleUnderscore:h}=(td(),te(Na));this.setText(h(this,w(this,s),w(this,i)))},Za=function(h){const{parseLinks:S}=(nd(),te(Ba));this.setText(S(this.firstChild.toString(),w(this,s),w(this,i),h))},eu=function(h){if(w(this,s).excludes.includes("quote"))return;const{parseQuotes:S}=(ja(),te(Ea)),y=this.firstChild.toString().split(`
|
|
26
|
-
`);for(let
|
|
27
|
-
`))},
|
|
28
|
-
`),I={lastPrefix:""};let j=y==="root"||y==="ext-inner"
|
|
29
|
-
`))},nu=function(){if(w(this,s).variants.length>0){const{parseConverter:h}=(hd(),te(Da));this.setText(h(this.firstChild.toString(),w(this,s),w(this,i)))}},g)}}),be,Qs,fs,Oe=C({"util/debug.ts"(){"use strict";be={running:!1,run(e){const{running:t}=this;this.running=!0;try{const{Token:s}=(X(),te(ls)),i=e();return i instanceof s&&!i.getAttribute("built")&&i.afterBuild(),this.running=t,i}catch(s){throw this.running=t,s}},rev:0},Qs=e=>t=>t.type===e,fs=(e,t,s,i=[])=>{var l,o;let r=e.getChildNodes(),n;r.length===s?(n=r,r=i):n=r.splice(t,s,...i);for(let d=0;d<i.length;d++){const a=i[d];a.setAttribute("parentNode",e),a.setAttribute("nextSibling",r[t+d+1]),a.setAttribute("previousSibling",r[t+d-1])}return(l=r[t-1])==null||l.setAttribute("nextSibling",r[t]),(o=r[t+i.length])==null||o.setAttribute("previousSibling",r[t+i.length-1]),r===i&&e.setAttribute("childNodes",r),n}}}),xt,Yi,Cs,Zi,Yl,en,Zl,kn,gd=C({"lib/lintConfig.ts"(){"use strict";var e,t;En(),xt=new Map([[0,!1],[1,"warning"],[2,"error"],[!1,!1],["off",!1],["warning","warning"],["error","error"]]),Yi={"bold-header":[1,{}],"format-leakage":[1,{}],"fostered-content":[1,{}],h1:[1,{}],"illegal-attr":[2,{}],"insecure-style":2,"invalid-gallery":[2,{parameter:1}],"invalid-imagemap":[2,{}],"invalid-invoke":[2,{}],"invalid-isbn":2,"lonely-apos":[1,{}],"lonely-bracket":[1,{extLink:2}],"lonely-http":[1,{}],"nested-link":[2,{}],"no-arg":1,"no-duplicate":[2,{category:1,id:1,unknownImageParameter:1}],"no-ignored":[2,{fragment:1,galleryComment:1,galleryNoImage:1,include:1,nonWordAttributes:1,redirect:1}],"obsolete-attr":1,"obsolete-tag":1,"parsing-order":[2,{templateInTable:1}],"pipe-like":[1,{double:2}],"table-layout":1,"tag-like":[2,{disallowed:1,invalid:1}],"unbalanced-header":2,"unclosed-comment":[1,{}],"unclosed-quote":1,"unclosed-table":2,unescaped:2,"unknown-page":1,"unmatched-tag":[1,{both:2,selfClosing:2}],"unterminated-url":[1,{}],"url-encoding":[1,{}],"var-anchor":[1,{}],"void-ext":[2,{}]},Object.freeze(Yi),Cs={configurationComment:"lint",ignoreDisables:!1,fix:!0,computeEditInfo:!0},Object.freeze(Cs),Zi=s=>xt.has(s),Yl=s=>Zi(s)||Array.isArray(s)&&Zi(s[0])&&(s.length===1||typeof s[1]=="object"),en=(s,i,r)=>{if(os.includes(i)){if(r===void 0)return!1;if(Yl(r))return s[i]=r,!0}else throw new RangeError(`Unknown lint rule: ${i}`);throw new RangeError(`Invalid lint config for ${i}: ${JSON.stringify(r)}`)},Zl=class{constructor(s){if(Object.assign(this,JSON.parse(JSON.stringify(Yi))),!!s)for(const[i,r]of Object.entries(s))en(this,i,r)}getSeverity(s,i){var n,l;const r=this[s];return typeof r!="object"?xt.get(r):i&&(l=xt.get((n=r[1])==null?void 0:n[i]))!=null?l:xt.get(r[0])}},kn=(t=class{constructor(s){P(this,e);if(Object.assign(this,Cs),s&&!("rules"in s)&&Object.keys(s).some(i=>os.includes(i)))this.rules=s;else{const{rules:i,...r}=s!=null?s:{};this.rules=i;for(const[n,l]of Object.entries(r))l!==void 0&&Object.prototype.hasOwnProperty.call(Cs,n)&&(this[n]=l)}}get rules(){return w(this,e)}set rules(s){E(this,e,new Proxy(new Zl(s),{set:en,deleteProperty(){return!1}}))}getSeverity(s,i){return w(this,e).getSeverity(s,i)}},e=new WeakMap,t)}}),ru={};oe(ru,{Title:()=>lu});var lu,pd=C({"lib/title.ts"(){"use strict";var e,t,s,i,r,n;Ke(),fe(),lu=(n=class{constructor(l,o,d,{temporary:a,decode:u,selfLink:c}={}){P(this,e);P(this,t);P(this,s);P(this,i);P(this,r);Ne(this,"valid");Ne(this,"encoded",!1);const p=l.trim().startsWith("../");if(u&&l.includes("%"))try{const b=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(l);l=cs(l),this.encoded=b}catch{}if(l=us(l).replace(/[_ ]+/gu," ").trim(),p)E(this,i,0);else{let b=o;l.startsWith(":")&&(b=0,l=l.slice(1).trim());const _=l.split(":");if(_.length>1){const A=Nt(_[0]),$=Object.prototype.hasOwnProperty.call(d.nsid,A)&&d.nsid[A];$&&(b=$,l=_.slice(1).join(":").trim())}E(this,i,b)}const m=l.indexOf("#");if(m!==-1){let b=l.slice(m).trim().slice(1);if(b.includes("%"))try{b=cs(b)}catch{}E(this,r,b.replace(/ /gu,"_")),l=l.slice(0,m).trim()}this.valid=!!(l||c&&this.ns===0&&w(this,r)!==void 0)&&us(l)===l&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(p?/^(?:\.\.\/)+(.*)/u.exec(l)[1]:l),this.main=l,E(this,t,d.namespaces),E(this,s,d.articlePath||"/wiki/$1"),w(this,s).includes("$1")||E(this,s,w(this,s)+`${w(this,s).endsWith("/")?"":"/"}$1`),a||Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}})}get ns(){return w(this,i)}get fragment(){return w(this,r)}get main(){return w(this,e)}set main(l){l=l.replace(/_/gu," ").trim(),E(this,e,l&&l[0].toUpperCase()+l.slice(1))}get prefix(){const l=w(this,t)[this.ns];return l+(l&&":")}get title(){return this.getRedirection()[1]}get extension(){const{main:l}=this,o=l.lastIndexOf(".");return o===-1?void 0:l.slice(o+1).toLowerCase()}getRedirection(){return[!1,(this.prefix+this.main).replace(/ /gu,"_")]}setFragment(l){E(this,r,l)}getUrl(l){{typeof l=="string"&&(E(this,s,l),w(this,s).includes("$1")||E(this,s,w(this,s)+`${w(this,s).endsWith("/")?"":"/"}$1`));const{title:o,fragment:d}=this;return o?w(this,s).replace("$1",encodeURIComponent(o)+(d?`#${encodeURIComponent(d)}`:"")):d===void 0?"":`#${encodeURIComponent(d)}`}throw new Error("Title.getUrl method is only available in the LSP version!")}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakMap,n)}}),ou={};oe(ou,{LanguageService:()=>au,isAttr:()=>Ps,tasks:()=>$n});var $n,eo,to,so,io,tn,no,ro,lo,oo,Ps,ao,sn,vt,nn,ze,ve,rn,ln,bt,wt,nt,Dt,on,uo,au,fd=C({"lib/lsp.ts"(){"use strict";var e,t,s,i,r,n,l,o,d,a,ns,Le,_n,Tn,Cn,uu,In,yt,T;Ke(),En(),qo(),K(),fe(),G(),$n=new WeakMap,eo=new Set(["ref"]),to=new Set(["ref","references"]),so=new Set(["name","follow"]),io=new Set(["group"]),tn=new Set(["arg-name","template-name","link-target","parameter-key"]),no=new Set(["ext","html","attr-key","image-parameter","heading-title","heading","magic-word-name",...tn]),ro=new Set(["text","comment","noinclude","include"]),lo=["ext","html","table"].map(f=>`${f}-attr#style`).join(),oo=at(f=>new RegExp(`^(?:${f}|//)`,"iu")),Ps=({type:f,parentNode:g,length:x,firstChild:v},h)=>f==="attr-value"&&x===1&&v.type==="text"&&(!h||g.name==="style"),ao=f=>f.is("html-attr")||f.is("table-attr"),sn=f=>f.childNodes.every(({type:g})=>ro.has(g)),vt=(f,g)=>{const{top:x,left:v}=f.posFromIndex(g);return{line:x,character:v}},nn=(f,g,x)=>({start:vt(f,g),end:vt(f,x)}),ze=f=>{const{top:g,left:x,height:v,width:h}=f.getBoundingClientRect();return{start:{line:g,character:x},end:hs(g,x,v,h)}},ve=(f,g,x,{line:v,character:h},S,y)=>[...new Set(f)].map(k=>{var I;const L=(I=y==null?void 0:y(k))==null?void 0:I.description;return{label:k,kind:g,textEdit:{range:{start:{line:v,character:h-x.length},end:{line:v,character:h}},newText:k+(S!=null?S:"")},...L&&{documentation:{kind:"markdown",value:L}}}}),rn=(f,g,{line:x,character:v})=>{const h=f.indexFromPos(x,v);return f.caretPositionFromIndex(h+Number(/\w/u.test(g.charAt(h))))},ln=(f,g,x)=>{const{type:v,parentNode:h={}}=f,{name:S,tag:y}=h;return v==="attr-value"&&g.has(y)&&x.has(S)?f.toString().trim():NaN},bt=f=>ln(f,eo,so),wt=f=>ln(f,to,io),nt=(f,g)=>{const x=f==null?void 0:f.getAttr(g);return x!==!0&&x||!1},Dt=f=>{const{type:g,name:x,parentNode:v}=f;switch(g){case"heading":return f.level;case"heading-title":return v.level;case"parameter-key":return`${v.parentNode.name}|${v.name}`;case"ext":case"html":case"image-parameter":return x;default:return v.name}},on=(f,g,x=!1)=>({range:nn(f,...g.range),newText:g.text,title:`${x?"Fix":"Suggestion"}: ${g.desc}`,fix:x}),uo=(f,g)=>{const{lintConfig:x}=N,{rules:v,fix:h,computeEditInfo:S}=x;if(x.fix=!0,x.computeEditInfo=!1,g){x.rules=void 0;for(const k of os)x.rules[k]=k===g?v[k]:0}const{output:y}=f.lint();return x.fix=h,x.computeEditInfo=S,g&&(x.rules=v),y===void 0?[]:[{range:ze(f),newText:y}]},au=(T=class{constructor(f){P(this,a);P(this,e);P(this,t);P(this,s);P(this,i);P(this,r);P(this,n);P(this,l);P(this,o);P(this,d);Ne(this,"include",!0);Ne(this,"config");Ne(this,"data");$n.set(f,this),Object.defineProperties(this,{config:{enumerable:!1},data:{enumerable:!1}})}destroy(){Object.setPrototypeOf(this,null)}async provideDocumentColors(f,g,x=!0){const v=await R(this,a,Le).call(this,g);return v.querySelectorAll("attr-value,parameter-value,arg-default").reverse().flatMap(h=>{const{type:S,childNodes:y}=h;return S!=="attr-value"&&!sn(h)?[]:y.filter(k=>k.type==="text").reverse().flatMap(k=>{const{data:L}=k,I=So(L,x).filter(([,,,B])=>B);if(I.length===0)return[];const j=k.getAbsoluteIndex();return I.map(([B,O,F])=>{const D=f(B);return D.length===4&&{color:{red:D[0]/255,green:D[1]/255,blue:D[2]/255,alpha:D[3]},range:nn(v,j+O,j+F)}}).filter(Boolean)})})}provideColorPresentations(f){const{color:{red:g,green:x,blue:v,alpha:h},range:S}=f,y=[g,x,v],k=h<1?`rgba(${y.map(L=>Math.round(L*255)).join()},${h})`:`#${y.map(yo).join("")}`;return[{label:k,textEdit:{range:S,newText:k}}]}async provideCompletionItems(f,g){var Q,se,ue,he,ne,Ce,Ie;const{re:x,allTags:v,functions:h,switches:S,protocols:y,params:k,tags:L,ext:I}=R(this,a,uu).call(this),{line:j,character:B}=g,O=f.split(/\r?\n/u,j+1)[j],F=x.exec((Q=O==null?void 0:O.slice(0,B))!=null?Q:""),[,,D={},W={}]=this.config.doubleUnderscore;if((F==null?void 0:F[1])!==void 0){const U=F[1].startsWith("/");return ve(v,"Class",F[1].slice(U?1:0),g,U&&!(O!=null&&O.slice(B).trim().startsWith(">"))?">":"")}else{if(F!=null&&F[4])return ve(S,"Constant",F[4],g,"",U=>{if(this.data)return U=U.slice(2,-2),U in D?U=D[U]:U in W&&(U=W[U]),R(this,a,In).call(this,U.toLowerCase())});if((F==null?void 0:F[5])!==void 0)return ve(y,"Reference",F[5],g)}const q=await R(this,a,Le).call(this,f);let z;if(F!=null&&F[2]){z=q.elementFromPoint(F.index+F[2].length-1,j);const U=(se=F[3])!=null?se:"";if(F[2]==="{{{")return ve(q.querySelectorAll("arg").filter(ee=>ee.name&&ee!==z).map(({name:ee})=>ee),"Variable",U,g);const[Z,ge]=this.config.parserFunction,xe=Array.isArray(ge),Te=O.charAt(B),Ue=U.startsWith(":"),ye=Ue?U.slice(1).trimStart():U;if(F[2]==="[[")return ve(q.querySelectorAll("link,file,category,redirect-target").filter(ee=>ee!==z).map(({name:ee})=>ee),"Folder",ye,g);let ft=h;return Te===":"?ft=h.filter(ee=>!ee.endsWith(":")):Te===":"&&(ft=h.filter(ee=>ee.endsWith(":")).map(ee=>ee.slice(0,-1))),[...ve(ft,"Function",U,g,"",ee=>{if(this.data)ee in Z?ee=Z[ee]:!xe&&ee in ge&&(ee=ge[ee]);else return;return R(this,a,yt).call(this,ee.toLowerCase())}),...U.startsWith("#")?[]:ve(q.querySelectorAll("template").filter(ee=>ee!==z).map(ee=>{const{name:et}=ee;if(Ue)return et;const{ns:Pt}=ee.getAttribute("title");return Pt===0?`:${et}`:Pt===10?et.slice(9):et}),"Folder",ye,g)]}let M,V;if((F==null?void 0:F[7])===void 0&&(z=q.elementFromPoint(B,j),{type:M,parentNode:V}=z),(F==null?void 0:F[6])!==void 0||M==="image-parameter"){const U=q.indexFromPos(j,B),Z=(he=(ue=F==null?void 0:F[6])==null?void 0:ue.trimStart())!=null?he:w(this,e).slice(z.getAbsoluteIndex(),U).trimStart(),ge=w(this,e)[U]==="=";return[...ve(k,"Property",Z,g).filter(({label:xe})=>!ge||!/[= ]$/u.test(xe)),...ve(q.querySelectorAll("image-parameter#width").filter(xe=>xe!==z).map(xe=>xe.text()),"Unit",Z,g)]}else if((F==null?void 0:F[7])!==void 0||M==="attr-key"){const U=(Ce=(ne=F==null?void 0:F[7])==null?void 0:ne.toLowerCase())!=null?Ce:V.tag,Z=(Ie=F==null?void 0:F[9])!=null?Ie:z.toString().slice(0,B-q.posFromIndex(z.getAbsoluteIndex()).left);if(!L.has(U))return;const ge=Gn[U],xe=Vn[U],Te=xe&&ve(xe,"Field",Z,g);return I.includes(U)&&!ge?Te:[...Te!=null?Te:[],...U==="meta"||U==="link"?[]:ve(Dn,"Property",Z,g),...ge?ve(ge,"Property",Z,g):[],...ve(["data-"],"Variable",Z,g),...ve(["xmlns:"],"Interface",Z,g)]}else if(M==="parameter-key"||M==="parameter-value"&&V.anon){const U=V.parentNode,{type:Z,name:ge}=U;if(Z==="magic-word"&&ge!=="invoke")return;const xe=w(this,e).slice(z.getAbsoluteIndex(),q.indexFromPos(j,B)).trimStart(),{module:Te,function:Ue}=U;return xe?ve(q.querySelectorAll("parameter").filter(ye=>ye===V||ye.anon||ye.parentNode.type!==Z||ye.parentNode.name!==ge?!1:Z==="template"?!0:ye.parentNode.module===Te&&ye.parentNode.function===Ue).map(({name:ye})=>ye),"Variable",xe,g,M==="parameter-value"?"=":""):void 0}else if(Ps(z)&&ao(V)){const U=qn(V.tag,V.name);if(U.length===0)return;const Z=w(this,e).slice(z.getAbsoluteIndex(),q.indexFromPos(j,B)).trimStart();return ve(U,"Value",Z,g)}}async provideDiagnostics(f,g=!0){const x=await R(this,a,Le).call(this,f),{lintConfig:v}=N,h=v.fix;v.fix=!1;const S=x.lint();return v.fix=h,[(g?S:S.filter(({severity:I})=>I==="error")).map(({startLine:I,startCol:j,endLine:B,endCol:O,severity:F,rule:D,message:W,fix:q,suggestions:z})=>({range:{start:{line:I,character:j},end:{line:B,character:O}},severity:F==="error"?1:2,source:"WikiLint",code:D,message:W,data:[...q?[on(x,q,!0)]:[],...z?z.map(M=>on(x,M)):[]]})),[],[]].flat(2)}resolveCodeAction(f){if(f.kind!=="source.fixAll")return f;const{rule:g}=f.data;return{...f,edit:{changes:{"":uo(w(this,r),g)}}}}async provideFoldingRanges(f){const g=await R(this,a,Le).call(this,f),{length:x}=g.getLines(),v=[],h=new Array(6),S=g.querySelectorAll("heading-title,table,template,magic-word");for(const y of[...S].reverse())y.getRelativeIndex();for(const y of S){const{offsetHeight:k}=y;if(y.type==="heading-title"||k>2){const{top:L}=g.posFromIndex(y.getAbsoluteIndex());if(y.type==="heading-title"){const{level:I}=y.parentNode;for(let j=I-1;j<6;j++){const B=h[j];B!==void 0&&B<L-1&&v.push({startLine:B,endLine:L-1,kind:"region"}),h[j]=void 0}h[I-1]=L+k-1}else v.push({startLine:L,endLine:L+k-2,kind:"region"})}}for(const y of h)y!==void 0&&y<x-1&&v.push({startLine:y,endLine:x-1,kind:"region"});return v}async provideLinks(f){var S;(S=this.config)!=null||(this.config=N.getConfig());const{articlePath:g,protocol:x}=this.config,v=g==null?void 0:g.includes("//"),h=oo(x);return(await R(this,a,Le).call(this,f)).querySelectorAll(`magic-link,ext-link-url,free-ext-link,attr-value,image-parameter#link${v?",link-target,template-name,invoke-module,magic-word#filepath,magic-word#widget":""}`).reverse().map(y=>{let k;y.is("magic-word")&&({name:k}=y,y=y.childNodes[1].lastChild);const{type:L,parentNode:I,firstChild:j,lastChild:B,childNodes:O,length:F}=y,{tag:D}=I;if(k!=null||(k=I.name),!(L!=="attr-value"||k==="src"&&["templatestyles","img"].includes(D)||k==="cite"&&["blockquote","del","ins","q"].includes(D))||!sn(y))return!1;let W=O.filter(q=>q.type==="text").map(({data:q})=>q).join("").trim();if(!W)return!1;try{if(y.is("magic-link")||y.is("ext-link-url")||y.is("free-ext-link"))W=y.getUrl(g);else if(L==="link-target"&&(I.is("link")||I.is("redirect-target")||I.is("category"))){if(W.startsWith("/"))return!1;W=I.link.getUrl(g)}else if(L==="template-name")W=I.getAttribute("title").getUrl(g);else if(["link-target","invoke-module","parameter-value"].includes(L)||L==="attr-value"&&k==="src"&&D==="templatestyles"||L==="image-parameter"&&!h.test(W)){if(!v||W.startsWith("/"))return!1;let q=0;switch(L){case"attr-value":q=10;break;case"invoke-module":q=828;break;case"parameter-value":q=k==="filepath"?6:274}const z=N.normalizeTitle(W,q,!1,this.config,{temporary:!0});if(!z.valid)return!1;W=z.getUrl()}if(typeof W=="string"&&W.startsWith("//")&&(W=`https:${W}`),W=new URL(W).href,L==="image-parameter"){const q=j.getBoundingClientRect(),{top:z,left:M,height:V,width:Q}=F===1?q:B.getBoundingClientRect();return{range:{start:{line:q.top,character:q.left},end:hs(z,M,V,Q)},target:W}}return{range:ze(y),target:W}}catch{return!1}}).filter(Boolean)}async provideReferences(f,g){const x=await R(this,a,Le).call(this,f),{offsetNode:v,offset:h}=rn(x,w(this,e),g),S=v.type==="text"?v.parentNode:v,y=h===0&&(S.type==="ext-attr-dirty"||S.type==="html-attr-dirty")?S.parentNode.parentNode:S,{type:k}=y,L=bt(y),I=wt(y);if(!L&&!I&&!no.has(k))return;const j=Dt(y),B=x.querySelectorAll(k==="heading-title"?"heading":k).filter(O=>k==="attr-value"?bt(O)===L||wt(O)===I:Dt(O)===j).reverse().map(O=>({range:ze(O.type==="parameter-key"?O.parentNode:O)}));return B.length===0?void 0:B}async provideDefinition(f,g){const x=await R(this,a,Le).call(this,f),v=x.elementFromPoint(g.character,g.line),h=v.is("ext")&&v.name==="ref"?v:v.closest("ext#ref"),S=nt(h,"name");if(!S)return;const y=nt(h,"group"),k=x.querySelectorAll("ext#ref").filter(L=>L.innerText&&nt(L,"name")===S&&nt(L,"group")===y).reverse().map(({lastChild:L})=>({range:ze(L)}));return k.length===0?void 0:k}async resolveRenameLocation(f,g){const x=await R(this,a,Le).call(this,f),v=x.elementFromPoint(g.character,g.line),{type:h}=v,S=bt(v),y=wt(v);return!S&&!y&&(!tn.has(h)||h==="parameter-key"&&/^[1-9]\d*$/u.test(v.parentNode.name)||h==="link-target"&&!["link","redirect-target"].includes(v.parentNode.type))?void 0:ze(v)}async provideRenameEdits(f,g,x){const v=await R(this,a,Le).call(this,f),h=v.elementFromPoint(g.character,g.line),{type:S}=h,y=bt(h),k=y&&nt(h.parentNode.parentNode,"group"),L=wt(h),I=Dt(h),j=v.querySelectorAll(S).filter(B=>{const{type:O}=B.parentNode;return S==="link-target"&&O!=="link"&&O!=="redirect-target"?!1:S==="attr-value"?wt(B)===L||bt(B)===y&&nt(B.parentNode.parentNode,"group")===k:Dt(B)===I});return j.length===0?void 0:{changes:{"":j.reverse().map(B=>({range:ze(B),newText:x}))}}}async provideHover(f,g){if(!this.data)return;const x=await R(this,a,Le).call(this,f);let{offsetNode:v,offset:h}=rn(x,w(this,e),g);v.type==="text"&&(h+=v.getRelativeIndex(),v=v.parentNode);const{type:S,parentNode:y,length:k,name:L}=v;let I,j,B,O;if(v.is("double-underscore")&&h>0)I=R(this,a,In).call(this,v.name);else if(S==="magic-word-name")I=R(this,a,yt).call(this,y.name),j=v.text().trim(),B=y.getAttribute("colon");else if(v.is("magic-word")&&!v.modifier&&k===1&&(h>0||x.posFromIndex(v.getAbsoluteIndex()).left===g.character))I=R(this,a,yt).call(this,L),j=v.firstChild.text().trim(),B=v.getAttribute("colon");else if((v.is("magic-word")||v.is("template"))&&v.modifier&&h>=2&&v.getRelativeIndex(0)>h&&(j=v.modifier.trim().slice(0,-1),I=R(this,a,yt).call(this,j.toLowerCase()),B=":",I)){const F=v.getAbsoluteIndex();O={start:vt(x,F+2),end:vt(x,F+v.modifier.trimEnd().length+1)}}return I&&{contents:{kind:"markdown",value:(I.signatures?`${I.signatures.map(F=>`- **{{ ${j}${F.length===0?"**":`${B}** `}${F.map(({label:D,const:W})=>W?D:`*${D}*`).join(" **|** ")} **}}**`).join(`
|
|
21
|
+
${u}`,d),n.push(d);continue}const[,_,A,k,T]=b;if(_){for(;!d.is("table");)d=n.pop();d.close(`
|
|
22
|
+
${c}${_}`,!0),a(T,n[n.length-1])}else if(A){d=Di(d,n),d.is("tr")&&(d=n.pop());const f=new _a(`
|
|
23
|
+
${c}${A}`,T,i,r);n.push(d,f),d.insertAt(f)}else{d=Di(d,n);const f=k==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu;let g=f.exec(T),x=0,v=`
|
|
24
|
+
${c}${k}`;const h=S=>{const y=new qs(v,T.slice(x,g==null?void 0:g.index),i,r);return S.insertAt(y),y};for(;g;)h(d),{lastIndex:x}=f,[v]=g,g=f.exec(T);n.push(d,h(d))}}return o.slice(1)}}}),Ct,La=C({"../cm-util/dist/index.mjs"(){"use strict";Ct=e=>!/^_{2}.+_{2}$/u.test(e)}}),Fa,sd=C({"src/nowiki/hr.ts"(){"use strict";pt(),Fa=class extends Oe{get type(){return"hr"}}}}),Gl,Gi,Vl,ss,id=C({"src/nowiki/doubleUnderscore.ts"(){"use strict";var e,t;gt(),Ze(),pt(),Gl=[Ye(),Ue("__")],ss=(t=class extends(Vl=Oe){constructor(i,r,n,l,o){var c,p;super(i,l,o);P(this,e);const d=i.toLowerCase(),{doubleUnderscore:[,,a,u]}=l;this.setAttribute("name",(p=r?(c=u==null?void 0:u[i])==null?void 0:c.toLowerCase():a==null?void 0:a[d])!=null?p:d),F(this,e,n)}get type(){return"double-underscore"}toString(){const i=w(this,e)?"__":"__";return i+this.innerText+i}print(){const i=w(this,e)?"__":"__";return super.print({pre:i,post:i})}},e=new WeakMap,t),Gi=ae(Vl),ss=le(Gi,0,"DoubleUnderscoreToken",Gl,ss),re(Gi,1,ss)}}),Ea={};oe(Ea,{parseHrAndDoubleUnderscore:()=>ja});var ja,nd=C({"parser/hrAndDoubleUnderscore.ts"(){"use strict";La(),sd(),id(),Qo(),ja=({firstChild:{data:e},type:t,name:s},i,r)=>{var a,u,c;const{doubleUnderscore:[n,l,o]}=i,d=[...n,...l];return(a=i.insensitiveDoubleUnderscore)!=null||(i.insensitiveDoubleUnderscore=new Set(n.filter(Ct))),(u=i.sensitiveDoubleUnderscore)!=null||(i.sensitiveDoubleUnderscore=new Set(l.filter(Ct))),(c=i.regexHrAndDoubleUnderscore)!=null||(i.regexHrAndDoubleUnderscore=new RegExp(`__(${d.filter(Ct).join("|")})__|_{2}(${d.filter(p=>!Ct(p)).map(p=>p.slice(2,-2)).join("|")})_{2}`,"giu")),t!=="root"&&(t!=="ext-inner"||s!=="poem")&&(e=`\0${e}`),e=e.replace(/^((?:\0\d+[cno]\x7F)*)(-{4,})/gmu,(p,m,b)=>(new Fa(b,i,r),`${m}\0${r.length-1}r`)).replace(i.regexHrAndDoubleUnderscore,(p,m,b)=>{var f;const _=m!=null?m:b,A=i.sensitiveDoubleUnderscore.has(_),k=_.toLowerCase(),T=i.insensitiveDoubleUnderscore.has(k);return A||T?(new ss(_,A,!!b,i,r),`\0${r.length-1}${T&&((f=o==null?void 0:o[k])!=null?f:k)==="toc"?"u":"n"}`):p}),i.excludes.includes("heading")||(e=e.replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(p,m,b,_,A)=>{const k=`${m}\0${r.length}h`;return new St(b.length,[_,A],i,r),k})),t==="root"||t==="ext-inner"&&s==="poem"?e:e.slice(1)}}}),Ra,rd=C({"src/nowiki/quote.ts"(){"use strict";var e,t;K(),me(),G(),pt(),Ra=(t=class extends Oe{constructor(i,r,n,l){super(i,n,l);P(this,e);F(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:w(this,e).bold}:void 0,...this.italic?{italic:w(this,e).italic}:void 0}}text(){const{parentNode:i,innerText:r}=this;return i!=null&&i.is("image-parameter")&&i.name!=="caption"?"":r}lint(i=this.getAbsoluteIndex()){var r;{const{previousSibling:n,bold:l,closing:o}=this,d=(n==null?void 0:n.type)==="text"?n.data:void 0,a=[],u=new ce(this,i),c=["lonely-apos","bold-header"],{lintConfig:p}=N,{computeEditInfo:m}=p,b=[void 0,"word"].map(A=>p.getSeverity(c[0],A)),_=p.getSeverity(c[1]);if(d!=null&&d.endsWith("'")){const A=b[(o.bold||o.italic)&&/[a-z\d]'$/iu.test(d)?1:0];if(A){const k=Y(this,u,c[0],N.msg("lonely","'"),A),{startLine:T,startCol:f}=k,[,{length:g}]=/(?:^|[^'])('+)$/u.exec(d),x=i-g,v={...k,startIndex:x,endIndex:i,endLine:T,startCol:f-g,endCol:f};m&&(v.suggestions=[Et(x,"'",g),Z(v)]),a.push(v)}}if(_&&l&&((r=this.closest("heading-title,ext"))==null?void 0:r.type)==="heading-title"){const A=Y(this,u,c[1],"bold-in-header",_);m&&(A.suggestions=[Z(A)]),a.push(A)}return a}}json(i,r=this.getAbsoluteIndex()){{const n=super.json(void 0,r);return Object.assign(n,{bold:this.bold,italic:this.italic}),n}}},e=new WeakMap,t)}}),Pa={};oe(Pa,{parseQuotes:()=>rr});var rr,Oa=C({"parser/quotes.ts"(){"use strict";rd(),rr=(e,t,s,i)=>{var m;const r=e.split(/('{2,})/u),{length:n}=r;if(n===1)return e;let l=0,o=0,d,a,u;for(let b=1;b<n;b+=2){const _=r[b].length;switch(_){case 2:o++;break;case 4:r[b-1]+="'",r[b]="'''";case 3:if(l++,d!==void 0)break;r[b-1].endsWith(" ")?a===void 0&&u===void 0&&(u=b):r[b-1].slice(-2,-1)===" "?d=b:a!=null||(a=b);break;default:r[b-1]+="'".repeat(_-5),r[b]="'''''",o++,l++}}if(o%2===1&&l%2===1){const b=(m=d!=null?d:a)!=null?m:u;b!==void 0&&(r[b]="''",r[b-1]+="'")}let c=!0,p=!0;for(let b=1;b<n;b+=2){const _=r[b].length,A=_!==2,k=_!==3;A&&(c=!c),k&&(p=!p),new Ra(r[b],{bold:A&&c,italic:k&&p},t,s),r[b]=`\0${s.length-1}q`}return r.join("")}}}),Ba={};oe(Ba,{parseExternalLinks:()=>lr});var lr,qa=C({"parser/externalLinks.ts"(){"use strict";fe(),ca(),tr(),lr=(e,t,s,i)=>{var r;return(r=t.regexExternalLinks)!=null||(t.regexExternalLinks=new RegExp(String.raw`\[((?:\0\d+[cn]\x7F)*(?:\0\d+f\x7F|(?:(?:${t.protocol}|//)${It}|\0\d+m\x7F)${Nt}(?=[[\]<>"\t${Qe}]|\0\d)))([${Qe}]*(?![${Qe}]))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),e.replace(t.regexExternalLinks,(n,l,o,d)=>{const{length:a}=s,u=/&[lg]t;/u.exec(l);return u&&(o="",d=l.slice(u.index)+o+d,l=l.slice(0,u.index)),i?(new fs(l,"ext-link-url",t,s),`[\0${a}f${o}${d}]`):(new kt(l,o,d,t,s),`\0${a}w`)})}}}),Wa,ld=C({"src/link/category.ts"(){"use strict";fe(),zs(),Wa=class extends Ge{get type(){return"category"}get sortkey(){{const{childNodes:[,e]}=this;return e&&ds(e.text())}}json(e,t=this.getAbsoluteIndex()){{const s=super.json(void 0,t),{sortkey:i}=this;return i&&(s.sortkey=i),s}}}}}),Ua={};oe(Ua,{parseLinks:()=>kn});var Ql,kn,od=C({"parser/links.ts"(){"use strict";fe(),G(),Oa(),qa(),da(),na(),ld(),Ql=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)([\s\S]*)$/u,kn=(e,t,s,i)=>{var o;(o=t.regexLinks)!=null||(t.regexLinks=new RegExp(String.raw`^\s*(?:${t.protocol}|//)`,"iu"));const r=t.inExt?/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]]))?\]\]([\s\S]*)$/u:/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])*)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]])?)?\]\]([\s\S]*)$/u,n=e.split("[[");let l=n.shift();for(let d=0;d<n.length;d++){let a=!1,u,c,p,m;const b=n[d],_=r.exec(b);if(_)[,u,c,p,m]=_,m.startsWith("]")&&(p!=null&&p.includes("["))&&(p+="]",m=m.slice(1));else{const x=Ql.exec(b);x&&(a=!0,[,u,c,p]=x)}if(u===void 0||t.regexLinks.test(u)||/\0\d+[exhbru]\x7F/u.test(u)){l+=`[[${b}`;continue}let A=_e(u).trim();const k=A.startsWith(":");if(k&&a){l+=`[[${b}`;continue}else!A&&p&&!p.includes(`
|
|
25
|
+
`)&&(A=_e(p).trim());const{ns:T,valid:f}=N.normalizeTitle(A,0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0});if(f){if(a){if(T!==6){l+=`[[${b}`;continue}let x=!1;for(d++;d<n.length;d++){const v=n[d],h=v.split("]]");if(h.length>2){x=!0,p+=`[[${h[0]}]]${h[1]}`,m=h.slice(2).join("]]");break}else if(h.length===2)p+=`[[${h[0]}]]${h[1]}`;else{p+=`[[${v}`;break}}if(p=kn(p,t,s,i),!x){l+=`[[${u}${c}${p}`;continue}}}else{l+=`[[${b}`;continue}p&&(p=rr(p,t,s,i));let g=er;k||(T===6?(p&&(p=lr(p,t,s,!0)),g=Zn):T===14&&(g=Wa)),p===void 0&&c&&(p=""),l+=`\0${s.length}l${m}`,new g(u,p,t,s,c)}return l}}}),Ma={};oe(Ma,{parseMagicLinks:()=>za});var Vi,Qi,Ji,Xi,za,ad=C({"parser/magicLinks.ts"(){"use strict";fe(),tr(),Vi=String.raw`[${Qe}\t]| |�*160;|�*a0;`,Qi=`(?:${Vi})+`,Ji=`(?:${Vi}|-)`,Xi=String.raw`(?:RFC|PMID)${Qi}\d+\b|ISBN${Qi}(?:97[89]${Ji}?)?(?:\d${Ji}?){9}[\dx]\b`,za=(e,t,s)=>{if(!t.regexMagicLinks)try{t.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${t.protocol})(${It}${Nt})|${Xi})`,"giu")}catch{t.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${t.protocol})(${It}${Nt})|${Xi})`,"giu")}return e.replace(t.regexMagicLinks,(i,r,n)=>{let l=r?i.slice(r.length):i;if(n){let o="";const d=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(l);d&&(o=l.slice(d.index),l=l.slice(0,d.index));const a=l.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,u=a.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),o=l.slice(u.index+c)+o,l=l.slice(0,u.index+c)}return o.length>=n.length?i:(new fs(l,void 0,t,s),`${r}\0${s.length-1}w${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(l))return i;return new fs(l,"magic-link",t,s),`${r}\0${s.length-1}i`})}}}),Ha,ud=C({"util/html.ts"(){"use strict";Ha=(e,t)=>e.startsWith(t)?t.length:[...t].findIndex((s,i)=>s!==e[i])}}),Da,dd=C({"src/nowiki/list.ts"(){"use strict";Ta(),Da=class extends ir{get type(){return"list"}}}}),Ga={};oe(Ga,{parseList:()=>Va});var Va,cd=C({"parser/list.ts"(){"use strict";ud(),dd(),Ca(),Va=(e,t,s,i)=>{const r=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(e);if(!r)return t.lastPrefix="",e;const[n,l,o,d]=r,a=o.replace(/;/gu,":"),u=Ha(a,t.lastPrefix),c=((u>1?o.slice(u-1):o)+d).split(/(?=;)/u),p=c[0].startsWith(";");let m=c.length-(p?0:1);if(u>1){const $=o.slice(0,u-1);if(p){const L=$.split(/(?=;)/u);c.unshift(...L),m+=$.includes(";")?L.length:0}else c[0]=$+c[0]}t.lastPrefix=a;let b=l+c.map(($,L)=>`\0${i.length+L}d`).join("")+e.slice(n.length);for(const $ of c)new Da($,s,i);if(!m)return b;const{html:[_,,A]}=s,k=/:+|-\{|\0\d+[xq]\x7F/gu;let T=k,f=T.exec(b),g=0,x=!1,v=!1,h=0;const S=($,L)=>(new nr($,s,i),`${b.slice(0,L)}\0${i.length-1}d${b.slice(L+$.length)}`),y=$=>{$?g&&g--:g++};for(;f&&m;){const{0:$,index:L}=f;if($==="-{"){if(!h){const{lastIndex:I}=T;T=/-\{|\}-/gu,T.lastIndex=I}h++}else if($==="}-"){if(h--,!h){const{lastIndex:I}=T;T=k,T.lastIndex=I}}else if($.endsWith("x")){const{name:I,closing:j,selfClosing:B}=i[Number($.slice(1,-2))];(_.includes(I)||!B&&!A.includes(I))&&y(j)}else if($.endsWith("q")){const{bold:I,italic:j}=i[Number($.slice(1,-2))];I&&(y(x),x=!x),j&&(y(v),v=!v)}else if(g===0){if($.length>=m)return S($.slice(0,m),L);m-=$.length,T.lastIndex=L+4+String(i.length).length,b=S($,L)}f=T.exec(b)}return b}}}),Cs,Jl,Ki,Xl,is,hd=C({"src/converterFlags.ts"(){"use strict";var e,t;K(),me(),Ms(),G(),X(),ct(),Cs=new Set(["A","T","R","D","-","H","N"]),Jl=[xs()],is=(t=class extends(Xl=H){constructor(i,r,n=[]){super(void 0,r,n,{});P(this,e);this.safeAppend(i.map(l=>new $e(l,"converter-flag",r,n)))}get type(){return"converter-flags"}afterBuild(){F(this,e,this.childNodes.map(i=>i.text().trim())),super.afterBuild()}toString(i){return super.toString(i,";")}text(){return super.text(";")}getUnknownFlags(){return new Set(w(this,e).filter(i=>/\{{3}[^{}]+\}{3}/u.test(i)))}getVariantFlags(){const i=new Set(this.getAttribute("config").variants);return new Set(w(this,e).filter(r=>i.has(r)))}isInvalidFlag(i,r,n,l){return typeof i=="object"&&(i=i.text().trim(),r=this.getVariantFlags(),n=this.getUnknownFlags(),l=new Set(w(this,e).filter(o=>Cs.has(o)))),!!i&&!r.has(i)&&!n.has(i)&&(r.size>0||!l.has(i))}lint(i=this.getAbsoluteIndex(),r){{const n=this.getVariantFlags(),l=this.getUnknownFlags(),o=new Set(w(this,e).filter(A=>Cs.has(A))),d=w(this,e).filter(A=>!A).length,a=w(this,e).length-l.size-d,{lintConfig:u}=N,{computeEditInfo:c,fix:p}=u,m=super.lint(i,r);if(n.size===a||o.size===a)return m;const b="no-ignored",_=u.getSeverity(b,"conversionFlag");if(_){const A=new ce(this,i);for(let k=0;k<this.length;k++){const T=this.childNodes[k],f=T.text().trim();if(this.isInvalidFlag(f,n,l,o)){const g=J(T,A,b,"invalid-conversion-flag",_);(c||p)&&(n.size===0&&Cs.has(f.toUpperCase())?g.fix=Bn(g,f):c&&(g.suggestions=[Z(g,k&&-1)])),m.push(g)}}}return m}}print(){return super.print({sep:";"})}},e=new WeakMap,t),Ki=ae(Xl),is=le(Ki,0,"ConverterFlagsToken",Jl,is),re(Ki,1,is)}}),Ps,gd=C({"src/converterRule.ts"(){"use strict";G(),X(),ct(),Ps=class extends H{get type(){return"converter-rule"}get variant(){var e,t;return(t=(e=this.childNodes[this.length-2])==null?void 0:e.text().trim().toLowerCase())!=null?t:""}constructor(e,t=!0,s=N.getConfig(),i=[]){super(void 0,s,i);const r=e.indexOf(":"),n=e.slice(0,r).indexOf("=>"),l=n===-1?e.slice(0,r):e.slice(n+2,r);t&&s.variants.includes(l.trim().toLowerCase())?(super.insertAt(new $e(l,"converter-rule-variant",s,i)),super.insertAt(new $e(e.slice(r+1),"converter-rule-to",s,i)),n!==-1&&super.insertAt(new $e(e.slice(0,n),"converter-rule-from",s,i),0)):super.insertAt(new $e(e,"converter-rule-to",s,i))}toString(e){const{childNodes:t,firstChild:s,lastChild:i}=this;return t.length===3?`${s.toString(e)}=>${t[1].toString(e)}:${i.toString(e)}`:super.toString(e,":")}text(){const{childNodes:e,firstChild:t,lastChild:s}=this;return e.length===3?`${t.text()}=>${e[1].text()}:${s.text()}`:super.text(":")}getGaps(e){return e===0&&this.length===3?2:1}print(){const{childNodes:e}=this;if(e.length===3){const[t,s,i]=e;return`<span class="wpb-converter-rule">${t.print()}=>${s.print()}:${i.print()}</span>`}return super.print({sep:":"})}json(e,t=this.getAbsoluteIndex()){{const s=super.json(void 0,t);return s.variant=this.variant,s}}}}}),Kl,Yi,Yl,ns,pd=C({"src/converter.ts"(){"use strict";fe(),Ze(),We(),X(),hd(),gd(),Kl=[Be,Ue("-{")],ns=class extends(Yl=H){get type(){return"converter"}constructor(e,t,s,i=[]){super(void 0,s,i),this.insertAt(new is(e,s,i));const[r]=t,n=r.includes(":"),l=new Ps(r,n,s,i);n&&l.length===1||!n&&t.length===2&&!_e(t[1]).trim()?this.insertAt(new Ps(t.join(";"),!1,s,i)):this.append(l,...t.slice(1).map(o=>new Ps(o,!0,s,i)))}toString(e){const{childNodes:[t,...s]}=this;return`-{${t.toString(e)}${t.length>0?"|":""}${s.map(i=>i.toString(e)).join(";")}}-`}text(){const{childNodes:[e,...t]}=this;return`-{${e.text()}|${dt(t,";")}}-`}getGaps(e){return e||this.firstChild.length>0?1:0}print(){const{childNodes:[e,...t]}=this;return`<span class="wpb-converter">-{${e.print()}${e.length>0?"|":""}${Ft(t,{sep:";"})}}-</span>`}},Yi=ae(Yl),ns=le(Yi,0,"ConverterToken",Kl,ns),re(Yi,1,ns)}}),Qa={};oe(Qa,{parseConverter:()=>Ja});var Ja,fd=C({"parser/converter.ts"(){"use strict";pd(),Ja=(e,t,s)=>{var d;(d=t.regexConverter)!=null||(t.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${t.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"iu"));const i=/-\{/gu,r=/-\{|\}-/gu,n=[];let l=i,o=l.exec(e);for(;o;){const{0:a,index:u}=o;if(a==="}-"){const c=n.pop(),{length:p}=s,m=e.slice(c.index+2,u),b=m.indexOf("|"),[_,A]=b===-1?[[],m]:[m.slice(0,b).split(";"),m.slice(b+1)],k=A.replace(/(&[#a-z\d]+);/giu,"$1"),T=k.split(t.regexConverter).map(f=>f.replace(/\x01/gu,";"));new ns(_,T,t,s),e=`${e.slice(0,c.index)}\0${p}v${e.slice(u+2)}`,n.length===0&&(l=i),l.lastIndex=c.index+3+String(p).length}else n.push(o),l=r,l.lastIndex=u+2;o=l.exec(e)}return e}}}),os={};oe(os,{Token:()=>H});var Zl,H,X=C({"src/index.ts"(){"use strict";var e,t,s,i,r,n,l,o,Xa,Ka,Ya,Za,eu,tu,su,iu,nu,ru,lu,ou,g;fe(),Xe(),K(),je(),G(),Iu(),Lu(),Zl=["category","html-attr#id,ext-attr#id,table-attr#id"],H=(g=class extends Qt{constructor(h,S=N.getConfig(),y=[],$){super();P(this,o);P(this,e,"plain");P(this,t,0);P(this,s);P(this,i);P(this,r);P(this,n,!1);P(this,l);typeof h=="string"&&this.insertAt(h),F(this,s,S),F(this,i,y),y.push(this)}get type(){return w(this,e)}set type(h){F(this,e,h)}parseOnce(h=w(this,t),S=!1,y){if(h<w(this,t)||this.length===0||!this.isPlain())return this;if(w(this,t)>=Ae)return this;switch(h){case 0:if(this.type==="root"){w(this,i).pop();const $=R(this,o,Xa).call(this);S&&(S=!$)}F(this,r,S),R(this,o,Ka).call(this,S);break;case 1:R(this,o,Ya).call(this);break;case 2:R(this,o,Za).call(this);break;case 3:R(this,o,eu).call(this);break;case 4:R(this,o,tu).call(this);break;case 5:R(this,o,su).call(this,y);break;case 6:R(this,o,iu).call(this,y);break;case 7:R(this,o,nu).call(this);break;case 8:R(this,o,ru).call(this);break;case 9:R(this,o,lu).call(this);break;case 10:R(this,o,ou).call(this)}if(this.type==="root")for(const $ of w(this,i))$==null||$.parseOnce(h,S,y);return ur(this,t)._++,this}buildFromStr(h,S){const y=h.split(/[\0\x7F]/u).map(($,L)=>{if(L%2===0)return new fn($);if(isNaN($.slice(-1)))return w(this,i)[Number($.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${$}`)});return S===0?y.map(String).join(""):S===1?dt(y):y}build(){F(this,t,Ae);const{length:h,firstChild:S}=this,y=S==null?void 0:S.toString();if(h===1&&S.type==="text"&&y.includes("\0")&&(ms(this,0,1,this.buildFromStr(y)),this.normalize(),this.type==="root"))for(const $ of w(this,i))$==null||$.build()}afterBuild(){if(this.type==="root")for(const h of w(this,i))h==null||h.afterBuild();F(this,n,!0)}parse(h=Ae,S,y){for(h=Math.min(h,Ae);w(this,t)<h;)this.parseOnce(w(this,t),S,y);return h&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===g}getAttribute(h){var S;switch(h){case"config":return w(this,s);case"include":return(S=w(this,r))!=null?S:!!w(this.getRootNode(),r);case"accum":return w(this,i);case"built":return w(this,n);case"stage":return w(this,t);case"invalid":return this.type==="table-inter"&&ls(this)===2;default:return super.getAttribute(h)}}setAttribute(h,S){switch(h){case"stage":w(this,t)===0&&this.type==="root"&&w(this,i).shift(),F(this,t,S);break;default:super.setAttribute(h,S)}}insertAt(h,S=this.length){const y=typeof h=="string"?new fn(h):h;super.insertAt(y,S);const{type:$}=y;return $==="root"&&(y.type="plain"),y}normalizeTitle(h,S=0,y){return N.normalizeTitle(h,S,w(this,r),w(this,s),y)}inTableAttrs(){var h,S;return((h=this.closest("table-attrs,ext"))==null?void 0:h.type)==="table-attrs"&&((S=this.closest("table-attrs,arg,magic-word,template"))!=null&&S.is("table-attrs")?2:1)}inHtmlAttrs(){var h;return(h=this.closest("html-attrs,ext"))!=null&&h.is("html-attrs")?2:this.inTableAttrs()}lint(h=this.getAbsoluteIndex(),S){var y;{const{lintConfig:$}=N,{computeEditInfo:L,fix:I,ignoreDisables:j,configurationComment:B}=$;let O=super.lint(h,S);if(this.type==="root"){const E=new Map,D="no-duplicate",W=["category","id"].map(U=>$.getSeverity(D,U)),q=this.toString(),z=Zl.filter((U,V)=>W[V]).join();if(z){for(const U of this.querySelectorAll(z)){let V;if(U.is("category"))V=U.name;else{const Q=U.getValue();Q&&Q!==!0&&(V=`#${Q}`)}if(V){const Q=E.get(V);Q?Q.add(U):E.set(V,new Set([U]))}}for(const[U,V]of E)if(V.size>1&&!U.startsWith("#mw-customcollapsible-")){const Q=!U.startsWith("#"),ie=`duplicate-${Q?"category":"id"}`,ue=W[Q?0:1];O.push(...[...V].map(he=>{const ne=Y(he,{start:he.getAbsoluteIndex()},D,ie,ue);return L&&Q&&(ne.suggestions=[Z(ne)]),ne}))}}if(!j){const U=new RegExp(String.raw`<!--\s*${B}-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->`,"gu"),V=[];let Q=U.exec(q);for(;Q;){const{1:ie,index:ue}=Q,he=(y=Q[2])==null?void 0:y.trim();V.push({line:this.posFromIndex(ue).top+(ie==="disable-line"?0:1),from:ie==="disable"?U.lastIndex:void 0,to:ie==="enable"?U.lastIndex:void 0,rules:he?new Set(he.split(",").map(ne=>ne.trim())):void 0}),Q=U.exec(q)}O=O.filter(({rule:ie,startLine:ue,startIndex:he})=>{const ne={pos:0};for(const{line:Ce,from:Ie,to:M,rules:ee}of V){if(Ce>ue+1)break;if(ee&&!ee.has(ie))continue;if(Ce===ue&&Ie===void 0&&M===void 0)return!1;Ie<=he&&Ie>ne.pos?(ne.pos=Ie,ne.type="from"):M<=he&&M>ne.pos&&(ne.pos=M,ne.type="to")}return ne.type!=="from"})}if(I&&O.some(({fix:U})=>U)){const U=O.map(({fix:ie})=>ie).filter(Boolean).sort(({range:[ie,ue]},{range:[he,ne]})=>ue===ne?he-ie:ne-ue);let V=1/0,Q=q;for(const{range:[ie,ue],text:he}of U)ue<=V&&(Q=Q.slice(0,ie)+he+Q.slice(ue),V=ie);Object.assign(O,{output:Q})}if(!L)for(const U of O)delete U.fix,delete U.suggestions}return O}}toString(h,S){return h?super.toString(!0,S):ut(w(this,l),()=>super.toString(!1,S),y=>{const $=this.getRootNode();$.type==="root"&&w($,n)&&F(this,l,y)})}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakMap,n=new WeakMap,l=new WeakMap,o=new WeakSet,Xa=function(){const{parseRedirect:h}=(ju(),se(Ro)),S=this.firstChild.toString(),y=h(S,w(this,s),w(this,i));return y&&this.setText(y),!!y},Ka=function(h){const{parseCommentAndExt:S}=(Qs(),se(wa));this.setText(S(this.firstChild.toString(),w(this,s),w(this,i),h))},Ya=function(){const{parseBraces:h}=(Yn(),se(Xo)),S=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,y=h(S,w(this,s),w(this,i));this.setText(this.type==="root"?y:y.slice(1))},Za=function(){if(w(this,s).excludes.includes("html"))return;const{parseHtml:h}=(Yu(),se(ya));this.setText(h(this.firstChild.toString(),w(this,s),w(this,i)))},eu=function(){if(w(this,s).excludes.includes("table"))return;const{parseTable:h}=(td(),se(Ia));this.setText(h(this,w(this,s),w(this,i)))},tu=function(){if(w(this,s).excludes.includes("hr"))return;const{parseHrAndDoubleUnderscore:h}=(nd(),se(Ea));this.setText(h(this,w(this,s),w(this,i)))},su=function(h){const{parseLinks:S}=(od(),se(Ua));this.setText(S(this.firstChild.toString(),w(this,s),w(this,i),h))},iu=function(h){if(w(this,s).excludes.includes("quote"))return;const{parseQuotes:S}=(Oa(),se(Pa)),y=this.firstChild.toString().split(`
|
|
26
|
+
`);for(let $=0;$<y.length;$++)y[$]=S(y[$],w(this,s),w(this,i),h);this.setText(y.join(`
|
|
27
|
+
`))},nu=function(){if(w(this,s).excludes.includes("extLink"))return;const{parseExternalLinks:h}=(qa(),se(Ba));this.setText(h(this.firstChild.toString(),w(this,s),w(this,i)))},ru=function(){if(w(this,s).excludes.includes("magicLink"))return;const{parseMagicLinks:h}=(ad(),se(Ma));this.setText(h(this.firstChild.toString(),w(this,s),w(this,i)))},lu=function(){if(w(this,s).excludes.includes("list"))return;const{parseList:h}=(cd(),se(Ga)),{firstChild:S,type:y,name:$}=this,L=S.toString().split(`
|
|
28
|
+
`),I={lastPrefix:""};let j=y==="root"||y==="ext-inner"&&$==="poem"?0:1;for(;j<L.length;j++)L[j]=h(L[j],I,w(this,s),w(this,i));this.setText(L.join(`
|
|
29
|
+
`))},ou=function(){if(w(this,s).variants.length>0){const{parseConverter:h}=(fd(),se(Qa));this.setText(h(this.firstChild.toString(),w(this,s),w(this,i)))}},g)}}),xe,Js,ms,je=C({"util/debug.ts"(){"use strict";xe={running:!1,run(e){const{running:t}=this;this.running=!0;try{const{Token:s}=(X(),se(os)),i=e();return i instanceof s&&!i.getAttribute("built")&&i.afterBuild(),this.running=t,i}catch(s){throw this.running=t,s}},rev:0},Js=e=>t=>t.type===e,ms=(e,t,s,i=[])=>{var l,o;let r=e.getChildNodes(),n;r.length===s?(n=r,r=i):n=r.splice(t,s,...i);for(let d=0;d<i.length;d++){const a=i[d];a.setAttribute("parentNode",e),a.setAttribute("nextSibling",r[t+d+1]),a.setAttribute("previousSibling",r[t+d-1])}return(l=r[t-1])==null||l.setAttribute("nextSibling",r[t]),(o=r[t+i.length])==null||o.setAttribute("previousSibling",r[t+i.length-1]),r===i&&e.setAttribute("childNodes",r),n}}}),xt,Zi,Is,en,eo,tn,to,$n,md=C({"lib/lintConfig.ts"(){"use strict";var e,t;jn(),xt=new Map([[0,!1],[1,"warning"],[2,"error"],[!1,!1],["off",!1],["warning","warning"],["error","error"]]),Zi={"bold-header":[1,{}],"format-leakage":[1,{}],"fostered-content":[1,{}],h1:[1,{}],"illegal-attr":[2,{}],"insecure-style":2,"invalid-gallery":[2,{parameter:1}],"invalid-imagemap":[2,{}],"invalid-invoke":[2,{}],"invalid-isbn":2,"invalid-url":1,"lonely-apos":[1,{}],"lonely-bracket":[1,{extLink:2}],"lonely-http":[1,{}],"nested-link":[2,{}],"no-arg":1,"no-duplicate":[2,{category:1,id:1,unknownImageParameter:1}],"no-ignored":[2,{fragment:1,galleryComment:1,galleryNoImage:1,include:1,nonWordAttributes:1,redirect:1}],"obsolete-attr":1,"obsolete-tag":1,"parsing-order":[2,{templateInTable:1}],"pipe-like":[1,{double:2}],"table-layout":1,"tag-like":[2,{disallowed:1,invalid:1}],"unbalanced-header":2,"unclosed-comment":[1,{}],"unclosed-quote":1,"unclosed-table":2,unescaped:2,"unknown-page":1,"unmatched-tag":[1,{both:2,selfClosing:2}],"unterminated-url":[1,{}],"url-encoding":[1,{}],"var-anchor":[1,{}],"void-ext":[2,{}]},Object.freeze(Zi),Is={configurationComment:"lint",ignoreDisables:!1,fix:!0,computeEditInfo:!0},Object.freeze(Is),en=s=>xt.has(s),eo=s=>en(s)||Array.isArray(s)&&en(s[0])&&(s.length===1||typeof s[1]=="object"),tn=(s,i,r)=>{if(as.includes(i)){if(r===void 0)return!1;if(eo(r))return s[i]=r,!0}else throw new RangeError(`Unknown lint rule: ${i}`);throw new RangeError(`Invalid lint config for ${i}: ${JSON.stringify(r)}`)},to=class{constructor(s){if(Object.assign(this,JSON.parse(JSON.stringify(Zi))),!!s)for(const[i,r]of Object.entries(s))tn(this,i,r)}getSeverity(s,i){var n,l;const r=this[s];return typeof r!="object"?xt.get(r):i&&(l=xt.get((n=r[1])==null?void 0:n[i]))!=null?l:xt.get(r[0])}},$n=(t=class{constructor(s){P(this,e);if(Object.assign(this,Is),s&&!("rules"in s)&&Object.keys(s).some(i=>as.includes(i)))this.rules=s;else{const{rules:i,...r}=s!=null?s:{};this.rules=i;for(const[n,l]of Object.entries(r))l!==void 0&&Object.prototype.hasOwnProperty.call(Is,n)&&(this[n]=l)}}get rules(){return w(this,e)}set rules(s){F(this,e,new Proxy(new to(s),{set:tn,deleteProperty(){return!1}}))}getSeverity(s,i){return w(this,e).getSeverity(s,i)}},e=new WeakMap,t)}}),au={};oe(au,{Title:()=>uu});var uu,xd=C({"lib/title.ts"(){"use strict";var e,t,s,i,r,n;Ke(),fe(),uu=(n=class{constructor(l,o,d,{temporary:a,decode:u,selfLink:c}={}){P(this,e);P(this,t);P(this,s);P(this,i);P(this,r);Ne(this,"valid");Ne(this,"encoded",!1);const p=l.trim().startsWith("../");if(u&&l.includes("%"))try{const b=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(l);l=hs(l),this.encoded=b}catch{}if(l=ds(l).replace(/[_ ]+/gu," ").trim(),p)F(this,i,0);else{let b=o;l.startsWith(":")&&(b=0,l=l.slice(1).trim());const _=l.split(":");if(_.length>1){const A=Lt(_[0]),k=Object.prototype.hasOwnProperty.call(d.nsid,A)&&d.nsid[A];k&&(b=k,l=_.slice(1).join(":").trim())}F(this,i,b)}const m=l.indexOf("#");if(m!==-1){let b=l.slice(m).trim().slice(1);if(b.includes("%"))try{b=hs(b)}catch{}F(this,r,b.replace(/ /gu,"_")),l=l.slice(0,m).trim()}this.valid=!!(l||c&&this.ns===0&&w(this,r)!==void 0)&&ds(l)===l&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(p?/^(?:\.\.\/)+(.*)/u.exec(l)[1]:l),this.main=l,F(this,t,d.namespaces),F(this,s,d.articlePath||"/wiki/$1"),w(this,s).includes("$1")||F(this,s,w(this,s)+`${w(this,s).endsWith("/")?"":"/"}$1`),a||Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}})}get ns(){return w(this,i)}get fragment(){return w(this,r)}get main(){return w(this,e)}set main(l){l=l.replace(/_/gu," ").trim(),F(this,e,l&&l[0].toUpperCase()+l.slice(1))}get prefix(){const l=w(this,t)[this.ns];return l+(l&&":")}get title(){return this.getRedirection()[1]}get extension(){const{main:l}=this,o=l.lastIndexOf(".");return o===-1?void 0:l.slice(o+1).toLowerCase()}getRedirection(){return[!1,(this.prefix+this.main).replace(/ /gu,"_")]}setFragment(l){F(this,r,l)}getUrl(l){{typeof l=="string"&&(F(this,s,l),w(this,s).includes("$1")||F(this,s,w(this,s)+`${w(this,s).endsWith("/")?"":"/"}$1`));const{title:o,fragment:d}=this;return o?w(this,s).replace("$1",encodeURIComponent(o)+(d?`#${encodeURIComponent(d)}`:"")):d===void 0?"":`#${encodeURIComponent(d)}`}throw new Error("Title.getUrl method is only available in the LSP version!")}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakMap,n)}}),du={};oe(du,{LanguageService:()=>cu,isAttr:()=>Os,tasks:()=>_n});var _n,so,io,no,ro,sn,lo,oo,ao,uo,Os,co,nn,vt,rn,ze,be,ln,on,bt,wt,nt,Gt,an,ho,cu,vd=C({"lib/lsp.ts"(){"use strict";var e,t,s,i,r,n,l,o,d,a,rs,Le,Tn,Cn,In,hu,Nn,yt,T;Ke(),La(),jn(),Uo(),K(),fe(),G(),_n=new WeakMap,so=new Set(["ref"]),io=new Set(["ref","references"]),no=new Set(["name","follow"]),ro=new Set(["group"]),sn=new Set(["arg-name","template-name","link-target","parameter-key"]),lo=new Set(["ext","html","attr-key","image-parameter","heading-title","heading","magic-word-name",...sn]),oo=new Set(["text","comment","noinclude","include"]),ao=["ext","html","table"].map(f=>`${f}-attr#style`).join(),uo=at(f=>new RegExp(`^(?:${f}|//)`,"iu")),Os=({type:f,parentNode:g,length:x,firstChild:v},h)=>f==="attr-value"&&x===1&&v.type==="text"&&(!h||g.name==="style"),co=f=>f.is("html-attr")||f.is("table-attr"),nn=f=>f.childNodes.every(({type:g})=>oo.has(g)),vt=(f,g)=>{const{top:x,left:v}=f.posFromIndex(g);return{line:x,character:v}},rn=(f,g,x)=>({start:vt(f,g),end:vt(f,x)}),ze=f=>{const{top:g,left:x,height:v,width:h}=f.getBoundingClientRect();return{start:{line:g,character:x},end:gs(g,x,v,h)}},be=(f,g,x,{line:v,character:h},S,y)=>[...new Set(f)].map($=>{var I;const L=(I=y==null?void 0:y($))==null?void 0:I.description;return{label:$,kind:g,textEdit:{range:{start:{line:v,character:h-x.length},end:{line:v,character:h}},newText:$+(S!=null?S:"")},...L&&{documentation:{kind:"markdown",value:L}}}}),ln=(f,g,{line:x,character:v})=>{const h=f.indexFromPos(x,v);return f.caretPositionFromIndex(h+Number(/\w/u.test(g.charAt(h))))},on=(f,g,x)=>{const{type:v,parentNode:h={}}=f,{name:S,tag:y}=h;return v==="attr-value"&&g.has(y)&&x.has(S)?f.toString().trim():NaN},bt=f=>on(f,so,no),wt=f=>on(f,io,ro),nt=(f,g)=>{const x=f==null?void 0:f.getAttr(g);return x!==!0&&x||!1},Gt=f=>{const{type:g,name:x,parentNode:v}=f;switch(g){case"heading":return f.level;case"heading-title":return v.level;case"parameter-key":return`${v.parentNode.name}|${v.name}`;case"ext":case"html":case"image-parameter":return x;default:return v.name}},an=(f,g,x=!1)=>({range:rn(f,...g.range),newText:g.text,title:`${x?"Fix":"Suggestion"}: ${g.desc}`,fix:x}),ho=(f,g)=>{const{lintConfig:x}=N,{rules:v,fix:h,computeEditInfo:S}=x;if(x.fix=!0,x.computeEditInfo=!1,g){x.rules=void 0;for(const $ of as)x.rules[$]=$===g?v[$]:0}const{output:y}=f.lint();return x.fix=h,x.computeEditInfo=S,g&&(x.rules=v),y===void 0?[]:[{range:ze(f),newText:y}]},cu=(T=class{constructor(f){P(this,a);P(this,e);P(this,t);P(this,s);P(this,i);P(this,r);P(this,n);P(this,l);P(this,o);P(this,d);Ne(this,"include",!0);Ne(this,"config");Ne(this,"data");_n.set(f,this),Object.defineProperties(this,{config:{enumerable:!1},data:{enumerable:!1}})}destroy(){Object.setPrototypeOf(this,null)}async provideDocumentColors(f,g,x=!0){const v=await R(this,a,Le).call(this,g);return v.querySelectorAll("attr-value,parameter-value,arg-default").reverse().flatMap(h=>{const{type:S,childNodes:y}=h;return S!=="attr-value"&&!nn(h)?[]:y.filter($=>$.type==="text").reverse().flatMap($=>{const{data:L}=$,I=ko(L,x).filter(([,,,B])=>B);if(I.length===0)return[];const j=$.getAbsoluteIndex();return I.map(([B,O,E])=>{const D=f(B);return D.length===4&&{color:{red:D[0]/255,green:D[1]/255,blue:D[2]/255,alpha:D[3]},range:rn(v,j+O,j+E)}}).filter(Boolean)})})}provideColorPresentations(f){const{color:{red:g,green:x,blue:v,alpha:h},range:S}=f,y=[g,x,v],$=h<1?`rgba(${y.map(L=>Math.round(L*255)).join()},${h})`:`#${y.map(Ao).join("")}`;return[{label:$,textEdit:{range:S,newText:$}}]}async provideCompletionItems(f,g){var Q,ie,ue,he,ne,Ce,Ie;const{re:x,allTags:v,functions:h,switches:S,protocols:y,params:$,tags:L,ext:I}=R(this,a,hu).call(this),{line:j,character:B}=g,O=f.split(/\r?\n/u,j+1)[j],E=x.exec((Q=O==null?void 0:O.slice(0,B))!=null?Q:""),[,,D={},W={}]=this.config.doubleUnderscore;if((E==null?void 0:E[1])!==void 0){const M=E[1].startsWith("/");return be(v,"Class",E[1].slice(M?1:0),g,M&&!(O!=null&&O.slice(B).trim().startsWith(">"))?">":"")}else{if(E!=null&&E[4])return be(S,"Constant",E[4],g,"",M=>{if(this.data)return M=M.slice(2,-2),M in D?M=D[M]:M in W&&(M=W[M]),R(this,a,Nn).call(this,M.toLowerCase())});if((E==null?void 0:E[5])!==void 0)return be(y,"Reference",E[5],g)}const q=await R(this,a,Le).call(this,f);let z;if(E!=null&&E[2]){z=q.elementFromPoint(E.index+E[2].length-1,j);const M=(ie=E[3])!=null?ie:"";if(E[2]==="{{{")return be(q.querySelectorAll("arg").filter(te=>te.name&&te!==z).map(({name:te})=>te),"Variable",M,g);const[ee,ge]=this.config.parserFunction,ve=Array.isArray(ge),Te=O.charAt(B),Me=M.startsWith(":"),ye=Me?M.slice(1).trimStart():M;if(E[2]==="[[")return be(q.querySelectorAll("link,file,category,redirect-target").filter(te=>te!==z).map(({name:te})=>te),"Folder",ye,g);let ft=h;return Te===":"?ft=h.filter(te=>!te.endsWith(":")):Te===":"&&(ft=h.filter(te=>te.endsWith(":")).map(te=>te.slice(0,-1))),[...be(ft,"Function",M,g,"",te=>{if(this.data)te in ee?te=ee[te]:!ve&&te in ge&&(te=ge[te]);else return;return R(this,a,yt).call(this,te.toLowerCase())}),...M.startsWith("#")?[]:be(q.querySelectorAll("template").filter(te=>te!==z).map(te=>{const{name:et}=te;if(Me)return et;const{ns:Ot}=te.getAttribute("title");return Ot===0?`:${et}`:Ot===10?et.slice(9):et}),"Folder",ye,g)]}let U,V;if((E==null?void 0:E[7])===void 0&&(z=q.elementFromPoint(B,j),{type:U,parentNode:V}=z),(E==null?void 0:E[6])!==void 0||U==="image-parameter"){const M=q.indexFromPos(j,B),ee=(he=(ue=E==null?void 0:E[6])==null?void 0:ue.trimStart())!=null?he:w(this,e).slice(z.getAbsoluteIndex(),M).trimStart(),ge=w(this,e)[M]==="=";return[...be($,"Property",ee,g).filter(({label:ve})=>!ge||!/[= ]$/u.test(ve)),...be(q.querySelectorAll("image-parameter#width").filter(ve=>ve!==z).map(ve=>ve.text()),"Unit",ee,g)]}else if((E==null?void 0:E[7])!==void 0||U==="attr-key"){const M=(Ce=(ne=E==null?void 0:E[7])==null?void 0:ne.toLowerCase())!=null?Ce:V.tag,ee=(Ie=E==null?void 0:E[9])!=null?Ie:z.toString().slice(0,B-q.posFromIndex(z.getAbsoluteIndex()).left);if(!L.has(M))return;const ge=Vn[M],ve=Qn[M],Te=ve&&be(ve,"Field",ee,g);return I.includes(M)&&!ge?Te:[...Te!=null?Te:[],...M==="meta"||M==="link"?[]:be(Gn,"Property",ee,g),...ge?be(ge,"Property",ee,g):[],...be(["data-"],"Variable",ee,g),...be(["xmlns:"],"Interface",ee,g)]}else if(U==="parameter-key"||U==="parameter-value"&&V.anon){const M=V.parentNode,{type:ee,name:ge}=M;if(ee==="magic-word"&&ge!=="invoke")return;const ve=w(this,e).slice(z.getAbsoluteIndex(),q.indexFromPos(j,B)).trimStart(),{module:Te,function:Me}=M;return ve?be(q.querySelectorAll("parameter").filter(ye=>ye===V||ye.anon||ye.parentNode.type!==ee||ye.parentNode.name!==ge?!1:ee==="template"?!0:ye.parentNode.module===Te&&ye.parentNode.function===Me).map(({name:ye})=>ye),"Variable",ve,g,U==="parameter-value"?"=":""):void 0}else if(Os(z)&&co(V)){const M=Wn(V.tag,V.name);if(M.length===0)return;const ee=w(this,e).slice(z.getAbsoluteIndex(),q.indexFromPos(j,B)).trimStart();return be(M,"Value",ee,g)}}async provideDiagnostics(f,g=!0){const x=await R(this,a,Le).call(this,f),{lintConfig:v}=N,h=v.fix;v.fix=!1;const S=x.lint();return v.fix=h,[(g?S:S.filter(({severity:I})=>I==="error")).map(({startLine:I,startCol:j,endLine:B,endCol:O,severity:E,rule:D,message:W,fix:q,suggestions:z})=>({range:{start:{line:I,character:j},end:{line:B,character:O}},severity:E==="error"?1:2,source:"WikiLint",code:D,message:W,data:[...q?[an(x,q,!0)]:[],...z?z.map(U=>an(x,U)):[]]})),[],[]].flat(2)}resolveCodeAction(f){if(f.kind!=="source.fixAll")return f;const{rule:g}=f.data;return{...f,edit:{changes:{"":ho(w(this,r),g)}}}}async provideFoldingRanges(f){const g=await R(this,a,Le).call(this,f),{length:x}=g.getLines(),v=[],h=new Array(6),S=g.querySelectorAll("heading-title,table,template,magic-word");for(const y of[...S].reverse())y.getRelativeIndex();for(const y of S){const{offsetHeight:$}=y;if(y.type==="heading-title"||$>2){const{top:L}=g.posFromIndex(y.getAbsoluteIndex());if(y.type==="heading-title"){const{level:I}=y.parentNode;for(let j=I-1;j<6;j++){const B=h[j];B!==void 0&&B<L-1&&v.push({startLine:B,endLine:L-1,kind:"region"}),h[j]=void 0}h[I-1]=L+$-1}else v.push({startLine:L,endLine:L+$-2,kind:"region"})}}for(const y of h)y!==void 0&&y<x-1&&v.push({startLine:y,endLine:x-1,kind:"region"});return v}async provideLinks(f){var S;(S=this.config)!=null||(this.config=N.getConfig());const{articlePath:g,protocol:x}=this.config,v=g==null?void 0:g.includes("//"),h=uo(x);return(await R(this,a,Le).call(this,f)).querySelectorAll(`magic-link,ext-link-url,free-ext-link,attr-value,image-parameter#link${v?",link-target,template-name,invoke-module,magic-word#filepath,magic-word#widget":""}`).reverse().map(y=>{let $;y.is("magic-word")&&({name:$}=y,y=y.childNodes[1].lastChild);const{type:L,parentNode:I,firstChild:j,lastChild:B,childNodes:O,length:E}=y,{tag:D}=I;if($!=null||($=I.name),!(L!=="attr-value"||$==="src"&&["templatestyles","img"].includes(D)||$==="cite"&&["blockquote","del","ins","q"].includes(D))||!nn(y))return!1;let W=O.filter(q=>q.type==="text").map(({data:q})=>q).join("").trim();if(!W)return!1;try{if(y.is("magic-link")||y.is("ext-link-url")||y.is("free-ext-link"))W=y.getUrl(g);else if(L==="link-target"&&(I.is("link")||I.is("redirect-target")||I.is("category"))){if(W.startsWith("/"))return!1;W=I.link.getUrl(g)}else if(L==="template-name")W=I.getAttribute("title").getUrl(g);else if(["link-target","invoke-module","parameter-value"].includes(L)||L==="attr-value"&&$==="src"&&D==="templatestyles"||L==="image-parameter"&&!h.test(W)){if(!v||W.startsWith("/"))return!1;let q=0;switch(L){case"attr-value":q=10;break;case"invoke-module":q=828;break;case"parameter-value":q=$==="filepath"?6:274}const z=N.normalizeTitle(W,q,!1,this.config,{temporary:!0});if(!z.valid)return!1;W=z.getUrl()}if(typeof W=="string"&&W.startsWith("//")&&(W=`https:${W}`),W=new URL(W).href,L==="image-parameter"){const q=j.getBoundingClientRect(),{top:z,left:U,height:V,width:Q}=E===1?q:B.getBoundingClientRect();return{range:{start:{line:q.top,character:q.left},end:gs(z,U,V,Q)},target:W}}return{range:ze(y),target:W}}catch{return!1}}).filter(Boolean)}async provideReferences(f,g){const x=await R(this,a,Le).call(this,f),{offsetNode:v,offset:h}=ln(x,w(this,e),g),S=v.type==="text"?v.parentNode:v,y=h===0&&(S.type==="ext-attr-dirty"||S.type==="html-attr-dirty")?S.parentNode.parentNode:S,{type:$}=y,L=bt(y),I=wt(y);if(!L&&!I&&!lo.has($))return;const j=Gt(y),B=x.querySelectorAll($==="heading-title"?"heading":$).filter(O=>$==="attr-value"?bt(O)===L||wt(O)===I:Gt(O)===j).reverse().map(O=>({range:ze(O.type==="parameter-key"?O.parentNode:O)}));return B.length===0?void 0:B}async provideDefinition(f,g){const x=await R(this,a,Le).call(this,f),v=x.elementFromPoint(g.character,g.line),h=v.is("ext")&&v.name==="ref"?v:v.closest("ext#ref"),S=nt(h,"name");if(!S)return;const y=nt(h,"group"),$=x.querySelectorAll("ext#ref").filter(L=>L.innerText&&nt(L,"name")===S&&nt(L,"group")===y).reverse().map(({lastChild:L})=>({range:ze(L)}));return $.length===0?void 0:$}async resolveRenameLocation(f,g){const x=await R(this,a,Le).call(this,f),v=x.elementFromPoint(g.character,g.line),{type:h}=v,S=bt(v),y=wt(v);return!S&&!y&&(!sn.has(h)||h==="parameter-key"&&/^[1-9]\d*$/u.test(v.parentNode.name)||h==="link-target"&&!["link","redirect-target"].includes(v.parentNode.type))?void 0:ze(v)}async provideRenameEdits(f,g,x){const v=await R(this,a,Le).call(this,f),h=v.elementFromPoint(g.character,g.line),{type:S}=h,y=bt(h),$=y&&nt(h.parentNode.parentNode,"group"),L=wt(h),I=Gt(h),j=v.querySelectorAll(S).filter(B=>{const{type:O}=B.parentNode;return S==="link-target"&&O!=="link"&&O!=="redirect-target"?!1:S==="attr-value"?wt(B)===L||bt(B)===y&&nt(B.parentNode.parentNode,"group")===$:Gt(B)===I});return j.length===0?void 0:{changes:{"":j.reverse().map(B=>({range:ze(B),newText:x}))}}}async provideHover(f,g){if(!this.data)return;const x=await R(this,a,Le).call(this,f);let{offsetNode:v,offset:h}=ln(x,w(this,e),g);v.type==="text"&&(h+=v.getRelativeIndex(),v=v.parentNode);const{type:S,parentNode:y,length:$,name:L}=v;let I,j,B,O;if(v.is("double-underscore")&&h>0)I=R(this,a,Nn).call(this,v.name);else if(S==="magic-word-name")I=R(this,a,yt).call(this,y.name),j=v.text().trim(),B=y.getAttribute("colon");else if(v.is("magic-word")&&!v.modifier&&$===1&&(h>0||x.posFromIndex(v.getAbsoluteIndex()).left===g.character))I=R(this,a,yt).call(this,L),j=v.firstChild.text().trim(),B=v.getAttribute("colon");else if((v.is("magic-word")||v.is("template"))&&v.modifier&&h>=2&&v.getRelativeIndex(0)>h&&(j=v.modifier.trim().slice(0,-1),I=R(this,a,yt).call(this,j.toLowerCase()),B=":",I)){const E=v.getAbsoluteIndex();O={start:vt(x,E+2),end:vt(x,E+v.modifier.trimEnd().length+1)}}return I&&{contents:{kind:"markdown",value:(I.signatures?`${I.signatures.map(E=>`- **{{ ${j}${E.length===0?"**":`${B}** `}${E.map(({label:D,const:W})=>W?D:`*${D}*`).join(" **|** ")} **}}**`).join(`
|
|
30
30
|
`)}
|
|
31
31
|
|
|
32
|
-
`:"")+I.description},range:O!=null?O:ze(v)}}async provideSignatureHelp(f,g){if(!this.data)return;const{line:x,character:v}=g,h=f.split(/\r?\n/u,x+1)[x],{lastChild:S}=await R(this,a,
|
|
33
|
-
${x.slice(y.line+1
|
|
32
|
+
`:"")+I.description},range:O!=null?O:ze(v)}}async provideSignatureHelp(f,g){if(!this.data)return;const{line:x,character:v}=g,h=f.split(/\r?\n/u,x+1)[x],{lastChild:S}=await R(this,a,Cn).call(this,`${h.slice(0,v+/^[^{}<]*/u.exec(h.slice(v))[0].length)}}}`);if(!S.is("magic-word")||S.length===1)return;const{name:y,childNodes:$,firstChild:L}=S,I=R(this,a,yt).call(this,y);if(!(I!=null&&I.signatures))return;const j=$.length-1,B=I.signatures.filter(W=>{var q;return(W.length>=j||((q=W[W.length-1])==null?void 0:q.rest))&&W.every(({label:z,const:U},V)=>{var ie;const Q=U&&V<j&&((ie=$[V+1])==null?void 0:ie.text().trim());return!Q||z.toLowerCase().includes(Q.toLowerCase())})});if(B.length===0)return;let O=-1;for(let W=S.getAbsoluteIndex()+S.getAttribute("padding");O<j&&(W+=$[O+1].toString().length+1,!(W>v));O++);const E=L.text().trim(),D=S.getAttribute("colon");return{signatures:B.map(W=>({label:`{{${E}${W.length===0?"":D}${W.map(({label:q})=>q).join("|")}}}`,parameters:W.map(({label:q,const:z})=>({label:q,...z?{documentation:"Predefined parameter"}:void 0})),...W.length<j?{activeParameter:Math.min(O,W.length-1)}:void 0})),activeParameter:O}}async provideInlayHints(f){const g=await R(this,a,Le).call(this,f);let x=[];for(const v of g.querySelectorAll("template,magic-word#invoke").reverse()){const{type:h,childNodes:S}=v;x=[...x,...S.slice(h==="template"?1:3).filter(({anon:y})=>y).reverse().map(y=>({position:vt(g,y.getAbsoluteIndex()),label:`${y.name}=`,kind:2}))]}return x}findStyleTokens(){return w(this,r).querySelectorAll(ao).filter(({lastChild:f})=>Os(f))}async provideRefactoringAction(f,g){let x,v;if(g){const{start:y,end:$}=g;if(y.line===$.line&&y.character===$.character)return[];x=f.split(/\r?\n/u,$.line+1),v=y.line===$.line?x[$.line].slice(y.character,$.character):`${x[y.line].slice(y.character)}
|
|
33
|
+
${x.slice(y.line+1,$.line).join(`
|
|
34
34
|
`)}${x.length===2?"":`
|
|
35
|
-
`}${x[
|
|
36
|
-
`),g={start:{line:0,character:0},end:{line:x.length-1,character:x[x.length-1].length}};else return[];const h=await R(this,a,
|
|
35
|
+
`}${x[$.line].slice(0,$.character)}`}else if(f)x=f.split(/\r?\n/u),v=x.join(`
|
|
36
|
+
`),g={start:{line:0,character:0},end:{line:x.length-1,character:x[x.length-1].length}};else return[];const h=await R(this,a,Cn).call(this,v),{viewOnly:S}=N;return N.viewOnly=!1,h.escape(),N.viewOnly=S,[{title:"Escape with magic words",kind:"refactor.rewrite",edit:{changes:{"":[{range:g,newText:h.toString()}]}}}]}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakMap,n=new WeakMap,l=new WeakMap,o=new WeakMap,d=new WeakMap,a=new WeakSet,rs=function(){return w(this,l)===this.config&&w(this,o)===this.include},Le=async function(f){var g;return f=us(f),!w(this,s)&&R(this,a,rs).call(this)&&w(this,e)===f?w(this,r):(F(this,e,f),(g=w(this,s))!=null||F(this,s,R(this,a,Tn).call(this)),w(this,s))},Tn=async function(){var x;(x=this.config)!=null||(this.config=N.getConfig()),F(this,l,this.config),F(this,o,this.include);const f=w(this,e),g=await N.partialParse(f,()=>w(this,e),this.include,this.config);return R(this,a,rs).call(this)&&w(this,e)===f?(F(this,r,g),F(this,s,void 0),g):(F(this,s,R(this,a,Tn).call(this)),w(this,s))},Cn=async function(f){var g;return f=us(f),!w(this,i)&&R(this,a,rs).call(this)&&w(this,t)===f?w(this,n):(F(this,t,f),(g=w(this,i))!=null||F(this,i,R(this,a,In).call(this)),w(this,i))},In=async function(){var x;(x=this.config)!=null||(this.config=N.getConfig()),F(this,l,this.config),F(this,o,this.include);const f=w(this,t),g=await N.partialParse(f,()=>w(this,t),this.include,this.config);return R(this,a,rs).call(this)&&w(this,t)===f?(F(this,n,g),F(this,i,void 0),g):(F(this,i,R(this,a,In).call(this)),w(this,i))},hu=function(){var f;if(!w(this,d)||w(this,d)[1]!==this.config){(f=this.config)!=null||(this.config=N.getConfig());const{nsid:g,ext:x,html:v,parserFunction:[h,S,...y],doubleUnderscore:$,protocol:L,img:I}=this.config,j=new Set([x,v].flat(2)),B=new RegExp("(?:"+String.raw`<(\/?\w*)`+"|"+String.raw`(\{{2,4}|\[\[)\s*([^|{}<>[\]\s][^|{}<>[\]#]*)?`+"|"+String.raw`(__(?:(?!__)[\p{L}\p{N}_])*)`+"|"+String.raw`(?<!\[)\[([a-z:/]*)`+"|"+String.raw`\[\[\s*(?:${Object.entries(g).filter(([,O])=>O===6).map(([O])=>O).join("|")})\s*:[^[\]{}<>]+\|([^[\]{}<>|=]*)`+"|"+String.raw`<(\w+)(?:\s(?:[^<>{}|=\s]+(?:\s*=\s*(?:[^\s"']\S*|(["']).*?\8))?(?=\s))*)?\s(\w*)`+")$","iu");F(this,d,[{re:B,ext:x,tags:j,allTags:[...j,"onlyinclude","includeonly","noinclude"],functions:[Object.keys(h),Array.isArray(S)?S:Object.keys(S),y].flat(2),switches:$.slice(0,2).flat().filter(Ct).map(O=>`__${O}__`),protocols:L.split("|"),params:Object.keys(I).filter(O=>O.endsWith("$1")||!O.includes("$1")).map(O=>O.replace(/\$1$/u,""))},this.config])}return w(this,d)[0]},Nn=function(f){return this.data.behaviorSwitches.find(({aliases:g})=>g.includes(f))},yt=function(f){return this.data.parserFunctions.find(({aliases:g})=>g.some(x=>x.replace(/^#/u,"")===f))},T)}}),gu={};oe(gu,{default:()=>N});pu.exports=se(gu);var Ns,un,go,He,dn,po,N,G=C({"index.ts"(){jn(),je(),Xe(),fe(),md(),Ns=!0,un=new $n,He={config:hn,get rules(){return as},get i18n(){return{...So,...go}},set i18n(e){go=e},get lintConfig(){return un},set lintConfig(e){un=new $n(e)},get viewOnly(){return Ns},set viewOnly(e){Ns&&!e&&xe.rev++,Ns=e},getConfig(e){const t=e!=null?e:this.config,{doubleUnderscore:s,ext:i,parserFunction:r,variable:n}=t;for(let l=0;l<2;l++)s.length>l+2&&s[l].length===0&&(s[l]=Object.keys(s[l+2]));return i.includes("translate")&&!n.includes("translationlanguage")&&(n.push("translationlanguage"),Array.isArray(r[1])?r[1].push("TRANSLATIONLANGUAGE"):r[1].TRANSLATIONLANGUAGE="translationlanguage"),{...hn,...t,excludes:[]}},msg(e,t=""){var s;return e&&((s=this.i18n[e])!=null?s:e).replace("$1",this.msg(t))},normalizeTitle(e,t=0,s,i=He.getConfig(),r){const{Title:n}=(xd(),se(au));let l;if(r!=null&&r.halfParsed)l=new n(e,t,i,r);else{const{Token:o}=(X(),se(os));l=xe.run(()=>{const d=new o(e,i);d.type="root",d.parseOnce(0,s).parseOnce();const a=new n(d.toString(),t,i,r);d.build();for(const u of["main","fragment"]){const c=a[u];if(c!=null&&c.includes("\0")){const p=d.buildFromStr(c,1);u==="main"?a.main=p:a.setFragment(p)}}return a})}return l},parse(e,t,s=Ae,i=He.getConfig()){e=us(e);let r;typeof s!="number"&&(r=Array.isArray(s)?s:[s],s=Math.max(...r.map(o=>wo[o]||Ae)));const{Token:n}=(X(),se(os));return xe.run(()=>{const o=new n(e,i);return o.type="root",o.parse(s,t)})},async partialParse(e,t,s,i=He.getConfig()){{const{Token:r}=(X(),se(os)),n=typeof setImmediate=="function"?setImmediate:setTimeout,{running:l}=xe;xe.running=!0;const o=new r(us(e),i);o.type="root";let d=0;try{await new Promise(a=>{const u=()=>{t()===e?(d++,n(c,0)):a()},c=()=>{d===Ae+1?(o.afterBuild(),a()):(o[d===Ae?"build":"parseOnce"](d,s),u())};n(c,0)})}catch(a){throw xe.running=l,a}return xe.running=l,o}},createLanguageService(e={}){var t;{const s=(vd(),se(du)),{LanguageService:i,tasks:r}=s;return(t=r.get(e))!=null?t:new i(e)}throw new Error("Parser.createLanguageService method is only available in the LSP version!")}},dn={},po=new Set(["lintConfig","normalizeTitle","parse","createLanguageService"]);for(const e in He)po.has(e)||(dn[e]={enumerable:!1});Object.defineProperties(He,dn),Object.assign(typeof globalThis=="object"?globalThis:self,{Parser:He}),N=He}});G()});bd();})();
|
|
37
37
|
//# sourceMappingURL=bundle-lsp.min.js.map
|