wikiparser-node 1.21.3 → 1.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/README.md +6 -0
  2. package/bundle/bundle-es8.min.js +24 -24
  3. package/bundle/bundle-lsp.min.js +26 -26
  4. package/bundle/bundle.min.js +24 -24
  5. package/config/default.json +15 -11
  6. package/config/enwiki.json +1 -1
  7. package/config/jawiki.json +1 -1
  8. package/config/minimum.json +2 -3
  9. package/config/moegirl.json +152 -15
  10. package/config/zhwiki.json +1 -1
  11. package/dist/addon/token.js +3 -0
  12. package/dist/base.d.mts +10 -8
  13. package/dist/base.d.ts +10 -8
  14. package/dist/bin/config.js +23 -11
  15. package/dist/index.d.ts +31 -2
  16. package/dist/index.js +27 -1
  17. package/dist/lib/element.d.ts +4 -4
  18. package/dist/lib/element.js +4 -4
  19. package/dist/lib/lintConfig.js +123 -6
  20. package/dist/lib/lsp.d.ts +7 -7
  21. package/dist/lib/lsp.js +12 -16
  22. package/dist/lib/node.d.ts +1 -1
  23. package/dist/lib/node.js +1 -1
  24. package/dist/lib/range.d.ts +2 -2
  25. package/dist/lib/range.js +2 -2
  26. package/dist/lib/text.js +72 -62
  27. package/dist/lib/title.d.ts +11 -4
  28. package/dist/lib/title.js +16 -6
  29. package/dist/parser/commentAndExt.js +6 -4
  30. package/dist/parser/converter.js +1 -1
  31. package/dist/src/arg.js +11 -10
  32. package/dist/src/attribute.js +31 -19
  33. package/dist/src/attributes.js +10 -8
  34. package/dist/src/commented.js +1 -1
  35. package/dist/src/converterRule.js +2 -2
  36. package/dist/src/gallery.js +26 -19
  37. package/dist/src/heading.js +32 -36
  38. package/dist/src/html.js +64 -51
  39. package/dist/src/index.d.ts +2 -2
  40. package/dist/src/index.js +10 -8
  41. package/dist/src/link/base.d.ts +1 -1
  42. package/dist/src/link/base.js +22 -15
  43. package/dist/src/link/file.js +22 -14
  44. package/dist/src/link/index.d.ts +1 -1
  45. package/dist/src/link/index.js +1 -1
  46. package/dist/src/magicLink.js +16 -12
  47. package/dist/src/nowiki/index.js +1 -1
  48. package/dist/src/nowiki/quote.js +19 -38
  49. package/dist/src/table/index.js +33 -27
  50. package/dist/src/table/td.d.ts +1 -1
  51. package/dist/src/table/td.js +27 -25
  52. package/dist/src/table/trBase.js +13 -10
  53. package/dist/src/tagPair/ext.js +6 -3
  54. package/dist/src/tagPair/index.js +2 -3
  55. package/dist/src/transclude.d.ts +15 -1
  56. package/dist/src/transclude.js +43 -13
  57. package/dist/util/lint.js +3 -5
  58. package/dist/util/sharable.js +1 -1
  59. package/dist/util/sharable.mjs +2 -2
  60. package/extensions/dist/base.js +8 -1
  61. package/extensions/typings.d.ts +2 -1
  62. package/i18n/zh-hans.json +1 -1
  63. package/i18n/zh-hant.json +1 -1
  64. package/package.json +7 -2
@@ -1,32 +1,32 @@
1
- "use strict";(()=>{var kl=Object.defineProperty;var Pn=e=>{throw TypeError(e)};var _l=(e,t,s)=>t in e?kl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var Tl=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ae=(e,t,s)=>_l(e,typeof t!="symbol"?t+"":t,s),Ps=(e,t,s)=>t.has(e)||Pn("Cannot "+s);var f=(e,t,s)=>(Ps(e,t,"read from private field"),s?s.call(e):t.get(e)),q=(e,t,s)=>t.has(e)?Pn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),j=(e,t,s,n)=>(Ps(e,t,"write to private field"),n?n.call(e,s):t.set(e,s),s),P=(e,t,s)=>(Ps(e,t,"access private method"),s);var En=(e,t,s,n)=>({set _(a){j(e,t,a,s)},get _(){return f(e,t,n)}});var Td=Tl((Cd,$l)=>{var Il=Object.create,pt=Object.defineProperty,La=Object.getOwnPropertyDescriptor,hn=Object.getOwnPropertyNames,Cl=Object.prototype.hasOwnProperty,ja=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),ft=e=>{throw TypeError(e)},Ra=(e,t,s)=>t in e?pt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,On=(e,t)=>pt(e,"name",{value:t,configurable:!0}),C=(e,t)=>function(){return e&&(t=(0,e[hn(e)[0]])(e=0)),t},Nl=(e,t)=>function(){return t||(0,e[hn(e)[0]])((t={exports:{}}).exports,t),t.exports},ie=(e,t)=>{for(var s in t)pt(e,s,{get:t[s],enumerable:!0})},Fl=(e,t,s,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of hn(t))!Cl.call(e,a)&&a!==s&&pt(e,a,{get:()=>t[a],enumerable:!(n=La(t,a))||n.enumerable});return e},Y=e=>Fl(pt({},"__esModule",{value:!0}),e),oe=e=>{var t;return[,,,Il((t=e==null?void 0:e[ja("metadata")])!=null?t:null)]},Pa=["class","method","getter","setter","accessor","field","value","get","set"],Lt=e=>e!==void 0&&typeof e!="function"?ft("Function expected"):e,Ll=(e,t,s,n,a)=>({kind:Pa[e],name:t,metadata:n,addInitializer:r=>s._?ft("Already initialized"):a.push(Lt(r||null))}),cn=(e,t)=>Ra(t,ja("metadata"),e[3]),le=(e,t,s,n)=>{for(var a=0,r=e[t>>1],i=r&&r.length;a<i;a++)t&1?r[a].call(s):n=r[a].call(s,n);return n},de=(e,t,s,n,a,r)=>{var i,o,l,d,h,c=t&7,x=!!(t&8),g=!!(t&16),u=c>3?e.length+1:c?x?1:2:0,y=Pa[c+5],k=c>3&&(e[u-1]=[]),$=e[u]||(e[u]=[]),T=c&&(!g&&!x&&(a=a.prototype),c<5&&(c>3||!g)&&La(c<4?a:{get[s](){return ge(this,r)},set[s](p){return ke(this,r,p)}},s));c?g&&c<4&&On(r,(c>2?"set ":c>1?"get ":"")+s):On(a,s);for(var m=n.length-1;m>=0;m--)d=Ll(c,s,l={},e[3],$),c&&(d.static=x,d.private=g,h=d.access={has:g?p=>Rl(a,p):p=>s in p},c^3&&(h.get=g?p=>(c^1?ge:dt)(p,a,c^4?r:T.get):p=>p[s]),c>2&&(h.set=g?(p,b)=>ke(p,a,b,c^4?r:T.set):(p,b)=>p[s]=b)),o=(0,n[m])(c?c<4?g?r:T[y]:c>4?void 0:{get:T.get,set:T.set}:a,d),l._=1,c^4||o===void 0?Lt(o)&&(c>4?k.unshift(o):c?g?r=o:T[y]=o:a=o):typeof o!="object"||o===null?ft("Object expected"):(Lt(i=o.get)&&(T.get=i),Lt(i=o.set)&&(T.set=i),Lt(i=o.init)&&k.unshift(i));return c||cn(e,a),T&&pt(a,s,T),g?c^4?r:T:a},jl=(e,t,s)=>Ra(e,typeof t!="symbol"?t+"":t,s),un=(e,t,s)=>t.has(e)||ft("Cannot "+s),Rl=(e,t)=>Object(t)!==t?ft('Cannot use the "in" operator on this value'):e.has(t),ge=(e,t,s)=>(un(e,t,"read from private field"),s?s.call(e):t.get(e)),Fe=(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),ke=(e,t,s,n)=>(un(e,t,"write to private field"),n?n.call(e,s):t.set(e,s),s),dt=(e,t,s)=>(un(e,t,"access private method"),s),Pl=(e,t,s,n)=>({set _(a){ke(e,t,a,s)},get _(){return ge(e,t,n)}}),Ea,gn,Oa=C({"base.ts"(){"use strict";Ea=(()=>{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})(),gn=(()=>{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 Ge(e){const t=new Map,s=new WeakMap;return n=>{const a=typeof n=="string"?t:s;if(a.has(n)){const i=a.get(n);return i.lastIndex=0,i}const r=e(n);return a.set(n,r),r}}var Jt,qa,qn,Ba,Wa,xt=C({"../code-standard/dist/index.mjs"(){"use strict";Jt=e=>decodeURIComponent(e.replace(/%(?![\da-f]{2})/giu,"%25")),qa=e=>Math.round(e*255).toString(16).padStart(2,"0"),qn=(()=>{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)?`,n=String.raw`rgba?\(\s*(?:${String.raw`${new Array(3).fill(t).join(String.raw`\s+`)}(?:\s*\/\s*${t})?`}|${String.raw`${new Array(3).fill(t).join(String.raw`\s*,\s*`)}(?:\s*,\s*${t})?`})\s*\)`,a=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}|${n}|${a})`,"giu"),rgb:new RegExp(String.raw`(^|[^\p{L}\p{N}_])(${e}|${n})`,"giu")}})(),Ba=(e,t=!0)=>{const s=[],n=qn[t?"full":"rgb"];n.lastIndex=0;let a=n.exec(e),r=0;for(;a;){const i=a.index+a[1].length;i>r&&s.push([e.slice(r,i),r,i,!1]),{lastIndex:r}=n,s.push([a[2],i,r,e[i-1]!=="&"||!/^#\d+$/u.test(a[2])]),a=n.exec(e)}return e.length>r&&s.push([e.slice(r),r,e.length,!1]),s},Wa=Ge}}),Ee,Es,ht,ct,ut,Le,Ye,Xt,_e,Ve,Bn,Wn,Kt,Ua,Un,Mn,Yt,gt,ce=C({"util/string.ts"(){"use strict";xt(),Ee=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,Es=String.raw`[^[\]<>"\0-\x1F\x7F${Ee}\uFFFD]`,ht=String.raw`(?:\[[\da-f:.]+\]|${Es})`,ct=String.raw`(?:${Es}|\0\d+[cn!~]\x7F)*`,ut=e=>e.trim().toLowerCase(),Le=(e,t)=>e.replace(/\0(\d+)\x7F/gu,(s,n)=>t[n]),Ye=(e,t)=>s=>s.replace(e,t),Xt=Ye(/[\0\x7F]|\r$/gmu,""),_e=Ye(/\0\d+[cn]\x7F/gu,""),Ve=(e,t="")=>e.map(s=>typeof s=="string"?s:s.text()).join(t),Bn={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},Wn=Ye(/&(?:#(\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)):Bn[s.toLowerCase()]),Kt=e=>Wn(e),Ua=Ye(/&#(\d+|x[\da-f]+);/giu,(e,t)=>String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t))),Un={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},Mn=e=>Ye(e,t=>`&${Un[t]};`),Yt=Mn(/[&<>]/gu),gt=(e,t={})=>{const{pre:s="",post:n="",sep:a=""}=t;return s+e.map(r=>r.print()).join(a)+n}}}),El=Nl({"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","#urlencode":"urlencode","#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","#cscore":"cscore","#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","#chart":"chart"},{"!":"!","=":"=","#FORMAL":"formal","#bcp47":"bcp47","#dir":"dir","#interwikilink":"interwikilink","#interlanguagelink":"interlanguagelink","#timef":"timef","#timefl":"timefl"},["msg","raw"],["subst","safesubst"]],doubleUnderscore:[[],[]],protocol:"bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|matrix:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|worldwind://|xmpp:",interwiki:[],img:{},redirection:["#redirect"],variants:[]}}}),we,Gr,Qe=C({"util/constants.ts"(){"use strict";we=11,Gr=El()}}),he,ue=C({"lib/rect.ts"(){"use strict";var e,t,s,n,Dr,r;he=(r=class{constructor(i,o){q(this,n);q(this,e);q(this,t);q(this,s);j(this,e,i),j(this,t,o)}get start(){return f(this,t)}get top(){return P(this,n,Dr).call(this).top}get left(){return P(this,n,Dr).call(this).left}},e=new WeakMap,t=new WeakMap,s=new WeakMap,n=new WeakSet,Dr=function(){var i;return(i=f(this,s))!=null||j(this,s,f(this,e).getRootNode().posFromIndex(f(this,t))),f(this,s)},r)}}),zn,Hn,Dt,Zt,Os,Q,Z,De,pn,X=C({"util/lint.ts"(){"use strict";be(),ue(),J(),zn=new Set(["tr","td","th","caption"]),Hn=new Set(["Template:!!","Template:!-"]),Dt=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")&&Hn.has(t.name)||t.is("html")&&zn.has(t.name))return!1;if(t.is("arg"))return t.length>1&&Dt(t.childNodes[1]);if(t.is("magic-word"))try{const s=t.getPossibleValues().map(Dt);return s.includes("error")?"error":s.includes("warning")&&"warning"}catch{}return t.is("template")||t.is("magic-word")&&t.name==="invoke"?"warning":"error"},Zt=(e,t,s,n)=>({line:e+s-1,character:(s===1?t:0)+n}),Os=e=>(t,s,n,a,r="error")=>{const{start:i}=s,{top:o,left:l}=s instanceof he?s:new he(t,i),{offsetHeight:d,offsetWidth:h}=t,{startIndex:c,startLine:x,startCol:g}=e(t,i,o,l),{line:u,character:y}=Zt(x,g,d,h);return{rule:n,message:W.msg(a),severity:r,startIndex:c,endIndex:c+t.toString().length,startLine:x,endLine:u,startCol:g,endCol:y}},Q=Os((e,t,s,n)=>{const a=e.getRelativeIndex(),{top:r,left:i}=e.parentNode.posFromIndex(a);return{startIndex:t+a,startLine:s+r,startCol:r?i:n+i}}),Z=Os((e,t,s,n)=>({startIndex:t,startLine:s,startCol:n})),De=(e,t,s,n)=>{if(e&&(n||W.viewOnly&&e[0]===me.rev))return e[1];const a=t();return(n||W.viewOnly)&&s([me.rev,a]),a},pn=(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"]:[]}}),Gn,xs,Ol=C({"parser/selector.ts"(){"use strict";Gn=(e,t,s)=>{if(e.includes("#")){const[n,...a]=e.split("#");return(!n||n===t)&&a.every(r=>r===s)}return!e||e===t},xs=(e,t,s)=>({type:n,name:a})=>e.split(",").some(r=>Gn(r.trim(),n,a))}}),fn,Ma=C({"mixin/cached.ts"(){"use strict";X(),fn=(e=!0)=>t=>{const s=new WeakMap;return function(...n){return De(s.get(this),()=>t.apply(this,n),a=>{s.set(this,a)},e)}}}}),Dn,ns,St,At,is,$t,kt,_t,as,os,Vt,za=C({"lib/node.ts"(){"use strict";X(),be(),Ma(),J(),Dn=[fn(!1)],Vt=class{constructor(){le(os,5,this),Fe(this,_t),jl(this,"childNodes",[]),Fe(this,ns),Fe(this,St),Fe(this,At),Fe(this,is),Fe(this,$t),Fe(this,kt,{})}get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get parentNode(){return ge(this,ns)}get nextSibling(){return ge(this,St)}get previousSibling(){return ge(this,At)}get offsetHeight(){return dt(this,_t,as).call(this).height}get offsetWidth(){return dt(this,_t,as).call(this).width}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,ns,t),t||(ke(this,St,void 0),ke(this,At,void 0));break;case"nextSibling":ke(this,St,t);break;case"previousSibling":ke(this,At,t);break;case"aIndex":W.viewOnly&&ke(this,$t,[me.rev,t]);break;default:this[e]=t}}getRootNode(){return De(ge(this,is),()=>{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,is,e)})}indexFromPos(e,t){{if(e<0||t<0)return;const s=this.getLines();if(e>=s.length)return;const[,n,a]=s[e],r=n+t;return r>a?void 0:r}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(),n=s.findIndex(([,,a])=>e<=a);return{top:n,left:e-s[n][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 De(ge(this,kt)[e],()=>{const{childNodes:t}=this,s=e+(e<0?t.length:0);let n=this.getAttribute("padding");for(let a=0;a<s;a++)W.viewOnly&&(ge(this,kt)[a]=[me.rev,n]),n+=t[a].toString().length+this.getGaps(a);return n},t=>{ge(this,kt)[e]=t})}getAbsoluteIndex(){return De(ge(this,$t),()=>{const{parentNode:e}=this;return e?e.getAbsoluteIndex()+this.getRelativeIndex():0},e=>{ke(this,$t,e)})}getBoundingClientRect(){return{...dt(this,_t,as).call(this),...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 n=t+s.length;e.push([s,t,n]),t=n+1}return e}seal(e,t){Object.defineProperty(this,e,{enumerable:!t&&!!this[e],configurable:!0})}lspError(e){throw new Error(`${e} method is only available in the LSP version!`)}},os=oe(null),ns=new WeakMap,St=new WeakMap,At=new WeakMap,is=new WeakMap,$t=new WeakMap,kt=new WeakMap,_t=new WeakSet,as=function(){const e=this.getLines(),t=e[e.length-1];return{height:e.length,width:t[2]-t[1]}},de(os,1,"getLines",Dn,Vt),cn(os,Vt)}}),Ha,ql=C({"lib/element.ts"(){"use strict";var e,Vr,Qr,n;ce(),be(),Ol(),za(),Ha=(n=class extends Vt{constructor(){super(...arguments);q(this,e)}get length(){return this.childNodes.length}text(r){return Ve(this.childNodes,r)}normalize(){const r=this.getChildNodes(),i=o=>{var l,d;r.splice(o,1),(l=r[o-1])==null||l.setAttribute("nextSibling",r[o]),(d=r[o])==null||d.setAttribute("previousSibling",r[o-1])};for(let o=r.length-1;o>=0;o--){const{type:l,data:d}=r[o];l!=="text"||r.length===1||this.getGaps(o-(o&&1))||d===""&&i(o)}this.setAttribute("childNodes",r)}removeAt(r){return $s(this,r,1)[0]}insertAt(r,i=this.length){return $s(this,i,0,[r]),r}closest(r){const i=xs(r,this);let{parentNode:o}=this;for(;o;){if(i(o))return o;({parentNode:o}=o)}}querySelector(r){const i=xs(r,this);return P(this,e,Vr).call(this,i)}querySelectorAll(r){const i=xs(r,this);return P(this,e,Qr).call(this,i)}append(...r){this.safeAppend(r)}safeAppend(r){for(const i of r)this.insertAt(i)}replaceChildren(...r){this.safeReplaceChildren(r)}safeReplaceChildren(r){for(let i=this.length-1;i>=0;i--)this.removeAt(i);this.safeAppend(r)}setText(r,i=0){i+=i<0?this.length:0;const o=this.childNodes[i],{data:l}=o;return o.replaceData(r),l}toString(r,i=""){return this.childNodes.map(o=>o.toString(r)).join(i)}caretPositionFromIndex(r){{if(r===void 0)return;const{length:i}=this.toString();if(r>i||r<-i)return;r+=r<0?i:0;let o=this,l=0,d=0;for(;o.type!=="text";){const{childNodes:h}=o;l+=o.getAttribute("padding");for(let c=0;l<=r&&c<h.length;c++){const x=h[c],{nextSibling:g}=x,u=x.toString(),y=u.length;if(x.setAttribute("aIndex",l),l+=y,l>r||l===r&&y>0&&(!g||g.type==="text"||x.type!=="text"&&(u.trim()||!g.toString().trim()))){o=x,l-=y,d=l;break}l+=o.getGaps(c)}if(o.childNodes===h)return{offsetNode:o,offset:r-d}}return{offsetNode:o,offset:r-d}}this.lspError("AstElement.caretPositionFromIndex")}elementFromIndex(r){var i;{const o=(i=this.caretPositionFromIndex(r))==null?void 0:i.offsetNode;return(o==null?void 0:o.type)==="text"?o.parentNode:o}this.lspError("AstElement.elementFromIndex")}elementFromPoint(r,i){return this.elementFromIndex(this.indexFromPos(i,r))}lint(r=this.getAbsoluteIndex(),i){const o=[];for(let l=0,d=r+this.getAttribute("padding");l<this.length;l++){const h=this.childNodes[l];h.setAttribute("aIndex",d);const c=h.lint(d,i);c.length>0&&o.push(...c),d+=h.toString().length+this.getGaps(l)}return o}print(r={}){const i=r.class;return this.toString()?(i===""?"":`<span class="wpb-${i!=null?i:this.type}${this.getAttribute("invalid")?" wpb-invalid":""}">`)+gt(this.childNodes,r)+(i===""?"":"</span>"):""}json(r,i=this.getAbsoluteIndex()){const o={...this,type:this.type,range:[i,i+this.toString().length],childNodes:[]};for(let l=0,d=i+this.getAttribute("padding");l<this.length;l++){const h=this.childNodes[l],{length:c}=h.toString();h.setAttribute("aIndex",d),o.childNodes.push(h.type==="text"?{data:h.data,range:[d,d+c]}:h.json(void 0,d)),d+=c+this.getGaps(l)}return o}},e=new WeakSet,Vr=function(r){var i;for(const o of this.childNodes){if(o.type==="text")continue;if(r(o))return o;const l=P(i=o,e,Vr).call(i,r);if(l)return l}},Qr=function(r){var o;let i=[];for(const l of this.childNodes)l.type!=="text"&&(r(l)&&i.push(l),i=[...i,...P(o=l,e,Qr).call(o,r)]);return i},n)}}),ls,qs,Vn,Qn,Jn,Xn,Kn,Bs,Ws,Jr,Bl=C({"lib/text.ts"(){"use strict";var e,Ga,s;ce(),X(),J(),za(),ls=String.raw`[${Ee}\t]*`,qs=String.raw`<\s*(?:/\s*)?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|(?:rfc|pmid)(?=[-::]?${ls}\d)|isbn(?=[-::]?${ls}(?:\d(?:${ls}|-)){6})`,Vn=new RegExp(String.raw`${qs}|https?[:/]/+`,"giu"),Qn=new RegExp(qs,"giu"),Jn=new Set(["attr-value","ext-link-text","link-text"]),Xn={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},Kn={"<":"tag-like","[":"lonely-bracket","{":"lonely-bracket","]":"lonely-bracket","}":"lonely-bracket",h:"lonely-http",r:"lonely-http",p:"lonely-http",i:"lonely-http"},Bs=new Set(["html","head","style","title","body","a","audio","img","video","embed","iframe","object","canvas","script","col","colgroup","tbody","tfoot","thead","button","input","label","option","select","textarea"]);try{Ws=new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch{Ws=/\w/u}Jr=(s=class extends Vt{constructor(a){super();q(this,e);Ae(this,"data","");this.data=a}get type(){return"text"}toString(a){var r;return a&&!((r=this.parentNode)!=null&&r.getAttribute("built"))?_e(this.data):this.data}text(){return this.data}lint(a=this.getAbsoluteIndex(),r){var _,E,F;if(r===!1)return[];const{data:i,parentNode:o,nextSibling:l,previousSibling:d}=this;if(!o)throw new Error("An isolated text node cannot be linted!");const{type:h,name:c,parentNode:x}=o;let g=!1;if(h==="attr-value"){const{type:N,name:O,tag:R}=x;if(N!=="ext-attr")g=!0;else if(R==="ref"&&(O==="name"||O==="extends"||O==="follow")||O==="group"&&(R==="ref"||R==="references")||R==="choose"&&(O==="before"||O==="after"))return[]}if(r!=null||(r=h==="free-ext-link"||h==="ext-link-url"||h==="ext-link-text"||h==="image-parameter"&&c==="link"||g?Qn:Vn),i.search(r)===-1)return[];r.lastIndex=0;const u=[],y=l==null?void 0:l.type,k=l==null?void 0:l.name,$=d==null?void 0:d.type,T=this.getRootNode(),m=T.toString(),{ext:p,html:b,variants:w}=T.getAttribute("config"),{top:v,left:A}=T.posFromIndex(a),S=new Set(["onlyinclude","noinclude","includeonly",...p,...b[0],...b[1],...b[2],...Bs]);for(let N=r.exec(i);N;N=r.exec(i)){const[,O,R]=N;let{index:L,0:U}=N;if(R&&R!=="]"){const{length:te}=R;L+=te,U=U.slice(te)}U=U.toLowerCase();const[I]=U,B=I==="r"||I==="p"||I==="i";let{length:M}=U;if(I==="<"&&!S.has(O.toLowerCase())||I==="["&&h==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(i.slice(L+1))||l!=null&&l.is("ext")&&k==="nowiki"&&((_=l.innerText)!=null&&_.includes("]")))||B&&(!o.isPlain()||Jn.has(h)))continue;I==="]"&&(L||M>1)&&r.lastIndex--;let H=a+L,G=H+M;const K=m[G],se=m[H-1];let re=M>1&&!(I==="<"&&(/^<\s/u.test(U)||!/[\s/>]/u.test(K!=null?K:"")||Bs.has(O))||g&&(I==="["||I==="]")||B&&h==="parameter-value"||/^(?:rfc|pmid|isbn)$/iu.test(U))||I==="{"&&(K===I||se==="-"&&w.length>0)||I==="}"&&(se===I||K==="-"&&w.length>0)||I==="["&&(h==="ext-link-text"||y==="free-ext-link"&&!i.slice(L+1).trim())||I==="]"&&$==="free-ext-link"&&!i.slice(0,L).includes("]")?"error":"warning";const Ne=I==="{"||I==="[";if(re==="warning"&&(Ne||(I==="]"||I==="}"))){const te=Xn[I],fe=Ne?i.slice(L+1):i.slice(0,L);if(I==="{"&&((E=te.exec(fe))==null?void 0:E[0])==="}"||I==="}"&&((F=te.exec(fe))==null?void 0:F[0])==="{")continue;if(!fe.includes(I)){const ye=Ne?"nextSibling":"previousSibling";let Se=this[ye];for(;Se&&(Se.type!=="text"||!te.test(Se.data));)Se=Se[ye];if(Se&&te.exec(Se.data)[0]!==I)continue}}B?U=U.toUpperCase():U==="{"&&se==="-"&&re==="error"?(re="warning",L>0&&(U="-{",L--,H--,M=2)):U==="}"&&K==="-"&&re==="error"&&(re="warning",L<i.length-1&&(U="}-",G++,M=2));const wt=this.posFromIndex(L),{line:yt,character:D}=Zt(v,A,wt.top+1,wt.left),ne={rule:Kn[I],message:W.msg('lonely "$1"',B||I==="h"||U==="-{"||U==="}-"?U:I),severity:re,startIndex:H,endIndex:G,startLine:yt,endLine:yt,startCol:D,endCol:D+M};if(I==="<")ne.suggestions=[{desc:"escape",range:[H,H+1],text:"&lt;"}];else if(I==="h"&&h!=="link-text"&&Ws.test(se||""))ne.suggestions=[{desc:"whitespace",range:[H,H],text:" "}];else if(I==="["&&h==="ext-link-text"){const te=o.getAbsoluteIndex()+o.toString().length;ne.suggestions=[{desc:"escape",range:[te,te+1],text:"&#93;"}]}else if(I==="]"&&$==="free-ext-link"&&re==="error"){const te=a-d.toString().length;ne.suggestions=[{desc:"left bracket",range:[te,te],text:"["}]}else B&&(ne.suggestions=[...N[0]===U?[]:[{desc:"uppercase",range:[H,G],text:U}],...K===":"||K===":"?[{desc:"whitespace",range:[G,G+1],text:" "}]:[]]);u.push(ne)}return u}replaceData(a){P(this,e,Ga).call(this,a)}print(){return Yt(this.data)}},e=new WeakSet,Ga=function(a){this.setAttribute("data",a)},s)}}),Je,mt=C({"mixin/hidden.ts"(){"use strict";be(),Je=(e=!0,t=!0)=>s=>{class n extends s{text(){return""}lint(r){return e?[]:super.lint(r)}}return bt(n,s),n}}}),Xe,vt=C({"src/syntax.ts"(){"use strict";var e,t;V(),Xe=(t=class extends z{constructor(n,a,r,i,o){super(n,r,i,o);q(this,e);j(this,e,a)}get type(){return f(this,e)}lint(n=this.getAbsoluteIndex()){return super.lint(n,!1)}},e=new WeakMap,t)}}),je,Oe=C({"mixin/padded.ts"(){"use strict";be(),je=({length:e})=>t=>{class s extends t{getAttribute(a){return a==="padding"?e:super.getAttribute(a)}}return bt(s,t),s}}}),ve,qe=C({"src/atom.ts"(){"use strict";var e,t;V(),ve=(t=class extends z{constructor(n,a,r,i,o){super(n,r,i,o);q(this,e);j(this,e,a)}get type(){return f(this,e)}set type(n){j(this,e,n)}getAttribute(n){var a;return n==="invalid"?this.type==="converter-flag"&&!!((a=this.parentNode)!=null&&a.isInvalidFlag(this)):super.getAttribute(n)}},e=new WeakMap,t)}}),Yn,Zn,Us,ei,Pe,ks=C({"src/link/base.ts"(){"use strict";var e,t,s,n;X(),Qe(),ce(),ue(),Oe(),V(),qe(),Yn=a=>a==="redirect-target"||a==="link",Zn=[je("[[")],Pe=(n=class extends(ei=z){constructor(r,i,o,l=[],d="|"){super(void 0,o,l,{});q(this,e,!0);q(this,t);q(this,s);if(this.insertAt(new ve(r,"link-target",o,l,{})),i!==void 0){const h=new z(i,o,l,{});h.type="link-text",h.setAttribute("stage",we-1),this.insertAt(h)}j(this,t,d)}get link(){return f(this,s)}get fragment(){return f(this,s).fragment}afterBuild(){j(this,s,this.getTitle()),f(this,t).includes("\0")&&j(this,t,this.buildFromStr(f(this,t),0)),this.setAttribute("name",f(this,s).title),super.afterBuild()}setAttribute(r,i){r==="bracket"?j(this,e,i):r==="title"?j(this,s,i):super.setAttribute(r,i)}toString(r){const i=super.toString(r,f(this,t));return f(this,e)?`[[${i}]]`:i}text(){const r=super.text("|");return f(this,e)?`[[${r}]]`:r}getAttribute(r){return r==="title"?f(this,s):super.getAttribute(r)}getGaps(r){return r===0?f(this,t).length:1}lint(r=this.getAbsoluteIndex(),i){const o=super.lint(r,i),{childNodes:[l,d],type:h}=this,{encoded:c,fragment:x}=f(this,s),g=new he(this,r);if(l.childNodes.some(({type:u})=>u==="template")&&o.push(Q(l,g,"unknown-page","template in an internal link target","warning")),c){const u=Q(l,g,"url-encoding","unnecessary URL encoding in an internal link","warning");u.fix={desc:"decode",range:[u.startIndex,u.endIndex],text:Jt(l.text())},o.push(u)}if(h==="link"||h==="category"){const u=d==null?void 0:d.childNodes.findIndex(k=>k.type==="text"&&k.data.includes("|")),y=d==null?void 0:d.childNodes[u];if(y){const k=Q(d,g,"pipe-like",'additional "|" in the link text',"warning"),$=k.startIndex+d.getRelativeIndex(u);k.suggestions=[{desc:"escape",range:[$,$+y.data.length],text:y.data.replace(/\|/gu,"&#124;")}],o.push(k)}}if(x!==void 0&&!Yn(h)){const u=Q(l,g,"no-ignored","useless fragment","warning"),y=l.childNodes.findIndex($=>$.type==="text"&&$.data.includes("#")),k=l.childNodes[y];k&&(u.fix={desc:"remove",range:[u.startIndex+l.getRelativeIndex(y)+k.data.indexOf("#"),u.endIndex],text:""}),o.push(u)}return o}getTitle(r,i){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:i,temporary:r,decode:!0,selfLink:!0})}print(){return super.print(f(this,e)?{pre:"[[",post:"]]",sep:f(this,t)}:{sep:f(this,t)})}json(r,i=this.getAbsoluteIndex()){const o=super.json(void 0,i),{type:l,fragment:d}=this;return d!==void 0&&(l==="link"||l==="redirect-target")&&(o.fragment=d),o}},e=new WeakMap,t=new WeakMap,s=new WeakMap,n),Us=oe(ei),Pe=de(Us,0,"LinkBaseToken",Zn,Pe),le(Us,1,Pe)}}),Be,Ke=C({"src/nowiki/base.ts"(){"use strict";V(),Be=class extends z{get innerText(){return this.firstChild.data}constructor(e="",t,s){super(e,t,s)}}}}),ti,Ms,si,pe,We=C({"src/nowiki/noinclude.ts"(){"use strict";mt(),Ke(),ti=[Je()],pe=class extends(si=Be){get type(){return"noinclude"}toString(e){return e?"":super.toString()}},Ms=oe(si),pe=de(Ms,0,"NoincludeToken",ti,pe),le(Ms,1,pe)}}),Da,Wl=C({"src/link/redirectTarget.ts"(){"use strict";X(),J(),ks(),We(),Da=class extends Pe{get type(){return"redirect-target"}constructor(e,t,s,n){super(e,void 0,s,n),t!==void 0&&this.insertAt(new pe(t,s,n))}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",n=W.lintConfig.getSeverity(s,"redirect");if(n&&this.length===2){const a=Q(this.lastChild,{start:e},s,"useless link text",n);a.startIndex--,a.startCol--,a.fix={desc:"remove",range:[a.startIndex,a.endIndex],text:""},t.push(a)}return t}}}}),ri,zs,ni,jt,Ul=C({"src/redirect.ts"(){"use strict";var e,t,s;mt(),V(),vt(),Wl(),ri=[Je(!1,!1)],jt=(s=class extends(ni=z){constructor(a,r,i,o,l,d,h=[]){super(void 0,d,h);q(this,e);q(this,t);j(this,e,a),j(this,t,l),this.append(new Xe(r,"redirect-syntax",d,h),new Da(i,o==null?void 0:o.slice(1),d,h))}get type(){return"redirect"}getAttribute(a){return a==="padding"?f(this,e).length:super.getAttribute(a)}toString(a){return f(this,e)+super.toString(a)+f(this,t)}lint(a=this.getAbsoluteIndex()){const r=a+f(this,e).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",r),this.lastChild.lint(r)}print(){return super.print({pre:f(this,e),post:f(this,t)})}},e=new WeakMap,t=new WeakMap,s),zs=oe(ni),jt=de(zs,0,"RedirectToken",ri,jt),le(zs,1,jt)}}),Va={};ie(Va,{parseRedirect:()=>Qa});var Qa,Ml=C({"parser/redirect.ts"(){"use strict";J(),Ul(),Qa=(e,t,s)=>{var a;(a=t.regexRedirect)!=null||(t.regexRedirect=new RegExp(String.raw`^(\s*)((?:${t.redirection.join("|")})\s*(?::\s*)?)\[\[([^\n|\]]+)(\|.*?)?\]\](\s*)`,"iu"));const n=t.regexRedirect.exec(e);return n&&W.normalizeTitle(n[3],0,!1,t,{halfParsed:!0,temporary:!0,decode:!0}).valid?(e=`\0${s.length}o${e.slice(n[0].length)}`,new jt(...n.slice(1),t,s),e):!1}}}),ii,Hs,ai,Rt,zl=C({"src/onlyinclude.ts"(){"use strict";Oe(),V(),ii=[je("<onlyinclude>")],Rt=class extends(ai=z){get type(){return"onlyinclude"}toString(e){return`<onlyinclude>${super.toString(e)}</onlyinclude>`}isPlain(){return!0}print(){return super.print({pre:'<span class="wpb-ext">&lt;onlyinclude&gt;</span>',post:'<span class="wpb-ext">&lt;/onlyinclude&gt;</span>'})}},Hs=oe(ai),Rt=de(Hs,0,"OnlyincludeToken",ii,Rt),le(Hs,1,Rt)}}),ts,_s=C({"mixin/gapped.ts"(){"use strict";be(),ts=(e=1)=>t=>{class s extends t{getGaps(){return e}}return bt(s,t),s}}}),oi,Gs,li,He,xn=C({"src/tagPair/index.ts"(){"use strict";var e,t;_s(),V(),oi=[ts()],He=(t=class extends(li=z){constructor(n,a,r,i,o,l=[]){super(void 0,o);q(this,e);Ae(this,"closed");Ae(this,"selfClosing");this.setAttribute("name",n.toLowerCase()),j(this,e,[n,i||n]),this.closed=i!=="",this.selfClosing=i===void 0,this.append(a,r);const d=typeof a=="string"?-1:l.indexOf(a);l.splice(d===-1?1/0:d,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(n){const{selfClosing:a,firstChild:r,lastChild:i}=this,[o,l]=f(this,e);return a?`<${o}${r.toString(n)}/>`:`<${o}${r.toString(n)}>${i.toString(n)}${this.closed?`</${l}>`:""}`}text(){const[n,a]=f(this,e);return this.selfClosing?`<${n}${this.firstChild.text()}/>`:`<${n}${super.text(">")}${this.closed?`</${a}>`:""}`}getAttribute(n){return n==="padding"?f(this,e)[0].length+1:super.getAttribute(n)}print(){const[n,a]=f(this,e);return super.print(this.selfClosing?{pre:`&lt;${n}`,post:"/&gt;"}:{pre:`&lt;${n}`,sep:"&gt;",post:this.closed?`&lt;/${a}&gt;`:""})}},e=new WeakMap,t),Gs=oe(li),He=de(Gs,0,"TagPairToken",oi,He),le(Gs,1,He)}}),Ja,Hl=C({"src/tagPair/translate.ts"(){"use strict";var e,Xa,s;V(),xn(),vt(),We(),Ja=(s=class extends He{constructor(a,r,i,o=[]){const l=new Xe(a,"translate-attr",i,o);r=r==null?void 0:r.replace(/(<tvar\|[^>]+>)([\s\S]*?)(<\/>)/gu,(h,c,x,g)=>(new pe(c,i,o),new pe(g,i,o),`\0${o.length-1}n${x}\0${o.length}n`)).replace(/(<tvar\s+name\s*=(?:\s*(?:(["'])[\s\S]*?\2|[^"'\s>]+))?\s*>)([\s\S]*?)(<\/tvar\s*>)/giu,(h,c,x,g,u)=>(new pe(c,i,o),new pe(u,i,o),`\0${o.length-1}n${g}\0${o.length}n`));const d=new z(r,i,o);d.type="translate-inner";super("translate",l,d,"translate",i,o);q(this,e);this.seal("closed",!0),this.seal("selfClosing",!0)}get type(){return"translate"}toString(a){return a?this.lastChild.toString(!0):super.toString()}text(){return this.lastChild.text()}print(){return`<span class="wpb-ext">&lt;translate${P(this,e,Xa).call(this)?'<span class="wpb-ext-attrs"> <span class="wpb-ext-attr"><span class="wpb-attr-key">nowrap</span></span></span>':""}&gt;${this.lastChild.print({class:"ext-inner"})}&lt;/translate&gt;</span>`}},e=new WeakSet,Xa=function(){return this.firstChild.toString()===" nowrap"},s)}}),di,Ds,hi,Pt,Gl=C({"src/tagPair/include.ts"(){"use strict";X(),ue(),mt(),J(),xn(),di=[Je(!1)],Pt=class extends(hi=He){get type(){return"include"}constructor(e,t="",s,n,a,r){super(e,t,s!=null?s:"",s===void 0||n!=null?n:"",a,r)}toString(e){return e?"":super.toString()}lint(e=this.getAbsoluteIndex()){const t=[],{firstChild:s,closed:n,name:a}=this,r=new he(this,e),i=["no-ignored","unclosed-comment"],o=i.map(l=>W.lintConfig.getSeverity(l,"include"));if(o[0]&&s.data.trim()){const l=Q(s,r,i[0],"useless attribute",o[0]);l.suggestions=[{desc:"remove",range:[l.startIndex,l.endIndex],text:""}],t.push(l)}if(o[1]&&!n){const l=Z(this,r,i[1],W.msg("unclosed $1",`<${a}>`),o[1]);l.suggestions=[{desc:"close",range:[l.endIndex,l.endIndex],text:`</${a}>`}],t.push(l)}return t}},Ds=oe(hi),Pt=de(Ds,0,"IncludeToken",di,Pt),le(Ds,1,Pt)}}),Ts,mn=C({"mixin/attributesParent.ts"(){"use strict";be(),Ts=(e=0)=>t=>{var n,Xr;class s extends t{constructor(){super(...arguments);q(this,n)}hasAttr(o){return P(this,n,Xr).call(this).hasAttr(o)}getAttr(o){return P(this,n,Xr).call(this).getAttr(o)}}return n=new WeakSet,Xr=function(){return this.childNodes[e]},bt(s,t),s}}}),ae,Vs,Qs,Tt,ds,Js,Ue,Xs,Ks,Ys,hs,Zs,Ie,vn,bn,wn,Ka,Ya=C({"util/sharable.ts"(){"use strict";ae=new Set(["align"]),Vs=new Set(["cite"]),Qs=new Set(["cite","datetime"]),Tt=new Set(["width"]),ds=new Set(["axis","align","bgcolor","height","width","valign"]),Js=new Set([...ds,"abbr","headers","scope","rowspan","colspan"]),Ue=new Set(["type"]),Xs=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),Ks=new Set(["clear"]),Ys=new Set(["bgcolor","align","valign"]),hs=new Set(["qid","forcemathmode","type","display"]),Zs=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),Ie=new Set,vn=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"]),bn={div:ae,h1:ae,h2:ae,h3:ae,h4:ae,h5:ae,h6:ae,blockquote:Vs,q:Vs,p:ae,br:Ks,pre:Tt,ins:Qs,del:Qs,ul:Ue,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...Xs,"border"]),caption:ae,tr:Ys,td:Js,th:Js,img:new Set(["alt","src","width","height","srcset"]),font:new Set(["size","color","face"]),hr:Tt,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:Ue,poem:ae,categorytree:ae,combooption:ae,math:Ie,chem:Ie,ce:Ie},wn={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:Ie,indicator:new Set(["name"]),langconvert:new Set(["from","to"]),ref:new Set(["group","name","extends","follow","dir"]),references:new Set(["group","responsive"]),charinsert:new Set(["label"]),choose:new Set(["uncached","before","after"]),option:new Set(["weight"]),imagemap:Ie,inputbox:Ie,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:Ie,poll:new Set(["id","show-results-before-voting"]),sm2:Ue,flashmp3:Ue,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([...hs,"chem"]),chem:hs,ce:hs,hiero:Ie,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:Zs,syntaxhighlight:Zs,templatedata:Ie,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:Ie},Ka={table:Xs,td:new Set([...ds,"scope"]),th:ds,br:Ks,caption:ae,div:ae,hr:Tt,h1:ae,h2:ae,h3:ae,h4:ae,h5:ae,h6:ae,li:Ue,p:ae,pre:Tt,tr:Ys,ul:Ue}}}),ci,ui,gi,pi,ms,Dl=C({"src/attribute.ts"(){"use strict";var e,t,s,n,a,Kr,i;X(),ce(),Qe(),Ya(),ue(),J(),V(),qe(),ci=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,ui=/(?:^|\s|\*\/)(?:javascript|vbscript)(?:\W|$)/iu,gi=new Set(["ext","arg","magic-word","template"]),pi=new Set(["about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),ms=(i=class extends z{constructor(l,d,h,c="",x,g=[],u=W.getConfig(),y=[]){const k=new ve(h,"attr-key",u,y);let $;if(h==="title"||d==="img"&&h==="alt")$=new z(x,u,y,{}),$.type="attr-value",$.setAttribute("stage",we-1);else if(d==="gallery"&&h==="caption"||d==="choose"&&(h==="before"||h==="after")){const T={...u,excludes:[...u.excludes,"heading","html","table","hr","list"]};$=new z(x,T,y,{}),$.type="attr-value",$.setAttribute("stage",1)}else $=new ve(x,"attr-value",u,y,{});super(void 0,u,y);q(this,a);q(this,e);q(this,t);q(this,s);q(this,n);j(this,e,l),this.append(k,$),j(this,s,c),j(this,n,[...g]),j(this,t,d),this.setAttribute("name",ut(_e(h)))}get type(){return f(this,e)}get tag(){return f(this,t)}get balanced(){return!f(this,s)||f(this,n)[0]===f(this,n)[1]}afterBuild(){f(this,s).includes("\0")&&j(this,s,this.buildFromStr(f(this,s),0)),this.parentNode&&j(this,t,this.parentNode.name),this.setAttribute("name",ut(this.firstChild.text())),super.afterBuild()}toString(l){const[d="",h=""]=f(this,n);return f(this,s)?super.toString(l,f(this,s)+d)+h:this.firstChild.toString(l)}text(){return f(this,s)?`${super.text(`${f(this,s).trim()}"`)}"`:this.firstChild.text()}getGaps(){var l,d;return f(this,s)?f(this,s).length+((d=(l=f(this,n)[0])==null?void 0:l.length)!=null?d:0):0}lint(l=this.getAbsoluteIndex(),d){var T;const h=super.lint(l,d),{balanced:c,firstChild:x,lastChild:g,name:u,tag:y}=this,k=new he(this,l);if(!c){const m=Q(g,k,"unclosed-quote",W.msg("unclosed $1","quotes"),"warning");m.startIndex--,m.startCol--,m.suggestions=[{desc:"close",range:[m.endIndex,m.endIndex],text:f(this,n)[0]}],h.push(m)}const $=P(this,a,Kr).call(this,l,k);return $&&h.push($),(T=Ka[y])!=null&&T.has(u)&&h.push(Q(x,k,"obsolete-attr","obsolete attribute","warning")),h}getValue(){return f(this,s)?this.lastChild.text().trim():this.type==="ext-attr"||""}getAttribute(l){return l==="invalid"?P(this,a,Kr).call(this):super.getAttribute(l)}print(){const[l="",d=""]=f(this,n);return f(this,s)?super.print({sep:Yt(f(this,s))+l,post:d}):super.print()}json(l,d=this.getAbsoluteIndex()){const h=super.json(void 0,d);return h.tag=this.tag,h}},e=new WeakMap,t=new WeakMap,s=new WeakMap,n=new WeakMap,a=new WeakSet,Kr=function(l,d){const{firstChild:h,lastChild:c,type:x,name:g,tag:u,parentNode:y}=this,k=!c.childNodes.some(({type:b})=>gi.has(b)),$=this.getValue(),T=wn[u],m=bn[u],{length:p}=this.toString();if(!(T!=null&&T.has(g))&&!(m!=null&&m.has(g))&&(x==="ext-attr"?T||m:!/\{\{[^{]+\}\}/u.test(g))&&(x==="ext-attr"&&!m||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(g)&&(u==="meta"||u==="link"||!vn.has(g)))||(g==="itemtype"||g==="itemid"||g==="itemref")&&!(y!=null&&y.hasAttr("itemscope"))){if(l===void 0)return!0;const b=Q(h,d,"illegal-attr","illegal attribute name");return b.suggestions=[{desc:"remove",range:[l,l+p],text:""}],b}else{if(g==="style"&&typeof $=="string"&&ci.test($))return l===void 0?!0:Q(c,d,"insecure-style","insecure style");if(g==="tabindex"&&typeof $=="string"&&$!=="0"){if(l===void 0)return!0;const b=Q(c,d,"illegal-attr","nonzero tabindex");return b.suggestions=[{desc:"remove",range:[l,l+p],text:""},{desc:"0 tabindex",range:[b.startIndex,b.endIndex],text:"0"}],b}else if(k&&x!=="ext-attr"){const b=pn(u,g),w=String($).toLowerCase();if(b.length>0&&b.every(v=>v!==w))return l===void 0?!0:Q(c,d,"illegal-attr","illegal attribute value","warning")}else if(typeof $=="string"&&((/^xmlns:[\w:.-]+$/u.test(g)||pi.has(g))&&ui.test($)||k&&(g==="href"||g==="src")&&!new RegExp(String.raw`^(?:${this.getAttribute("config").protocol}|//)\S+$`,"iu").test($)))return l===void 0?!0:Q(c,d,"illegal-attr","illegal attribute value")}return!1},i)}}),er,fi,tr,Is,yn=C({"src/attributes.ts"(){"use strict";var e,t,vs,n;X(),ce(),ue(),J(),V(),qe(),Dl(),er=a=>a.slice(0,-1),fi=a=>`${er(a)}-dirty`;try{tr=new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch{tr=/[^\W_]/u}Is=(n=class extends z{constructor(r,i,o,l,d=[]){super(void 0,l,d,{});q(this,t);q(this,e);if(j(this,e,i),this.setAttribute("name",o),r){const h=/([^\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="",x=h.exec(r),g=0;const u=()=>{c&&(super.insertAt(new ve(c,fi(i),l,d,{})),c="")};for(;x;){const{index:y,0:k,1:$,2:T,3:m,4:p,5:b,6:w}=x;if(c+=r.slice(g,y),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(_e($).trim())){const v=p!=null?p:w,A=[m,b],S=new ms(er(i),o,$,T,v,A,l,d);u(),super.insertAt(S)}else c+=k;({lastIndex:g}=h),x=h.exec(r)}c+=r.slice(g),u()}}get type(){return f(this,e)}afterBuild(){const{parentNode:r}=this;r!=null&&r.is("td")&&this.setAttribute("name",r.subtype),super.afterBuild()}getAttrTokens(r){return this.childNodes.filter(i=>i instanceof ms&&(!r||i.name===ut(r)))}hasAttr(r){return this.getAttrTokens(r).length>0}getAttrToken(r){const i=this.getAttrTokens(r);return i[i.length-1]}getAttr(r){var i;return(i=this.getAttrToken(r))==null?void 0:i.getValue()}lint(r=this.getAbsoluteIndex(),i){const o=super.lint(r,i),{parentNode:l,childNodes:d}=this,h=new Map,c=new Set,x=new he(this,r);if(P(this,t,vs).call(this)){const g=Z(this,x,"no-ignored","attributes of a closing tag"),u=l.getAbsoluteIndex();g.suggestions=[{desc:"remove",range:[r,g.endIndex],text:""},{desc:"open",range:[u+1,u+2],text:""}],o.push(g)}for(const g of d)if(g instanceof ms){const{name:u}=g;h.has(u)?(c.add(u),h.get(u).push(g)):h.set(u,[g])}else{const u=g.text().trim();if(u){const y=Q(g,x,"no-ignored","containing invalid attribute",tr.test(u)?"error":"warning");y.suggestions=[{desc:"remove",range:[y.startIndex,y.endIndex],text:" "}],o.push(y)}}if(c.size>0)for(const g of c){const u=h.get(g).map(y=>{const k=y.getValue();return[y,k===!0?"":k]});o.push(...u.map(([y,k],$)=>{const T=Q(y,x,"no-duplicate",W.msg("duplicated $1 attribute",g)),m={desc:"remove",range:[T.startIndex,T.endIndex],text:""};return!k||u.slice(0,$).some(([,p])=>p===k)?T.fix=m:T.suggestions=[m],T}))}return o}getAttribute(r){return r==="invalid"?P(this,t,vs).call(this):super.getAttribute(r)}print(){return this.toString()?`<span class="wpb-${this.type}${P(this,t,vs).call(this)?" wpb-invalid":""}">${this.childNodes.map(r=>r.print(r instanceof ve?{class:r.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}},e=new WeakMap,t=new WeakSet,vs=function(){const{parentNode:r}=this;return(r==null?void 0:r.type)==="html"&&r.closing&&this.text().trim()!==""},n)}}),Za={};ie(Za,{PreToken:()=>eo});var eo,Vl=C({"src/pre.ts"(){"use strict";Qe(),V(),We(),eo=class extends z{get type(){return"ext-inner"}constructor(e,t,s=[]){if(e){const n=/<nowiki>/giu,a=/<\/nowiki>/giu,{length:r}=n.source;let i=n.exec(e);i&&(a.lastIndex=i.index+r);let o=a.exec(e),l=0,d="";for(;i&&o;)new pe(i[0],t,s),new pe(o[0],t,s),d+=`${e.slice(l,i.index)}\0${s.length-1}n${e.slice(i.index+r,o.index)}\0${s.length}n`,l=o.index+r+1,n.lastIndex=l,i=n.exec(e),i&&(a.lastIndex=i.index+r),o=a.exec(e);e=d+e.slice(l)}super(e,t,s,{}),this.setAttribute("stage",we-1)}isPlain(){return!0}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*\/\s*(pre)\b/giu)}}}}),Cs,Sn=C({"mixin/multiLine.ts"(){"use strict";be(),Cs=e=>{class t extends e{toString(n){return super.toString(n,`
1
+ "use strict";(()=>{var Io=Object.defineProperty;var Br=e=>{throw TypeError(e)};var To=(e,t,s)=>t in e?Io(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var No=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var ke=(e,t,s)=>To(e,typeof t!="symbol"?t+"":t,s),Us=(e,t,s)=>t.has(e)||Br("Cannot "+s);var x=(e,t,s)=>(Us(e,t,"read from private field"),s?s.call(e):t.get(e)),O=(e,t,s)=>t.has(e)?Br("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),R=(e,t,s,r)=>(Us(e,t,"write to private field"),r?r.call(e,s):t.set(e,s),s),P=(e,t,s)=>(Us(e,t,"access private method"),s);var Wr=(e,t,s,r)=>({set _(l){R(e,t,l,s)},get _(){return x(e,t,r)}});var Nd=No((Fd,Co)=>{var Lo=Object.create,wt=Object.defineProperty,Ol=Object.getOwnPropertyDescriptor,mr=Object.getOwnPropertyNames,Fo=Object.prototype.hasOwnProperty,ql=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),yt=e=>{throw TypeError(e)},Bl=(e,t,s)=>t in e?wt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Ur=(e,t)=>wt(e,"name",{value:t,configurable:!0}),N=(e,t)=>function(){return e&&(t=(0,e[mr(e)[0]])(e=0)),t},jo=(e,t)=>function(){return t||(0,e[mr(e)[0]])((t={exports:{}}).exports,t),t.exports},ie=(e,t)=>{for(var s in t)wt(e,s,{get:t[s],enumerable:!0})},Ro=(e,t,s,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of mr(t))!Fo.call(e,l)&&l!==s&&wt(e,l,{get:()=>t[l],enumerable:!(r=Ol(t,l))||r.enumerable});return e},ee=e=>Ro(wt({},"__esModule",{value:!0}),e),re=e=>{var t;return[,,,Lo((t=e==null?void 0:e[ql("metadata")])!=null?t:null)]},Wl=["class","method","getter","setter","accessor","field","value","get","set"],Ot=e=>e!==void 0&&typeof e!="function"?yt("Function expected"):e,Po=(e,t,s,r,l)=>({kind:Wl[e],name:t,metadata:r,addInitializer:i=>s._?yt("Already initialized"):l.push(Ot(i||null))}),Ls=(e,t)=>Bl(t,ql("metadata"),e[3]),ne=(e,t,s,r)=>{for(var l=0,i=e[t>>1],n=i&&i.length;l<n;l++)t&1?i[l].call(s):r=i[l].call(s,r);return r},le=(e,t,s,r,l,i)=>{var n,a,o,d,u,h=t&7,p=!!(t&8),c=!!(t&16),m=h>3?e.length+1:h?p?1:2:0,S=Wl[h+5],A=h>3&&(e[m-1]=[]),y=e[m]||(e[m]=[]),$=h&&(!c&&!p&&(l=l.prototype),h<5&&(h>3||!c)&&Ol(h<4?l:{get[s](){return ge(this,i)},set[s](g){return Ce(this,i,g)}},s));h?c&&h<4&&Ur(i,(h>2?"set ":h>1?"get ":"")+s):Ur(l,s);for(var f=r.length-1;f>=0;f--)d=Po(h,s,o={},e[3],y),h&&(d.static=p,d.private=c,u=d.access={has:c?g=>Oo(l,g):g=>s in g},h^3&&(u.get=c?g=>(h^1?ge:ft)(g,l,h^4?i:$.get):g=>g[s]),h>2&&(u.set=c?(g,w)=>Ce(g,l,w,h^4?i:$.set):(g,w)=>g[s]=w)),a=(0,r[f])(h?h<4?c?i:$[S]:h>4?void 0:{get:$.get,set:$.set}:l,d),o._=1,h^4||a===void 0?Ot(a)&&(h>4?A.unshift(a):h?c?i=a:$[S]=a:l=a):typeof a!="object"||a===null?yt("Object expected"):(Ot(n=a.get)&&($.get=n),Ot(n=a.set)&&($.set=n),Ot(n=a.init)&&A.unshift(n));return h||Ls(e,l),$&&wt(l,s,$),c?h^4?i:$:l},Eo=(e,t,s)=>Bl(e,typeof t!="symbol"?t+"":t,s),xr=(e,t,s)=>t.has(e)||yt("Cannot "+s),Oo=(e,t)=>Object(t)!==t?yt('Cannot use the "in" operator on this value'):e.has(t),ge=(e,t,s)=>(xr(e,t,"read from private field"),s?s.call(e):t.get(e)),je=(e,t,s)=>t.has(e)?yt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),Ce=(e,t,s,r)=>(xr(e,t,"write to private field"),r?r.call(e,s):t.set(e,s),s),ft=(e,t,s)=>(xr(e,t,"access private method"),s),qo=(e,t,s,r)=>({set _(l){Ce(e,t,l,s)},get _(){return ge(e,t,r)}}),Ul,vr,Ml=N({"base.ts"(){"use strict";Ul=(()=>{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})(),vr=(()=>{const e=["bold-header","format-leakage","fostered-content","h1","illegal-attr","insecure-style","invalid-gallery","invalid-imagemap","invalid-invoke","invalid-isbn","lonely-apos","lonely-bracket","lonely-http","nested-link","no-arg","no-duplicate","no-ignored","obsolete-attr","obsolete-tag","parsing-order","pipe-like","table-layout","tag-like","unbalanced-header","unclosed-comment","unclosed-quote","unclosed-table","unescaped","unknown-page","unmatched-tag","unterminated-url","url-encoding","var-anchor","void-ext"];return Object.freeze(e),e})()}});function Xe(e){const t=new Map,s=new WeakMap;return r=>{const l=typeof r=="string"?t:s;if(l.has(r)){const n=l.get(r);return n.lastIndex=0,n}const i=e(r);return l.set(r,i),i}}var es,zl,Mr,Hl,Dl,St=N({"../common/dist/index.mjs"(){"use strict";es=e=>decodeURIComponent(e.replace(/%(?![\da-f]{2})/giu,"%25")),zl=e=>Math.round(e*255).toString(16).padStart(2,"0"),Mr=(()=>{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)?`,r=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}|${r}|${l})`,"giu"),rgb:new RegExp(String.raw`(^|[^\p{L}\p{N}_])(${e}|${r})`,"giu")}})(),Hl=(e,t=!0)=>{const s=[],r=Mr[t?"full":"rgb"];r.lastIndex=0;let l=r.exec(e),i=0;for(;l;){const n=l.index+l[1].length;n>i&&s.push([e.slice(i,n),i,n,!1]),{lastIndex:i}=r,s.push([l[2],n,i,e[n-1]!=="&"||!/^#\d+$/u.test(l[2])]),l=r.exec(e)}return e.length>i&&s.push([e.slice(i),i,e.length,!1]),s},Dl=Xe}}),Be,Ms,mt,xt,vt,Re,rt,ts,Ie,Ye,zr,Hr,ss,Gl,Dr,Gr,is,bt,he=N({"util/string.ts"(){"use strict";St(),Be=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,Ms=String.raw`[^[\]<>"\0-\x1F\x7F${Be}\uFFFD]`,mt=String.raw`(?:\[[\da-f:.]+\]|${Ms})`,xt=String.raw`(?:${Ms}|\0\d+[cn!~]\x7F)*`,vt=e=>e.trim().toLowerCase(),Re=(e,t)=>e.replace(/\0(\d+)\x7F/gu,(s,r)=>t[r]),rt=(e,t)=>s=>s.replace(e,t),ts=rt(/[\0\x7F]|\r$/gmu,""),Ie=rt(/\0\d+[cn]\x7F/gu,""),Ye=(e,t="")=>e.map(s=>typeof s=="string"?s:s.text()).join(t),zr={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},Hr=rt(/&(?:#(\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)):zr[s.toLowerCase()]),ss=e=>Hr(e),Gl=rt(/&#(\d+|x[\da-f]+);/giu,(e,t)=>String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t))),Dr={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},Gr=e=>rt(e,t=>`&${Dr[t]};`),is=Gr(/[&<>]/gu),bt=(e,t={})=>{const{pre:s="",post:r="",sep:l=""}=t;return s+e.map(i=>i.print()).join(l)+r}}}),Bo=jo({"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","#chart":"chart"},{"!":"!","=":"=","#FORMAL":"formal","#bcp47":"bcp47","#dir":"dir","#interwikilink":"interwikilink","#interlanguagelink":"interlanguagelink","#timef":"timef","#timefl":"timefl"},["msg","raw"],["subst","safesubst"]],doubleUnderscore:[[],[]],protocol:"bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|matrix:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|wikipedia://|worldwind://|xmpp:",interwiki:[],img:{},redirection:["#redirect"],variants:[]}}}),Se,Yi,Ze=N({"util/constants.ts"(){"use strict";Se=11,Yi=Bo()}}),de,ce=N({"lib/rect.ts"(){"use strict";var e,t,s,r,Zi,i;de=(i=class{constructor(n,a){O(this,r);O(this,e);O(this,t);O(this,s);R(this,e,n),R(this,t,a)}get start(){return x(this,t)}get top(){return P(this,r,Zi).call(this).top}get left(){return P(this,r,Zi).call(this).left}},e=new WeakMap,t=new WeakMap,s=new WeakMap,r=new WeakSet,Zi=function(){var n;return(n=x(this,s))!=null||R(this,s,x(this,e).getRootNode().posFromIndex(x(this,t))),x(this,s)},i)}}),Vr,Qr,Kt,rs,zs,X,te,Ke,br,K=N({"util/lint.ts"(){"use strict";we(),ce(),J(),Vr=new Set(["tr","td","th","caption"]),Qr=new Set(["Template:!!","Template:!-"]),Kt=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")&&Qr.has(t.name)||t.is("html")&&Vr.has(t.name))return!1;if(t.is("arg"))return t.length>1&&Kt(t.childNodes[1]);if(t.is("magic-word"))try{const s=t.getPossibleValues().map(Kt);return s.includes(2)?2:s.includes(1)&&1}catch{}return t.is("template")||t.is("magic-word")&&t.name==="invoke"?1:2},rs=(e,t,s,r)=>({line:e+s-1,character:(s===1?t:0)+r}),zs=e=>(t,s,r,l,i="error")=>{const{start:n}=s,{top:a,left:o}=s instanceof de?s:new de(t,n),{offsetHeight:d,offsetWidth:u}=t,{startIndex:h,startLine:p,startCol:c}=e(t,n,a,o),{line:m,character:S}=rs(p,c,d,u);return{rule:r,message:I.msg(l),severity:i,startIndex:h,endIndex:h+t.toString().length,startLine:p,endLine:m,startCol:c,endCol:S}},X=zs((e,t,s,r)=>{const l=e.getRelativeIndex(),{top:i,left:n}=e.parentNode.posFromIndex(l);return{startIndex:t+l,startLine:s+i,startCol:i?n:r+n}}),te=zs((e,t,s,r)=>({startIndex:t,startLine:s,startCol:r})),Ke=(e,t,s,r)=>{if(e&&(r||I.viewOnly&&e[0]===ve.rev))return e[1];const l=t();return(r||I.viewOnly)&&s([ve.rev,l]),l},br=(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"]:[]}}),Jr,ys,Wo=N({"parser/selector.ts"(){"use strict";Jr=(e,t,s)=>{if(e.includes("#")){const[r,...l]=e.split("#");return(!r||r===t)&&l.every(i=>i===s)}return!e||e===t},ys=(e,t,s)=>({type:r,name:l})=>e.split(",").some(i=>Jr(i.trim(),r,l))}}),Fs,wr=N({"mixin/cached.ts"(){"use strict";K(),Fs=(e=!0)=>t=>{const s=new WeakMap;return function(...r){return Ke(s.get(this),()=>t.apply(this,r),l=>{s.set(this,l)},e)}}}}),Xr,os,Ct,It,ds,Tt,Nt,Lt,us,hs,Yt,Vl=N({"lib/node.ts"(){"use strict";K(),we(),wr(),J(),Xr=[Fs(!1)],Yt=class{constructor(){ne(hs,5,this),je(this,Lt),Eo(this,"childNodes",[]),je(this,os),je(this,Ct),je(this,It),je(this,ds),je(this,Tt),je(this,Nt,{})}get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get parentNode(){return ge(this,os)}get nextSibling(){return ge(this,Ct)}get previousSibling(){return ge(this,It)}get offsetHeight(){return ft(this,Lt,us).call(this).height}get offsetWidth(){return ft(this,Lt,us).call(this).width}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":Ce(this,os,t),t||(Ce(this,Ct,void 0),Ce(this,It,void 0));break;case"nextSibling":Ce(this,Ct,t);break;case"previousSibling":Ce(this,It,t);break;case"aIndex":I.viewOnly&&Ce(this,Tt,[ve.rev,t]);break;default:this[e]=t}}getRootNode(){return Ke(ge(this,ds),()=>{var e,t;return(t=(e=this.parentNode)==null?void 0:e.getRootNode())!=null?t:this},e=>{const[,t]=e;t.type==="root"&&Ce(this,ds,e)})}indexFromPos(e,t){{if(e<0||t<0)return;const s=this.getLines();if(e>=s.length)return;const[,r,l]=s[e],i=r+t;return i>l?void 0:i}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(),r=s.findIndex(([,,l])=>e<=l);return{top:r,left:e-s[r][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 Ke(ge(this,Nt)[e],()=>{const{childNodes:t}=this,s=e+(e<0?t.length:0);let r=this.getAttribute("padding");for(let l=0;l<s;l++)I.viewOnly&&(ge(this,Nt)[l]=[ve.rev,r]),r+=t[l].toString().length+this.getGaps(l);return r},t=>{ge(this,Nt)[e]=t})}getAbsoluteIndex(){return Ke(ge(this,Tt),()=>{const{parentNode:e}=this;return e?e.getAbsoluteIndex()+this.getRelativeIndex():0},e=>{Ce(this,Tt,e)})}getBoundingClientRect(){return{...ft(this,Lt,us).call(this),...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 r=t+s.length;e.push([s,t,r]),t=r+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!`)}},hs=re(null),os=new WeakMap,Ct=new WeakMap,It=new WeakMap,ds=new WeakMap,Tt=new WeakMap,Nt=new WeakMap,Lt=new WeakSet,us=function(){const e=this.getLines(),t=e[e.length-1];return{height:e.length,width:t[2]-t[1]}},le(hs,1,"getLines",Xr,Yt),Ls(hs,Yt)}}),Ql,Uo=N({"lib/element.ts"(){"use strict";var e,er,tr,r;he(),we(),Wo(),Vl(),Ql=(r=class extends Yt{constructor(){super(...arguments);O(this,e)}get length(){return this.childNodes.length}text(i){return Ye(this.childNodes,i)}normalize(){const i=this.getChildNodes(),n=a=>{var o,d;i.splice(a,1),(o=i[a-1])==null||o.setAttribute("nextSibling",i[a]),(d=i[a])==null||d.setAttribute("previousSibling",i[a-1])};for(let a=i.length-1;a>=0;a--){const{type:o,data:d}=i[a];o!=="text"||i.length===1||this.getGaps(a-(a&&1))||d===""&&n(a)}this.setAttribute("childNodes",i)}removeAt(i){return Ns(this,i,1)[0]}insertAt(i,n=this.length){return Ns(this,n,0,[i]),i}closest(i){const n=ys(i,this);let{parentNode:a}=this;for(;a;){if(n(a))return a;({parentNode:a}=a)}}querySelector(i){const n=ys(i,this);return P(this,e,er).call(this,n)}querySelectorAll(i){const n=ys(i,this);return P(this,e,tr).call(this,n)}append(...i){this.safeAppend(i)}safeAppend(i){for(const n of i)this.insertAt(n)}replaceChildren(...i){this.safeReplaceChildren(i)}safeReplaceChildren(i){for(let n=this.length-1;n>=0;n--)this.removeAt(n);this.safeAppend(i)}setText(i,n=0){n+=n<0?this.length:0;const a=this.childNodes[n],{data:o}=a;return a.replaceData(i),o}toString(i,n=""){return this.childNodes.map(a=>a.toString(i)).join(n)}caretPositionFromIndex(i){{if(i===void 0)return;const{length:n}=this.toString();if(i>n||i<-n)return;i+=i<0?n:0;let a=this,o=0,d=0;for(;a.type!=="text";){const{childNodes:u}=a;o+=a.getAttribute("padding");for(let h=0;o<=i&&h<u.length;h++){const p=u[h],{nextSibling:c}=p,m=p.toString(),S=m.length;if(p.setAttribute("aIndex",o),o+=S,o>i||o===i&&S>0&&(!c||c.type==="text"||p.type!=="text"&&(m.trim()||!c.toString().trim()))){a=p,o-=S,d=o;break}o+=a.getGaps(h)}if(a.childNodes===u)return{offsetNode:a,offset:i-d}}return{offsetNode:a,offset:i-d}}this.lspError("AstElement.caretPositionFromIndex")}elementFromIndex(i){var n;{const a=(n=this.caretPositionFromIndex(i))==null?void 0:n.offsetNode;return(a==null?void 0:a.type)==="text"?a.parentNode:a}this.lspError("AstElement.elementFromIndex")}elementFromPoint(i,n){return this.elementFromIndex(this.indexFromPos(n,i))}lint(i=this.getAbsoluteIndex(),n){const a=[];for(let o=0,d=i+this.getAttribute("padding");o<this.length;o++){const u=this.childNodes[o];u.setAttribute("aIndex",d);const h=u.lint(d,n);h.length>0&&a.push(...h),d+=u.toString().length+this.getGaps(o)}return a}print(i={}){const n=i.class;return this.toString()?(n===""?"":`<span class="wpb-${n!=null?n:this.type}${this.getAttribute("invalid")?" wpb-invalid":""}">`)+bt(this.childNodes,i)+(n===""?"":"</span>"):""}json(i,n=this.getAbsoluteIndex()){const a={...this,type:this.type,range:[n,n+this.toString().length],childNodes:[]};for(let o=0,d=n+this.getAttribute("padding");o<this.length;o++){const u=this.childNodes[o],{length:h}=u.toString();u.setAttribute("aIndex",d),a.childNodes.push(u.type==="text"?{data:u.data,range:[d,d+h]}:u.json(void 0,d)),d+=h+this.getGaps(o)}return a}},e=new WeakSet,er=function(i){var n;for(const a of this.childNodes){if(a.type==="text")continue;if(i(a))return a;const o=P(n=a,e,er).call(n,i);if(o)return o}},tr=function(i){var a;let n=[];for(const o of this.childNodes)o.type!=="text"&&(i(o)&&n.push(o),n=[...n,...P(a=o,e,tr).call(a,i)]);return n},r)}}),cs,Hs,Kr,Yr,Zr,en,Ds,Gs,sr,Mo=N({"lib/text.ts"(){"use strict";var e,Jl,s;he(),K(),J(),Vl(),cs=String.raw`[${Be}\t]*`,Hs=String.raw`<\s*(?:/\s*)?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|(?:rfc|pmid)(?=[-::]?${cs}\d)|isbn(?=[-::]?${cs}(?:\d(?:${cs}|-)){6})`,Kr=new RegExp(String.raw`${Hs}|https?[:/]/+`,"giu"),Yr=new RegExp(Hs,"giu"),Zr=new Set(["attr-value","ext-link-text","link-text"]),en={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},Ds=new Set(["html","head","style","title","body","a","audio","img","video","embed","iframe","object","canvas","script","col","colgroup","tbody","tfoot","thead","button","input","label","option","select","textarea"]);try{Gs=new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch{Gs=/\w/u}sr=(s=class extends Yt{constructor(l){super();O(this,e);ke(this,"data","");this.data=l}get type(){return"text"}toString(l){var i;return l&&!((i=this.parentNode)!=null&&i.getAttribute("built"))?Ie(this.data):this.data}text(){return this.data}lint(l=this.getAbsoluteIndex(),i){var _,C,E;if(i===!1)return[];const{data:n,parentNode:a,nextSibling:o,previousSibling:d}=this;if(!a)throw new Error("An isolated text node cannot be linted!");const{type:u,name:h,parentNode:p}=a;if(u==="attr-value"){const{name:T,tag:L}=p;if(L==="ref"&&(T==="name"||T==="extends"||T==="follow")||T==="group"&&(L==="ref"||L==="references")||L==="choose"&&(T==="before"||T==="after"))return[]}if(i!=null||(i=u==="free-ext-link"||u==="ext-link-url"||u==="ext-link-text"||u==="image-parameter"&&h==="link"||u==="attr-value"?Yr:Kr),n.search(i)===-1)return[];i.lastIndex=0;const c=[],m=o==null?void 0:o.type,S=o==null?void 0:o.name,A=d==null?void 0:d.type,y=this.getRootNode(),$=y.toString(),{ext:f,html:g,variants:w}=y.getAttribute("config"),{top:b,left:v}=y.posFromIndex(l),k=new Set(["onlyinclude","noinclude","includeonly",...f,...g[0],...g[1],...g[2],...Ds]);for(let T=i.exec(n);T;T=i.exec(n)){const[,L,B]=T;let{index:j,0:F}=T;if(B&&B!=="]"){const{length:z}=B;j+=z,F=F.slice(z)}F=F.toLowerCase();const[U]=F,W=U==="r"||U==="p"||U==="i",q=U==="{",M=U==="}",D=U==="[",G=U==="]";let{length:Z}=F;if(U==="<"&&!k.has(L.toLowerCase())||D&&u==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(n.slice(j+1))||o!=null&&o.is("ext")&&S==="nowiki"&&((_=o.innerText)!=null&&_.includes("]")))||W&&(!a.isPlain()||Zr.has(u)))continue;G&&(j||Z>1)&&i.lastIndex--;let Y=l+j,se=Y+Z,ue,Ae;const Le=$[se],it=$[Y-1],V=q||D,oe=q&&it==="-"&&w.length>0,me=M&&Le==="-"&&w.length>0,xe=D&&m==="free-ext-link"&&!n.slice(j+1).trim()||G&&A==="free-ext-link"&&!n.slice(0,j).includes("]");if(W)ue="lonely-http",F=F.toUpperCase(),Ae=I.lintConfig.getSeverity(ue,F);else if(U==="<"){ue="tag-like";let z;/^<\s/u.test(F)||!/[\s/>]/u.test(Le!=null?Le:"")?z="invalid":Ds.has(L)&&(z="disallowed"),Ae=I.lintConfig.getSeverity(ue,z)}else if(oe||me)ue="lonely-bracket",Ae=I.lintConfig.getSeverity(ue,"converter"),oe&&j>0?(F="-{",j--,Y--,Z=2):me&&j<n.length-1&&(F="}-",se++,Z=2);else if(xe)ue="lonely-bracket",Ae=I.lintConfig.getSeverity(ue,"extLink");else if(V||M||G)if(ue="lonely-bracket",Z>1||q&&Le===U||M&&it===U)Ae=I.lintConfig.getSeverity(ue,"double");else{if(!D||u!=="ext-link-text"){const z=en[U],Ee=V?n.slice(j+1):n.slice(0,j);if(q&&((C=z.exec(Ee))==null?void 0:C[0])==="}"||M&&((E=z.exec(Ee))==null?void 0:E[0])==="{")continue;if(!Ee.includes(U)){const _t=V?"nextSibling":"previousSibling";let De=this[_t];for(;De&&(De.type!=="text"||!z.test(De.data));)De=De[_t];if(De&&z.exec(De.data)[0]!==U)continue}}Ae=I.lintConfig.getSeverity(ue,"single")}else ue="lonely-http",Ae=I.lintConfig.getSeverity(ue);if(!Ae)continue;const $e=this.posFromIndex(j),{line:He,character:ye}=rs(b,v,$e.top+1,$e.left),Fe={rule:ue,message:I.msg('lonely "$1"',W||U==="h"||oe||me?F:U),severity:Ae,startIndex:Y,endIndex:se,startLine:He,endLine:He,startCol:ye,endCol:ye+Z};if(U==="<")Fe.suggestions=[{desc:"escape",range:[Y,Y+1],text:"&lt;"}];else if(U==="h"&&u!=="link-text"&&Gs.test(it||""))Fe.suggestions=[{desc:"whitespace",range:[Y,Y],text:" "}];else if(D&&u==="ext-link-text"){const z=a.getAbsoluteIndex()+a.toString().length;Fe.suggestions=[{desc:"escape",range:[z,z+1],text:"&#93;"}]}else if(G&&xe){const z=l-d.toString().length;Fe.suggestions=[{desc:"left bracket",range:[z,z],text:"["}]}else W&&(Fe.suggestions=[...T[0]===F?[]:[{desc:"uppercase",range:[Y,se],text:F}],...Le===":"||Le===":"?[{desc:"whitespace",range:[se,se+1],text:" "}]:[]]);c.push(Fe)}return c}replaceData(l){P(this,e,Jl).call(this,l)}print(){return is(this.data)}},e=new WeakSet,Jl=function(l){this.setAttribute("data",l)},s)}}),et,At=N({"mixin/hidden.ts"(){"use strict";we(),et=(e=!0,t=!0)=>s=>{class r extends s{text(){return""}lint(i){return e?[]:super.lint(i)}}return kt(r,s),r}}}),tt,$t=N({"src/syntax.ts"(){"use strict";var e,t;Q(),tt=(t=class extends H{constructor(r,l,i,n,a){super(r,i,n,a);O(this,e);R(this,e,l)}get type(){return x(this,e)}lint(r=this.getAbsoluteIndex()){return super.lint(r,!1)}},e=new WeakMap,t)}}),Pe,We=N({"mixin/padded.ts"(){"use strict";we(),Pe=({length:e})=>t=>{class s extends t{getAttribute(l){return l==="padding"?e:super.getAttribute(l)}}return kt(s,t),s}}}),be,Ue=N({"src/atom.ts"(){"use strict";var e,t;Q(),be=(t=class extends H{constructor(r,l,i,n,a){super(r,i,n,a);O(this,e);R(this,e,l)}get type(){return x(this,e)}set type(r){R(this,e,r)}getAttribute(r){var l;return r==="invalid"?this.type==="converter-flag"&&!!((l=this.parentNode)!=null&&l.isInvalidFlag(this)):super.getAttribute(r)}},e=new WeakMap,t)}}),tn,sn,Vs,rn,qe,js=N({"src/link/base.ts"(){"use strict";var e,t,s,r;K(),Ze(),he(),ce(),We(),J(),Q(),Ue(),tn=l=>l==="redirect-target"||l==="link",sn=[Pe("[[")],qe=(r=class extends(rn=H){constructor(i,n,a,o=[],d="|"){super(void 0,a,o,{});O(this,e,!0);O(this,t);O(this,s);if(this.insertAt(new be(i,"link-target",a,o,{})),n!==void 0){const u=new H(n,a,o,{});u.type="link-text",u.setAttribute("stage",Se-1),this.insertAt(u)}R(this,t,d)}get link(){return x(this,s)}get fragment(){return x(this,s).fragment}afterBuild(){R(this,s,this.getTitle()),x(this,t).includes("\0")&&R(this,t,this.buildFromStr(x(this,t),0)),this.setAttribute("name",x(this,s).title),super.afterBuild()}setAttribute(i,n){i==="bracket"?R(this,e,n):i==="title"?R(this,s,n):super.setAttribute(i,n)}toString(i){const n=super.toString(i,x(this,t));return x(this,e)?`[[${n}]]`:n}text(){const i=super.text("|");return x(this,e)?`[[${i}]]`:i}getAttribute(i){return i==="title"?x(this,s):super.getAttribute(i)}getGaps(i){return i===0?x(this,t).length:1}lint(i=this.getAbsoluteIndex(),n){const a=super.lint(i,n),{childNodes:[o,d],type:u}=this,{encoded:h,fragment:p}=x(this,s),c=new de(this,i);let m="unknown-page",S=I.lintConfig.getSeverity(m);if(S&&o.childNodes.some(({type:A})=>A==="template")&&a.push(X(o,c,m,"template in an internal link target",S)),m="url-encoding",S=I.lintConfig.getSeverity(m),S&&h){const A=X(o,c,m,"unnecessary URL encoding in an internal link",S);A.fix={desc:"decode",range:[A.startIndex,A.endIndex],text:es(o.text())},a.push(A)}if(m="pipe-like",S=I.lintConfig.getSeverity(m,"link"),S&&(u==="link"||u==="category")){const A=d==null?void 0:d.childNodes.findIndex($=>$.type==="text"&&$.data.includes("|")),y=d==null?void 0:d.childNodes[A];if(y){const $=X(d,c,m,'additional "|" in the link text',S),f=$.startIndex+d.getRelativeIndex(A);$.suggestions=[{desc:"escape",range:[f,f+y.data.length],text:y.data.replace(/\|/gu,"&#124;")}],a.push($)}}if(m="no-ignored",S=I.lintConfig.getSeverity(m,"fragment"),S&&p!==void 0&&!tn(u)){const A=X(o,c,m,"useless fragment",S),y=o.childNodes.findIndex(f=>f.type==="text"&&f.data.includes("#")),$=o.childNodes[y];$&&(A.fix={desc:"remove",range:[A.startIndex+o.getRelativeIndex(y)+$.data.indexOf("#"),A.endIndex],text:""}),a.push(A)}return a}getTitle(i,n){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:n,temporary:i,decode:!0,selfLink:!0})}print(){return super.print(x(this,e)?{pre:"[[",post:"]]",sep:x(this,t)}:{sep:x(this,t)})}json(i,n=this.getAbsoluteIndex()){const a=super.json(void 0,n),{type:o,fragment:d}=this;return d!==void 0&&(o==="link"||o==="redirect-target")&&(a.fragment=d),a}},e=new WeakMap,t=new WeakMap,s=new WeakMap,r),Vs=re(rn),qe=le(Vs,0,"LinkBaseToken",sn,qe),ne(Vs,1,qe)}}),Me,st=N({"src/nowiki/base.ts"(){"use strict";Q(),Me=class extends H{get innerText(){return this.firstChild.data}constructor(e="",t,s){super(e,t,s)}}}}),nn,Qs,ln,pe,ze=N({"src/nowiki/noinclude.ts"(){"use strict";At(),st(),nn=[et()],pe=class extends(ln=Me){get type(){return"noinclude"}toString(e){return e?"":super.toString()}},Qs=re(ln),pe=le(Qs,0,"NoincludeToken",nn,pe),ne(Qs,1,pe)}}),Xl,zo=N({"src/link/redirectTarget.ts"(){"use strict";K(),J(),js(),ze(),Xl=class extends qe{get type(){return"redirect-target"}constructor(e,t,s,r){super(e,void 0,s,r),t!==void 0&&this.insertAt(new pe(t,s,r))}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",r=I.lintConfig.getSeverity(s,"redirect");if(r&&this.length===2){const l=X(this.lastChild,{start:e},s,"useless link text",r);l.startIndex--,l.startCol--,l.fix={desc:"remove",range:[l.startIndex,l.endIndex],text:""},t.push(l)}return t}}}}),an,Js,on,qt,Ho=N({"src/redirect.ts"(){"use strict";var e,t,s;At(),Q(),$t(),zo(),an=[et(!1,!1)],qt=(s=class extends(on=H){constructor(l,i,n,a,o,d,u=[]){super(void 0,d,u);O(this,e);O(this,t);R(this,e,l),R(this,t,o),this.append(new tt(i,"redirect-syntax",d,u),new Xl(n,a==null?void 0:a.slice(1),d,u))}get type(){return"redirect"}getAttribute(l){return l==="padding"?x(this,e).length:super.getAttribute(l)}toString(l){return x(this,e)+super.toString(l)+x(this,t)}lint(l=this.getAbsoluteIndex()){const i=l+x(this,e).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",i),this.lastChild.lint(i)}print(){return super.print({pre:x(this,e),post:x(this,t)})}},e=new WeakMap,t=new WeakMap,s),Js=re(on),qt=le(Js,0,"RedirectToken",an,qt),ne(Js,1,qt)}}),Kl={};ie(Kl,{parseRedirect:()=>Yl});var Yl,Do=N({"parser/redirect.ts"(){"use strict";J(),Ho(),Yl=(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 r=t.regexRedirect.exec(e);return r&&I.normalizeTitle(r[3],0,!1,t,{halfParsed:!0,temporary:!0,decode:!0}).valid?(e=`\0${s.length}o${e.slice(r[0].length)}`,new qt(...r.slice(1),t,s),e):!1}}}),dn,Xs,un,Bt,Go=N({"src/onlyinclude.ts"(){"use strict";We(),Q(),dn=[Pe("<onlyinclude>")],Bt=class extends(un=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">&lt;onlyinclude&gt;</span>',post:'<span class="wpb-ext">&lt;/onlyinclude&gt;</span>'})}},Xs=re(un),Bt=le(Xs,0,"OnlyincludeToken",dn,Bt),ne(Xs,1,Bt)}}),ls,Rs=N({"mixin/gapped.ts"(){"use strict";we(),ls=(e=1)=>t=>{class s extends t{getGaps(){return e}}return kt(s,t),s}}}),hn,Ks,cn,Je,yr=N({"src/tagPair/index.ts"(){"use strict";var e,t;Rs(),Q(),hn=[ls()],Je=(t=class extends(cn=H){constructor(r,l,i,n,a,o=[]){super(void 0,a);O(this,e);ke(this,"closed");ke(this,"selfClosing");this.setAttribute("name",r.toLowerCase()),R(this,e,[r,n||r]),this.closed=n!=="",this.selfClosing=n===void 0,this.append(l,i);const d=typeof l=="string"?-1:o.indexOf(l);o.splice(d===-1?1/0:d,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(r){const{selfClosing:l,firstChild:i,lastChild:n}=this,[a,o]=x(this,e);return l?`<${a}${i.toString(r)}/>`:`<${a}${i.toString(r)}>${n.toString(r)}${this.closed?`</${o}>`:""}`}text(){const[r,l]=x(this,e);return this.selfClosing?`<${r}${this.firstChild.text()}/>`:`<${r}${super.text(">")}${this.closed?`</${l}>`:""}`}getAttribute(r){return r==="padding"?x(this,e)[0].length+1:super.getAttribute(r)}print(){const[r,l]=x(this,e);return super.print(this.selfClosing?{pre:`&lt;${r}`,post:"/&gt;"}:{pre:`&lt;${r}`,sep:"&gt;",post:this.closed?`&lt;/${l}&gt;`:""})}},e=new WeakMap,t),Ks=re(cn),Je=le(Ks,0,"TagPairToken",hn,Je),ne(Ks,1,Je)}}),Zl,Vo=N({"src/tagPair/translate.ts"(){"use strict";var e,ea,s;Q(),yr(),$t(),ze(),Zl=(s=class extends Je{constructor(l,i,n,a=[]){const o=new tt(l,"translate-attr",n,a);i=i==null?void 0:i.replace(/(<tvar\|[^>]+>)([\s\S]*?)(<\/>)/gu,(u,h,p,c)=>(new pe(h,n,a),new pe(c,n,a),`\0${a.length-1}n${p}\0${a.length}n`)).replace(/(<tvar\s+name\s*=(?:\s*(?:(["'])[\s\S]*?\2|[^"'\s>]+))?\s*>)([\s\S]*?)(<\/tvar\s*>)/giu,(u,h,p,c,m)=>(new pe(h,n,a),new pe(m,n,a),`\0${a.length-1}n${c}\0${a.length}n`));const d=new H(i,n,a);d.type="translate-inner";super("translate",o,d,"translate",n,a);O(this,e);this.seal("closed",!0),this.seal("selfClosing",!0)}get type(){return"translate"}toString(l){return l?this.lastChild.toString(!0):super.toString()}text(){return this.lastChild.text()}print(){return`<span class="wpb-ext">&lt;translate${P(this,e,ea).call(this)?'<span class="wpb-ext-attrs"> <span class="wpb-ext-attr"><span class="wpb-attr-key">nowrap</span></span></span>':""}&gt;${this.lastChild.print({class:"ext-inner"})}&lt;/translate&gt;</span>`}},e=new WeakSet,ea=function(){return this.firstChild.toString()===" nowrap"},s)}}),gn,Ys,pn,Wt,Qo=N({"src/tagPair/include.ts"(){"use strict";K(),ce(),At(),J(),yr(),gn=[et(!1)],Wt=class extends(pn=Je){get type(){return"include"}constructor(e,t="",s,r,l,i){super(e,t,s!=null?s:"",s===void 0||r!=null?r:"",l,i)}toString(e){return e?"":super.toString()}lint(e=this.getAbsoluteIndex()){const t=[],{firstChild:s,closed:r,name:l}=this,i=new de(this,e),n=["no-ignored","unclosed-comment"],a=n.map(o=>I.lintConfig.getSeverity(o,"include"));if(a[0]&&s.data.trim()){const o=X(s,i,n[0],"useless attribute",a[0]);o.suggestions=[{desc:"remove",range:[o.startIndex,o.endIndex],text:""}],t.push(o)}if(a[1]&&!r){const o=te(this,i,n[1],I.msg("unclosed $1",`<${l}>`),a[1]);o.suggestions=[{desc:"close",range:[o.endIndex,o.endIndex],text:`</${l}>`}],t.push(o)}return t}},Ys=re(pn),Wt=le(Ys,0,"IncludeToken",gn,Wt),ne(Ys,1,Wt)}}),Ps,Sr=N({"mixin/attributesParent.ts"(){"use strict";we(),Ps=(e=0)=>t=>{var r,ir;class s extends t{constructor(){super(...arguments);O(this,r)}hasAttr(a){return P(this,r,ir).call(this).hasAttr(a)}getAttr(a){return P(this,r,ir).call(this).getAttr(a)}}return r=new WeakSet,ir=function(){return this.childNodes[e]},kt(s,t),s}}}),ae,Zs,ei,Ft,gs,ti,Ge,si,ii,ri,ps,ni,Te,Ar,$r,kr,ta,sa=N({"util/sharable.ts"(){"use strict";ae=new Set(["align"]),Zs=new Set(["cite"]),ei=new Set(["cite","datetime"]),Ft=new Set(["width"]),gs=new Set(["axis","align","bgcolor","height","width","valign"]),ti=new Set([...gs,"abbr","headers","scope","rowspan","colspan"]),Ge=new Set(["type"]),si=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),ii=new Set(["clear"]),ri=new Set(["bgcolor","align","valign"]),ps=new Set(["qid","forcemathmode","type","display"]),ni=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),Te=new Set,Ar=new Set(["id","class","style","lang","dir","title","tabindex","aria-describedby","aria-flowto","aria-hidden","aria-label","aria-labelledby","aria-level","aria-owns","role","about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),$r={div:ae,h1:ae,h2:ae,h3:ae,h4:ae,h5:ae,h6:ae,blockquote:Zs,q:Zs,p:ae,br:ii,pre:Ft,ins:ei,del:ei,ul:Ge,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...si,"border"]),caption:ae,tr:ri,td:ti,th:ti,font:new Set(["size","color","face"]),hr:Ft,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:Ge,poem:ae,categorytree:ae,combooption:ae,math:Te,chem:Te,ce:Te,img:new Set(["alt","src","width","height","loading"])},kr={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:Te,indicator:new Set(["name"]),langconvert:new Set(["from","to"]),ref:new Set(["group","name","extends","follow","dir"]),references:new Set(["group","responsive"]),charinsert:new Set(["label"]),choose:new Set(["uncached","before","after"]),option:new Set(["weight"]),imagemap:Te,inputbox:Te,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:Te,poll:new Set(["id","show-results-before-voting"]),sm2:Ge,flashmp3:Ge,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([...ps,"chem"]),chem:ps,ce:ps,hiero:Te,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:ni,syntaxhighlight:ni,templatedata:Te,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:Te},ta={table:si,td:new Set([...gs,"scope"]),th:gs,br:ii,caption:ae,div:ae,hr:Ft,h1:ae,h2:ae,h3:ae,h4:ae,h5:ae,h6:ae,li:Ge,p:ae,pre:Ft,tr:ri,ul:Ge}}}),fn,mn,xn,vn,Ss,Jo=N({"src/attribute.ts"(){"use strict";var e,t,s,r,l,rr,n;K(),he(),Ze(),sa(),ce(),J(),Q(),Ue(),fn=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,mn=/(?:^|\s|\*\/)(?:javascript|vbscript)(?:\W|$)/iu,xn=new Set(["ext","arg","magic-word","template"]),vn=new Set(["about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),Ss=(n=class extends H{constructor(o,d,u,h="",p,c=[],m=I.getConfig(),S=[]){const A=new be(u,"attr-key",m,S);let y;if(u==="title"||d==="img"&&u==="alt")y=new H(p,m,S,{}),y.type="attr-value",y.setAttribute("stage",Se-1);else if(d==="gallery"&&u==="caption"||d==="choose"&&(u==="before"||u==="after")||d==="img"&&u==="src"&&(p!=null&&p.includes("{{"))){const $={...m,excludes:[...m.excludes,"heading","html","table","hr","list"]};y=new H(p,$,S,{}),y.type="attr-value",y.setAttribute("stage",1)}else y=new be(p,"attr-value",m,S,{});super(void 0,m,S);O(this,l);O(this,e);O(this,t);O(this,s);O(this,r);R(this,e,o),this.append(A,y),R(this,s,h),R(this,r,[...c]),R(this,t,d),this.setAttribute("name",vt(Ie(u)))}get type(){return x(this,e)}get tag(){return x(this,t)}get balanced(){return!x(this,s)||x(this,r)[0]===x(this,r)[1]}afterBuild(){x(this,s).includes("\0")&&R(this,s,this.buildFromStr(x(this,s),0)),this.parentNode&&R(this,t,this.parentNode.name),this.setAttribute("name",vt(this.firstChild.text())),super.afterBuild()}toString(o){const[d="",u=""]=x(this,r);return x(this,s)?super.toString(o,x(this,s)+d)+u:this.firstChild.toString(o)}text(){return x(this,s)?`${super.text(`${x(this,s).trim()}"`)}"`:this.firstChild.text()}getGaps(){var o,d;return x(this,s)?x(this,s).length+((d=(o=x(this,r)[0])==null?void 0:o.length)!=null?d:0):0}lint(o=this.getAbsoluteIndex(),d){var g;const u=super.lint(o,d),{balanced:h,firstChild:p,lastChild:c,name:m,tag:S}=this,A=new de(this,o),y=["unclosed-quote","obsolete-attr"],$=y.map(w=>I.lintConfig.getSeverity(w,m));if($[0]&&!h){const w=X(c,A,y[0],I.msg("unclosed $1","quotes"),$[0]);w.startIndex--,w.startCol--,w.suggestions=[{desc:"close",range:[w.endIndex,w.endIndex],text:x(this,r)[0]}],u.push(w)}const f=P(this,l,rr).call(this,o,A);return f&&u.push(f),$[1]&&((g=ta[S])!=null&&g.has(m))&&u.push(X(p,A,y[1],"obsolete attribute",$[1])),u}getValue(){return x(this,s)?this.lastChild.text().trim():this.type==="ext-attr"||""}getAttribute(o){return o==="invalid"?P(this,l,rr).call(this):super.getAttribute(o)}print(){const[o="",d=""]=x(this,r);return x(this,s)?super.print({sep:is(x(this,s))+o,post:d}):super.print()}json(o,d=this.getAbsoluteIndex()){const u=super.json(void 0,d);return u.tag=this.tag,u}},e=new WeakMap,t=new WeakMap,s=new WeakMap,r=new WeakMap,l=new WeakSet,rr=function(o,d){const{firstChild:u,lastChild:h,type:p,name:c,tag:m,parentNode:S}=this,A=!h.childNodes.some(({type:b})=>xn.has(b)),y=this.getValue(),$=kr[m],f=$r[m],{length:g}=this.toString();let w="illegal-attr";if(!($!=null&&$.has(c))&&!(f!=null&&f.has(c))&&(p==="ext-attr"?$||f:!/\{\{[^{]+\}\}/u.test(c))&&(p==="ext-attr"&&!f||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(c)&&(m==="meta"||m==="link"||!Ar.has(c)))||(c==="itemtype"||c==="itemid"||c==="itemref")&&!(S!=null&&S.hasAttr("itemscope"))){if(o===void 0)return!0;const b=I.lintConfig.getSeverity(w,"unknown");if(b){const v=X(u,d,w,"illegal attribute name",b);return v.suggestions=[{desc:"remove",range:[o,o+g],text:""}],v}}else if(c==="style"&&typeof y=="string"&&fn.test(y)){if(o===void 0)return!0;w="insecure-style";const b=I.lintConfig.getSeverity(w);return b&&X(h,d,w,"insecure style",b)}else if(c==="tabindex"&&typeof y=="string"&&y!=="0"){if(o===void 0)return!0;const b=I.lintConfig.getSeverity(w,"tabindex");if(b){const v=X(h,d,w,"nonzero tabindex",b);return v.suggestions=[{desc:"remove",range:[o,o+g],text:""},{desc:"0 tabindex",range:[v.startIndex,v.endIndex],text:"0"}],v}}else if(A&&p!=="ext-attr"){const b=br(m,c),v=String(y).toLowerCase();if(b.length>0&&b.every(k=>k!==v)){if(o===void 0)return!0;const k=I.lintConfig.getSeverity(w,"value");return k&&X(h,d,w,"illegal attribute value",k)}}else if(typeof y=="string"&&((/^xmlns:[\w:.-]+$/u.test(c)||vn.has(c))&&mn.test(y)||A&&(c==="href"||m==="img"&&c==="src")&&!new RegExp(String.raw`^(?:${this.getAttribute("config").protocol}|//)\S+$`,"iu").test(y))){if(o===void 0)return!0;const b=I.lintConfig.getSeverity(w,"value");return b&&X(h,d,w,"illegal attribute value",b)}return!1},n)}}),li,bn,ai,Es,_r=N({"src/attributes.ts"(){"use strict";var e,t,As,r;K(),he(),ce(),J(),Q(),Ue(),Jo(),li=l=>l.slice(0,-1),bn=l=>`${li(l)}-dirty`;try{ai=new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch{ai=/[^\W_]/u}Es=(r=class extends H{constructor(i,n,a,o,d=[]){super(void 0,o,d,{});O(this,t);O(this,e);if(R(this,e,n),this.setAttribute("name",a),i){const u=/([^\s/](?:(?!\0\d+~\x7F)[^\s/=])*)(?:((?:\s(?:\s|\0\d+[cn]\x7F)*)?(?:=|\0\d+~\x7F)(?:\s|\0\d+[cn]\x7F)*)(?:(["'])([\s\S]*?)(\3|$)|(\S*)))?/gu;let h="",p=u.exec(i),c=0;const m=()=>{h&&(super.insertAt(new be(h,bn(n),o,d,{})),h="")};for(;p;){const{index:S,0:A,1:y,2:$,3:f,4:g,5:w,6:b}=p;if(h+=i.slice(c,S),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(Ie(y).trim())){const v=g!=null?g:b,k=[f,w],_=new Ss(li(n),a,y,$,v,k,o,d);m(),super.insertAt(_)}else h+=A;({lastIndex:c}=u),p=u.exec(i)}h+=i.slice(c),m()}}get type(){return x(this,e)}afterBuild(){const{parentNode:i}=this;i!=null&&i.is("td")&&this.setAttribute("name",i.subtype),super.afterBuild()}getAttrTokens(i){return this.childNodes.filter(n=>n instanceof Ss&&(!i||n.name===vt(i)))}hasAttr(i){return this.getAttrTokens(i).length>0}getAttrToken(i){const n=this.getAttrTokens(i);return n[n.length-1]}getAttr(i){var n;return(n=this.getAttrToken(i))==null?void 0:n.getValue()}lint(i=this.getAbsoluteIndex(),n){const a=super.lint(i,n),{parentNode:o,childNodes:d}=this,u=new Map,h=new Set,p=new de(this,i),c=["no-ignored","no-duplicate"],m=["closingTag","invalidAttributes","nonWordAttributes"].map(A=>I.lintConfig.getSeverity(c[0],A));if(m[0]&&P(this,t,As).call(this)){const A=te(this,p,c[0],"attributes of a closing tag",m[0]),y=o.getAbsoluteIndex();A.suggestions=[{desc:"remove",range:[i,A.endIndex],text:""},{desc:"open",range:[y+1,y+2],text:""}],a.push(A)}for(const A of d)if(A instanceof Ss){const{name:y}=A;u.has(y)?(h.add(y),u.get(y).push(A)):u.set(y,[A])}else{const y=A.text().trim(),$=m[ai.test(y)?1:2];if(y&&$){const f=X(A,p,c[0],"containing invalid attribute",$);f.suggestions=[{desc:"remove",range:[f.startIndex,f.endIndex],text:" "}],a.push(f)}}const S=I.lintConfig.getSeverity(c[1],"attribute");if(S&&h.size>0)for(const A of h){const y=u.get(A).map($=>{const f=$.getValue();return[$,f===!0?"":f]});a.push(...y.map(([$,f],g)=>{const w=X($,p,c[1],I.msg("duplicated $1 attribute",A),S),b={desc:"remove",range:[w.startIndex,w.endIndex],text:""};return!f||y.slice(0,g).some(([,v])=>v===f)?w.fix=b:w.suggestions=[b],w}))}return a}getAttribute(i){return i==="invalid"?P(this,t,As).call(this):super.getAttribute(i)}print(){return this.toString()?`<span class="wpb-${this.type}${P(this,t,As).call(this)?" wpb-invalid":""}">${this.childNodes.map(i=>i.print(i instanceof be?{class:i.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}},e=new WeakMap,t=new WeakSet,As=function(){const{parentNode:i}=this;return(i==null?void 0:i.type)==="html"&&i.closing&&this.text().trim()!==""},r)}}),ia={};ie(ia,{PreToken:()=>ra});var ra,Xo=N({"src/pre.ts"(){"use strict";Ze(),Q(),ze(),ra=class extends H{get type(){return"ext-inner"}constructor(e,t,s=[]){if(e){const r=/<nowiki>/giu,l=/<\/nowiki>/giu,{length:i}=r.source;let n=r.exec(e);n&&(l.lastIndex=n.index+i);let a=l.exec(e),o=0,d="";for(;n&&a;)new pe(n[0],t,s),new pe(a[0],t,s),d+=`${e.slice(o,n.index)}\0${s.length-1}n${e.slice(n.index+i,a.index)}\0${s.length}n`,o=a.index+i+1,r.lastIndex=o,n=r.exec(e),n&&(l.lastIndex=n.index+i),a=l.exec(e);e=d+e.slice(o)}super(e,t,s,{}),this.setAttribute("stage",Se-1)}isPlain(){return!0}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*\/\s*(pre)\b/giu)}}}}),Os,Cr=N({"mixin/multiLine.ts"(){"use strict";we(),Os=e=>{class t extends e{toString(r){return super.toString(r,`
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 bt(t,e),t}}}),to={};ie(to,{ParamTagToken:()=>rt});var xi,sr,mi,rt,so=C({"src/paramTag/index.ts"(){"use strict";X(),ue(),Fs(),Sn(),J(),V(),qe(),xi=[Cs],rt=class extends(mi=z){get type(){return"ext-inner"}constructor(e,t,s=W.getConfig(),n=[],a){if(super(void 0,s,n,{}),t){const r=ve;this.append(...t.split(`
7
- `).map(i=>a?i:ss(i,s,n,e)).map(i=>new r(i,"param-line",s,n,{})))}n.splice(n.indexOf(this),1),n.push(this)}lint(e=this.getAbsoluteIndex()){const t="no-ignored",s=W.lintConfig.getSeverity(t,this.name);if(!s)return[];const n=new he(this,e),a=W.msg("invalid parameter of <$1>",this.name),r=[];for(const i of this.childNodes){i.setAttribute("aIndex",e);const o=i.childNodes.filter(({type:l})=>l!=="comment"&&l!=="include"&&l!=="noinclude");if(o.some(({type:l})=>l==="ext"))r.push(Q(i,n,t,a,s));else{const l=o.findIndex(({type:h})=>h!=="text"),d=o.slice(0,l===-1?void 0:l).map(String).join("");if(d&&!(l===-1?/^[a-z]+(?:\[\])?\s*=/iu:/^[a-z]+(?:\[\])?\s*(?:=|$)/iu).test(d)){const h=Q(i,n,t,a,s);h.suggestions=[{desc:"remove",range:[h.startIndex,h.endIndex],text:""}],r.push(h)}else{const h=i.lint(e,!1);h.length>0&&r.push(...h)}}e+=i.toString().length+1}return r}},sr=oe(mi),rt=de(sr,0,"ParamTagToken",xi,rt),le(sr,1,rt)}}),An,ro=C({"src/heading.ts"(){"use strict";var e,t,bs,n;X(),be(),ue(),J(),V(),vt(),An=(n=class extends z{constructor(r,i,o,l=[]){super(void 0,o,l);q(this,t);q(this,e);j(this,e,r);const d=new z(i[0],o,l);d.type="heading-title",d.setAttribute("stage",2);const h=new Xe(i[1],"heading-trail",o,l);this.append(d,h)}get type(){return"heading"}get level(){return f(this,e)}toString(r){const i=P(this,t,bs).call(this);return i+this.firstChild.toString(r)+i+this.lastChild.toString(r)}text(){const r=P(this,t,bs).call(this);return r+this.firstChild.text()+r}getAttribute(r){return r==="invalid"?this.inHtmlAttrs()==="error":r==="padding"?this.level:super.getAttribute(r)}getGaps(){return this.level}lint(r=this.getAbsoluteIndex(),i){const o=super.lint(r,i),{firstChild:l,level:d}=this,h=l.toString(),c=h.startsWith("="),x=c||h.endsWith("="),g=l.childNodes.filter(Ls("quote")),u=g.filter(({bold:p})=>p),y=g.filter(({italic:p})=>p),k=new he(this,r),$=this.inHtmlAttrs();if(this.level===1){const p="h1",b=W.lintConfig.getSeverity(p);if(b){const w=Q(l,k,p,"<h1>",b);x||(w.suggestions=[{desc:"h2",range:[w.startIndex,w.endIndex],text:`=${h}=`}]),o.push(w)}}if(x){const p="unbalanced-header",b=W.lintConfig.getSeverity(p);if(b){const w=W.msg("unbalanced $1 in a section header",'"="'),v=Q(l,k,p,w,b);if(h!=="=")if(c){const[A]=/^=+/u.exec(h),S=d+A.length;v.suggestions=[{desc:`h${d}`,range:[v.startIndex,v.startIndex+A.length],text:""}],S<7&&v.suggestions.push({desc:`h${S}`,range:[v.endIndex,v.endIndex],text:A})}else{const A=/[^=](=+)$/u.exec(h)[1],S=d+A.length;v.suggestions=[{desc:`h${d}`,range:[v.endIndex-A.length,v.endIndex],text:""}],S<7&&v.suggestions.push({desc:`h${S}`,range:[v.startIndex,v.startIndex],text:A})}o.push(v)}}$&&o.push(Z(this,k,"parsing-order","section header in HTML tag attributes",$));const T="format-leakage",m=W.lintConfig.getSeverity(T,"apostrophe");if(m){const p=this.getRootNode().toString();if(u.length%2){const b=Q(u[u.length-1],{...k,start:r+d,left:k.left+d},T,W.msg("unbalanced $1 in a section header","bold apostrophes"),m),w=r+d+h.length;p.slice(b.endIndex,w).trim()?b.suggestions=[{desc:"close",range:[w,w],text:"'''"}]:b.fix={desc:"remove",range:[b.startIndex,b.endIndex],text:""},o.push(b)}if(y.length%2){const b=Q(y[y.length-1],{start:r+d},T,W.msg("unbalanced $1 in a section header","italic apostrophes"),m),w=r+d+h.length;p.slice(b.endIndex,w).trim()?b.suggestions=[{desc:"close",range:[w,w],text:"''"}]:b.fix={desc:"remove",range:[b.startIndex,b.endIndex],text:""},o.push(b)}}return o}print(){const r=P(this,t,bs).call(this);return super.print({pre:r,sep:r})}json(r,i=this.getAbsoluteIndex()){const o=super.json(void 0,i);return o.level=this.level,o}},e=new WeakMap,t=new WeakSet,bs=function(){return"=".repeat(this.level)},n)}}),vi,no,Ql=C({"src/parameter.ts"(){"use strict";ce(),X(),J(),V(),vi=new RegExp(`https?://${ht}${ct}$`,"iu"),no=class extends z{get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){var e;try{return!!((e=this.parentNode)!=null&&e.getDuplicatedArgs().some(([t])=>t===this.name))}catch{return!1}}constructor(e,t,s,n=[]){super(void 0,s,n);const a=new z(typeof e=="number"?void 0:e,s,n,{}),r=new z(t,s,n);a.type="parameter-key",a.setAttribute("stage",2),r.type="parameter-value",r.setAttribute("stage",2),this.append(a,r)}trimName(e,t=!0){const s=(typeof e=="string"?e:e.toString(!0)).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");return this.setAttribute("name",s),s}afterBuild(){if(!this.anon){const{parentNode:e,firstChild:t}=this,s=this.trimName(t);e&&e.getArgs(s,!1,!1).add(this)}super.afterBuild()}toString(e){return this.anon?this.lastChild.toString(e):super.toString(e,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(e=this.getAbsoluteIndex(),t){var r;const s=super.lint(e,t),n="unescaped",a=W.lintConfig.getSeverity(n);if(a){const{firstChild:i}=this,o=(r=vi.exec(i.text()))==null?void 0:r[0];try{if(o&&new URL(o).search){const l="unescaped query string in an anonymous parameter",d=Q(i,{start:e},n,l,a);d.startIndex=d.endIndex,d.startLine=d.endLine,d.startCol=d.endCol,d.endIndex++,d.endCol++,d.fix={desc:"escape",range:[d.startIndex,d.endIndex],text:"{{=}}"},s.push(d)}}catch{}}return s}print(){return super.print({sep:this.anon?"":"="})}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t);return Object.assign(s,{anon:this.anon},this.duplicated&&{duplicated:!0}),s}}}}),bi,rr,wi,nt,Jl=C({"src/transclude.ts"(){"use strict";var e,t,s,n,a,r,Et,io,l;ce(),X(),be(),ue(),_s(),V(),Ql(),qe(),vt(),bi=[ts()],nt=(l=class extends(wi=z){constructor(h,c,x,g=[]){var _,E;let u;const y=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(h);y&&(u=Number(y[1]),h=h.replace(`\0${u}h`,g[u].toString().replace(/^\n/u,"")));super(void 0,x,g,{});q(this,r);Ae(this,"modifier","");q(this,e,"template");q(this,t,":");q(this,s,!1);q(this,n,new Map);q(this,a);const{parserFunction:[k,$],variable:T,functionHook:m}=x,p=(_=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(h))==null?void 0:_[0];if(p)this.setAttribute("modifier",p),h=h.slice(p.length);else if(h.includes(":")){const[F,...N]=h.split(":"),[O]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((E=N[0])!=null?E:"");this.setModifier(`${F}:${O}`)&&(h=N.join(":").slice(O.length))}const b=h.search(/[::]/u),w=h[b]===":",v=b!==-1;if(v||c.length===0&&!f(this,s)){const F=v?h.slice(0,b):h,N=v&&h.slice(b+1),O=_e(F),R=v?O.slice(O.search(/\S/u))+(w?":":""):O.trim(),L=R.toLowerCase(),U=Array.isArray($),I=U?$.includes(R):Object.prototype.hasOwnProperty.call($,R),B=!U&&I?$[R]:Object.prototype.hasOwnProperty.call(k,L)&&k[L],M=U&&I||!("functionHook"in x)||m.includes(B),H=U&&I||T.includes(B);if(v?B&&M:H){this.setAttribute("name",B||L.replace(/^#|:$/u,"")),j(this,e,"magic-word"),w&&j(this,t,":");const G=new Xe(F,"magic-word-name",x,g);if(super.insertAt(G),N!==!1&&c.unshift([N]),this.name==="invoke")for(let K=0;K<2;K++){const se=c.shift();if(!se)break;const re=new ve(se.join("="),`invoke-${K?"function":"module"}`,x,g);super.insertAt(re)}}}if(this.type==="template"){const F=_e(h).trim();if(!this.normalizeTitle(F,10,{halfParsed:!0,temporary:!0}).valid)throw g.pop(),new SyntaxError("Invalid template name");const N=new ve(h,"template-name",x,g,{});super.insertAt(N)}typeof u=="number"&&(g[u]=void 0);const A=this.isTemplate();let S=1;for(let F=0;F<c.length;F++){const N=c[F];A||this.name==="switch"&&F>0||this.name==="tag"&&F>1||(N[0]=N.join("="),N.length=1),N.length===1&&(N.unshift(S),S++),this.insertAt(new no(...N,x,g))}this.seal("modifier")}get type(){return f(this,e)}get module(){return this.type==="magic-word"&&this.name==="invoke"?P(this,r,Et).call(this).title:void 0}get function(){var h;return this.type==="magic-word"&&this.name==="invoke"?(h=this.childNodes[2])==null?void 0:h.text().trim():void 0}setModifier(h){const{parserFunction:[,,c,x]}=this.getAttribute("config"),g=_e(h).trim();if(h&&!g.endsWith(":"))return!1;const u=g.slice(0,-1).toLowerCase(),y=c.includes(u),k=x.includes(u);return f(this,s)&&y||!f(this,s)&&(k||!h)||(me.running||this.length>1)&&(y||k||!h)?(this.setAttribute("modifier",h),j(this,s,y),!!h):!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,a,P(this,r,Et).call(this)),this.setAttribute("name",f(this,a).title))}toString(h){return`{{${this.modifier}${this.type==="magic-word"?this.firstChild.toString(h)+(this.length===1?"":f(this,t))+this.childNodes.slice(1).map(c=>c.toString(h)).join("|"):super.toString(h,"|")}}}`}text(){const{childNodes:h,length:c,firstChild:x,modifier:g,type:u,name:y}=this;return u==="magic-word"&&y==="vardefine"?"":`{{${g}${u==="magic-word"?x.text()+(c===1?"":f(this,t))+Ve(h.slice(1),"|"):super.text("|")}}}`}getAttribute(h){switch(h){case"padding":return this.modifier.length+2;case"title":return f(this,a);case"colon":return f(this,t);case"invalid":return this.type==="magic-word"&&this.name==="invoke"&&(this.length===2||!P(this,r,Et).call(this).valid);default:return super.getAttribute(h)}}lint(h=this.getAbsoluteIndex(),c){const x=super.lint(h,c);if(!this.isTemplate())return x;const{type:g,childNodes:u,length:y}=this,k=new he(this,h),$=g==="magic-word";if($&&!P(this,r,Et).call(this).valid)x.push(Q(u[1],k,"invalid-invoke","illegal module name"));else{const m=u[$?1:0],p=m.childNodes.findIndex(w=>w.type==="text"&&Kt(w.data).includes("#")),b=m.childNodes[p];if(b){const w=Q(m,k,"no-ignored","useless fragment","warning");w.fix={desc:"remove",range:[w.startIndex+m.getRelativeIndex(p)+b.data.indexOf("#"),w.endIndex],text:""},x.push(w)}}if($&&y===2)return x.push(Z(this,k,"invalid-invoke","missing module function")),x;const T=this.getDuplicatedArgs().filter(([,m])=>!m[0].querySelector("ext"));if(T.length>0)for(const[,m]of T)x.push(...m.map(p=>{const b=Q(p,k,"no-duplicate","duplicated parameter");return b.suggestions=[{desc:"remove",range:[b.startIndex-1,b.endIndex],text:""}],b}));return x}insertAt(h,c=this.length){return super.insertAt(h,c),h.anon?P(this,r,io).call(this,h):h.name&&this.getArgs(h.name,!1,!1).add(h),h}getAllArgs(){return this.childNodes.filter(Ls("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:h})=>h)}getArgs(h,c,x=!0){const g=String(h).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");let u;return f(this,n).has(g)?u=f(this,n).get(g):(u=new Set(this.getAllArgs().filter(({name:y})=>g===y)),f(this,n).set(g,u)),u}getDuplicatedArgs(){return[...f(this,n)].filter(([,{size:h}])=>h>1).map(([h,c])=>[h,[...c]])}getPossibleValues(){const{type:h,name:c,childNodes:x}=this;if(h==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let g,u;switch(c){case"if":case"ifexist":case"ifexpr":case"iferror":g=2;break;case"ifeq":g=3;break;case"switch":{const y=x.slice(2),k=y[y.length-1];u=[...y.filter(({anon:$})=>!$),...k!=null&&k.anon?[k]:[]].map(({lastChild:$})=>$);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}u!=null||(u=x.slice(g,g+2).map(({lastChild:y})=>y));for(let y=0;y<u.length;){const{length:k,0:$}=u[y].childNodes.filter(T=>T.text().trim());if(k===0)u.splice(y,1);else if(k>1||$.type!=="magic-word")y++;else try{const T=$.getPossibleValues();u.splice(y,1,...T),y+=T.length}catch{y++}}return u}print(){const{childNodes:h,length:c,firstChild:x,modifier:g,type:u}=this;return`<span class="wpb-${u}${this.getAttribute("invalid")?" wpb-invalid":""}">{{${u==="magic-word"?Yt(g)+x.print()+(c===1?"":f(this,t))+gt(h.slice(1),{sep:"|"}):(g?`<span class="wpb-magic-word">${Yt(g)}</span>`:"")+gt(h,{sep:"|"})}}}</span>`}},e=new WeakMap,t=new WeakMap,s=new WeakMap,n=new WeakMap,a=new WeakMap,r=new WeakSet,Et=function(){const h=this.type==="template";return this.normalizeTitle(this.childNodes[h?0:1].text(),h?10:828,{temporary:!0})},io=function(h){const c=this.getAnonArgs(),x=typeof h!="number";for(let g=x?c.indexOf(h):h-1;g<c.length;g++){const u=c[g],{name:y}=u,k=String(g+1);(y!==k||u===h)&&(u.setAttribute("name",k),this.getArgs(k,!1,!1).add(u))}},l),rr=oe(wi),nt=de(rr,0,"TranscludeToken",bi,nt),le(rr,1,nt)}}),yi,nr,Si,Ot,Xl=C({"src/hidden.ts"(){"use strict";mt(),V(),yi=[Je()],Ot=class extends(Si=z){get type(){return"hidden"}getAttribute(e){return e==="invalid"||super.getAttribute(e)}},nr=oe(Si),Ot=de(nr,0,"HiddenToken",yi,Ot),le(nr,1,Ot)}}),Ai,ir,$i,qt,Kl=C({"src/arg.ts"(){"use strict";var e,ao,s;ce(),X(),ue(),Oe(),_s(),V(),qe(),Xl(),Ai=[je("{{{"),ts()],qt=(s=class extends($i=z){constructor(a,r,i=[]){super(void 0,r,i,{});q(this,e);for(let o=0;o<a.length;o++){const l=a[o];if(o===0){const d=new ve(l,"arg-name",r,i,{});super.insertAt(d)}else if(o>1){const d=new Ot(l,r,i);super.insertAt(d)}else{const d=new z(l,r,i);d.type="arg-default",d.setAttribute("stage",2),super.insertAt(d)}}}get type(){return"arg"}get default(){var a,r;return(r=(a=this.childNodes[1])==null?void 0:a.text())!=null?r:!1}toString(a){return`{{{${super.toString(a,"|")}}}}`}text(){return`{{{${Ve(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){P(this,e,ao).call(this),super.afterBuild()}lint(a=this.getAbsoluteIndex(),r){const{childNodes:[i,o,...l]}=this;i.setAttribute("aIndex",a+3);const d=i.lint(a+3,r);if(o){const h=a+4+i.toString().length;o.setAttribute("aIndex",h);const c=o.lint(h,r);c.length>0&&d.push(...c)}if(l.length>0){const h=new he(this,a);d.push(...l.map(c=>{const x=Q(c,h,"no-ignored","invisible content inside triple braces");return x.startIndex--,x.startCol--,x.suggestions=[{desc:"remove",range:[x.startIndex,x.endIndex],text:""},{desc:"escape",range:[x.startIndex,x.startIndex+1],text:"{{!}}"}],x}))}if(!this.getAttribute("include")){const h=Z(this,{start:a},"no-arg","unexpected template argument","warning");o&&(h.suggestions=[{desc:"expand",range:[a,h.endIndex],text:o.text()}]),d.push(h)}return d}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(a,r=this.getAbsoluteIndex()){const i=super.json(void 0,r);return i.default=this.default,i}},e=new WeakSet,ao=function(){this.setAttribute("name",this.firstChild.text().trim())},s),ir=oe($i),qt=de(ir,0,"ArgToken",Ai,qt),le(ir,1,qt)}}),oo={};ie(oo,{parseBraces:()=>Ns});var ki,ar,cs,or,lr,dr,_i,hr,Ns,$n=C({"parser/braces.ts"(){"use strict";xt(),ce(),ro(),Jl(),Kl(),ki={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},ar=String.raw`\[(?!\[)`,cs=String.raw`\n(?![=\0])`,or=String.raw`|\{{2,}`,lr=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),dr=Ge(e=>new RegExp(e,"gmu")),_i=new RegExp(String.raw`\{\{((?:[^\n{}[]|${ar}|${cs})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${cs})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${ar}|${cs})*\}-`,"gu"),hr=e=>{const t=ut(_e(e));return lr.has(t)?lr.get(t):/^(?:filepath|(?:full|canonical)urle?):./u.test(t)?"m":/^#vardefine:./u.test(t)?"n":"t"},Ns=(e,t,s)=>{var u,y,k,$,T;const n=String.raw`${t.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,a]}=t,r=[],i=[],o=(m,p,b,w)=>{p[p.length-1].push(Le(m.slice(b,w),i))};let l;do l!==void 0&&(e=l),l=e.replace(_i,(m,p,b)=>{if(p!==void 0||typeof b=="string")try{const{length:w}=s,v=(p!=null?p:b).split("|");return new nt(Le(v[0],i),v.slice(1).map(A=>{const S=A.indexOf("=");return(S===-1?[A]:[A.slice(0,S),A.slice(S+1)]).map(_=>Le(_,i))}),t,s),`\0${w}${hr(v[0])}`}catch(w){if(!(w instanceof SyntaxError)||w.message!=="Invalid template name")throw w}return i.push(Le(m,i)),`\0${i.length-1}`});while(l!==e);e=l;const d=e.lastIndexOf("}}")-e.length;let h=d+e.length!==-1,c=dr(n+(h?or:"")),x=c.exec(e),g;for(;x||g!==void 0&&g<=e.length&&((y=(u=r[r.length-1])==null?void 0:u[0])!=null&&y.startsWith("="));){if(x!=null&&x[1]){const[,{length:N}]=x;x[0]=x[0].slice(N),x.index+=N}const{0:m,index:p}=x!=null?x:{0:`
8
- `,index:e.length},b=(k=r.pop())!=null?k:{},{0:w,index:v,parts:A,findEqual:S,pos:_}=b,E=m==="="&&S;if(m==="]]"||m==="}-")g=p+2;else if(m===`
9
- `){g=p+1;const{pos:N,findEqual:O}=($=r[r.length-1])!=null?$:{};if(N===void 0||O||_e(e.slice(N,v))!==""){const R=/^(={1,6})(.+)\1((?:\s|\0\d+[cn]\x7F)*)$/u.exec(e.slice(v,p));R&&(R[2]=Le(R[2],i),R[2].includes(`
10
- `)||(e=`${e.slice(0,v)}\0${s.length}h${e.slice(p)}`,g=v+4+String(s.length).length,new An(R[1].length,R.slice(2),t,s)))}}else if(m==="|"||E)g=p+1,o(e,A,_,p),m==="|"&&A.push([]),b.pos=g,b.findEqual=m==="|",r.push(b);else if(m.startsWith("}}")){const N=m.slice(0,Math.min(w.length,3)),O=w.length-N.length,{length:R}=s;g=p+N.length,o(e,A,_,p);let L=!1,U="t";if(N.length===3){const I=A.map(M=>M.join("=")),B=I.length>1&&_e(I[1]).trim();new qt(I,t,s),B&&B.endsWith(":")&&a.includes(B.slice(0,-1).toLowerCase())&&(U="s")}else try{new nt(A[0][0],A.slice(1),t,s),U=hr(A[0][0])}catch(I){if(I instanceof SyntaxError&&I.message==="Invalid template name")L=!0;else throw I}L||(e=`${e.slice(0,v+O)}\0${R}${U}${e.slice(g)}`,g=v+O+3+String(R).length,O>1?r.push({0:w.slice(0,O),index:v,pos:v+O,parts:[[]]}):O===1&&e[v-1]==="-"&&r.push({0:"-{",index:v-1,pos:v+1,parts:[[]]}))}else g=p+m.length,m.startsWith("{")&&(x.pos=g,x.parts=[[]]),r.push(..."0"in b?[b]:[],x);let F=r[r.length-1];if(h&&d+e.length<g)for(h=!1;(T=F==null?void 0:F[0])!=null&&T.startsWith("{");)r.pop(),F=r[r.length-1];c=dr(n+(h?or:"")+(F?`|${ki[F[0][0]]}${F.findEqual?"|=":""}`:"")),c.lastIndex=g,x=c.exec(e)}return Le(e,i)}}}),lo={};ie(lo,{InputboxToken:()=>ho});var ho,Yl=C({"src/paramTag/inputbox.ts"(){"use strict";Fs(),$n(),J(),so(),ho=class extends rt{constructor(e,t,s=W.getConfig(),n=[]){const a=Symbol("InputboxToken"),r=s.excludes.includes("heading")?s:{...s,excludes:[...s.excludes,"heading"]},{length:i}=n;n.push(a),t&&(t=ss(t,r,n,e)),t&&(t=Ns(t,r,n)),n.splice(i,1),super(e,t,r,n,{})}}}}),ws={};ie(ws,{NestedToken:()=>co});var Ti,Ii,co,cr=C({"src/nested.ts"(){"use strict";var e,t,s;X(),ue(),Fs(),$n(),J(),V(),Io(),We(),Ti=new Set(["comment","include","arg","template","magic-word"]),Ii=[!1,!0].map(n=>{const a=n?"includeonly":"noinclude";return new RegExp(String.raw`^(?:<${a}(?:\s[^>]*)?/?>|</${a}\s*>)$`,"iu")}),co=(s=class extends z{constructor(a,r,i,o,l=[]){if(typeof r=="boolean"){const d=Symbol("InputboxToken"),{length:h}=l;l.push(d),a&&(a=ss(a,o,l,r)),a&&(a=Ns(a,o,l)),l.splice(h,1)}else a&&(a=a.replace(r,(d,h,c,x,g)=>{const u=`\0${l.length+1}e`;return new lt(h,c,x,g,o,!1,l),u}));a&&(a=a.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(d,h,c)=>(new pe(c,o,l),`${h}\0${l.length}n`)));super(a,o,l);q(this,e);q(this,t);j(this,e,[...i]),j(this,t,r)}get type(){return"ext-inner"}lint(a=this.getAbsoluteIndex(),r){const i=super.lint(a,r),o="no-ignored",l=W.lintConfig.getSeverity(o,this.name);if(!l)return i;const d=new he(this,a),h=typeof f(this,t)=="boolean"?Ii[f(this,t)?1:0]:/^<!--[\s\S]*-->$/u;return[...i,...this.childNodes.filter(c=>{const{type:x,name:g}=c;if(x==="ext")return!f(this,e).includes(g);if(Ti.has(x))return!1;const u=c.toString().trim();return u&&!h.test(u)}).map(c=>{const x=Q(c,d,o,W.msg("invalid content in <$1>",this.name),l);return x.suggestions=[{desc:"remove",range:[x.startIndex,x.endIndex],text:""},{desc:"comment",range:[x.startIndex,x.endIndex],text:`<!--${c.toString()}-->`}],x})]}},e=new WeakMap,t=new WeakMap,s)}});function Ci(e,t,s,n,a){t=_e(t).trim();let r=t.replace(e==="link"?/\0\d+[tq]\x7F/gu:/\0\d+t\x7F/gu,"").trim();switch(e){case"width":return!r&&!!t||/^(?:\d+x?|\d*x\d+)(?:\s*px)?$/u.test(r);case"link":{if(r){if(uo(s.protocol).test(r))return go(s.protocol).test(r)&&t;r.startsWith("[[")&&r.endsWith("]]")&&(r=r.slice(2,-2))}else return t;const i=W.normalizeTitle(r,0,!1,s,{halfParsed:n,decode:!0,selfLink:!0});return i.valid&&i}case"lang":return(a==="svg"||a==="svgz")&&!/[^a-z\d-]/u.test(r);case"alt":case"class":case"manualthumb":return!0;case"page":return(a==="djvu"||a==="djv"||a==="pdf")&&Number(r)>0;default:return!!r&&!isNaN(r)}}var uo,go,Ni,Fi,po,Zl=C({"src/imageParameter.ts"(){"use strict";var e,t,fo,a;xt(),ce(),X(),J(),V(),uo=Ge(r=>new RegExp(String.raw`^(?:${r}|//|\0\d+m\x7F)`,"iu")),go=Ge(r=>new RegExp(String.raw`^(?:(?:${r}|//)${ht}|\0\d+m\x7F)${ct}$`,"iu")),Ni=Ge(r=>new RegExp(String.raw`^(\s*(?!\s))${r.replace("$1","(.*)")}${r.endsWith("$1")?`(?=$|
11
- )`:""}(\s*)$`,"u")),Fi=new Set(["alt","link","lang","page","caption"]),po=(a=class extends z{constructor(i,o,l,d){var r=(...n)=>(super(...n),q(this,t),q(this,e,""),this);let h;const c=Object.entries(l.img).map(([g,u])=>[g,u,Ni(g)]),x=c.find(([,g,u])=>(h=u.exec(i),h&&(h.length!==4||Ci(g,h[2],l,!0,o)!==!1)));if(x&&h){h.length===3?(r(void 0,l,d),j(this,e,i)):(r(h[2],l,d,{}),j(this,e,h[1]+x[0]+h[3])),this.setAttribute("name",x[1]);return}r(i,l.excludes.includes("list")?l:{...l,excludes:[...l.excludes,"list"]},d),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get type(){return"image-parameter"}get link(){return this.name==="link"?Ci("link",super.text(),this.getAttribute("config")):void 0}afterBuild(){var i;(i=this.parentNode)!=null&&i.is("gallery-image")&&!Fi.has(this.name)&&this.setAttribute("name","invalid"),super.afterBuild()}toString(i){return f(this,e)?f(this,e).replace("$1",super.toString(i)):super.toString(i)}text(){return f(this,e)?f(this,e).replace("$1",super.text()).trim():super.text().trim()}isPlain(){return this.name==="caption"}getAttribute(i){return i==="invalid"?this.name==="invalid":i==="padding"?Math.max(0,f(this,e).indexOf("$1")):super.getAttribute(i)}lint(i=this.getAbsoluteIndex(),o){const l=super.lint(i,o),{link:d,name:h}=this;if(h==="invalid"){const c="invalid-gallery",x=W.lintConfig.getSeverity(c,"parameter");if(x){const g=Z(this,{start:i},c,"invalid image parameter",x);g.fix={desc:"remove",range:[i-1,g.endIndex],text:""},l.push(g)}}else if(typeof d=="object"&&d.encoded){const c="url-encoding",x=W.lintConfig.getSeverity(c,"file");if(x){const g=Z(this,{start:i},c,"unnecessary URL encoding in an internal link",x);g.suggestions=[{desc:"decode",range:[i,g.endIndex],text:Jt(this.text())}],l.push(g)}}return l}getValue(){return this.name==="invalid"?this.text():P(this,t,fo).call(this)||super.text()}print(){return f(this,e)?`<span class="wpb-image-parameter${this.name==="invalid"?" wpb-invalid":""}">${f(this,e).replace("$1",`<span class="wpb-image-caption">${gt(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}},e=new WeakMap,t=new WeakSet,fo=function(){return f(this,e)&&!f(this,e).includes("$1")},a)}}),ur,Li,ji,gr,pr,Ri,Pi,fr,kn,xo=C({"src/link/file.ts"(){"use strict";X(),ue(),J(),ks(),Zl(),ur=new Map([["manualthumb","Thumb"],["frameless","Frameless"],["framed","Frame"],["thumbnail","Thumb"]]),Li=new Set(["arg"]),ji=new Set(["template","magic-word"]),gr=new Set(["left","right","center","none"]),pr=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),Ri=new Set(["tiff","tif","png","gif","jpg","jpeg","webp","xcf","pdf","svg","djvu"]),Pi=e=>{if(e===void 0)return[];const t=/-\{|\}-|\|/gu,s=[];let n=t.exec(e),a=0,r=0;for(;n;){const{0:i,index:o}=n;i!=="|"?a+=i==="-{"?1:-1:a===0&&(s.push(e.slice(r,o)),{lastIndex:r}=t),n=t.exec(e)}return s.push(e.slice(r)),s},fr=(e,t)=>e.filter(({childNodes:s})=>{const n=s.filter(a=>a.text().trim());return n.length!==1||!t.has(n[0].type)}),kn=class extends Pe{get type(){return"file"}get extension(){return this.getAttribute("title").extension}constructor(e,t,s,n=[],a="|"){super(e,void 0,s,n,a);const{extension:r}=this.getTitle(!0,!0);this.safeAppend(Pi(t).map(i=>new po(i,r,s,n)))}lint(e=this.getAbsoluteIndex(),t){var g;const s=super.lint(e,t),n=fr(this.getAllArgs(),Li),a=[...new Set(n.map(({name:u})=>u))],r=a.filter(u=>ur.has(u)),i=a.filter(u=>gr.has(u)),o=a.filter(u=>pr.has(u)),[l]=r,d=l==="framed"||l==="manualthumb",h=new he(this,e);if(this.closest("ext-link-text")&&((g=this.getValue("link"))==null?void 0:g.trim())!==""&&s.push(Z(this,h,"nested-link","internal link in an external link")),d)for(const u of n.filter(({name:y})=>y==="width")){const y=Q(u,h,"invalid-gallery","invalid image parameter");y.fix={desc:"remove",range:[y.startIndex-1,y.endIndex],text:""},s.push(y)}if(n.length===a.length&&r.length<2&&i.length<2&&o.length<2)return s;const c=(u,y,k=!0)=>$=>{const T=typeof k=="function"?k($):k,m=Q($,h,"no-duplicate",W.msg(`${u} image $1 parameter`,y),T?"error":"warning");return m.suggestions=[{desc:"remove",range:[m.startIndex-1,m.endIndex],text:""}],m},{extension:x}=this;for(const u of a){if(u==="invalid"||u==="width"&&d)continue;const y=u==="caption";let k=n.filter(({name:$})=>$===u);if(y&&(k=[...k.slice(0,-1).filter($=>$.text()),...k.slice(-1)]),k.length>1){let $=!y||!x||Ri.has(x);if(y&&$){const T=fr(k,ji);$=T.length>1&&(m=>T.includes(m))}s.push(...k.map(c("duplicated",u,$)))}}return r.length>1&&s.push(...n.filter(({name:u})=>ur.has(u)).map(c("conflicting","frame"))),i.length>1&&s.push(...n.filter(({name:u})=>gr.has(u)).map(c("conflicting","horizontal-alignment"))),o.length>1&&s.push(...n.filter(({name:u})=>pr.has(u)).map(c("conflicting","vertical-alignment"))),s}getAllArgs(){return this.childNodes.slice(1)}getArgs(e){return this.getAllArgs().filter(({name:t})=>e===t)}getArg(e){const t=this.getArgs(e);return t[e==="manualthumb"?0:t.length-1]}getValue(e){var t;return(t=this.getArg(e))==null?void 0:t.getValue()}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t),{extension:n}=this;return n&&(s.extension=n),s}}}}),Ei,xr,Oi,it,mo=C({"src/link/galleryImage.ts"(){"use strict";var e,Yr,s;X(),Qe(),Oe(),J(),V(),xo(),Ei=[je("")],it=(s=class extends(Oi=kn){constructor(a,r,i,o,l=[]){let d;if(i!==void 0){const{length:h}=l;d=new z(i,o,l);for(let c=1;c<we;c++)d.parseOnce();l.splice(h,1)}super(r,d==null?void 0:d.toString(),o,l);q(this,e);Ae(this,"privateType","imagemap-image");this.setAttribute("bracket",!1),this.privateType=`${a}-image`,this.seal("privateType",!0)}get type(){return this.privateType}getTitle(a){const r=this.type==="imagemap-image";return this.normalizeTitle(this.firstChild.toString(),r?0:6,{halfParsed:!0,temporary:a,decode:!r})}lint(a=this.getAbsoluteIndex(),r){const i=super.lint(a,r),o="invalid-gallery",l=W.lintConfig.getSeverity(o,"image");if(l&&P(this,e,Yr).call(this)){const d=Z(this,{start:a},o,"invalid gallery image",l);d.suggestions=[{desc:"prefix",range:[a,a],text:"File:"}],i.push(d)}return i}getAttribute(a){return a==="invalid"?P(this,e,Yr).call(this):super.getAttribute(a)}},e=new WeakSet,Yr=function(){const{ns:a}=this.getAttribute("title");return a!==6},s),xr=oe(Oi),it=de(xr,0,"GalleryImageToken",Ei,it),le(xr,1,it)}}),vo={};ie(vo,{GalleryToken:()=>Bt});var qi,mr,Bi,Bt,ed=C({"src/gallery.ts"(){"use strict";var e,bo,Zr,n;Sn(),J(),V(),mo(),We(),qi=[Cs],Bt=(n=class extends(Bi=z){constructor(r,i,o=[]){var l;super(void 0,i,o,{});q(this,e);for(const d of(l=r==null?void 0:r.split(`
12
- `))!=null?l:[]){const h=/^([^|]+)(?:\|(.*))?/u.exec(d);if(!h){super.insertAt(d.trim()?new pe(d,i,o):d);continue}const[,c,x]=h;P(this,e,bo).call(this,c)?super.insertAt(new it("gallery",c,x,i,o)):super.insertAt(new pe(d,i,o))}}get type(){return"ext-inner"}get widths(){return P(this,e,Zr).call(this,"widths")}get heights(){return P(this,e,Zr).call(this,"heights")}lint(r=this.getAbsoluteIndex(),i){const{top:o,left:l}=this.getRootNode().posFromIndex(r),d=[];for(let h=0;h<this.length;h++){const c=this.childNodes[h],x=c.toString(),{length:g}=x,u=x.trim(),{type:y}=c,k=o+h,$=h?0:l;if(c.setAttribute("aIndex",r),y==="noinclude"&&u&&!/^<!--.*-->$/u.test(u)){const T=r+g;d.push({rule:"no-ignored",message:W.msg("invalid content in <$1>","gallery"),severity:u.endsWith("-->")||/^(?:\||<!--)/u.test(u)?"warning":"error",startIndex:r,endIndex:T,startLine:k,endLine:k,startCol:$,endCol:$+g,suggestions:[{desc:"remove",range:[r,T],text:""},{desc:"comment",range:[r,T],text:`<!--${x}-->`}]})}else if(y!=="noinclude"&&y!=="text"){const T=c.lint(r,i);T.length>0&&d.push(...T)}r+=g+1}return d}json(r,i=this.getAbsoluteIndex()){const o=super.json(void 0,i);return Object.assign(o,{widths:this.widths,heights:this.heights}),o}},e=new WeakSet,bo=function(r){return this.normalizeTitle(r,6,{halfParsed:!0,temporary:!0,decode:!0}).valid},Zr=function(r){var l,d;const i=(l=this.parentNode)==null?void 0:l.getAttr(r),o=typeof i=="string"&&((d=/^(\d+)\s*(?:px)?$/u.exec(i))==null?void 0:d[1]);return o&&Number(o)||120},n),mr=oe(Bi),Bt=de(mr,0,"GalleryToken",qi,Bt),le(mr,1,Bt)}}),_n,wo=C({"src/link/index.ts"(){"use strict";X(),J(),ks(),_n=class extends Pe{get type(){return"link"}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),n="nested-link",a=W.lintConfig.getSeverity(n);return a&&this.closest("ext-link-text")&&s.push(Z(this,{start:e},n,"internal link in an external link",a)),s}}}}),Wi,Ui,es,Tn=C({"src/magicLink.ts"(){"use strict";var e,t,en,n;X(),ce(),ue(),J(),V(),Wi=String.raw`(?:[${Ee}\t]|&nbsp;|&#0*160;|&#[xX]0*[aA]0;)`,Ui=new RegExp(`${Wi}+`,"gu"),es=(n=class extends z{constructor(r,i="free-ext-link",o=W.getConfig(),l){super(r,o,l,{});q(this,t);q(this,e);j(this,e,i)}get type(){return f(this,e)}get innerText(){const r=new Map([["!","|"],["=","="]]);let i=Ve(this.childNodes.map(o=>{const{type:l}=o,d=String(o.name);return l==="magic-word"&&r.has(d)?r.get(d):o}));return this.type==="magic-link"&&(i=i.replace(Ui," ")),i}get link(){const{innerText:r}=this;return this.type==="magic-link"?r.startsWith("ISBN")?`ISBN ${r.slice(5).replace(/[- ]/gu,"").replace(/x$/u,"X")}`:r:Ua(r).replace(/\n/gu,"%0A")}lint(r=this.getAbsoluteIndex(),i){const o=super.lint(r,i),l=new he(this,r),{type:d,childNodes:h}=this;if(d==="magic-link")return P(this,t,en).call(this)&&o.push(Z(this,l,"invalid-isbn","invalid ISBN")),o;const c=d==="ext-link-url",x=c?/\|/u:/[,;。:!?()]+/u,g=h.find(u=>u.type==="text"&&x.test(u.data));if(g){const{data:u}=g,y=Q(g,l,"unterminated-url",W.msg("$1 in URL",c?'"|"':"full-width punctuation"),"warning"),{index:k,0:$}=x.exec(u),T=y.startIndex+k;y.suggestions=c?[{desc:"whitespace",range:[T,T+1],text:" "}]:[{desc:"whitespace",range:[T,T],text:" "},{desc:"escape",range:[T,T+$.length],text:encodeURI($)}],o.push(y)}return o}getUrl(r){{const{type:i}=this;let{link:o}=this;if(i==="magic-link"){if(o.startsWith("ISBN"))return this.normalizeTitle(`BookSources/${o.slice(5)}`,-1,{temporary:!0}).getUrl(r);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(r){return r==="invalid"?P(this,t,en).call(this):super.getAttribute(r)}},e=new WeakMap,t=new WeakSet,en=function(){if(this.type==="magic-link"){const{link:r}=this;if(r.startsWith("ISBN")){const i=[...r.slice(5)].map(o=>o==="X"?10:Number(o));return i.length===10?i.reduce((o,l,d)=>o+l*(10-d),0)%11!==0:i.length===13&&(i[12]===10||i.reduce((o,l,d)=>o+l*(d%2?3:1),0)%10!==0)}}return!1},n)}}),Mi,vr,zi,at,yo=C({"src/extLink.ts"(){"use strict";var e,t;Qe(),X(),Oe(),J(),V(),Tn(),Mi=[je("[")],at=(t=class extends(zi=z){constructor(n,a="",r="",i,o=[]){super(void 0,i,o,{});q(this,e);const l=n&&/^\0\d+f\x7F$/u.test(n)?o[Number(n.slice(1,-2))]:new es(n,"ext-link-url",i,o);if(this.insertAt(l),j(this,e,a),r){const d=new z(r,i,o,{});d.type="ext-link-text",d.setAttribute("stage",we-1),this.insertAt(d)}}get type(){return"ext-link"}toString(n){return this.length===1?`[${super.toString(n)}${f(this,e)}]`:`[${super.toString(n,f(this,e))}]`}text(){return`[${super.text(" ")}]`}getGaps(){return f(this,e).length}lint(n=this.getAbsoluteIndex(),a){const r=super.lint(n,a),i="var-anchor",o=W.lintConfig.getSeverity(i,"extLink");return o&&this.length===1&&this.closest("heading-title")&&r.push(Z(this,{start:n},i,"variable anchor in a section header",o)),r}print(){return super.print(this.length===1?{pre:"[",post:`${f(this,e)}]`}:{pre:"[",sep:f(this,e),post:"]"})}},e=new WeakMap,t),vr=oe(zi),at=de(vr,0,"ExtLinkToken",Mi,at),le(vr,1,at)}}),tn,td=C({"src/imagemapLink.ts"(){"use strict";V(),We(),wo(),yo(),tn=class extends z{get type(){return"imagemap-link"}constructor(e,t,s,n,a=[]){super(void 0,n,a),this.append(e,t.length===2?new _n(...t,n,a):new at(...t,n,a),new pe(s,n,a))}}}}),So={};ie(So,{ImagemapToken:()=>Wt});var Hi,br,Gi,Wt,sd=C({"src/imagemap.ts"(){"use strict";X(),be(),ue(),Sn(),J(),V(),We(),mo(),td(),Hi=[Cs],Wt=class extends(Gi=z){get type(){return"ext-inner"}get image(){return this.childNodes.find(Ls("imagemap-image"))}constructor(e,t=W.getConfig(),s=[]){if(super(void 0,t,s,{}),!e)return;const n=e.split(`
13
- `),a=new Set(t.protocol.split("|")),r=pe;let i=!0,o=!1;for(const l of n){const d=l.trim();if(!(o||!d||d.startsWith("#"))){if(i){const h=l.indexOf("|"),c=h===-1?l:l.slice(0,h),{valid:x,ns:g}=this.normalizeTitle(c,0,{halfParsed:!0,temporary:!0});if(x&&g===6){const u=new it("imagemap",c,h===-1?void 0:l.slice(h+1),t,s);super.insertAt(u),i=!1;continue}else o=!0}else if(l.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(l);continue}else if(l.includes("[")){const h=l.indexOf("["),c=l.slice(h),x=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(c);if(x){if(this.normalizeTitle(x[1],0,{halfParsed:!0,temporary:!0,selfLink:!0}).valid){super.insertAt(new tn(l.slice(0,h),x.slice(1),c.slice(c.indexOf("]]")+2),t,s));continue}}else if(c.startsWith("[//")||a.has(c.slice(1,c.indexOf(":")+1))||a.has(c.slice(1,c.indexOf("//")+2))){const g=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(c);if(g){super.insertAt(new tn(l.slice(0,h),g.slice(1),c.slice(c.indexOf("]")+1),t,s));continue}}}}super.insertAt(new r(l,t,s))}}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),n=new he(this,e),{childNodes:a,image:r}=this,i="invalid-imagemap",o=W.lintConfig.getSeverity(i,r?"link":"image");return o&&(r?s.push(...a.filter(l=>{const d=l.toString().trim();return l.is("noinclude")&&d&&!d.startsWith("#")}).map(l=>{const d=Q(l,n,i,"invalid link in <imagemap>",o);return d.suggestions=[{desc:"remove",range:[d.startIndex-1,d.endIndex],text:""},{desc:"comment",range:[d.startIndex,d.startIndex],text:"# "}],d})):s.push(Z(this,n,i,"<imagemap> without an image",o))),s}getAttribute(e){return e==="invalid"?!this.image:super.getAttribute(e)}},br=oe(Gi),Wt=de(br,0,"ImagemapToken",Hi,Wt),le(br,1,Wt)}}),Di,wr,Vi,ot,Ao=C({"src/nowiki/comment.ts"(){"use strict";X(),mt(),Oe(),J(),Ke(),Di=[Je(!1),je("<!--")],ot=class extends(Vi=Be){constructor(t,s,n,a){super(t,n,a);Ae(this,"closed");this.closed=s}get type(){return"comment"}lint(t=this.getAbsoluteIndex()){if(this.closed)return[];const s="unclosed-comment",n=W.lintConfig.getSeverity(s);if(!n)return[];const a=Z(this,{start:t},s,W.msg("unclosed $1","HTML comment"),n);return a.suggestions=[{desc:"close",range:[a.endIndex,a.endIndex],text:"-->"}],[a]}toString(t){return t?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"&lt;!--",post:this.closed?"--&gt;":""})}},wr=oe(Vi),ot=de(wr,0,"CommentToken",Di,ot),le(wr,1,ot)}}),$o={};ie($o,{CommentedToken:()=>ko});var ko,rd=C({"src/commented.ts"(){"use strict";V(),Ao(),ko=class extends z{get type(){return"ext-inner"}constructor(e,t,s=[]){if(super(void 0,t,s,{AstText:":",CommentToken:":"}),e){let n=e.indexOf("<!--"),a=n!==-1&&e.indexOf("-->",n+4),r=0;for(;a!==!1&&a!==-1;)n>r&&this.insertAt(e.slice(r,n)),this.insertAt(new ot(e.slice(n+4,a),!0,t,s)),r=a+3,n=e.indexOf("<!--",r),a=n!==-1&&e.indexOf("-->",n+4);r<e.length&&this.insertAt(e.slice(r))}}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*(?:\/\s*)?(hiero)\b/giu)}}}}),_o={};ie(_o,{NowikiToken:()=>To});var Qi,Ji,To,nd=C({"src/nowiki/index.ts"(){"use strict";var e,sn,s;xt(),X(),J(),Ke(),Qi=Ge(n=>new RegExp(String.raw`<\s*(?:/\s*)${n==="nowiki"?"":"?"}(${n})\b`,"giu")),Ji=new Set(["templatestyles","section","languages"]),To=(s=class extends Be{constructor(){super(...arguments);q(this,e)}get type(){return"ext-inner"}lint(a=this.getAbsoluteIndex()){const{name:r}=this,i="void-ext",o=W.lintConfig.getSeverity(i,r);if(o&&P(this,e,sn).call(this)){const l=Z(this,{start:a},i,W.msg("nothing should be in <$1>",r),o);return l.fix={desc:"empty",range:[a,l.endIndex],text:""},[l]}return super.lint(a,Qi(r))}getAttribute(a){return a==="invalid"?P(this,e,sn).call(this):super.getAttribute(a)}},e=new WeakSet,sn=function(){const{name:a,firstChild:{data:r}}=this;return Ji.has(a)&&!!r},s)}}),Xi,yr,Ki,lt,Io=C({"src/tagPair/ext.ts"(){"use strict";X(),ue(),J(),mn(),V(),xn(),yn(),Xi=[Ts()],lt=class extends(Ki=He){get type(){return"ext"}constructor(e,t,s,n,a=W.getConfig(),r=!1,i=[]){const o=e.toLowerCase(),l=new Is(!t||/^\s/u.test(t)?t:` ${t}`,"ext-attrs",o,a,i),d={...a,ext:a.ext.filter(c=>c!==o),excludes:[...a.excludes]};let h;switch(d.inExt=!0,o){case"tab":d.ext=d.ext.filter(c=>c!=="tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":case"langconvert":case"phonos":o==="poem"&&d.excludes.push("heading"),h=new z(s,d,i);break;case"pre":{const{PreToken:c}=(Vl(),Y(Za));h=new c(s,d,i);break}case"dynamicpagelist":{const{ParamTagToken:c}=(so(),Y(to));h=new c(r,s,d,i);break}case"inputbox":{const{InputboxToken:c}=(Yl(),Y(lo));h=new c(r,s,d,i);break}case"references":{const{NestedToken:c}=(cr(),Y(ws));d.excludes.push("heading"),h=new c(s,r,["ref"],d,i);break}case"choose":{const{NestedToken:c}=(cr(),Y(ws));h=new c(s,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],d,i);break}case"combobox":{const{NestedToken:c}=(cr(),Y(ws));h=new c(s,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],d,i);break}case"gallery":{const{GalleryToken:c}=(ed(),Y(vo));h=new c(s,d,i);break}case"imagemap":{const{ImagemapToken:c}=(sd(),Y(So));h=new c(s,d,i);break}case"hiero":{const{CommentedToken:c}=(rd(),Y($o));h=new c(s,d,i);break}default:{const{NowikiToken:c}=(nd(),Y(_o));h=new c(s,d,i)}}h.setAttribute("name",o),h.type==="plain"&&(h.type="ext-inner"),super(e,l,h,n,a,i),this.seal("closed",!0)}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),n=new he(this,e);if(this.name!=="nowiki"){const i=this.inHtmlAttrs();i&&s.push(Z(this,n,"parsing-order","extension tag in HTML tag attributes",i))}const a="var-anchor",r=W.lintConfig.getSeverity(a,"ref");return r&&this.name==="ref"&&this.closest("heading-title")&&s.push(Z(this,n,a,"variable anchor in a section header",r)),s}},yr=oe(Ki),lt=de(yr,0,"ExtToken",Xi,lt),le(yr,1,lt)}}),Co={};ie(Co,{parseCommentAndExt:()=>ss});var Sr,Yi,us,Zi,Ar,ss,Fs=C({"parser/commentAndExt.ts"(){"use strict";xt(),ce(),zl(),We(),Hl(),Gl(),Io(),Ao(),Sr="<onlyinclude>",Yi="</onlyinclude>",{length:us}=Sr,Zi=[!1,!0].map(e=>{const t=e?"includeonly":"(?:no|only)include",s=e?"noinclude":"includeonly";return Wa(n=>new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${t}(?:\s[^>]*)?/?>|</${t}\s*>|<(${n.join("|")})(\s[^>]*?)?(?:/>|>([\s\S]*?)</(\1\s*)>)|<(${s})(\s[^>]*?)?(?:/>|>([\s\S]*?)(?:</(${s}\s*)>|$))`,"giu"))}),Ar=e=>{const t=e.indexOf(Sr);return{i:t,j:e.indexOf(Yi,t+us)}},ss=(e,t,s,n)=>{if(n){let{i:o,j:l}=Ar(e);if(o!==-1&&l!==-1){let d="";const h=c=>{new pe(c,t,s),d+=`\0${s.length-1}n`};for(;o!==-1&&l!==-1;){const c=`\0${s.length}e`;new Rt(e.slice(o+us,l),t,s),o>0&&h(e.slice(0,o)),d+=c,e=e.slice(l+us+1),{i:o,j:l}=Ar(e)}return e&&h(e),d}}const{ext:a}=t,r=a.filter(o=>o!=="translate"&&o!=="tvar"),i={...t,ext:r};if(a.includes("translate")){const o=[];e=e.replace(/<nowiki>[\s\S]*?<\/nowiki>/giu,l=>(o.push(l),`\0${o.length-1}`)).replace(/<translate( nowrap)?>([\s\S]+?)?<\/translate>/gu,(l,d,h)=>{const c=s.length;return new Ja(d,h&&Le(h,o),i,s),`\0${c}g`}),e=Le(e,o)}return e.replace(Zi[n?1:0](r),(o,l,d,h,c,x,g,u,y)=>{const k=s.length;let $="n";if(l)$="e",new lt(l,d,h,c,i,x,s);else if(o.startsWith("<!--")){$="c";const T=o.endsWith("-->");new ot(o.slice(4,T?-3:void 0),T,t,s)}else x?new Pt(x,g,u,y,t,s):new pe(o,t,s);return`\0${k}${$}`})}}}),ea,ta,sa,ra,$r,na,Ut,id=C({"src/html.ts"(){"use strict";var e,t,s,n,a;X(),be(),ue(),mn(),V(),J(),ea=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),ta=new Set(["b","big","center","cite","code","del","dfn","em","font","i","ins","kbd","mark","pre","q","s","samp","small","strike","strong","sub","sup","tt","u","var"]),sa=new Set(["strike","big","center","font","tt"]),ra=[Ts()],Ut=(a=class extends(na=z){constructor(i,o,l,d,h,c){super(void 0,h,c);q(this,e);q(this,t);q(this,s);q(this,n);this.insertAt(o),this.setAttribute("name",i.toLowerCase()),j(this,e,l),j(this,t,d),j(this,s,i)}get type(){return"html"}get selfClosing(){return f(this,t)}get closing(){return f(this,e)}toString(i){return`<${this.closing?"/":""}${f(this,s)}${super.toString(i)}${f(this,t)?"/":""}>`}text(){const{closing:i}=this,o=f(this,s)+(i?"":super.text());return`<${i?"/":""}${o}${f(this,t)?"/":""}>`}getAttribute(i){return i==="invalid"?this.inTableAttrs()==="error":i==="padding"?f(this,s).length+(this.closing?2:1):super.getAttribute(i)}lint(i=this.getAbsoluteIndex(),o){const l=super.lint(i,o),{name:d,parentNode:h,closing:c,selfClosing:x}=this,g=new he(this,i),u=this.inTableAttrs();if(d==="h1"&&!c){const p=Z(this,g,"h1","<h1>");p.suggestions=[{desc:"h2",range:[i+2,i+3],text:"2"}],l.push(p)}if(u){const p=Z(this,g,"parsing-order","HTML tag in table attributes",u);u==="error"&&(p.fix={desc:"remove",range:[i,p.endIndex],text:""}),l.push(p)}sa.has(d)&&l.push(Z(this,g,"obsolete-tag","obsolete HTML tag","warning")),(d==="b"||d==="strong")&&this.closest("heading-title")&&l.push(Z(this,g,"bold-header","bold in section header","warning"));const{html:[,y,k]}=this.getAttribute("config"),$=k.includes(d),T=y.includes(d);if(c&&(x||$)||x&&(!$&&!T)){const p=Z(this,g,"unmatched-tag",c?"tag that is both closing and self-closing":"invalid self-closing tag"),b={desc:"open",range:[i+1,i+2],text:""},w={desc:"no self-closing",range:[p.endIndex-2,p.endIndex-1],text:""};T?p.suggestions=[b,w]:c?p.fix=$?b:w:p.suggestions=[w,{desc:"close",range:[p.endIndex-2,p.endIndex],text:`></${d}>`}],l.push(p)}else if(!this.findMatchingTag()){const p=Z(this,g,"unmatched-tag",c?"unmatched closing tag":"unclosed tag");if(c){const b=this.closest("magic-word");b&&ea.has(b.name)?p.severity="warning":p.suggestions=[{desc:"remove",range:[i,p.endIndex],text:""}]}else{const b=h==null?void 0:h.childNodes;ta.has(d)&&(b!=null&&b.slice(0,b.indexOf(this)).some(({type:w,name:v})=>w==="html"&&v===d))?p.suggestions=[{desc:"close",range:[i+1,i+1],text:"/"}]:this.closest("heading-title")||(p.severity="warning")}l.push(p)}return l}findMatchingTag(){return De(f(this,n),()=>{const{name:i,parentNode:o,closing:l,selfClosing:d}=this,{html:[,h,c]}=this.getAttribute("config"),x=c.includes(i),g=h.includes(i);if(x||g&&d)return this;if(!o)return;const{childNodes:u}=o,y=u.indexOf(this),k=l?u.slice(0,y).reverse():u.slice(y+1),$=[this],{rev:T}=me;for(const m of k)if(!(!m.is("html")||m.name!==i||g&&f(m,t)))if(f(m,e)===l)$.push(m);else{const p=$.pop();if(p===this)return m;W.viewOnly&&(j(p,n,[T,m]),j(m,n,[T,p]))}if(W.viewOnly)for(const m of $)j(m,n,[T,void 0])},i=>{j(this,n,i),i[1]&&i[1]!==this&&j(i[1],n,[me.rev,this])})}print(){return super.print({pre:`&lt;${this.closing?"/":""}${f(this,s)}`,post:`${f(this,t)?"/":""}&gt;`})}json(i,o=this.getAbsoluteIndex()){const l=super.json(void 0,o);return Object.assign(l,{closing:this.closing,selfClosing:f(this,t)}),l}},e=new WeakMap,t=new WeakMap,s=new WeakMap,n=new WeakMap,a),$r=oe(na),Ut=de($r,0,"HtmlToken",ra,Ut),le($r,1,Ut)}}),No={};ie(No,{parseHtml:()=>Fo});var ia,Fo,ad=C({"parser/html.ts"(){"use strict";yn(),id(),ia=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,Fo=(e,t,s)=>{var i;const{html:n}=t;(i=t.htmlElements)!=null||(t.htmlElements=new Set([...n[0],...n[1],...n[2]]));const a=e.split("<");let r=a.shift();for(const o of a){const l=ia.exec(o),d=l==null?void 0:l[2],h=d==null?void 0:d.toLowerCase();if(!l||!t.htmlElements.has(h)){r+=`<${o}`;continue}const[,c,,x="",g,u]=l,{length:y}=s,k=new Is(x,"html-attrs",h,t,s),$=k.hasAttr("itemprop");if(h==="meta"&&!($&&k.hasAttr("content"))||h==="link"&&!($&&k.hasAttr("href"))){r+=`<${o}`,s.length=y;continue}r+=`\0${s.length}x${u}`,new Ut(d,k,c==="/",g==="/>",t,s)}return r}}}),In,Lo=C({"src/table/base.ts"(){"use strict";mn(),V(),vt(),yn(),In=class extends Ts(1)(z){constructor(e,t,s,n,a,r=[],i){super(void 0,a,r,i),this.append(new Xe(t,"table-syntax",a,r),new Is(n,"table-attrs",s,a,r))}}}}),aa,kr,Ce,gs,It,Ct,As,jo=C({"src/table/td.ts"(){"use strict";X(),ue(),Ma(),V(),Lo(),As=class extends(kr=In,aa=[fn(!1)],kr){constructor(e,t,s,n=[]){var o;let a=/\||\0\d+!\x7F/u.exec(t!=null?t:""),r=a?t.slice(0,a.index):"";/\[\[|-\{/u.test(r)&&(a=null,r=""),super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",r,s,n),le(gs,5,this),Fe(this,It),Fe(this,Ce,""),a&&([Pl(this,Ce)._]=a);const i=new z(t==null?void 0:t.slice(((o=a==null?void 0:a.index)!=null?o:NaN)+ge(this,Ce).length),s,n);i.type="td-inner",i.setAttribute("stage",4),this.insertAt(i)}get type(){return"td"}get rowspan(){return this.getAttr("rowspan")}get colspan(){return this.getAttr("colspan")}get subtype(){return dt(this,It,Ct).call(this).subtype}afterBuild(){ge(this,Ce).includes("\0")&&ke(this,Ce,this.buildFromStr(ge(this,Ce),0)),super.afterBuild()}toString(e){const{childNodes:[t,s,n]}=this;return t.toString(e)+s.toString(e)+ge(this,Ce)+n.toString(e)}text(){const{childNodes:[e,t,s]}=this;return e.text()+t.text()+ge(this,Ce)+s.text()}getGaps(e){return e===1?ge(this,Ce).length:0}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),n=new he(this,e+this.getRelativeIndex(this.length-1));for(const a of this.lastChild.childNodes)if(a.type==="text"){const{data:r}=a;if(r.includes("|")){const i=r.includes("||"),o=Q(a,n,"pipe-like",'additional "|" in a table cell',i?"error":"warning");if(i){const l={caption:"|+",td:"|",th:"!"}[this.subtype];o.fix={desc:"newline",range:[o.startIndex,o.endIndex],text:r.replace(/\|\|/gu,`
14
- ${l}`)}}else o.suggestions=[{desc:"escape",range:[o.startIndex,o.endIndex],text:r.replace(/\|/gu,"&#124;")}];s.push(o)}}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}print(){const{childNodes:[e,t,s]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${ge(this,Ce)}${s.print()}</span>`}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t),{rowspan:n,colspan:a}=this;return Object.assign(s,{subtype:this.subtype},n!==1&&{rowspan:n},a!==1&&{colspan:a}),s}},gs=oe(kr),Ce=new WeakMap,It=new WeakSet,Ct=function(){var e;const t=this.firstChild.text(),s=t.slice(-1);let n="td";if(s==="!"?n="th":s==="+"&&(n="caption"),this.isIndependent())return{subtype:n};const{previousSibling:a}=this,r={...dt(e=a,It,Ct).call(e)};return r},Ct=de(gs,17,"#getSyntax",aa,It,Ct),cn(gs,As)}}),Cn,Ro=C({"src/table/trBase.ts"(){"use strict";X(),Lo(),jo(),Cn=class extends In{lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),n=this.childNodes.find(({type:i})=>i==="table-inter");if(!n)return s;const a=Dt(n);if(!a)return s;const r=Q(n,{start:e},"fostered-content","content to be moved out from the table",a);return r.startIndex++,r.startLine++,r.startCol=0,s.push(r),s}getRowCount(){return Number(this.childNodes.some(e=>e instanceof As&&e.isIndependent()&&!e.firstChild.text().endsWith("+")))}}}}),oa,la,da,Po,od=C({"src/table/index.ts"(){"use strict";X(),be(),ue(),J(),Ro(),vt(),oa=(e,t)=>new Array(e).fill(void 0).map((s,n)=>t(n)),la=({type:e})=>e==="tr"||e==="table-syntax",da=class extends Array{},Po=class extends Cn{get type(){return"table"}get closed(){return this.lastChild.is("table-syntax")}constructor(e,t,s,n){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,e,"table",t,s,n,{})}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),n=new he(this,e);this.closed||s.push(Q(this.firstChild,n,"unclosed-table",W.msg("unclosed $1","table")));const a=this.getLayout(),{length:r}=a;if(r>1){let i=1,o=1/0,l=0;for(;l<r;l++){const d=a[l],h=d.length;if(h<i)break;h<o&&(o=h);const c=d.indexOf(d[h-1])+1;if(c>o)break;c>i&&(i=c)}if(l<r){const d=Q(this.getNthRow(l),n,"table-layout","inconsistent table layout","warning");d.startIndex++,d.startLine++,d.startCol=0,s.push(d)}}return s}close(e=`
16
- |}`,t){const s=this.getAttribute("config"),n=this.getAttribute("accum"),a=[e];me.run(()=>{const r=new Xe(void 0,"table-syntax",s,n);super.insertAt(r)}),this.lastChild.safeReplaceChildren(a)}getLayout(e){const t=this.getAllRows(),{length:s}=t,n=da.from(oa(s,()=>[]));for(let a=0;a<n.length;a++){const r=n[a];let i=0,o=0,l;for(const d of t[a].childNodes.slice(2))if(d.is("td")){if(d.isIndependent()&&(l=d.subtype!=="caption"),l){const h={row:a,column:i},{rowspan:c,colspan:x}=d;for(i++;r[o];)o++;for(let g=a;g<Math.min(a+c,s);g++)for(let u=o;u<o+x;u++)n[g][u]=h;o+=x}}else if(la(d))break}return n}getAllRows(){return[...super.getRowCount()?[this]:[],...this.childNodes.slice(1).filter(e=>e.is("tr")&&e.getRowCount()>0)]}getNthRow(e,t,s){const n=super.getRowCount();if(e===0&&n)return this;n&&e--;for(const a of this.childNodes.slice(2)){const{type:r}=a;if(r==="tr"&&a.getRowCount()&&(e--,e<0))return a}}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t);return s.closed=this.closed,s}}}}),Eo,ld=C({"src/table/tr.ts"(){"use strict";Ro(),Eo=class extends Cn{get type(){return"tr"}constructor(e,t,s,n){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,e,"tr",t,s,n)}}}}),Nn,Oo=C({"src/nowiki/listBase.ts"(){"use strict";Ke(),Nn=class extends Be{get indent(){return this.innerText.split(":").length-1}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t),{indent:n}=this;return n&&(s.indent=n),s}}}}),Fn,qo=C({"src/nowiki/dd.ts"(){"use strict";Oo(),Fn=class extends Nn{get type(){return"dd"}}}}),Bo={};ie(Bo,{parseTable:()=>Wo});var ha,_r,Wo,dd=C({"parser/table.ts"(){"use strict";V(),od(),ld(),jo(),qo(),ha=e=>e.lastChild.constructor!==z,_r=(e,t)=>e.is("td")?t.pop():e,Wo=({firstChild:{data:e},type:t,name:s},n,a)=>{const r=[],i=e.split(`
17
- `);let o=t==="root"||t==="parameter-value"||t==="ext-inner"&&s==="poem"?"":`
18
- ${i.shift()}`,l;const d=(h,c)=>{if(!c){o+=h;return}const{lastChild:x}=c;if(ha(c)){const g=new z(h,n,a);g.type="table-inter",g.setAttribute("stage",3),c.insertAt(g)}else x.setText(x.toString()+h)};for(const h of i){l=r.pop();const[c]=/^(?:\s|\0\d+[cno]\x7F)*/u.exec(h),x=h.slice(c.length),g=/^(:*)((?:\s|\0\d+[cn]\x7F)*)(\{\||\{(?:\0\d+[cn]\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(x);if(g){for(;l&&!l.is("td");)l=r.pop();const[,m,p,b,w]=g;m&&new Fn(m,n,a),d(`
19
- ${c}${m&&`\0${a.length-1}d`}${p}\0${a.length}b`,l),r.push(...l?[l]:[],new Po(b,w,n,a));continue}else if(!l){o+=`
20
- ${h}`;continue}const u=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(x);if(!u){d(`
21
- ${h}`,l),r.push(l);continue}const[,y,k,$,T]=u;if(y){for(;!l.is("table");)l=r.pop();l.close(`
22
- ${c}${y}`,!0),d(T,r[r.length-1])}else if(k){l=_r(l,r),l.is("tr")&&(l=r.pop());const m=new Eo(`
23
- ${c}${k}`,T,n,a);r.push(l,m),l.insertAt(m)}else{l=_r(l,r);const m=$==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu;let p=m.exec(T),b=0,w=`
24
- ${c}${$}`;const v=A=>{const S=new As(w,T.slice(b,p==null?void 0:p.index),n,a);return A.insertAt(S),S};for(;p;)v(l),{lastIndex:b}=m,[w]=p,p=m.exec(T);r.push(l,v(l))}}return o.slice(1)}}}),Uo,hd=C({"src/nowiki/hr.ts"(){"use strict";Ke(),Uo=class extends Be{get type(){return"hr"}}}}),ca,Tr,ua,Mt,cd=C({"src/nowiki/doubleUnderscore.ts"(){"use strict";mt(),Oe(),Ke(),ca=[Je(),je("__")],Mt=class extends(ua=Be){get type(){return"double-underscore"}constructor(e,t,s,n){var o,l;super(e,s,n);const a=e.toLowerCase(),{doubleUnderscore:[,,r,i]}=s;this.setAttribute("name",(l=t?(o=i==null?void 0:i[e])==null?void 0:o.toLowerCase():r==null?void 0:r[a])!=null?l:a)}toString(){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}},Tr=oe(ua),Mt=de(Tr,0,"DoubleUnderscoreToken",ca,Mt),le(Tr,1,Mt)}}),Mo={};ie(Mo,{parseHrAndDoubleUnderscore:()=>zo});var zo,ud=C({"parser/hrAndDoubleUnderscore.ts"(){"use strict";hd(),cd(),ro(),zo=({firstChild:{data:e},type:t,name:s},n,a)=>{var l,d,h;const{doubleUnderscore:[r,i,o]}=n;return(l=n.insensitiveDoubleUnderscore)!=null||(n.insensitiveDoubleUnderscore=new Set(r)),(d=n.sensitiveDoubleUnderscore)!=null||(n.sensitiveDoubleUnderscore=new Set(i)),(h=n.regexHrAndDoubleUnderscore)!=null||(n.regexHrAndDoubleUnderscore=new RegExp(`__(${[...r,...i].join("|")})__`,"giu")),t!=="root"&&(t!=="ext-inner"||s!=="poem")&&(e=`\0${e}`),e=e.replace(/^((?:\0\d+[cno]\x7F)*)(-{4,})/gmu,(c,x,g)=>(new Uo(g,n,a),`${x}\0${a.length-1}r`)).replace(n.regexHrAndDoubleUnderscore,(c,x)=>{var k;const g=n.sensitiveDoubleUnderscore.has(x),u=x.toLowerCase(),y=n.insensitiveDoubleUnderscore.has(u);return g||y?(new Mt(x,g,n,a),`\0${a.length-1}${y&&((k=o==null?void 0:o[u])!=null?k:u)==="toc"?"u":"n"}`):c}).replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(c,x,g,u,y)=>{const k=`${x}\0${a.length}h`;return new An(g.length,[u,y],n,a),k}),t==="root"||t==="ext-inner"&&s==="poem"?e:e.slice(1)}}}),Ho,gd=C({"src/nowiki/quote.ts"(){"use strict";var e,t;X(),ue(),J(),Ke(),Ho=(t=class extends Be{constructor(n,a,r,i){super(n,r,i);q(this,e);j(this,e,a)}get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}get closing(){return{...this.bold?{bold:f(this,e).bold}:void 0,...this.italic?{italic:f(this,e).italic}:void 0}}text(){const{parentNode:n,innerText:a}=this;return n!=null&&n.is("image-parameter")&&n.name!=="caption"?"":a}lint(n=this.getAbsoluteIndex()){const{previousSibling:a,nextSibling:r,bold:i,closing:o}=this,l=(a==null?void 0:a.type)==="text"?a.data:void 0,d=(r==null?void 0:r.type)==="text"?r.data:void 0,h=W.msg('lonely "$1"',"'"),c=[],x=new he(this,n),g=(u,y,k)=>[{desc:"escape",range:[u,y],text:"&apos;".repeat(k)},{desc:"remove",range:[u,y],text:""}];if(l!=null&&l.endsWith("'")){const u=Z(this,x,"lonely-apos",h,(o.bold||o.italic)&&(/[a-z\d]'$/iu.test(l)||d&&/^[a-z\d]/iu.test(d))?"warning":"error"),{startIndex:y,startLine:k,startCol:$}=u,[,{length:T}]=/(?:^|[^'])('+)$/u.exec(l),m=n-T;c.push({...u,startIndex:m,endIndex:y,endLine:k,startCol:$-T,endCol:$,suggestions:g(m,y,T)})}if(d!=null&&d.startsWith("'")){const u=Z(this,x,"lonely-apos",h),{endIndex:y,endLine:k,endCol:$}=u,[{length:T}]=/^'+/u.exec(d),m=y+T;c.push({...u,startIndex:y,endIndex:m,startLine:k,startCol:$,endCol:$+T,suggestions:g(y,m,T)})}if(i&&this.closest("heading-title")){const u=Z(this,x,"bold-header","bold in section header","warning");u.suggestions=[{desc:"remove",range:[n,n+3],text:""}],c.push(u)}return c}json(n,a=this.getAbsoluteIndex()){const r=super.json(void 0,a);return Object.assign(r,{bold:this.bold,italic:this.italic}),r}},e=new WeakMap,t)}}),Go={};ie(Go,{parseQuotes:()=>Ln});var Ln,Do=C({"parser/quotes.ts"(){"use strict";gd(),Ln=(e,t,s,n)=>{var g;const a=e.split(/('{2,})/u),{length:r}=a;if(r===1)return e;let i=0,o=0,l,d,h;for(let u=1;u<r;u+=2){const y=a[u].length;switch(y){case 2:o++;break;case 4:a[u-1]+="'",a[u]="'''";case 3:if(i++,l!==void 0)break;a[u-1].endsWith(" ")?d===void 0&&h===void 0&&(h=u):a[u-1].slice(-2,-1)===" "?l=u:d!=null||(d=u);break;default:a[u-1]+="'".repeat(y-5),a[u]="'''''",o++,i++}}if(o%2===1&&i%2===1){const u=(g=l!=null?l:d)!=null?g:h;u!==void 0&&(a[u]="''",a[u-1]+="'")}let c=!0,x=!0;for(let u=1;u<r;u+=2){const y=a[u].length,k=y!==2,$=y!==3;k&&(c=!c),$&&(x=!x),new Ho(a[u],{bold:k&&c,italic:$&&x},t,s),a[u]=`\0${s.length-1}q`}return a.join("")}}}),Vo={};ie(Vo,{parseExternalLinks:()=>jn});var jn,Qo=C({"parser/externalLinks.ts"(){"use strict";ce(),yo(),Tn(),jn=(e,t,s,n)=>{var a;return(a=t.regexExternalLinks)!=null||(t.regexExternalLinks=new RegExp(String.raw`\[(\0\d+f\x7F|(?:(?:${t.protocol}|//)${ht}|\0\d+m\x7F)${ct}(?=[[\]<>"\t${Ee}]|\0\d))([${Ee}]*(?![${Ee}]))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),e.replace(t.regexExternalLinks,(r,i,o,l)=>{const{length:d}=s,h=/&[lg]t;/u.exec(i);return h&&(o="",l=i.slice(h.index)+o+l,i=i.slice(0,h.index)),n?(new es(i,"ext-link-url",t,s),`[\0${d}f${o}${l}]`):(new at(i,o,l,t,s),`\0${d}w`)})}}}),Jo,pd=C({"src/link/category.ts"(){"use strict";ce(),ks(),Jo=class extends Pe{get type(){return"category"}get sortkey(){const{childNodes:[,e]}=this;return e&&Kt(e.text())}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t),{sortkey:n}=this;return n&&(s.sortkey=n),s}}}}),Xo={};ie(Xo,{parseLinks:()=>rn});var ga,rn,fd=C({"parser/links.ts"(){"use strict";J(),Do(),Qo(),wo(),xo(),pd(),ga=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)([\s\S]*)$/u,rn=(e,t,s,n)=>{var o;(o=t.regexLinks)!=null||(t.regexLinks=new RegExp(String.raw`^\s*(?:${t.protocol}|//)`,"iu"));const a=t.inExt?/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]]))?\]\]([\s\S]*)$/u:/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]])?)?\]\]([\s\S]*)$/u,r=e.split("[[");let i=r.shift();for(let l=0;l<r.length;l++){let d=!1,h,c,x,g;const u=r[l],y=a.exec(u);if(y)[,h,c,x,g]=y,g.startsWith("]")&&(x!=null&&x.includes("["))&&(x+="]",g=g.slice(1));else{const p=ga.exec(u);p&&(d=!0,[,h,c,x]=p)}if(h===void 0||t.regexLinks.test(h)||/\0\d+[exhbru]\x7F/u.test(h)){i+=`[[${u}`;continue}const k=h.trim().startsWith(":");if(k&&d){i+=`[[${u}`;continue}const{ns:$,valid:T}=W.normalizeTitle(h,0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0});if(T){if(d){if($!==6){i+=`[[${u}`;continue}let p=!1;for(l++;l<r.length;l++){const b=r[l],w=b.split("]]");if(w.length>2){p=!0,x+=`[[${w[0]}]]${w[1]}`,g=w.slice(2).join("]]");break}else if(w.length===2)x+=`[[${w[0]}]]${w[1]}`;else{x+=`[[${b}`;break}}if(x=rn(x,t,s,n),!p){i+=`[[${h}${c}${x}`;continue}}}else{i+=`[[${u}`;continue}x&&(x=Ln(x,t,s,n));let m=_n;k||($===6?(x&&(x=jn(x,t,s,!0)),m=kn):$===14&&(m=Jo)),x===void 0&&c&&(x=""),i+=`\0${s.length}l${g}`,new m(h,x,t,s,c)}return i}}}),Ko={};ie(Ko,{parseMagicLinks:()=>Yo});var Ir,Cr,Nr,Fr,Yo,xd=C({"parser/magicLinks.ts"(){"use strict";ce(),Tn(),Ir=String.raw`[${Ee}\t]|&nbsp;|&#0*160;|&#x0*a0;`,Cr=`(?:${Ir})+`,Nr=`(?:${Ir}|-)`,Fr=String.raw`(?:RFC|PMID)${Cr}\d+\b|ISBN${Cr}(?:97[89]${Nr}?)?(?:\d${Nr}?){9}[\dx]\b`,Yo=(e,t,s)=>{if(!t.regexMagicLinks)try{t.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${t.protocol})(${ht}${ct})|${Fr})`,"giu")}catch{t.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${t.protocol})(${ht}${ct})|${Fr})`,"giu")}return e.replace(t.regexMagicLinks,(n,a,r)=>{let i=a?n.slice(a.length):n;if(r){let o="";const l=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(i);l&&(o=i.slice(l.index),i=i.slice(0,l.index));const d=i.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,h=d.exec(i);if(h){let c=1;h[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(i.slice(0,h.index))&&(c=2),o=i.slice(h.index+c)+o,i=i.slice(0,h.index+c)}return o.length>=r.length?n:(new es(i,void 0,t,s),`${a}\0${s.length-1}w${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(i))return n;return new es(i,"magic-link",t,s),`${a}\0${s.length-1}i`})}}}),Zo,md=C({"util/html.ts"(){"use strict";Zo=(e,t)=>e.startsWith(t)?t.length:[...t].findIndex((s,n)=>s!==e[n])}}),el,vd=C({"src/nowiki/list.ts"(){"use strict";Oo(),el=class extends Nn{get type(){return"list"}}}}),tl={};ie(tl,{parseList:()=>sl});var sl,bd=C({"parser/list.ts"(){"use strict";md(),vd(),qo(),sl=(e,t,s,n)=>{const a=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(e);if(!a)return t.lastPrefix="",e;const[r,i,o,l]=a,d=o.replace(/;/gu,":"),h=Zo(d,t.lastPrefix),c=((h>1?o.slice(h-1):o)+l).split(/(?=;)/u),x=c[0].startsWith(";");let g=c.length-(x?0:1);if(h>1){const _=o.slice(0,h-1);if(x){const E=_.split(/(?=;)/u);c.unshift(...E),g+=_.includes(";")?E.length:0}else c[0]=_+c[0]}t.lastPrefix=d;let u=i+c.map((_,E)=>`\0${n.length+E}d`).join("")+e.slice(r.length);for(const _ of c)new el(_,s,n);if(!g)return u;const{html:[y,,k]}=s,$=/:+|-\{|\0\d+[xq]\x7F/gu;let T=$,m=T.exec(u),p=0,b=!1,w=!1,v=0;const A=(_,E)=>(new Fn(_,s,n),`${u.slice(0,E)}\0${n.length-1}d${u.slice(E+_.length)}`),S=_=>{_?p&&p--:p++};for(;m&&g;){const{0:_,index:E}=m;if(_==="-{"){if(!v){const{lastIndex:F}=T;T=/-\{|\}-/gu,T.lastIndex=F}v++}else if(_==="}-"){if(v--,!v){const{lastIndex:F}=T;T=$,T.lastIndex=F}}else if(_.endsWith("x")){const{name:F,closing:N,selfClosing:O}=n[Number(_.slice(1,-2))];(y.includes(F)||!O&&!k.includes(F))&&S(N)}else if(_.endsWith("q")){const{bold:F,italic:N}=n[Number(_.slice(1,-2))];F&&(S(b),b=!b),N&&(S(w),w=!w)}else if(p===0){if(_.length>=g)return A(_.slice(0,g),E);g-=_.length,T.lastIndex=E+4+String(n.length).length,u=A(_,E)}m=T.exec(u)}return u}}}),ps,pa,Lr,fa,zt,wd=C({"src/converterFlags.ts"(){"use strict";var e,t;X(),ue(),_s(),J(),V(),qe(),ps=new Set(["A","T","R","D","-","H","N"]),pa=[ts()],zt=(t=class extends(fa=z){constructor(n,a,r=[]){super(void 0,a,r,{});q(this,e);this.safeAppend(n.map(i=>new ve(i,"converter-flag",a,r)))}get type(){return"converter-flags"}afterBuild(){j(this,e,this.childNodes.map(n=>n.text().trim())),super.afterBuild()}toString(n){return super.toString(n,";")}text(){return super.text(";")}getUnknownFlags(){return new Set(f(this,e).filter(n=>/\{{3}[^{}]+\}{3}/u.test(n)))}getVariantFlags(){const n=new Set(this.getAttribute("config").variants);return new Set(f(this,e).filter(a=>n.has(a)))}isInvalidFlag(n,a,r,i){return typeof n=="object"&&(n=n.text().trim(),a=this.getVariantFlags(),r=this.getUnknownFlags(),i=new Set(f(this,e).filter(o=>ps.has(o)))),!!n&&!a.has(n)&&!r.has(n)&&(a.size>0||!i.has(n))}lint(n=this.getAbsoluteIndex(),a){const r=this.getVariantFlags(),i=this.getUnknownFlags(),o=new Set(f(this,e).filter(g=>ps.has(g))),l=f(this,e).filter(g=>!g).length,d=f(this,e).length-i.size-l,h=super.lint(n,a);if(r.size===d||o.size===d)return h;const c="no-ignored",x=W.lintConfig.getSeverity(c,"conversionFlag");if(x){const g=new he(this,n);for(let u=0;u<this.length;u++){const y=this.childNodes[u],k=y.text().trim();if(this.isInvalidFlag(k,r,i,o)){const $=Q(y,g,c,"invalid conversion flag",x);r.size===0&&ps.has(k.toUpperCase())?$.fix={desc:"uppercase",range:[$.startIndex,$.endIndex],text:k.toUpperCase()}:$.suggestions=[{desc:"remove",range:[$.startIndex-(u&&1),$.endIndex],text:""}],h.push($)}}}return h}print(){return super.print({sep:";"})}},e=new WeakMap,t),Lr=oe(fa),zt=de(Lr,0,"ConverterFlagsToken",pa,zt),le(Lr,1,zt)}}),ys,yd=C({"src/converterRule.ts"(){"use strict";J(),V(),qe(),ys=class extends z{get type(){return"converter-rule"}get variant(){var e,t;return(t=(e=this.childNodes[this.length-2])==null?void 0:e.text().trim())!=null?t:""}constructor(e,t=!0,s=W.getConfig(),n=[]){super(void 0,s,n);const a=e.indexOf(":"),r=e.slice(0,a).indexOf("=>"),i=r===-1?e.slice(0,a):e.slice(r+2,a);t&&s.variants.includes(i.trim())?(super.insertAt(new ve(i,"converter-rule-variant",s,n)),super.insertAt(new ve(e.slice(a+1),"converter-rule-to",s,n)),r!==-1&&super.insertAt(new ve(e.slice(0,r),"converter-rule-from",s,n),0)):super.insertAt(new ve(e,"converter-rule-to",s,n))}toString(e){const{childNodes:t,firstChild:s,lastChild:n}=this;return t.length===3?`${s.toString(e)}=>${t[1].toString(e)}:${n.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,n]=e;return`<span class="wpb-converter-rule">${t.print()}=>${s.print()}:${n.print()}</span>`}return super.print({sep:":"})}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t);return s.variant=this.variant,s}}}}),xa,jr,ma,Ht,Sd=C({"src/converter.ts"(){"use strict";ce(),Oe(),V(),wd(),yd(),xa=[je("-{")],Ht=class extends(ma=z){get type(){return"converter"}constructor(e,t,s,n=[]){super(void 0,s,n),this.insertAt(new zt(e,s,n));const[a]=t,r=a.includes(":"),i=new ys(a,r,s,n);r&&i.length===1||!r&&t.length===2&&!_e(t[1]).trim()?this.insertAt(new ys(t.join(";"),!1,s,n)):this.append(i,...t.slice(1).map(o=>new ys(o,!0,s,n)))}toString(e){const{childNodes:[t,...s]}=this;return`-{${t.toString(e)}${t.length>0?"|":""}${s.map(n=>n.toString(e)).join(";")}}-`}text(){const{childNodes:[e,...t]}=this;return`-{${e.text()}|${Ve(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?"|":""}${gt(t,{sep:";"})}}-</span>`}},jr=oe(ma),Ht=de(jr,0,"ConverterToken",xa,Ht),le(jr,1,Ht)}}),rl={};ie(rl,{parseConverter:()=>nl});var nl,Ad=C({"parser/converter.ts"(){"use strict";Sd(),nl=(e,t,s)=>{var l;(l=t.regexConverter)!=null||(t.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${t.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"u"));const n=/-\{/gu,a=/-\{|\}-/gu,r=[];let i=n,o=i.exec(e);for(;o;){const{0:d,index:h}=o;if(d==="}-"){const c=r.pop(),{length:x}=s,g=e.slice(c.index+2,h),u=g.indexOf("|"),[y,k]=u===-1?[[],g]:[g.slice(0,u).split(";"),g.slice(u+1)],$=k.replace(/(&[#a-z\d]+);/giu,"$1"),T=$.split(t.regexConverter).map(m=>m.replace(/\x01/gu,";"));new Ht(y,T,t,s),e=`${e.slice(0,c.index)}\0${x}v${e.slice(h+2)}`,r.length===0&&(i=n),i.lastIndex=c.index+3+String(x).length}else r.push(o),i=a,i.lastIndex=h+2;o=i.exec(e)}return e}}}),Qt={};ie(Qt,{Token:()=>z});var va,z,V=C({"src/index.ts"(){"use strict";var e,t,s,n,a,r,i,o,il,al,ol,ll,dl,hl,cl,ul,gl,pl,fl,xl,p;ce(),Qe(),X(),be(),J(),ql(),Bl(),va=["category","html-attr#id,ext-attr#id,table-attr#id"],z=(p=class extends Ha{constructor(v,A=W.getConfig(),S=[],_){super();q(this,o);q(this,e,"plain");q(this,t,0);q(this,s);q(this,n);q(this,a);q(this,r,!1);q(this,i);typeof v=="string"&&this.insertAt(v),j(this,s,A),j(this,n,S),S.push(this)}get type(){return f(this,e)}set type(v){j(this,e,v)}parseOnce(v=f(this,t),A=!1,S){if(v<f(this,t)||this.length===0||!this.isPlain())return this;if(f(this,t)>=we)return this;switch(v){case 0:if(this.type==="root"){f(this,n).pop();const _=P(this,o,il).call(this);A&&(A=!_)}j(this,a,A),P(this,o,al).call(this,A);break;case 1:P(this,o,ol).call(this);break;case 2:P(this,o,ll).call(this);break;case 3:P(this,o,dl).call(this);break;case 4:P(this,o,hl).call(this);break;case 5:P(this,o,cl).call(this,S);break;case 6:P(this,o,ul).call(this,S);break;case 7:P(this,o,gl).call(this);break;case 8:P(this,o,pl).call(this);break;case 9:P(this,o,fl).call(this);break;case 10:P(this,o,xl).call(this)}if(this.type==="root")for(const _ of f(this,n))_==null||_.parseOnce(v,A,S);return En(this,t)._++,this}buildFromStr(v,A){const S=v.split(/[\0\x7F]/u).map((_,E)=>{if(E%2===0)return new Jr(_);if(isNaN(_.slice(-1)))return f(this,n)[Number(_.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${_}`)});return A===0?S.map(String).join(""):A===1?Ve(S):S}build(){j(this,t,we);const{length:v,firstChild:A}=this,S=A==null?void 0:A.toString();if(v===1&&A.type==="text"&&S.includes("\0")&&($s(this,0,1,this.buildFromStr(S)),this.normalize(),this.type==="root"))for(const _ of f(this,n))_==null||_.build()}afterBuild(){if(this.type==="root")for(const v of f(this,n))v==null||v.afterBuild();j(this,r,!0)}parse(v=we,A,S){for(v=Math.min(v,we);f(this,t)<v;)this.parseOnce(f(this,t),A,S);return v&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===p}getAttribute(v){var A;switch(v){case"config":return f(this,s);case"include":return(A=f(this,a))!=null?A:!!f(this.getRootNode(),a);case"accum":return f(this,n);case"built":return f(this,r);case"stage":return f(this,t);case"invalid":return this.type==="table-inter"&&Dt(this)==="error";default:return super.getAttribute(v)}}setAttribute(v,A){switch(v){case"stage":f(this,t)===0&&this.type==="root"&&f(this,n).shift(),j(this,t,A);break;default:super.setAttribute(v,A)}}insertAt(v,A=this.length){const S=typeof v=="string"?new Jr(v):v;super.insertAt(S,A);const{type:_}=S;return _==="root"&&(S.type="plain"),S}normalizeTitle(v,A=0,S){return W.normalizeTitle(v,A,f(this,a),f(this,s),S)}inTableAttrs(){var v,A;return((v=this.closest("table-attrs,ext"))==null?void 0:v.type)==="table-attrs"&&((A=this.closest("table-attrs,arg,magic-word,template"))!=null&&A.is("table-attrs")?"error":"warning")}inHtmlAttrs(){var v;return(v=this.closest("html-attrs,ext"))!=null&&v.is("html-attrs")?"error":this.inTableAttrs()}lint(v=this.getAbsoluteIndex(),A){var _;let S=super.lint(v,A);if(this.type==="root"){const E=new Map,F="no-duplicate",N=["category","id"].map(B=>W.lintConfig.getSeverity(F,B)),O=va.filter((B,M)=>N[M]).join();if(O){for(const B of this.querySelectorAll(O)){let M;if(B.is("category"))M=B.name;else{const H=B.getValue();H&&H!==!0&&(M=`#${H}`)}if(M){const H=E.get(M);H?H.add(B):E.set(M,new Set([B]))}}for(const[B,M]of E)if(M.size>1&&!B.startsWith("#mw-customcollapsible-")){const H=!B.startsWith("#"),G=`duplicated ${H?"category":"id"}`,K=N[H?0:1];S.push(...[...M].map(se=>{const re=Z(se,{start:se.getAbsoluteIndex()},F,G,K);return H&&(re.suggestions=[{desc:"remove",range:[re.startIndex,re.endIndex],text:""}]),re}))}}const R=/<!--\s*lint-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->/gu,L=this.toString(),U=[];let I=R.exec(L);for(;I;){const{1:B,index:M}=I,H=(_=I[2])==null?void 0:_.trim();U.push({line:this.posFromIndex(M).top+(B==="disable-line"?0:1),from:B==="disable"?R.lastIndex:void 0,to:B==="enable"?R.lastIndex:void 0,rules:H?new Set(H.split(",").map(G=>G.trim())):void 0}),I=R.exec(L)}if(S=S.filter(({rule:B,startLine:M,startIndex:H})=>{const G={pos:0};for(const{line:K,from:se,to:re,rules:Ne}of U){if(K>M+1)break;if(Ne&&!Ne.has(B))continue;if(K===M&&se===void 0&&re===void 0)return!1;se<=H&&se>G.pos?(G.pos=se,G.type="from"):re<=H&&re>G.pos&&(G.pos=re,G.type="to")}return G.type!=="from"}),S.some(({fix:B})=>B)){const B=S.map(({fix:G})=>G).filter(Boolean).sort(({range:[G,K]},{range:[se,re]})=>K===re?se-G:re-K);let M=1/0,H=L;for(const{range:[G,K],text:se}of B)K<=M&&(H=H.slice(0,G)+se+H.slice(K),M=G);Object.assign(S,{output:H})}}return S}toString(v,A){return v?super.toString(!0,A):De(f(this,i),()=>super.toString(!1,A),S=>{const _=this.getRootNode();_.type==="root"&&f(_,r)&&j(this,i,S)})}},e=new WeakMap,t=new WeakMap,s=new WeakMap,n=new WeakMap,a=new WeakMap,r=new WeakMap,i=new WeakMap,o=new WeakSet,il=function(){const{parseRedirect:v}=(Ml(),Y(Va)),A=this.firstChild.toString(),S=v(A,f(this,s),f(this,n));return S&&this.setText(S),!!S},al=function(v){const{parseCommentAndExt:A}=(Fs(),Y(Co));this.setText(A(this.firstChild.toString(),f(this,s),f(this,n),v))},ol=function(){const{parseBraces:v}=($n(),Y(oo)),A=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,S=v(A,f(this,s),f(this,n));this.setText(this.type==="root"?S:S.slice(1))},ll=function(){if(f(this,s).excludes.includes("html"))return;const{parseHtml:v}=(ad(),Y(No));this.setText(v(this.firstChild.toString(),f(this,s),f(this,n)))},dl=function(){if(f(this,s).excludes.includes("table"))return;const{parseTable:v}=(dd(),Y(Bo));this.setText(v(this,f(this,s),f(this,n)))},hl=function(){if(f(this,s).excludes.includes("hr"))return;const{parseHrAndDoubleUnderscore:v}=(ud(),Y(Mo));this.setText(v(this,f(this,s),f(this,n)))},cl=function(v){const{parseLinks:A}=(fd(),Y(Xo));this.setText(A(this.firstChild.toString(),f(this,s),f(this,n),v))},ul=function(v){if(f(this,s).excludes.includes("quote"))return;const{parseQuotes:A}=(Do(),Y(Go)),S=this.firstChild.toString().split(`
25
- `);for(let _=0;_<S.length;_++)S[_]=A(S[_],f(this,s),f(this,n),v);this.setText(S.join(`
26
- `))},gl=function(){if(f(this,s).excludes.includes("extLink"))return;const{parseExternalLinks:v}=(Qo(),Y(Vo));this.setText(v(this.firstChild.toString(),f(this,s),f(this,n)))},pl=function(){if(f(this,s).excludes.includes("magicLink"))return;const{parseMagicLinks:v}=(xd(),Y(Ko));this.setText(v(this.firstChild.toString(),f(this,s),f(this,n)))},fl=function(){if(f(this,s).excludes.includes("list"))return;const{parseList:v}=(bd(),Y(tl)),{firstChild:A,type:S,name:_}=this,E=A.toString().split(`
27
- `),F={lastPrefix:""};let N=S==="root"||S==="ext-inner"&&_==="poem"?0:1;for(;N<E.length;N++)E[N]=v(E[N],F,f(this,s),f(this,n));this.setText(E.join(`
28
- `))},xl=function(){if(f(this,s).variants.length>0){const{parseConverter:v}=(Ad(),Y(rl));this.setText(v(this.firstChild.toString(),f(this,s),f(this,n)))}},p)}}),me,Ls,$s,bt,be=C({"util/debug.ts"(){"use strict";me={running:!1,run(e){const{running:t}=this;this.running=!0;try{const{Token:s}=(V(),Y(Qt)),n=e();return n instanceof s&&!n.getAttribute("built")&&n.afterBuild(),this.running=t,n}catch(s){throw this.running=t,s}},rev:0},Ls=e=>t=>t.type===e,$s=(e,t,s,n=[])=>{var i,o;let a=e.getChildNodes(),r;a.length===s?(r=a,a=n):r=a.splice(t,s,...n);for(let l=0;l<n.length;l++){const d=n[l];d.setAttribute("parentNode",e),d.setAttribute("nextSibling",a[t+l+1]),d.setAttribute("previousSibling",a[t+l-1])}return(i=a[t-1])==null||i.setAttribute("nextSibling",a[t]),(o=a[t+n.length])==null||o.setAttribute("previousSibling",a[t+n.length-1]),a===n&&e.setAttribute("childNodes",a),r},bt=(e,t)=>{Object.defineProperty(e,"name",{value:t.name})}}}),ba,Nt,Rr,Pr,wa,Er,ya,nn,$d=C({"lib/lintConfig.ts"(){"use strict";Oa(),ba=new Set([0,1,2]),Nt=new Map([[0,!1],[1,"warning"],[2,"error"]]),Rr={"format-leakage":[2,{}],h1:[1,{}],"invalid-gallery":[2,{}],"invalid-imagemap":[2,{}],"nested-link":[2,{}],"no-duplicate":[2,{id:1}],"no-ignored":[2,{include:1,redirect:1}],"unbalanced-header":2,"unclosed-comment":[1,{}],unescaped:2,"url-encoding":[1,{}],"var-anchor":[1,{}],"void-ext":[2,{}]},Object.freeze(Rr),Pr=e=>typeof e=="number"&&ba.has(e),wa=e=>Pr(e)||Array.isArray(e)&&e.length===2&&Pr(e[0])&&e[1]&&typeof e[1]=="object",Er=(e,t,s)=>{if(gn.includes(t)){if(wa(s))return e[t]=s,!0}else throw new RangeError(`Unknown lint rule: ${t}`);throw new RangeError(`Invalid lint config for ${t}: ${JSON.stringify(s)}`)},ya=class{constructor(e){if(Object.assign(this,JSON.parse(JSON.stringify(Rr))),!!e)for(const[t,s]of Object.entries(e))Er(this,t,s)}getSeverity(e,t){var n;const s=this[e];return typeof s=="number"?Nt.get(s):t&&(n=Nt.get(s[1][t]))!=null?n:Nt.get(s[0])}},nn=e=>new Proxy(new ya(e),{set:Er})}}),ml={};ie(ml,{Title:()=>vl});var vl,kd=C({"lib/title.ts"(){"use strict";var e,t,s,n,a,r;ce(),vl=(r=class{constructor(i,o,l,{temporary:d,decode:h,selfLink:c}={}){q(this,e);q(this,t);q(this,s);q(this,n);q(this,a);Ae(this,"valid");Ae(this,"encoded",!1);const x=i.trim().startsWith("../");if(h&&i.includes("%"))try{const u=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(i);i=Jt(i),this.encoded=u}catch{}if(i=Kt(i).replace(/[_ ]+/gu," ").trim(),x)j(this,n,0);else{let u=o;i.startsWith(":")&&(u=0,i=i.slice(1).trim());const y=i.split(":");if(y.length>1){const k=ut(y[0]),$=Object.prototype.hasOwnProperty.call(l.nsid,k)&&l.nsid[k];$&&(u=$,i=y.slice(1).join(":").trim())}j(this,n,u)}const g=i.indexOf("#");if(g!==-1){let u=i.slice(g).trim().slice(1);if(u.includes("%"))try{u=Jt(u)}catch{}j(this,a,u.replace(/ /gu,"_")),i=i.slice(0,g).trim()}this.valid=!!(i||c&&this.ns===0&&f(this,a)!==void 0)&&Kt(i)===i&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(x?/^(?:\.\.\/)+(.*)/u.exec(i)[1]:i),this.main=i,j(this,t,l.namespaces),j(this,s,l.articlePath||"/wiki/$1"),f(this,s).includes("$1")||j(this,s,f(this,s)+`${f(this,s).endsWith("/")?"":"/"}$1`),d||Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}})}get ns(){return f(this,n)}get fragment(){return f(this,a)}get main(){return f(this,e)}set main(i){i=i.replace(/_/gu," ").trim(),j(this,e,i&&i[0].toUpperCase()+i.slice(1))}get prefix(){const i=f(this,t)[this.ns];return i+(i&&":")}get title(){return this.getRedirection()[1]}get extension(){const{main:i}=this,o=i.lastIndexOf(".");return o===-1?void 0:i.slice(o+1).toLowerCase()}getRedirection(){return[!1,(this.prefix+this.main).replace(/ /gu,"_")]}setFragment(i){j(this,a,i)}getUrl(i){{typeof i=="string"&&(j(this,s,i),f(this,s).includes("$1")||j(this,s,f(this,s)+`${f(this,s).endsWith("/")?"":"/"}$1`));const{title:o,fragment:l}=this;return o?f(this,s).replace("$1",encodeURIComponent(o)+(l?`#${encodeURIComponent(l)}`:"")):l===void 0?"":`#${encodeURIComponent(l)}`}throw new Error("Title.getUrl method is only available in the LSP version!")}},e=new WeakMap,t=new WeakMap,s=new WeakMap,n=new WeakMap,a=new WeakMap,r)}}),bl={};ie(bl,{LanguageService:()=>wl,isAttr:()=>Ss,tasks:()=>an});var an,Sa,Aa,$a,ka,Or,_a,Ta,Ia,Ca,Ss,Na,qr,Ze,Br,Me,xe,Wr,Ur,et,tt,ze,Ft,Mr,wl,_d=C({"lib/lsp.ts"(){"use strict";var e,t,s,n,a,r,i,o,l,d,Gt,$e,on,yl,ln,Sl,dn,st,T;xt(),Ya(),X(),ce(),J(),an=new WeakMap,Sa=new Set(["ref"]),Aa=new Set(["ref","references"]),$a=new Set(["name","extends","follow"]),ka=new Set(["group"]),Or=new Set(["arg-name","template-name","link-target","parameter-key"]),_a=new Set(["ext","html","attr-key","image-parameter","heading-title","heading","magic-word-name",...Or]),Ta=new Set(["text","comment","noinclude","include"]),Ia=["ext","html","table"].map(m=>`${m}-attr#style`).join(),Ca=Ge(m=>new RegExp(`^(?:${m}|//)`,"iu")),Ss=({type:m,parentNode:p,length:b,firstChild:w},v)=>m==="attr-value"&&b===1&&w.type==="text"&&(!v||p.name==="style"),Na=m=>m.is("html-attr")||m.is("table-attr"),qr=m=>m.childNodes.every(({type:p})=>Ta.has(p)),Ze=(m,p)=>{const{top:b,left:w}=m.posFromIndex(p);return{line:b,character:w}},Br=(m,p,b)=>({start:Ze(m,p),end:Ze(m,b)}),Me=m=>{const{top:p,left:b,height:w,width:v}=m.getBoundingClientRect();return{start:{line:p,character:b},end:Zt(p,b,w,v)}},xe=(m,p,b,{line:w,character:v},A,S)=>[...new Set(m)].map(_=>{var F;const E=(F=S==null?void 0:S(_))==null?void 0:F.description;return{label:_,kind:p,textEdit:{range:{start:{line:w,character:v-b.length},end:{line:w,character:v}},newText:_+(A!=null?A:"")},...E&&{documentation:{kind:"markdown",value:E}}}}),Wr=(m,p,{line:b,character:w})=>{const v=m.indexFromPos(b,w);return m.caretPositionFromIndex(v+Number(/\w/u.test(p.charAt(v))))},Ur=(m,p,b)=>{const{type:w,parentNode:v={}}=m,{name:A,tag:S}=v;return w==="attr-value"&&p.has(S)&&b.has(A)?m.toString().trim():NaN},et=m=>Ur(m,Sa,$a),tt=m=>Ur(m,Aa,ka),ze=(m,p)=>{const b=m==null?void 0:m.getAttr(p);return b!==!0&&b||!1},Ft=m=>{const{type:p,name:b,parentNode:w}=m;switch(p){case"heading":return m.level;case"heading-title":return w.level;case"parameter-key":return`${w.parentNode.name}|${w.name}`;case"ext":case"html":case"image-parameter":return b;default:return w.name}},Mr=(m,p,b=!1)=>({range:Br(m,...p.range),newText:p.text,title:`${b?"Fix":"Suggestion"}: ${p.desc}`,fix:b}),wl=(T=class{constructor(m){q(this,d);q(this,e);q(this,t);q(this,s);q(this,n);q(this,a);q(this,r);q(this,i);q(this,o);q(this,l);Ae(this,"include",!0);Ae(this,"config");Ae(this,"data");an.set(m,this),Object.defineProperties(this,{config:{enumerable:!1},data:{enumerable:!1}})}destroy(){Object.setPrototypeOf(this,null)}async provideDocumentColors(m,p,b=!0){const w=await P(this,d,$e).call(this,p);return w.querySelectorAll("attr-value,parameter-value,arg-default").reverse().flatMap(v=>{const{type:A,childNodes:S}=v;return A!=="attr-value"&&!qr(v)?[]:S.filter(_=>_.type==="text").reverse().flatMap(_=>{const{data:E}=_,F=Ba(E,b).filter(([,,,O])=>O);if(F.length===0)return[];const N=_.getAbsoluteIndex();return F.map(([O,R,L])=>{const U=m(O);return U.length===4&&{color:{red:U[0]/255,green:U[1]/255,blue:U[2]/255,alpha:U[3]},range:Br(w,N+R,N+L)}}).filter(Boolean)})})}provideColorPresentations(m){const{color:{red:p,green:b,blue:w,alpha:v},range:A}=m,S=[p,b,w],_=v<1?`rgba(${S.map(E=>Math.round(E*255)).join()},${v})`:`#${S.map(qa).join("")}`;return[{label:_,textEdit:{range:A,newText:_}}]}async provideCompletionItems(m,p){var K,se,re,Ne,js,wt,yt;const{re:b,allTags:w,functions:v,switches:A,protocols:S,params:_,tags:E,ext:F}=P(this,d,Sl).call(this),{line:N,character:O}=p,R=m.split(/\r?\n/u,N+1)[N],L=b.exec((K=R==null?void 0:R.slice(0,O))!=null?K:""),[,,U={},I={}]=this.config.doubleUnderscore;if((L==null?void 0:L[1])!==void 0){const D=L[1].startsWith("/");return xe(w,"Class",L[1].slice(D?1:0),p,D&&!(R!=null&&R.slice(O).trim().startsWith(">"))?">":"")}else{if(L!=null&&L[4])return xe(A,"Constant",L[4],p,"",D=>{if(this.data)return D=D.slice(2,-2),D in U?D=U[D]:D in I&&(D=I[D]),P(this,d,dn).call(this,D.toLowerCase())});if((L==null?void 0:L[5])!==void 0)return xe(S,"Reference",L[5],p)}const B=await P(this,d,$e).call(this,m);let M;if(L!=null&&L[2]){M=B.elementFromPoint(L.index+L[2].length-1,N);const D=(se=L[3])!=null?se:"";if(L[2]==="{{{")return xe(B.querySelectorAll("arg").filter(ee=>ee.name&&ee!==M).map(({name:ee})=>ee),"Variable",D,p);const[ne,te]=this.config.parserFunction,fe=Array.isArray(te),ye=R.charAt(O),Se=D.startsWith(":"),Te=Se?D.slice(1).trimStart():D;if(L[2]==="[[")return xe(B.querySelectorAll("link,file,category,redirect-target").filter(ee=>ee!==M).map(({name:ee})=>ee),"Folder",Te,p);let Rs=v;return ye===":"?Rs=v.filter(ee=>!ee.endsWith(":")):ye===":"&&(Rs=v.filter(ee=>ee.endsWith(":")).map(ee=>ee.slice(0,-1))),[...xe(Rs,"Function",D,p,"",ee=>{if(this.data)ee in ne?ee=ne[ee]:!fe&&ee in te&&(ee=te[ee]);else return;return P(this,d,st).call(this,ee.toLowerCase())}),...D.startsWith("#")?[]:xe(B.querySelectorAll("template").filter(ee=>ee!==M).map(ee=>{const{name:rs}=ee;if(Se)return rs;const{ns:Rn}=ee.getAttribute("title");return Rn===0?`:${rs}`:Rn===10?rs.slice(9):rs}),"Folder",Te,p)]}let H,G;if((L==null?void 0:L[7])===void 0&&(M=B.elementFromPoint(O,N),{type:H,parentNode:G}=M),(L==null?void 0:L[6])!==void 0||H==="image-parameter"){const D=B.indexFromPos(N,O),ne=(Ne=(re=L==null?void 0:L[6])==null?void 0:re.trimStart())!=null?Ne:f(this,e).slice(M.getAbsoluteIndex(),D).trimStart(),te=f(this,e)[D]==="=";return[...xe(_,"Property",ne,p).filter(({label:fe})=>!te||!/[= ]$/u.test(fe)),...xe(B.querySelectorAll("image-parameter#width").filter(fe=>fe!==M).map(fe=>fe.text()),"Unit",ne,p)]}else if((L==null?void 0:L[7])!==void 0||H==="attr-key"){const D=(wt=(js=L==null?void 0:L[7])==null?void 0:js.toLowerCase())!=null?wt:G.tag,ne=(yt=L==null?void 0:L[9])!=null?yt:M.toString().slice(0,O-B.posFromIndex(M.getAbsoluteIndex()).left);if(!E.has(D))return;const te=bn[D],fe=wn[D],ye=fe&&xe(fe,"Field",ne,p);return F.includes(D)&&!te?ye:[...ye!=null?ye:[],...D==="meta"||D==="link"?[]:xe(vn,"Property",ne,p),...te?xe(te,"Property",ne,p):[],...xe(["data-"],"Variable",ne,p),...xe(["xmlns:"],"Interface",ne,p)]}else if(H==="parameter-key"||H==="parameter-value"&&G.anon){const D=G.parentNode,{type:ne,name:te}=D;if(ne==="magic-word"&&te!=="invoke")return;const fe=f(this,e).slice(M.getAbsoluteIndex(),B.indexFromPos(N,O)).trimStart(),{module:ye,function:Se}=D;return fe?xe(B.querySelectorAll("parameter").filter(Te=>Te===G||Te.anon||Te.parentNode.type!==ne||Te.parentNode.name!==te?!1:ne==="template"?!0:Te.parentNode.module===ye&&Te.parentNode.function===Se).map(({name:Te})=>Te),"Variable",fe,p,H==="parameter-value"?"=":""):void 0}else if(Ss(M)&&Na(G)){const D=pn(G.tag,G.name);if(D.length===0)return;const ne=f(this,e).slice(M.getAbsoluteIndex(),B.indexFromPos(N,O)).trimStart();return xe(D,"Value",ne,p)}}async provideDiagnostics(m,p=!0){const b=await P(this,d,$e).call(this,m),w=b.lint();return[(p?w:w.filter(({severity:_})=>_==="error")).map(({startLine:_,startCol:E,endLine:F,endCol:N,severity:O,rule:R,message:L,fix:U,suggestions:I})=>({range:{start:{line:_,character:E},end:{line:F,character:N}},severity:O==="error"?1:2,source:"WikiLint",code:R,message:L,data:[...U?[Mr(b,U,!0)]:[],...I?I.map(B=>Mr(b,B)):[]]})),[],[]].flat(2)}async provideFoldingRanges(m){const p=await P(this,d,$e).call(this,m),{length:b}=p.getLines(),w=[],v=new Array(6),A=p.querySelectorAll("heading-title,table,template,magic-word");for(const S of[...A].reverse())S.getRelativeIndex();for(const S of A){const{offsetHeight:_}=S;if(S.type==="heading-title"||_>2){const{top:E}=p.posFromIndex(S.getAbsoluteIndex());if(S.type==="heading-title"){const{level:F}=S.parentNode;for(let N=F-1;N<6;N++){const O=v[N];O!==void 0&&O<E-1&&w.push({startLine:O,endLine:E-1,kind:"region"}),v[N]=void 0}v[F-1]=E+_-1}else w.push({startLine:E,endLine:E+_-2,kind:"region"})}}for(const S of v)S!==void 0&&S<b-1&&w.push({startLine:S,endLine:b-1,kind:"region"});return w}async provideLinks(m){var A;(A=this.config)!=null||(this.config=W.getConfig());const{articlePath:p,protocol:b}=this.config,w=p==null?void 0:p.includes("//"),v=Ca(b);return(await P(this,d,$e).call(this,m)).querySelectorAll(`magic-link,ext-link-url,free-ext-link,attr-value,image-parameter#link${w?",link-target,template-name,invoke-module,magic-word#filepath,magic-word#widget":""}`).reverse().map(S=>{let _;S.is("magic-word")&&({name:_}=S,S=S.childNodes[1].lastChild);const{type:E,parentNode:F,firstChild:N,lastChild:O,childNodes:R,length:L}=S,{tag:U}=F;if(_!=null||(_=F.name),!(E!=="attr-value"||_==="src"&&["templatestyles","img"].includes(U)||_==="cite"&&["blockquote","del","ins","q"].includes(U))||!qr(S))return!1;let I=R.filter(B=>B.type==="text").map(({data:B})=>B).join("").trim();if(!I)return!1;try{if(S.is("magic-link")||S.is("ext-link-url")||S.is("free-ext-link"))I=S.getUrl(p);else if(E==="link-target"&&(F.is("link")||F.is("redirect-target")||F.is("category"))){if(I.startsWith("/"))return!1;I=F.link.getUrl(p)}else if(E==="template-name")I=F.getAttribute("title").getUrl(p);else if(["link-target","invoke-module","parameter-value"].includes(E)||E==="attr-value"&&_==="src"&&U==="templatestyles"||E==="image-parameter"&&!v.test(I)){if(!w||I.startsWith("/"))return!1;let B=0;switch(E){case"attr-value":B=10;break;case"invoke-module":B=828;break;case"parameter-value":B=_==="filepath"?6:274}const M=W.normalizeTitle(I,B,!1,this.config,{temporary:!0});if(!M.valid)return!1;I=M.getUrl()}if(typeof I=="string"&&I.startsWith("//")&&(I=`https:${I}`),I=new URL(I).href,E==="image-parameter"){const B=N.getBoundingClientRect(),{top:M,left:H,height:G,width:K}=L===1?B:O.getBoundingClientRect();return{range:{start:{line:B.top,character:B.left},end:Zt(M,H,G,K)},target:I}}return{range:Me(S),target:I}}catch{return!1}}).filter(Boolean)}async provideReferences(m,p){const b=await P(this,d,$e).call(this,m),{offsetNode:w,offset:v}=Wr(b,f(this,e),p),A=w.type==="text"?w.parentNode:w,S=v===0&&(A.type==="ext-attr-dirty"||A.type==="html-attr-dirty")?A.parentNode.parentNode:A,{type:_}=S,E=et(S),F=tt(S);if(!E&&!F&&!_a.has(_))return;const N=Ft(S),O=b.querySelectorAll(_==="heading-title"?"heading":_).filter(R=>_==="attr-value"?et(R)===E||tt(R)===F:Ft(R)===N).reverse().map(R=>({range:Me(R.type==="parameter-key"?R.parentNode:R)}));return O.length===0?void 0:O}async provideDefinition(m,p){const b=await P(this,d,$e).call(this,m),w=b.elementFromPoint(p.character,p.line),v=w.is("ext")&&w.name==="ref"?w:w.closest("ext#ref"),A=ze(v,"name");if(!A)return;const S=ze(v,"group"),_=b.querySelectorAll("ext#ref").filter(E=>E.innerText&&ze(E,"name")===A&&ze(E,"group")===S).reverse().map(({lastChild:E})=>({range:Me(E)}));return _.length===0?void 0:_}async resolveRenameLocation(m,p){const b=await P(this,d,$e).call(this,m),w=b.elementFromPoint(p.character,p.line),{type:v}=w,A=et(w),S=tt(w);return!A&&!S&&(!Or.has(v)||v==="parameter-key"&&/^[1-9]\d*$/u.test(w.parentNode.name)||v==="link-target"&&!["link","redirect-target"].includes(w.parentNode.type))?void 0:Me(w)}async provideRenameEdits(m,p,b){const w=await P(this,d,$e).call(this,m),v=w.elementFromPoint(p.character,p.line),{type:A}=v,S=et(v),_=S&&ze(v.parentNode.parentNode,"group"),E=tt(v),F=Ft(v),N=w.querySelectorAll(A).filter(O=>{const{type:R}=O.parentNode;return A==="link-target"&&R!=="link"&&R!=="redirect-target"?!1:A==="attr-value"?tt(O)===E||et(O)===S&&ze(O.parentNode.parentNode,"group")===_:Ft(O)===F});return N.length===0?void 0:{changes:{"":N.reverse().map(O=>({range:Me(O),newText:b}))}}}async provideHover(m,p){if(!this.data)return;const b=await P(this,d,$e).call(this,m);let{offsetNode:w,offset:v}=Wr(b,f(this,e),p);w.type==="text"&&(v+=w.getRelativeIndex(),w=w.parentNode);const{type:A,parentNode:S,length:_,name:E}=w;let F,N,O,R;if(w.is("double-underscore")&&v>0)F=P(this,d,dn).call(this,w.name);else if(A==="magic-word-name")F=P(this,d,st).call(this,S.name),N=w.text().trim(),O=S.getAttribute("colon");else if(w.is("magic-word")&&!w.modifier&&_===1&&(v>0||b.posFromIndex(w.getAbsoluteIndex()).left===p.character))F=P(this,d,st).call(this,E),N=w.firstChild.text().trim(),O=w.getAttribute("colon");else if((w.is("magic-word")||w.is("template"))&&w.modifier&&v>=2&&w.getRelativeIndex(0)>v&&(N=w.modifier.trim().slice(0,-1),F=P(this,d,st).call(this,N.toLowerCase()),O=":",F)){const L=w.getAbsoluteIndex();R={start:Ze(b,L+2),end:Ze(b,L+w.modifier.trimEnd().length+1)}}return F&&{contents:{kind:"markdown",value:(F.signatures?`${F.signatures.map(L=>`- **{{ ${N}${L.length===0?"**":`${O}** `}${L.map(({label:U,const:I})=>I?U:`*${U}*`).join(" **|** ")} **}}**`).join(`
6
+ `})}}return kt(t,e),t}}}),na={};ie(na,{ParamTagToken:()=>dt});var wn,oi,yn,dt,la=N({"src/paramTag/index.ts"(){"use strict";K(),ce(),Bs(),Cr(),J(),Q(),Ue(),wn=[Os],dt=class extends(yn=H){get type(){return"ext-inner"}constructor(e,t,s=I.getConfig(),r=[],l){if(super(void 0,s,r,{}),t){const i=be;this.append(...t.split(`
7
+ `).map(n=>l?n:as(n,s,r,e)).map(n=>new i(n,"param-line",s,r,{})))}r.splice(r.indexOf(this),1),r.push(this)}lint(e=this.getAbsoluteIndex()){const t="no-ignored",s=I.lintConfig.getSeverity(t,this.name);if(!s)return[];const r=new de(this,e),l=I.msg("invalid parameter of <$1>",this.name),i=[];for(const n of this.childNodes){n.setAttribute("aIndex",e);const a=n.childNodes.filter(({type:o})=>o!=="comment"&&o!=="include"&&o!=="noinclude");if(a.some(({type:o})=>o==="ext"))i.push(X(n,r,t,l,s));else{const o=a.findIndex(({type:u})=>u!=="text"),d=a.slice(0,o===-1?void 0:o).map(String).join("");if(d&&!(o===-1?/^[a-z]+(?:\[\])?\s*=/iu:/^[a-z]+(?:\[\])?\s*(?:=|$)/iu).test(d)){const u=X(n,r,t,l,s);u.suggestions=[{desc:"remove",range:[u.startIndex,u.endIndex],text:""}],i.push(u)}else{const u=n.lint(e,!1);u.length>0&&i.push(...u)}}e+=n.toString().length+1}return i}},oi=re(yn),dt=le(oi,0,"ParamTagToken",wn,dt),ne(oi,1,dt)}}),Ir,aa=N({"src/heading.ts"(){"use strict";var e,t,$s,r;K(),we(),ce(),J(),Q(),$t(),Ir=(r=class extends H{constructor(i,n,a,o=[]){super(void 0,a,o);O(this,t);O(this,e);R(this,e,i);const d=new H(n[0],a,o);d.type="heading-title",d.setAttribute("stage",2);const u=new tt(n[1],"heading-trail",a,o);this.append(d,u)}get type(){return"heading"}get level(){return x(this,e)}toString(i){const n=P(this,t,$s).call(this);return n+this.firstChild.toString(i)+n+this.lastChild.toString(i)}text(){const i=P(this,t,$s).call(this);return i+this.firstChild.text()+i}getAttribute(i){return i==="invalid"?this.inHtmlAttrs()===2:i==="padding"?this.level:super.getAttribute(i)}getGaps(){return this.level}lint(i=this.getAbsoluteIndex(),n){const a=super.lint(i,n),{firstChild:o,level:d}=this,u=o.toString(),h=u.startsWith("="),p=h||u.endsWith("="),c=new de(this,i),m=this.inHtmlAttrs(),S=["h1","unbalanced-header","format-leakage"],A=S.map(y=>I.lintConfig.getSeverity(y,"apostrophe"));if(A[0]&&this.level===1){const y=X(o,c,S[0],"<h1>",A[0]);p||(y.suggestions=[{desc:"h2",range:[y.startIndex,y.endIndex],text:`=${u}=`}]),a.push(y)}if(A[1]&&p){const y=I.msg("unbalanced $1 in a section header",'"="'),$=X(o,c,S[1],y,A[1]);if(u!=="=")if(h){const[f]=/^=+/u.exec(u),g=d+f.length;$.suggestions=[{desc:`h${d}`,range:[$.startIndex,$.startIndex+f.length],text:""}],g<7&&$.suggestions.push({desc:`h${g}`,range:[$.endIndex,$.endIndex],text:f})}else{const f=/[^=](=+)$/u.exec(u)[1],g=d+f.length;$.suggestions=[{desc:`h${d}`,range:[$.endIndex-f.length,$.endIndex],text:""}],g<7&&$.suggestions.push({desc:`h${g}`,range:[$.startIndex,$.startIndex],text:f})}a.push($)}if(m){const y="parsing-order",$=I.lintConfig.getSeverity(y,m===2?"heading":"templateInTable");$&&a.push(te(this,c,y,"section header in HTML tag attributes",$))}if(A[2]){const y=this.getRootNode().toString(),$=o.childNodes.filter(Ws("quote")),f=$.filter(({bold:w})=>w),g=$.filter(({italic:w})=>w);if(f.length%2){const w=X(f[f.length-1],{...c,start:i+d,left:c.left+d},S[2],I.msg("unbalanced $1 in a section header","bold apostrophes"),A[2]),b=i+d+u.length;y.slice(w.endIndex,b).trim()?w.suggestions=[{desc:"close",range:[b,b],text:"'''"}]:w.fix={desc:"remove",range:[w.startIndex,w.endIndex],text:""},a.push(w)}if(g.length%2){const w=X(g[g.length-1],{start:i+d},S[2],I.msg("unbalanced $1 in a section header","italic apostrophes"),A[2]),b=i+d+u.length;y.slice(w.endIndex,b).trim()?w.suggestions=[{desc:"close",range:[b,b],text:"''"}]:w.fix={desc:"remove",range:[w.startIndex,w.endIndex],text:""},a.push(w)}}return a}print(){const i=P(this,t,$s).call(this);return super.print({pre:i,sep:i})}json(i,n=this.getAbsoluteIndex()){const a=super.json(void 0,n);return a.level=this.level,a}},e=new WeakMap,t=new WeakSet,$s=function(){return"=".repeat(this.level)},r)}}),Sn,oa,Ko=N({"src/parameter.ts"(){"use strict";he(),K(),J(),Q(),Sn=new RegExp(`https?://${mt}${xt}$`,"iu"),oa=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,r=[]){super(void 0,s,r);const l=new H(typeof e=="number"?void 0:e,s,r,{}),i=new H(t,s,r);l.type="parameter-key",l.setAttribute("stage",2),i.type="parameter-value",i.setAttribute("stage",2),this.append(l,i)}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 i;const s=super.lint(e,t),r="unescaped",l=I.lintConfig.getSeverity(r);if(l){const{firstChild:n}=this,a=(i=Sn.exec(n.text()))==null?void 0:i[0];try{if(a&&new URL(a).search){const o="unescaped query string in an anonymous parameter",d=X(n,{start:e},r,o,l);d.startIndex=d.endIndex,d.startLine=d.endLine,d.startCol=d.endCol,d.endIndex++,d.endCol++,d.fix={desc:"escape",range:[d.startIndex,d.endIndex],text:"{{=}}"},s.push(d)}}catch{}}return s}print(){return super.print({sep:this.anon?"":"="})}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t);return Object.assign(s,{anon:this.anon},this.duplicated&&{duplicated:!0}),s}}}}),An,di,$n,ut,Yo=N({"src/transclude.ts"(){"use strict";var e,t,s,r,l,i,Ut,da,o;he(),K(),we(),ce(),Rs(),J(),Q(),Ko(),Ue(),$t(),An=[ls()],ut=(o=class extends($n=H){constructor(u,h,p,c=[]){var C,E;let m;const S=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(u);S&&(m=Number(S[1]),u=u.replace(`\0${m}h`,c[m].toString().replace(/^\n/u,"")));super(void 0,p,c,{});O(this,i);ke(this,"modifier","");O(this,e,"template");O(this,t,":");O(this,s,!1);O(this,r,new Map);O(this,l);const{parserFunction:[A,y],variable:$,functionHook:f}=p,g=(C=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(u))==null?void 0:C[0];if(g)this.setAttribute("modifier",g),u=u.slice(g.length);else if(u.includes(":")){const[T,...L]=u.split(":"),[B]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((E=L[0])!=null?E:"");this.setModifier(`${T}:${B}`)&&(u=L.join(":").slice(B.length))}const w=u.search(/[::]/u),b=u[w]===":",v=w!==-1;if(v||h.length===0&&!x(this,s)){const T=v?u.slice(0,w):u,L=v&&u.slice(w+1),B=Ie(T),j=v?B.slice(B.search(/\S/u))+(b?":":""):B.trim(),F=j.toLowerCase(),U=Array.isArray(y),W=U?y.includes(j):Object.prototype.hasOwnProperty.call(y,j),q=!U&&W?y[j]:Object.prototype.hasOwnProperty.call(A,F)&&A[F],M=U&&W||!("functionHook"in p)||f.includes(q),D=U&&W||$.includes(q);if(v?q&&M:D){this.setAttribute("name",q||F.replace(/^#|:$/u,"")),R(this,e,"magic-word"),b&&R(this,t,":");const G=new tt(T,"magic-word-name",p,c);if(super.insertAt(G),L!==!1&&h.unshift([L]),this.name==="invoke")for(let Z=0;Z<2;Z++){const Y=h.shift();if(!Y)break;const se=new be(Y.join("="),`invoke-${Z?"function":"module"}`,p,c);super.insertAt(se)}}}if(this.type==="template"){const T=Ie(u).trim();if(!this.normalizeTitle(T,10,{halfParsed:!0,temporary:!0}).valid)throw c.pop(),new SyntaxError("Invalid template name");const L=new be(u,"template-name",p,c,{});super.insertAt(L)}typeof m=="number"&&(c[m]=void 0);const k=this.isTemplate();let _=1;for(let T=0;T<h.length;T++){const L=h[T];k||this.name==="switch"&&T>0||this.name==="tag"&&T>1||(L[0]=L.join("="),L.length=1),L.length===1&&(L.unshift(_),_++),this.insertAt(new oa(...L,p,c))}this.seal("modifier")}get type(){return x(this,e)}get module(){return this.type==="magic-word"&&this.name==="invoke"?P(this,i,Ut).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:[,,h,p]}=this.getAttribute("config"),c=Ie(u).trim();if(u&&!c.endsWith(":"))return!1;const m=c.slice(0,-1).toLowerCase(),S=h.includes(m),A=p.includes(m);return x(this,s)&&S||!x(this,s)&&(A||!u)||(ve.running||this.length>1)&&(S||A||!u)?(this.setAttribute("modifier",u),R(this,s,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"&&(R(this,l,P(this,i,Ut).call(this)),this.setAttribute("name",x(this,l).title))}toString(u){return`{{${this.modifier}${this.type==="magic-word"?this.firstChild.toString(u)+(this.length===1?"":x(this,t))+this.childNodes.slice(1).map(h=>h.toString(u)).join("|"):super.toString(u,"|")}}}`}text(){const{childNodes:u,length:h,firstChild:p,modifier:c,type:m,name:S}=this;return m==="magic-word"&&S==="vardefine"?"":`{{${c}${m==="magic-word"?p.text()+(h===1?"":x(this,t))+Ye(u.slice(1),"|"):super.text("|")}}}`}getAttribute(u){switch(u){case"padding":return this.modifier.length+2;case"title":return x(this,l);case"colon":return x(this,t);case"invalid":return this.type==="magic-word"&&this.name==="invoke"&&(this.length===2||!P(this,i,Ut).call(this).valid);default:return super.getAttribute(u)}}lint(u=this.getAbsoluteIndex(),h){const p=super.lint(u,h);if(!this.isTemplate())return p;const{type:c,childNodes:m,length:S}=this,A=new de(this,u),y=c==="magic-word";let $="no-ignored",f=I.lintConfig.getSeverity($,"fragment");if(y&&!P(this,i,Ut).call(this).valid)$="invalid-invoke",f=I.lintConfig.getSeverity($,"name"),f&&p.push(X(m[1],A,$,"illegal module name",f));else if(f){const g=m[y?1:0],w=g.childNodes.findIndex(v=>v.type==="text"&&ss(v.data).includes("#")),b=g.childNodes[w];if(b){const v=X(g,A,$,"useless fragment",f);v.fix={desc:"remove",range:[v.startIndex+g.getRelativeIndex(w)+b.data.indexOf("#"),v.endIndex],text:""},p.push(v)}}if($="invalid-invoke",f=I.lintConfig.getSeverity($,"function"),f&&y&&S===2)return p.push(te(this,A,$,"missing module function",f)),p;if($="no-duplicate",f=I.lintConfig.getSeverity($,"parameter"),f){const g=this.getDuplicatedArgs().filter(([,b])=>!b[0].querySelector("ext")),w="duplicated parameter";for(const[,b]of g)p.push(...b.map(v=>{const k=X(v,A,$,w,f);return k.suggestions=[{desc:"remove",range:[k.startIndex-1,k.endIndex],text:""}],k}))}return p}insertAt(u,h=this.length){return super.insertAt(u,h),u.anon?P(this,i,da).call(this,u):u.name&&this.getArgs(u.name,!1,!1).add(u),u}getAllArgs(){return this.childNodes.filter(Ws("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:u})=>u)}getArgs(u,h,p=!0){const c=String(u).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");let m;return x(this,r).has(c)?m=x(this,r).get(c):(m=new Set(this.getAllArgs().filter(({name:S})=>c===S)),x(this,r).set(c,m)),m}getDuplicatedArgs(){return[...x(this,r)].filter(([,{size:u}])=>u>1).map(([u,h])=>[u,[...h]])}getPossibleValues(){const{type:u,name:h,childNodes:p}=this;if(u==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let c,m;switch(h){case"if":case"ifexist":case"ifexpr":case"iferror":c=2;break;case"ifeq":c=3;break;case"switch":{const S=p.slice(2),A=S[S.length-1];m=[...S.filter(({anon:y})=>!y),...A!=null&&A.anon?[A]:[]].map(({lastChild:y})=>y);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}m!=null||(m=p.slice(c,c+2).map(({lastChild:S})=>S));for(let S=0;S<m.length;){const{length:A,0:y}=m[S].childNodes.filter($=>$.text().trim());if(A===0)m.splice(S,1);else if(A>1||y.type!=="magic-word")S++;else try{const $=y.getPossibleValues();m.splice(S,1,...$),S+=$.length}catch{S++}}return m}print(){const{childNodes:u,length:h,firstChild:p,modifier:c,type:m}=this;return`<span class="wpb-${m}${this.getAttribute("invalid")?" wpb-invalid":""}">{{${m==="magic-word"?is(c)+p.print()+(h===1?"":x(this,t))+bt(u.slice(1),{sep:"|"}):(c?`<span class="wpb-magic-word">${is(c)}</span>`:"")+bt(u,{sep:"|"})}}}</span>`}},e=new WeakMap,t=new WeakMap,s=new WeakMap,r=new WeakMap,l=new WeakMap,i=new WeakSet,Ut=function(){const u=this.type==="template";return this.normalizeTitle(this.childNodes[u?0:1].text(),u?10:828,{temporary:!0})},da=function(u){const h=this.getAnonArgs(),p=typeof u!="number";for(let c=p?h.indexOf(u):u-1;c<h.length;c++){const m=h[c],{name:S}=m,A=String(c+1);(S!==A||m===u)&&(m.setAttribute("name",A),this.getArgs(A,!1,!1).add(m))}},o),di=re($n),ut=le(di,0,"TranscludeToken",An,ut),ne(di,1,ut)}}),kn,ui,_n,Mt,Zo=N({"src/hidden.ts"(){"use strict";At(),Q(),kn=[et()],Mt=class extends(_n=H){get type(){return"hidden"}getAttribute(e){return e==="invalid"||super.getAttribute(e)}},ui=re(_n),Mt=le(ui,0,"HiddenToken",kn,Mt),ne(ui,1,Mt)}}),Cn,hi,In,zt,ed=N({"src/arg.ts"(){"use strict";var e,ua,s;he(),K(),ce(),We(),Rs(),J(),Q(),Ue(),Zo(),Cn=[Pe("{{{"),ls()],zt=(s=class extends(In=H){constructor(l,i,n=[]){super(void 0,i,n,{});O(this,e);for(let a=0;a<l.length;a++){const o=l[a];if(a===0){const d=new be(o,"arg-name",i,n,{});super.insertAt(d)}else if(a>1){const d=new Mt(o,i,n);super.insertAt(d)}else{const d=new H(o,i,n);d.type="arg-default",d.setAttribute("stage",2),super.insertAt(d)}}}get type(){return"arg"}get default(){var l,i;return(i=(l=this.childNodes[1])==null?void 0:l.text())!=null?i:!1}toString(l){return`{{{${super.toString(l,"|")}}}}`}text(){return`{{{${Ye(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){P(this,e,ua).call(this),super.afterBuild()}lint(l=this.getAbsoluteIndex(),i){const{childNodes:[n,a,...o]}=this;n.setAttribute("aIndex",l+3);const d=n.lint(l+3,i);if(a){const p=l+4+n.toString().length;a.setAttribute("aIndex",p);const c=a.lint(p,i);c.length>0&&d.push(...c)}const u=["no-ignored","no-arg"],h=u.map(p=>I.lintConfig.getSeverity(p,"arg"));if(h[0]&&o.length>0){const p=new de(this,l);d.push(...o.map(c=>{const m=X(c,p,u[0],"invisible content inside triple braces",h[0]);return m.startIndex--,m.startCol--,m.suggestions=[{desc:"remove",range:[m.startIndex,m.endIndex],text:""},{desc:"escape",range:[m.startIndex,m.startIndex+1],text:"{{!}}"}],m}))}if(h[1]&&!this.getAttribute("include")){const p=te(this,{start:l},u[1],"unexpected template argument",h[1]);a&&(p.suggestions=[{desc:"expand",range:[l,p.endIndex],text:a.text()}]),d.push(p)}return d}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(l,i=this.getAbsoluteIndex()){const n=super.json(void 0,i);return n.default=this.default,n}},e=new WeakSet,ua=function(){this.setAttribute("name",this.firstChild.text().trim())},s),hi=re(In),zt=le(hi,0,"ArgToken",Cn,zt),ne(hi,1,zt)}}),ha={};ie(ha,{parseBraces:()=>qs});var Tn,ci,fs,gi,pi,fi,Nn,mi,qs,Tr=N({"parser/braces.ts"(){"use strict";St(),he(),aa(),Yo(),ed(),Tn={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},ci=String.raw`\[(?!\[)`,fs=String.raw`\n(?![=\0])`,gi=String.raw`|\{{2,}`,pi=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),fi=Xe(e=>new RegExp(e,"gmu")),Nn=new RegExp(String.raw`\{\{((?:[^\n{}[]|${ci}|${fs})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${fs})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${ci}|${fs})*\}-`,"gu"),mi=e=>{const t=vt(Ie(e));return pi.has(t)?pi.get(t):/^(?:filepath|(?:full|canonical)urle?):./u.test(t)?"m":/^#vardefine:./u.test(t)?"n":"t"},qs=(e,t,s)=>{var m,S,A,y,$;const r=String.raw`${t.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,l]}=t,i=[],n=[],a=(f,g,w,b)=>{g[g.length-1].push(Re(f.slice(w,b),n))};let o;do o!==void 0&&(e=o),o=e.replace(Nn,(f,g,w)=>{if(g!==void 0||typeof w=="string")try{const{length:b}=s,v=(g!=null?g:w).split("|");return new ut(Re(v[0],n),v.slice(1).map(k=>{const _=k.indexOf("=");return(_===-1?[k]:[k.slice(0,_),k.slice(_+1)]).map(C=>Re(C,n))}),t,s),`\0${b}${mi(v[0])}`}catch(b){if(!(b instanceof SyntaxError)||b.message!=="Invalid template name")throw b}return n.push(Re(f,n)),`\0${n.length-1}`});while(o!==e);e=o;const d=e.lastIndexOf("}}")-e.length;let u=d+e.length!==-1,h=fi(r+(u?gi:"")),p=h.exec(e),c;for(;p||c!==void 0&&c<=e.length&&((S=(m=i[i.length-1])==null?void 0:m[0])!=null&&S.startsWith("="));){if(p!=null&&p[1]){const[,{length:L}]=p;p[0]=p[0].slice(L),p.index+=L}const{0:f,index:g}=p!=null?p:{0:`
8
+ `,index:e.length},w=(A=i.pop())!=null?A:{},{0:b,index:v,parts:k,findEqual:_,pos:C}=w,E=f==="="&&_;if(f==="]]"||f==="}-")c=g+2;else if(f===`
9
+ `){c=g+1;const{pos:L,findEqual:B}=(y=i[i.length-1])!=null?y:{};if(L===void 0||B||Ie(e.slice(L,v))!==""){const j=/^(={1,6})(.+)\1((?:\s|\0\d+[cn]\x7F)*)$/u.exec(e.slice(v,g));j&&(j[2]=Re(j[2],n),j[2].includes(`
10
+ `)||(e=`${e.slice(0,v)}\0${s.length}h${e.slice(g)}`,c=v+4+String(s.length).length,new Ir(j[1].length,j.slice(2),t,s)))}}else if(f==="|"||E)c=g+1,a(e,k,C,g),f==="|"&&k.push([]),w.pos=c,w.findEqual=f==="|",i.push(w);else if(f.startsWith("}}")){const L=f.slice(0,Math.min(b.length,3)),B=b.length-L.length,{length:j}=s;c=g+L.length,a(e,k,C,g);let F=!1,U="t";if(L.length===3){const W=k.map(M=>M.join("=")),q=W.length>1&&Ie(W[1]).trim();new zt(W,t,s),q&&q.endsWith(":")&&l.includes(q.slice(0,-1).toLowerCase())&&(U="s")}else try{new ut(k[0][0],k.slice(1),t,s),U=mi(k[0][0])}catch(W){if(W instanceof SyntaxError&&W.message==="Invalid template name")F=!0;else throw W}F||(e=`${e.slice(0,v+B)}\0${j}${U}${e.slice(c)}`,c=v+B+3+String(j).length,B>1?i.push({0:b.slice(0,B),index:v,pos:v+B,parts:[[]]}):B===1&&e[v-1]==="-"&&i.push({0:"-{",index:v-1,pos:v+1,parts:[[]]}))}else c=g+f.length,f.startsWith("{")&&(p.pos=c,p.parts=[[]]),i.push(..."0"in w?[w]:[],p);let T=i[i.length-1];if(u&&d+e.length<c)for(u=!1;($=T==null?void 0:T[0])!=null&&$.startsWith("{");)i.pop(),T=i[i.length-1];h=fi(r+(u?gi:"")+(T?`|${Tn[T[0][0]]}${T.findEqual?"|=":""}`:"")),h.lastIndex=c,p=h.exec(e)}return Re(e,n)}}}),ca={};ie(ca,{InputboxToken:()=>ga});var ga,td=N({"src/paramTag/inputbox.ts"(){"use strict";Bs(),Tr(),J(),la(),ga=class extends dt{constructor(e,t,s=I.getConfig(),r=[]){const l=Symbol("InputboxToken"),i=s.excludes.includes("heading")?s:{...s,excludes:[...s.excludes,"heading"]},{length:n}=r;r.push(l),t&&(t=as(t,i,r,e)),t&&(t=qs(t,i,r)),r.splice(n,1),super(e,t,i,r,{})}}}}),ks={};ie(ks,{NestedToken:()=>pa});var Ln,Fn,pa,xi=N({"src/nested.ts"(){"use strict";var e,t,s;K(),ce(),Bs(),Tr(),J(),Q(),La(),ze(),Ln=new Set(["comment","include","arg","template","magic-word"]),Fn=[!1,!0].map(r=>{const l=r?"includeonly":"noinclude";return new RegExp(String.raw`^(?:<${l}(?:\s[^>]*)?/?>|</${l}\s*>)$`,"iu")}),pa=(s=class extends H{constructor(l,i,n,a,o=[]){if(typeof i=="boolean"){const d=Symbol("InputboxToken"),{length:u}=o;o.push(d),l&&(l=as(l,a,o,i)),l&&(l=qs(l,a,o)),o.splice(u,1)}else l&&(l=l.replace(i,(d,u,h,p,c)=>{const m=`\0${o.length+1}e`;return new pt(u,h,p,c,a,!1,o),m}));l&&(l=l.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(d,u,h)=>(new pe(h,a,o),`${u}\0${o.length}n`)));super(l,a,o);O(this,e);O(this,t);R(this,e,[...n]),R(this,t,i)}get type(){return"ext-inner"}lint(l=this.getAbsoluteIndex(),i){const n=super.lint(l,i),a="no-ignored",o=I.lintConfig.getSeverity(a,this.name);if(!o)return n;const d=new de(this,l),u=typeof x(this,t)=="boolean"?Fn[x(this,t)?1:0]:/^<!--[\s\S]*-->$/u;return[...n,...this.childNodes.filter(h=>{const{type:p,name:c}=h;if(p==="ext")return!x(this,e).includes(c);if(Ln.has(p))return!1;const m=h.toString().trim();return m&&!u.test(m)}).map(h=>{const p=X(h,d,a,I.msg("invalid content in <$1>",this.name),o);return p.suggestions=[{desc:"remove",range:[p.startIndex,p.endIndex],text:""},{desc:"comment",range:[p.startIndex,p.endIndex],text:`<!--${h.toString()}-->`}],p})]}},e=new WeakMap,t=new WeakMap,s)}});function jn(e,t,s,r,l){t=Ie(t).trim();let i=t.replace(e==="link"?/\0\d+[tq]\x7F/gu:/\0\d+t\x7F/gu,"").trim();switch(e){case"width":return!i&&!!t||/^(?:\d+x?|\d*x\d+)(?:\s*px)?$/u.test(i);case"link":{if(i){if(fa(s.protocol).test(i))return ma(s.protocol).test(i)&&t;i.startsWith("[[")&&i.endsWith("]]")&&(i=i.slice(2,-2))}else return t;const n=I.normalizeTitle(i,0,!1,s,{halfParsed:r,decode:!0,selfLink:!0});return n.valid&&n}case"lang":return(l==="svg"||l==="svgz")&&!/[^a-z\d-]/u.test(i);case"alt":case"class":case"manualthumb":return!0;case"page":return(l==="djvu"||l==="djv"||l==="pdf")&&Number(i)>0;default:return!!i&&!isNaN(i)}}var fa,ma,Rn,Pn,xa,sd=N({"src/imageParameter.ts"(){"use strict";var e,t,va,l;St(),he(),K(),J(),Q(),fa=Xe(i=>new RegExp(String.raw`^(?:${i}|//|\0\d+m\x7F)`,"iu")),ma=Xe(i=>new RegExp(String.raw`^(?:(?:${i}|//)${mt}|\0\d+m\x7F)${xt}$`,"iu")),Rn=Xe(i=>new RegExp(String.raw`^(\s*(?!\s))${i.replace("$1","(.*)")}${i.endsWith("$1")?`(?=$|
11
+ )`:""}(\s*)$`,"u")),Pn=new Set(["alt","link","lang","page","caption"]),xa=(l=class extends H{constructor(n,a,o,d){var i=(...r)=>(super(...r),O(this,t),O(this,e,""),this);let u;const h=Object.entries(o.img).map(([c,m])=>[c,m,Rn(c)]),p=h.find(([,c,m])=>(u=m.exec(n),u&&(u.length!==4||jn(c,u[2],o,!0,a)!==!1)));if(p&&u){u.length===3?(i(void 0,o,d),R(this,e,n)):(i(u[2],o,d,{}),R(this,e,u[1]+p[0]+u[3])),this.setAttribute("name",p[1]);return}i(n,o.excludes.includes("list")?o:{...o,excludes:[...o.excludes,"list"]},d),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get type(){return"image-parameter"}get link(){return this.name==="link"?jn("link",super.text(),this.getAttribute("config")):void 0}afterBuild(){var n;(n=this.parentNode)!=null&&n.is("gallery-image")&&!Pn.has(this.name)&&this.setAttribute("name","invalid"),super.afterBuild()}toString(n){return x(this,e)?x(this,e).replace("$1",super.toString(n)):super.toString(n)}text(){return x(this,e)?x(this,e).replace("$1",super.text()).trim():super.text().trim()}isPlain(){return this.name==="caption"}getAttribute(n){return n==="invalid"?this.name==="invalid":n==="padding"?Math.max(0,x(this,e).indexOf("$1")):super.getAttribute(n)}lint(n=this.getAbsoluteIndex(),a){const o=super.lint(n,a),{link:d,name:u}=this;if(u==="invalid"){const h="invalid-gallery",p=I.lintConfig.getSeverity(h,"parameter");if(p){const c=te(this,{start:n},h,"invalid image parameter",p);c.fix={desc:"remove",range:[n-1,c.endIndex],text:""},o.push(c)}}else if(typeof d=="object"&&d.encoded){const h="url-encoding",p=I.lintConfig.getSeverity(h,"file");if(p){const c=te(this,{start:n},h,"unnecessary URL encoding in an internal link",p);c.suggestions=[{desc:"decode",range:[n,c.endIndex],text:es(this.text())}],o.push(c)}}return o}getValue(){return this.name==="invalid"?this.text():P(this,t,va).call(this)||super.text()}print(){return x(this,e)?`<span class="wpb-image-parameter${this.name==="invalid"?" wpb-invalid":""}">${x(this,e).replace("$1",`<span class="wpb-image-caption">${bt(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}},e=new WeakMap,t=new WeakSet,va=function(){return x(this,e)&&!x(this,e).includes("$1")},l)}}),vi,En,On,bi,wi,qn,Bn,yi,Nr,ba=N({"src/link/file.ts"(){"use strict";K(),ce(),J(),js(),sd(),vi=new Map([["manualthumb","Thumb"],["frameless","Frameless"],["framed","Frame"],["thumbnail","Thumb"]]),En=new Set(["arg"]),On=new Set(["template","magic-word"]),bi=new Set(["left","right","center","none"]),wi=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),qn=new Set(["tiff","tif","png","gif","jpg","jpeg","webp","xcf","pdf","svg","djvu"]),Bn=e=>{if(e===void 0)return[];const t=/-\{|\}-|\|/gu,s=[];let r=t.exec(e),l=0,i=0;for(;r;){const{0:n,index:a}=r;n!=="|"?l+=n==="-{"?1:-1:l===0&&(s.push(e.slice(i,a)),{lastIndex:i}=t),r=t.exec(e)}return s.push(e.slice(i)),s},yi=(e,t)=>e.filter(({childNodes:s})=>{const r=s.filter(l=>l.text().trim());return r.length!==1||!t.has(r[0].type)}),Nr=class extends qe{get type(){return"file"}get extension(){return this.getAttribute("title").extension}constructor(e,t,s,r=[],l="|"){super(e,void 0,s,r,l);const{extension:i}=this.getTitle(!0,!0);this.safeAppend(Bn(t).map(n=>new xa(n,i,s,r)))}lint(e=this.getAbsoluteIndex(),t){var A;const s=super.lint(e,t),r=yi(this.getAllArgs(),En),l=[...new Set(r.map(({name:y})=>y))],i=l.filter(y=>vi.has(y)),n=l.filter(y=>bi.has(y)),a=l.filter(y=>wi.has(y)),[o]=i,d=o==="framed"||o==="manualthumb",u=new de(this,e);let h="nested-link",p=I.lintConfig.getSeverity(h,"file");if(p&&this.closest("ext-link-text")&&((A=this.getValue("link"))==null?void 0:A.trim())!==""&&s.push(te(this,u,h,"internal link in an external link",p)),h="invalid-gallery",p=I.lintConfig.getSeverity(h,"parameter"),p&&d)for(const y of r.filter(({name:$})=>$==="width")){const $=X(y,u,h,"invalid image parameter",p);$.fix={desc:"remove",range:[$.startIndex-1,$.endIndex],text:""},s.push($)}if(r.length===l.length&&i.length<2&&n.length<2&&a.length<2)return s;h="no-duplicate";const{extension:c}=this,m=["unknownImageParameter","imageParameter"].map(y=>I.lintConfig.getSeverity(h,y)),S=(y,$,f,g=!0)=>y.map(w=>{if(p=m[Number(typeof g=="function"?g(w):g)],!p)return!1;const b=X(w,u,h,I.msg(`${$} image $1 parameter`,f),p);return b.suggestions=[{desc:"remove",range:[b.startIndex-1,b.endIndex],text:""}],b}).filter(w=>w!==!1);for(const y of l){if(y==="invalid"||y==="width"&&d)continue;const $=y==="caption";let f=r.filter(({name:g})=>g===y);if($&&(f=[...f.slice(0,-1).filter(g=>g.text()),...f.slice(-1)]),f.length>1){let g=!$||!c||qn.has(c);if($&&g){const w=yi(f,On);g=w.length>1&&(b=>w.includes(b))}s.push(...S(f,"duplicated",y,g))}}return i.length>1&&s.push(...S(r.filter(({name:y})=>vi.has(y)),"conflicting","frame")),n.length>1&&s.push(...S(r.filter(({name:y})=>bi.has(y)),"conflicting","horizontal-alignment")),a.length>1&&s.push(...S(r.filter(({name:y})=>wi.has(y)),"conflicting","vertical-alignment")),s}getAllArgs(){return this.childNodes.slice(1)}getArgs(e){return this.getAllArgs().filter(({name:t})=>e===t)}getArg(e){const t=this.getArgs(e);return t[e==="manualthumb"?0:t.length-1]}getValue(e){var t;return(t=this.getArg(e))==null?void 0:t.getValue()}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t),{extension:r}=this;return r&&(s.extension=r),s}}}}),Wn,Si,Un,ht,wa=N({"src/link/galleryImage.ts"(){"use strict";var e,nr,s;K(),Ze(),We(),J(),Q(),ba(),Wn=[Pe("")],ht=(s=class extends(Un=Nr){constructor(l,i,n,a,o=[]){let d;if(n!==void 0){const{length:u}=o;d=new H(n,a,o);for(let h=1;h<Se;h++)d.parseOnce();o.splice(u,1)}super(i,d==null?void 0:d.toString(),a,o);O(this,e);ke(this,"privateType","imagemap-image");this.setAttribute("bracket",!1),this.privateType=`${l}-image`,this.seal("privateType",!0)}get type(){return this.privateType}getTitle(l){const i=this.type==="imagemap-image";return this.normalizeTitle(this.firstChild.toString(),i?0:6,{halfParsed:!0,temporary:l,decode:!i})}lint(l=this.getAbsoluteIndex(),i){const n=super.lint(l,i),a="invalid-gallery",o=I.lintConfig.getSeverity(a,"image");if(o&&P(this,e,nr).call(this)){const d=te(this,{start:l},a,"invalid gallery image",o);d.suggestions=[{desc:"prefix",range:[l,l],text:"File:"}],n.push(d)}return n}getAttribute(l){return l==="invalid"?P(this,e,nr).call(this):super.getAttribute(l)}},e=new WeakSet,nr=function(){const{ns:l}=this.getAttribute("title");return l!==6},s),Si=re(Un),ht=le(Si,0,"GalleryImageToken",Wn,ht),ne(Si,1,ht)}}),ya={};ie(ya,{GalleryToken:()=>Ht});var Mn,Ai,zn,Ht,id=N({"src/gallery.ts"(){"use strict";var e,Sa,lr,r;Cr(),J(),Q(),wa(),ze(),Mn=[Os],Ht=(r=class extends(zn=H){constructor(i,n,a=[]){var o;super(void 0,n,a,{});O(this,e);for(const d of(o=i==null?void 0:i.split(`
12
+ `))!=null?o:[]){const u=/^([^|]+)(?:\|(.*))?/u.exec(d);if(!u){super.insertAt(d.trim()?new pe(d,n,a):d);continue}const[,h,p]=u;P(this,e,Sa).call(this,h)?super.insertAt(new ht("gallery",h,p,n,a)):super.insertAt(new pe(d,n,a))}}get type(){return"ext-inner"}get widths(){return P(this,e,lr).call(this,"widths")}get heights(){return P(this,e,lr).call(this,"heights")}lint(i=this.getAbsoluteIndex(),n){const{top:a,left:o}=this.getRootNode().posFromIndex(i),d=[],u="no-ignored",h=["Image","NoImage","Comment"].map(p=>I.lintConfig.getSeverity(u,`gallery${p}`));for(let p=0;p<this.length;p++){const c=this.childNodes[p],m=c.toString(),{length:S}=m,A=m.trim(),{type:y}=c,$=a+p,f=p?0:o;if(c.setAttribute("aIndex",i),y==="noinclude"&&A&&!/^<!--.*-->$/u.test(A)){let[g]=h;if(A.startsWith("|")?[,g]=h:(A.startsWith("<!--")||A.endsWith("-->"))&&([,,g]=h),g){const w=i+S;d.push({rule:u,message:I.msg("invalid content in <$1>","gallery"),severity:g,startIndex:i,endIndex:w,startLine:$,endLine:$,startCol:f,endCol:f+S,suggestions:[{desc:"remove",range:[i,w],text:""},{desc:"comment",range:[i,w],text:`<!--${m}-->`}]})}}else if(y!=="noinclude"&&y!=="text"){const g=c.lint(i,n);g.length>0&&d.push(...g)}i+=S+1}return d}json(i,n=this.getAbsoluteIndex()){const a=super.json(void 0,n);return Object.assign(a,{widths:this.widths,heights:this.heights}),a}},e=new WeakSet,Sa=function(i){return this.normalizeTitle(i,6,{halfParsed:!0,temporary:!0,decode:!0}).valid},lr=function(i){var o,d;const n=(o=this.parentNode)==null?void 0:o.getAttr(i),a=typeof n=="string"&&((d=/^(\d+)\s*(?:px)?$/u.exec(n))==null?void 0:d[1]);return a&&Number(a)||120},r),Ai=re(zn),Ht=le(Ai,0,"GalleryToken",Mn,Ht),ne(Ai,1,Ht)}}),Lr,Aa=N({"src/link/index.ts"(){"use strict";K(),J(),js(),Lr=class extends qe{get type(){return"link"}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),r="nested-link",l=I.lintConfig.getSeverity(r);return l&&this.closest("ext-link-text")&&s.push(te(this,{start:e},r,"internal link in an external link",l)),s}}}}),Hn,Dn,ns,Fr=N({"src/magicLink.ts"(){"use strict";var e,t,ar,r;K(),he(),ce(),J(),Q(),Hn=String.raw`(?:[${Be}\t]|&nbsp;|&#0*160;|&#[xX]0*[aA]0;)`,Dn=new RegExp(`${Hn}+`,"gu"),ns=(r=class extends H{constructor(i,n="free-ext-link",a=I.getConfig(),o){super(i,a,o,{});O(this,t);O(this,e);R(this,e,n)}get type(){return x(this,e)}get innerText(){const i=new Map([["!","|"],["=","="]]);let n=Ye(this.childNodes.map(a=>{const{type:o}=a,d=String(a.name);return o==="magic-word"&&i.has(d)?i.get(d):a}));return this.type==="magic-link"&&(n=n.replace(Dn," ")),n}get link(){const{innerText:i}=this;return this.type==="magic-link"?i.startsWith("ISBN")?`ISBN ${i.slice(5).replace(/[- ]/gu,"").replace(/x$/u,"X")}`:i:Gl(i).replace(/\n/gu,"%0A")}lint(i=this.getAbsoluteIndex(),n){const a=super.lint(i,n),o=new de(this,i),{type:d,childNodes:u}=this;if(d==="magic-link"){const m="invalid-isbn",S=I.lintConfig.getSeverity(m);return S&&P(this,t,ar).call(this)&&a.push(te(this,o,m,"invalid ISBN",S)),a}const h=d==="ext-link-url",p="unterminated-url",c=I.lintConfig.getSeverity(p,h?"pipe":"punctuation");if(c){const m=h?/\|/u:/[,;。:!?()]+/u,S=u.find(A=>A.type==="text"&&m.test(A.data));if(S){const{data:A}=S,y=X(S,o,p,I.msg("$1 in URL",h?'"|"':"full-width punctuation"),c),{index:$,0:f}=m.exec(A),g=y.startIndex+$;y.suggestions=h?[{desc:"whitespace",range:[g,g+1],text:" "}]:[{desc:"whitespace",range:[g,g],text:" "},{desc:"escape",range:[g,g+f.length],text:encodeURI(f)}],a.push(y)}}return a}getUrl(i){{const{type:n}=this;let{link:a}=this;if(n==="magic-link"){if(a.startsWith("ISBN"))return this.normalizeTitle(`BookSources/${a.slice(5)}`,-1,{temporary:!0}).getUrl(i);a=a.startsWith("RFC")?`https://datatracker.ietf.org/doc/html/rfc${a.slice(4)}`:`https://pubmed.ncbi.nlm.nih.gov/${a.slice(5)}`}else a.startsWith("//")&&(a=`https:${a}`);return new URL(a)}this.lspError("MagicLinkToken.getUrl")}getAttribute(i){return i==="invalid"?P(this,t,ar).call(this):super.getAttribute(i)}},e=new WeakMap,t=new WeakSet,ar=function(){if(this.type==="magic-link"){const{link:i}=this;if(i.startsWith("ISBN")){const n=[...i.slice(5)].map(a=>a==="X"?10:Number(a));return n.length===10?n.reduce((a,o,d)=>a+o*(10-d),0)%11!==0:n.length===13&&(n[12]===10||n.reduce((a,o,d)=>a+o*(d%2?3:1),0)%10!==0)}}return!1},r)}}),Gn,$i,Vn,ct,$a=N({"src/extLink.ts"(){"use strict";var e,t;Ze(),K(),We(),J(),Q(),Fr(),Gn=[Pe("[")],ct=(t=class extends(Vn=H){constructor(r,l="",i="",n,a=[]){super(void 0,n,a,{});O(this,e);const o=r&&/^\0\d+f\x7F$/u.test(r)?a[Number(r.slice(1,-2))]:new ns(r,"ext-link-url",n,a);if(this.insertAt(o),R(this,e,l),i){const d=new H(i,n,a,{});d.type="ext-link-text",d.setAttribute("stage",Se-1),this.insertAt(d)}}get type(){return"ext-link"}toString(r){return this.length===1?`[${super.toString(r)}${x(this,e)}]`:`[${super.toString(r,x(this,e))}]`}text(){return`[${super.text(" ")}]`}getGaps(){return x(this,e).length}lint(r=this.getAbsoluteIndex(),l){const i=super.lint(r,l),n="var-anchor",a=I.lintConfig.getSeverity(n,"extLink");return a&&this.length===1&&this.closest("heading-title")&&i.push(te(this,{start:r},n,"variable anchor in a section header",a)),i}print(){return super.print(this.length===1?{pre:"[",post:`${x(this,e)}]`}:{pre:"[",sep:x(this,e),post:"]"})}},e=new WeakMap,t),$i=re(Vn),ct=le($i,0,"ExtLinkToken",Gn,ct),ne($i,1,ct)}}),or,rd=N({"src/imagemapLink.ts"(){"use strict";Q(),ze(),Aa(),$a(),or=class extends H{get type(){return"imagemap-link"}constructor(e,t,s,r,l=[]){super(void 0,r,l),this.append(e,t.length===2?new Lr(...t,r,l):new ct(...t,r,l),new pe(s,r,l))}}}}),ka={};ie(ka,{ImagemapToken:()=>Dt});var Qn,ki,Jn,Dt,nd=N({"src/imagemap.ts"(){"use strict";K(),we(),ce(),Cr(),J(),Q(),ze(),wa(),rd(),Qn=[Os],Dt=class extends(Jn=H){get type(){return"ext-inner"}get image(){return this.childNodes.find(Ws("imagemap-image"))}constructor(e,t=I.getConfig(),s=[]){if(super(void 0,t,s,{}),!e)return;const r=e.split(`
13
+ `),l=new Set(t.protocol.split("|")),i=pe;let n=!0,a=!1;for(const o of r){const d=o.trim();if(!(a||!d||d.startsWith("#"))){if(n){const u=o.indexOf("|"),h=u===-1?o:o.slice(0,u),{valid:p,ns:c}=this.normalizeTitle(h,0,{halfParsed:!0,temporary:!0});if(p&&c===6){const m=new ht("imagemap",h,u===-1?void 0:o.slice(u+1),t,s);super.insertAt(m),n=!1;continue}else a=!0}else if(o.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(o);continue}else if(o.includes("[")){const u=o.indexOf("["),h=o.slice(u),p=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(h);if(p){if(this.normalizeTitle(p[1],0,{halfParsed:!0,temporary:!0,selfLink:!0}).valid){super.insertAt(new or(o.slice(0,u),p.slice(1),h.slice(h.indexOf("]]")+2),t,s));continue}}else if(h.startsWith("[//")||l.has(h.slice(1,h.indexOf(":")+1))||l.has(h.slice(1,h.indexOf("//")+2))){const c=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(h);if(c){super.insertAt(new or(o.slice(0,u),c.slice(1),h.slice(h.indexOf("]")+1),t,s));continue}}}}super.insertAt(new i(o,t,s))}}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),r=new de(this,e),{childNodes:l,image:i}=this,n="invalid-imagemap",a=I.lintConfig.getSeverity(n,i?"link":"image");return a&&(i?s.push(...l.filter(o=>{const d=o.toString().trim();return o.is("noinclude")&&d&&!d.startsWith("#")}).map(o=>{const d=X(o,r,n,"invalid link in <imagemap>",a);return d.suggestions=[{desc:"remove",range:[d.startIndex-1,d.endIndex],text:""},{desc:"comment",range:[d.startIndex,d.startIndex],text:"# "}],d})):s.push(te(this,r,n,"<imagemap> without an image",a))),s}getAttribute(e){return e==="invalid"?!this.image:super.getAttribute(e)}},ki=re(Jn),Dt=le(ki,0,"ImagemapToken",Qn,Dt),ne(ki,1,Dt)}}),Xn,_i,Kn,gt,_a=N({"src/nowiki/comment.ts"(){"use strict";K(),At(),We(),J(),st(),Xn=[et(!1),Pe("<!--")],gt=class extends(Kn=Me){constructor(t,s,r,l){super(t,r,l);ke(this,"closed");this.closed=s}get type(){return"comment"}lint(t=this.getAbsoluteIndex()){if(this.closed)return[];const s="unclosed-comment",r=I.lintConfig.getSeverity(s);if(!r)return[];const l=te(this,{start:t},s,I.msg("unclosed $1","HTML comment"),r);return l.suggestions=[{desc:"close",range:[l.endIndex,l.endIndex],text:"-->"}],[l]}toString(t){return t?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"&lt;!--",post:this.closed?"--&gt;":""})}},_i=re(Kn),gt=le(_i,0,"CommentToken",Xn,gt),ne(_i,1,gt)}}),Ca={};ie(Ca,{CommentedToken:()=>Ia});var Ia,ld=N({"src/commented.ts"(){"use strict";Q(),_a(),Ia=class extends H{get type(){return"ext-inner"}constructor(e,t,s=[]){if(super(void 0,t,s,{AstText:":",CommentToken:":"}),e){let r=e.indexOf("<!--"),l=r!==-1&&e.indexOf("-->",r+4),i=0;for(;l!==!1&&l!==-1;)r>i&&this.insertAt(e.slice(i,r)),this.insertAt(new gt(e.slice(r+4,l),!0,t,s)),i=l+3,r=e.indexOf("<!--",i),l=r!==-1&&e.indexOf("-->",r+4);i<e.length&&this.insertAt(e.slice(i))}}lint(e=this.getAbsoluteIndex()){return super.lint(e,new RegExp(String.raw`<\s*(?:\/\s*)?(${this.name})\b`,"giu"))}}}}),Ta={};ie(Ta,{NowikiToken:()=>Na});var Yn,Zn,Na,ad=N({"src/nowiki/index.ts"(){"use strict";var e,dr,s;St(),K(),J(),st(),Yn=Xe(r=>new RegExp(String.raw`<\s*(?:/\s*)${r==="nowiki"?"":"?"}(${r})\b`,"giu")),Zn=new Set(["img","languages","section","templatestyles"]),Na=(s=class extends Me{constructor(){super(...arguments);O(this,e)}get type(){return"ext-inner"}lint(l=this.getAbsoluteIndex()){const{name:i}=this,n="void-ext",a=I.lintConfig.getSeverity(n,i);if(a&&P(this,e,dr).call(this)){const o=te(this,{start:l},n,I.msg("nothing should be in <$1>",i),a);return o.fix={desc:"empty",range:[l,o.endIndex],text:""},[o]}return super.lint(l,Yn(i))}getAttribute(l){return l==="invalid"?P(this,e,dr).call(this):super.getAttribute(l)}},e=new WeakSet,dr=function(){const{name:l,firstChild:{data:i}}=this;return Zn.has(l)&&!!i},s)}}),el,Ci,tl,pt,La=N({"src/tagPair/ext.ts"(){"use strict";K(),ce(),J(),Sr(),Q(),yr(),_r(),el=[Ps()],pt=class extends(tl=Je){get type(){return"ext"}constructor(e,t,s,r,l=I.getConfig(),i=!1,n=[]){const a=e.toLowerCase(),o=new Es(!t||/^\s/u.test(t)?t:` ${t}`,"ext-attrs",a,l,n),d={...l,ext:l.ext.filter(h=>h!==a),excludes:[...l.excludes]};let u;switch(d.inExt=!0,a){case"tab":d.ext=d.ext.filter(h=>h!=="tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":case"langconvert":case"phonos":a==="poem"&&d.excludes.push("heading"),u=new H(s,d,n);break;case"pre":{const{PreToken:h}=(Xo(),ee(ia));u=new h(s,d,n);break}case"dynamicpagelist":{const{ParamTagToken:h}=(la(),ee(na));u=new h(i,s,d,n);break}case"inputbox":{const{InputboxToken:h}=(td(),ee(ca));u=new h(i,s,d,n);break}case"references":{const{NestedToken:h}=(xi(),ee(ks));d.excludes.push("heading"),u=new h(s,i,["ref"],d,n);break}case"choose":{const{NestedToken:h}=(xi(),ee(ks));u=new h(s,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],d,n);break}case"combobox":{const{NestedToken:h}=(xi(),ee(ks));u=new h(s,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],d,n);break}case"gallery":{const{GalleryToken:h}=(id(),ee(ya));u=new h(s,d,n);break}case"imagemap":{const{ImagemapToken:h}=(nd(),ee(ka));u=new h(s,d,n);break}case"hiero":{const{CommentedToken:h}=(ld(),ee(Ca));u=new h(s,d,n);break}default:{const{NowikiToken:h}=(ad(),ee(Ta));u=new h(s,d,n)}}u.setAttribute("name",a),u.type==="plain"&&(u.type="ext-inner"),super(e,o,u,r,l,n),this.seal("closed",!0)}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),r=new de(this,e);if(this.name!=="nowiki"){const n=this.inHtmlAttrs(),a="parsing-order",o=n&&I.lintConfig.getSeverity(a,n===2?"ext":"templateInTable");o&&s.push(te(this,r,a,"extension tag in HTML tag attributes",o))}const l="var-anchor",i=I.lintConfig.getSeverity(l,"ref");return i&&this.name==="ref"&&this.closest("heading-title")&&s.push(te(this,r,l,"variable anchor in a section header",i)),s}},Ci=re(tl),pt=le(Ci,0,"ExtToken",el,pt),ne(Ci,1,pt)}}),Fa={};ie(Fa,{parseCommentAndExt:()=>as});var Ii,sl,ms,il,Ti,as,Bs=N({"parser/commentAndExt.ts"(){"use strict";St(),he(),Go(),ze(),Vo(),Qo(),La(),_a(),Ii="<onlyinclude>",sl="</onlyinclude>",{length:ms}=Ii,il=[!1,!0].map(e=>{const t=e?"includeonly":"(?:no|only)include",s=e?"noinclude":"includeonly";return Dl(r=>new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${t}(?:\s[^>]*)?/?>|</${t}\s*>|<(${r.filter(l=>l!=="img").join("|")})(\s[^>]*?)?(?:/>|>([\s\S]*?)</(${"\\1"}\s*)>)|<(${s})(\s[^>]*?)?(?:/>|>([\s\S]*?)(?:</(${s}\s*)>|$))${r.includes("img")?String.raw`|<img(\s[^>]*?)?(/?)>`:""}`,"giu"))}),Ti=e=>{const t=e.indexOf(Ii);return{i:t,j:e.indexOf(sl,t+ms)}},as=(e,t,s,r)=>{if(r){let{i:a,j:o}=Ti(e);if(a!==-1&&o!==-1){let d="";const u=h=>{new pe(h,t,s),d+=`\0${s.length-1}n`};for(;a!==-1&&o!==-1;){const h=`\0${s.length}e`;new Bt(e.slice(a+ms,o),t,s),a>0&&u(e.slice(0,a)),d+=h,e=e.slice(o+ms+1),{i:a,j:o}=Ti(e)}return e&&u(e),d}}const{ext:l}=t,i=l.filter(a=>a!=="translate"&&a!=="tvar"),n={...t,ext:i};if(l.includes("translate")){const a=[];e=e.replace(/<nowiki>[\s\S]*?<\/nowiki>/giu,o=>(a.push(o),`\0${a.length-1}`)).replace(/<translate( nowrap)?>([\s\S]+?)?<\/translate>/gu,(o,d,u)=>{const h=s.length;return new Zl(d,u&&Re(u,a),n,s),`\0${h}g`}),e=Re(e,a)}return e.replace(il[r?1:0](i),(a,o,d,u,h,p,c,m,S,A,y)=>{const $=s.length;let f="n";if(o||i.includes("img")&&y!==void 0)f="e",new pt(o!=null?o:"img",o?d:A,u,o?h:y&&void 0,n,p,s);else if(a.startsWith("<!--")){f="c";const g=a.endsWith("-->");new gt(a.slice(4,g?-3:void 0),g,t,s)}else p?new Wt(p,c,m,S,t,s):new pe(a,t,s);return`\0${$}${f}`})}}}),rl,nl,ll,al,Ni,ol,Gt,od=N({"src/html.ts"(){"use strict";var e,t,s,r,l;K(),we(),ce(),Sr(),J(),Q(),rl=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),nl=new Set(["b","big","center","cite","code","del","dfn","em","font","i","ins","kbd","mark","pre","q","s","samp","small","strike","strong","sub","sup","tt","u","var"]),ll=new Set(["strike","big","center","font","tt"]),al=[Ps()],Gt=(l=class extends(ol=H){constructor(n,a,o,d,u,h){super(void 0,u,h);O(this,e);O(this,t);O(this,s);O(this,r);this.insertAt(a),this.setAttribute("name",n.toLowerCase()),R(this,e,o),R(this,t,d),R(this,s,n)}get type(){return"html"}get selfClosing(){return x(this,t)}get closing(){return x(this,e)}toString(n){return`<${this.closing?"/":""}${x(this,s)}${super.toString(n)}${x(this,t)?"/":""}>`}text(){const{closing:n}=this,a=x(this,s)+(n?"":super.text());return`<${n?"/":""}${a}${x(this,t)?"/":""}>`}getAttribute(n){return n==="invalid"?this.inTableAttrs()===2:n==="padding"?x(this,s).length+(this.closing?2:1):super.getAttribute(n)}lint(n=this.getAbsoluteIndex(),a){const o=super.lint(n,a),{name:d,parentNode:u,closing:h,selfClosing:p}=this,c=new de(this,n),m=this.inTableAttrs();let S="h1",A=I.lintConfig.getSeverity(S,"html");if(A&&d==="h1"&&!h){const b=te(this,c,S,"<h1>",A);b.suggestions=[{desc:"h2",range:[n+2,n+3],text:"2"}],o.push(b)}if(S="parsing-order",A=m&&I.lintConfig.getSeverity(S,m===2?"html":"templateInTable"),A){const b=te(this,c,S,"HTML tag in table attributes",A);m===2&&(b.fix={desc:"remove",range:[n,b.endIndex],text:""}),o.push(b)}S="obsolete-tag",A=I.lintConfig.getSeverity(S,d),A&&ll.has(d)&&o.push(te(this,c,S,"obsolete HTML tag",A)),S="bold-header",A=I.lintConfig.getSeverity(S,d),A&&(d==="b"||d==="strong")&&this.closest("heading-title")&&o.push(te(this,c,S,"bold in section header",A));const{html:[,y,$]}=this.getAttribute("config"),f=$.includes(d),g=y.includes(d),w=!f&&!g;if(S="unmatched-tag",h&&(p||f)||p&&w){if(A=I.lintConfig.getSeverity(S,h?"both":"selfClosing"),A){const b=te(this,c,S,h?"tag that is both closing and self-closing":"invalid self-closing tag",A),v={desc:"open",range:[n+1,n+2],text:""},k={desc:"no self-closing",range:[b.endIndex-2,b.endIndex-1],text:""};g?b.suggestions=[v,k]:h?b.fix=f?v:k:b.suggestions=[k,{desc:"close",range:[b.endIndex-2,b.endIndex],text:`></${d}>`}],o.push(b)}}else if(!this.findMatchingTag()){const b=te(this,c,S,h?"unmatched closing tag":"unclosed tag"),v=this.closest("magic-word");if(v&&rl.has(v.name))A=I.lintConfig.getSeverity(S,"conditional");else if(h)A=I.lintConfig.getSeverity(S,"closing"),b.suggestions=[{desc:"remove",range:[n,b.endIndex],text:""}];else{A=I.lintConfig.getSeverity(S,"opening");const k=u==null?void 0:u.childNodes;nl.has(d)&&(k!=null&&k.slice(0,k.indexOf(this)).some(({type:_,name:C})=>_==="html"&&C===d)&&(b.suggestions=[{desc:"close",range:[n+1,n+1],text:"/"}]),this.closest("heading-title")&&(b.rule="format-leakage",A=I.lintConfig.getSeverity("format-leakage",d)))}A&&(b.severity=A,o.push(b))}return o}findMatchingTag(){return Ke(x(this,r),()=>{const{name:n,parentNode:a,closing:o,selfClosing:d}=this,{html:[,u,h]}=this.getAttribute("config"),p=h.includes(n),c=u.includes(n);if(p||c&&d)return this;if(!a)return;const{childNodes:m}=a,S=m.indexOf(this),A=o?m.slice(0,S).reverse():m.slice(S+1),y=[this],{rev:$}=ve;for(const f of A)if(!(!f.is("html")||f.name!==n||c&&x(f,t)))if(x(f,e)===o)y.push(f);else{const g=y.pop();if(g===this)return f;I.viewOnly&&(R(g,r,[$,f]),R(f,r,[$,g]))}if(I.viewOnly)for(const f of y)R(f,r,[$,void 0])},n=>{R(this,r,n),n[1]&&n[1]!==this&&R(n[1],r,[ve.rev,this])})}print(){return super.print({pre:`&lt;${this.closing?"/":""}${x(this,s)}`,post:`${x(this,t)?"/":""}&gt;`})}json(n,a=this.getAbsoluteIndex()){const o=super.json(void 0,a);return Object.assign(o,{closing:this.closing,selfClosing:x(this,t)}),o}},e=new WeakMap,t=new WeakMap,s=new WeakMap,r=new WeakMap,l),Ni=re(ol),Gt=le(Ni,0,"HtmlToken",al,Gt),ne(Ni,1,Gt)}}),ja={};ie(ja,{parseHtml:()=>Ra});var dl,Ra,dd=N({"parser/html.ts"(){"use strict";_r(),od(),dl=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,Ra=(e,t,s)=>{var n;const{html:r}=t;(n=t.htmlElements)!=null||(t.htmlElements=new Set([...r[0],...r[1],...r[2]]));const l=e.split("<");let i=l.shift();for(const a of l){const o=dl.exec(a),d=o==null?void 0:o[2],u=d==null?void 0:d.toLowerCase();if(!o||!t.htmlElements.has(u)){i+=`<${a}`;continue}const[,h,,p="",c,m]=o,{length:S}=s,A=new Es(p,"html-attrs",u,t,s),y=A.hasAttr("itemprop");if(u==="meta"&&!(y&&A.hasAttr("content"))||u==="link"&&!(y&&A.hasAttr("href"))){i+=`<${a}`,s.length=S;continue}i+=`\0${s.length}x${m}`,new Gt(d,A,h==="/",c==="/>",t,s)}return i}}}),jr,Pa=N({"src/table/base.ts"(){"use strict";Sr(),Q(),$t(),_r(),jr=class extends Ps(1)(H){constructor(e,t,s,r,l,i=[],n){super(void 0,l,i,n),this.append(new tt(t,"table-syntax",l,i),new Es(r,"table-attrs",s,l,i))}}}}),ul,Li,Ne,xs,jt,Rt,Ts,Ea=N({"src/table/td.ts"(){"use strict";K(),ce(),wr(),J(),Q(),Pa(),Ts=class extends(Li=jr,ul=[Fs(!1)],Li){constructor(e,t,s,r=[]){var a;let l=/\||\0\d+!\x7F/u.exec(t!=null?t:""),i=l?t.slice(0,l.index):"";/\[\[|-\{/u.test(i)&&(l=null,i=""),super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",i,s,r),ne(xs,5,this),je(this,jt),je(this,Ne,""),l&&([qo(this,Ne)._]=l);const n=new H(t==null?void 0:t.slice(((a=l==null?void 0:l.index)!=null?a:NaN)+ge(this,Ne).length),s,r);n.type="td-inner",n.setAttribute("stage",4),this.insertAt(n)}get type(){return"td"}get rowspan(){return this.getAttr("rowspan")}get colspan(){return this.getAttr("colspan")}get subtype(){return ft(this,jt,Rt).call(this).subtype}afterBuild(){ge(this,Ne).includes("\0")&&Ce(this,Ne,this.buildFromStr(ge(this,Ne),0)),super.afterBuild()}toString(e){const{childNodes:[t,s,r]}=this;return t.toString(e)+s.toString(e)+ge(this,Ne)+r.toString(e)}text(){const{childNodes:[e,t,s]}=this;return e.text()+t.text()+ge(this,Ne)+s.text()}getGaps(e){return e===1?ge(this,Ne).length:0}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),r=new de(this,e+this.getRelativeIndex(this.length-1)),l="pipe-like",i=["td","double"].map(n=>I.lintConfig.getSeverity(l,n));for(const n of this.lastChild.childNodes)if(n.type==="text"){const{data:a}=n;if(a.includes("|")){const o=a.includes("||"),d=i[o?1:0];if(d){const u=X(n,r,l,'additional "|" in a table cell',d);if(o){const h={caption:"|+",td:"|",th:"!"}[this.subtype];u.fix={desc:"newline",range:[u.startIndex,u.endIndex],text:a.replace(/\|\|/gu,`
14
+ ${h}`)}}else u.suggestions=[{desc:"escape",range:[u.startIndex,u.endIndex],text:a.replace(/\|/gu,"&#124;")}];s.push(u)}}}return s}isIndependent(){return this.firstChild.text().startsWith(`
15
+ `)}getAttr(e){const t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}print(){const{childNodes:[e,t,s]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${ge(this,Ne)}${s.print()}</span>`}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t),{rowspan:r,colspan:l}=this;return Object.assign(s,{subtype:this.subtype},r!==1&&{rowspan:r},l!==1&&{colspan:l}),s}},xs=re(Li),Ne=new WeakMap,jt=new WeakSet,Rt=function(){var e;const t=this.firstChild.text(),s=t.slice(-1);let r="td";if(s==="!"?r="th":s==="+"&&(r="caption"),this.isIndependent())return{subtype:r};const{previousSibling:l}=this;return{...ft(e=l,jt,Rt).call(e)}},Rt=le(xs,17,"#getSyntax",ul,jt,Rt),Ls(xs,Ts)}}),Rr,Oa=N({"src/table/trBase.ts"(){"use strict";K(),J(),Pa(),Ea(),Rr=class extends jr{lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),r=this.childNodes.find(({type:a})=>a==="table-inter");if(!r)return s;const l=Kt(r),i="fostered-content",n=l&&I.lintConfig.getSeverity(i,l===2?void 0:"transclusion");if(n){const a=X(r,{start:e},i,"content to be moved outside the table",n);a.startIndex++,a.startLine++,a.startCol=0,s.push(a)}return s}getRowCount(){return Number(this.childNodes.some(e=>e instanceof Ts&&e.isIndependent()&&!e.firstChild.text().endsWith("+")))}}}}),hl,cl,gl,pl,Fi,vs,_s,ud=N({"src/table/index.ts"(){"use strict";K(),we(),ce(),wr(),J(),Oa(),$t(),hl=(e,t)=>new Array(e).fill(void 0).map((s,r)=>t(r)),cl=({type:e})=>e==="tr"||e==="table-syntax",gl=class extends Array{},_s=class extends(Fi=Rr,pl=[Fs(!1)],Fi){constructor(e,t,s,r){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,e,"table",t,s,r,{}),ne(vs,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),r=new de(this,e),l=["unclosed-table","table-layout"],i=l.map(n=>I.lintConfig.getSeverity(n));if(i[0]&&!this.closed&&s.push(X(this.firstChild,r,l[0],I.msg("unclosed $1","table"),i[0])),i[1]){const n=this.getLayout(),{length:a}=n;if(a>1){let o=1,d=1/0,u=0;for(;u<a;u++){const h=n[u],p=h.length;if(p<o)break;p<d&&(d=p);const c=h.indexOf(h[p-1])+1;if(c>d)break;c>o&&(o=c)}if(u<a){const h=this.getNthRow(u),p=X(h,r,l[1],"inconsistent table layout",i[1]);p.startIndex++,p.startLine++,p.startCol=0,s.push(p)}}}return s}close(e=`
16
+ |}`,t){const s=this.getAttribute("config"),r=this.getAttribute("accum"),l=[e];ve.run(()=>{const i=new tt(void 0,"table-syntax",s,r);super.insertAt(i)}),this.lastChild.safeReplaceChildren(l)}getLayout(e){const t=this.getAllRows(),{length:s}=t,r=gl.from(hl(s,()=>[]));for(let l=0;l<r.length;l++){const i=r[l];let n=0,a=0,o;for(const d of t[l].childNodes.slice(2))if(d.is("td")){if(d.isIndependent()&&(o=d.subtype!=="caption"),o){const u={row:l,column:n},{rowspan:h,colspan:p}=d;for(n++;i[a];)a++;for(let c=l;c<Math.min(l+h,s);c++)for(let m=a;m<a+p;m++)r[c][m]=u;a+=p}}else if(cl(d))break}return r}getAllRows(){return[...super.getRowCount()?[this]:[],...this.childNodes.slice(1).filter(e=>e.is("tr")&&e.getRowCount()>0)]}getNthRow(e,t,s){const r=super.getRowCount();if(e===0&&r)return this;r&&e--;for(const l of this.childNodes.slice(2)){const{type:i}=l;if(i==="tr"&&l.getRowCount()&&(e--,e<0))return l}}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t);return s.closed=this.closed,s}},vs=re(Fi),le(vs,1,"getLayout",pl,_s),Ls(vs,_s)}}),qa,hd=N({"src/table/tr.ts"(){"use strict";Oa(),qa=class extends Rr{get type(){return"tr"}constructor(e,t,s,r){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,e,"tr",t,s,r)}}}}),Pr,Ba=N({"src/nowiki/listBase.ts"(){"use strict";st(),Pr=class extends Me{get indent(){return this.innerText.split(":").length-1}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t),{indent:r}=this;return r&&(s.indent=r),s}}}}),Er,Wa=N({"src/nowiki/dd.ts"(){"use strict";Ba(),Er=class extends Pr{get type(){return"dd"}}}}),Ua={};ie(Ua,{parseTable:()=>Ma});var fl,ji,Ma,cd=N({"parser/table.ts"(){"use strict";Q(),ud(),hd(),Ea(),Wa(),fl=e=>e.lastChild.constructor!==H,ji=(e,t)=>e.is("td")?t.pop():e,Ma=({firstChild:{data:e},type:t,name:s},r,l)=>{const i=[],n=e.split(`
17
+ `);let a=t==="root"||t==="parameter-value"||t==="ext-inner"&&s==="poem"?"":`
18
+ ${n.shift()}`,o;const d=(u,h)=>{if(!h){a+=u;return}const{lastChild:p}=h;if(fl(h)){const c=new H(u,r,l);c.type="table-inter",c.setAttribute("stage",3),h.insertAt(c)}else p.setText(p.toString()+u)};for(const u of n){o=i.pop();const[h]=/^(?:\s|\0\d+[cno]\x7F)*/u.exec(u),p=u.slice(h.length),c=/^(:*)((?:\s|\0\d+[cn]\x7F)*)(\{\||\{(?:\0\d+[cn]\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(p);if(c){for(;o&&!o.is("td");)o=i.pop();const[,f,g,w,b]=c;f&&new Er(f,r,l),d(`
19
+ ${h}${f&&`\0${l.length-1}d`}${g}\0${l.length}b`,o),i.push(...o?[o]:[],new _s(w,b,r,l));continue}else if(!o){a+=`
20
+ ${u}`;continue}const m=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(p);if(!m){d(`
21
+ ${u}`,o),i.push(o);continue}const[,S,A,y,$]=m;if(S){for(;!o.is("table");)o=i.pop();o.close(`
22
+ ${h}${S}`,!0),d($,i[i.length-1])}else if(A){o=ji(o,i),o.is("tr")&&(o=i.pop());const f=new qa(`
23
+ ${h}${A}`,$,r,l);i.push(o,f),o.insertAt(f)}else{o=ji(o,i);const f=y==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu;let g=f.exec($),w=0,b=`
24
+ ${h}${y}`;const v=k=>{const _=new Ts(b,$.slice(w,g==null?void 0:g.index),r,l);return k.insertAt(_),_};for(;g;)v(o),{lastIndex:w}=f,[b]=g,g=f.exec($);i.push(o,v(o))}}return a.slice(1)}}}),za,gd=N({"src/nowiki/hr.ts"(){"use strict";st(),za=class extends Me{get type(){return"hr"}}}}),ml,Ri,xl,Vt,pd=N({"src/nowiki/doubleUnderscore.ts"(){"use strict";At(),We(),st(),ml=[et(),Pe("__")],Vt=class extends(xl=Me){get type(){return"double-underscore"}constructor(e,t,s,r){var a,o;super(e,s,r);const l=e.toLowerCase(),{doubleUnderscore:[,,i,n]}=s;this.setAttribute("name",(o=t?(a=n==null?void 0:n[e])==null?void 0:a.toLowerCase():i==null?void 0:i[l])!=null?o:l)}toString(){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}},Ri=re(xl),Vt=le(Ri,0,"DoubleUnderscoreToken",ml,Vt),ne(Ri,1,Vt)}}),Ha={};ie(Ha,{parseHrAndDoubleUnderscore:()=>Da});var Da,fd=N({"parser/hrAndDoubleUnderscore.ts"(){"use strict";gd(),pd(),aa(),Da=({firstChild:{data:e},type:t,name:s},r,l)=>{var o,d,u;const{doubleUnderscore:[i,n,a]}=r;return(o=r.insensitiveDoubleUnderscore)!=null||(r.insensitiveDoubleUnderscore=new Set(i)),(d=r.sensitiveDoubleUnderscore)!=null||(r.sensitiveDoubleUnderscore=new Set(n)),(u=r.regexHrAndDoubleUnderscore)!=null||(r.regexHrAndDoubleUnderscore=new RegExp(`__(${[...i,...n].join("|")})__`,"giu")),t!=="root"&&(t!=="ext-inner"||s!=="poem")&&(e=`\0${e}`),e=e.replace(/^((?:\0\d+[cno]\x7F)*)(-{4,})/gmu,(h,p,c)=>(new za(c,r,l),`${p}\0${l.length-1}r`)).replace(r.regexHrAndDoubleUnderscore,(h,p)=>{var A;const c=r.sensitiveDoubleUnderscore.has(p),m=p.toLowerCase(),S=r.insensitiveDoubleUnderscore.has(m);return c||S?(new Vt(p,c,r,l),`\0${l.length-1}${S&&((A=a==null?void 0:a[m])!=null?A:m)==="toc"?"u":"n"}`):h}).replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(h,p,c,m,S)=>{const A=`${p}\0${l.length}h`;return new Ir(c.length,[m,S],r,l),A}),t==="root"||t==="ext-inner"&&s==="poem"?e:e.slice(1)}}}),Ga,md=N({"src/nowiki/quote.ts"(){"use strict";var e,t;K(),ce(),J(),st(),Ga=(t=class extends Me{constructor(r,l,i,n){super(r,i,n);O(this,e);R(this,e,l)}get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}get closing(){return{...this.bold?{bold:x(this,e).bold}:void 0,...this.italic?{italic:x(this,e).italic}:void 0}}text(){const{parentNode:r,innerText:l}=this;return r!=null&&r.is("image-parameter")&&r.name!=="caption"?"":l}lint(r=this.getAbsoluteIndex()){const{previousSibling:l,bold:i,closing:n}=this,a=(l==null?void 0:l.type)==="text"?l.data:void 0,o=[],d=new de(this,r),u=["lonely-apos","bold-header"],h=[void 0,"word"].map(c=>I.lintConfig.getSeverity(u[0],c)),p=I.lintConfig.getSeverity(u[1]);if(a!=null&&a.endsWith("'")){const c=h[(n.bold||n.italic)&&/[a-z\d]'$/iu.test(a)?1:0];if(c){const m=te(this,d,u[0],I.msg('lonely "$1"',"'"),c),{startIndex:S,startLine:A,startCol:y}=m,[,{length:$}]=/(?:^|[^'])('+)$/u.exec(a),f=r-$;o.push({...m,startIndex:f,endIndex:S,endLine:A,startCol:y-$,endCol:y,suggestions:[{desc:"escape",range:[f,S],text:"&apos;".repeat($)},{desc:"remove",range:[f,S],text:""}]})}}if(p&&i&&this.closest("heading-title")){const c=te(this,d,u[1],"bold in section header",p);c.suggestions=[{desc:"remove",range:[r,r+3],text:""}],o.push(c)}return o}json(r,l=this.getAbsoluteIndex()){const i=super.json(void 0,l);return Object.assign(i,{bold:this.bold,italic:this.italic}),i}},e=new WeakMap,t)}}),Va={};ie(Va,{parseQuotes:()=>Or});var Or,Qa=N({"parser/quotes.ts"(){"use strict";md(),Or=(e,t,s,r)=>{var c;const l=e.split(/('{2,})/u),{length:i}=l;if(i===1)return e;let n=0,a=0,o,d,u;for(let m=1;m<i;m+=2){const S=l[m].length;switch(S){case 2:a++;break;case 4:l[m-1]+="'",l[m]="'''";case 3:if(n++,o!==void 0)break;l[m-1].endsWith(" ")?d===void 0&&u===void 0&&(u=m):l[m-1].slice(-2,-1)===" "?o=m:d!=null||(d=m);break;default:l[m-1]+="'".repeat(S-5),l[m]="'''''",a++,n++}}if(a%2===1&&n%2===1){const m=(c=o!=null?o:d)!=null?c:u;m!==void 0&&(l[m]="''",l[m-1]+="'")}let h=!0,p=!0;for(let m=1;m<i;m+=2){const S=l[m].length,A=S!==2,y=S!==3;A&&(h=!h),y&&(p=!p),new Ga(l[m],{bold:A&&h,italic:y&&p},t,s),l[m]=`\0${s.length-1}q`}return l.join("")}}}),Ja={};ie(Ja,{parseExternalLinks:()=>qr});var qr,Xa=N({"parser/externalLinks.ts"(){"use strict";he(),$a(),Fr(),qr=(e,t,s,r)=>{var l;return(l=t.regexExternalLinks)!=null||(t.regexExternalLinks=new RegExp(String.raw`\[(\0\d+f\x7F|(?:(?:${t.protocol}|//)${mt}|\0\d+m\x7F)${xt}(?=[[\]<>"\t${Be}]|\0\d))([${Be}]*(?![${Be}]))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),e.replace(t.regexExternalLinks,(i,n,a,o)=>{const{length:d}=s,u=/&[lg]t;/u.exec(n);return u&&(a="",o=n.slice(u.index)+a+o,n=n.slice(0,u.index)),r?(new ns(n,"ext-link-url",t,s),`[\0${d}f${a}${o}]`):(new ct(n,a,o,t,s),`\0${d}w`)})}}}),Ka,xd=N({"src/link/category.ts"(){"use strict";he(),js(),Ka=class extends qe{get type(){return"category"}get sortkey(){const{childNodes:[,e]}=this;return e&&ss(e.text())}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t),{sortkey:r}=this;return r&&(s.sortkey=r),s}}}}),Ya={};ie(Ya,{parseLinks:()=>ur});var vl,ur,vd=N({"parser/links.ts"(){"use strict";J(),Qa(),Xa(),Aa(),ba(),xd(),vl=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)([\s\S]*)$/u,ur=(e,t,s,r)=>{var a;(a=t.regexLinks)!=null||(t.regexLinks=new RegExp(String.raw`^\s*(?:${t.protocol}|//)`,"iu"));const l=t.inExt?/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]]))?\]\]([\s\S]*)$/u:/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]])?)?\]\]([\s\S]*)$/u,i=e.split("[[");let n=i.shift();for(let o=0;o<i.length;o++){let d=!1,u,h,p,c;const m=i[o],S=l.exec(m);if(S)[,u,h,p,c]=S,c.startsWith("]")&&(p!=null&&p.includes("["))&&(p+="]",c=c.slice(1));else{const g=vl.exec(m);g&&(d=!0,[,u,h,p]=g)}if(u===void 0||t.regexLinks.test(u)||/\0\d+[exhbru]\x7F/u.test(u)){n+=`[[${m}`;continue}const A=u.trim().startsWith(":");if(A&&d){n+=`[[${m}`;continue}const{ns:y,valid:$}=I.normalizeTitle(u,0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0});if($){if(d){if(y!==6){n+=`[[${m}`;continue}let g=!1;for(o++;o<i.length;o++){const w=i[o],b=w.split("]]");if(b.length>2){g=!0,p+=`[[${b[0]}]]${b[1]}`,c=b.slice(2).join("]]");break}else if(b.length===2)p+=`[[${b[0]}]]${b[1]}`;else{p+=`[[${w}`;break}}if(p=ur(p,t,s,r),!g){n+=`[[${u}${h}${p}`;continue}}}else{n+=`[[${m}`;continue}p&&(p=Or(p,t,s,r));let f=Lr;A||(y===6?(p&&(p=qr(p,t,s,!0)),f=Nr):y===14&&(f=Ka)),p===void 0&&h&&(p=""),n+=`\0${s.length}l${c}`,new f(u,p,t,s,h)}return n}}}),Za={};ie(Za,{parseMagicLinks:()=>eo});var Pi,Ei,Oi,qi,eo,bd=N({"parser/magicLinks.ts"(){"use strict";he(),Fr(),Pi=String.raw`[${Be}\t]|&nbsp;|&#0*160;|&#x0*a0;`,Ei=`(?:${Pi})+`,Oi=`(?:${Pi}|-)`,qi=String.raw`(?:RFC|PMID)${Ei}\d+\b|ISBN${Ei}(?:97[89]${Oi}?)?(?:\d${Oi}?){9}[\dx]\b`,eo=(e,t,s)=>{if(!t.regexMagicLinks)try{t.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${t.protocol})(${mt}${xt})|${qi})`,"giu")}catch{t.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${t.protocol})(${mt}${xt})|${qi})`,"giu")}return e.replace(t.regexMagicLinks,(r,l,i)=>{let n=l?r.slice(l.length):r;if(i){let a="";const o=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(n);o&&(a=n.slice(o.index),n=n.slice(0,o.index));const d=n.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,u=d.exec(n);if(u){let h=1;u[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(n.slice(0,u.index))&&(h=2),a=n.slice(u.index+h)+a,n=n.slice(0,u.index+h)}return a.length>=i.length?r:(new ns(n,void 0,t,s),`${l}\0${s.length-1}w${a}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(n))return r;return new ns(n,"magic-link",t,s),`${l}\0${s.length-1}i`})}}}),to,wd=N({"util/html.ts"(){"use strict";to=(e,t)=>e.startsWith(t)?t.length:[...t].findIndex((s,r)=>s!==e[r])}}),so,yd=N({"src/nowiki/list.ts"(){"use strict";Ba(),so=class extends Pr{get type(){return"list"}}}}),io={};ie(io,{parseList:()=>ro});var ro,Sd=N({"parser/list.ts"(){"use strict";wd(),yd(),Wa(),ro=(e,t,s,r)=>{const l=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(e);if(!l)return t.lastPrefix="",e;const[i,n,a,o]=l,d=a.replace(/;/gu,":"),u=to(d,t.lastPrefix),h=((u>1?a.slice(u-1):a)+o).split(/(?=;)/u),p=h[0].startsWith(";");let c=h.length-(p?0:1);if(u>1){const C=a.slice(0,u-1);if(p){const E=C.split(/(?=;)/u);h.unshift(...E),c+=C.includes(";")?E.length:0}else h[0]=C+h[0]}t.lastPrefix=d;let m=n+h.map((C,E)=>`\0${r.length+E}d`).join("")+e.slice(i.length);for(const C of h)new so(C,s,r);if(!c)return m;const{html:[S,,A]}=s,y=/:+|-\{|\0\d+[xq]\x7F/gu;let $=y,f=$.exec(m),g=0,w=!1,b=!1,v=0;const k=(C,E)=>(new Er(C,s,r),`${m.slice(0,E)}\0${r.length-1}d${m.slice(E+C.length)}`),_=C=>{C?g&&g--:g++};for(;f&&c;){const{0:C,index:E}=f;if(C==="-{"){if(!v){const{lastIndex:T}=$;$=/-\{|\}-/gu,$.lastIndex=T}v++}else if(C==="}-"){if(v--,!v){const{lastIndex:T}=$;$=y,$.lastIndex=T}}else if(C.endsWith("x")){const{name:T,closing:L,selfClosing:B}=r[Number(C.slice(1,-2))];(S.includes(T)||!B&&!A.includes(T))&&_(L)}else if(C.endsWith("q")){const{bold:T,italic:L}=r[Number(C.slice(1,-2))];T&&(_(w),w=!w),L&&(_(b),b=!b)}else if(g===0){if(C.length>=c)return k(C.slice(0,c),E);c-=C.length,$.lastIndex=E+4+String(r.length).length,m=k(C,E)}f=$.exec(m)}return m}}}),bs,bl,Bi,wl,Qt,Ad=N({"src/converterFlags.ts"(){"use strict";var e,t;K(),ce(),Rs(),J(),Q(),Ue(),bs=new Set(["A","T","R","D","-","H","N"]),bl=[ls()],Qt=(t=class extends(wl=H){constructor(r,l,i=[]){super(void 0,l,i,{});O(this,e);this.safeAppend(r.map(n=>new be(n,"converter-flag",l,i)))}get type(){return"converter-flags"}afterBuild(){R(this,e,this.childNodes.map(r=>r.text().trim())),super.afterBuild()}toString(r){return super.toString(r,";")}text(){return super.text(";")}getUnknownFlags(){return new Set(x(this,e).filter(r=>/\{{3}[^{}]+\}{3}/u.test(r)))}getVariantFlags(){const r=new Set(this.getAttribute("config").variants);return new Set(x(this,e).filter(l=>r.has(l)))}isInvalidFlag(r,l,i,n){return typeof r=="object"&&(r=r.text().trim(),l=this.getVariantFlags(),i=this.getUnknownFlags(),n=new Set(x(this,e).filter(a=>bs.has(a)))),!!r&&!l.has(r)&&!i.has(r)&&(l.size>0||!n.has(r))}lint(r=this.getAbsoluteIndex(),l){const i=this.getVariantFlags(),n=this.getUnknownFlags(),a=new Set(x(this,e).filter(c=>bs.has(c))),o=x(this,e).filter(c=>!c).length,d=x(this,e).length-n.size-o,u=super.lint(r,l);if(i.size===d||a.size===d)return u;const h="no-ignored",p=I.lintConfig.getSeverity(h,"conversionFlag");if(p){const c=new de(this,r);for(let m=0;m<this.length;m++){const S=this.childNodes[m],A=S.text().trim();if(this.isInvalidFlag(A,i,n,a)){const y=X(S,c,h,"invalid conversion flag",p);i.size===0&&bs.has(A.toUpperCase())?y.fix={desc:"uppercase",range:[y.startIndex,y.endIndex],text:A.toUpperCase()}:y.suggestions=[{desc:"remove",range:[y.startIndex-(m&&1),y.endIndex],text:""}],u.push(y)}}}return u}print(){return super.print({sep:";"})}},e=new WeakMap,t),Bi=re(wl),Qt=le(Bi,0,"ConverterFlagsToken",bl,Qt),ne(Bi,1,Qt)}}),Cs,$d=N({"src/converterRule.ts"(){"use strict";J(),Q(),Ue(),Cs=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=I.getConfig(),r=[]){super(void 0,s,r);const l=e.indexOf(":"),i=e.slice(0,l).indexOf("=>"),n=i===-1?e.slice(0,l):e.slice(i+2,l);t&&s.variants.includes(n.trim().toLowerCase())?(super.insertAt(new be(n,"converter-rule-variant",s,r)),super.insertAt(new be(e.slice(l+1),"converter-rule-to",s,r)),i!==-1&&super.insertAt(new be(e.slice(0,i),"converter-rule-from",s,r),0)):super.insertAt(new be(e,"converter-rule-to",s,r))}toString(e){const{childNodes:t,firstChild:s,lastChild:r}=this;return t.length===3?`${s.toString(e)}=>${t[1].toString(e)}:${r.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,r]=e;return`<span class="wpb-converter-rule">${t.print()}=>${s.print()}:${r.print()}</span>`}return super.print({sep:":"})}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t);return s.variant=this.variant,s}}}}),yl,Wi,Sl,Jt,kd=N({"src/converter.ts"(){"use strict";he(),We(),Q(),Ad(),$d(),yl=[Pe("-{")],Jt=class extends(Sl=H){get type(){return"converter"}constructor(e,t,s,r=[]){super(void 0,s,r),this.insertAt(new Qt(e,s,r));const[l]=t,i=l.includes(":"),n=new Cs(l,i,s,r);i&&n.length===1||!i&&t.length===2&&!Ie(t[1]).trim()?this.insertAt(new Cs(t.join(";"),!1,s,r)):this.append(n,...t.slice(1).map(a=>new Cs(a,!0,s,r)))}toString(e){const{childNodes:[t,...s]}=this;return`-{${t.toString(e)}${t.length>0?"|":""}${s.map(r=>r.toString(e)).join(";")}}-`}text(){const{childNodes:[e,...t]}=this;return`-{${e.text()}|${Ye(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?"|":""}${bt(t,{sep:";"})}}-</span>`}},Wi=re(Sl),Jt=le(Wi,0,"ConverterToken",yl,Jt),ne(Wi,1,Jt)}}),no={};ie(no,{parseConverter:()=>lo});var lo,_d=N({"parser/converter.ts"(){"use strict";kd(),lo=(e,t,s)=>{var o;(o=t.regexConverter)!=null||(t.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${t.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"iu"));const r=/-\{/gu,l=/-\{|\}-/gu,i=[];let n=r,a=n.exec(e);for(;a;){const{0:d,index:u}=a;if(d==="}-"){const h=i.pop(),{length:p}=s,c=e.slice(h.index+2,u),m=c.indexOf("|"),[S,A]=m===-1?[[],c]:[c.slice(0,m).split(";"),c.slice(m+1)],y=A.replace(/(&[#a-z\d]+);/giu,"$1"),$=y.split(t.regexConverter).map(f=>f.replace(/\x01/gu,";"));new Jt(S,$,t,s),e=`${e.slice(0,h.index)}\0${p}v${e.slice(u+2)}`,i.length===0&&(n=r),n.lastIndex=h.index+3+String(p).length}else i.push(a),n=l,n.lastIndex=u+2;a=n.exec(e)}return e}}}),Zt={};ie(Zt,{Token:()=>H});var Al,H,Q=N({"src/index.ts"(){"use strict";var e,t,s,r,l,i,n,a,ao,oo,uo,ho,co,go,po,fo,mo,xo,vo,bo,g;he(),Ze(),K(),we(),J(),Uo(),Mo(),Al=["category","html-attr#id,ext-attr#id,table-attr#id"],H=(g=class extends Ql{constructor(v,k=I.getConfig(),_=[],C){super();O(this,a);O(this,e,"plain");O(this,t,0);O(this,s);O(this,r);O(this,l);O(this,i,!1);O(this,n);typeof v=="string"&&this.insertAt(v),R(this,s,k),R(this,r,_),_.push(this)}get type(){return x(this,e)}set type(v){R(this,e,v)}parseOnce(v=x(this,t),k=!1,_){if(v<x(this,t)||this.length===0||!this.isPlain())return this;if(x(this,t)>=Se)return this;switch(v){case 0:if(this.type==="root"){x(this,r).pop();const C=P(this,a,ao).call(this);k&&(k=!C)}R(this,l,k),P(this,a,oo).call(this,k);break;case 1:P(this,a,uo).call(this);break;case 2:P(this,a,ho).call(this);break;case 3:P(this,a,co).call(this);break;case 4:P(this,a,go).call(this);break;case 5:P(this,a,po).call(this,_);break;case 6:P(this,a,fo).call(this,_);break;case 7:P(this,a,mo).call(this);break;case 8:P(this,a,xo).call(this);break;case 9:P(this,a,vo).call(this);break;case 10:P(this,a,bo).call(this)}if(this.type==="root")for(const C of x(this,r))C==null||C.parseOnce(v,k,_);return Wr(this,t)._++,this}buildFromStr(v,k){const _=v.split(/[\0\x7F]/u).map((C,E)=>{if(E%2===0)return new sr(C);if(isNaN(C.slice(-1)))return x(this,r)[Number(C.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${C}`)});return k===0?_.map(String).join(""):k===1?Ye(_):_}build(){R(this,t,Se);const{length:v,firstChild:k}=this,_=k==null?void 0:k.toString();if(v===1&&k.type==="text"&&_.includes("\0")&&(Ns(this,0,1,this.buildFromStr(_)),this.normalize(),this.type==="root"))for(const C of x(this,r))C==null||C.build()}afterBuild(){if(this.type==="root")for(const v of x(this,r))v==null||v.afterBuild();R(this,i,!0)}parse(v=Se,k,_){for(v=Math.min(v,Se);x(this,t)<v;)this.parseOnce(x(this,t),k,_);return v&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===g}getAttribute(v){var k;switch(v){case"config":return x(this,s);case"include":return(k=x(this,l))!=null?k:!!x(this.getRootNode(),l);case"accum":return x(this,r);case"built":return x(this,i);case"stage":return x(this,t);case"invalid":return this.type==="table-inter"&&Kt(this)===2;default:return super.getAttribute(v)}}setAttribute(v,k){switch(v){case"stage":x(this,t)===0&&this.type==="root"&&x(this,r).shift(),R(this,t,k);break;default:super.setAttribute(v,k)}}insertAt(v,k=this.length){const _=typeof v=="string"?new sr(v):v;super.insertAt(_,k);const{type:C}=_;return C==="root"&&(_.type="plain"),_}normalizeTitle(v,k=0,_){return I.normalizeTitle(v,k,x(this,l),x(this,s),_)}inTableAttrs(){var v,k;return((v=this.closest("table-attrs,ext"))==null?void 0:v.type)==="table-attrs"&&((k=this.closest("table-attrs,arg,magic-word,template"))!=null&&k.is("table-attrs")?2:1)}inHtmlAttrs(){var v;return(v=this.closest("html-attrs,ext"))!=null&&v.is("html-attrs")?2:this.inTableAttrs()}lint(v=this.getAbsoluteIndex(),k){var C;let _=super.lint(v,k);if(this.type==="root"){const E=new Map,T="no-duplicate",L=["category","id"].map(q=>I.lintConfig.getSeverity(T,q)),B=Al.filter((q,M)=>L[M]).join();if(B){for(const q of this.querySelectorAll(B)){let M;if(q.is("category"))M=q.name;else{const D=q.getValue();D&&D!==!0&&(M=`#${D}`)}if(M){const D=E.get(M);D?D.add(q):E.set(M,new Set([q]))}}for(const[q,M]of E)if(M.size>1&&!q.startsWith("#mw-customcollapsible-")){const D=!q.startsWith("#"),G=`duplicated ${D?"category":"id"}`,Z=L[D?0:1];_.push(...[...M].map(Y=>{const se=te(Y,{start:Y.getAbsoluteIndex()},T,G,Z);return D&&(se.suggestions=[{desc:"remove",range:[se.startIndex,se.endIndex],text:""}]),se}))}}const j=/<!--\s*lint-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->/gu,F=this.toString(),U=[];let W=j.exec(F);for(;W;){const{1:q,index:M}=W,D=(C=W[2])==null?void 0:C.trim();U.push({line:this.posFromIndex(M).top+(q==="disable-line"?0:1),from:q==="disable"?j.lastIndex:void 0,to:q==="enable"?j.lastIndex:void 0,rules:D?new Set(D.split(",").map(G=>G.trim())):void 0}),W=j.exec(F)}if(_=_.filter(({rule:q,startLine:M,startIndex:D})=>{const G={pos:0};for(const{line:Z,from:Y,to:se,rules:ue}of U){if(Z>M+1)break;if(ue&&!ue.has(q))continue;if(Z===M&&Y===void 0&&se===void 0)return!1;Y<=D&&Y>G.pos?(G.pos=Y,G.type="from"):se<=D&&se>G.pos&&(G.pos=se,G.type="to")}return G.type!=="from"}),_.some(({fix:q})=>q)){const q=_.map(({fix:G})=>G).filter(Boolean).sort(({range:[G,Z]},{range:[Y,se]})=>Z===se?Y-G:se-Z);let M=1/0,D=F;for(const{range:[G,Z],text:Y}of q)Z<=M&&(D=D.slice(0,G)+Y+D.slice(Z),M=G);Object.assign(_,{output:D})}}return _}toString(v,k){return v?super.toString(!0,k):Ke(x(this,n),()=>super.toString(!1,k),_=>{const C=this.getRootNode();C.type==="root"&&x(C,i)&&R(this,n,_)})}},e=new WeakMap,t=new WeakMap,s=new WeakMap,r=new WeakMap,l=new WeakMap,i=new WeakMap,n=new WeakMap,a=new WeakSet,ao=function(){const{parseRedirect:v}=(Do(),ee(Kl)),k=this.firstChild.toString(),_=v(k,x(this,s),x(this,r));return _&&this.setText(_),!!_},oo=function(v){const{parseCommentAndExt:k}=(Bs(),ee(Fa));this.setText(k(this.firstChild.toString(),x(this,s),x(this,r),v))},uo=function(){const{parseBraces:v}=(Tr(),ee(ha)),k=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,_=v(k,x(this,s),x(this,r));this.setText(this.type==="root"?_:_.slice(1))},ho=function(){if(x(this,s).excludes.includes("html"))return;const{parseHtml:v}=(dd(),ee(ja));this.setText(v(this.firstChild.toString(),x(this,s),x(this,r)))},co=function(){if(x(this,s).excludes.includes("table"))return;const{parseTable:v}=(cd(),ee(Ua));this.setText(v(this,x(this,s),x(this,r)))},go=function(){if(x(this,s).excludes.includes("hr"))return;const{parseHrAndDoubleUnderscore:v}=(fd(),ee(Ha));this.setText(v(this,x(this,s),x(this,r)))},po=function(v){const{parseLinks:k}=(vd(),ee(Ya));this.setText(k(this.firstChild.toString(),x(this,s),x(this,r),v))},fo=function(v){if(x(this,s).excludes.includes("quote"))return;const{parseQuotes:k}=(Qa(),ee(Va)),_=this.firstChild.toString().split(`
25
+ `);for(let C=0;C<_.length;C++)_[C]=k(_[C],x(this,s),x(this,r),v);this.setText(_.join(`
26
+ `))},mo=function(){if(x(this,s).excludes.includes("extLink"))return;const{parseExternalLinks:v}=(Xa(),ee(Ja));this.setText(v(this.firstChild.toString(),x(this,s),x(this,r)))},xo=function(){if(x(this,s).excludes.includes("magicLink"))return;const{parseMagicLinks:v}=(bd(),ee(Za));this.setText(v(this.firstChild.toString(),x(this,s),x(this,r)))},vo=function(){if(x(this,s).excludes.includes("list"))return;const{parseList:v}=(Sd(),ee(io)),{firstChild:k,type:_,name:C}=this,E=k.toString().split(`
27
+ `),T={lastPrefix:""};let L=_==="root"||_==="ext-inner"&&C==="poem"?0:1;for(;L<E.length;L++)E[L]=v(E[L],T,x(this,s),x(this,r));this.setText(E.join(`
28
+ `))},bo=function(){if(x(this,s).variants.length>0){const{parseConverter:v}=(_d(),ee(no));this.setText(v(this.firstChild.toString(),x(this,s),x(this,r)))}},g)}}),ve,Ws,Ns,kt,we=N({"util/debug.ts"(){"use strict";ve={running:!1,run(e){const{running:t}=this;this.running=!0;try{const{Token:s}=(Q(),ee(Zt)),r=e();return r instanceof s&&!r.getAttribute("built")&&r.afterBuild(),this.running=t,r}catch(s){throw this.running=t,s}},rev:0},Ws=e=>t=>t.type===e,Ns=(e,t,s,r=[])=>{var n,a;let l=e.getChildNodes(),i;l.length===s?(i=l,l=r):i=l.splice(t,s,...r);for(let o=0;o<r.length;o++){const d=r[o];d.setAttribute("parentNode",e),d.setAttribute("nextSibling",l[t+o+1]),d.setAttribute("previousSibling",l[t+o-1])}return(n=l[t-1])==null||n.setAttribute("nextSibling",l[t]),(a=l[t+r.length])==null||a.setAttribute("previousSibling",l[t+r.length-1]),l===r&&e.setAttribute("childNodes",l),i},kt=(e,t)=>{Object.defineProperty(e,"name",{value:t.name})}}}),$l,Pt,Ui,Mi,kl,zi,_l,hr,Cd=N({"lib/lintConfig.ts"(){"use strict";Ml(),$l=new Set([0,1,2]),Pt=new Map([[0,!1],[1,"warning"],[2,"error"]]),Ui={"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(Ui),Mi=e=>typeof e=="number"&&$l.has(e),kl=e=>Mi(e)||Array.isArray(e)&&e.length===2&&Mi(e[0])&&e[1]&&typeof e[1]=="object",zi=(e,t,s)=>{if(vr.includes(t)){if(kl(s))return e[t]=s,!0}else throw new RangeError(`Unknown lint rule: ${t}`);throw new RangeError(`Invalid lint config for ${t}: ${JSON.stringify(s)}`)},_l=class{constructor(e){if(Object.assign(this,JSON.parse(JSON.stringify(Ui))),!!e)for(const[t,s]of Object.entries(e))zi(this,t,s)}getSeverity(e,t){var r;if(!(e in this))throw new RangeError(`Unknown rule: ${e}`);const s=this[e];return typeof s=="number"?Pt.get(s):t&&(r=Pt.get(s[1][t]))!=null?r:Pt.get(s[0])}},hr=e=>new Proxy(new _l(e),{set:zi})}}),wo={};ie(wo,{Title:()=>yo});var yo,Id=N({"lib/title.ts"(){"use strict";var e,t,s,r,l,i;he(),yo=(i=class{constructor(n,a,o,{temporary:d,decode:u,selfLink:h}={}){O(this,e);O(this,t);O(this,s);O(this,r);O(this,l);ke(this,"valid");ke(this,"encoded",!1);const p=n.trim().startsWith("../");if(u&&n.includes("%"))try{const m=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(n);n=es(n),this.encoded=m}catch{}if(n=ss(n).replace(/[_ ]+/gu," ").trim(),p)R(this,r,0);else{let m=a;n.startsWith(":")&&(m=0,n=n.slice(1).trim());const S=n.split(":");if(S.length>1){const A=vt(S[0]),y=Object.prototype.hasOwnProperty.call(o.nsid,A)&&o.nsid[A];y&&(m=y,n=S.slice(1).join(":").trim())}R(this,r,m)}const c=n.indexOf("#");if(c!==-1){let m=n.slice(c).trim().slice(1);if(m.includes("%"))try{m=es(m)}catch{}R(this,l,m.replace(/ /gu,"_")),n=n.slice(0,c).trim()}this.valid=!!(n||h&&this.ns===0&&x(this,l)!==void 0)&&ss(n)===n&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(p?/^(?:\.\.\/)+(.*)/u.exec(n)[1]:n),this.main=n,R(this,t,o.namespaces),R(this,s,o.articlePath||"/wiki/$1"),x(this,s).includes("$1")||R(this,s,x(this,s)+`${x(this,s).endsWith("/")?"":"/"}$1`),d||Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}})}get ns(){return x(this,r)}get fragment(){return x(this,l)}get main(){return x(this,e)}set main(n){n=n.replace(/_/gu," ").trim(),R(this,e,n&&n[0].toUpperCase()+n.slice(1))}get prefix(){const n=x(this,t)[this.ns];return n+(n&&":")}get title(){return this.getRedirection()[1]}get extension(){const{main:n}=this,a=n.lastIndexOf(".");return a===-1?void 0:n.slice(a+1).toLowerCase()}getRedirection(){return[!1,(this.prefix+this.main).replace(/ /gu,"_")]}setFragment(n){R(this,l,n)}getUrl(n){{typeof n=="string"&&(R(this,s,n),x(this,s).includes("$1")||R(this,s,x(this,s)+`${x(this,s).endsWith("/")?"":"/"}$1`));const{title:a,fragment:o}=this;return a?x(this,s).replace("$1",encodeURIComponent(a)+(o?`#${encodeURIComponent(o)}`:"")):o===void 0?"":`#${encodeURIComponent(o)}`}throw new Error("Title.getUrl method is only available in the LSP version!")}},e=new WeakMap,t=new WeakMap,s=new WeakMap,r=new WeakMap,l=new WeakMap,i)}}),So={};ie(So,{LanguageService:()=>Ao,isAttr:()=>Is,tasks:()=>cr});var cr,Cl,Il,Tl,Nl,Hi,Ll,Fl,jl,Rl,Is,Pl,Di,nt,Gi,Ve,fe,Vi,Qi,lt,at,Qe,Et,Ji,Ao,Td=N({"lib/lsp.ts"(){"use strict";var e,t,s,r,l,i,n,a,o,d,Xt,_e,gr,$o,pr,ko,fr,ot,$;St(),sa(),K(),he(),J(),cr=new WeakMap,Cl=new Set(["ref"]),Il=new Set(["ref","references"]),Tl=new Set(["name","extends","follow"]),Nl=new Set(["group"]),Hi=new Set(["arg-name","template-name","link-target","parameter-key"]),Ll=new Set(["ext","html","attr-key","image-parameter","heading-title","heading","magic-word-name",...Hi]),Fl=new Set(["text","comment","noinclude","include"]),jl=["ext","html","table"].map(f=>`${f}-attr#style`).join(),Rl=Xe(f=>new RegExp(`^(?:${f}|//)`,"iu")),Is=({type:f,parentNode:g,length:w,firstChild:b},v)=>f==="attr-value"&&w===1&&b.type==="text"&&(!v||g.name==="style"),Pl=f=>f.is("html-attr")||f.is("table-attr"),Di=f=>f.childNodes.every(({type:g})=>Fl.has(g)),nt=(f,g)=>{const{top:w,left:b}=f.posFromIndex(g);return{line:w,character:b}},Gi=(f,g,w)=>({start:nt(f,g),end:nt(f,w)}),Ve=f=>{const{top:g,left:w,height:b,width:v}=f.getBoundingClientRect();return{start:{line:g,character:w},end:rs(g,w,b,v)}},fe=(f,g,w,{line:b,character:v},k,_)=>[...new Set(f)].map(C=>{var T;const E=(T=_==null?void 0:_(C))==null?void 0:T.description;return{label:C,kind:g,textEdit:{range:{start:{line:b,character:v-w.length},end:{line:b,character:v}},newText:C+(k!=null?k:"")},...E&&{documentation:{kind:"markdown",value:E}}}}),Vi=(f,g,{line:w,character:b})=>{const v=f.indexFromPos(w,b);return f.caretPositionFromIndex(v+Number(/\w/u.test(g.charAt(v))))},Qi=(f,g,w)=>{const{type:b,parentNode:v={}}=f,{name:k,tag:_}=v;return b==="attr-value"&&g.has(_)&&w.has(k)?f.toString().trim():NaN},lt=f=>Qi(f,Cl,Tl),at=f=>Qi(f,Il,Nl),Qe=(f,g)=>{const w=f==null?void 0:f.getAttr(g);return w!==!0&&w||!1},Et=f=>{const{type:g,name:w,parentNode:b}=f;switch(g){case"heading":return f.level;case"heading-title":return b.level;case"parameter-key":return`${b.parentNode.name}|${b.name}`;case"ext":case"html":case"image-parameter":return w;default:return b.name}},Ji=(f,g,w=!1)=>({range:Gi(f,...g.range),newText:g.text,title:`${w?"Fix":"Suggestion"}: ${g.desc}`,fix:w}),Ao=($=class{constructor(f){O(this,d);O(this,e);O(this,t);O(this,s);O(this,r);O(this,l);O(this,i);O(this,n);O(this,a);O(this,o);ke(this,"include",!0);ke(this,"config");ke(this,"data");cr.set(f,this),Object.defineProperties(this,{config:{enumerable:!1},data:{enumerable:!1}})}destroy(){Object.setPrototypeOf(this,null)}async provideDocumentColors(f,g,w=!0){const b=await P(this,d,_e).call(this,g);return b.querySelectorAll("attr-value,parameter-value,arg-default").reverse().flatMap(v=>{const{type:k,childNodes:_}=v;return k!=="attr-value"&&!Di(v)?[]:_.filter(C=>C.type==="text").reverse().flatMap(C=>{const{data:E}=C,T=Hl(E,w).filter(([,,,B])=>B);if(T.length===0)return[];const L=C.getAbsoluteIndex();return T.map(([B,j,F])=>{const U=f(B);return U.length===4&&{color:{red:U[0]/255,green:U[1]/255,blue:U[2]/255,alpha:U[3]},range:Gi(b,L+j,L+F)}}).filter(Boolean)})})}provideColorPresentations(f){const{color:{red:g,green:w,blue:b,alpha:v},range:k}=f,_=[g,w,b],C=v<1?`rgba(${_.map(E=>Math.round(E*255)).join()},${v})`:`#${_.map(zl).join("")}`;return[{label:C,textEdit:{range:k,newText:C}}]}async provideCompletionItems(f,g){var Z,Y,se,ue,Ae,Le,it;const{re:w,allTags:b,functions:v,switches:k,protocols:_,params:C,tags:E,ext:T}=P(this,d,ko).call(this),{line:L,character:B}=g,j=f.split(/\r?\n/u,L+1)[L],F=w.exec((Z=j==null?void 0:j.slice(0,B))!=null?Z:""),[,,U={},W={}]=this.config.doubleUnderscore;if((F==null?void 0:F[1])!==void 0){const V=F[1].startsWith("/");return fe(b,"Class",F[1].slice(V?1:0),g,V&&!(j!=null&&j.slice(B).trim().startsWith(">"))?">":"")}else{if(F!=null&&F[4])return fe(k,"Constant",F[4],g,"",V=>{if(this.data)return V=V.slice(2,-2),V in U?V=U[V]:V in W&&(V=W[V]),P(this,d,fr).call(this,V.toLowerCase())});if((F==null?void 0:F[5])!==void 0)return fe(_,"Reference",F[5],g)}const q=await P(this,d,_e).call(this,f);let M;if(F!=null&&F[2]){M=q.elementFromPoint(F.index+F[2].length-1,L);const V=(Y=F[3])!=null?Y:"";if(F[2]==="{{{")return fe(q.querySelectorAll("arg").filter(z=>z.name&&z!==M).map(({name:z})=>z),"Variable",V,g);const[oe,me]=this.config.parserFunction,xe=Array.isArray(me),$e=j.charAt(B),He=V.startsWith(":"),ye=He?V.slice(1).trimStart():V;if(F[2]==="[[")return fe(q.querySelectorAll("link,file,category,redirect-target").filter(z=>z!==M).map(({name:z})=>z),"Folder",ye,g);let Fe=v;return $e===":"?Fe=v.filter(z=>!z.endsWith(":")):$e===":"&&(Fe=v.filter(z=>z.endsWith(":")).map(z=>z.slice(0,-1))),[...fe(Fe,"Function",V,g,"",z=>{if(this.data)z in oe?z=oe[z]:!xe&&z in me&&(z=me[z]);else return;return P(this,d,ot).call(this,z.toLowerCase())}),...V.startsWith("#")?[]:fe(q.querySelectorAll("template").filter(z=>z!==M).map(z=>{const{name:Ee}=z;if(He)return Ee;const{ns:_t}=z.getAttribute("title");return _t===0?`:${Ee}`:_t===10?Ee.slice(9):Ee}),"Folder",ye,g)]}let D,G;if((F==null?void 0:F[7])===void 0&&(M=q.elementFromPoint(B,L),{type:D,parentNode:G}=M),(F==null?void 0:F[6])!==void 0||D==="image-parameter"){const V=q.indexFromPos(L,B),oe=(ue=(se=F==null?void 0:F[6])==null?void 0:se.trimStart())!=null?ue:x(this,e).slice(M.getAbsoluteIndex(),V).trimStart(),me=x(this,e)[V]==="=";return[...fe(C,"Property",oe,g).filter(({label:xe})=>!me||!/[= ]$/u.test(xe)),...fe(q.querySelectorAll("image-parameter#width").filter(xe=>xe!==M).map(xe=>xe.text()),"Unit",oe,g)]}else if((F==null?void 0:F[7])!==void 0||D==="attr-key"){const V=(Le=(Ae=F==null?void 0:F[7])==null?void 0:Ae.toLowerCase())!=null?Le:G.tag,oe=(it=F==null?void 0:F[9])!=null?it:M.toString().slice(0,B-q.posFromIndex(M.getAbsoluteIndex()).left);if(!E.has(V))return;const me=$r[V],xe=kr[V],$e=xe&&fe(xe,"Field",oe,g);return T.includes(V)&&!me?$e:[...$e!=null?$e:[],...V==="meta"||V==="link"?[]:fe(Ar,"Property",oe,g),...me?fe(me,"Property",oe,g):[],...fe(["data-"],"Variable",oe,g),...fe(["xmlns:"],"Interface",oe,g)]}else if(D==="parameter-key"||D==="parameter-value"&&G.anon){const V=G.parentNode,{type:oe,name:me}=V;if(oe==="magic-word"&&me!=="invoke")return;const xe=x(this,e).slice(M.getAbsoluteIndex(),q.indexFromPos(L,B)).trimStart(),{module:$e,function:He}=V;return xe?fe(q.querySelectorAll("parameter").filter(ye=>ye===G||ye.anon||ye.parentNode.type!==oe||ye.parentNode.name!==me?!1:oe==="template"?!0:ye.parentNode.module===$e&&ye.parentNode.function===He).map(({name:ye})=>ye),"Variable",xe,g,D==="parameter-value"?"=":""):void 0}else if(Is(M)&&Pl(G)){const V=br(G.tag,G.name);if(V.length===0)return;const oe=x(this,e).slice(M.getAbsoluteIndex(),q.indexFromPos(L,B)).trimStart();return fe(V,"Value",oe,g)}}async provideDiagnostics(f,g=!0){const w=await P(this,d,_e).call(this,f),b=w.lint();return[(g?b:b.filter(({severity:C})=>C==="error")).map(({startLine:C,startCol:E,endLine:T,endCol:L,severity:B,rule:j,message:F,fix:U,suggestions:W})=>({range:{start:{line:C,character:E},end:{line:T,character:L}},severity:B==="error"?1:2,source:"WikiLint",code:j,message:F,data:[...U?[Ji(w,U,!0)]:[],...W?W.map(q=>Ji(w,q)):[]]})),[],[]].flat(2)}async provideFoldingRanges(f){const g=await P(this,d,_e).call(this,f),{length:w}=g.getLines(),b=[],v=new Array(6),k=g.querySelectorAll("heading-title,table,template,magic-word");for(const _ of[...k].reverse())_.getRelativeIndex();for(const _ of k){const{offsetHeight:C}=_;if(_.type==="heading-title"||C>2){const{top:E}=g.posFromIndex(_.getAbsoluteIndex());if(_.type==="heading-title"){const{level:T}=_.parentNode;for(let L=T-1;L<6;L++){const B=v[L];B!==void 0&&B<E-1&&b.push({startLine:B,endLine:E-1,kind:"region"}),v[L]=void 0}v[T-1]=E+C-1}else b.push({startLine:E,endLine:E+C-2,kind:"region"})}}for(const _ of v)_!==void 0&&_<w-1&&b.push({startLine:_,endLine:w-1,kind:"region"});return b}async provideLinks(f){var k;(k=this.config)!=null||(this.config=I.getConfig());const{articlePath:g,protocol:w}=this.config,b=g==null?void 0:g.includes("//"),v=Rl(w);return(await P(this,d,_e).call(this,f)).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(_=>{let C;_.is("magic-word")&&({name:C}=_,_=_.childNodes[1].lastChild);const{type:E,parentNode:T,firstChild:L,lastChild:B,childNodes:j,length:F}=_,{tag:U}=T;if(C!=null||(C=T.name),!(E!=="attr-value"||C==="src"&&["templatestyles","img"].includes(U)||C==="cite"&&["blockquote","del","ins","q"].includes(U))||!Di(_))return!1;let W=j.filter(q=>q.type==="text").map(({data:q})=>q).join("").trim();if(!W)return!1;try{if(_.is("magic-link")||_.is("ext-link-url")||_.is("free-ext-link"))W=_.getUrl(g);else if(E==="link-target"&&(T.is("link")||T.is("redirect-target")||T.is("category"))){if(W.startsWith("/"))return!1;W=T.link.getUrl(g)}else if(E==="template-name")W=T.getAttribute("title").getUrl(g);else if(["link-target","invoke-module","parameter-value"].includes(E)||E==="attr-value"&&C==="src"&&U==="templatestyles"||E==="image-parameter"&&!v.test(W)){if(!b||W.startsWith("/"))return!1;let q=0;switch(E){case"attr-value":q=10;break;case"invoke-module":q=828;break;case"parameter-value":q=C==="filepath"?6:274}const M=I.normalizeTitle(W,q,!1,this.config,{temporary:!0});if(!M.valid)return!1;W=M.getUrl()}if(typeof W=="string"&&W.startsWith("//")&&(W=`https:${W}`),W=new URL(W).href,E==="image-parameter"){const q=L.getBoundingClientRect(),{top:M,left:D,height:G,width:Z}=F===1?q:B.getBoundingClientRect();return{range:{start:{line:q.top,character:q.left},end:rs(M,D,G,Z)},target:W}}return{range:Ve(_),target:W}}catch{return!1}}).filter(Boolean)}async provideReferences(f,g){const w=await P(this,d,_e).call(this,f),{offsetNode:b,offset:v}=Vi(w,x(this,e),g),k=b.type==="text"?b.parentNode:b,_=v===0&&(k.type==="ext-attr-dirty"||k.type==="html-attr-dirty")?k.parentNode.parentNode:k,{type:C}=_,E=lt(_),T=at(_);if(!E&&!T&&!Ll.has(C))return;const L=Et(_),B=w.querySelectorAll(C==="heading-title"?"heading":C).filter(j=>C==="attr-value"?lt(j)===E||at(j)===T:Et(j)===L).reverse().map(j=>({range:Ve(j.type==="parameter-key"?j.parentNode:j)}));return B.length===0?void 0:B}async provideDefinition(f,g){const w=await P(this,d,_e).call(this,f),b=w.elementFromPoint(g.character,g.line),v=b.is("ext")&&b.name==="ref"?b:b.closest("ext#ref"),k=Qe(v,"name");if(!k)return;const _=Qe(v,"group"),C=w.querySelectorAll("ext#ref").filter(E=>E.innerText&&Qe(E,"name")===k&&Qe(E,"group")===_).reverse().map(({lastChild:E})=>({range:Ve(E)}));return C.length===0?void 0:C}async resolveRenameLocation(f,g){const w=await P(this,d,_e).call(this,f),b=w.elementFromPoint(g.character,g.line),{type:v}=b,k=lt(b),_=at(b);return!k&&!_&&(!Hi.has(v)||v==="parameter-key"&&/^[1-9]\d*$/u.test(b.parentNode.name)||v==="link-target"&&!["link","redirect-target"].includes(b.parentNode.type))?void 0:Ve(b)}async provideRenameEdits(f,g,w){const b=await P(this,d,_e).call(this,f),v=b.elementFromPoint(g.character,g.line),{type:k}=v,_=lt(v),C=_&&Qe(v.parentNode.parentNode,"group"),E=at(v),T=Et(v),L=b.querySelectorAll(k).filter(B=>{const{type:j}=B.parentNode;return k==="link-target"&&j!=="link"&&j!=="redirect-target"?!1:k==="attr-value"?at(B)===E||lt(B)===_&&Qe(B.parentNode.parentNode,"group")===C:Et(B)===T});return L.length===0?void 0:{changes:{"":L.reverse().map(B=>({range:Ve(B),newText:w}))}}}async provideHover(f,g){if(!this.data)return;const w=await P(this,d,_e).call(this,f);let{offsetNode:b,offset:v}=Vi(w,x(this,e),g);b.type==="text"&&(v+=b.getRelativeIndex(),b=b.parentNode);const{type:k,parentNode:_,length:C,name:E}=b;let T,L,B,j;if(b.is("double-underscore")&&v>0)T=P(this,d,fr).call(this,b.name);else if(k==="magic-word-name")T=P(this,d,ot).call(this,_.name),L=b.text().trim(),B=_.getAttribute("colon");else if(b.is("magic-word")&&!b.modifier&&C===1&&(v>0||w.posFromIndex(b.getAbsoluteIndex()).left===g.character))T=P(this,d,ot).call(this,E),L=b.firstChild.text().trim(),B=b.getAttribute("colon");else if((b.is("magic-word")||b.is("template"))&&b.modifier&&v>=2&&b.getRelativeIndex(0)>v&&(L=b.modifier.trim().slice(0,-1),T=P(this,d,ot).call(this,L.toLowerCase()),B=":",T)){const F=b.getAbsoluteIndex();j={start:nt(w,F+2),end:nt(w,F+b.modifier.trimEnd().length+1)}}return T&&{contents:{kind:"markdown",value:(T.signatures?`${T.signatures.map(F=>`- **{{ ${L}${F.length===0?"**":`${B}** `}${F.map(({label:U,const:W})=>W?U:`*${U}*`).join(" **|** ")} **}}**`).join(`
29
29
  `)}
30
30
 
31
- `:"")+F.description},range:R!=null?R:Me(w)}}async provideSignatureHelp(m,p){if(!this.data)return;const{line:b,character:w}=p,v=m.split(/\r?\n/u,b+1)[b],{lastChild:A}=await P(this,d,yl).call(this,`${v.slice(0,w+/^[^{}<]*/u.exec(v.slice(w))[0].length)}}}`);if(!A.is("magic-word")||A.length===1)return;const{name:S,childNodes:_,firstChild:E}=A,F=P(this,d,st).call(this,S);if(!(F!=null&&F.signatures))return;const N=_.length-1,O=F.signatures.filter(I=>{var B;return(I.length>=N||((B=I[I.length-1])==null?void 0:B.rest))&&I.every(({label:M,const:H},G)=>{var se;const K=H&&G<N&&((se=_[G+1])==null?void 0:se.text().trim());return!K||M.toLowerCase().includes(K.toLowerCase())})});if(O.length===0)return;let R=-1;for(let I=A.getAbsoluteIndex()+A.getAttribute("padding");R<N&&(I+=_[R+1].toString().length+1,!(I>w));R++);const L=E.text().trim(),U=A.getAttribute("colon");return{signatures:O.map(I=>({label:`{{${L}${I.length===0?"":U}${I.map(({label:B})=>B).join("|")}}}`,parameters:I.map(({label:B,const:M})=>({label:B,...M?{documentation:"Predefined parameter"}:void 0})),...I.length<N?{activeParameter:Math.min(R,I.length-1)}:void 0})),activeParameter:R}}async provideInlayHints(m){const p=await P(this,d,$e).call(this,m);let b=[];for(const w of p.querySelectorAll("template,magic-word#invoke").reverse()){const{type:v,childNodes:A}=w;b=[...b,...A.slice(v==="template"?1:3).filter(({anon:S})=>S).reverse().map(S=>({position:Ze(p,S.getAbsoluteIndex()),label:`${S.name}=`,kind:2}))]}return b}findStyleTokens(){return f(this,a).querySelectorAll(Ia).filter(({lastChild:m})=>Ss(m))}},e=new WeakMap,t=new WeakMap,s=new WeakMap,n=new WeakMap,a=new WeakMap,r=new WeakMap,i=new WeakMap,o=new WeakMap,l=new WeakMap,d=new WeakSet,Gt=function(){return f(this,i)===this.config&&f(this,o)===this.include},$e=async function(m){var p;return m=Xt(m),!f(this,s)&&P(this,d,Gt).call(this)&&f(this,e)===m?f(this,a):(j(this,e,m),(p=f(this,s))!=null||j(this,s,P(this,d,on).call(this)),f(this,s))},on=async function(){var b;(b=this.config)!=null||(this.config=W.getConfig()),j(this,i,this.config),j(this,o,this.include);const m=f(this,e),p=await W.partialParse(m,()=>f(this,e),this.include,this.config);return P(this,d,Gt).call(this)&&f(this,e)===m?(j(this,a,p),j(this,s,void 0),p):(j(this,s,P(this,d,on).call(this)),f(this,s))},yl=async function(m){var p;return m=Xt(m),!f(this,n)&&P(this,d,Gt).call(this)&&f(this,t)===m?f(this,r):(j(this,t,m),(p=f(this,n))!=null||j(this,n,P(this,d,ln).call(this)),f(this,n))},ln=async function(){var b;(b=this.config)!=null||(this.config=W.getConfig()),j(this,i,this.config),j(this,o,this.include);const m=f(this,t),p=await W.partialParse(m,()=>f(this,t),this.include,this.config);return P(this,d,Gt).call(this)&&f(this,t)===m?(j(this,r,p),j(this,n,void 0),p):(j(this,n,P(this,d,ln).call(this)),f(this,n))},Sl=function(){var m;if(!f(this,l)||f(this,l)[1]!==this.config){(m=this.config)!=null||(this.config=W.getConfig());const{nsid:p,ext:b,html:w,parserFunction:[v,A,...S],doubleUnderscore:_,protocol:E,img:F}=this.config,N=new Set([b,w].flat(2)),O=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(p).filter(([,R])=>R===6).map(([R])=>R).join("|")})\s*:[^[\]{}<>]+\|([^[\]{}<>|=]*)`+"|"+String.raw`<(\w+)(?:\s(?:[^<>{}|=\s]+(?:\s*=\s*(?:[^\s"']\S*|(["']).*?\8))?(?=\s))*)?\s(\w*)`+")$","iu");j(this,l,[{re:O,ext:b,tags:N,allTags:[...N,"onlyinclude","includeonly","noinclude"],functions:[Object.keys(v),Array.isArray(A)?A:Object.keys(A),S].flat(2),switches:_.slice(0,2).flat().map(R=>`__${R}__`),protocols:E.split("|"),params:Object.keys(F).filter(R=>R.endsWith("$1")||!R.includes("$1")).map(R=>R.replace(/\$1$/u,""))},this.config])}return f(this,l)[0]},dn=function(m){return this.data.behaviorSwitches.find(({aliases:p})=>p.includes(m))},st=function(m){return this.data.parserFunctions.find(({aliases:p})=>p.some(b=>b.replace(/^#/u,"")===m))},T)}}),Al={};ie(Al,{default:()=>W});$l.exports=Y(Al);var fs,zr,Re,Hr,Fa,W,J=C({"index.ts"(){Oa(),be(),Qe(),ce(),$d(),fs=!0,zr=nn(),Re={config:Gr,i18n:void 0,rules:gn,get lintConfig(){return zr},set lintConfig(e){zr=nn(e)},get viewOnly(){return fs},set viewOnly(e){fs&&!e&&me.rev++,fs=e},getConfig(e){const t=e!=null?e:this.config,{doubleUnderscore:s,ext:n,parserFunction:a,variable:r}=t;for(let i=0;i<2;i++)s.length>i+2&&s[i].length===0&&(s[i]=Object.keys(s[i+2]));return n.includes("translate")&&!r.includes("translationlanguage")&&(r.push("translationlanguage"),Array.isArray(a[1])?a[1].push("TRANSLATIONLANGUAGE"):a[1].TRANSLATIONLANGUAGE="translationlanguage"),{...Gr,...t,excludes:[]}},msg(e,t=""){var s,n;return e&&((n=(s=this.i18n)==null?void 0:s[e])!=null?n:e).replace("$1",this.msg(t))},normalizeTitle(e,t=0,s,n=Re.getConfig(),a){const{Title:r}=(kd(),Y(ml));let i;if(a!=null&&a.halfParsed)i=new r(e,t,n,a);else{const{Token:o}=(V(),Y(Qt));i=me.run(()=>{const l=new o(e,n);l.type="root",l.parseOnce(0,s).parseOnce();const d=new r(l.toString(),t,n,a);for(const h of["main","fragment"]){const c=d[h];if(c!=null&&c.includes("\0")){const x=l.buildFromStr(c,1);h==="main"?d.main=x:d.setFragment(x)}}return d})}return i},parse(e,t,s=we,n=Re.getConfig()){e=Xt(e);let a;typeof s!="number"&&(a=Array.isArray(s)?s:[s],s=Math.max(...a.map(o=>Ea[o]||we)));const{Token:r}=(V(),Y(Qt));return me.run(()=>{const o=new r(e,n);return o.type="root",o.parse(s,t)})},async partialParse(e,t,s,n=Re.getConfig()){{const{Token:a}=(V(),Y(Qt)),r=typeof setImmediate=="function"?setImmediate:setTimeout,{running:i}=me;me.running=!0;const o=new a(Xt(e),n);o.type="root";let l=0;try{await new Promise(d=>{const h=()=>{t()===e?(l++,r(c,0)):d()},c=()=>{l===we+1?(o.afterBuild(),d()):(o[l===we?"build":"parseOnce"](l,s),h())};r(c,0)})}catch(d){throw me.running=i,d}return me.running=i,o}},createLanguageService(e={}){var t;{const s=(_d(),Y(bl)),{LanguageService:n,tasks:a}=s;return(t=a.get(e))!=null?t:new n(e)}throw new Error("Parser.createLanguageService method is only available in the LSP version!")}},Hr={},Fa=new Set(["normalizeTitle","parse","createLanguageService"]);for(const e in Re)Fa.has(e)||(Hr[e]={enumerable:!1});Object.defineProperties(Re,Hr),Object.assign(typeof globalThis=="object"?globalThis:self,{Parser:Re}),W=Re}});J()});Td();})();
31
+ `:"")+T.description},range:j!=null?j:Ve(b)}}async provideSignatureHelp(f,g){if(!this.data)return;const{line:w,character:b}=g,v=f.split(/\r?\n/u,w+1)[w],{lastChild:k}=await P(this,d,$o).call(this,`${v.slice(0,b+/^[^{}<]*/u.exec(v.slice(b))[0].length)}}}`);if(!k.is("magic-word")||k.length===1)return;const{name:_,childNodes:C,firstChild:E}=k,T=P(this,d,ot).call(this,_);if(!(T!=null&&T.signatures))return;const L=C.length-1,B=T.signatures.filter(W=>{var q;return(W.length>=L||((q=W[W.length-1])==null?void 0:q.rest))&&W.every(({label:M,const:D},G)=>{var Y;const Z=D&&G<L&&((Y=C[G+1])==null?void 0:Y.text().trim());return!Z||M.toLowerCase().includes(Z.toLowerCase())})});if(B.length===0)return;let j=-1;for(let W=k.getAbsoluteIndex()+k.getAttribute("padding");j<L&&(W+=C[j+1].toString().length+1,!(W>b));j++);const F=E.text().trim(),U=k.getAttribute("colon");return{signatures:B.map(W=>({label:`{{${F}${W.length===0?"":U}${W.map(({label:q})=>q).join("|")}}}`,parameters:W.map(({label:q,const:M})=>({label:q,...M?{documentation:"Predefined parameter"}:void 0})),...W.length<L?{activeParameter:Math.min(j,W.length-1)}:void 0})),activeParameter:j}}async provideInlayHints(f){const g=await P(this,d,_e).call(this,f);let w=[];for(const b of g.querySelectorAll("template,magic-word#invoke").reverse()){const{type:v,childNodes:k}=b;w=[...w,...k.slice(v==="template"?1:3).filter(({anon:_})=>_).reverse().map(_=>({position:nt(g,_.getAbsoluteIndex()),label:`${_.name}=`,kind:2}))]}return w}findStyleTokens(){return x(this,l).querySelectorAll(jl).filter(({lastChild:f})=>Is(f))}},e=new WeakMap,t=new WeakMap,s=new WeakMap,r=new WeakMap,l=new WeakMap,i=new WeakMap,n=new WeakMap,a=new WeakMap,o=new WeakMap,d=new WeakSet,Xt=function(){return x(this,n)===this.config&&x(this,a)===this.include},_e=async function(f){var g;return f=ts(f),!x(this,s)&&P(this,d,Xt).call(this)&&x(this,e)===f?x(this,l):(R(this,e,f),(g=x(this,s))!=null||R(this,s,P(this,d,gr).call(this)),x(this,s))},gr=async function(){var w;(w=this.config)!=null||(this.config=I.getConfig()),R(this,n,this.config),R(this,a,this.include);const f=x(this,e),g=await I.partialParse(f,()=>x(this,e),this.include,this.config);return P(this,d,Xt).call(this)&&x(this,e)===f?(R(this,l,g),R(this,s,void 0),g):(R(this,s,P(this,d,gr).call(this)),x(this,s))},$o=async function(f){var g;return f=ts(f),!x(this,r)&&P(this,d,Xt).call(this)&&x(this,t)===f?x(this,i):(R(this,t,f),(g=x(this,r))!=null||R(this,r,P(this,d,pr).call(this)),x(this,r))},pr=async function(){var w;(w=this.config)!=null||(this.config=I.getConfig()),R(this,n,this.config),R(this,a,this.include);const f=x(this,t),g=await I.partialParse(f,()=>x(this,t),this.include,this.config);return P(this,d,Xt).call(this)&&x(this,t)===f?(R(this,i,g),R(this,r,void 0),g):(R(this,r,P(this,d,pr).call(this)),x(this,r))},ko=function(){var f;if(!x(this,o)||x(this,o)[1]!==this.config){(f=this.config)!=null||(this.config=I.getConfig());const{nsid:g,ext:w,html:b,parserFunction:[v,k,..._],doubleUnderscore:C,protocol:E,img:T}=this.config,L=new Set([w,b].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(([,j])=>j===6).map(([j])=>j).join("|")})\s*:[^[\]{}<>]+\|([^[\]{}<>|=]*)`+"|"+String.raw`<(\w+)(?:\s(?:[^<>{}|=\s]+(?:\s*=\s*(?:[^\s"']\S*|(["']).*?\8))?(?=\s))*)?\s(\w*)`+")$","iu");R(this,o,[{re:B,ext:w,tags:L,allTags:[...L,"onlyinclude","includeonly","noinclude"],functions:[Object.keys(v),Array.isArray(k)?k:Object.keys(k),_].flat(2),switches:C.slice(0,2).flat().map(j=>`__${j}__`),protocols:E.split("|"),params:Object.keys(T).filter(j=>j.endsWith("$1")||!j.includes("$1")).map(j=>j.replace(/\$1$/u,""))},this.config])}return x(this,o)[0]},fr=function(f){return this.data.behaviorSwitches.find(({aliases:g})=>g.includes(f))},ot=function(f){return this.data.parserFunctions.find(({aliases:g})=>g.some(w=>w.replace(/^#/u,"")===f))},$)}}),_o={};ie(_o,{default:()=>I});Co.exports=ee(_o);var ws,Xi,Oe,Ki,El,I,J=N({"index.ts"(){Ml(),we(),Ze(),he(),Cd(),ws=!0,Xi=hr(),Oe={config:Yi,i18n:void 0,rules:vr,get lintConfig(){return Xi},set lintConfig(e){Xi=hr(e)},get viewOnly(){return ws},set viewOnly(e){ws&&!e&&ve.rev++,ws=e},getConfig(e){const t=e!=null?e:this.config,{doubleUnderscore:s,ext:r,parserFunction:l,variable:i}=t;for(let n=0;n<2;n++)s.length>n+2&&s[n].length===0&&(s[n]=Object.keys(s[n+2]));return r.includes("translate")&&!i.includes("translationlanguage")&&(i.push("translationlanguage"),Array.isArray(l[1])?l[1].push("TRANSLATIONLANGUAGE"):l[1].TRANSLATIONLANGUAGE="translationlanguage"),{...Yi,...t,excludes:[]}},msg(e,t=""){var s,r;return e&&((r=(s=this.i18n)==null?void 0:s[e])!=null?r:e).replace("$1",this.msg(t))},normalizeTitle(e,t=0,s,r=Oe.getConfig(),l){const{Title:i}=(Id(),ee(wo));let n;if(l!=null&&l.halfParsed)n=new i(e,t,r,l);else{const{Token:a}=(Q(),ee(Zt));n=ve.run(()=>{const o=new a(e,r);o.type="root",o.parseOnce(0,s).parseOnce();const d=new i(o.toString(),t,r,l);o.build();for(const u of["main","fragment"]){const h=d[u];if(h!=null&&h.includes("\0")){const p=o.buildFromStr(h,1);u==="main"?d.main=p:d.setFragment(p)}}return d})}return n},parse(e,t,s=Se,r=Oe.getConfig()){e=ts(e);let l;typeof s!="number"&&(l=Array.isArray(s)?s:[s],s=Math.max(...l.map(a=>Ul[a]||Se)));const{Token:i}=(Q(),ee(Zt));return ve.run(()=>{const a=new i(e,r);return a.type="root",a.parse(s,t)})},async partialParse(e,t,s,r=Oe.getConfig()){{const{Token:l}=(Q(),ee(Zt)),i=typeof setImmediate=="function"?setImmediate:setTimeout,{running:n}=ve;ve.running=!0;const a=new l(ts(e),r);a.type="root";let o=0;try{await new Promise(d=>{const u=()=>{t()===e?(o++,i(h,0)):d()},h=()=>{o===Se+1?(a.afterBuild(),d()):(a[o===Se?"build":"parseOnce"](o,s),u())};i(h,0)})}catch(d){throw ve.running=n,d}return ve.running=n,a}},createLanguageService(e={}){var t;{const s=(Td(),ee(So)),{LanguageService:r,tasks:l}=s;return(t=l.get(e))!=null?t:new r(e)}throw new Error("Parser.createLanguageService method is only available in the LSP version!")}},Ki={},El=new Set(["lintConfig","normalizeTitle","parse","createLanguageService"]);for(const e in Oe)El.has(e)||(Ki[e]={enumerable:!1});Object.defineProperties(Oe,Ki),Object.assign(typeof globalThis=="object"?globalThis:self,{Parser:Oe}),I=Oe}});J()});Nd();})();
32
32
  //# sourceMappingURL=bundle-lsp.min.js.map