wikiparser-node 1.27.0 → 1.28.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/bundle-es8.min.js +25 -25
- package/bundle/bundle-lsp.min.js +29 -29
- package/bundle/bundle.min.js +24 -25
- package/config/default.json +15 -16
- package/config/jawiki.json +15 -16
- package/dist/addon/token.js +1 -1
- package/dist/base.d.mts +2 -2
- package/dist/base.d.ts +2 -2
- package/dist/base.js +1 -0
- package/dist/base.mjs +1 -0
- package/dist/bin/config.js +11 -11
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -3
- package/dist/internal.d.ts +5 -5
- package/dist/lib/lintConfig.js +7 -5
- package/dist/lib/lsp.d.ts +1 -1
- package/dist/lib/lsp.js +5 -2
- package/dist/lib/node.js +51 -40
- package/dist/mixin/attributesParent.js +59 -57
- package/dist/mixin/elementLike.js +77 -75
- package/dist/mixin/hidden.js +3 -3
- package/dist/mixin/nodeLike.js +2 -2
- package/dist/mixin/padded.js +9 -7
- package/dist/mixin/singleLine.d.ts +1 -1
- package/dist/mixin/singleLine.js +10 -11
- package/dist/parser/commentAndExt.js +5 -2
- package/dist/parser/hrAndDoubleUnderscore.js +9 -8
- package/dist/parser/html.js +1 -1
- package/dist/parser/selector.js +2 -1
- package/dist/src/arg.js +4 -5
- package/dist/src/atom.d.ts +1 -1
- package/dist/src/atom.js +0 -1
- package/dist/src/attribute.d.ts +5 -7
- package/dist/src/attribute.js +18 -8
- package/dist/src/attributes.d.ts +7 -8
- package/dist/src/attributes.js +5 -3
- package/dist/src/commented.d.ts +3 -3
- package/dist/src/converterRule.js +1 -1
- package/dist/src/heading.js +1 -1
- package/dist/src/imageParameter.d.ts +0 -8
- package/dist/src/imageParameter.js +56 -25
- package/dist/src/imagemapLink.js +1 -1
- package/dist/src/index.d.ts +0 -5
- package/dist/src/index.js +2 -5
- package/dist/src/link/base.js +1 -2
- package/dist/src/link/category.js +1 -2
- package/dist/src/link/file.js +9 -11
- package/dist/src/link/galleryImage.d.ts +0 -3
- package/dist/src/link/galleryImage.js +3 -2
- package/dist/src/link/index.js +1 -1
- package/dist/src/magicLink.d.ts +0 -7
- package/dist/src/magicLink.js +12 -1
- package/dist/src/multiLine/gallery.d.ts +49 -0
- package/dist/src/{gallery.js → multiLine/gallery.js} +24 -37
- package/dist/src/multiLine/imagemap.d.ts +25 -0
- package/dist/src/{imagemap.js → multiLine/imagemap.js} +20 -36
- package/dist/src/multiLine/index.d.ts +17 -0
- package/dist/src/multiLine/index.js +36 -0
- package/dist/src/{paramTag → multiLine}/inputbox.d.ts +1 -1
- package/dist/src/{paramTag → multiLine}/inputbox.js +2 -2
- package/dist/src/multiLine/paramTag.d.ts +20 -0
- package/dist/src/{paramTag/index.js → multiLine/paramTag.js} +10 -24
- package/dist/src/nowiki/base.d.ts +1 -1
- package/dist/src/nowiki/comment.js +2 -0
- package/dist/src/nowiki/commentLine.d.ts +11 -0
- package/dist/src/nowiki/commentLine.js +67 -0
- package/dist/src/nowiki/doubleUnderscore.d.ts +2 -1
- package/dist/src/nowiki/doubleUnderscore.js +10 -4
- package/dist/src/nowiki/listBase.js +1 -2
- package/dist/src/nowiki/noinclude.d.ts +6 -0
- package/dist/src/nowiki/noinclude.js +19 -4
- package/dist/src/nowiki/quote.js +2 -2
- package/dist/src/paramLine.d.ts +17 -0
- package/dist/src/paramLine.js +83 -0
- package/dist/src/parameter.d.ts +0 -1
- package/dist/src/parameter.js +2 -1
- package/dist/src/pre.d.ts +6 -8
- package/dist/src/pre.js +3 -2
- package/dist/src/syntax.d.ts +1 -1
- package/dist/src/table/base.d.ts +6 -1
- package/dist/src/table/base.js +96 -46
- package/dist/src/table/index.js +70 -66
- package/dist/src/table/td.d.ts +2 -2
- package/dist/src/table/td.js +8 -7
- package/dist/src/table/tr.d.ts +2 -2
- package/dist/src/table/trBase.d.ts +0 -5
- package/dist/src/table/trBase.js +4 -5
- package/dist/src/{html.d.ts → tag/html.d.ts} +6 -22
- package/dist/src/{html.js → tag/html.js} +43 -131
- package/dist/src/tag/index.d.ts +44 -0
- package/dist/src/tag/index.js +214 -0
- package/dist/src/tag/tvar.d.ts +38 -0
- package/dist/src/tag/tvar.js +169 -0
- package/dist/src/tagPair/ext.js +14 -7
- package/dist/src/tagPair/include.js +1 -1
- package/dist/src/tagPair/index.d.ts +1 -1
- package/dist/src/tagPair/index.js +1 -0
- package/dist/src/tagPair/translate.js +10 -10
- package/dist/src/transclude.d.ts +8 -9
- package/dist/src/transclude.js +8 -5
- package/dist/util/constants.js +1 -1
- package/extensions/dist/base.js +1 -1
- package/extensions/ui.css +1 -1
- package/i18n/en.json +2 -0
- package/i18n/zh-hans.json +2 -0
- package/i18n/zh-hant.json +2 -0
- package/package.json +5 -5
- package/dist/mixin/multiLine.d.ts +0 -4
- package/dist/mixin/multiLine.js +0 -33
- package/dist/src/gallery.d.ts +0 -66
- package/dist/src/imagemap.d.ts +0 -49
- package/dist/src/paramTag/index.d.ts +0 -28
package/bundle/bundle-lsp.min.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
"use strict";(()=>{var au=Object.defineProperty;var or=e=>{throw TypeError(e)};var uu=(e,t,s)=>t in e?au(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var du=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Le=(e,t,s)=>uu(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),j=(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 _(l){j(e,t,l,s)},get _(){return w(e,t,i)}});var dd=du((hd,ou)=>{var cu=Object.create,Lt=Object.defineProperty,fo=Object.getOwnPropertyDescriptor,Ln=Object.getOwnPropertyNames,hu=Object.prototype.hasOwnProperty,mo=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Ft=e=>{throw TypeError(e)},xo=(e,t,s)=>t in e?Lt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,ur=(e,t)=>Lt(e,"name",{value:t,configurable:!0}),I=(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},ae=(e,t)=>{for(var s in t)Lt(e,s,{get:t[s],enumerable:!0})},gu=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of Ln(t))!hu.call(e,l)&&l!==s&&Lt(e,l,{get:()=>t[l],enumerable:!(i=fo(t,l))||i.enumerable});return e},ee=e=>gu(Lt({},"__esModule",{value:!0}),e),oe=e=>{var t;return[,,,cu((t=e==null?void 0:e[mo("metadata")])!=null?t:null)]},bo=["class","method","getter","setter","accessor","field","value","get","set"],Dt=e=>e!==void 0&&typeof e!="function"?Ft("Function expected"):e,pu=(e,t,s,i,l)=>({kind:bo[e],name:t,metadata:i,addInitializer:n=>s._?Ft("Already initialized"):l.push(Dt(n||null))}),Fn=(e,t)=>xo(t,mo("metadata"),e[3]),ne=(e,t,s,i)=>{for(var l=0,n=e[t>>1],r=n&&n.length;l<r;l++)t&1?n[l].call(s):i=n[l].call(s,i);return i},re=(e,t,s,i,l,n)=>{var r,o,a,u,d,c=t&7,f=!!(t&8),p=!!(t&16),v=c>3?e.length+1:c?f?1:2:0,k=bo[c+5],$=c>3&&(e[v-1]=[]),_=e[v]||(e[v]=[]),T=c&&(!p&&!f&&(l=l.prototype),c<5&&(c>3||!p)&&fo(c<4?l:{get[s](){return pe(this,n)},set[s](h){return _e(this,n,h)}},s));c?p&&c<4&&ur(n,(c>2?"set ":c>1?"get ":"")+s):ur(l,s);for(var g=i.length-1;g>=0;g--)u=pu(c,s,a={},e[3],_),c&&(u.static=f,u.private=p,d=u.access={has:p?h=>mu(l,h):h=>s in h},c^3&&(d.get=p?h=>(c^1?pe:cn)(h,l,c^4?n:T.get):h=>h[s]),c>2&&(d.set=p?(h,x)=>_e(h,l,x,c^4?n:T.set):(h,x)=>h[s]=x)),o=(0,i[g])(c?c<4?p?n:T[k]:c>4?void 0:{get:T.get,set:T.set}:l,u),a._=1,c^4||o===void 0?Dt(o)&&(c>4?$.unshift(o):c?p?n=o:T[k]=o:l=o):typeof o!="object"||o===null?Ft("Object expected"):(Dt(r=o.get)&&(T.get=r),Dt(r=o.set)&&(T.set=r),Dt(r=o.init)&&$.unshift(r));return c||Fn(e,l),T&&Lt(l,s,T),p?c^4?n:T:l},fu=(e,t,s)=>xo(e,typeof t!="symbol"?t+"":t,s),En=(e,t,s)=>t.has(e)||Ft("Cannot "+s),mu=(e,t)=>Object(t)!==t?Ft('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)),He=(e,t,s)=>t.has(e)?Ft("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),_e=(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),xu=(e,t,s,i)=>({set _(l){_e(e,t,l,s)},get _(){return pe(e,t,i)}}),wo,as,jn=I({"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","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 Ee(e,t,s){return s===1?e.replace(/\0(\d+)g\x7F/gu,(i,l)=>Ee(String(t[l]),t,2)):s===2?e.replace(/\0(\d+)n\x7F/gu,(i,l)=>String(t[l])):e.replace(/\0(\d+)\x7F/gu,(i,l)=>t[l])}var Ge,Ks,_t,Tt,Ct,pt,us,Te,dt,dr,cr,ds,yo,hr,gr,cs,It,fe=I({"util/string.ts"(){"use strict";Ge=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,Ks=String.raw`[^[\]<>"\0-\x1F\x7F${Ge}\uFFFD]`,_t=String.raw`(?:\[[\da-f:.]+\]|${Ks})`,Tt=String.raw`(?:${Ks}|\0\d+[cn!~]\x7F)*`,Ct=e=>e.trim().toLowerCase(),pt=(e,t)=>s=>s.replace(e,t),us=pt(/[\0\x7F]|\r$/gmu,""),Te=pt(/\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=pt(/&(?:#(\d+|[Xx][\da-fA-F]+)|([lg]t|[LG]T|[lr]brac[ke]|nbsp|amp|AMP|quot|QUOT));/gu,(e,t,s)=>t?String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t)):dr[s.toLowerCase()]),ds=e=>cr(e),yo=pt(/&#(\d+|x[\da-f]+);/giu,(e,t)=>String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t))),hr={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},gr=e=>pt(e,t=>`&${hr[t]};`),cs=gr(/[&<>]/gu),It=(e,t={})=>{const{pre:s="",post:i="",sep:l=""}=t;return s+e.map(n=>n.print()).join(l)+i}}}),vu=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","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}}}),bu=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:[]}}}),ke,So,hn,Je=I({"util/constants.ts"(){"use strict";ke=11,So=vu(),hn=bu()}});function at(e){const t=new Map,s=new WeakMap;return i=>{const l=typeof i=="string"?t:s;if(l.has(i)){const r=l.get(i);return r.lastIndex=0,r}const n=e(i);return l.set(i,n),n}}var hs,Ao,pr,ko,$o,Xe=I({"../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"),pr=(()=>{const e=String.raw`#(?:[\da-f]{3,4}|(?:[\da-f]{2}){3,4})(?![\p{L}\p{N}_])`,t=String.raw`(?:\d*\.)?\d+%?`,s=String.raw`(?:\d*\.)?\d+(?:deg|grad|rad|turn)?`,i=String.raw`rgba?\(\s*(?:${String.raw`${new Array(3).fill(t).join(String.raw`\s+`)}(?:\s*\/\s*${t})?`}|${String.raw`${new Array(3).fill(t).join(String.raw`\s*,\s*`)}(?:\s*,\s*${t})?`})\s*\)`,l=String.raw`hsla?\(\s*(?:${String.raw`${s}\s+${t}\s+${t}(?:\s*\/\s*${t})?`}|${String.raw`${s}${String.raw`\s*,\s*(?:\d*\.)?\d+%`.repeat(2)}(?:\s*,\s*${t})?`})\s*\)`;return{full:new RegExp(String.raw`(^|[^\p{L}\p{N}_])(${e}|${i}|${l})`,"giu"),rgb:new RegExp(String.raw`(^|[^\p{L}\p{N}_])(${e}|${i})`,"giu")}})(),ko=(e,t=!0)=>{const s=[],i=pr[t?"full":"rgb"];i.lastIndex=0;let l=i.exec(e),n=0;for(;l;){const r=l.index+l[1].length;r>n&&s.push([e.slice(n,r),n,r,!1]),{lastIndex:n}=i,s.push([l[2],r,n,e[r-1]!=="&"||!/^#\d+$/u.test(l[2])]),l=i.exec(e)}return e.length>n&&s.push([e.slice(n),n,e.length,!1]),s},$o=at}}),ce,me=I({"lib/rect.ts"(){"use strict";var e,t,s,i,gn,n;ce=(n=class{constructor(r,o){P(this,i);P(this,e);P(this,t);P(this,s);j(this,e,r),j(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 r;return(r=w(this,s))!=null||j(this,s,w(this,e).getRootNode().posFromIndex(w(this,t))),w(this,s)},n)}}),fr,mr,ls,gs,Ys,X,ie,Re,qs,te,Rn,Ve,Pn,On,Bn,ps,Nt,qn,ut,Wn,K=I({"util/lint.ts"(){"use strict";Xe(),Oe(),me(),G(),fr=new Set(["tr","td","th","caption"]),mr=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")&&mr.has(t.name)||t.is("html")&&fr.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}),Ys=e=>(t,s,i,l,n="error")=>{const{start:r}=s,{top:o,left:a}=s instanceof ce?s:new ce(t,r),{offsetHeight:u,offsetWidth:d}=t,{startIndex:c,startLine:f,startCol:p}=e(t,r,o,a),{line:v,character:k}=gs(f,p,u,d);return{rule:i,message:N.msg(l),severity:n,startIndex:c,endIndex:c+t.toString().length,startLine:f,endLine:v,startCol:p,endCol:k}},X=Ys((e,t,s,i)=>{const l=e.getRelativeIndex(),{top:n,left:r}=e.parentNode.posFromIndex(l);return{startIndex:t+l,startLine:s+n,startCol:n?r:i+r}}),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}),te=(e,t=0,s="")=>typeof e=="number"?{desc:N.msg("remove"),range:[e,e+t],text:s}:Re(e,"remove",s,t),Rn=(e,t)=>Re(e,"decode",hs(t.text().replace(/%(?=21|3[ce]|5[bd]|7[b-d])/giu,"%25"))),Ve=(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)=>Re(e,"comment",`<!--${t}-->`),Bn=(e,t)=>Re(e,"uppercase",t.toUpperCase()),ps=(e,t=0)=>({desc:N.msg("whitespace"),range:[e,e+t],text:" "}),Nt=(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]===we.rev))return e[1];const l=t();return(i||N.viewOnly)&&s([we.rev,l]),l},Wn=(e,t)=>e==="ol"&&t==="type"?["1","a","A","i","I"]:e==="th"&&t==="scope"?["row","col","rowgroup","colgroup"]:t==="dir"?["ltr","rtl","auto"]:t==="aria-hidden"?["true","false"]:[]}}),xr,Mn,_o=I({"parser/selector.ts"(){"use strict";xr=(e,t,s)=>{if(e.includes("#")){const i=e.indexOf("#");return(i===0||e.slice(0,i)===t)&&e.slice(i+1)===s}return!e||e===t},Mn=(e,t,s)=>{const i=e.split(",");return({type:l,name:n})=>i.some(r=>xr(r.trim(),l,n))}}}),Ws,Un=I({"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),l=>{s.set(this,l)},e)}}}}),To,wu=I({"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}}}),vr,br,bs,Pt,Ot,ws,Bt,qt,Wt,rt,Co=I({"lib/node.ts"(){"use strict";K(),Oe(),Un(),wu(),G(),br=[To],vr=[Ws(!1)],rt=class{constructor(){ne(Wt,5,this),fu(this,"childNodes",[]),He(this,bs),He(this,Pt),He(this,Ot),He(this,ws),He(this,Bt),He(this,qt,{})}get parentNode(){return pe(this,bs)}get nextSibling(){return pe(this,Pt)}get previousSibling(){return pe(this,Ot)}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":_e(this,bs,t),t||(_e(this,Pt,void 0),_e(this,Ot,void 0));break;case"nextSibling":_e(this,Pt,t);break;case"previousSibling":_e(this,Ot,t);break;case"aIndex":N.viewOnly&&_e(this,Bt,[we.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"&&_e(this,ws,e)})}indexFromPos(e,t){{if(e<0||t<0)return;const s=this.getLines();if(e>=s.length)return;const[,i,l]=s[e],n=i+t;return n>l?void 0:n}this.lspError("AstNode.indexFromPos")}posFromIndex(e){const{length:t}=String(this);if(e+=e<0?t:0,e>=0&&e<=t){const s=this.getLines(),i=s.findIndex(([,,l])=>e<=l);return{top:i,left:e-s[i][1]}}}getDimension(){const e=this.getLines(),t=e[e.length-1];return{height:e.length,width:t[2]-t[1]}}getGaps(e){return 0}getRelativeIndex(e){if(e===void 0){const{parentNode:t}=this;return t?t.getRelativeIndex(t.childNodes.indexOf(this)):0}return ut(pe(this,qt)[e],()=>{const{childNodes:t}=this,s=e+(e<0?t.length:0);let i=this.getAttribute("padding");for(let l=0;l<s;l++)N.viewOnly&&(pe(this,qt)[l]=[we.rev,i]),i+=t[l].toString().length+this.getGaps(l);return i},t=>{pe(this,qt)[e]=t})}getAbsoluteIndex(){return ut(pe(this,Bt),()=>{const{parentNode:e}=this;return e?e.getAbsoluteIndex()+this.getRelativeIndex():0},e=>{_e(this,Bt,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!`)}},Wt=oe(null),bs=new WeakMap,Pt=new WeakMap,Ot=new WeakMap,ws=new WeakMap,Bt=new WeakMap,qt=new WeakMap,re(Wt,1,"getLines",vr,rt),rt=re(Wt,0,"AstNode",br,rt),ne(Wt,1,rt)}}),Io,yu=I({"mixin/elementLike.ts"(){"use strict";_o(),Io=e=>{var s,pn;class t extends e{constructor(){super(...arguments);P(this,s)}getElementBy(r){for(const o of this.childNodes){if(o.type==="text")continue;if(r(o))return o;const a=o.getElementBy(r);if(a)return a}}querySelector(r){return this.getElementBy(R(this,s,pn).call(this,r))}getElementsBy(r,o=[]){for(const a of this.childNodes)a.type!=="text"&&(r(a)&&o.push(a),a.getElementsBy(r,o));return o}querySelectorAll(r){return this.getElementsBy(R(this,s,pn).call(this,r))}escape(){for(const r of this.childNodes)r.escape()}}return s=new WeakSet,pn=function(r){return Mn(r,this)},t}}}),wr,Zs,yr,Gt,Su=I({"lib/element.ts"(){"use strict";fe(),Oe(),_o(),Co(),yu(),wr=[Io],Gt=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,l;e.splice(s,1),(i=e[s-1])==null||i.setAttribute("nextSibling",e[s]),(l=e[s])==null||l.setAttribute("previousSibling",e[s-1])};for(let s=e.length-1;s>=0;s--){const{type:i,data:l}=e[s];i!=="text"||e.length===1||this.getGaps(s-(s&&1))||l===""&&t(s)}this.setAttribute("childNodes",e)}removeAt(e){return ms(this,e,1)[0]}insertAt(e,t=this.length){return ms(this,t,0,[e]),e}closest(e){const t=Mn(e,this);let{parentNode:s}=this;for(;s;){if(t(s))return s;({parentNode:s}=s)}}append(...e){this.safeAppend(e)}safeAppend(e){for(const t of e)this.insertAt(t)}safeReplaceChildren(e){for(let t=this.length-1;t>=0;t--)this.removeAt(t);this.safeAppend(e)}setText(e,t=0){t+=t<0?this.length:0;const s=this.childNodes[t],{data:i}=s;return s.replaceData(e),i}toString(e,t=""){return this.childNodes.map(s=>s.toString(e)).join(t)}caretPositionFromIndex(e){{if(e===void 0)return;const{length:t}=this.toString();if(e>t||e<-t)return;e+=e<0?t:0;let s=this,i=0,l=0;for(;s.type!=="text";){const{childNodes:n}=s;i+=s.getAttribute("padding");for(let r=0;i<=e&&r<n.length;r++){const o=n[r],{nextSibling:a}=o,u=o.toString(),d=u.length;if(o.setAttribute("aIndex",i),i+=d,i>e||i===e&&d>0&&(!a||a.type==="text"||o.type!=="text"&&(u.trim()||!a.toString().trim()))){s=o,i-=d,l=i;break}i+=s.getGaps(r)}if(s.childNodes===n)return{offsetNode:s,offset:e-l}}return{offsetNode:s,offset:e-l}}this.lspError("AstElement.caretPositionFromIndex")}elementFromIndex(e){var t;{const s=(t=this.caretPositionFromIndex(e))==null?void 0:t.offsetNode;return(s==null?void 0:s.type)==="text"?s.parentNode:s}this.lspError("AstElement.elementFromIndex")}elementFromPoint(e,t){return this.elementFromIndex(this.indexFromPos(t,e))}lint(e=this.getAbsoluteIndex(),t){{const s=[];for(let i=0,l=e+this.getAttribute("padding");i<this.length;i++){const n=this.childNodes[i];n.setAttribute("aIndex",l);const r=n.lint(l,t);r.length>0&&s.push(...r),l+=n.toString().length+this.getGaps(i)}return s}}print(e={}){const t=e.class;return this.toString()?(t===""?"":`<span class="wpb-${t!=null?t:this.type}${this.getAttribute("invalid")?" wpb-invalid":""}">`)+It(this.childNodes,e)+(t===""?"":"</span>"):""}json(e,t=this.getAbsoluteIndex()){{const s={...this,type:this.type,range:[t,t+this.toString().length],childNodes:[]};for(let i=0,l=t+this.getAttribute("padding");i<this.length;i++){const n=this.childNodes[i],{length:r}=n.toString();n.setAttribute("aIndex",l),s.childNodes.push(n.type==="text"?{data:n.data,range:[l,l+r]}:n.json(void 0,l)),l+=r+this.getGaps(i)}return s}this.lspError("AstElement.json")}},Zs=oe(yr),Gt=re(Zs,0,"AstElement",wr,Gt),ne(Zs,1,Gt)}}),xs,Ms=I({"mixin/gapped.ts"(){"use strict";xs=(e=1)=>t=>{class s extends t{getGaps(){return e}}return s}}}),Be,qe=I({"mixin/noEscape.ts"(){"use strict";Be=e=>{{class t extends e{escape(){}}return t}}}}),Sr,No,Au=I({"src/parameter.ts"(){"use strict";fe(),K(),G(),V(),Sr=new RegExp(`https?://${_t}${Tt}$`,"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 l=new H(typeof e=="number"?void 0:e,s,i,{}),n=new H(t,s,i);l.type="parameter-key",l.setAttribute("stage",2),n.type="parameter-value",n.setAttribute("stage",2),this.append(l,n)}trimName(e,t=!0){const s=(typeof e=="string"?e:e.toString(!0)).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");return this.setAttribute("name",s),s}afterBuild(){if(!this.anon){const{parentNode:e,firstChild:t}=this,s=this.trimName(t);e&&e.getArgs(s,!1,!1).add(this)}super.afterBuild()}toString(e){return this.anon?this.lastChild.toString(e):super.toString(e,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(e=this.getAbsoluteIndex(),t){var s;{const i=super.lint(e,t),l="unescaped",{lintConfig:n}=N,r=n.getSeverity(l);if(r){const{firstChild:o}=this,a=(s=Sr.exec(o.text()))==null?void 0:s[0];try{if(a&&new URL(a).search){const u=X(o,{start:e},l,"unescaped-query",r);u.startIndex=u.endIndex,u.startLine=u.endLine,u.startCol=u.endCol,u.endIndex++,u.endCol++,(n.computeEditInfo||n.fix)&&(u.fix=Nt(u.startIndex,"{{=}}")),i.push(u)}}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,Ke=I({"src/atom.ts"(){"use strict";var e,t;V(),$e=(t=class extends H{constructor(i,l,n,r,o){super(i,n,r,o);P(this,e);j(this,e,l)}get type(){return w(this,e)}set type(i){j(this,e,i)}getAttribute(i){var l;return i==="invalid"?this.type==="converter-flag"&&!!((l=this.parentNode)!=null&&l.isInvalidFlag(this)):super.getAttribute(i)}},e=new WeakMap,t)}}),Qe,Et=I({"src/syntax.ts"(){"use strict";var e,t;V(),Qe=(t=class extends H{constructor(i,l,n,r,o){super(i,n,r,o);P(this,e);j(this,e,l)}get type(){return w(this,e)}lint(i=this.getAbsoluteIndex()){return super.lint(i,!1)}},e=new WeakMap,t)}}),Lo={};ae(Lo,{TranscludeToken:()=>lt});var Ar,ei,kr,lt,Fo=I({"src/transclude.ts"(){"use strict";var e,t,s,i,l,n,Vt,Eo,a;fe(),K(),Oe(),me(),Ms(),qe(),G(),V(),Au(),Ke(),Et(),Ar=[Be,xs()],lt=(a=class extends(kr=H){constructor(d,c,f,p=[]){var A,L;let v;const k=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(d);k&&(v=Number(k[1]),d=d.replace(`\0${v}h`,p[v].toString().replace(/^\n/u,"")));super(void 0,f,p,{});P(this,n);Le(this,"modifier","");P(this,e,"template");P(this,t,":");P(this,s,!1);P(this,i,new Map);P(this,l);const{parserFunction:[$,_],variable:T,functionHook:g}=f,h=(A=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(d))==null?void 0:A[0];if(h)this.setAttribute("modifier",h),d=d.slice(h.length);else if(d.includes(":")){const[C,...F]=d.split(":"),[B]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((L=F[0])!=null?L:"");this.setModifier(`${C}:${B}`)&&(d=F.join(":").slice(B.length))}const x=d.search(/[::]/u),b=d[x]===":",m=x!==-1;if(m||c.length===0&&!w(this,s)){const C=m?d.slice(0,x):d,F=m&&d.slice(x+1),B=Te(C),O=m?B.slice(B.search(/\S/u))+(b?":":""):B.trim(),E=O.toLowerCase(),D=Array.isArray(_),W=D?_.includes(O):Object.prototype.hasOwnProperty.call(_,O),q=!D&&W?_[O]:Object.prototype.hasOwnProperty.call($,E)&&$[E],z=D&&W||!("functionHook"in f)||g.includes(q),M=D&&W||T.includes(q);if(m?q&&z:M){this.setAttribute("name",q||E.replace(/^#|:$/u,"")),j(this,e,"magic-word"),b&&j(this,t,":");const Q=new Qe(C,"magic-word-name",f,p);if(super.insertAt(Q),F!==!1&&c.unshift([F]),this.name==="invoke")for(let J=0;J<2;J++){const se=c.shift();if(!se)break;const ue=new $e(se.join("="),`invoke-${J?"function":"module"}`,f,p);super.insertAt(ue)}}}if(this.type==="template"){const C=Te(d).trim();if(!this.normalizeTitle(C,10,{halfParsed:!0,temporary:!0}).valid)throw p.pop(),new SyntaxError("Invalid template name");const F=new $e(d,"template-name",f,p,{});super.insertAt(F)}typeof v=="number"&&(p[v]=void 0);const y=this.isTemplate();let S=1;for(let C=0;C<c.length;C++){const F=c[C];y||this.name==="switch"&&C>0||this.name==="tag"&&C>1||(F[0]=F.join("="),F.length=1),F.length===1&&(F.unshift(S),S++),this.insertAt(new No(...F,f,p))}this.seal("modifier")}get type(){return w(this,e)}get module(){return this.type==="magic-word"&&this.name==="invoke"?R(this,n,Vt).call(this).title:void 0}get function(){var d;return this.type==="magic-word"&&this.name==="invoke"?(d=this.childNodes[2])==null?void 0:d.text().trim():void 0}setModifier(d){const{parserFunction:[,,c,f]}=this.getAttribute("config"),p=Te(d).trim();if(d&&!p.endsWith(":"))return!1;const v=p.slice(0,-1).toLowerCase(),k=c.includes(v),$=f.includes(v);return w(this,s)&&k||!w(this,s)&&($||!d)||(we.running||this.length>1)&&(k||$||!d)?(this.setAttribute("modifier",d),j(this,s,k),!!d):!1}isTemplate(){return this.type==="template"||this.name==="invoke"}afterBuild(){this.modifier.includes("\0")&&this.setAttribute("modifier",this.buildFromStr(this.modifier,0)),super.afterBuild(),this.isTemplate()&&this.type==="template"&&(j(this,l,R(this,n,Vt).call(this)),this.setAttribute("name",w(this,l).title))}toString(d){const{childNodes:c,length:f,firstChild:p,modifier:v,type:k}=this;return`{{${v}${k==="magic-word"?p.toString(d)+(f===1?"":w(this,t))+c.slice(1).map($=>$.toString(d)).join("|"):super.toString(d,"|")}}}`}text(){const{childNodes:d,length:c,firstChild:f,modifier:p,type:v,name:k}=this;return v==="magic-word"&&k==="vardefine"?"":`{{${p}${v==="magic-word"?f.text()+(c===1?"":w(this,t))+dt(d.slice(1),"|"):super.text("|")}}}`}getAttribute(d){switch(d){case"padding":return this.modifier.length+2;case"title":return w(this,l);case"colon":return w(this,t);case"invalid":return this.type==="magic-word"&&this.name==="invoke"&&(this.length===2||!R(this,n,Vt).call(this).valid);default:return super.getAttribute(d)}}lint(d=this.getAbsoluteIndex(),c){{const f=super.lint(d,c);if(!this.isTemplate())return f;const{type:p,childNodes:v,length:k}=this,$=new ce(this,d),{lintConfig:_}=N,{computeEditInfo:T}=_,g=p==="magic-word";let h="no-ignored",x=_.getSeverity(h,"fragment");if(g&&!R(this,n,Vt).call(this).valid)h="invalid-invoke",x=_.getSeverity(h,"name"),x&&f.push(X(v[1],$,h,"illegal-module",x));else if(x){const b=v[g?1:0],m=b.childNodes.findIndex(S=>S.type==="text"&&ds(S.data).includes("#")),y=b.childNodes[m];if(y){const S=X(b,$,h,"useless-fragment",x);T&&(S.suggestions=[te(S,b.getRelativeIndex(m)+y.data.indexOf("#"))]),f.push(S)}}if(h="invalid-invoke",x=_.getSeverity(h,"function"),x&&g&&k===2)return f.push(ie(this,$,h,"missing-function",x)),f;if(h="no-duplicate",x=_.getSeverity(h,"parameter"),x){const b=this.getDuplicatedArgs().filter(([,y])=>!y[0].querySelector("ext")),m="duplicate-parameter";for(const[,y]of b)f.push(...y.map(S=>{const A=X(S,$,h,m,x);return T&&(A.suggestions=[te(A,-1)]),A}))}return f}}insertAt(d,c=this.length){return super.insertAt(d,c),d.anon?R(this,n,Eo).call(this,d):d.name&&this.getArgs(d.name,!1,!1).add(d),d}getAllArgs(){return this.childNodes.filter(Qs("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:d})=>d)}getArgs(d,c,f=!0){const p=String(d).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");let v;return w(this,i).has(p)?v=w(this,i).get(p):(v=new Set(this.getAllArgs().filter(({name:k})=>p===k)),w(this,i).set(p,v)),v}getDuplicatedArgs(){return[...w(this,i)].filter(([,{size:d}])=>d>1).map(([d,c])=>[d,[...c]])}getPossibleValues(){const{type:d,name:c,childNodes:f}=this;if(d==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let p,v;switch(c){case"if":case"ifexist":case"ifexpr":case"iferror":p=2;break;case"ifeq":p=3;break;case"switch":{const k=f.slice(2),$=k[k.length-1];v=[...k.filter(({anon:_})=>!_),...$!=null&&$.anon?[$]:[]].map(({lastChild:_})=>_);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}v!=null||(v=f.slice(p,p+2).map(({lastChild:k})=>k));for(let k=0;k<v.length;){const{length:$,0:_}=v[k].childNodes.filter(T=>T.text().trim());if($===0)v.splice(k,1);else if($>1||_.type!=="magic-word")k++;else try{const T=_.getPossibleValues();v.splice(k,1,...T),k+=T.length}catch{k++}}return v}print(){const{childNodes:d,length:c,firstChild:f,modifier:p,type:v}=this;return`<span class="wpb-${v}${this.getAttribute("invalid")?" wpb-invalid":""}">{{${v==="magic-word"?cs(p)+f.print()+(c===1?"":w(this,t))+It(d.slice(1),{sep:"|"}):(p?`<span class="wpb-magic-word">${cs(p)}</span>`:"")+It(d,{sep:"|"})}}}</span>`}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,l=new WeakMap,n=new WeakSet,Vt=function(){const d=this.type==="template";return this.normalizeTitle(this.childNodes[d?0:1].text(),d?10:828,{temporary:!0})},Eo=function(d){const c=this.getAnonArgs(),f=typeof d!="number";for(let p=f?c.indexOf(d):d-1;p<c.length;p++){const v=c[p],{name:k}=v,$=String(p+1);(k!==$||v===d)&&(v.setAttribute("name",$),this.getArgs($,!1,!1).add(v))}},a),ei=oe(kr),lt=re(ei,0,"TranscludeToken",Ar,lt),ne(ei,1,lt)}}),ys,ti,si,$r,_r,Tr,Cr,ii,Ir,fn,ku=I({"lib/text.ts"(){"use strict";var e,mn,s;fe(),K(),Oe(),G(),Co(),ys=String.raw`[${Ge}\t]*`,ti=String.raw`[^\S\n]*`,si=String.raw`<${ti}(?:/${ti})?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|(?:rfc|pmid)(?=[-::]?${ys}\d)|isbn(?=[-::]?${ys}(?:\d(?:${ys}|-)){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}})(),fn=(s=class extends rt{constructor(n){super();P(this,e);Le(this,"data","");this.data=n}get type(){return"text"}toString(n){var r;return n&&!((r=this.parentNode)!=null&&r.getAttribute("built"))?Te(this.data):this.data}text(){return this.data}lint(n=this.getAbsoluteIndex(),r){var o,a,u;{if(r===!1)return[];const{data:d,parentNode:c,nextSibling:f,previousSibling:p}=this;if(!c)throw new Error("An isolated text node cannot be linted!");const{type:v,name:k,parentNode:$}=c;if(v==="attr-value"){const{name:E,tag:D}=$;if(D==="ref"&&(E==="name"||E==="follow")||E==="group"&&(D==="ref"||D==="references")||D==="choose"&&(E==="before"||E==="after"))return[]}if(r!=null||(r=v==="free-ext-link"||v==="ext-link-url"||v==="ext-link-text"||v==="image-parameter"&&k==="link"||v==="attr-value"?_r:$r),d.search(r)===-1)return[];r.lastIndex=0;const _=[],T=f==null?void 0:f.type,g=f==null?void 0:f.name,h=p==null?void 0:p.type,x=this.getRootNode(),b=x.toString(),{ext:m,html:y,variants:S}=x.getAttribute("config"),{top:A,left:L}=x.posFromIndex(n),{lintConfig:C}=N,F=C.rules["tag-like"],B=typeof F=="object"&&F[1]?new Set(Object.keys(F[1]).filter(E=>E!=="invalid"&&E!=="disallowed")):new Set,O=new Set(["onlyinclude","noinclude","includeonly",...m,...y[0],...y[1],...y[2],...B,...C.getSeverity("tag-like","disallowed")?ii:[]]);for(let E=r.exec(d);E;E=r.exec(d)){const[,D,W]=E;let{index:q,0:z}=E;if(W&&W!=="]"){const{length:ye}=W;q+=ye,z=z.slice(ye)}z=z.toLowerCase();const[M]=z,Q=M==="r"||M==="p"||M==="i",J=M==="{",se=M==="}",ue=M==="[",he=M==="]";let{length:le}=z;if(M==="<"&&!O.has(D.toLowerCase())||ue&&v==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(d.slice(q+1))||f!=null&&f.is("ext")&&g==="nowiki"&&((o=f.innerText)!=null&&o.includes("]")))||Q&&(!c.isPlain()||Tr.has(v)))continue;he&&(q||le>1)&&r.lastIndex--;let Ie=n+q,Ne=Ie+le,U,Y;const ge=b[Ne],ve=b[Ie-1],Ce=J||ue,Me=J&&ve==="-"&&S.length>0,Se=se&&ge==="-"&&S.length>0,gt=ue&&T==="free-ext-link"&&!d.slice(q+1).trim()||he&&h==="free-ext-link"&&!d.slice(0,q).includes("]");if(Q)U="lonely-http",z=z.toUpperCase(),Y=C.getSeverity(U,z);else if(M==="<"){U="tag-like";let ye;/^<\/?\s/u.test(z)||!/[\s/>]/u.test(ge!=null?ge:"")?ye="invalid":B.has(D)?ye=D:ii.has(D)&&!m.includes(D)&&(ye="disallowed"),Y=C.getSeverity(U,ye)}else if(Me||Se)U="lonely-bracket",Y=C.getSeverity(U,"converter"),Me&&q>0?(z="-{",q--,Ie--,le=2):Se&&q<d.length-1&&(z="}-",Ne++,le=2);else if(gt)U="lonely-bracket",Y=C.getSeverity(U,"extLink");else if(Ce||se||he)if(U="lonely-bracket",le>1||J&&ge===M||se&&ve===M)Y=C.getSeverity(U,"double");else{if(!ue||v!=="ext-link-text"){const ye=Cr[M],Js=Ce?d.slice(q+1):d.slice(0,q);if(J&&((a=ye.exec(Js))==null?void 0:a[0])==="}"||se&&((u=ye.exec(Js))==null?void 0:u[0])==="{")continue;if(!Js.includes(M)){const lr=Ce?"nextSibling":"previousSibling";let st=this[lr];for(;st&&(st.type!=="text"||!ye.test(st.data));)st=st[lr];if(st&&ye.exec(st.data)[0]!==M)continue}}Y=C.getSeverity(U,"single")}else U="lonely-http",Y=C.getSeverity(U);if(!Y)continue;const Z=this.posFromIndex(q),{line:et,character:Rt}=gs(A,L,Z.top+1,Z.left),tt={rule:U,message:N.msg("lonely",Q||M==="h"||Me||Se?z:M),severity:Y,startIndex:Ie,endIndex:Ne,startLine:et,endLine:et,startCol:Rt,endCol:Rt+le};if(C.computeEditInfo)if(M==="<")tt.suggestions=[Nt(Ie,"<")];else if(M==="h"&&v!=="link-text"&&Ir.test(ve||""))tt.suggestions=[ps(Ie)];else if(ue&&v==="ext-link-text"){const ye=c.getAbsoluteIndex()+c.toString().length;tt.suggestions=[Nt(ye,"]")]}else if(he&>){const ye=n-p.toString().length;tt.suggestions=[qs(ye,"left-bracket","[")]}else Q&&(tt.suggestions=[...E[0]===z?[]:[Bn(tt,z)],...ge===":"||ge===":"?[ps(Ne,1)]:[]]);_.push(tt)}return _}}replaceData(n){R(this,e,mn).call(this,n)}splitText(n){{const{parentNode:r,data:o}=this;if(!r)throw new Error("The text node to be split has no parent node!");const a=new s(o.slice(n));return ms(r,r.childNodes.indexOf(this)+1,0,[a]),this.setAttribute("data",o.slice(0,n)),a}this.lspError("AstText.splitText")}escape(){{const{parentNode:n}=this;if(!n)throw new Error("The text node to be escaped has no parent node!");const{TranscludeToken:r}=(Fo(),ee(Lo)),o=n.getAttribute("config"),a=n.childNodes.indexOf(this)+1,u=f=>Math.max(this.data.lastIndexOf("=",f),this.data.lastIndexOf("|",f));let d=u();const c=()=>new r(this.data[d]==="="?"=":"!",[],o);for(;d>=0;d=u(d-1))d<this.data.length-1&&this.splitText(d+1),n.insertAt(we.run(c),a),R(this,e,mn).call(this,this.data.slice(0,d))}}print(){return cs(this.data)}},e=new WeakSet,mn=function(n){this.setAttribute("data",n)},s)}}),ct,jt=I({"mixin/hidden.ts"(){"use strict";ct=(e=!0,t=!0)=>s=>{class i extends s{text(){return""}lint(n){return e?[]:super.lint(n)}}return i}}}),We,Ye=I({"mixin/padded.ts"(){"use strict";We=({length:e})=>t=>{class s extends t{getAttribute(l){return l==="padding"?e:super.getAttribute(l)}}return s}}}),Nr,Lr,ni,Fr,De,Us=I({"src/link/base.ts"(){"use strict";var e,t,s,i;K(),Je(),me(),Ye(),qe(),G(),V(),Ke(),Nr=l=>l==="redirect-target"||l==="link",Lr=[Be,We("[[")],De=(i=class extends(Fr=H){constructor(n,r,o,a=[],u="|"){super(void 0,o,a,{});P(this,e,!0);P(this,t);P(this,s);if(this.insertAt(new $e(n,"link-target",o,a,{})),r!==void 0){const d=new H(r,o,a,{});d.type="link-text",d.setAttribute("stage",ke-1),this.insertAt(d)}j(this,t,u)}get link(){return w(this,s)}get fragment(){return w(this,s).fragment}afterBuild(){j(this,s,this.getTitle()),w(this,t).includes("\0")&&j(this,t,this.buildFromStr(w(this,t),0)),this.setAttribute("name",w(this,s).title),super.afterBuild()}setAttribute(n,r){n==="bracket"?j(this,e,r):n==="title"?j(this,s,r):super.setAttribute(n,r)}toString(n){const r=super.toString(n,w(this,t));return w(this,e)?`[[${r}]]`:r}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(),r){{const o=super.lint(n,r),{childNodes:[a,u],type:d}=this,{encoded:c,fragment:f}=w(this,s),{lintConfig:p}=N,{computeEditInfo:v,fix:k}=p,$=new ce(this,n);let _="unknown-page",T=p.getSeverity(_);if(T&&a.childNodes.some(({type:g})=>g==="template")&&o.push(X(a,$,_,"template-in-link",T)),_="url-encoding",T=p.getSeverity(_),T&&c){const g=X(a,$,_,"unnecessary-encoding",T);(v||k)&&(g.fix=Rn(g,a)),o.push(g)}if(_="pipe-like",T=p.getSeverity(_,"link"),T&&(d==="link"||d==="category")){const g=u==null?void 0:u.childNodes.findIndex(x=>x.type==="text"&&x.data.includes("|")),h=u==null?void 0:u.childNodes[g];if(h){const x=X(u,$,_,"pipe-in-link",T);if(v){const b=x.startIndex+u.getRelativeIndex(g);x.suggestions=[qn(b,h.data)]}o.push(x)}}if(_="no-ignored",T=p.getSeverity(_,"fragment"),T&&f!==void 0&&!Nr(d)){const g=X(a,$,_,"useless-fragment",T);if(v||k){const h=a.childNodes.findIndex(b=>b.type==="text"&&b.data.includes("#")),x=a.childNodes[h];x&&(g.fix=te(g,a.getRelativeIndex(h)+x.data.indexOf("#")))}o.push(g)}return o}}getTitle(n,r){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:r,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,r=this.getAbsoluteIndex()){const o=super.json(void 0,r);{const{type:a,fragment:u}=this;return u!==void 0&&(a==="link"||a==="redirect-target")&&(o.fragment=u),o}}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i),ni=oe(Fr),De=re(ni,0,"LinkBaseToken",Lr,De),ne(ni,1,De)}}),Er,ri,jr,Pe,ht=I({"src/nowiki/base.ts"(){"use strict";qe(),V(),Er=[Be],Pe=class extends(jr=H){get innerText(){return this.firstChild.data}constructor(e="",t,s){super(e,t,s)}},ri=oe(jr),Pe=re(ri,0,"NowikiBaseToken",Er,Pe),ne(ri,1,Pe)}}),Rr,li,Pr,xe,Ze=I({"src/nowiki/noinclude.ts"(){"use strict";jt(),ht(),Rr=[ct()],xe=class extends(Pr=Pe){get type(){return"noinclude"}toString(e){return e?"":super.toString()}},li=oe(Pr),xe=re(li,0,"NoincludeToken",Rr,xe),ne(li,1,xe)}}),jo,$u=I({"src/link/redirectTarget.ts"(){"use strict";K(),G(),Us(),Ze(),jo=class extends De{get type(){return"redirect-target"}constructor(e,t,s,i){super(e,void 0,s,i),t!==void 0&&this.insertAt(new xe(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,l=i.getSeverity(s,"redirect");if(l&&this.length===2){const n=X(this.lastChild,{start:e},s,"useless-link-text",l);n.startIndex--,n.startCol--,(i.computeEditInfo||i.fix)&&(n.fix=te(n)),t.push(n)}return t}}}}}),Or,oi,Br,Qt,_u=I({"src/redirect.ts"(){"use strict";var e,t,s;jt(),qe(),V(),Et(),$u(),Or=[ct(!1,!1),Be],Qt=(s=class extends(Br=H){constructor(l,n,r,o,a,u,d=[]){super(void 0,u,d);P(this,e);P(this,t);j(this,e,l),j(this,t,a),this.append(new Qe(n,"redirect-syntax",u,d),new jo(r,o==null?void 0:o.slice(1),u,d))}get type(){return"redirect"}getAttribute(l){return l==="padding"?w(this,e).length:super.getAttribute(l)}toString(l){return w(this,e)+super.toString(l)+w(this,t)}lint(l=this.getAbsoluteIndex()){{const n=l+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=oe(Br),Qt=re(oi,0,"RedirectToken",Or,Qt),ne(oi,1,Qt)}}),Ro={};ae(Ro,{parseRedirect:()=>Po});var Po,Tu=I({"parser/redirect.ts"(){"use strict";G(),_u(),Po=(e,t,s)=>{var l;(l=t.regexRedirect)!=null||(t.regexRedirect=new RegExp(String.raw`^(\s*)((?:${t.redirection.join("|")})\s*(?::\s*)?)\[\[([^\n|\]]+)(\|.*?)?\]\](\s*)`,"iu"));const i=t.regexRedirect.exec(e);return i&&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 Qt(...i.slice(1),t,s),e):!1}}}),qr,ai,Wr,Jt,Cu=I({"src/onlyinclude.ts"(){"use strict";Ye(),qe(),V(),qr=[Be,We("<onlyinclude>")],Jt=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=oe(Wr),Jt=re(ai,0,"OnlyincludeToken",qr,Jt),ne(ai,1,Jt)}}),Mr,ui,Ur,ot,zn=I({"src/tagPair/index.ts"(){"use strict";var e,t;Ms(),qe(),V(),Mr=[xs(),Be],ot=(t=class extends(Ur=H){constructor(i,l,n,r,o,a=[]){super(void 0,o);P(this,e);Le(this,"closed");Le(this,"selfClosing");this.setAttribute("name",i.toLowerCase()),j(this,e,[i,r||i]),this.closed=r!=="",this.selfClosing=r===void 0,this.append(l,n);const u=typeof l=="string"?-1:a.indexOf(l);a.splice(u===-1?1/0:u,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(i){const{selfClosing:l,firstChild:n,lastChild:r}=this,[o,a]=w(this,e);return l?`<${o}${n.toString(i)}/>`:`<${o}${n.toString(i)}>${r.toString(i)}${this.closed?`</${a}>`:""}`}text(){const[i,l]=w(this,e);return this.selfClosing?`<${i}${this.firstChild.text()}/>`:`<${i}${super.text(">")}${this.closed?`</${l}>`:""}`}getAttribute(i){return i==="padding"?w(this,e)[0].length+1:super.getAttribute(i)}print(){const[i,l]=w(this,e);return super.print(this.selfClosing?{pre:`<${i}`,post:"/>"}:{pre:`<${i}`,sep:">",post:this.closed?`</${l}>`:""})}},e=new WeakMap,t),ui=oe(Ur),ot=re(ui,0,"TagPairToken",Mr,ot),ne(ui,1,ot)}}),Oo,Iu=I({"src/tagPair/translate.ts"(){"use strict";var e,Bo,s;V(),zn(),Et(),Ze(),Oo=(s=class extends ot{constructor(l,n,r,o=[]){const a=new Qe(l,"translate-attr",r,o);n=n==null?void 0:n.replace(/(<tvar\|[^>]+>)([\s\S]*?)(<\/>)/gu,(d,c,f,p)=>(new xe(c,r,o),new xe(p,r,o),`\0${o.length-1}n${f}\0${o.length}n`)).replace(/(<tvar\s+name\s*=(?:\s*(?:(["'])[\s\S]*?\2|[^"'\s>]+))?\s*>)([\s\S]*?)(<\/tvar\s*>)/giu,(d,c,f,p,v)=>(new xe(c,r,o),new xe(v,r,o),`\0${o.length-1}n${p}\0${o.length}n`));const u=new H(n,r,o);u.type="translate-inner";super("translate",a,u,"translate",r,o);P(this,e);this.seal("closed",!0),this.seal("selfClosing",!0)}get type(){return"translate"}toString(l){return l?this.lastChild.toString(!0):super.toString()}text(){return this.lastChild.text()}print(){return`<span class="wpb-ext"><translate${R(this,e,Bo).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,Bo=function(){return this.firstChild.toString()===" nowrap"},s)}}),zr,di,Hr,Xt,Nu=I({"src/tagPair/include.ts"(){"use strict";K(),me(),jt(),G(),zn(),zr=[ct(!1)],Xt=class extends(Hr=ot){get type(){return"include"}constructor(e,t="",s,i,l,n){super(e,t,s!=null?s:"",s===void 0||i!=null?i:"",l,n)}toString(e){return e?"":super.toString()}lint(e=this.getAbsoluteIndex()){{const t=[],{firstChild:s,closed:i,name:l}=this,n=new ce(this,e),r=["no-ignored","unclosed-comment"],{lintConfig:o}=N,{computeEditInfo:a}=o,u=r.map(d=>o.getSeverity(d,"include"));if(u[0]&&s.data.trim()){const d=X(s,n,r[0],"useless-attribute",u[0]);a&&(d.suggestions=[te(d)]),t.push(d)}if(u[1]&&!i){const d=ie(this,n,r[1],N.msg("unclosed",`<${l}>`),u[1]);a&&(d.suggestions=[Ve(d.endIndex,`</${l}>`)]),t.push(d)}return t}}},di=oe(Hr),Xt=re(di,0,"IncludeToken",zr,Xt),ne(di,1,Xt)}}),zs,Hn=I({"mixin/attributesParent.ts"(){"use strict";zs=(e=0)=>t=>{var i,xn;class s extends t{constructor(){super(...arguments);P(this,i)}hasAttr(o){return R(this,i,xn).call(this).hasAttr(o)}getAttr(o){return R(this,i,xn).call(this).getAttr(o)}}return i=new WeakSet,xn=function(){return this.childNodes[e]},s}}}),de,ci,hi,Mt,Ss,gi,it,pi,fi,mi,As,xi,je,Dn,Gn,Vn,qo,Wo=I({"util/sharable.ts"(){"use strict";de=new Set(["align"]),ci=new Set(["cite"]),hi=new Set(["cite","datetime"]),Mt=new Set(["width"]),Ss=new Set(["axis","align","bgcolor","height","width","valign"]),gi=new Set([...Ss,"abbr","headers","scope","rowspan","colspan"]),it=new Set(["type"]),pi=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),fi=new Set(["clear"]),mi=new Set(["bgcolor","align","valign"]),As=new Set(["qid","forcemathmode","type","display"]),xi=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:ci,q:ci,p:de,br:fi,pre:Mt,ins:hi,del:hi,ul:it,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...pi,"border"]),caption:de,tr:mi,td:gi,th:gi,font:new Set(["size","color","face"]),hr:Mt,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([...As,"chem"]),chem:As,ce:As,hiero:je,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:xi,syntaxhighlight:xi,templatedata:je,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:je},qo={table:pi,td:new Set([...Ss,"scope"]),th:Ss,br:fi,caption:de,div:de,hr:Mt,h1:de,h2:de,h3:de,h4:de,h5:de,h6:de,li:it,p:de,pre:Mt,tr:mi,ul:it}}}),Dr,Gr,Vr,Qr,Ls,Lu=I({"src/attribute.ts"(){"use strict";var e,t,s,i,l,vn,r;K(),fe(),Je(),Wo(),me(),G(),V(),Ke(),Dr=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,Gr=/(?:^|\s|\*\/)(?:javascript|vbscript)(?:\W|$)/iu,Vr=new Set(["ext","arg","magic-word","template"]),Qr=new Set(["about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),Ls=(r=class extends H{constructor(a,u,d,c="",f,p=[],v=N.getConfig(),k=[]){const $=new $e(d,"attr-key",v,k);let _;if(d==="title"||u==="img"&&d==="alt")_=new H(f,v,k,{}),_.type="attr-value",_.setAttribute("stage",ke-1);else if(u==="gallery"&&d==="caption"||u==="choose"&&(d==="before"||d==="after")){const T={...v,excludes:[...v.excludes,"heading","html","table","hr","list"]};_=new H(f,T,k,{}),_.type="attr-value",_.setAttribute("stage",1)}else _=new $e(f,"attr-value",v,k,{});super(void 0,v,k);P(this,l);P(this,e);P(this,t);P(this,s);P(this,i);j(this,e,a),this.append($,_),j(this,s,c),j(this,i,[...p]),j(this,t,u),this.setAttribute("name",Ct(Te(d)))}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")&&j(this,s,this.buildFromStr(w(this,s),0)),this.parentNode&&j(this,t,this.parentNode.name),this.setAttribute("name",Ct(this.firstChild.text())),super.afterBuild()}toString(a){const[u="",d=""]=w(this,i);return w(this,s)?super.toString(a,w(this,s)+u)+d: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 d;{const c=super.lint(a,u),{balanced:f,firstChild:p,lastChild:v,name:k,tag:$}=this,_=new ce(this,a),T=["unclosed-quote","obsolete-attr"],{lintConfig:g}=N,h=T.map(b=>g.getSeverity(b,k));if(h[0]&&!f){const b=X(v,_,T[0],"unclosed-quotes",h[0]);b.startIndex--,b.startCol--,g.computeEditInfo&&(b.suggestions=[Ve(b.endIndex,w(this,i)[0])]),c.push(b)}const x=R(this,l,vn).call(this,a,_);return x&&c.push(x),h[1]&&((d=qo[$])!=null&&d.has(k))&&c.push(X(p,_,T[1],"obsolete-attribute",h[1])),c}}getValue(){return w(this,s)?this.lastChild.text().trim():this.type==="ext-attr"||""}escape(){j(this,s,"{{=}}"),this.lastChild.escape()}getAttribute(a){return a==="invalid"?R(this,l,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 d=super.json(void 0,u);return d.tag=this.tag,d}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,l=new WeakSet,vn=function(a,u){const{firstChild:d,lastChild:c,type:f,name:p,tag:v,parentNode:k}=this,$=!c.childNodes.some(({type:y})=>Vr.has(y)),_=this.getValue(),T=Vn[v],g=Gn[v],{length:h}=this.toString();let x="illegal-attr",b,m;if({lintConfig:b}=N,{computeEditInfo:m}=b,!(T!=null&&T.has(p))&&!(g!=null&&g.has(p))&&(f==="ext-attr"?T||g:!/\{\{[^{]+\}\}/u.test(p))&&(f==="ext-attr"&&!g||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(p)&&(v==="meta"||v==="link"||!Dn.has(p)))||(p==="itemtype"||p==="itemid"||p==="itemref")&&!(k!=null&&k.hasAttr("itemscope"))){if(a===void 0)return!0;{const y=b.getSeverity(x,"unknown");if(y){const S=X(d,u,x,"illegal-attribute-name",y);return m&&(S.suggestions=[te(a,h)]),S}}}else if(p==="style"&&typeof _=="string"&&Dr.test(_)){if(a===void 0)return!0;{x="insecure-style";const y=b.getSeverity(x);return y&&X(c,u,x,"insecure-style",y)}}else if(p==="tabindex"&&typeof _=="string"&&_!=="0"){if(a===void 0)return!0;{const y=b.getSeverity(x,"tabindex");if(y){const S=X(c,u,x,"nonzero-tabindex",y);return m&&(S.suggestions=[te(a,h),Re(S,"0 tabindex","0")]),S}}}else if(typeof _=="string"&&((/^xmlns:[\w:.-]+$/u.test(p)||Qr.has(p))&&Gr.test(_)||$&&(p==="href"||v==="img"&&p==="src")&&!new RegExp(String.raw`^(?:${this.getAttribute("config").protocol}|//)\S+$`,"iu").test(_))){if(a===void 0)return!0;{const y=b.getSeverity(x,"value");return y&&X(c,u,x,"illegal-attribute-value",y)}}else if($&&f!=="ext-attr"){const y=Wn(v,p),S=String(_).toLowerCase();if(y.length>0&&y.every(A=>A!==S)){if(a===void 0)return!0;{const A=b.getSeverity(x,"value");return A&&X(c,u,x,"illegal-attribute-value",A)}}}return!1},r)}}),vi,Jr,Xr,Hs,Qn=I({"src/attributes.ts"(){"use strict";var e,t,Fs,i;K(),fe(),me(),G(),V(),Ke(),Lu(),vi=l=>l.slice(0,-1),Jr=l=>`${vi(l)}-dirty`,Xr=(()=>{try{return new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch{return/[^\W_]/u}})(),Hs=(i=class extends H{constructor(n,r,o,a,u=[]){super(void 0,a,u,{});P(this,t);P(this,e);if(j(this,e,r),this.setAttribute("name",o),n){const d=/([^\s/](?:(?!\0\d+~\x7F)[^\s/=])*)(?:((?:\s(?:\s|\0\d+[cn]\x7F)*)?(?:=|\0\d+~\x7F)(?:\s|\0\d+[cn]\x7F)*)(?:(["'])([\s\S]*?)(\3|$)|(\S*)))?/gu;let c="",f=d.exec(n),p=0;const v=()=>{c&&(super.insertAt(new $e(c,Jr(r),a,u,{})),c="")};for(;f;){const{index:k,0:$,1:_,2:T,3:g,4:h,5:x,6:b}=f;if(c+=n.slice(p,k),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(Te(_).trim())){const m=h!=null?h:b,y=[g,x],S=new Ls(vi(r),o,_,T,m,y,a,u);v(),super.insertAt(S)}else c+=$;({lastIndex:p}=d),f=d.exec(n)}c+=n.slice(p),v()}}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(r=>r instanceof Ls&&(!n||r.name===Ct(n)))}hasAttr(n){return this.getAttrTokens(n).length>0}getAttrToken(n){const r=this.getAttrTokens(n);return r[r.length-1]}getAttr(n){var r;return(r=this.getAttrToken(n))==null?void 0:r.getValue()}lint(n=this.getAbsoluteIndex(),r){{const o=super.lint(n,r),{parentNode:a,childNodes:u}=this,d=new Map,c=new Set,f=new ce(this,n),p=["no-ignored","no-duplicate"],{lintConfig:v}=N,{computeEditInfo:k,fix:$}=v,_=["closingTag","invalidAttributes","nonWordAttributes"].map(g=>v.getSeverity(p[0],g));if(_[0]&&R(this,t,Fs).call(this)){const g=ie(this,f,p[0],"attributes-of-closing-tag",_[0]);if(k){const h=a.getAbsoluteIndex();g.suggestions=[te(g),Pn(h)]}o.push(g)}for(const g of u)if(g instanceof Ls){const{name:h}=g;d.has(h)?(c.add(h),d.get(h).push(g)):d.set(h,[g])}else{const h=g.text().trim(),x=_[Xr.test(h)?1:2];if(h&&x){const b=X(g,f,p[0],"invalid-attribute",x);k&&(b.suggestions=[te(b,0," ")]),o.push(b)}}const T=v.getSeverity(p[1],"attribute");if(T&&c.size>0)for(const g of c){const h=d.get(g).map(x=>{const b=x.getValue();return[x,b===!0?"":b]});o.push(...h.map(([x,b],m)=>{const y=X(x,f,p[1],N.msg("duplicate-attribute",g),T);if(k||$){const S=te(y);!b||h.slice(0,m).some(([,A])=>A===b)?y.fix=S:k&&(y.suggestions=[S])}return y}))}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)}}),Mo={};ae(Mo,{PreToken:()=>Uo});var Uo,Fu=I({"src/pre.ts"(){"use strict";Je(),V(),Ze(),Uo=class extends H{get type(){return"ext-inner"}constructor(e,t,s=[]){if(e){const i=/<nowiki>/giu,l=/<\/nowiki>/giu,{length:n}=i.source;let r=i.exec(e);r&&(l.lastIndex=r.index+n);let o=l.exec(e),a=0,u="";for(;r&&o;)new xe(r[0],t,s),new xe(o[0],t,s),u+=`${e.slice(a,r.index)}\0${s.length-1}n${e.slice(r.index+n,o.index)}\0${s.length}n`,a=o.index+n+1,i.lastIndex=a,r=i.exec(e),r&&(l.lastIndex=r.index+n),o=l.exec(e);e=u+e.slice(a)}super(e,t,s,{}),this.setAttribute("stage",ke-1)}isPlain(){return!0}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*\/\s*(pre)\b/giu)}}}}),Ds,Jn=I({"mixin/multiLine.ts"(){"use strict";Ds=e=>{class t extends e{toString(i){return super.toString(i,`
|
|
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
|
-
`})}}return
|
|
7
|
-
`).map(r
|
|
8
|
-
`,index:e.length},x=(
|
|
9
|
-
`){
|
|
10
|
-
`)||(e=`${e.slice(0,
|
|
11
|
-
)`:""}(\s*)$`,"u")),
|
|
12
|
-
`))!=null?
|
|
13
|
-
`),l=new Set(t.protocol.split("|")),n=xe;let r=!0,o=!1;for(const a of i){const u=a.trim();if(!(o||!u||u.startsWith("#"))){if(r){const d=a.indexOf("|"),c=d===-1?a:a.slice(0,d),{valid:f,ns:p}=this.normalizeTitle(c,0,{halfParsed:!0,temporary:!0});if(f&&p===6){const v=new St("imagemap",c,d===-1?void 0:a.slice(d+1),t,s);super.insertAt(v),r=!1;continue}else o=!0}else if(a.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(a);continue}else if(a.includes("[")){const d=a.indexOf("["),c=a.slice(d),f=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(c);if(f){if(this.normalizeTitle(f[1],0,{halfParsed:!0,temporary:!0,selfLink:!0}).valid){super.insertAt(new Sn(a.slice(0,d),f.slice(1),c.slice(c.indexOf("]]")+2),t,s));continue}}else if(c.startsWith("[//")||l.has(c.slice(1,c.indexOf(":")+1))||l.has(c.slice(1,c.indexOf("//")+2))){const p=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(c);if(p){super.insertAt(new Sn(a.slice(0,d),p.slice(1),c.slice(c.indexOf("]")+1),t,s));continue}}}}super.insertAt(new n(a,t,s))}}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new ce(this,e),{childNodes:l,image:n}=this,r="invalid-imagemap",{lintConfig:o}=N,a=o.getSeverity(r,n?"link":"image");return a&&(n?s.push(...l.filter(u=>{const d=u.toString().trim();return u.is("noinclude")&&d&&!d.startsWith("#")}).map(u=>{const d=X(u,i,r,"invalid-imagemap-link",a);return o.computeEditInfo&&(d.suggestions=[te(d,-1),Re(d,"comment","# ")]),d})):s.push(ie(this,i,r,"imagemap-without-image",a))),s}}getAttribute(e){return e==="invalid"?!this.image:super.getAttribute(e)}},Oi=oe(kl),es=re(Oi,0,"ImagemapToken",Al,es),ne(Oi,1,es)}}),$l,Bi,_l,kt,aa=I({"src/nowiki/comment.ts"(){"use strict";K(),jt(),Ye(),G(),ht(),$l=[ct(!1),We("<!--")],kt=class extends(_l=Pe){constructor(t,s,i,l){super(t,i,l);Le(this,"closed");this.closed=s}get type(){return"comment"}lint(t=this.getAbsoluteIndex()){{if(this.closed)return[];const s="unclosed-comment",{lintConfig:i}=N,l=i.getSeverity(s);if(!l)return[];const n=ie(this,{start:t},s,"unclosed-comment",l);return i.computeEditInfo&&(n.suggestions=[Ve(n.endIndex,"-->")]),[n]}}toString(t){return t?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"<!--",post:this.closed?"-->":""})}},Bi=oe(_l),kt=re(Bi,0,"CommentToken",$l,kt),ne(Bi,1,kt)}}),ua={};ae(ua,{CommentedToken:()=>da});var da,Wu=I({"src/commented.ts"(){"use strict";V(),aa(),da=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("<!--"),l=i!==-1&&e.indexOf("-->",i+4),n=0;for(;l!==!1&&l!==-1;)i>n&&this.insertAt(e.slice(n,i)),this.insertAt(new kt(e.slice(i+4,l),!0,t,s)),n=l+3,i=e.indexOf("<!--",n),l=i!==-1&&e.indexOf("-->",i+4);n<e.length&&this.insertAt(e.slice(n))}}lint(e=this.getAbsoluteIndex()){return super.lint(e,new RegExp(String.raw`<\s*(?:\/\s*)?(${this.name})\b`,"giu"))}}}}),ca={};ae(ca,{NowikiToken:()=>ha});var Tl,Cl,ha,Mu=I({"src/nowiki/index.ts"(){"use strict";var e,An,s;Xe(),K(),G(),ht(),Tl=at(i=>new RegExp(String.raw`<\s*(?:/\s*)${i==="nowiki"?"":"?"}(${i})\b`,"giu")),Cl=new Set(["languages","section","templatestyles"]),ha=(s=class extends Pe{constructor(){super(...arguments);P(this,e)}get type(){return"ext-inner"}lint(l=this.getAbsoluteIndex()){{const{name:n}=this,r="void-ext",{lintConfig:o}=N,a=o.getSeverity(r,n);if(a&&R(this,e,An).call(this)){const u=ie(this,{start:l},r,N.msg("nothing-in",n),a);return o.computeEditInfo&&(u.suggestions=[te(u)]),[u]}return super.lint(l,Tl(n))}}getAttribute(l){return l==="invalid"?R(this,e,An).call(this):super.getAttribute(l)}},e=new WeakSet,An=function(){const{name:l,firstChild:{data:n}}=this;return Cl.has(l)&&!!n},s)}}),Il,qi,Nl,$t,ga=I({"src/tagPair/ext.ts"(){"use strict";K(),me(),G(),Hn(),V(),zn(),Qn(),Il=[zs()],$t=class extends(Nl=ot){get type(){return"ext"}constructor(e,t,s,i,l=N.getConfig(),n=!1,r=[]){const o=e.toLowerCase(),a=new Hs(!t||/^\s/u.test(t)?t:` ${t}`,"ext-attrs",o,l,r),u={...l,ext:l.ext.filter(c=>c!==o),excludes:[...l.excludes],inExt:!0};let d;switch(o){case"tab":u.ext=u.ext.filter(c=>c!=="tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":case"langconvert":case"phonos":o==="poem"&&u.excludes.push("heading"),d=new H(s,u,r);break;case"pre":{const{PreToken:c}=(Fu(),ee(Mo));d=new c(s,u,r);break}case"dynamicpagelist":{const{ParamTagToken:c}=(Ho(),ee(zo));d=new c(n,s,u,r);break}case"inputbox":{const{InputboxToken:c}=(Ru(),ee(Qo));d=new c(n,s,u,r);break}case"references":{const{NestedToken:c}=(Ci(),ee(js));u.excludes.push("heading"),d=new c(s,n,["ref"],u,r);break}case"choose":{const{NestedToken:c}=(Ci(),ee(js));d=new c(s,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],u,r);break}case"combobox":{const{NestedToken:c}=(Ci(),ee(js));d=new c(s,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],u,r);break}case"gallery":{const{GalleryToken:c}=(Ou(),ee(ia));d=new c(s,u,r);break}case"imagemap":{const{ImagemapToken:c}=(qu(),ee(oa));d=new c(s,u,r);break}case"hiero":{const{CommentedToken:c}=(Wu(),ee(ua));d=new c(s,u,r);break}default:{const{NowikiToken:c}=(Mu(),ee(ca));d=new c(s,u,r)}}d.setAttribute("name",o),d.type==="plain"&&(d.type="ext-inner"),super(e,a,d,i,l,r),this.seal("closed",!0)}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),{lintConfig:i}=N,l=new ce(this,e);if(this.name!=="nowiki"){const o=this.inHtmlAttrs(),a="parsing-order",u=o&&i.getSeverity(a,o===2?"ext":"templateInTable");u&&s.push(ie(this,l,a,"ext-in-html",u))}const n="var-anchor",r=i.getSeverity(n,"ref");return r&&this.name==="ref"&&this.closest("heading-title")&&s.push(ie(this,l,n,"variable-anchor",r)),s}}},qi=oe(Nl),$t=re(qi,0,"ExtToken",Il,$t),ne(qi,1,$t)}}),pa={};ae(pa,{parseCommentAndExt:()=>vs});var Wi,Ll,$s,Fl,Mi,vs,Vs=I({"parser/commentAndExt.ts"(){"use strict";Xe(),fe(),Cu(),Ze(),Iu(),Nu(),ga(),aa(),Wi="<onlyinclude>",Ll="</onlyinclude>",{length:$s}=Wi,Fl=[!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"))}),Mi=e=>{const t=e.indexOf(Wi);return{i:t,j:e.indexOf(Ll,t+$s)}},vs=(e,t,s,i)=>{if(i){let{i:o,j:a}=Mi(e);if(o!==-1&&a!==-1){let u="";const d=c=>{new xe(c,t,s),u+=`\0${s.length-1}n`};for(;o!==-1&&a!==-1;){const c=`\0${s.length}e`;new Jt(e.slice(o+$s,a),t,s),o>0&&d(e.slice(0,o)),u+=c,e=e.slice(a+$s+1),{i:o,j:a}=Mi(e)}return e&&d(e),u}}const{ext:l}=t,n=l.filter(o=>o!=="translate"&&o!=="tvar"),r={...t,ext:n};if(l.includes("translate")){const o=[];e=e.replace(/<nowiki>[\s\S]*?<\/nowiki>/giu,a=>(o.push(a),`\0${o.length-1}`)).replace(/<translate( nowrap)?>([\s\S]+?)?<\/translate>/gu,(a,u,d)=>{const c=s.length;return new Oo(u,d&&Ee(d,o),r,s),`\0${c}g`}),e=Ee(e,o)}return e.replace(Fl[i?1:0](n),(o,a,u,d,c,f,p,v,k)=>{const $=s.length;let _="n";if(a)_="e",new $t(a,u,d,c,r,f,s);else if(o.startsWith("<!--")){_="c";const T=o.endsWith("-->");new kt(Ee(o,s,1).slice(4,T?-3:void 0),T,t,s)}else f?new Xt(f,p&&Ee(p,s,1),v&&Ee(v,s,1),k,t,s):new xe(o,t,s);return`\0${$}${_}`})}}}),El,jl,Rl,Pl,Ui,Ol,ts,Uu=I({"src/html.ts"(){"use strict";var e,t,s,i,l;K(),Oe(),me(),Hn(),G(),V(),El=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),jl=new Set(["b","big","center","cite","code","del","dfn","em","font","i","ins","kbd","mark","pre","q","s","samp","small","strike","strong","sub","sup","tt","u","var"]),Rl=new Set(["strike","big","center","font","tt"]),Pl=[zs()],ts=(l=class extends(Ol=H){constructor(r,o,a,u,d,c){super(void 0,d,c);P(this,e);P(this,t);P(this,s);P(this,i);this.insertAt(o),this.setAttribute("name",r.toLowerCase()),j(this,e,a),j(this,t,u),j(this,s,r)}get type(){return"html"}get selfClosing(){return w(this,t)}get closing(){return w(this,e)}toString(r){return`<${this.closing?"/":""}${w(this,s)}${super.toString(r)}${w(this,t)?"/":""}>`}text(){const{closing:r}=this,o=w(this,s)+(r?"":super.text());return`<${r?"/":""}${o}${w(this,t)?"/":""}>`}getAttribute(r){return r==="invalid"?this.inTableAttrs()===2:r==="padding"?w(this,s).length+(this.closing?2:1):super.getAttribute(r)}lint(r=this.getAbsoluteIndex(),o){var a;{const u=super.lint(r,o),{name:d,parentNode:c,closing:f,selfClosing:p}=this,v=new ce(this,r),{lintConfig:k}=N,{computeEditInfo:$,fix:_}=k,T=this.inTableAttrs();let g="h1",h=k.getSeverity(g,"html");if(h&&d==="h1"&&!f){const A=ie(this,v,g,"<h1>",h);$&&(A.suggestions=[{desc:"h2",range:[r+2,r+3],text:"2"}]),u.push(A)}if(g="parsing-order",h=T&&k.getSeverity(g,T===2?"html":"templateInTable"),h){const A=ie(this,v,g,"html-in-table",h);$&&T===2&&(A.suggestions=[te(A)]),u.push(A)}if(g="obsolete-tag",h=k.getSeverity(g,d),h&&Rl.has(d)&&u.push(ie(this,v,g,"obsolete-tag",h)),g="bold-header",h=k.getSeverity(g,d),h&&(d==="b"||d==="strong")&&((a=this.closest("heading-title,ext"))==null?void 0:a.type)==="heading-title"){const A=ie(this,v,g,"bold-in-header",h);$&&(A.suggestions=[te(A)]),u.push(A)}const{html:[,x,b]}=this.getAttribute("config"),m=b.includes(d),y=x.includes(d),S=!m&&!y;if(g="unmatched-tag",f&&(p||m)||p&&S){if(h=k.getSeverity(g,f?"both":"selfClosing"),h){const A=ie(this,v,g,f?"closing-and-self-closing":"invalid-self-closing",h);if($||_){const L=Pn(r),C={desc:N.msg("no-self-closing"),range:[A.endIndex-2,A.endIndex-1],text:""};y?$&&(A.suggestions=[L,C]):f?A.fix=m?L:C:$&&(A.suggestions=[C,Ve(A.endIndex,`></${d}>`,-2)])}u.push(A)}}else if(!this.findMatchingTag()){const A=ie(this,v,g,f?"unmatched-closing":"unclosed-tag"),L=this.closest("magic-word");if(L&&El.has(L.name))h=k.getSeverity(g,"conditional");else if(f)h=k.getSeverity(g,"closing"),A.suggestions=[te(A)];else{h=k.getSeverity(g,"opening");const C=c==null?void 0:c.childNodes;jl.has(d)&&(C!=null&&C.slice(0,C.indexOf(this)).some(F=>F.type==="html"&&F.name===d&&!F.findMatchingTag())&&(A.suggestions=[Ve(r+1,"/")]),this.closest("heading-title")&&(A.rule="format-leakage",h=k.getSeverity("format-leakage",d)))}h&&(A.severity=h,u.push(A))}return u}}findMatchingTag(){return ut(w(this,i),()=>{const{name:r,parentNode:o,closing:a,selfClosing:u}=this,{html:[,d,c]}=this.getAttribute("config"),f=c.includes(r),p=d.includes(r);if(f||p&&u)return this;if(!o)return;const{childNodes:v}=o,k=v.indexOf(this),$=a?v.slice(0,k).reverse():v.slice(k+1),_=[this],{rev:T}=we;for(const g of $)if(!(!g.is("html")||g.name!==r||p&&w(g,t)))if(w(g,e)===a)_.push(g);else{const h=_.pop();if(h===this)return g;N.viewOnly&&(j(h,i,[T,g]),j(g,i,[T,h]))}if(N.viewOnly)for(const g of _)j(g,i,[T,void 0])},r=>{j(this,i,r),r[1]&&r[1]!==this&&j(r[1],i,[we.rev,this])})}print(){return super.print({pre:`<${this.closing?"/":""}${w(this,s)}`,post:`${w(this,t)?"/":""}>`})}json(r,o=this.getAbsoluteIndex()){const a=super.json(void 0,o);return Object.assign(a,{closing:this.closing,selfClosing:w(this,t)}),a}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,l),Ui=oe(Ol),ts=re(Ui,0,"HtmlToken",Pl,ts),ne(Ui,1,ts)}}),fa={};ae(fa,{parseHtml:()=>ma});var Bl,ma,zu=I({"parser/html.ts"(){"use strict";Qn(),Uu(),Bl=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,ma=(e,t,s)=>{var r;const{html:i}=t;(r=t.htmlElements)!=null||(t.htmlElements=new Set([...i[0],...i[1],...i[2]]));const l=e.split("<");let n=l.shift();for(const o of l){const a=Bl.exec(o),u=a==null?void 0:a[2],d=u==null?void 0:u.toLowerCase();if(!a||!t.htmlElements.has(d)){n+=`<${o}`;continue}const[,c,,f="",p,v]=a,{length:k}=s,$=new Hs(f,"html-attrs",d,t,s),_=$.hasAttr("itemprop");if(d==="meta"&&!(_&&$.hasAttr("content"))||d==="link"&&!(_&&$.hasAttr("href"))){n+=`<${o}`,s.length=k;continue}n+=`\0${s.length}x${v}`,new ts(u,$,c==="/",p==="/>",t,s)}return n}}}),ql,er,xa=I({"src/table/base.ts"(){"use strict";Hn(),G(),V(),Et(),Qn(),ql=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)},er=class extends zs(1)(H){constructor(e,t,s,i,l,n=[],r){super(void 0,l,n,r),this.append(new Qe(t,"table-syntax",l,n),new Hs(i,"table-attrs",s,l,n))}escape(){for(const e of this.childNodes)e instanceof Qe?ql(e):e.escape()}}}}),Wl,zi,Ae,_s,Ut,zt,Bs,va=I({"src/table/td.ts"(){"use strict";K(),me(),Un(),G(),V(),xa(),Bs=class extends(zi=er,Wl=[Ws(!1)],zi){constructor(e,t,s,i=[]){var o;let l=/\||\0\d+!\x7F/u.exec(t!=null?t:""),n=l?t.slice(0,l.index):"";/\[\[|-\{/u.test(n)&&(l=null,n=""),super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",n,s,i),ne(_s,5,this),He(this,Ut),He(this,Ae,""),l&&([xu(this,Ae)._]=l);const r=new H(t==null?void 0:t.slice(((o=l==null?void 0:l.index)!=null?o:NaN)+pe(this,Ae).length),s,i);r.type="td-inner",r.setAttribute("stage",4),this.insertAt(r)}get type(){return"td"}get rowspan(){return this.getAttr("rowspan")}get colspan(){return this.getAttr("colspan")}get subtype(){return cn(this,Ut,zt).call(this).subtype}afterBuild(){pe(this,Ae).includes("\0")&&_e(this,Ae,this.buildFromStr(pe(this,Ae),0)),super.afterBuild()}toString(e){const{childNodes:[t,s,i]}=this;return t.toString(e)+s.toString(e)+pe(this,Ae)+i.toString(e)}text(){const{childNodes:[e,t,s]}=this;return e.text()+t.text()+pe(this,Ae)+s.text()}getGaps(e){return e===1?pe(this,Ae).length:0}lint(e=this.getAbsoluteIndex(),t){{const s=super.lint(e,t),i=new ce(this,e+this.getRelativeIndex(this.length-1)),l="pipe-like",{lintConfig:n}=N,{computeEditInfo:r,fix:o}=n,a=["td","double"].map(u=>n.getSeverity(l,u));for(const u of this.lastChild.childNodes)if(u.type==="text"){const{data:d}=u;if(d.includes("|")){const c=d.includes("||"),f=a[c?1:0];if(f){const p=X(u,i,l,"pipe-in-table",f);if(r||o)if(c){const v={caption:"|+",td:"|",th:"!"}[this.subtype];p.fix=Re(p,"newline",d.replace(/\|\|/gu,`
|
|
14
|
-
${
|
|
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,
|
|
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
|
-
${
|
|
19
|
-
${c}${
|
|
20
|
-
${
|
|
21
|
-
${
|
|
22
|
-
${c}${
|
|
23
|
-
${c}${
|
|
24
|
-
${c}${
|
|
25
|
-
`)&&($=Te(f).trim());const{ns:T,valid:g}=N.normalizeTitle($,0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0});if(g){if(u){if(T!==6){r+=`[[${v}`;continue}let x=!1;for(a++;a<n.length;a++){const b=n[a],m=b.split("]]");if(m.length>2){x=!0,f+=`[[${m[0]}]]${m[1]}`,p=m.slice(2).join("]]");break}else if(m.length===2)f+=`[[${m[0]}]]${m[1]}`;else{f+=`[[${b}`;break}}if(f=kn(f,t,s,i),!x){r+=`[[${d}${c}${f}`;continue}}}else{r+=`[[${v}`;continue}f&&(f=nr(f,t,s,i));let h=Yn;_||(T===6?(f&&(f=rr(f,t,s,!0)),h=Kn):T===14&&(h=Ea)),f===void 0&&c&&(f=""),r+=`\0${s.length}l${p}`,new h(d,f,t,s,c)}return r}}}),Ra={};ae(Ra,{parseMagicLinks:()=>Pa});var Vi,Qi,Ji,Xi,Pa,Zu=I({"parser/magicLinks.ts"(){"use strict";fe(),Zn(),Vi=String.raw`[${Ge}\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`,Pa=(e,t,s)=>{if(!t.regexMagicLinks)try{t.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${t.protocol})(${_t}${Tt})|${Xi})`,"giu")}catch{t.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${t.protocol})(${_t}${Tt})|${Xi})`,"giu")}return e.replace(t.regexMagicLinks,(i,l,n)=>{let r=l?i.slice(l.length):i;if(n){let o="";const a=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(r);a&&(o=r.slice(a.index),r=r.slice(0,a.index));const u=r.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,d=u.exec(r);if(d){let c=1;d[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(r.slice(0,d.index))&&(c=2),o=r.slice(d.index+c)+o,r=r.slice(0,d.index+c)}return o.length>=n.length?i:(new fs(r,void 0,t,s),`${l}\0${s.length-1}w${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(r))return i;return new fs(r,"magic-link",t,s),`${l}\0${s.length-1}i`})}}}),Oa,ed=I({"util/html.ts"(){"use strict";Oa=(e,t)=>e.startsWith(t)?t.length:[...t].findIndex((s,i)=>s!==e[i])}}),Ba,td=I({"src/nowiki/list.ts"(){"use strict";ya(),Ba=class extends sr{get type(){return"list"}}}}),qa={};ae(qa,{parseList:()=>Wa});var Wa,sd=I({"parser/list.ts"(){"use strict";ed(),td(),Sa(),Wa=(e,t,s,i)=>{const l=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(e);if(!l)return t.lastPrefix="",e;const[n,r,o,a]=l,u=o.replace(/;/gu,":"),d=Oa(u,t.lastPrefix),c=((d>1?o.slice(d-1):o)+a).split(/(?=;)/u),f=c[0].startsWith(";");let p=c.length-(f?0:1);if(d>1){const A=o.slice(0,d-1);if(f){const L=A.split(/(?=;)/u);c.unshift(...L),p+=A.includes(";")?L.length:0}else c[0]=A+c[0]}t.lastPrefix=u;let v=r+c.map((A,L)=>`\0${i.length+L}d`).join("")+e.slice(n.length);for(const A of c)new Ba(A,s,i);if(!p)return v;const{html:[k,,$]}=s,_=/:+|-\{|\0\d+[xq]\x7F/gu;let T=_,g=T.exec(v),h=0,x=!1,b=!1,m=0;const y=(A,L)=>(new ir(A,s,i),`${v.slice(0,L)}\0${i.length-1}d${v.slice(L+A.length)}`),S=A=>{A?h&&h--:h++};for(;g&&p;){const{0:A,index:L}=g;if(A==="-{"){if(!m){const{lastIndex:C}=T;T=/-\{|\}-/gu,T.lastIndex=C}m++}else if(A==="}-"){if(m--,!m){const{lastIndex:C}=T;T=_,T.lastIndex=C}}else if(A.endsWith("x")){const{name:C,closing:F,selfClosing:B}=i[Number(A.slice(1,-2))];(k.includes(C)||!B&&!$.includes(C))&&S(F)}else if(A.endsWith("q")){const{bold:C,italic:F}=i[Number(A.slice(1,-2))];C&&(S(x),x=!x),F&&(S(b),b=!b)}else if(h===0){if(A.length>=p)return y(A.slice(0,p),L);p-=A.length,T.lastIndex=L+4+String(i.length).length,v=y(A,L)}g=T.exec(v)}return v}}}),Cs,Jl,Ki,Xl,is,id=I({"src/converterFlags.ts"(){"use strict";var e,t;K(),me(),Ms(),G(),V(),Ke(),Cs=new Set(["A","T","R","D","-","H","N"]),Jl=[xs()],is=(t=class extends(Xl=H){constructor(i,l,n=[]){super(void 0,l,n,{});P(this,e);this.safeAppend(i.map(r=>new $e(r,"converter-flag",l,n)))}get type(){return"converter-flags"}afterBuild(){j(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(l=>i.has(l)))}isInvalidFlag(i,l,n,r){return typeof i=="object"&&(i=i.text().trim(),l=this.getVariantFlags(),n=this.getUnknownFlags(),r=new Set(w(this,e).filter(o=>Cs.has(o)))),!!i&&!l.has(i)&&!n.has(i)&&(l.size>0||!r.has(i))}lint(i=this.getAbsoluteIndex(),l){{const n=this.getVariantFlags(),r=this.getUnknownFlags(),o=new Set(w(this,e).filter($=>Cs.has($))),a=w(this,e).filter($=>!$).length,u=w(this,e).length-r.size-a,{lintConfig:d}=N,{computeEditInfo:c,fix:f}=d,p=super.lint(i,l);if(n.size===u||o.size===u)return p;const v="no-ignored",k=d.getSeverity(v,"conversionFlag");if(k){const $=new ce(this,i);for(let _=0;_<this.length;_++){const T=this.childNodes[_],g=T.text().trim();if(this.isInvalidFlag(g,n,r,o)){const h=X(T,$,v,"invalid-conversion-flag",k);(c||f)&&(n.size===0&&Cs.has(g.toUpperCase())?h.fix=Bn(h,g):c&&(h.suggestions=[te(h,_&&-1)])),p.push(h)}}}return p}}print(){return super.print({sep:";"})}},e=new WeakMap,t),Ki=oe(Xl),is=re(Ki,0,"ConverterFlagsToken",Jl,is),ne(Ki,1,is)}}),Ps,nd=I({"src/converterRule.ts"(){"use strict";G(),V(),Ke(),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 l=e.indexOf(":"),n=e.slice(0,l).indexOf("=>"),r=n===-1?e.slice(0,l):e.slice(n+2,l);t&&s.variants.includes(r.trim().toLowerCase())?(super.insertAt(new $e(r,"converter-rule-variant",s,i)),super.insertAt(new $e(e.slice(l+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,rd=I({"src/converter.ts"(){"use strict";fe(),Ye(),qe(),V(),id(),nd(),Kl=[Be,We("-{")],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[l]=t,n=l.includes(":"),r=new Ps(l,n,s,i);n&&r.length===1||!n&&t.length===2&&!Te(t[1]).trim()?this.insertAt(new Ps(t.join(";"),!1,s,i)):this.append(r,...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?"|":""}${It(t,{sep:";"})}}-</span>`}},Yi=oe(Yl),ns=re(Yi,0,"ConverterToken",Kl,ns),ne(Yi,1,ns)}}),Ma={};ae(Ma,{parseConverter:()=>Ua});var Ua,ld=I({"parser/converter.ts"(){"use strict";rd(),Ua=(e,t,s)=>{var a;(a=t.regexConverter)!=null||(t.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${t.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"iu"));const i=/-\{/gu,l=/-\{|\}-/gu,n=[];let r=i,o=r.exec(e);for(;o;){const{0:u,index:d}=o;if(u==="}-"){const c=n.pop(),{length:f}=s,p=e.slice(c.index+2,d),v=p.indexOf("|"),[k,$]=v===-1?[[],p]:[p.slice(0,v).split(";"),p.slice(v+1)],_=$.replace(/(&[#a-z\d]+);/giu,"$1"),T=_.split(t.regexConverter).map(g=>g.replace(/\x01/gu,";"));new ns(k,T,t,s),e=`${e.slice(0,c.index)}\0${f}v${e.slice(d+2)}`,n.length===0&&(r=i),r.lastIndex=c.index+3+String(f).length}else n.push(o),r=l,r.lastIndex=d+2;o=r.exec(e)}return e}}}),os={};ae(os,{Token:()=>H});var Zl,H,V=I({"src/index.ts"(){"use strict";var e,t,s,i,l,n,r,o,za,Ha,Da,Ga,Va,Qa,Ja,Xa,Ka,Ya,Za,eu,h;fe(),Je(),K(),Oe(),G(),Su(),ku(),Zl=["category","html-attr#id,ext-attr#id,table-attr#id"],H=(h=class extends Gt{constructor(m,y=N.getConfig(),S=[],A){super();P(this,o);P(this,e,"plain");P(this,t,0);P(this,s);P(this,i);P(this,l);P(this,n,!1);P(this,r);typeof m=="string"&&this.insertAt(m),j(this,s,y),j(this,i,S),S.push(this)}get type(){return w(this,e)}set type(m){j(this,e,m)}parseOnce(m=w(this,t),y=!1,S){if(m<w(this,t)||this.length===0||!this.isPlain())return this;if(w(this,t)>=ke)return this;switch(m){case 0:if(this.type==="root"){w(this,i).pop();const A=R(this,o,za).call(this);y&&(y=!A)}j(this,l,y),R(this,o,Ha).call(this,y);break;case 1:R(this,o,Da).call(this);break;case 2:R(this,o,Ga).call(this);break;case 3:R(this,o,Va).call(this);break;case 4:R(this,o,Qa).call(this);break;case 5:R(this,o,Ja).call(this,S);break;case 6:R(this,o,Xa).call(this,S);break;case 7:R(this,o,Ka).call(this);break;case 8:R(this,o,Ya).call(this);break;case 9:R(this,o,Za).call(this);break;case 10:R(this,o,eu).call(this)}if(this.type==="root")for(const A of w(this,i))A==null||A.parseOnce(m,y,S);return ar(this,t)._++,this}buildFromStr(m,y){const S=m.split(/[\0\x7F]/u).map((A,L)=>{if(L%2===0)return new fn(A);if(isNaN(A.slice(-1)))return w(this,i)[Number(A.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${A}`)});return y===0?S.map(String).join(""):y===1?dt(S):S}build(){j(this,t,ke);const{length:m,firstChild:y}=this,S=y==null?void 0:y.toString();if(m===1&&y.type==="text"&&S.includes("\0")&&(ms(this,0,1,this.buildFromStr(S)),this.normalize(),this.type==="root"))for(const A of w(this,i))A==null||A.build()}afterBuild(){if(this.type==="root")for(const m of w(this,i))m==null||m.afterBuild();j(this,n,!0)}parse(m=ke,y,S){for(m=Math.min(m,ke);w(this,t)<m;)this.parseOnce(w(this,t),y,S);return m&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===h}getAttribute(m){var y;switch(m){case"config":return w(this,s);case"include":return(y=w(this,l))!=null?y:!!w(this.getRootNode(),l);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(m)}}setAttribute(m,y){switch(m){case"stage":w(this,t)===0&&this.type==="root"&&w(this,i).shift(),j(this,t,y);break;default:super.setAttribute(m,y)}}insertAt(m,y=this.length){const S=typeof m=="string"?new fn(m):m;super.insertAt(S,y);const{type:A}=S;return A==="root"&&(S.type="plain"),S}normalizeTitle(m,y=0,S){return N.normalizeTitle(m,y,w(this,l),w(this,s),S)}inTableAttrs(){var m,y;return((m=this.closest("table-attrs,ext"))==null?void 0:m.type)==="table-attrs"&&((y=this.closest("table-attrs,arg,magic-word,template"))!=null&&y.is("table-attrs")?2:1)}inHtmlAttrs(){var m;return(m=this.closest("html-attrs,ext"))!=null&&m.is("html-attrs")?2:this.inTableAttrs()}lint(m=this.getAbsoluteIndex(),y){var S;{const{lintConfig:A}=N,{computeEditInfo:L,fix:C,ignoreDisables:F,configurationComment:B}=A;let O=super.lint(m,y);if(this.type==="root"){const E=new Map,D="no-duplicate",W=["category","id"].map(M=>A.getSeverity(D,M)),q=this.toString(),z=Zl.filter((M,Q)=>W[Q]).join();if(z){for(const M of this.querySelectorAll(z)){let Q;if(M.is("category"))Q=M.name;else{const J=M.getValue();J&&J!==!0&&(Q=`#${J}`)}if(Q){const J=E.get(Q);J?J.add(M):E.set(Q,new Set([M]))}}for(const[M,Q]of E)if(Q.size>1&&!M.startsWith("#mw-customcollapsible-")){const J=!M.startsWith("#"),se=`duplicate-${J?"category":"id"}`,ue=W[J?0:1];O.push(...[...Q].map(he=>{const le=ie(he,{start:he.getAbsoluteIndex()},D,se,ue);return L&&J&&(le.suggestions=[te(le)]),le}))}}if(!F){const M=new RegExp(String.raw`<!--\s*${B}-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->`,"gu"),Q=[];let J=M.exec(q);for(;J;){const{1:se,index:ue}=J,he=(S=J[2])==null?void 0:S.trim();Q.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(le=>le.trim())):void 0}),J=M.exec(q)}O=O.filter(({rule:se,startLine:ue,startIndex:he})=>{const le={pos:0};for(const{line:Ie,from:Ne,to:U,rules:Y}of Q){if(Ie>ue+1)break;if(Y&&!Y.has(se))continue;if(Ie===ue&&Ne===void 0&&U===void 0)return!1;Ne<=he&&Ne>le.pos?(le.pos=Ne,le.type="from"):U<=he&&U>le.pos&&(le.pos=U,le.type="to")}return le.type!=="from"})}if(C&&O.some(({fix:M})=>M)){const M=O.map(({fix:se})=>se).filter(Boolean).sort(({range:[se,ue]},{range:[he,le]})=>ue===le?he-se:le-ue);let Q=1/0,J=q;for(const{range:[se,ue],text:he}of M)ue<=Q&&(J=J.slice(0,se)+he+J.slice(ue),Q=se);Object.assign(O,{output:J})}if(!L)for(const M of O)delete M.fix,delete M.suggestions}return O}}toString(m,y){return m?super.toString(!0,y):ut(w(this,r),()=>super.toString(!1,y),S=>{const A=this.getRootNode();A.type==="root"&&w(A,n)&&j(this,r,S)})}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,l=new WeakMap,n=new WeakMap,r=new WeakMap,o=new WeakSet,za=function(){const{parseRedirect:m}=(Tu(),ee(Ro)),y=this.firstChild.toString(),S=m(y,w(this,s),w(this,i));return S&&this.setText(S),!!S},Ha=function(m){const{parseCommentAndExt:y}=(Vs(),ee(pa));this.setText(y(this.firstChild.toString(),w(this,s),w(this,i),m))},Da=function(){const{parseBraces:m}=(Xn(),ee(Vo)),y=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,S=m(y,w(this,s),w(this,i));this.setText(this.type==="root"?S:S.slice(1))},Ga=function(){if(w(this,s).excludes.includes("html"))return;const{parseHtml:m}=(zu(),ee(fa));this.setText(m(this.firstChild.toString(),w(this,s),w(this,i)))},Va=function(){if(w(this,s).excludes.includes("table"))return;const{parseTable:m}=(Gu(),ee(Aa));this.setText(m(this,w(this,s),w(this,i)))},Qa=function(){if(w(this,s).excludes.includes("hr"))return;const{parseHrAndDoubleUnderscore:m}=(Ju(),ee(_a));this.setText(m(this,w(this,s),w(this,i)))},Ja=function(m){const{parseLinks:y}=(Yu(),ee(ja));this.setText(y(this.firstChild.toString(),w(this,s),w(this,i),m))},Xa=function(m){if(w(this,s).excludes.includes("quote"))return;const{parseQuotes:y}=(Na(),ee(Ia)),S=this.firstChild.toString().split(`
|
|
26
|
-
`);for(let
|
|
27
|
-
`))},
|
|
28
|
-
`),
|
|
29
|
-
`))},eu=function(){if(w(this,s).variants.length>0){const{parseConverter:m}=(ld(),ee(Ma));this.setText(m(this.firstChild.toString(),w(this,s),w(this,i)))}},h)}}),we,Qs,ms,Oe=I({"util/debug.ts"(){"use strict";we={running:!1,run(e){const{running:t}=this;this.running=!0;try{const{Token:s}=(V(),ee(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},Qs=e=>t=>t.type===e,ms=(e,t,s,i=[])=>{var r,o;let l=e.getChildNodes(),n;l.length===s?(n=l,l=i):n=l.splice(t,s,...i);for(let a=0;a<i.length;a++){const u=i[a];u.setAttribute("parentNode",e),u.setAttribute("nextSibling",l[t+a+1]),u.setAttribute("previousSibling",l[t+a-1])}return(r=l[t-1])==null||r.setAttribute("nextSibling",l[t]),(o=l[t+i.length])==null||o.setAttribute("previousSibling",l[t+i.length-1]),l===i&&e.setAttribute("childNodes",l),n}}}),ft,Zi,Is,en,eo,tn,to,$n,od=I({"lib/lintConfig.ts"(){"use strict";var e,t;jn(),ft=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,"lonely-apos":[1,{}],"lonely-bracket":[1,{extLink:2}],"lonely-http":[1,{}],"nested-link":[2,{}],"no-arg":1,"no-duplicate":[2,{category:1,id:1,unknownImageParameter:1}],"no-ignored":[2,{fragment:1,galleryComment:1,galleryNoImage:1,include:1,nonWordAttributes:1,redirect:1}],"obsolete-attr":1,"obsolete-tag":1,"parsing-order":[2,{templateInTable:1}],"pipe-like":[1,{double:2}],"table-layout":1,"tag-like":[2,{disallowed:1,invalid:1}],"unbalanced-header":2,"unclosed-comment":[1,{}],"unclosed-quote":1,"unclosed-table":2,unescaped:2,"unknown-page":1,"unmatched-tag":[1,{}],"unterminated-url":[1,{}],"url-encoding":[1,{}],"var-anchor":[1,{}],"void-ext":[2,{}]},Object.freeze(Zi),Is={configurationComment:"lint",ignoreDisables:!1,fix:!0,computeEditInfo:!0},Object.freeze(Is),en=s=>ft.has(s),eo=s=>en(s)||Array.isArray(s)&&en(s[0])&&(s.length===1||typeof s[1]=="object"),tn=(s,i,l)=>{if(as.includes(i)){if(l===void 0)return!1;if(eo(l))return s[i]=l,!0}else throw new RangeError(`Unknown lint rule: ${i}`);throw new RangeError(`Invalid lint config for ${i}: ${JSON.stringify(l)}`)},to=class{constructor(s){if(Object.assign(this,JSON.parse(JSON.stringify(Zi))),!!s)for(const[i,l]of Object.entries(s))tn(this,i,l)}getSeverity(s,i){var n,r;const l=this[s];return typeof l!="object"?ft.get(l):i&&(r=ft.get((n=l[1])==null?void 0:n[i]))!=null?r:ft.get(l[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,...l}=s!=null?s:{};this.rules=i;for(const[n,r]of Object.entries(l))r!==void 0&&Object.prototype.hasOwnProperty.call(Is,n)&&(this[n]=r)}}get rules(){return w(this,e)}set rules(s){j(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)}}),tu={};ae(tu,{Title:()=>su});var su,ad=I({"lib/title.ts"(){"use strict";var e,t,s,i,l,n;Xe(),fe(),su=(n=class{constructor(r,o,a,{temporary:u,decode:d,selfLink:c}={}){P(this,e);P(this,t);P(this,s);P(this,i);P(this,l);Le(this,"valid");Le(this,"encoded",!1);const f=r.trim().startsWith("../");if(d&&r.includes("%"))try{const v=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(r);r=hs(r),this.encoded=v}catch{}if(r=ds(r).replace(/[_ ]+/gu," ").trim(),f)j(this,i,0);else{let v=o;r.startsWith(":")&&(v=0,r=r.slice(1).trim());const k=r.split(":");if(k.length>1){const $=Ct(k[0]),_=Object.prototype.hasOwnProperty.call(a.nsid,$)&&a.nsid[$];_&&(v=_,r=k.slice(1).join(":").trim())}j(this,i,v)}const p=r.indexOf("#");if(p!==-1){let v=r.slice(p).trim().slice(1);if(v.includes("%"))try{v=hs(v)}catch{}j(this,l,v.replace(/ /gu,"_")),r=r.slice(0,p).trim()}this.valid=!!(r||c&&this.ns===0&&w(this,l)!==void 0)&&ds(r)===r&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(f?/^(?:\.\.\/)+(.*)/u.exec(r)[1]:r),this.main=r,j(this,t,a.namespaces),j(this,s,a.articlePath||"/wiki/$1"),w(this,s).includes("$1")||j(this,s,w(this,s)+`${w(this,s).endsWith("/")?"":"/"}$1`),u||Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}})}get ns(){return w(this,i)}get fragment(){return w(this,l)}get main(){return w(this,e)}set main(r){r=r.replace(/_/gu," ").trim(),j(this,e,r&&r[0].toUpperCase()+r.slice(1))}get prefix(){const r=w(this,t)[this.ns];return r+(r&&":")}get title(){return this.getRedirection()[1]}get extension(){const{main:r}=this,o=r.lastIndexOf(".");return o===-1?void 0:r.slice(o+1).toLowerCase()}getRedirection(){return[!1,(this.prefix+this.main).replace(/ /gu,"_")]}setFragment(r){j(this,l,r)}getUrl(r){{typeof r=="string"&&(j(this,s,r),w(this,s).includes("$1")||j(this,s,w(this,s)+`${w(this,s).endsWith("/")?"":"/"}$1`));const{title:o,fragment:a}=this;return o?w(this,s).replace("$1",encodeURIComponent(o)+(a?`#${encodeURIComponent(a)}`:"")):a===void 0?"":`#${encodeURIComponent(a)}`}throw new Error("Title.getUrl method is only available in the LSP version!")}},e=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,l=new WeakMap,n)}}),iu={};ae(iu,{LanguageService:()=>nu,isAttr:()=>Os,tasks:()=>_n});var _n,so,io,no,ro,sn,lo,oo,ao,uo,Os,co,nn,mt,rn,Ue,be,ln,on,xt,vt,nt,Ht,an,ho,nu,ud=I({"lib/lsp.ts"(){"use strict";var e,t,s,i,l,n,r,o,a,u,rs,Fe,Tn,Cn,In,ru,Nn,bt,T;Xe(),jn(),Wo(),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(g=>`${g}-attr#style`).join(),uo=at(g=>new RegExp(`^(?:${g}|//)`,"iu")),Os=({type:g,parentNode:h,length:x,firstChild:b},m)=>g==="attr-value"&&x===1&&b.type==="text"&&(!m||h.name==="style"),co=g=>g.is("html-attr")||g.is("table-attr"),nn=g=>g.childNodes.every(({type:h})=>oo.has(h)),mt=(g,h)=>{const{top:x,left:b}=g.posFromIndex(h);return{line:x,character:b}},rn=(g,h,x)=>({start:mt(g,h),end:mt(g,x)}),Ue=g=>{const{top:h,left:x,height:b,width:m}=g.getBoundingClientRect();return{start:{line:h,character:x},end:gs(h,x,b,m)}},be=(g,h,x,{line:b,character:m},y,S)=>[...new Set(g)].map(A=>{var C;const L=(C=S==null?void 0:S(A))==null?void 0:C.description;return{label:A,kind:h,textEdit:{range:{start:{line:b,character:m-x.length},end:{line:b,character:m}},newText:A+(y!=null?y:"")},...L&&{documentation:{kind:"markdown",value:L}}}}),ln=(g,h,{line:x,character:b})=>{const m=g.indexFromPos(x,b);return g.caretPositionFromIndex(m+Number(/\w/u.test(h.charAt(m))))},on=(g,h,x)=>{const{type:b,parentNode:m={}}=g,{name:y,tag:S}=m;return b==="attr-value"&&h.has(S)&&x.has(y)?g.toString().trim():NaN},xt=g=>on(g,so,no),vt=g=>on(g,io,ro),nt=(g,h)=>{const x=g==null?void 0:g.getAttr(h);return x!==!0&&x||!1},Ht=g=>{const{type:h,name:x,parentNode:b}=g;switch(h){case"heading":return g.level;case"heading-title":return b.level;case"parameter-key":return`${b.parentNode.name}|${b.name}`;case"ext":case"html":case"image-parameter":return x;default:return b.name}},an=(g,h,x=!1)=>({range:rn(g,...h.range),newText:h.text,title:`${x?"Fix":"Suggestion"}: ${h.desc}`,fix:x}),ho=(g,h)=>{const{lintConfig:x}=N,{rules:b,fix:m,computeEditInfo:y}=x;if(x.fix=!0,x.computeEditInfo=!1,h){x.rules=void 0;for(const A of as)x.rules[A]=A===h?b[A]:0}const{output:S}=g.lint();return x.fix=m,x.computeEditInfo=y,h&&(x.rules=b),S===void 0?[]:[{range:Ue(g),newText:S}]},nu=(T=class{constructor(g){P(this,u);P(this,e);P(this,t);P(this,s);P(this,i);P(this,l);P(this,n);P(this,r);P(this,o);P(this,a);Le(this,"include",!0);Le(this,"config");Le(this,"data");_n.set(g,this),Object.defineProperties(this,{config:{enumerable:!1},data:{enumerable:!1}})}destroy(){Object.setPrototypeOf(this,null)}async provideDocumentColors(g,h,x=!0){const b=await R(this,u,Fe).call(this,h);return b.querySelectorAll("attr-value,parameter-value,arg-default").reverse().flatMap(m=>{const{type:y,childNodes:S}=m;return y!=="attr-value"&&!nn(m)?[]:S.filter(A=>A.type==="text").reverse().flatMap(A=>{const{data:L}=A,C=ko(L,x).filter(([,,,B])=>B);if(C.length===0)return[];const F=A.getAbsoluteIndex();return C.map(([B,O,E])=>{const D=g(B);return D.length===4&&{color:{red:D[0]/255,green:D[1]/255,blue:D[2]/255,alpha:D[3]},range:rn(b,F+O,F+E)}}).filter(Boolean)})})}provideColorPresentations(g){const{color:{red:h,green:x,blue:b,alpha:m},range:y}=g,S=[h,x,b],A=m<1?`rgba(${S.map(L=>Math.round(L*255)).join()},${m})`:`#${S.map(Ao).join("")}`;return[{label:A,textEdit:{range:y,newText:A}}]}async provideCompletionItems(g,h){var J,se,ue,he,le,Ie,Ne;const{re:x,allTags:b,functions:m,switches:y,protocols:S,params:A,tags:L,ext:C}=R(this,u,ru).call(this),{line:F,character:B}=h,O=g.split(/\r?\n/u,F+1)[F],E=x.exec((J=O==null?void 0:O.slice(0,B))!=null?J:""),[,,D={},W={}]=this.config.doubleUnderscore;if((E==null?void 0:E[1])!==void 0){const U=E[1].startsWith("/");return be(b,"Class",E[1].slice(U?1:0),h,U&&!(O!=null&&O.slice(B).trim().startsWith(">"))?">":"")}else{if(E!=null&&E[4])return be(y,"Constant",E[4],h,"",U=>{if(this.data)return U=U.slice(2,-2),U in D?U=D[U]:U in W&&(U=W[U]),R(this,u,Nn).call(this,U.toLowerCase())});if((E==null?void 0:E[5])!==void 0)return be(S,"Reference",E[5],h)}const q=await R(this,u,Fe).call(this,g);let z;if(E!=null&&E[2]){z=q.elementFromPoint(E.index+E[2].length-1,F);const U=(se=E[3])!=null?se:"";if(E[2]==="{{{")return be(q.querySelectorAll("arg").filter(Z=>Z.name&&Z!==z).map(({name:Z})=>Z),"Variable",U,h);const[Y,ge]=this.config.parserFunction,ve=Array.isArray(ge),Ce=O.charAt(B),Me=U.startsWith(":"),Se=Me?U.slice(1).trimStart():U;if(E[2]==="[[")return be(q.querySelectorAll("link,file,category,redirect-target").filter(Z=>Z!==z).map(({name:Z})=>Z),"Folder",Se,h);let gt=m;return Ce===":"?gt=m.filter(Z=>!Z.endsWith(":")):Ce===":"&&(gt=m.filter(Z=>Z.endsWith(":")).map(Z=>Z.slice(0,-1))),[...be(gt,"Function",U,h,"",Z=>{if(this.data)Z in Y?Z=Y[Z]:!ve&&Z in ge&&(Z=ge[Z]);else return;return R(this,u,bt).call(this,Z.toLowerCase())}),...U.startsWith("#")?[]:be(q.querySelectorAll("template").filter(Z=>Z!==z).map(Z=>{const{name:et}=Z;if(Me)return et;const{ns:Rt}=Z.getAttribute("title");return Rt===0?`:${et}`:Rt===10?et.slice(9):et}),"Folder",Se,h)]}let M,Q;if((E==null?void 0:E[7])===void 0&&(z=q.elementFromPoint(B,F),{type:M,parentNode:Q}=z),(E==null?void 0:E[6])!==void 0||M==="image-parameter"){const U=q.indexFromPos(F,B),Y=(he=(ue=E==null?void 0:E[6])==null?void 0:ue.trimStart())!=null?he:w(this,e).slice(z.getAbsoluteIndex(),U).trimStart(),ge=w(this,e)[U]==="=";return[...be(A,"Property",Y,h).filter(({label:ve})=>!ge||!/[= ]$/u.test(ve)),...be(q.querySelectorAll("image-parameter#width").filter(ve=>ve!==z).map(ve=>ve.text()),"Unit",Y,h)]}else if((E==null?void 0:E[7])!==void 0||M==="attr-key"){const U=(Ie=(le=E==null?void 0:E[7])==null?void 0:le.toLowerCase())!=null?Ie:Q.tag,Y=(Ne=E==null?void 0:E[9])!=null?Ne:z.toString().slice(0,B-q.posFromIndex(z.getAbsoluteIndex()).left);if(!L.has(U))return;const ge=Gn[U],ve=Vn[U],Ce=ve&&be(ve,"Field",Y,h);return C.includes(U)&&!ge?Ce:[...Ce!=null?Ce:[],...U==="meta"||U==="link"?[]:be(Dn,"Property",Y,h),...ge?be(ge,"Property",Y,h):[],...be(["data-"],"Variable",Y,h),...be(["xmlns:"],"Interface",Y,h)]}else if(M==="parameter-key"||M==="parameter-value"&&Q.anon){const U=Q.parentNode,{type:Y,name:ge}=U;if(Y==="magic-word"&&ge!=="invoke")return;const ve=w(this,e).slice(z.getAbsoluteIndex(),q.indexFromPos(F,B)).trimStart(),{module:Ce,function:Me}=U;return ve?be(q.querySelectorAll("parameter").filter(Se=>Se===Q||Se.anon||Se.parentNode.type!==Y||Se.parentNode.name!==ge?!1:Y==="template"?!0:Se.parentNode.module===Ce&&Se.parentNode.function===Me).map(({name:Se})=>Se),"Variable",ve,h,M==="parameter-value"?"=":""):void 0}else if(Os(z)&&co(Q)){const U=Wn(Q.tag,Q.name);if(U.length===0)return;const Y=w(this,e).slice(z.getAbsoluteIndex(),q.indexFromPos(F,B)).trimStart();return be(U,"Value",Y,h)}}async provideDiagnostics(g,h=!0){const x=await R(this,u,Fe).call(this,g),{lintConfig:b}=N,m=b.fix;b.fix=!1;const y=x.lint();return b.fix=m,[(h?y:y.filter(({severity:C})=>C==="error")).map(({startLine:C,startCol:F,endLine:B,endCol:O,severity:E,rule:D,message:W,fix:q,suggestions:z})=>({range:{start:{line:C,character:F},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(M=>an(x,M)):[]]})),[],[]].flat(2)}resolveCodeAction(g){if(g.kind!=="source.fixAll")return g;const{rule:h}=g.data;return{...g,edit:{changes:{"":ho(w(this,l),h)}}}}async provideFoldingRanges(g){const h=await R(this,u,Fe).call(this,g),{length:x}=h.getLines(),b=[],m=new Array(6),y=h.querySelectorAll("heading-title,table,template,magic-word");for(const S of[...y].reverse())S.getRelativeIndex();for(const S of y){const{offsetHeight:A}=S;if(S.type==="heading-title"||A>2){const{top:L}=h.posFromIndex(S.getAbsoluteIndex());if(S.type==="heading-title"){const{level:C}=S.parentNode;for(let F=C-1;F<6;F++){const B=m[F];B!==void 0&&B<L-1&&b.push({startLine:B,endLine:L-1,kind:"region"}),m[F]=void 0}m[C-1]=L+A-1}else b.push({startLine:L,endLine:L+A-2,kind:"region"})}}for(const S of m)S!==void 0&&S<x-1&&b.push({startLine:S,endLine:x-1,kind:"region"});return b}async provideLinks(g){var y;(y=this.config)!=null||(this.config=N.getConfig());const{articlePath:h,protocol:x}=this.config,b=h==null?void 0:h.includes("//"),m=uo(x);return(await R(this,u,Fe).call(this,g)).querySelectorAll(`magic-link,ext-link-url,free-ext-link,attr-value,image-parameter#link${b?",link-target,template-name,invoke-module,magic-word#filepath,magic-word#widget":""}`).reverse().map(S=>{let A;S.is("magic-word")&&({name:A}=S,S=S.childNodes[1].lastChild);const{type:L,parentNode:C,firstChild:F,lastChild:B,childNodes:O,length:E}=S,{tag:D}=C;if(A!=null||(A=C.name),!(L!=="attr-value"||A==="src"&&["templatestyles","img"].includes(D)||A==="cite"&&["blockquote","del","ins","q"].includes(D))||!nn(S))return!1;let W=O.filter(q=>q.type==="text").map(({data:q})=>q).join("").trim();if(!W)return!1;try{if(S.is("magic-link")||S.is("ext-link-url")||S.is("free-ext-link"))W=S.getUrl(h);else if(L==="link-target"&&(C.is("link")||C.is("redirect-target")||C.is("category"))){if(W.startsWith("/"))return!1;W=C.link.getUrl(h)}else if(L==="template-name")W=C.getAttribute("title").getUrl(h);else if(["link-target","invoke-module","parameter-value"].includes(L)||L==="attr-value"&&A==="src"&&D==="templatestyles"||L==="image-parameter"&&!m.test(W)){if(!b||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=A==="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=F.getBoundingClientRect(),{top:z,left:M,height:Q,width:J}=E===1?q:B.getBoundingClientRect();return{range:{start:{line:q.top,character:q.left},end:gs(z,M,Q,J)},target:W}}return{range:Ue(S),target:W}}catch{return!1}}).filter(Boolean)}async provideReferences(g,h){const x=await R(this,u,Fe).call(this,g),{offsetNode:b,offset:m}=ln(x,w(this,e),h),y=b.type==="text"?b.parentNode:b,S=m===0&&(y.type==="ext-attr-dirty"||y.type==="html-attr-dirty")?y.parentNode.parentNode:y,{type:A}=S,L=xt(S),C=vt(S);if(!L&&!C&&!lo.has(A))return;const F=Ht(S),B=x.querySelectorAll(A==="heading-title"?"heading":A).filter(O=>A==="attr-value"?xt(O)===L||vt(O)===C:Ht(O)===F).reverse().map(O=>({range:Ue(O.type==="parameter-key"?O.parentNode:O)}));return B.length===0?void 0:B}async provideDefinition(g,h){const x=await R(this,u,Fe).call(this,g),b=x.elementFromPoint(h.character,h.line),m=b.is("ext")&&b.name==="ref"?b:b.closest("ext#ref"),y=nt(m,"name");if(!y)return;const S=nt(m,"group"),A=x.querySelectorAll("ext#ref").filter(L=>L.innerText&&nt(L,"name")===y&&nt(L,"group")===S).reverse().map(({lastChild:L})=>({range:Ue(L)}));return A.length===0?void 0:A}async resolveRenameLocation(g,h){const x=await R(this,u,Fe).call(this,g),b=x.elementFromPoint(h.character,h.line),{type:m}=b,y=xt(b),S=vt(b);return!y&&!S&&(!sn.has(m)||m==="parameter-key"&&/^[1-9]\d*$/u.test(b.parentNode.name)||m==="link-target"&&!["link","redirect-target"].includes(b.parentNode.type))?void 0:Ue(b)}async provideRenameEdits(g,h,x){const b=await R(this,u,Fe).call(this,g),m=b.elementFromPoint(h.character,h.line),{type:y}=m,S=xt(m),A=S&&nt(m.parentNode.parentNode,"group"),L=vt(m),C=Ht(m),F=b.querySelectorAll(y).filter(B=>{const{type:O}=B.parentNode;return y==="link-target"&&O!=="link"&&O!=="redirect-target"?!1:y==="attr-value"?vt(B)===L||xt(B)===S&&nt(B.parentNode.parentNode,"group")===A:Ht(B)===C});return F.length===0?void 0:{changes:{"":F.reverse().map(B=>({range:Ue(B),newText:x}))}}}async provideHover(g,h){if(!this.data)return;const x=await R(this,u,Fe).call(this,g);let{offsetNode:b,offset:m}=ln(x,w(this,e),h);b.type==="text"&&(m+=b.getRelativeIndex(),b=b.parentNode);const{type:y,parentNode:S,length:A,name:L}=b;let C,F,B,O;if(b.is("double-underscore")&&m>0)C=R(this,u,Nn).call(this,b.name);else if(y==="magic-word-name")C=R(this,u,bt).call(this,S.name),F=b.text().trim(),B=S.getAttribute("colon");else if(b.is("magic-word")&&!b.modifier&&A===1&&(m>0||x.posFromIndex(b.getAbsoluteIndex()).left===h.character))C=R(this,u,bt).call(this,L),F=b.firstChild.text().trim(),B=b.getAttribute("colon");else if((b.is("magic-word")||b.is("template"))&&b.modifier&&m>=2&&b.getRelativeIndex(0)>m&&(F=b.modifier.trim().slice(0,-1),C=R(this,u,bt).call(this,F.toLowerCase()),B=":",C)){const E=b.getAbsoluteIndex();O={start:mt(x,E+2),end:mt(x,E+b.modifier.trimEnd().length+1)}}return C&&{contents:{kind:"markdown",value:(C.signatures?`${C.signatures.map(E=>`- **{{ ${F}${E.length===0?"**":`${B}** `}${E.map(({label:D,const:W})=>W?D:`*${D}*`).join(" **|** ")} **}}**`).join(`
|
|
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
|
+
${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,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
|
-
`:"")+
|
|
33
|
-
${x.slice(
|
|
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
|
-
`),
|
|
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
|