wikiparser-node 1.21.2 → 1.21.3

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 (70) hide show
  1. package/README.md +3 -5
  2. package/bundle/bundle-es8.min.js +25 -25
  3. package/bundle/bundle-lsp.min.js +26 -26
  4. package/bundle/bundle.min.js +25 -25
  5. package/dist/base.d.mts +6 -1
  6. package/dist/base.d.ts +6 -1
  7. package/dist/index.d.ts +2 -2
  8. package/dist/index.js +10 -1
  9. package/dist/lib/element.js +2 -1
  10. package/dist/lib/lintConfig.d.ts +13 -0
  11. package/dist/lib/lintConfig.js +161 -0
  12. package/dist/lib/lsp.js +6 -4
  13. package/dist/lib/node.js +646 -606
  14. package/dist/lib/text.js +4 -0
  15. package/dist/mixin/attributesParent.d.ts +6 -6
  16. package/dist/mixin/attributesParent.js +4 -4
  17. package/dist/mixin/cached.d.ts +5 -0
  18. package/dist/mixin/cached.js +22 -0
  19. package/dist/mixin/clone.d.ts +5 -0
  20. package/dist/mixin/clone.js +23 -0
  21. package/dist/mixin/hidden.js +68 -18
  22. package/dist/mixin/sol.js +1 -1
  23. package/dist/parser/commentAndExt.js +1 -1
  24. package/dist/parser/html.js +3 -3
  25. package/dist/parser/table.js +2 -2
  26. package/dist/src/arg.js +13 -7
  27. package/dist/src/atom.js +76 -31
  28. package/dist/src/attribute.js +49 -21
  29. package/dist/src/attributes.d.ts +7 -7
  30. package/dist/src/attributes.js +415 -366
  31. package/dist/src/commented.js +81 -35
  32. package/dist/src/converter.js +13 -7
  33. package/dist/src/converterFlags.js +33 -22
  34. package/dist/src/converterRule.js +263 -216
  35. package/dist/src/extLink.js +21 -16
  36. package/dist/src/gallery.js +18 -8
  37. package/dist/src/heading.js +66 -57
  38. package/dist/src/hidden.js +14 -9
  39. package/dist/src/html.js +28 -9
  40. package/dist/src/imageParameter.js +13 -6
  41. package/dist/src/imagemap.js +32 -25
  42. package/dist/src/index.js +53 -44
  43. package/dist/src/link/base.js +13 -8
  44. package/dist/src/link/file.js +401 -354
  45. package/dist/src/link/galleryImage.js +9 -5
  46. package/dist/src/link/index.js +7 -3
  47. package/dist/src/link/redirectTarget.js +7 -3
  48. package/dist/src/magicLink.js +23 -14
  49. package/dist/src/nested.js +122 -74
  50. package/dist/src/nowiki/base.js +5 -2
  51. package/dist/src/nowiki/comment.js +5 -1
  52. package/dist/src/nowiki/index.js +3 -3
  53. package/dist/src/nowiki/quote.js +13 -8
  54. package/dist/src/onlyinclude.js +17 -9
  55. package/dist/src/paramTag/index.js +21 -14
  56. package/dist/src/parameter.js +26 -20
  57. package/dist/src/pre.js +91 -45
  58. package/dist/src/syntax.js +14 -10
  59. package/dist/src/table/index.js +550 -503
  60. package/dist/src/table/td.js +65 -58
  61. package/dist/src/table/trBase.js +179 -129
  62. package/dist/src/tagPair/ext.js +32 -20
  63. package/dist/src/tagPair/include.js +5 -5
  64. package/dist/src/tagPair/translate.js +150 -103
  65. package/dist/src/transclude.js +13 -8
  66. package/dist/util/html.js +46 -41
  67. package/dist/util/lint.js +4 -4
  68. package/dist/util/string.js +13 -7
  69. package/extensions/dist/base.js +2 -2
  70. package/package.json +15 -15
@@ -1,28 +1,28 @@
1
- "use strict";(()=>{var Da=Object.create;var qt=Object.defineProperty,Wa=Object.defineProperties,es=Object.getOwnPropertyDescriptor,Ha=Object.getOwnPropertyDescriptors,Ga=Object.getOwnPropertyNames,Yi=Object.getOwnPropertySymbols;var ts=Object.prototype.hasOwnProperty,Va=Object.prototype.propertyIsEnumerable;var rs=(a,n)=>(n=Symbol[a])?n:Symbol.for("Symbol."+a),_t=a=>{throw TypeError(a)};var en=(a,n,e)=>n in a?qt(a,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[n]=e,K=(a,n)=>{for(var e in n||(n={}))ts.call(n,e)&&en(a,e,n[e]);if(Yi)for(var e of Yi(n))Va.call(n,e)&&en(a,e,n[e]);return a},oe=(a,n)=>Wa(a,Ha(n)),Zi=(a,n)=>qt(a,"name",{value:n,configurable:!0});var v=(a,n)=>()=>(a&&(n=a(a=0)),n);var Xa=(a,n)=>()=>(n||a((n={exports:{}}).exports,n),n.exports),te=(a,n)=>{for(var e in n)qt(a,e,{get:n[e],enumerable:!0})},Qa=(a,n,e,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of Ga(n))!ts.call(a,r)&&r!==e&&qt(a,r,{get:()=>n[r],enumerable:!(t=es(n,r))||t.enumerable});return a};var H=a=>Qa(qt({},"__esModule",{value:!0}),a);var F=a=>{var n;return[,,,Da((n=a==null?void 0:a[rs("metadata")])!=null?n:null)]},ns=["class","method","getter","setter","accessor","field","value","get","set"],kr=a=>a!==void 0&&typeof a!="function"?_t("Function expected"):a,Ka=(a,n,e,t,r)=>({kind:ns[a],name:n,metadata:t,addInitializer:i=>e._?_t("Already initialized"):r.push(kr(i||null))}),Ja=(a,n)=>en(n,rs("metadata"),a[3]),R=(a,n,e,t)=>{for(var r=0,i=a[n>>1],s=i&&i.length;r<s;r++)n&1?i[r].call(e):t=i[r].call(e,t);return t},P=(a,n,e,t,r,i)=>{var s,o,l,g,p,d=n&7,u=!!(n&8),h=!!(n&16),m=d>3?a.length+1:d?u?1:2:0,f=ns[d+5],x=d>3&&(a[m-1]=[]),T=a[m]||(a[m]=[]),k=d&&(!h&&!u&&(r=r.prototype),d<5&&(d>3||!h)&&es(d<4?r:{get[e](){return c(this,i)},set[e](w){return y(this,i,w)}},e));d?h&&d<4&&Zi(i,(d>2?"set ":d>1?"get ":"")+e):Zi(r,e);for(var $=t.length-1;$>=0;$--)g=Ka(d,e,l={},a[3],T),d&&(g.static=u,g.private=h,p=g.access={has:h?w=>Ya(r,w):w=>e in w},d^3&&(p.get=h?w=>(d^1?c:S)(w,r,d^4?i:k.get):w=>w[e]),d>2&&(p.set=h?(w,I)=>y(w,r,I,d^4?i:k.set):(w,I)=>w[e]=I)),o=(0,t[$])(d?d<4?h?i:k[f]:d>4?void 0:{get:k.get,set:k.set}:r,g),l._=1,d^4||o===void 0?kr(o)&&(d>4?x.unshift(o):d?h?i=o:k[f]=o:r=o):typeof o!="object"||o===null?_t("Object expected"):(kr(s=o.get)&&(k.get=s),kr(s=o.set)&&(k.set=s),kr(s=o.init)&&x.unshift(s));return d||Ja(a,r),k&&qt(r,e,k),h?d^4?i:k:r},ge=(a,n,e)=>en(a,typeof n!="symbol"?n+"":n,e),Rn=(a,n,e)=>n.has(a)||_t("Cannot "+e),Ya=(a,n)=>Object(n)!==n?_t('Cannot use the "in" operator on this value'):a.has(n),c=(a,n,e)=>(Rn(a,n,"read from private field"),e?e.call(a):n.get(a)),b=(a,n,e)=>n.has(a)?_t("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(a):n.set(a,e),y=(a,n,e,t)=>(Rn(a,n,"write to private field"),t?t.call(a,e):n.set(a,e),e),S=(a,n,e)=>(Rn(a,n,"access private method"),e);var tn=(a,n,e,t)=>({set _(r){y(a,n,r,e)},get _(){return c(a,n,t)}});var is,ss,os=v(()=>{"use strict";is=(()=>{let a={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(a,null),a})(),ss=(()=>{let a=["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(a),a})()});function Ee(a){return n=>{let e=new(typeof n=="string"?Map:WeakMap);if(e.has(n)){let r=e.get(n);return r.lastIndex=0,r}let t=a(n);return e.set(n,t),t}}var et,Mt=v(()=>{"use strict";et=a=>decodeURIComponent(a.replace(/%(?![\da-f]{2})/giu,"%25"))});var Se,as,Oe,qe,_e,Le,ht,ls,ae,kd,ke,Za,el,mt,ds,vd,tl,rl,ft,Me,ie=v(()=>{"use strict";Mt();Se=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,as=String.raw`[^[\]<>"\0-\x1F\x7F${Se}\uFFFD]`,Oe=String.raw`(?:\[[\da-f:.]+\]|${as})`,qe=String.raw`(?:${as}|\0\d+[cn!~]\x7F)*`,_e=a=>a.trim().toLowerCase(),Le=(a,n)=>a.replace(/\0(\d+)\x7F/gu,(e,t)=>n[t]),ht=(a,n)=>e=>e.replace(a,n),ls=ht(/[\0\x7F]|\r$/gmu,""),ae=ht(/\0\d+[cn]\x7F/gu,""),kd=ht(/[\\{}()|.?*+^$[\]]/gu,String.raw`\$&`),ke=(a,n="")=>a.map(e=>typeof e=="string"?e:e.text()).join(n),Za={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},el=ht(/&(?:#(\d+|[Xx][\da-fA-F]+)|([lg]t|[LG]T|[lr]brac[ke]|nbsp|amp|AMP|quot|QUOT));/gu,(a,n,e)=>n?String.fromCodePoint(+((/^x/iu.test(n)?"0":"")+n)):Za[e.toLowerCase()]),mt=a=>el(a),ds=ht(/&#(\d+|x[\da-f]+);/giu,(a,n)=>String.fromCodePoint(+((/^x/iu.test(n)?"0":"")+n))),vd=ht(/\n/gu,String.raw`\n`),tl={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},rl=a=>ht(a,n=>`&${tl[n]};`),ft=rl(/[&<>]/gu),Me=(a,n={})=>{let{pre:e="",post:t="",sep:r=""}=n;return e+a.map(i=>i.print()).join(r)+t}});var gs=Xa((Sd,nl)=>{nl.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:[]}});var Pn,ps=v(()=>{"use strict";Pn=gs()});var vr,Ut,Ar,wr,jn,L,se=v(()=>{"use strict";L=class{constructor(n,e){b(this,wr);b(this,vr);b(this,Ut);b(this,Ar);y(this,vr,n),y(this,Ut,e)}get start(){return c(this,Ut)}get top(){return S(this,wr,jn).call(this).top}get left(){return S(this,wr,jn).call(this).left}};vr=new WeakMap,Ut=new WeakMap,Ar=new WeakMap,wr=new WeakSet,jn=function(){var n;return(n=c(this,Ar))!=null||y(this,Ar,c(this,vr).getRootNode().posFromIndex(c(this,Ut))),c(this,Ar)}});var il,sl,zt,Bn,us,N,E,Ce,cs,M=v(()=>{"use strict";pe();se();G();il=new Set(["tr","td","th","caption"]),sl=new Set(["Template:!!","Template:!-"]),zt=a=>{let n=a.childNodes.find(e=>e.text().trim());if(!n||n.type==="text"&&n.data.trim().startsWith("!")||n.is("magic-word")&&n.name==="!"||n.is("template")&&sl.has(n.name)||n.is("html")&&il.has(n.name))return!1;if(n.is("arg"))return n.length>1&&zt(n.childNodes[1]);if(n.is("magic-word"))try{let e=n.getPossibleValues().map(zt);return e.includes("error")?"error":e.includes("warning")&&"warning"}catch(e){}return n.is("template")||n.is("magic-word")&&n.name==="invoke"?"warning":"error"},Bn=(a,n,e,t)=>({line:a+e-1,character:(e===1?n:0)+t}),us=a=>(n,e,t,r,i="error")=>{let{start:s}=e,{top:o,left:l}=e instanceof L?e:new L(n,s),{offsetHeight:g,offsetWidth:p}=n,{startIndex:d,startLine:u,startCol:h}=a(n,s,o,l),{line:m,character:f}=Bn(u,h,g,p);return{rule:t,message:C.msg(r),severity:i,startIndex:d,endIndex:d+n.toString().length,startLine:u,endLine:m,startCol:h,endCol:f}},N=us((a,n,e,t)=>{let r=a.getRelativeIndex(),{top:i,left:s}=a.parentNode.posFromIndex(r);return{startIndex:n+r,startLine:e+i,startCol:i?s:t+s}}),E=us((a,n,e,t)=>({startIndex:n,startLine:e,startCol:t})),Ce=(a,n,e)=>{if(a&&C.viewOnly&&a[0]===le.rev)return a[1];let t=n();return C.viewOnly&&e([le.rev,t]),t},cs=(a,n)=>a==="ol"&&n==="type"?["1","a","A","i","I"]:a==="th"&&n==="scope"?["row","col","rowgroup","colgroup"]:n==="dir"?["ltr","rtl","auto"]:n==="aria-hidden"?["true","false"]:[]});var ol,rn,hs=v(()=>{"use strict";ol=(a,n,e)=>{if(a.includes("#")){let[t,...r]=a.split("#");return(!t||t===n)&&r.every(i=>i===e)}return!a||a===n},rn=(a,n,e)=>({type:t,name:r})=>a.split(",").some(i=>ol(i.trim(),t,r))});var Sr,Dt,Wt,Cr,$r,Ht,Gt,Nr,On,Vt,qn=v(()=>{"use strict";M();pe();G();Vt=class{constructor(){b(this,Nr);ge(this,"childNodes",[]);b(this,Sr);b(this,Dt);b(this,Wt);b(this,Cr);b(this,$r);b(this,Ht);b(this,Gt,{})}get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get parentNode(){return c(this,Sr)}get nextSibling(){return c(this,Dt)}get previousSibling(){return c(this,Wt)}get offsetHeight(){return S(this,Nr,On).call(this).height}get offsetWidth(){return S(this,Nr,On).call(this).width}getChildNodes(){let{childNodes:n}=this;return Object.isFrozen(n)?[...n]:n}getAttribute(n){return n==="padding"?0:this[n]}setAttribute(n,e){switch(n){case"parentNode":y(this,Sr,e),e||(y(this,Dt,void 0),y(this,Wt,void 0));break;case"nextSibling":y(this,Dt,e);break;case"previousSibling":y(this,Wt,e);break;case"aIndex":C.viewOnly&&y(this,Ht,[le.rev,e]);break;default:this[n]=e}}getRootNode(){return Ce(c(this,$r),()=>{var n,e;return(e=(n=this.parentNode)==null?void 0:n.getRootNode())!=null?e:this},n=>{let[,e]=n;e.type==="root"&&y(this,$r,n)})}indexFromPos(n,e){this.lspError("AstNode.indexFromPos")}posFromIndex(n){let{length:e}=String(this);if(n+=n<0?e:0,n>=0&&n<=e){let t=this.getLines(),r=t.findIndex(([,,i])=>n<=i);return{top:r,left:n-t[r][1]}}}getGaps(n){return 0}getRelativeIndex(n){if(n===void 0){let{parentNode:e}=this;return e?e.getRelativeIndex(e.childNodes.indexOf(this)):0}return Ce(c(this,Gt)[n],()=>{let{childNodes:e}=this,t=n+(n<0?e.length:0),r=this.getAttribute("padding");for(let i=0;i<t;i++)C.viewOnly&&(c(this,Gt)[i]=[le.rev,r]),r+=e[i].toString().length+this.getGaps(i);return r},e=>{c(this,Gt)[n]=e})}getAbsoluteIndex(){return Ce(c(this,Ht),()=>{let{parentNode:n}=this;return n?n.getAbsoluteIndex()+this.getRelativeIndex():0},n=>{y(this,Ht,n)})}getBoundingClientRect(){this.lspError("AstNode.getBoundingClientRect")}is(n){return this.type===n}getLines(){return Ce(c(this,Cr),()=>{let n=[],e=0;for(let t of String(this).split(`
2
- `)){let r=e+t.length;n.push([t,e,r]),e=r+1}return n},n=>{y(this,Cr,n)})}seal(n,e){Object.defineProperty(this,n,{enumerable:!e&&!!this[n],configurable:!0})}lspError(n){throw new Error(`${n} method is only available in the LSP version!`)}};Sr=new WeakMap,Dt=new WeakMap,Wt=new WeakMap,Cr=new WeakMap,$r=new WeakMap,Ht=new WeakMap,Gt=new WeakMap,Nr=new WeakSet,On=function(){let n=this.getLines(),e=n[n.length-1];return{height:n.length,width:e[2]-e[1]}}});var tt,_n,Mn,nn,ms=v(()=>{"use strict";ie();pe();hs();qn();nn=class extends Vt{constructor(){super(...arguments);b(this,tt)}get length(){return this.childNodes.length}text(e){return ke(this.childNodes,e)}normalize(){let e=this.getChildNodes(),t=r=>{var i,s;e.splice(r,1),(i=e[r-1])==null||i.setAttribute("nextSibling",e[r]),(s=e[r])==null||s.setAttribute("previousSibling",e[r-1])};for(let r=e.length-1;r>=0;r--){let{type:i,data:s}=e[r];i!=="text"||e.length===1||this.getGaps(r-(r&&1))||s===""&&t(r)}this.setAttribute("childNodes",e)}removeAt(e){return Ir(this,e,1)[0]}insertAt(e,t=this.length){return Ir(this,t,0,[e]),e}closest(e){let t=rn(e,this),{parentNode:r}=this;for(;r;){if(t(r))return r;({parentNode:r}=r)}}querySelector(e){let t=rn(e,this);return S(this,tt,_n).call(this,t)}querySelectorAll(e){let t=rn(e,this);return S(this,tt,Mn).call(this,t)}append(...e){this.safeAppend(e)}safeAppend(e){for(let t of e)this.insertAt(t)}replaceChildren(...e){this.safeReplaceChildren(e)}safeReplaceChildren(e){for(let t=this.length-1;t>=0;t--)this.removeAt(t);this.safeAppend(e)}setText(e,t=0){t+=t<0?this.length:0;let r=this.childNodes[t],{data:i}=r;return r.replaceData(e),i}toString(e,t=""){return this.childNodes.map(r=>r.toString(e)).join(t)}caretPositionFromIndex(e){this.lspError("AstElement.caretPositionFromIndex")}elementFromIndex(e){this.lspError("AstElement.elementFromIndex")}elementFromPoint(e,t){this.lspError("AstElement.elementFromPoint")}lint(e=this.getAbsoluteIndex(),t){let r=[];for(let i=0,s=e+this.getAttribute("padding");i<this.length;i++){let o=this.childNodes[i];o.setAttribute("aIndex",s);let l=o.lint(s,t);l.length>0&&r.push(...l),s+=o.toString().length+this.getGaps(i)}return r}print(e={}){let t=e.class;return this.toString()?(t===""?"":`<span class="wpb-${t!=null?t:this.type}${this.getAttribute("invalid")?" wpb-invalid":""}">`)+Me(this.childNodes,e)+(t===""?"":"</span>"):""}json(e,t=this.getAbsoluteIndex()){let r=oe(K({},this),{type:this.type,range:[t,t+this.toString().length],childNodes:[]});for(let i=0,s=t+this.getAttribute("padding");i<this.length;i++){let o=this.childNodes[i],{length:l}=o.toString();o.setAttribute("aIndex",s),r.childNodes.push(o.type==="text"?{data:o.data,range:[s,s+l]}:o.json(void 0,s)),s+=l+this.getGaps(i)}return r}};tt=new WeakSet,_n=function(e){var t;for(let r of this.childNodes){if(r.type==="text")continue;if(e(r))return r;let i=S(t=r,tt,_n).call(t,e);if(i)return i}},Mn=function(e){var r;let t=[];for(let i of this.childNodes)i.type!=="text"&&(e(i)&&t.push(i),t=[...t,...S(r=i,tt,Mn).call(r,e)]);return t}});var Un,xs,al,ll,dl,gl,pl,fs,zn,sn,bs,Er,Ts=v(()=>{"use strict";ie();M();G();qn();Un=String.raw`[${Se}\t]*`,xs=String.raw`<\s*(?:/\s*)?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|(?:rfc|pmid)(?=[-::]?${Un}\d)|isbn(?=[-::]?${Un}(?:\d(?:${Un}|-)){6})`,al=new RegExp(String.raw`${xs}|https?[:/]/+`,"giu"),ll=new RegExp(xs,"giu"),dl=new Set(["attr-value","ext-link-text","link-text"]),gl={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},pl={"<":"tag-like","[":"lonely-bracket","{":"lonely-bracket","]":"lonely-bracket","}":"lonely-bracket",h:"lonely-http",r:"lonely-http",p:"lonely-http",i:"lonely-http"},fs=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{zn=new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch(a){zn=/\w/u}Er=class extends Vt{constructor(e){super();b(this,sn);ge(this,"data","");this.data=e}get type(){return"text"}toString(e){var t;return e&&!((t=this.parentNode)!=null&&t.getAttribute("built"))?ae(this.data):this.data}text(){return this.data}lint(e=this.getAbsoluteIndex(),t){var J,ne,q;if(t===!1)return[];let{data:r,parentNode:i,nextSibling:s,previousSibling:o}=this;if(!i)throw new Error("An isolated text node cannot be linted!");let{type:l,name:g,parentNode:p}=i,d=!1;if(l==="attr-value"){let{type:W,name:z,tag:Y}=p;if(W!=="ext-attr")d=!0;else if(Y==="ref"&&(z==="name"||z==="extends"||z==="follow")||z==="group"&&(Y==="ref"||Y==="references")||Y==="choose"&&(z==="before"||z==="after"))return[]}if(t!=null||(t=l==="free-ext-link"||l==="ext-link-url"||l==="ext-link-text"||l==="image-parameter"&&g==="link"||d?ll:al),r.search(t)===-1)return[];t.lastIndex=0;let u=[],h=s==null?void 0:s.type,m=s==null?void 0:s.name,f=o==null?void 0:o.type,x=this.getRootNode(),T=x.toString(),{ext:k,html:$,variants:w}=x.getAttribute("config"),{top:I,left:j}=x.posFromIndex(e),U=new Set(["onlyinclude","noinclude","includeonly",...k,...$[0],...$[1],...$[2],...fs]);for(let W=t.exec(r);W;W=t.exec(r)){let[,z,Y]=W,{index:Q,0:_}=W;if(Y&&Y!=="]"){let{length:be}=Y;Q+=be,_=_.slice(be)}_=_.toLowerCase();let[O]=_,we=O==="r"||O==="p"||O==="i",{length:he}=_;if(O==="<"&&!U.has(z.toLowerCase())||O==="["&&l==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(r.slice(Q+1))||s!=null&&s.is("ext")&&m==="nowiki"&&((J=s.innerText)!=null&&J.includes("]")))||we&&(!i.isPlain()||dl.has(l)))continue;O==="]"&&(Q||he>1)&&t.lastIndex--;let xe=e+Q,Ye=xe+he,Ze=T[Ye],Zr=T[xe-1],ut=he>1&&!(O==="<"&&(/^<\s/u.test(_)||!/[\s/>]/u.test(Ze!=null?Ze:"")||fs.has(z))||d&&(O==="["||O==="]")||we&&l==="parameter-value"||/^(?:rfc|pmid|isbn)$/iu.test(_))||O==="{"&&(Ze===O||Zr==="-"&&w.length>0)||O==="}"&&(Zr===O||Ze==="-"&&w.length>0)||O==="["&&(l==="ext-link-text"||h==="free-ext-link"&&!r.slice(Q+1).trim())||O==="]"&&f==="free-ext-link"&&!r.slice(0,Q).includes("]")?"error":"warning",Ln=O==="{"||O==="[";if(ut==="warning"&&(Ln||(O==="]"||O==="}"))){let be=gl[O],Fn=Ln?r.slice(Q+1):r.slice(0,Q);if(O==="{"&&((ne=be.exec(Fn))==null?void 0:ne[0])==="}"||O==="}"&&((q=be.exec(Fn))==null?void 0:q[0])==="{")continue;if(!Fn.includes(O)){let Ji=Ln?"nextSibling":"previousSibling",ct=this[Ji];for(;ct&&(ct.type!=="text"||!be.test(ct.data));)ct=ct[Ji];if(ct&&be.exec(ct.data)[0]!==O)continue}}we?_=_.toUpperCase():_==="{"&&Zr==="-"&&ut==="error"?(ut="warning",Q>0&&(_="-{",Q--,xe--,he=2)):_==="}"&&Ze==="-"&&ut==="error"&&(ut="warning",Q<r.length-1&&(_="}-",Ye++,he=2));let Xi=this.posFromIndex(Q),{line:Qi,character:Ki}=Bn(I,j,Xi.top+1,Xi.left),Ot={rule:pl[O],message:C.msg('lonely "$1"',we||O==="h"||_==="-{"||_==="}-"?_:O),severity:ut,startIndex:xe,endIndex:Ye,startLine:Qi,endLine:Qi,startCol:Ki,endCol:Ki+he};if(O==="<")Ot.suggestions=[{desc:"escape",range:[xe,xe+1],text:"&lt;"}];else if(O==="h"&&l!=="link-text"&&zn.test(Zr||""))Ot.suggestions=[{desc:"whitespace",range:[xe,xe],text:" "}];else if(O==="["&&l==="ext-link-text"){let be=i.getAbsoluteIndex()+i.toString().length;Ot.suggestions=[{desc:"escape",range:[be,be+1],text:"&#93;"}]}else if(O==="]"&&f==="free-ext-link"&&ut==="error"){let be=e-o.toString().length;Ot.suggestions=[{desc:"left bracket",range:[be,be],text:"["}]}else we&&(Ot.suggestions=[...W[0]===_?[]:[{desc:"uppercase",range:[xe,Ye],text:_}],...Ze===":"||Ze===":"?[{desc:"whitespace",range:[Ye,Ye+1],text:" "}]:[]]);u.push(Ot)}return u}replaceData(e){S(this,sn,bs).call(this,e)}print(){return ft(this.data)}};sn=new WeakSet,bs=function(e){this.setAttribute("data",e)}});var ve,xt=v(()=>{"use strict";pe();ve=(a=!0,n=!0)=>e=>{class t extends e{text(){return""}lint(i){return a?[]:super.lint(i)}}return Fe(t,e),t}});var Lr,me,bt=v(()=>{"use strict";B();me=class extends A{constructor(e,t,r,i,s){super(e,r,i,s);b(this,Lr);y(this,Lr,t)}get type(){return c(this,Lr)}lint(e=this.getAbsoluteIndex()){return super.lint(e,!1)}};Lr=new WeakMap});var ue,Ue=v(()=>{"use strict";pe();ue=({length:a})=>n=>{class e extends n{getAttribute(r){return r==="padding"?a:super.getAttribute(r)}}return Fe(e,n),e}});var Xt,Z,ze=v(()=>{"use strict";B();Z=class extends A{constructor(e,t,r,i,s){super(e,r,i,s);b(this,Xt);y(this,Xt,t)}get type(){return c(this,Xt)}set type(e){y(this,Xt,e)}getAttribute(e){var t;return e==="invalid"?this.type==="converter-flag"&&!!((t=this.parentNode)!=null&&t.isInvalidFlag(this)):super.getAttribute(e)}};Xt=new WeakMap});var ul,ys,Tt,$e,De,Dn,cl,Te,Fr=v(()=>{"use strict";M();ie();se();Ue();B();ze();ul=a=>a==="redirect-target"||a==="link";ys=[ue("[[")];Te=class extends(cl=A){constructor(e,t,r,i=[],s="|"){super(void 0,r,i,{});b(this,Tt,!0);b(this,$e);b(this,De);if(this.insertAt(new Z(e,"link-target",r,i,{})),t!==void 0){let o=new A(t,r,i,{});o.type="link-text",o.setAttribute("stage",10),this.insertAt(o)}y(this,$e,s)}get link(){}get fragment(){return c(this,De).fragment}afterBuild(){y(this,De,this.getTitle()),c(this,$e).includes("\0")&&y(this,$e,this.buildFromStr(c(this,$e),0)),this.setAttribute("name",c(this,De).title),super.afterBuild()}setAttribute(e,t){e==="bracket"?y(this,Tt,t):e==="title"?y(this,De,t):super.setAttribute(e,t)}toString(e){let t=super.toString(e,c(this,$e));return c(this,Tt)?`[[${t}]]`:t}text(){let e=super.text("|");return c(this,Tt)?`[[${e}]]`:e}getAttribute(e){return e==="title"?c(this,De):super.getAttribute(e)}getGaps(e){return e===0?c(this,$e).length:1}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{childNodes:[i,s],type:o}=this,{encoded:l,fragment:g}=c(this,De),p=new L(this,e);if(i.childNodes.some(({type:d})=>d==="template")&&r.push(N(i,p,"unknown-page","template in an internal link target","warning")),l){let d=N(i,p,"url-encoding","unnecessary URL encoding in an internal link","warning");d.fix={desc:"decode",range:[d.startIndex,d.endIndex],text:et(i.text())},r.push(d)}if(o==="link"||o==="category"){let d=s==null?void 0:s.childNodes.findIndex(h=>h.type==="text"&&h.data.includes("|")),u=s==null?void 0:s.childNodes[d];if(u){let h=N(s,p,"pipe-like",'additional "|" in the link text',"warning"),m=h.startIndex+s.getRelativeIndex(d);h.suggestions=[{desc:"escape",range:[m,m+u.data.length],text:u.data.replace(/\|/gu,"&#124;")}],r.push(h)}}if(g!==void 0&&!ul(o)){let d=N(i,p,"no-ignored","useless fragment","warning"),u=i.childNodes.findIndex(m=>m.type==="text"&&m.data.includes("#")),h=i.childNodes[u];h&&(d.fix={desc:"remove",range:[d.startIndex+i.getRelativeIndex(u)+h.data.indexOf("#"),d.endIndex],text:""}),r.push(d)}return r}getTitle(e,t){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:t,temporary:e,decode:!0,selfLink:!0})}print(){return super.print(c(this,Tt)?{pre:"[[",post:"]]",sep:c(this,$e)}:{sep:c(this,$e)})}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t),{type:i,fragment:s}=this;return s!==void 0&&(i==="link"||i==="redirect-target")&&(r.fragment=s),r}};Dn=F(cl),Tt=new WeakMap,$e=new WeakMap,De=new WeakMap,Te=P(Dn,0,"LinkBaseToken",ys,Te),R(Dn,1,Te)});var ce,rt=v(()=>{"use strict";B();ce=class extends A{get innerText(){return this.firstChild.data}constructor(n="",e,t){super(n,e,t)}}});var ks,Wn,hl,D,We=v(()=>{"use strict";xt();rt();ks=[ve()];D=class extends(hl=ce){get type(){return"noinclude"}toString(n){return n?"":super.toString()}};Wn=F(hl),D=P(Wn,0,"NoincludeToken",ks,D),R(Wn,1,D)});var on,vs=v(()=>{"use strict";M();Fr();We();on=class extends Te{get type(){return"redirect-target"}constructor(n,e,t,r){super(n,void 0,t,r),e!==void 0&&this.insertAt(new D(e,t,r))}getTitle(){return this.normalizeTitle(this.firstChild.toString(),0,{halfParsed:!0,decode:!0})}lint(n=this.getAbsoluteIndex()){let e=super.lint(n,!1);if(this.length===2){let t=N(this.lastChild,{start:n},"no-ignored","useless link text","warning");t.startIndex--,t.startCol--,t.fix={desc:"remove",range:[t.startIndex,t.endIndex],text:""},e.push(t)}return e}}});var As,nt,Qt,Hn,ml,yt,ws=v(()=>{"use strict";xt();B();bt();vs();As=[ve(!1,!1)];yt=class extends(ml=A){constructor(e,t,r,i,s,o,l=[]){super(void 0,o,l);b(this,nt);b(this,Qt);y(this,nt,e),y(this,Qt,s),this.append(new me(t,"redirect-syntax",o,l),new on(r,i==null?void 0:i.slice(1),o,l))}get type(){return"redirect"}getAttribute(e){return e==="padding"?c(this,nt).length:super.getAttribute(e)}toString(e){return c(this,nt)+super.toString(e)+c(this,Qt)}lint(e=this.getAbsoluteIndex()){let t=e+c(this,nt).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",t),this.lastChild.lint(t)}print(){return super.print({pre:c(this,nt),post:c(this,Qt)})}};Hn=F(ml),nt=new WeakMap,Qt=new WeakMap,yt=P(Hn,0,"RedirectToken",As,yt),R(Hn,1,yt)});var Ss={};te(Ss,{parseRedirect:()=>fl});var fl,Cs=v(()=>{"use strict";G();ws();fl=(a,n,e)=>{var r;(r=n.regexRedirect)!=null||(n.regexRedirect=new RegExp(String.raw`^(\s*)((?:${n.redirection.join("|")})\s*(?::\s*)?)\[\[([^\n|\]]+)(\|.*?)?\]\](\s*)`,"iu"));let t=n.regexRedirect.exec(a);return t&&C.normalizeTitle(t[3],0,!1,n,{halfParsed:!0,temporary:!0,decode:!0}).valid?(a=`\0${e.length}o${a.slice(t[0].length)}`,new yt(...t.slice(1),n,e),a):!1}});var $s,Gn,xl,kt,Ns=v(()=>{"use strict";Ue();B();$s=[ue("<onlyinclude>")];kt=class extends(xl=A){get type(){return"onlyinclude"}toString(n){return`<onlyinclude>${super.toString(n)}</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>'})}};Gn=F(xl),kt=P(Gn,0,"OnlyincludeToken",$s,kt),R(Gn,1,kt)});var it,Rr=v(()=>{"use strict";pe();it=(a=1)=>n=>{class e extends n{getGaps(){return a}}return Fe(e,n),e}});var Is,st,Vn,bl,Ie,an=v(()=>{"use strict";Rr();B();Is=[it()];Ie=class extends(bl=A){constructor(e,t,r,i,s,o=[]){super(void 0,s);b(this,st);ge(this,"closed");ge(this,"selfClosing");this.setAttribute("name",e.toLowerCase()),y(this,st,[e,i||e]),this.closed=i!=="",this.selfClosing=i===void 0,this.append(t,r);let l=typeof t=="string"?-1:o.indexOf(t);o.splice(l===-1?1/0:l,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(e){let{selfClosing:t,firstChild:r,lastChild:i}=this,[s,o]=c(this,st);return t?`<${s}${r.toString(e)}/>`:`<${s}${r.toString(e)}>${i.toString(e)}${this.closed?`</${o}>`:""}`}text(){let[e,t]=c(this,st);return this.selfClosing?`<${e}${this.firstChild.text()}/>`:`<${e}${super.text(">")}${this.closed?`</${t}>`:""}`}getAttribute(e){return e==="padding"?c(this,st)[0].length+1:super.getAttribute(e)}print(){let[e,t]=c(this,st);return super.print(this.selfClosing?{pre:`&lt;${e}`,post:"/&gt;"}:{pre:`&lt;${e}`,sep:"&gt;",post:this.closed?`&lt;/${t}&gt;`:""})}};Vn=F(bl),st=new WeakMap,Ie=P(Vn,0,"TagPairToken",Is,Ie),R(Vn,1,Ie)});var dn,Es,ln,Ls=v(()=>{"use strict";B();an();bt();We();ln=class extends Ie{constructor(e,t,r,i=[]){let s=new me(e,"translate-attr",r,i);t=t==null?void 0:t.replace(/(<tvar\|[^>]+>)([\s\S]*?)(<\/>)/gu,(l,g,p,d)=>(new D(g,r,i),new D(d,r,i),`\0${i.length-1}n${p}\0${i.length}n`)).replace(/(<tvar\s+name\s*=(?:\s*(?:(["'])[\s\S]*?\2|[^"'\s>]+))?\s*>)([\s\S]*?)(<\/tvar\s*>)/giu,(l,g,p,d,u)=>(new D(g,r,i),new D(u,r,i),`\0${i.length-1}n${d}\0${i.length}n`));let o=new A(t,r,i);o.type="translate-inner";super("translate",s,o,"translate",r,i);b(this,dn);this.seal("closed",!0),this.seal("selfClosing",!0)}get type(){return"translate"}toString(e){return e?this.lastChild.toString(!0):super.toString()}text(){return this.lastChild.text()}print(){return`<span class="wpb-ext">&lt;translate${S(this,dn,Es).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>`}};dn=new WeakSet,Es=function(){return this.firstChild.toString()===" nowrap"}});var Fs,Xn,Tl,vt,Rs=v(()=>{"use strict";M();se();xt();G();an();Fs=[ve(!1)];vt=class extends(Tl=Ie){get type(){return"include"}constructor(n,e="",t,r,i,s){super(n,e,t!=null?t:"",t===void 0||r!=null?r:"",i,s)}toString(n){return n?"":super.toString()}lint(n=this.getAbsoluteIndex()){let e=[],{firstChild:t,closed:r,name:i}=this,s=new L(this,n);if(t.data.trim()){let o=N(t,s,"no-ignored","useless attribute","warning");o.suggestions=[{desc:"remove",range:[o.startIndex,o.endIndex],text:""}],e.push(o)}if(!r){let o=E(this,s,"unclosed-comment",C.msg("unclosed $1",`<${i}>`));o.suggestions=[{desc:"close",range:[o.endIndex,o.endIndex],text:`</${i}>`}],e.push(o)}return e}};Xn=F(Tl),vt=P(Xn,0,"IncludeToken",Fs,vt),R(Xn,1,vt)});var Kt,gn=v(()=>{"use strict";pe();Kt=(a=0)=>n=>{var t,Ps;class e extends n{constructor(){super(...arguments);b(this,t)}getAttr(o){return S(this,t,Ps).call(this).getAttr(o)}}return t=new WeakSet,Ps=function(){return this.childNodes[a]},Fe(e,n),e}});var re,js,Bs,pn,Kn,Os,Jt,_s,Ms,Us,Qn,qs,Re,zs,Ds,Ws,Hs,Gs=v(()=>{"use strict";re=new Set(["align"]),js=new Set(["cite"]),Bs=new Set(["cite","datetime"]),pn=new Set(["width"]),Kn=new Set(["axis","align","bgcolor","height","width","valign"]),Os=new Set([...Kn,"abbr","headers","scope","rowspan","colspan"]),Jt=new Set(["type"]),_s=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),Ms=new Set(["clear"]),Us=new Set(["bgcolor","align","valign"]),Qn=new Set(["qid","forcemathmode","type","display"]),qs=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),Re=new Set,zs=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"]),Ds={div:re,h1:re,h2:re,h3:re,h4:re,h5:re,h6:re,blockquote:js,q:js,p:re,br:Ms,pre:pn,ins:Bs,del:Bs,ul:Jt,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([..._s,"border"]),caption:re,tr:Us,td:Os,th:Os,img:new Set(["alt","src","width","height","srcset"]),font:new Set(["size","color","face"]),hr:pn,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:Jt,poem:re,categorytree:re,combooption:re,math:Re,chem:Re,ce:Re},Ws={gallery:new Set(["mode","showfilename","caption","perrow","widths","heights","showthumbnails"]),poem:new Set(["compact"]),categorytree:new Set(["hideroot","onlyroot","depth","mode","hideprefix","namespaces","showcount","notranslations"]),combooption:new Set(["name","for","inline"]),nowiki:Re,indicator:new Set(["name"]),langconvert:new Set(["from","to"]),ref:new Set(["group","name","extends","follow","dir"]),references:new Set(["group","responsive"]),charinsert:new Set(["label"]),choose:new Set(["uncached","before","after"]),option:new Set(["weight"]),imagemap:Re,inputbox:Re,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:Re,poll:new Set(["id","show-results-before-voting"]),sm2:Jt,flashmp3:Jt,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([...Qn,"chem"]),chem:Qn,ce:Qn,hiero:Re,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:qs,syntaxhighlight:qs,templatedata:Re,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:Re},Hs={table:_s,td:new Set([...Kn,"scope"]),th:Kn,br:Ms,caption:re,div:re,hr:pn,h1:re,h2:re,h3:re,h4:re,h5:re,h6:re,li:Jt,p:re,pre:pn,tr:Us,ul:Jt}});var yl,kl,Pr,Yt,de,Pe,jr,Jn,Zt,Vs=v(()=>{"use strict";M();ie();Gs();se();G();B();ze();yl=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,kl=new Set(["ext","arg","magic-word","template"]),Zt=class extends A{constructor(e,t,r,i="",s,o=[],l=C.getConfig(),g=[]){let p=new Z(r,"attr-key",l,g),d;if(r==="title"||t==="img"&&r==="alt")d=new A(s,l,g,{}),d.type="attr-value",d.setAttribute("stage",10);else if(t==="gallery"&&r==="caption"||t==="choose"&&(r==="before"||r==="after")){let u=oe(K({},l),{excludes:[...l.excludes,"heading","html","table","hr","list"]});d=new A(s,u,g,{}),d.type="attr-value",d.setAttribute("stage",1)}else d=new Z(s,"attr-value",l,g,{});super(void 0,l,g);b(this,jr);b(this,Pr);b(this,Yt);b(this,de);b(this,Pe);y(this,Pr,e),this.append(p,d),y(this,de,i),y(this,Pe,[...o]),y(this,Yt,t),this.setAttribute("name",_e(ae(r)))}get type(){return c(this,Pr)}get tag(){return c(this,Yt)}get balanced(){return!c(this,de)||c(this,Pe)[0]===c(this,Pe)[1]}afterBuild(){c(this,de).includes("\0")&&y(this,de,this.buildFromStr(c(this,de),0)),this.parentNode&&y(this,Yt,this.parentNode.name),this.setAttribute("name",_e(this.firstChild.text())),super.afterBuild()}toString(e){let[t="",r=""]=c(this,Pe);return c(this,de)?super.toString(e,c(this,de)+t)+r:this.firstChild.toString(e)}text(){return c(this,de)?`${super.text(`${c(this,de).trim()}"`)}"`:this.firstChild.text()}getGaps(){var e,t;return c(this,de)?c(this,de).length+((t=(e=c(this,Pe)[0])==null?void 0:e.length)!=null?t:0):0}lint(e=this.getAbsoluteIndex(),t){var u;let r=super.lint(e,t),{balanced:i,firstChild:s,lastChild:o,name:l,tag:g}=this,p=new L(this,e);if(!i){let h=N(o,p,"unclosed-quote",C.msg("unclosed $1","quotes"),"warning");h.startIndex--,h.startCol--,h.suggestions=[{desc:"close",range:[h.endIndex,h.endIndex],text:c(this,Pe)[0]}],r.push(h)}let d=S(this,jr,Jn).call(this,e,p);return d&&r.push(d),(u=Hs[g])!=null&&u.has(l)&&r.push(N(s,p,"obsolete-attr","obsolete attribute","warning")),r}getValue(){return c(this,de)?this.lastChild.text().trim():this.type==="ext-attr"||""}getAttribute(e){return e==="invalid"?S(this,jr,Jn).call(this):super.getAttribute(e)}print(){let[e="",t=""]=c(this,Pe);return c(this,de)?super.print({sep:ft(c(this,de))+e,post:t}):super.print()}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return r.tag=this.tag,r}};Pr=new WeakMap,Yt=new WeakMap,de=new WeakMap,Pe=new WeakMap,jr=new WeakSet,Jn=function(e,t){let{firstChild:r,lastChild:i,type:s,name:o,tag:l}=this,g=this.getValue(),p=Ws[l],d=Ds[l],{length:u}=this.toString();if(!(p!=null&&p.has(o))&&!(d!=null&&d.has(o))&&(s==="ext-attr"?p||d:!/\{\{[^{]+\}\}/u.test(o))&&(s==="ext-attr"&&!d||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(o)&&(l==="meta"||l==="link"||!zs.has(o)))){if(e===void 0)return!0;let h=N(r,t,"illegal-attr","illegal attribute name");return h.suggestions=[{desc:"remove",range:[e,e+u],text:""}],h}else{if(o==="style"&&typeof g=="string"&&yl.test(g))return e===void 0?!0:N(i,t,"insecure-style","insecure style");if(o==="tabindex"&&typeof g=="string"&&g!=="0"){if(e===void 0)return!0;let h=N(i,t,"illegal-attr","nonzero tabindex");return h.suggestions=[{desc:"remove",range:[e,e+u],text:""},{desc:"0 tabindex",range:[h.startIndex,h.endIndex],text:"0"}],h}else if(s!=="ext-attr"&&!i.childNodes.some(({type:h})=>kl.has(h))){let h=cs(l,o),m=String(g).toLowerCase();if(h.length>0&&h.every(f=>f!==m))return e===void 0?!0:N(i,t,"illegal-attr","illegal attribute value","warning")}}return!1}});var Xs,vl,Yn,Br,er,un,ot,cn=v(()=>{"use strict";M();ie();se();G();B();ze();Vs();Xs=a=>a.slice(0,-1),vl=a=>`${Xs(a)}-dirty`;try{Yn=new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch(a){Yn=/[^\W_]/u}ot=class extends A{constructor(e,t,r,i,s=[]){super(void 0,i,s,{});b(this,er);b(this,Br);if(y(this,Br,t),this.setAttribute("name",r),e){let o=/([^\s/](?:(?!\0\d+~\x7F)[^\s/=])*)(?:((?:\s(?:\s|\0\d+[cn]\x7F)*)?(?:=|\0\d+~\x7F)(?:\s|\0\d+[cn]\x7F)*)(?:(["'])([\s\S]*?)(\3|$)|(\S*)))?/gu,l="",g=o.exec(e),p=0,d=()=>{l&&(super.insertAt(new Z(l,vl(t),i,s,{})),l="")};for(;g;){let{index:u,0:h,1:m,2:f,3:x,4:T,5:k,6:$}=g;if(l+=e.slice(p,u),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(ae(m).trim())){let w=T!=null?T:$,I=[x,k],j=new Zt(Xs(t),r,m,f,w,I,i,s);d(),super.insertAt(j)}else l+=h;({lastIndex:p}=o),g=o.exec(e)}l+=e.slice(p),d()}}get type(){return c(this,Br)}afterBuild(){let{parentNode:e}=this;e!=null&&e.is("td")&&this.setAttribute("name",e.subtype),super.afterBuild()}getAttrTokens(e){return this.childNodes.filter(t=>t instanceof Zt&&(!e||t.name===_e(e)))}getAttrToken(e){let t=this.getAttrTokens(e);return t[t.length-1]}getAttr(e){var t;return(t=this.getAttrToken(e))==null?void 0:t.getValue()}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{parentNode:i,childNodes:s}=this,o=new Map,l=new Set,g=new L(this,e);if(S(this,er,un).call(this)){let p=E(this,g,"no-ignored","attributes of a closing tag"),d=i.getAbsoluteIndex();p.suggestions=[{desc:"remove",range:[e,p.endIndex],text:""},{desc:"open",range:[d+1,d+2],text:""}],r.push(p)}for(let p of s)if(p instanceof Zt){let{name:d}=p;o.has(d)?(l.add(d),o.get(d).push(p)):o.set(d,[p])}else{let d=p.text().trim();if(d){let u=N(p,g,"no-ignored","containing invalid attribute",Yn.test(d)?"error":"warning");u.suggestions=[{desc:"remove",range:[u.startIndex,u.endIndex],text:" "}],r.push(u)}}if(l.size>0)for(let p of l){let d=o.get(p).map(u=>{let h=u.getValue();return[u,h===!0?"":h]});r.push(...d.map(([u,h],m)=>{let f=N(u,g,"no-duplicate",C.msg("duplicated $1 attribute",p)),x={desc:"remove",range:[f.startIndex,f.endIndex],text:""};return!h||d.slice(0,m).some(([,T])=>T===h)?f.fix=x:f.suggestions=[x],f}))}return r}getAttribute(e){return e==="invalid"?S(this,er,un).call(this):super.getAttribute(e)}print(){return this.toString()?`<span class="wpb-${this.type}${S(this,er,un).call(this)?" wpb-invalid":""}">${this.childNodes.map(e=>e.print(e instanceof Z?{class:e.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}};Br=new WeakMap,er=new WeakSet,un=function(){let{parentNode:e}=this;return(e==null?void 0:e.type)==="html"&&e.closing&&this.text().trim()!==""}});var Qs={};te(Qs,{PreToken:()=>Zn});var Zn,Ks=v(()=>{"use strict";B();We();Zn=class extends A{get type(){return"ext-inner"}constructor(n,e,t=[]){if(n){let r=/<nowiki>/giu,i=/<\/nowiki>/giu,{length:s}=r.source,o=r.exec(n);o&&(i.lastIndex=o.index+s);let l=i.exec(n),g=0,p="";for(;o&&l;)new D(o[0],e,t),new D(l[0],e,t),p+=`${n.slice(g,o.index)}\0${t.length-1}n${n.slice(o.index+s,l.index)}\0${t.length}n`,g=l.index+s+1,r.lastIndex=g,o=r.exec(n),o&&(i.lastIndex=o.index+s),l=i.exec(n);n=p+n.slice(g)}super(n,e,t,{}),this.setAttribute("stage",10)}isPlain(){return!0}lint(n=this.getAbsoluteIndex()){return super.lint(n,/<\s*\/\s*(pre)\b/giu)}}});var tr,hn=v(()=>{"use strict";pe();tr=a=>{class n extends a{toString(t){return super.toString(t,`
1
+ "use strict";(()=>{var Bo=Object.defineProperty,qo=Object.defineProperties;var Wo=Object.getOwnPropertyDescriptors;var lr=Object.getOwnPropertySymbols;var Mo=Object.prototype.hasOwnProperty,zo=Object.prototype.propertyIsEnumerable;var or=e=>{throw TypeError(e)};var ps=(e,t,s)=>t in e?Bo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,ue=(e,t)=>{for(var s in t||(t={}))Mo.call(t,s)&&ps(e,s,t[s]);if(lr)for(var s of lr(t))zo.call(t,s)&&ps(e,s,t[s]);return e},be=(e,t)=>qo(e,Wo(t));var Uo=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Ae=(e,t,s)=>ps(e,typeof t!="symbol"?t+"":t,s),fs=(e,t,s)=>t.has(e)||or("Cannot "+s);var f=(e,t,s)=>(fs(e,t,"read from private field"),s?s.call(e):t.get(e)),C=(e,t,s)=>t.has(e)?or("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),N=(e,t,s,r)=>(fs(e,t,"write to private field"),r?r.call(e,s):t.set(e,s),s),j=(e,t,s)=>(fs(e,t,"access private method"),s);var ar=(e,t,s,r)=>({set _(l){N(e,t,l,s)},get _(){return f(e,t,r)}});var Ha=Uo((Va,Oo)=>{var Ho=Object.create,st=Object.defineProperty,Qi=Object.getOwnPropertyDescriptor,Rn=Object.getOwnPropertyNames,Do=Object.prototype.hasOwnProperty,Ji=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),nt=e=>{throw TypeError(e)},Xi=(e,t,s)=>t in e?st(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,dr=(e,t)=>st(e,"name",{value:t,configurable:!0}),_=(e,t)=>function(){return e&&(t=(0,e[Rn(e)[0]])(e=0)),t},Go=(e,t)=>function(){return t||(0,e[Rn(e)[0]])((t={exports:{}}).exports,t),t.exports},Z=(e,t)=>{for(var s in t)st(e,s,{get:t[s],enumerable:!0})},Vo=(e,t,s,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of Rn(t))!Do.call(e,l)&&l!==s&&st(e,l,{get:()=>t[l],enumerable:!(r=Qi(t,l))||r.enumerable});return e},X=e=>Vo(st({},"__esModule",{value:!0}),e),se=e=>{var t;return[,,,Ho((t=e==null?void 0:e[Ji("metadata")])!=null?t:null)]},Ki=["class","method","getter","setter","accessor","field","value","get","set"],ft=e=>e!==void 0&&typeof e!="function"?nt("Function expected"):e,Qo=(e,t,s,r,l)=>({kind:Ki[e],name:t,metadata:r,addInitializer:n=>s._?nt("Already initialized"):l.push(ft(n||null))}),On=(e,t)=>Xi(t,Ji("metadata"),e[3]),ne=(e,t,s,r)=>{for(var l=0,n=e[t>>1],i=n&&n.length;l<i;l++)t&1?n[l].call(s):r=n[l].call(s,r);return r},re=(e,t,s,r,l,n)=>{var i,o,a,h,d,u=t&7,p=!!(t&8),g=!!(t&16),c=u>3?e.length+1:u?p?1:2:0,x=Ki[u+5],v=u>3&&(e[c-1]=[]),m=e[c]||(e[c]=[]),y=u&&(!g&&!p&&(l=l.prototype),u<5&&(u>3||!g)&&Qi(u<4?l:{get[s](){return de(this,n)},set[s](w){return fe(this,n,w)}},s));u?g&&u<4&&dr(n,(u>2?"set ":u>1?"get ":"")+s):dr(l,s);for(var A=r.length-1;A>=0;A--)h=Qo(u,s,a={},e[3],m),u&&(h.static=p,h.private=g,d=h.access={has:g?w=>Xo(l,w):w=>s in w},u^3&&(d.get=g?w=>(u^1?de:Ct)(w,l,u^4?n:y.get):w=>w[s]),u>2&&(d.set=g?(w,S)=>fe(w,l,S,u^4?n:y.set):(w,S)=>w[s]=S)),o=(0,r[A])(u?u<4?g?n:y[x]:u>4?void 0:{get:y.get,set:y.set}:l,h),a._=1,u^4||o===void 0?ft(o)&&(u>4?v.unshift(o):u?g?n=o:y[x]=o:l=o):typeof o!="object"||o===null?nt("Object expected"):(ft(i=o.get)&&(y.get=i),ft(i=o.set)&&(y.set=i),ft(i=o.init)&&v.unshift(i));return u||On(e,l),y&&st(l,s,y),g?u^4?n:y:l},Jo=(e,t,s)=>Xi(e,typeof t!="symbol"?t+"":t,s),Bn=(e,t,s)=>t.has(e)||nt("Cannot "+s),Xo=(e,t)=>Object(t)!==t?nt('Cannot use the "in" operator on this value'):e.has(t),de=(e,t,s)=>(Bn(e,t,"read from private field"),s?s.call(e):t.get(e)),Se=(e,t,s)=>t.has(e)?nt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),fe=(e,t,s,r)=>(Bn(e,t,"write to private field"),r?r.call(e,s):t.set(e,s),s),Ct=(e,t,s)=>(Bn(e,t,"access private method"),s),Ko=(e,t,s,r)=>({set _(l){fe(e,t,l,s)},get _(){return de(e,t,r)}}),Yi,qn,Zi=_({"base.ts"(){"use strict";Yi=(()=>{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})(),qn=(()=>{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 Ke(e){const t=new Map,s=new WeakMap;return r=>{const l=typeof r=="string"?t:s;if(l.has(r)){const i=l.get(r);return i.lastIndex=0,i}const n=e(r);return l.set(r,n),n}}var Nt,el,Et=_({"../code-standard/dist/index.mjs"(){"use strict";Nt=e=>decodeURIComponent(e.replace(/%(?![\da-f]{2})/giu,"%25")),el=Ke}}),Ie,xs,Ye,Ze,et,_e,He,tl,me,Oe,hr,ur,Lt,sl,cr,gr,Ft,tt,oe=_({"util/string.ts"(){"use strict";Et(),Ie=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,xs=String.raw`[^[\]<>"\0-\x1F\x7F${Ie}\uFFFD]`,Ye=String.raw`(?:\[[\da-f:.]+\]|${xs})`,Ze=String.raw`(?:${xs}|\0\d+[cn!~]\x7F)*`,et=e=>e.trim().toLowerCase(),_e=(e,t)=>e.replace(/\0(\d+)\x7F/gu,(s,r)=>t[r]),He=(e,t)=>s=>s.replace(e,t),tl=He(/[\0\x7F]|\r$/gmu,""),me=He(/\0\d+[cn]\x7F/gu,""),Oe=(e,t="")=>e.map(s=>typeof s=="string"?s:s.text()).join(t),hr={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},ur=He(/&(?:#(\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)):hr[s.toLowerCase()]),Lt=e=>ur(e),sl=He(/&#(\d+|x[\da-f]+);/giu,(e,t)=>String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t))),cr={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},gr=e=>He(e,t=>`&${cr[t]};`),Ft=gr(/[&<>]/gu),tt=(e,t={})=>{const{pre:s="",post:r="",sep:l=""}=t;return s+e.map(n=>n.print()).join(l)+r}}}),Yo=Go({"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:[]}}}),xe,yn,Be=_({"util/constants.ts"(){"use strict";xe=11,yn=Yo()}}),ie,ae=_({"lib/rect.ts"(){"use strict";var e,t,s,r,An,n;ie=(n=class{constructor(i,o){C(this,r);C(this,e);C(this,t);C(this,s);N(this,e,i),N(this,t,o)}get start(){return f(this,t)}get top(){return j(this,r,An).call(this).top}get left(){return j(this,r,An).call(this).left}},e=new WeakMap,t=new WeakMap,s=new WeakMap,r=new WeakSet,An=function(){var i;return(i=f(this,s))!=null||N(this,s,f(this,e).getRootNode().posFromIndex(f(this,t))),f(this,s)},n)}}),pr,fr,Tt,Sn,ms,O,Q,Re,nl,U=_({"util/lint.ts"(){"use strict";ge(),ae(),M(),pr=new Set(["tr","td","th","caption"]),fr=new Set(["Template:!!","Template:!-"]),Tt=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")&&fr.has(t.name)||t.is("html")&&pr.has(t.name))return!1;if(t.is("arg"))return t.length>1&&Tt(t.childNodes[1]);if(t.is("magic-word"))try{const s=t.getPossibleValues().map(Tt);return s.includes("error")?"error":s.includes("warning")&&"warning"}catch(s){}return t.is("template")||t.is("magic-word")&&t.name==="invoke"?"warning":"error"},Sn=(e,t,s,r)=>({line:e+s-1,character:(s===1?t:0)+r}),ms=e=>(t,s,r,l,n="error")=>{const{start:i}=s,{top:o,left:a}=s instanceof ie?s:new ie(t,i),{offsetHeight:h,offsetWidth:d}=t,{startIndex:u,startLine:p,startCol:g}=e(t,i,o,a),{line:c,character:x}=Sn(p,g,h,d);return{rule:r,message:L.msg(l),severity:n,startIndex:u,endIndex:u+t.toString().length,startLine:p,endLine:c,startCol:g,endCol:x}},O=ms((e,t,s,r)=>{const l=e.getRelativeIndex(),{top:n,left:i}=e.parentNode.posFromIndex(l);return{startIndex:t+l,startLine:s+n,startCol:n?i:r+i}}),Q=ms((e,t,s,r)=>({startIndex:t,startLine:s,startCol:r})),Re=(e,t,s,r)=>{if(e&&(r||L.viewOnly&&e[0]===ve.rev))return e[1];const l=t();return(r||L.viewOnly)&&s([ve.rev,l]),l},nl=(e,t)=>e==="ol"&&t==="type"?["1","a","A","i","I"]:e==="th"&&t==="scope"?["row","col","rowgroup","colgroup"]:t==="dir"?["ltr","rtl","auto"]:t==="aria-hidden"?["true","false"]:[]}}),xr,Jt,Zo=_({"parser/selector.ts"(){"use strict";xr=(e,t,s)=>{if(e.includes("#")){const[r,...l]=e.split("#");return(!r||r===t)&&l.every(n=>n===s)}return!e||e===t},Jt=(e,t,s)=>({type:r,name:l})=>e.split(",").some(n=>xr(n.trim(),r,l))}}),Wn,rl=_({"mixin/cached.ts"(){"use strict";U(),Wn=(e=!0)=>t=>{const s=new WeakMap;return function(...r){return Re(s.get(this),()=>t.apply(this,r),l=>{s.set(this,l)},e)}}}}),mr,Ot,ot,at,Bt,dt,ht,qt,vs,Wt,It,il=_({"lib/node.ts"(){"use strict";U(),ge(),rl(),M(),mr=[Wn(!1)],It=class{constructor(){ne(Wt,5,this),Se(this,qt),Jo(this,"childNodes",[]),Se(this,Ot),Se(this,ot),Se(this,at),Se(this,Bt),Se(this,dt),Se(this,ht,{})}get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get parentNode(){return de(this,Ot)}get nextSibling(){return de(this,ot)}get previousSibling(){return de(this,at)}get offsetHeight(){return Ct(this,qt,vs).call(this).height}get offsetWidth(){return Ct(this,qt,vs).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":fe(this,Ot,t),t||(fe(this,ot,void 0),fe(this,at,void 0));break;case"nextSibling":fe(this,ot,t);break;case"previousSibling":fe(this,at,t);break;case"aIndex":L.viewOnly&&fe(this,dt,[ve.rev,t]);break;default:this[e]=t}}getRootNode(){return Re(de(this,Bt),()=>{var e,t;return(t=(e=this.parentNode)==null?void 0:e.getRootNode())!=null?t:this},e=>{const[,t]=e;t.type==="root"&&fe(this,Bt,e)})}indexFromPos(e,t){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 Re(de(this,ht)[e],()=>{const{childNodes:t}=this,s=e+(e<0?t.length:0);let r=this.getAttribute("padding");for(let l=0;l<s;l++)L.viewOnly&&(de(this,ht)[l]=[ve.rev,r]),r+=t[l].toString().length+this.getGaps(l);return r},t=>{de(this,ht)[e]=t})}getAbsoluteIndex(){return Re(de(this,dt),()=>{const{parentNode:e}=this;return e?e.getAbsoluteIndex()+this.getRelativeIndex():0},e=>{fe(this,dt,e)})}getBoundingClientRect(){this.lspError("AstNode.getBoundingClientRect")}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){Object.defineProperty(this,e,{enumerable:!t&&!!this[e],configurable:!0})}lspError(e){throw new Error(`${e} method is only available in the LSP version!`)}},Wt=se(null),Ot=new WeakMap,ot=new WeakMap,at=new WeakMap,Bt=new WeakMap,dt=new WeakMap,ht=new WeakMap,qt=new WeakSet,vs=function(){const e=this.getLines(),t=e[e.length-1];return{height:e.length,width:t[2]-t[1]}},re(Wt,1,"getLines",mr,It),On(Wt,It)}}),ll,ea=_({"lib/element.ts"(){"use strict";var e,_n,kn,r;oe(),ge(),Zo(),il(),ll=(r=class extends It{constructor(){super(...arguments);C(this,e)}get length(){return this.childNodes.length}text(n){return Oe(this.childNodes,n)}normalize(){const n=this.getChildNodes(),i=o=>{var a,h;n.splice(o,1),(a=n[o-1])==null||a.setAttribute("nextSibling",n[o]),(h=n[o])==null||h.setAttribute("previousSibling",n[o-1])};for(let o=n.length-1;o>=0;o--){const{type:a,data:h}=n[o];a!=="text"||n.length===1||this.getGaps(o-(o&&1))||h===""&&i(o)}this.setAttribute("childNodes",n)}removeAt(n){return rs(this,n,1)[0]}insertAt(n,i=this.length){return rs(this,i,0,[n]),n}closest(n){const i=Jt(n,this);let{parentNode:o}=this;for(;o;){if(i(o))return o;({parentNode:o}=o)}}querySelector(n){const i=Jt(n,this);return j(this,e,_n).call(this,i)}querySelectorAll(n){const i=Jt(n,this);return j(this,e,kn).call(this,i)}append(...n){this.safeAppend(n)}safeAppend(n){for(const i of n)this.insertAt(i)}replaceChildren(...n){this.safeReplaceChildren(n)}safeReplaceChildren(n){for(let i=this.length-1;i>=0;i--)this.removeAt(i);this.safeAppend(n)}setText(n,i=0){i+=i<0?this.length:0;const o=this.childNodes[i],{data:a}=o;return o.replaceData(n),a}toString(n,i=""){return this.childNodes.map(o=>o.toString(n)).join(i)}caretPositionFromIndex(n){this.lspError("AstElement.caretPositionFromIndex")}elementFromIndex(n){this.lspError("AstElement.elementFromIndex")}elementFromPoint(n,i){this.lspError("AstElement.elementFromPoint")}lint(n=this.getAbsoluteIndex(),i){const o=[];for(let a=0,h=n+this.getAttribute("padding");a<this.length;a++){const d=this.childNodes[a];d.setAttribute("aIndex",h);const u=d.lint(h,i);u.length>0&&o.push(...u),h+=d.toString().length+this.getGaps(a)}return o}print(n={}){const i=n.class;return this.toString()?(i===""?"":`<span class="wpb-${i!=null?i:this.type}${this.getAttribute("invalid")?" wpb-invalid":""}">`)+tt(this.childNodes,n)+(i===""?"":"</span>"):""}json(n,i=this.getAbsoluteIndex()){const o=be(ue({},this),{type:this.type,range:[i,i+this.toString().length],childNodes:[]});for(let a=0,h=i+this.getAttribute("padding");a<this.length;a++){const d=this.childNodes[a],{length:u}=d.toString();d.setAttribute("aIndex",h),o.childNodes.push(d.type==="text"?{data:d.data,range:[h,h+u]}:d.json(void 0,h)),h+=u+this.getGaps(a)}return o}},e=new WeakSet,_n=function(n){var i;for(const o of this.childNodes){if(o.type==="text")continue;if(n(o))return o;const a=j(i=o,e,_n).call(i,n);if(a)return a}},kn=function(n){var o;let i=[];for(const a of this.childNodes)a.type!=="text"&&(n(a)&&i.push(a),i=[...i,...j(o=a,e,kn).call(o,n)]);return i},r)}}),Mt,bs,vr,br,wr,yr,Ar,ws,ys,$n,ta=_({"lib/text.ts"(){"use strict";var e,ol,s;oe(),U(),M(),il(),Mt=String.raw`[${Ie}\t]*`,bs=String.raw`<\s*(?:/\s*)?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|(?:rfc|pmid)(?=[-::]?${Mt}\d)|isbn(?=[-::]?${Mt}(?:\d(?:${Mt}|-)){6})`,vr=new RegExp(String.raw`${bs}|https?[:/]/+`,"giu"),br=new RegExp(bs,"giu"),wr=new Set(["attr-value","ext-link-text","link-text"]),yr={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},Ar={"<":"tag-like","[":"lonely-bracket","{":"lonely-bracket","]":"lonely-bracket","}":"lonely-bracket",h:"lonely-http",r:"lonely-http",p:"lonely-http",i:"lonely-http"},ws=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{ys=new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch(r){ys=/\w/u}$n=(s=class extends It{constructor(l){super();C(this,e);Ae(this,"data","");this.data=l}get type(){return"text"}toString(l){var n;return l&&!((n=this.parentNode)!=null&&n.getAttribute("built"))?me(this.data):this.data}text(){return this.data}lint(l=this.getAbsoluteIndex(),n){var I,H,R;if(n===!1)return[];const{data:i,parentNode:o,nextSibling:a,previousSibling:h}=this;if(!o)throw new Error("An isolated text node cannot be linted!");const{type:d,name:u,parentNode:p}=o;let g=!1;if(d==="attr-value"){const{type:P,name:D,tag:V}=p;if(P!=="ext-attr")g=!0;else if(V==="ref"&&(D==="name"||D==="extends"||D==="follow")||D==="group"&&(V==="ref"||V==="references")||V==="choose"&&(D==="before"||D==="after"))return[]}if(n!=null||(n=d==="free-ext-link"||d==="ext-link-url"||d==="ext-link-text"||d==="image-parameter"&&u==="link"||g?br:vr),i.search(n)===-1)return[];n.lastIndex=0;const c=[],x=a==null?void 0:a.type,v=a==null?void 0:a.name,m=h==null?void 0:h.type,y=this.getRootNode(),A=y.toString(),{ext:w,html:S,variants:T}=y.getAttribute("config"),{top:b,left:k}=y.posFromIndex(l),$=new Set(["onlyinclude","noinclude","includeonly",...w,...S[0],...S[1],...S[2],...ws]);for(let P=n.exec(i);P;P=n.exec(i)){const[,D,V]=P;let{index:K,0:z}=P;if(V&&V!=="]"){const{length:pe}=V;K+=pe,z=z.slice(pe)}z=z.toLowerCase();const[F]=z,q=F==="r"||F==="p"||F==="i";let{length:G}=z;if(F==="<"&&!$.has(D.toLowerCase())||F==="["&&d==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(i.slice(K+1))||a!=null&&a.is("ext")&&v==="nowiki"&&((I=a.innerText)!=null&&I.includes("]")))||q&&(!o.isPlain()||wr.has(d)))continue;F==="]"&&(K||G>1)&&n.lastIndex--;let W=l+K,J=W+G;const Y=A[J],le=A[W-1];let ee=G>1&&!(F==="<"&&(/^<\s/u.test(z)||!/[\s/>]/u.test(Y!=null?Y:"")||ws.has(D))||g&&(F==="["||F==="]")||q&&d==="parameter-value"||/^(?:rfc|pmid|isbn)$/iu.test(z))||F==="{"&&(Y===F||le==="-"&&T.length>0)||F==="}"&&(le===F||Y==="-"&&T.length>0)||F==="["&&(d==="ext-link-text"||x==="free-ext-link"&&!i.slice(K+1).trim())||F==="]"&&m==="free-ext-link"&&!i.slice(0,K).includes("]")?"error":"warning";const ze=F==="{"||F==="[";if(ee==="warning"&&(ze||(F==="]"||F==="}"))){const pe=yr[F],gs=ze?i.slice(K+1):i.slice(0,K);if(F==="{"&&((H=pe.exec(gs))==null?void 0:H[0])==="}"||F==="}"&&((R=pe.exec(gs))==null?void 0:R[0])==="{")continue;if(!gs.includes(F)){const ir=ze?"nextSibling":"previousSibling";let je=this[ir];for(;je&&(je.type!=="text"||!pe.test(je.data));)je=je[ir];if(je&&pe.exec(je.data)[0]!==F)continue}}q?z=z.toUpperCase():z==="{"&&le==="-"&&ee==="error"?(ee="warning",K>0&&(z="-{",K--,W--,G=2)):z==="}"&&Y==="-"&&ee==="error"&&(ee="warning",K<i.length-1&&(z="}-",J++,G=2));const sr=this.posFromIndex(K),{line:nr,character:rr}=Sn(b,k,sr.top+1,sr.left),Ue={rule:Ar[F],message:L.msg('lonely "$1"',q||F==="h"||z==="-{"||z==="}-"?z:F),severity:ee,startIndex:W,endIndex:J,startLine:nr,endLine:nr,startCol:rr,endCol:rr+G};if(F==="<")Ue.suggestions=[{desc:"escape",range:[W,W+1],text:"&lt;"}];else if(F==="h"&&d!=="link-text"&&ys.test(le||""))Ue.suggestions=[{desc:"whitespace",range:[W,W],text:" "}];else if(F==="["&&d==="ext-link-text"){const pe=o.getAbsoluteIndex()+o.toString().length;Ue.suggestions=[{desc:"escape",range:[pe,pe+1],text:"&#93;"}]}else if(F==="]"&&m==="free-ext-link"&&ee==="error"){const pe=l-h.toString().length;Ue.suggestions=[{desc:"left bracket",range:[pe,pe],text:"["}]}else q&&(Ue.suggestions=[...P[0]===z?[]:[{desc:"uppercase",range:[W,J],text:z}],...Y===":"||Y===":"?[{desc:"whitespace",range:[J,J+1],text:" "}]:[]]);c.push(Ue)}return c}replaceData(l){j(this,e,ol).call(this,l)}print(){return Ft(this.data)}},e=new WeakSet,ol=function(l){this.setAttribute("data",l)},s)}}),qe,rt=_({"mixin/hidden.ts"(){"use strict";ge(),qe=(e=!0,t=!0)=>s=>{class r extends s{text(){return""}lint(n){return e?[]:super.lint(n)}}return lt(r,s),r}}}),We,it=_({"src/syntax.ts"(){"use strict";var e,t;B(),We=(t=class extends E{constructor(r,l,n,i,o){super(r,n,i,o);C(this,e);N(this,e,l)}get type(){return f(this,e)}lint(r=this.getAbsoluteIndex()){return super.lint(r,!1)}},e=new WeakMap,t)}}),ke,Ce=_({"mixin/padded.ts"(){"use strict";ge(),ke=({length:e})=>t=>{class s extends t{getAttribute(l){return l==="padding"?e:super.getAttribute(l)}}return lt(s,t),s}}}),ce,Ne=_({"src/atom.ts"(){"use strict";var e,t;B(),ce=(t=class extends E{constructor(r,l,n,i,o){super(r,n,i,o);C(this,e);N(this,e,l)}get type(){return f(this,e)}set type(r){N(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)}}),Sr,_r,As,kr,Te,is=_({"src/link/base.ts"(){"use strict";var e,t,s,r;U(),Be(),oe(),ae(),Ce(),B(),Ne(),Sr=l=>l==="redirect-target"||l==="link",_r=[ke("[[")],Te=(r=class extends(kr=E){constructor(n,i,o,a=[],h="|"){super(void 0,o,a,{});C(this,e,!0);C(this,t);C(this,s);if(this.insertAt(new ce(n,"link-target",o,a,{})),i!==void 0){const d=new E(i,o,a,{});d.type="link-text",d.setAttribute("stage",xe-1),this.insertAt(d)}N(this,t,h)}get link(){}get fragment(){return f(this,s).fragment}afterBuild(){N(this,s,this.getTitle()),f(this,t).includes("\0")&&N(this,t,this.buildFromStr(f(this,t),0)),this.setAttribute("name",f(this,s).title),super.afterBuild()}setAttribute(n,i){n==="bracket"?N(this,e,i):n==="title"?N(this,s,i):super.setAttribute(n,i)}toString(n){const i=super.toString(n,f(this,t));return f(this,e)?`[[${i}]]`:i}text(){const n=super.text("|");return f(this,e)?`[[${n}]]`:n}getAttribute(n){return n==="title"?f(this,s):super.getAttribute(n)}getGaps(n){return n===0?f(this,t).length:1}lint(n=this.getAbsoluteIndex(),i){const o=super.lint(n,i),{childNodes:[a,h],type:d}=this,{encoded:u,fragment:p}=f(this,s),g=new ie(this,n);if(a.childNodes.some(({type:c})=>c==="template")&&o.push(O(a,g,"unknown-page","template in an internal link target","warning")),u){const c=O(a,g,"url-encoding","unnecessary URL encoding in an internal link","warning");c.fix={desc:"decode",range:[c.startIndex,c.endIndex],text:Nt(a.text())},o.push(c)}if(d==="link"||d==="category"){const c=h==null?void 0:h.childNodes.findIndex(v=>v.type==="text"&&v.data.includes("|")),x=h==null?void 0:h.childNodes[c];if(x){const v=O(h,g,"pipe-like",'additional "|" in the link text',"warning"),m=v.startIndex+h.getRelativeIndex(c);v.suggestions=[{desc:"escape",range:[m,m+x.data.length],text:x.data.replace(/\|/gu,"&#124;")}],o.push(v)}}if(p!==void 0&&!Sr(d)){const c=O(a,g,"no-ignored","useless fragment","warning"),x=a.childNodes.findIndex(m=>m.type==="text"&&m.data.includes("#")),v=a.childNodes[x];v&&(c.fix={desc:"remove",range:[c.startIndex+a.getRelativeIndex(x)+v.data.indexOf("#"),c.endIndex],text:""}),o.push(c)}return o}getTitle(n,i){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:i,temporary:n,decode:!0,selfLink:!0})}print(){return super.print(f(this,e)?{pre:"[[",post:"]]",sep:f(this,t)}:{sep:f(this,t)})}json(n,i=this.getAbsoluteIndex()){const o=super.json(void 0,i),{type:a,fragment:h}=this;return h!==void 0&&(a==="link"||a==="redirect-target")&&(o.fragment=h),o}},e=new WeakMap,t=new WeakMap,s=new WeakMap,r),As=se(kr),Te=re(As,0,"LinkBaseToken",_r,Te),ne(As,1,Te)}}),Le,Me=_({"src/nowiki/base.ts"(){"use strict";B(),Le=class extends E{get innerText(){return this.firstChild.data}constructor(e="",t,s){super(e,t,s)}}}}),$r,Ss,Tr,he,Fe=_({"src/nowiki/noinclude.ts"(){"use strict";rt(),Me(),$r=[qe()],he=class extends(Tr=Le){get type(){return"noinclude"}toString(e){return e?"":super.toString()}},Ss=se(Tr),he=re(Ss,0,"NoincludeToken",$r,he),ne(Ss,1,he)}}),al,sa=_({"src/link/redirectTarget.ts"(){"use strict";U(),M(),is(),Fe(),al=class extends Te{get type(){return"redirect-target"}constructor(e,t,s,r){super(e,void 0,s,r),t!==void 0&&this.insertAt(new he(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=L.lintConfig.getSeverity(s,"redirect");if(r&&this.length===2){const l=O(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}}}}),Ir,_s,Cr,xt,na=_({"src/redirect.ts"(){"use strict";var e,t,s;rt(),B(),it(),sa(),Ir=[qe(!1,!1)],xt=(s=class extends(Cr=E){constructor(l,n,i,o,a,h,d=[]){super(void 0,h,d);C(this,e);C(this,t);N(this,e,l),N(this,t,a),this.append(new We(n,"redirect-syntax",h,d),new al(i,o==null?void 0:o.slice(1),h,d))}get type(){return"redirect"}getAttribute(l){return l==="padding"?f(this,e).length:super.getAttribute(l)}toString(l){return f(this,e)+super.toString(l)+f(this,t)}lint(l=this.getAbsoluteIndex()){const n=l+f(this,e).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",n),this.lastChild.lint(n)}print(){return super.print({pre:f(this,e),post:f(this,t)})}},e=new WeakMap,t=new WeakMap,s),_s=se(Cr),xt=re(_s,0,"RedirectToken",Ir,xt),ne(_s,1,xt)}}),dl={};Z(dl,{parseRedirect:()=>hl});var hl,ra=_({"parser/redirect.ts"(){"use strict";M(),na(),hl=(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&&L.normalizeTitle(r[3],0,!1,t,{halfParsed:!0,temporary:!0,decode:!0}).valid?(e=`\0${s.length}o${e.slice(r[0].length)}`,new xt(...r.slice(1),t,s),e):!1}}}),Nr,ks,Lr,mt,ia=_({"src/onlyinclude.ts"(){"use strict";Ce(),B(),Nr=[ke("<onlyinclude>")],mt=class extends(Lr=E){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>'})}},ks=se(Lr),mt=re(ks,0,"OnlyincludeToken",Nr,mt),ne(ks,1,mt)}}),Pt,ls=_({"mixin/gapped.ts"(){"use strict";ge(),Pt=(e=1)=>t=>{class s extends t{getGaps(){return e}}return lt(s,t),s}}}),Fr,$s,jr,Pe,Mn=_({"src/tagPair/index.ts"(){"use strict";var e,t;ls(),B(),Fr=[Pt()],Pe=(t=class extends(jr=E){constructor(r,l,n,i,o,a=[]){super(void 0,o);C(this,e);Ae(this,"closed");Ae(this,"selfClosing");this.setAttribute("name",r.toLowerCase()),N(this,e,[r,i||r]),this.closed=i!=="",this.selfClosing=i===void 0,this.append(l,n);const h=typeof l=="string"?-1:a.indexOf(l);a.splice(h===-1?1/0:h,0,this)}get innerText(){return this.selfClosing?void 0:this.lastChild.text()}toString(r){const{selfClosing:l,firstChild:n,lastChild:i}=this,[o,a]=f(this,e);return l?`<${o}${n.toString(r)}/>`:`<${o}${n.toString(r)}>${i.toString(r)}${this.closed?`</${a}>`:""}`}text(){const[r,l]=f(this,e);return this.selfClosing?`<${r}${this.firstChild.text()}/>`:`<${r}${super.text(">")}${this.closed?`</${l}>`:""}`}getAttribute(r){return r==="padding"?f(this,e)[0].length+1:super.getAttribute(r)}print(){const[r,l]=f(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),$s=se(jr),Pe=re($s,0,"TagPairToken",Fr,Pe),ne($s,1,Pe)}}),ul,la=_({"src/tagPair/translate.ts"(){"use strict";var e,cl,s;B(),Mn(),it(),Fe(),ul=(s=class extends Pe{constructor(l,n,i,o=[]){const a=new We(l,"translate-attr",i,o);n=n==null?void 0:n.replace(/(<tvar\|[^>]+>)([\s\S]*?)(<\/>)/gu,(d,u,p,g)=>(new he(u,i,o),new he(g,i,o),`\0${o.length-1}n${p}\0${o.length}n`)).replace(/(<tvar\s+name\s*=(?:\s*(?:(["'])[\s\S]*?\2|[^"'\s>]+))?\s*>)([\s\S]*?)(<\/tvar\s*>)/giu,(d,u,p,g,c)=>(new he(u,i,o),new he(c,i,o),`\0${o.length-1}n${g}\0${o.length}n`));const h=new E(n,i,o);h.type="translate-inner";super("translate",a,h,"translate",i,o);C(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${j(this,e,cl).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,cl=function(){return this.firstChild.toString()===" nowrap"},s)}}),Er,Ts,Pr,vt,oa=_({"src/tagPair/include.ts"(){"use strict";U(),ae(),rt(),M(),Mn(),Er=[qe(!1)],vt=class extends(Pr=Pe){get type(){return"include"}constructor(e,t="",s,r,l,n){super(e,t,s!=null?s:"",s===void 0||r!=null?r:"",l,n)}toString(e){return e?"":super.toString()}lint(e=this.getAbsoluteIndex()){const t=[],{firstChild:s,closed:r,name:l}=this,n=new ie(this,e),i=["no-ignored","unclosed-comment"],o=i.map(a=>L.lintConfig.getSeverity(a,"include"));if(o[0]&&s.data.trim()){const a=O(s,n,i[0],"useless attribute",o[0]);a.suggestions=[{desc:"remove",range:[a.startIndex,a.endIndex],text:""}],t.push(a)}if(o[1]&&!r){const a=Q(this,n,i[1],L.msg("unclosed $1",`<${l}>`),o[1]);a.suggestions=[{desc:"close",range:[a.endIndex,a.endIndex],text:`</${l}>`}],t.push(a)}return t}},Ts=se(Pr),vt=re(Ts,0,"IncludeToken",Er,vt),ne(Ts,1,vt)}}),os,zn=_({"mixin/attributesParent.ts"(){"use strict";ge(),os=(e=0)=>t=>{var r,Tn;class s extends t{constructor(){super(...arguments);C(this,r)}hasAttr(o){return j(this,r,Tn).call(this).hasAttr(o)}getAttr(o){return j(this,r,Tn).call(this).getAttr(o)}}return r=new WeakSet,Tn=function(){return this.childNodes[e]},lt(s,t),s}}}),te,Is,Cs,ut,zt,Ns,Ee,Ls,Fs,js,Ut,Es,we,gl,pl,fl,xl,aa=_({"util/sharable.ts"(){"use strict";te=new Set(["align"]),Is=new Set(["cite"]),Cs=new Set(["cite","datetime"]),ut=new Set(["width"]),zt=new Set(["axis","align","bgcolor","height","width","valign"]),Ns=new Set([...zt,"abbr","headers","scope","rowspan","colspan"]),Ee=new Set(["type"]),Ls=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),Fs=new Set(["clear"]),js=new Set(["bgcolor","align","valign"]),Ut=new Set(["qid","forcemathmode","type","display"]),Es=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),we=new Set,gl=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"]),pl={div:te,h1:te,h2:te,h3:te,h4:te,h5:te,h6:te,blockquote:Is,q:Is,p:te,br:Fs,pre:ut,ins:Cs,del:Cs,ul:Ee,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...Ls,"border"]),caption:te,tr:js,td:Ns,th:Ns,img:new Set(["alt","src","width","height","srcset"]),font:new Set(["size","color","face"]),hr:ut,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:Ee,poem:te,categorytree:te,combooption:te,math:we,chem:we,ce:we},fl={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:we,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:we,inputbox:we,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:we,poll:new Set(["id","show-results-before-voting"]),sm2:Ee,flashmp3:Ee,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([...Ut,"chem"]),chem:Ut,ce:Ut,hiero:we,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:Es,syntaxhighlight:Es,templatedata:we,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:we},xl={table:Ls,td:new Set([...zt,"scope"]),th:zt,br:Fs,caption:te,div:te,hr:ut,h1:te,h2:te,h3:te,h4:te,h5:te,h6:te,li:Ee,p:te,pre:ut,tr:js,ul:Ee}}}),Rr,Or,Br,qr,Xt,da=_({"src/attribute.ts"(){"use strict";var e,t,s,r,l,In,i;U(),oe(),Be(),aa(),ae(),M(),B(),Ne(),Rr=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,Or=/(?:^|\s|\*\/)(?:javascript|vbscript)(?:\W|$)/iu,Br=new Set(["ext","arg","magic-word","template"]),qr=new Set(["about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),Xt=(i=class extends E{constructor(a,h,d,u="",p,g=[],c=L.getConfig(),x=[]){const v=new ce(d,"attr-key",c,x);let m;if(d==="title"||h==="img"&&d==="alt")m=new E(p,c,x,{}),m.type="attr-value",m.setAttribute("stage",xe-1);else if(h==="gallery"&&d==="caption"||h==="choose"&&(d==="before"||d==="after")){const y=be(ue({},c),{excludes:[...c.excludes,"heading","html","table","hr","list"]});m=new E(p,y,x,{}),m.type="attr-value",m.setAttribute("stage",1)}else m=new ce(p,"attr-value",c,x,{});super(void 0,c,x);C(this,l);C(this,e);C(this,t);C(this,s);C(this,r);N(this,e,a),this.append(v,m),N(this,s,u),N(this,r,[...g]),N(this,t,h),this.setAttribute("name",et(me(d)))}get type(){return f(this,e)}get tag(){return f(this,t)}get balanced(){return!f(this,s)||f(this,r)[0]===f(this,r)[1]}afterBuild(){f(this,s).includes("\0")&&N(this,s,this.buildFromStr(f(this,s),0)),this.parentNode&&N(this,t,this.parentNode.name),this.setAttribute("name",et(this.firstChild.text())),super.afterBuild()}toString(a){const[h="",d=""]=f(this,r);return f(this,s)?super.toString(a,f(this,s)+h)+d:this.firstChild.toString(a)}text(){return f(this,s)?`${super.text(`${f(this,s).trim()}"`)}"`:this.firstChild.text()}getGaps(){var a,h;return f(this,s)?f(this,s).length+((h=(a=f(this,r)[0])==null?void 0:a.length)!=null?h:0):0}lint(a=this.getAbsoluteIndex(),h){var y;const d=super.lint(a,h),{balanced:u,firstChild:p,lastChild:g,name:c,tag:x}=this,v=new ie(this,a);if(!u){const A=O(g,v,"unclosed-quote",L.msg("unclosed $1","quotes"),"warning");A.startIndex--,A.startCol--,A.suggestions=[{desc:"close",range:[A.endIndex,A.endIndex],text:f(this,r)[0]}],d.push(A)}const m=j(this,l,In).call(this,a,v);return m&&d.push(m),(y=xl[x])!=null&&y.has(c)&&d.push(O(p,v,"obsolete-attr","obsolete attribute","warning")),d}getValue(){return f(this,s)?this.lastChild.text().trim():this.type==="ext-attr"||""}getAttribute(a){return a==="invalid"?j(this,l,In).call(this):super.getAttribute(a)}print(){const[a="",h=""]=f(this,r);return f(this,s)?super.print({sep:Ft(f(this,s))+a,post:h}):super.print()}json(a,h=this.getAbsoluteIndex()){const d=super.json(void 0,h);return d.tag=this.tag,d}},e=new WeakMap,t=new WeakMap,s=new WeakMap,r=new WeakMap,l=new WeakSet,In=function(a,h){const{firstChild:d,lastChild:u,type:p,name:g,tag:c,parentNode:x}=this,v=!u.childNodes.some(({type:S})=>Br.has(S)),m=this.getValue(),y=fl[c],A=pl[c],{length:w}=this.toString();if(!(y!=null&&y.has(g))&&!(A!=null&&A.has(g))&&(p==="ext-attr"?y||A:!/\{\{[^{]+\}\}/u.test(g))&&(p==="ext-attr"&&!A||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(g)&&(c==="meta"||c==="link"||!gl.has(g)))||(g==="itemtype"||g==="itemid"||g==="itemref")&&!(x!=null&&x.hasAttr("itemscope"))){if(a===void 0)return!0;const S=O(d,h,"illegal-attr","illegal attribute name");return S.suggestions=[{desc:"remove",range:[a,a+w],text:""}],S}else{if(g==="style"&&typeof m=="string"&&Rr.test(m))return a===void 0?!0:O(u,h,"insecure-style","insecure style");if(g==="tabindex"&&typeof m=="string"&&m!=="0"){if(a===void 0)return!0;const S=O(u,h,"illegal-attr","nonzero tabindex");return S.suggestions=[{desc:"remove",range:[a,a+w],text:""},{desc:"0 tabindex",range:[S.startIndex,S.endIndex],text:"0"}],S}else if(v&&p!=="ext-attr"){const S=nl(c,g),T=String(m).toLowerCase();if(S.length>0&&S.every(b=>b!==T))return a===void 0?!0:O(u,h,"illegal-attr","illegal attribute value","warning")}else if(typeof m=="string"&&((/^xmlns:[\w:.-]+$/u.test(g)||qr.has(g))&&Or.test(m)||v&&(g==="href"||g==="src")&&!new RegExp(String.raw`^(?:${this.getAttribute("config").protocol}|//)\S+$`,"iu").test(m)))return a===void 0?!0:O(u,h,"illegal-attr","illegal attribute value")}return!1},i)}}),Ps,Wr,Rs,as,Un=_({"src/attributes.ts"(){"use strict";var e,t,Kt,r;U(),oe(),ae(),M(),B(),Ne(),da(),Ps=l=>l.slice(0,-1),Wr=l=>`${Ps(l)}-dirty`;try{Rs=new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch(l){Rs=/[^\W_]/u}as=(r=class extends E{constructor(n,i,o,a,h=[]){super(void 0,a,h,{});C(this,t);C(this,e);if(N(this,e,i),this.setAttribute("name",o),n){const d=/([^\s/](?:(?!\0\d+~\x7F)[^\s/=])*)(?:((?:\s(?:\s|\0\d+[cn]\x7F)*)?(?:=|\0\d+~\x7F)(?:\s|\0\d+[cn]\x7F)*)(?:(["'])([\s\S]*?)(\3|$)|(\S*)))?/gu;let u="",p=d.exec(n),g=0;const c=()=>{u&&(super.insertAt(new ce(u,Wr(i),a,h,{})),u="")};for(;p;){const{index:x,0:v,1:m,2:y,3:A,4:w,5:S,6:T}=p;if(u+=n.slice(g,x),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(me(m).trim())){const b=w!=null?w:T,k=[A,S],$=new Xt(Ps(i),o,m,y,b,k,a,h);c(),super.insertAt($)}else u+=v;({lastIndex:g}=d),p=d.exec(n)}u+=n.slice(g),c()}}get type(){return f(this,e)}afterBuild(){const{parentNode:n}=this;n!=null&&n.is("td")&&this.setAttribute("name",n.subtype),super.afterBuild()}getAttrTokens(n){return this.childNodes.filter(i=>i instanceof Xt&&(!n||i.name===et(n)))}hasAttr(n){return this.getAttrTokens(n).length>0}getAttrToken(n){const i=this.getAttrTokens(n);return i[i.length-1]}getAttr(n){var i;return(i=this.getAttrToken(n))==null?void 0:i.getValue()}lint(n=this.getAbsoluteIndex(),i){const o=super.lint(n,i),{parentNode:a,childNodes:h}=this,d=new Map,u=new Set,p=new ie(this,n);if(j(this,t,Kt).call(this)){const g=Q(this,p,"no-ignored","attributes of a closing tag"),c=a.getAbsoluteIndex();g.suggestions=[{desc:"remove",range:[n,g.endIndex],text:""},{desc:"open",range:[c+1,c+2],text:""}],o.push(g)}for(const g of h)if(g instanceof Xt){const{name:c}=g;d.has(c)?(u.add(c),d.get(c).push(g)):d.set(c,[g])}else{const c=g.text().trim();if(c){const x=O(g,p,"no-ignored","containing invalid attribute",Rs.test(c)?"error":"warning");x.suggestions=[{desc:"remove",range:[x.startIndex,x.endIndex],text:" "}],o.push(x)}}if(u.size>0)for(const g of u){const c=d.get(g).map(x=>{const v=x.getValue();return[x,v===!0?"":v]});o.push(...c.map(([x,v],m)=>{const y=O(x,p,"no-duplicate",L.msg("duplicated $1 attribute",g)),A={desc:"remove",range:[y.startIndex,y.endIndex],text:""};return!v||c.slice(0,m).some(([,w])=>w===v)?y.fix=A:y.suggestions=[A],y}))}return o}getAttribute(n){return n==="invalid"?j(this,t,Kt).call(this):super.getAttribute(n)}print(){return this.toString()?`<span class="wpb-${this.type}${j(this,t,Kt).call(this)?" wpb-invalid":""}">${this.childNodes.map(n=>n.print(n instanceof ce?{class:n.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}},e=new WeakMap,t=new WeakSet,Kt=function(){const{parentNode:n}=this;return(n==null?void 0:n.type)==="html"&&n.closing&&this.text().trim()!==""},r)}}),ml={};Z(ml,{PreToken:()=>vl});var vl,ha=_({"src/pre.ts"(){"use strict";Be(),B(),Fe(),vl=class extends E{get type(){return"ext-inner"}constructor(e,t,s=[]){if(e){const r=/<nowiki>/giu,l=/<\/nowiki>/giu,{length:n}=r.source;let i=r.exec(e);i&&(l.lastIndex=i.index+n);let o=l.exec(e),a=0,h="";for(;i&&o;)new he(i[0],t,s),new he(o[0],t,s),h+=`${e.slice(a,i.index)}\0${s.length-1}n${e.slice(i.index+n,o.index)}\0${s.length}n`,a=o.index+n+1,r.lastIndex=a,i=r.exec(e),i&&(l.lastIndex=i.index+n),o=l.exec(e);e=h+e.slice(a)}super(e,t,s,{}),this.setAttribute("stage",xe-1)}isPlain(){return!0}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*\/\s*(pre)\b/giu)}}}}),ds,Hn=_({"mixin/multiLine.ts"(){"use strict";ge(),ds=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 Fe(n,a),n}});var Ys={};te(Ys,{ParamTagToken:()=>at});var Js,ei,Al,at,ti=v(()=>{"use strict";M();se();Or();hn();G();B();ze();Js=[tr];at=class extends(Al=A){get type(){return"ext-inner"}constructor(n,e,t=C.getConfig(),r=[],i){if(super(void 0,t,r,{}),e){let s=Z;this.append(...e.split(`
7
- `).map(o=>i?o:At(o,t,r,n)).map(o=>new s(o,"param-line",t,r,{})))}r.splice(r.indexOf(this),1),r.push(this)}lint(n=this.getAbsoluteIndex()){let e=new L(this,n),t=C.msg("invalid parameter of <$1>",this.name),r=[];for(let i of this.childNodes){i.setAttribute("aIndex",n);let s=i.childNodes.filter(({type:o})=>o!=="comment"&&o!=="include"&&o!=="noinclude");if(s.some(({type:o})=>o==="ext"))r.push(N(i,e,"no-ignored",t));else{let o=s.findIndex(({type:g})=>g!=="text"),l=s.slice(0,o===-1?void 0:o).map(String).join("");if(l&&!(o===-1?/^[a-z]+(?:\[\])?\s*=/iu:/^[a-z]+(?:\[\])?\s*(?:=|$)/iu).test(l)){let g=N(i,e,"no-ignored",t);g.suggestions=[{desc:"remove",range:[g.startIndex,g.endIndex],text:""}],r.push(g)}else{let g=i.lint(n,!1);g.length>0&&r.push(...g)}}n+=i.toString().length+1}return r}};ei=F(Al),at=P(ei,0,"ParamTagToken",Js,at),R(ei,1,at)});var qr,rr,mn,nr,ri=v(()=>{"use strict";M();pe();se();G();B();bt();nr=class extends A{constructor(e,t,r,i=[]){super(void 0,r,i);b(this,rr);b(this,qr);y(this,qr,e);let s=new A(t[0],r,i);s.type="heading-title",s.setAttribute("stage",2);let o=new me(t[1],"heading-trail",r,i);this.append(s,o)}get type(){return"heading"}get level(){return c(this,qr)}toString(e){let t=S(this,rr,mn).call(this);return t+this.firstChild.toString(e)+t+this.lastChild.toString(e)}text(){let e=S(this,rr,mn).call(this);return e+this.firstChild.text()+e}getAttribute(e){return e==="invalid"?this.inHtmlAttrs()==="error":e==="padding"?this.level:super.getAttribute(e)}getGaps(){return this.level}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{firstChild:i,level:s}=this,o=i.toString(),l=o.startsWith("="),g=l||o.endsWith("="),p=i.childNodes.filter(ir("quote")),d=p.filter(({bold:x})=>x),u=p.filter(({italic:x})=>x),h=new L(this,e),m=this.inHtmlAttrs();if(this.level===1){let x=N(i,h,"h1","<h1>");g||(x.suggestions=[{desc:"h2",range:[x.startIndex,x.endIndex],text:`=${o}=`}]),r.push(x)}if(g){let x=N(i,h,"unbalanced-header",C.msg("unbalanced $1 in a section header",'"="'));if(o!=="=")if(l){let[T]=/^=+/u.exec(o),k=s+T.length;x.suggestions=[{desc:`h${s}`,range:[x.startIndex,x.startIndex+T.length],text:""}],k<7&&x.suggestions.push({desc:`h${k}`,range:[x.endIndex,x.endIndex],text:T})}else{let T=/[^=](=+)$/u.exec(o)[1],k=s+T.length;x.suggestions=[{desc:`h${s}`,range:[x.endIndex-T.length,x.endIndex],text:""}],k<7&&x.suggestions.push({desc:`h${k}`,range:[x.startIndex,x.startIndex],text:T})}r.push(x)}m&&r.push(E(this,h,"parsing-order","section header in HTML tag attributes",m));let f=this.getRootNode().toString();if(d.length%2){let x=N(d[d.length-1],oe(K({},h),{start:e+s,left:h.left+s}),"format-leakage",C.msg("unbalanced $1 in a section header","bold apostrophes")),T=e+s+o.length;f.slice(x.endIndex,T).trim()?x.suggestions=[{desc:"close",range:[T,T],text:"'''"}]:x.fix={desc:"remove",range:[x.startIndex,x.endIndex],text:""},r.push(x)}if(u.length%2){let x=N(u[u.length-1],{start:e+s},"format-leakage",C.msg("unbalanced $1 in a section header","italic apostrophes")),T=e+s+o.length;f.slice(x.endIndex,T).trim()?x.suggestions=[{desc:"close",range:[T,T],text:"''"}]:x.fix={desc:"remove",range:[x.startIndex,x.endIndex],text:""},r.push(x)}return r}print(){let e=S(this,rr,mn).call(this);return super.print({pre:e,sep:e})}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return r.level=this.level,r}};qr=new WeakMap,rr=new WeakSet,mn=function(){return"=".repeat(this.level)}});var wl,fn,Zs=v(()=>{"use strict";ie();M();B();wl=new RegExp(`https?://${Oe}${qe}$`,"iu"),fn=class extends A{get type(){return"parameter"}get anon(){return this.firstChild.length===0}get duplicated(){var n;try{return!!((n=this.parentNode)!=null&&n.getDuplicatedArgs().some(([e])=>e===this.name))}catch(e){return!1}}constructor(n,e,t,r=[]){super(void 0,t,r);let i=new A(typeof n=="number"?void 0:n,t,r,{}),s=new A(e,t,r);i.type="parameter-key",i.setAttribute("stage",2),s.type="parameter-value",s.setAttribute("stage",2),this.append(i,s)}trimName(n,e=!0){let t=(typeof n=="string"?n:n.toString(!0)).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");return this.setAttribute("name",t),t}afterBuild(){if(!this.anon){let{parentNode:n,firstChild:e}=this,t=this.trimName(e);n&&n.getArgs(t,!1,!1).add(this)}super.afterBuild()}toString(n){return this.anon?this.lastChild.toString(n):super.toString(n,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(n=this.getAbsoluteIndex(),e){var s;let t=super.lint(n,e),{firstChild:r}=this,i=(s=wl.exec(r.text()))==null?void 0:s[0];if(i&&new URL(i).search){let o=N(r,{start:n},"unescaped","unescaped query string in an anonymous parameter");o.startIndex=o.endIndex,o.startLine=o.endLine,o.startCol=o.endCol,o.endIndex++,o.endCol++,o.fix={desc:"escape",range:[o.startIndex,o.endIndex],text:"{{=}}"},t.push(o)}return t}print(){return super.print({sep:this.anon?"":"="})}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e);return Object.assign(t,{anon:this.anon},this.duplicated&&{duplicated:!0}),t}}});var eo,_r,dt,wt,St,sr,gt,xn,to,ni,Sl,lt,ro=v(()=>{"use strict";ie();M();pe();se();Rr();B();Zs();ze();bt();eo=[it()];lt=class extends(Sl=A){constructor(e,t,r,i=[]){var k,$;let s,o=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(e);o&&(s=Number(o[1]),e=e.replace(`\0${s}h`,i[s].toString().replace(/^\n/u,"")));super(void 0,r,i,{});b(this,gt);ge(this,"modifier","");b(this,_r,"template");b(this,dt,":");b(this,wt,!1);b(this,St,new Map);b(this,sr);let{parserFunction:[l,g],variable:p,functionHook:d}=r,u=(k=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(e))==null?void 0:k[0];if(u)this.setAttribute("modifier",u),e=e.slice(u.length);else if(e.includes(":")){let[w,...I]=e.split(":"),[j]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec(($=I[0])!=null?$:"");this.setModifier(`${w}:${j}`)&&(e=I.join(":").slice(j.length))}let h=e.search(/[::]/u),m=e[h]===":",f=h!==-1;if(f||t.length===0&&!c(this,wt)){let w=f?e.slice(0,h):e,I=f&&e.slice(h+1),j=ae(w),U=f?j.slice(j.search(/\S/u))+(m?":":""):j.trim(),J=U.toLowerCase(),ne=Array.isArray(g),q=ne?g.includes(U):Object.prototype.hasOwnProperty.call(g,U),W=!ne&&q?g[U]:Object.prototype.hasOwnProperty.call(l,J)&&l[J],z=ne&&q||!("functionHook"in r)||d.includes(W),Y=ne&&q||p.includes(W);if(f?W&&z:Y){this.setAttribute("name",W||J.replace(/^#|:$/u,"")),y(this,_r,"magic-word"),m&&y(this,dt,":");let Q=new me(w,"magic-word-name",r,i);if(super.insertAt(Q),I!==!1&&t.unshift([I]),this.name==="invoke")for(let _=0;_<2;_++){let O=t.shift();if(!O)break;let we=new Z(O.join("="),`invoke-${_?"function":"module"}`,r,i);super.insertAt(we)}}}if(this.type==="template"){let w=ae(e).trim();if(!this.normalizeTitle(w,10,{halfParsed:!0,temporary:!0}).valid)throw i.pop(),new SyntaxError("Invalid template name");let I=new Z(e,"template-name",r,i,{});super.insertAt(I)}typeof s=="number"&&(i[s]=void 0);let x=this.isTemplate(),T=1;for(let w=0;w<t.length;w++){let I=t[w];x||this.name==="switch"&&w>0||this.name==="tag"&&w>1||(I[0]=I.join("="),I.length=1),I.length===1&&(I.unshift(T),T++),this.insertAt(new fn(...I,r,i))}this.seal("modifier")}get type(){return c(this,_r)}get module(){}get function(){}setModifier(e){let{parserFunction:[,,t,r]}=this.getAttribute("config"),i=ae(e).trim();if(e&&!i.endsWith(":"))return!1;let s=i.slice(0,-1).toLowerCase(),o=t.includes(s),l=r.includes(s);return c(this,wt)&&o||!c(this,wt)&&(l||!e)||(le.running||this.length>1)&&(o||l||!e)?(this.setAttribute("modifier",e),y(this,wt,o),!!e):!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"&&(y(this,sr,S(this,gt,xn).call(this)),this.setAttribute("name",c(this,sr).title))}toString(e){return`{{${this.modifier}${this.type==="magic-word"?this.firstChild.toString(e)+(this.length===1?"":c(this,dt))+this.childNodes.slice(1).map(t=>t.toString(e)).join("|"):super.toString(e,"|")}}}`}text(){let{childNodes:e,length:t,firstChild:r,modifier:i,type:s,name:o}=this;return s==="magic-word"&&o==="vardefine"?"":`{{${i}${s==="magic-word"?r.text()+(t===1?"":c(this,dt))+ke(e.slice(1),"|"):super.text("|")}}}`}getAttribute(e){switch(e){case"padding":return this.modifier.length+2;case"title":return c(this,sr);case"colon":return c(this,dt);case"invalid":return this.type==="magic-word"&&this.name==="invoke"&&(this.length===2||!S(this,gt,xn).call(this).valid);default:return super.getAttribute(e)}}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t);if(!this.isTemplate())return r;let{type:i,childNodes:s,length:o}=this,l=new L(this,e),g=i==="magic-word";if(g&&!S(this,gt,xn).call(this).valid)r.push(N(s[1],l,"invalid-invoke","illegal module name"));else{let d=s[g?1:0],u=d.childNodes.findIndex(m=>m.type==="text"&&mt(m.data).includes("#")),h=d.childNodes[u];if(h){let m=N(d,l,"no-ignored","useless fragment","warning");m.fix={desc:"remove",range:[m.startIndex+d.getRelativeIndex(u)+h.data.indexOf("#"),m.endIndex],text:""},r.push(m)}}if(g&&o===2)return r.push(E(this,l,"invalid-invoke","missing module function")),r;let p=this.getDuplicatedArgs().filter(([,d])=>!d[0].querySelector("ext"));if(p.length>0)for(let[,d]of p)r.push(...d.map(u=>{let h=N(u,l,"no-duplicate","duplicated parameter");return h.suggestions=[{desc:"remove",range:[h.startIndex-1,h.endIndex],text:""}],h}));return r}insertAt(e,t=this.length){return super.insertAt(e,t),e.anon?S(this,gt,to).call(this,e):e.name&&this.getArgs(e.name,!1,!1).add(e),e}getAllArgs(){return this.childNodes.filter(ir("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:e})=>e)}getArgs(e,t,r=!0){let i=String(e).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),s;return c(this,St).has(i)?s=c(this,St).get(i):(s=new Set(this.getAllArgs().filter(({name:o})=>i===o)),c(this,St).set(i,s)),s}getDuplicatedArgs(){return[...c(this,St)].filter(([,{size:e}])=>e>1).map(([e,t])=>[e,[...t]])}getPossibleValues(){let{type:e,name:t,childNodes:r}=this;if(e==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let i,s;switch(t){case"if":case"ifexist":case"ifexpr":case"iferror":i=2;break;case"ifeq":i=3;break;case"switch":{let o=r.slice(2),l=o[o.length-1];s=[...o.filter(({anon:g})=>!g),...l!=null&&l.anon?[l]:[]].map(({lastChild:g})=>g);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}s!=null||(s=r.slice(i,i+2).map(({lastChild:o})=>o));for(let o=0;o<s.length;){let{length:l,0:g}=s[o].childNodes.filter(p=>p.text().trim());if(l===0)s.splice(o,1);else if(l>1||g.type!=="magic-word")o++;else try{let p=g.getPossibleValues();s.splice(o,1,...p),o+=p.length}catch(p){o++}}return s}print(){let{childNodes:e,length:t,firstChild:r,modifier:i,type:s}=this;return`<span class="wpb-${s}${this.getAttribute("invalid")?" wpb-invalid":""}">{{${s==="magic-word"?ft(i)+r.print()+(t===1?"":c(this,dt))+Me(e.slice(1),{sep:"|"}):(i?`<span class="wpb-magic-word">${ft(i)}</span>`:"")+Me(e,{sep:"|"})}}}</span>`}};ni=F(Sl),_r=new WeakMap,dt=new WeakMap,wt=new WeakMap,St=new WeakMap,sr=new WeakMap,gt=new WeakSet,xn=function(){let e=this.type==="template";return this.normalizeTitle(this.childNodes[e?0:1].text(),e?10:828,{temporary:!0})},to=function(e){let t=this.getAnonArgs(),r=typeof e!="number";for(let i=r?t.indexOf(e):e-1;i<t.length;i++){let s=t[i],{name:o}=s,l=String(i+1);(o!==l||s===e)&&(s.setAttribute("name",l),this.getArgs(l,!1,!1).add(s))}},lt=P(ni,0,"TranscludeToken",eo,lt),R(ni,1,lt)});var no,ii,Cl,Ct,io=v(()=>{"use strict";xt();B();no=[ve()];Ct=class extends(Cl=A){get type(){return"hidden"}getAttribute(n){return n==="invalid"||super.getAttribute(n)}};ii=F(Cl),Ct=P(ii,0,"HiddenToken",no,Ct),R(ii,1,Ct)});var so,oi,$l,si,Nl,$t,oo=v(()=>{"use strict";ie();M();se();Ue();Rr();B();ze();io();so=[ue("{{{"),it()];$t=class extends(Nl=A){constructor(e,t,r=[]){super(void 0,t,r,{});b(this,oi);for(let i=0;i<e.length;i++){let s=e[i];if(i===0){let o=new Z(s,"arg-name",t,r,{});super.insertAt(o)}else if(i>1){let o=new Ct(s,t,r);super.insertAt(o)}else{let o=new A(s,t,r);o.type="arg-default",o.setAttribute("stage",2),super.insertAt(o)}}}get type(){return"arg"}get default(){var e,t;return(t=(e=this.childNodes[1])==null?void 0:e.text())!=null?t:!1}toString(e){return`{{{${super.toString(e,"|")}}}}`}text(){return`{{{${ke(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){super.afterBuild()}lint(e=this.getAbsoluteIndex(),t){let{childNodes:[r,i,...s]}=this;r.setAttribute("aIndex",e+3);let o=r.lint(e+3,t);if(i){let l=e+4+r.toString().length;i.setAttribute("aIndex",l);let g=i.lint(l,t);g.length>0&&o.push(...g)}if(s.length>0){let l=new L(this,e);o.push(...s.map(g=>{let p=N(g,l,"no-ignored","invisible content inside triple braces");return p.startIndex--,p.startCol--,p.suggestions=[{desc:"remove",range:[p.startIndex,p.endIndex],text:""},{desc:"escape",range:[p.startIndex,p.startIndex+1],text:"{{!}}"}],p}))}if(!this.getAttribute("include")){let l=E(this,{start:e},"no-arg","unexpected template argument","warning");i&&(l.suggestions=[{desc:"expand",range:[e,l.endIndex],text:i.text()}]),o.push(l)}return o}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return r.default=this.default,r}};si=F(Nl),oi=new WeakSet,$l=function(){},$t=P(si,0,"ArgToken",so,$t),R(si,1,$t)});var ho={};te(ho,{parseBraces:()=>Mr});var Il,ao,ai,lo,go,po,co,uo,Mr,bn=v(()=>{"use strict";Mt();ie();ri();ro();oo();Il={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},ao=String.raw`\[(?!\[)`,ai=String.raw`\n(?![=\0])`,lo=String.raw`|\{{2,}`,go=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),po=Ee(a=>new RegExp(a,"gmu"));co=new RegExp(String.raw`\{\{((?:[^\n{}[]|${ao}|${ai})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${ai})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${ao}|${ai})*\}-`,"gu");uo=a=>{let n=_e(ae(a));return go.has(n)?go.get(n):/^(?:filepath|(?:full|canonical)urle?):./u.test(n)?"m":/^#vardefine:./u.test(n)?"n":"t"},Mr=(a,n,e)=>{var m,f,x,T,k;let t=String.raw`${n.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,r]}=n,i=[],s=[],o=($,w,I,j)=>{w[w.length-1].push(Le($.slice(I,j),s))},l;do l!==void 0&&(a=l),l=a.replace(co,($,w,I)=>{if(w!==void 0||typeof I=="string")try{let{length:j}=e,U=(w!=null?w:I).split("|");return new lt(Le(U[0],s),U.slice(1).map(J=>{let ne=J.indexOf("=");return(ne===-1?[J]:[J.slice(0,ne),J.slice(ne+1)]).map(q=>Le(q,s))}),n,e),`\0${j}${uo(U[0])}`}catch(j){if(!(j instanceof SyntaxError)||j.message!=="Invalid template name")throw j}return s.push(Le($,s)),`\0${s.length-1}`});while(l!==a);a=l;let g=a.lastIndexOf("}}")-a.length,p=g+a.length!==-1,d=po(t+(p?lo:"")),u=d.exec(a),h;for(;u||h!==void 0&&h<=a.length&&((f=(m=i[i.length-1])==null?void 0:m[0])!=null&&f.startsWith("="));){if(u!=null&&u[1]){let[,{length:Y}]=u;u[0]=u[0].slice(Y),u.index+=Y}let{0:$,index:w}=u!=null?u:{0:`
8
- `,index:a.length},I=(x=i.pop())!=null?x:{},{0:j,index:U,parts:J,findEqual:ne,pos:q}=I,W=$==="="&&ne;if($==="]]"||$==="}-")h=w+2;else if($===`
9
- `){h=w+1;let{pos:Y,findEqual:Q}=(T=i[i.length-1])!=null?T:{};if(Y===void 0||Q||ae(a.slice(Y,U))!==""){let _=/^(={1,6})(.+)\1((?:\s|\0\d+[cn]\x7F)*)$/u.exec(a.slice(U,w));_&&(_[2]=Le(_[2],s),_[2].includes(`
10
- `)||(a=`${a.slice(0,U)}\0${e.length}h${a.slice(w)}`,h=U+4+String(e.length).length,new nr(_[1].length,_.slice(2),n,e)))}}else if($==="|"||W)h=w+1,o(a,J,q,w),$==="|"&&J.push([]),I.pos=h,I.findEqual=$==="|",i.push(I);else if($.startsWith("}}")){let Y=$.slice(0,Math.min(j.length,3)),Q=j.length-Y.length,{length:_}=e;h=w+Y.length,o(a,J,q,w);let O=!1,we="t";if(Y.length===3){let he=J.map(Ye=>Ye.join("=")),xe=he.length>1&&ae(he[1]).trim();new $t(he,n,e),xe&&xe.endsWith(":")&&r.includes(xe.slice(0,-1).toLowerCase())&&(we="s")}else try{new lt(J[0][0],J.slice(1),n,e),we=uo(J[0][0])}catch(he){if(he instanceof SyntaxError&&he.message==="Invalid template name")O=!0;else throw he}O||(a=`${a.slice(0,U+Q)}\0${_}${we}${a.slice(h)}`,h=U+Q+3+String(_).length,Q>1?i.push({0:j.slice(0,Q),index:U,pos:U+Q,parts:[[]]}):Q===1&&a[U-1]==="-"&&i.push({0:"-{",index:U-1,pos:U+1,parts:[[]]}))}else h=w+$.length,$.startsWith("{")&&(u.pos=h,u.parts=[[]]),i.push(..."0"in I?[I]:[],u);let z=i[i.length-1];if(p&&g+a.length<h)for(p=!1;(k=z==null?void 0:z[0])!=null&&k.startsWith("{");)i.pop(),z=i[i.length-1];d=po(t+(p?lo:"")+(z?`|${Il[z[0][0]]}${z.findEqual?"|=":""}`:"")),d.lastIndex=h,u=d.exec(a)}return Le(a,s)}});var mo={};te(mo,{InputboxToken:()=>li});var li,fo=v(()=>{"use strict";Or();bn();G();ti();li=class extends at{constructor(n,e,t=C.getConfig(),r=[]){let i=Symbol("InputboxToken"),s=t.excludes.includes("heading")?t:oe(K({},t),{excludes:[...t.excludes,"heading"]}),{length:o}=r;r.push(i),e&&(e=At(e,s,r,n)),e&&(e=Mr(e,s,r)),r.splice(o,1),super(n,e,s,r,{})}}});var Tn={};te(Tn,{NestedToken:()=>di});var El,Ll,Ur,or,di,yn=v(()=>{"use strict";M();se();Or();bn();G();B();gi();We();El=new Set(["comment","include","arg","template","magic-word"]),Ll=[!1,!0].map(a=>{let n=a?"includeonly":"noinclude";return new RegExp(String.raw`^(?:<${n}(?:\s[^>]*)?/?>|</${n}\s*>)$`,"iu")}),di=class extends A{constructor(e,t,r,i,s=[]){if(typeof t=="boolean"){let o=Symbol("InputboxToken"),{length:l}=s;s.push(o),e&&(e=At(e,i,s,t)),e&&(e=Mr(e,i,s)),s.splice(l,1)}else e&&(e=e.replace(t,(o,l,g,p,d)=>{let u=`\0${s.length+1}e`;return new He(l,g,p,d,i,!1,s),u}));e&&(e=e.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(o,l,g)=>(new D(g,i,s),`${l}\0${s.length}n`)));super(e,i,s);b(this,Ur);b(this,or);y(this,Ur,[...r]),y(this,or,t)}get type(){return"ext-inner"}lint(e=this.getAbsoluteIndex(),t){let r=new L(this,e),i=typeof c(this,or)=="boolean"?Ll[c(this,or)?1:0]:/^<!--[\s\S]*-->$/u;return[...super.lint(e,t),...this.childNodes.filter(s=>{let{type:o,name:l}=s;if(o==="ext")return!c(this,Ur).includes(l);if(El.has(o))return!1;let g=s.toString().trim();return g&&!i.test(g)}).map(s=>{let o=N(s,r,"no-ignored",C.msg("invalid content in <$1>",this.name));return o.suggestions=[{desc:"remove",range:[o.startIndex,o.endIndex],text:""},{desc:"comment",range:[o.startIndex,o.endIndex],text:`<!--${s.toString()}-->`}],o})]}};Ur=new WeakMap,or=new WeakMap});function xo(a,n,e,t,r){n=ae(n).trim();let i=n.replace(a==="link"?/\0\d+[tq]\x7F/gu:/\0\d+t\x7F/gu,"").trim();switch(a){case"width":return!i&&!!n||/^(?:\d+x?|\d*x\d+)(?:\s*px)?$/u.test(i);case"link":{if(i){if(Fl(e.protocol).test(i))return Rl(e.protocol).test(i)&&n;i.startsWith("[[")&&i.endsWith("]]")&&(i=i.slice(2,-2))}else return n;let s=C.normalizeTitle(i,0,!1,e,{halfParsed:t,decode:!0,selfLink:!0});return s.valid&&s}case"lang":return(r==="svg"||r==="svgz")&&!/[^a-z\d-]/u.test(i);case"alt":case"class":case"manualthumb":return!0;case"page":return(r==="djvu"||r==="djv"||r==="pdf")&&Number(i)>0;default:return!!i&&!isNaN(i)}}var Fl,Rl,Pl,jl,fe,vn,bo,kn,To=v(()=>{"use strict";Mt();ie();M();G();B();Fl=Ee(a=>new RegExp(String.raw`^(?:${a}|//|\0\d+m\x7F)`,"iu")),Rl=Ee(a=>new RegExp(String.raw`^(?:(?:${a}|//)${Oe}|\0\d+m\x7F)${qe}$`,"iu")),Pl=Ee(a=>new RegExp(String.raw`^(\s*(?!\s))${a.replace("$1","(.*)")}${a.endsWith("$1")?`(?=$|
11
- )`:""}(\s*)$`,"u")),jl=new Set(["alt","link","lang","page","caption"]);kn=class extends A{constructor(e,t,r,i){var n=(...Wu)=>(super(...Wu),b(this,vn),b(this,fe,""),this);let s,o=Object.entries(r.img).map(([g,p])=>[g,p,Pl(g)]),l=o.find(([,g,p])=>(s=p.exec(e),s&&(s.length!==4||xo(g,s[2],r,!0,t)!==!1)));if(l&&s){s.length===3?(n(void 0,r,i),y(this,fe,e)):(n(s[2],r,i,{}),y(this,fe,s[1]+l[0]+s[3])),this.setAttribute("name",l[1]);return}n(e,r.excludes.includes("list")?r:oe(K({},r),{excludes:[...r.excludes,"list"]}),i),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get type(){return"image-parameter"}get link(){return this.name==="link"?xo("link",super.text(),this.getAttribute("config")):void 0}afterBuild(){var e;(e=this.parentNode)!=null&&e.is("gallery-image")&&!jl.has(this.name)&&this.setAttribute("name","invalid"),super.afterBuild()}toString(e){return c(this,fe)?c(this,fe).replace("$1",super.toString(e)):super.toString(e)}text(){return c(this,fe)?c(this,fe).replace("$1",super.text()).trim():super.text().trim()}isPlain(){return this.name==="caption"}getAttribute(e){return e==="invalid"?this.name==="invalid":e==="padding"?Math.max(0,c(this,fe).indexOf("$1")):super.getAttribute(e)}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{link:i,name:s}=this;if(s==="invalid"){let o=E(this,{start:e},"invalid-gallery","invalid image parameter");o.fix={desc:"remove",range:[e-1,o.endIndex],text:""},r.push(o)}else if(typeof i=="object"&&i.encoded){let o=E(this,{start:e},"url-encoding","unnecessary URL encoding in an internal link");o.suggestions=[{desc:"decode",range:[e,o.endIndex],text:et(this.text())}],r.push(o)}return r}getValue(){return this.name==="invalid"?this.text():S(this,vn,bo).call(this)||super.text()}print(){return c(this,fe)?`<span class="wpb-image-parameter${this.name==="invalid"?" wpb-invalid":""}">${c(this,fe).replace("$1",`<span class="wpb-image-caption">${Me(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}};fe=new WeakMap,vn=new WeakSet,bo=function(){return c(this,fe)&&!c(this,fe).includes("$1")}});var yo,Bl,Ol,ko,vo,ql,_l,Ao,ar,pi=v(()=>{"use strict";M();se();G();Fr();To();yo=new Map([["manualthumb","Thumb"],["frameless","Frameless"],["framed","Frame"],["thumbnail","Thumb"]]),Bl=new Set(["arg"]),Ol=new Set(["template","magic-word"]),ko=new Set(["left","right","center","none"]),vo=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),ql=new Set(["tiff","tif","png","gif","jpg","jpeg","webp","xcf","pdf","svg","djvu"]),_l=a=>{if(a===void 0)return[];let n=/-\{|\}-|\|/gu,e=[],t=n.exec(a),r=0,i=0;for(;t;){let{0:s,index:o}=t;s!=="|"?r+=s==="-{"?1:-1:r===0&&(e.push(a.slice(i,o)),{lastIndex:i}=n),t=n.exec(a)}return e.push(a.slice(i)),e},Ao=(a,n)=>a.filter(({childNodes:e})=>{let t=e.filter(r=>r.text().trim());return t.length!==1||!n.has(t[0].type)}),ar=class extends Te{get type(){return"file"}get extension(){return this.getAttribute("title").extension}constructor(n,e,t,r=[],i="|"){super(n,void 0,t,r,i);let{extension:s}=this.getTitle(!0,!0);this.safeAppend(_l(e).map(o=>new kn(o,s,t,r)))}lint(n=this.getAbsoluteIndex(),e){var m;let t=super.lint(n,e),r=Ao(this.getAllArgs(),Bl),i=[...new Set(r.map(({name:f})=>f))],s=i.filter(f=>yo.has(f)),o=i.filter(f=>ko.has(f)),l=i.filter(f=>vo.has(f)),[g]=s,p=g==="framed"||g==="manualthumb",d=new L(this,n);if(this.closest("ext-link-text")&&((m=this.getValue("link"))==null?void 0:m.trim())!==""&&t.push(E(this,d,"nested-link","internal link in an external link")),p)for(let f of r.filter(({name:x})=>x==="width")){let x=N(f,d,"invalid-gallery","invalid image parameter");x.fix={desc:"remove",range:[x.startIndex-1,x.endIndex],text:""},t.push(x)}if(r.length===i.length&&s.length<2&&o.length<2&&l.length<2)return t;let u=(f,x,T=!0)=>k=>{let $=typeof T=="function"?T(k):T,w=N(k,d,"no-duplicate",C.msg(`${f} image $1 parameter`,x),$?"error":"warning");return w.suggestions=[{desc:"remove",range:[w.startIndex-1,w.endIndex],text:""}],w},{extension:h}=this;for(let f of i){if(f==="invalid"||f==="width"&&p)continue;let x=f==="caption",T=r.filter(({name:k})=>k===f);if(x&&(T=[...T.slice(0,-1).filter(k=>k.text()),...T.slice(-1)]),T.length>1){let k=!x||!h||ql.has(h);if(x&&k){let $=Ao(T,Ol);k=$.length>1&&(w=>$.includes(w))}t.push(...T.map(u("duplicated",f,k)))}}return s.length>1&&t.push(...r.filter(({name:f})=>yo.has(f)).map(u("conflicting","frame"))),o.length>1&&t.push(...r.filter(({name:f})=>ko.has(f)).map(u("conflicting","horizontal-alignment"))),l.length>1&&t.push(...r.filter(({name:f})=>vo.has(f)).map(u("conflicting","vertical-alignment"))),t}getAllArgs(){return this.childNodes.slice(1)}getArgs(n){return this.getAllArgs().filter(({name:e})=>n===e)}getArg(n){let e=this.getArgs(n);return e[n==="manualthumb"?0:e.length-1]}getValue(n){var e;return(e=this.getArg(n))==null?void 0:e.getValue()}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e),{extension:r}=this;return r&&(t.extension=r),t}}});var wo,zr,ci,ui,Ml,Ge,hi=v(()=>{"use strict";M();Ue();B();pi();wo=[ue("")];Ge=class extends(Ml=ar){constructor(e,t,r,i,s=[]){let o;if(r!==void 0){let{length:l}=s;o=new A(r,i,s);for(let g=1;g<11;g++)o.parseOnce();s.splice(l,1)}super(t,o==null?void 0:o.toString(),i,s);b(this,zr);ge(this,"privateType","imagemap-image");this.setAttribute("bracket",!1),this.privateType=`${e}-image`,this.seal("privateType",!0)}get type(){return this.privateType}getTitle(e){let t=this.type==="imagemap-image";return this.normalizeTitle(this.firstChild.toString(),t?0:6,{halfParsed:!0,temporary:e,decode:!t})}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t);if(S(this,zr,ci).call(this)){let i=E(this,{start:e},"invalid-gallery","invalid gallery image");i.suggestions=[{desc:"prefix",range:[e,e],text:"File:"}],r.push(i)}return r}getAttribute(e){return e==="invalid"?S(this,zr,ci).call(this):super.getAttribute(e)}};ui=F(Ml),zr=new WeakSet,ci=function(){let{ns:e}=this.getAttribute("title");return e!==6},Ge=P(ui,0,"GalleryImageToken",wo,Ge),R(ui,1,Ge)});var $o={};te($o,{GalleryToken:()=>lr});var So,Nt,Co,fi,mi,Ul,lr,No=v(()=>{"use strict";hn();G();B();hi();We();So=[tr];lr=class extends(Ul=A){constructor(e,t,r=[]){var i;super(void 0,t,r,{});b(this,Nt);for(let s of(i=e==null?void 0:e.split(`
12
- `))!=null?i:[]){let o=/^([^|]+)(?:\|(.*))?/u.exec(s);if(!o){super.insertAt(s.trim()?new D(s,t,r):s);continue}let[,l,g]=o;S(this,Nt,Co).call(this,l)?super.insertAt(new Ge("gallery",l,g,t,r)):super.insertAt(new D(s,t,r))}}get type(){return"ext-inner"}get widths(){return S(this,Nt,fi).call(this,"widths")}get heights(){return S(this,Nt,fi).call(this,"heights")}lint(e=this.getAbsoluteIndex(),t){let{top:r,left:i}=this.getRootNode().posFromIndex(e),s=[];for(let o=0;o<this.length;o++){let l=this.childNodes[o],g=l.toString(),{length:p}=g,d=g.trim(),{type:u}=l,h=r+o,m=o?0:i;if(l.setAttribute("aIndex",e),u==="noinclude"&&d&&!/^<!--.*-->$/u.test(d)){let f=e+p;s.push({rule:"no-ignored",message:C.msg("invalid content in <$1>","gallery"),severity:d.endsWith("-->")||/^(?:\||<!--)/u.test(d)?"warning":"error",startIndex:e,endIndex:f,startLine:h,endLine:h,startCol:m,endCol:m+p,suggestions:[{desc:"remove",range:[e,f],text:""},{desc:"comment",range:[e,f],text:`<!--${g}-->`}]})}else if(u!=="noinclude"&&u!=="text"){let f=l.lint(e,t);f.length>0&&s.push(...f)}e+=p+1}return s}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return Object.assign(r,{widths:this.widths,heights:this.heights}),r}};mi=F(Ul),Nt=new WeakSet,Co=function(e){return this.normalizeTitle(e,6,{halfParsed:!0,temporary:!0,decode:!0}).valid},fi=function(e){var i,s;let t=(i=this.parentNode)==null?void 0:i.getAttr(e),r=typeof t=="string"&&((s=/^(\d+)\s*(?:px)?$/u.exec(t))==null?void 0:s[1]);return r&&Number(r)||120},lr=P(mi,0,"GalleryToken",So,lr),R(mi,1,lr)});var dr,xi=v(()=>{"use strict";M();Fr();dr=class extends Te{get type(){return"link"}lint(n=this.getAbsoluteIndex(),e){let t=super.lint(n,e);return this.closest("ext-link-text")&&t.push(E(this,{start:n},"nested-link","internal link in an external link")),t}}});var zl,Dl,Dr,Wr,bi,Ve,An=v(()=>{"use strict";M();ie();se();G();B();zl=String.raw`(?:[${Se}\t]|&nbsp;|&#0*160;|&#[xX]0*[aA]0;)`,Dl=new RegExp(`${zl}+`,"gu"),Ve=class extends A{constructor(e,t="free-ext-link",r=C.getConfig(),i){super(e,r,i,{});b(this,Wr);b(this,Dr);y(this,Dr,t)}get type(){return c(this,Dr)}get innerText(){let e=new Map([["!","|"],["=","="]]),t=ke(this.childNodes.map(r=>{let{type:i}=r,s=String(r.name);return i==="magic-word"&&e.has(s)?e.get(s):r}));return this.type==="magic-link"&&(t=t.replace(Dl," ")),t}get link(){let{innerText:e}=this;return this.type==="magic-link"?e.startsWith("ISBN")?`ISBN ${e.slice(5).replace(/[- ]/gu,"").replace(/x$/u,"X")}`:e:ds(e).replace(/\n/gu,"%0A")}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),i=new L(this,e),{type:s,childNodes:o}=this;if(s==="magic-link")return S(this,Wr,bi).call(this)&&r.push(E(this,i,"invalid-isbn","invalid ISBN")),r;let l=s==="ext-link-url",g=l?/\|/u:/[,;。:!?()]+/u,p=o.find(d=>d.type==="text"&&g.test(d.data));if(p){let{data:d}=p,u=N(p,i,"unterminated-url",C.msg("$1 in URL",l?'"|"':"full-width punctuation"),"warning"),{index:h,0:m}=g.exec(d),f=u.startIndex+h;u.suggestions=l?[{desc:"whitespace",range:[f,f+1],text:" "}]:[{desc:"whitespace",range:[f,f],text:" "},{desc:"escape",range:[f,f+m.length],text:encodeURI(m)}],r.push(u)}return r}getUrl(e){this.lspError("MagicLinkToken.getUrl")}getAttribute(e){return e==="invalid"?S(this,Wr,bi).call(this):super.getAttribute(e)}};Dr=new WeakMap,Wr=new WeakSet,bi=function(){if(this.type==="magic-link"){let{link:e}=this;if(e.startsWith("ISBN")){let t=[...e.slice(5)].map(r=>r==="X"?10:Number(r));return t.length===10?t.reduce((r,i,s)=>r+i*(10-s),0)%11!==0:t.length===13&&(t[12]===10||t.reduce((r,i,s)=>r+i*(s%2?3:1),0)%10!==0)}}return!1}});var Io,Xe,Ti,Wl,Qe,yi=v(()=>{"use strict";M();Ue();B();An();Io=[ue("[")];Qe=class extends(Wl=A){constructor(e,t="",r="",i,s=[]){super(void 0,i,s,{});b(this,Xe);let o=e&&/^\0\d+f\x7F$/u.test(e)?s[Number(e.slice(1,-2))]:new Ve(e,"ext-link-url",i,s);if(this.insertAt(o),y(this,Xe,t),r){let l=new A(r,i,s,{});l.type="ext-link-text",l.setAttribute("stage",10),this.insertAt(l)}}get type(){return"ext-link"}toString(e){return this.length===1?`[${super.toString(e)}${c(this,Xe)}]`:`[${super.toString(e,c(this,Xe))}]`}text(){return`[${super.text(" ")}]`}getGaps(){return c(this,Xe).length}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t);return this.length===1&&this.closest("heading-title")&&r.push(E(this,{start:e},"var-anchor","variable anchor in a section header")),r}print(){return super.print(this.length===1?{pre:"[",post:`${c(this,Xe)}]`}:{pre:"[",sep:c(this,Xe),post:"]"})}};Ti=F(Wl),Xe=new WeakMap,Qe=P(Ti,0,"ExtLinkToken",Io,Qe),R(Ti,1,Qe)});var Hr,Eo=v(()=>{"use strict";B();We();xi();yi();Hr=class extends A{get type(){return"imagemap-link"}constructor(n,e,t,r,i=[]){super(void 0,r,i),this.append(n,e.length===2?new dr(...e,r,i):new Qe(...e,r,i),new D(t,r,i))}}});var Fo={};te(Fo,{ImagemapToken:()=>gr});var Lo,ki,Hl,gr,Ro=v(()=>{"use strict";M();pe();se();hn();G();B();We();hi();Eo();Lo=[tr];gr=class extends(Hl=A){get type(){return"ext-inner"}get image(){return this.childNodes.find(ir("imagemap-image"))}constructor(n,e=C.getConfig(),t=[]){if(super(void 0,e,t,{}),!n)return;let r=n.split(`
13
- `),i=new Set(e.protocol.split("|")),s=D,o=!0,l=!1;for(let g of r){let p=g.trim();if(!(l||!p||p.startsWith("#"))){if(o){let d=g.indexOf("|"),u=d===-1?g:g.slice(0,d),{valid:h,ns:m}=this.normalizeTitle(u,0,{halfParsed:!0,temporary:!0});if(h&&m===6){let f=new Ge("imagemap",u,d===-1?void 0:g.slice(d+1),e,t);super.insertAt(f),o=!1;continue}else l=!0}else if(g.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(g);continue}else if(g.includes("[")){let d=g.indexOf("["),u=g.slice(d),h=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(u);if(h){if(this.normalizeTitle(h[1],0,{halfParsed:!0,temporary:!0,selfLink:!0}).valid){super.insertAt(new Hr(g.slice(0,d),h.slice(1),u.slice(u.indexOf("]]")+2),e,t));continue}}else if(u.startsWith("[//")||i.has(u.slice(1,u.indexOf(":")+1))||i.has(u.slice(1,u.indexOf("//")+2))){let m=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(u);if(m){super.insertAt(new Hr(g.slice(0,d),m.slice(1),u.slice(u.indexOf("]")+1),e,t));continue}}}}super.insertAt(new s(g,e,t))}}lint(n=this.getAbsoluteIndex(),e){let t=super.lint(n,e),r=new L(this,n);return this.image?t.push(...this.childNodes.filter(i=>{let s=i.toString().trim();return i.is("noinclude")&&s&&!s.startsWith("#")}).map(i=>{let s=N(i,r,"invalid-imagemap","invalid link in <imagemap>");return s.suggestions=[{desc:"remove",range:[s.startIndex-1,s.endIndex],text:""},{desc:"comment",range:[s.startIndex,s.startIndex],text:"# "}],s})):t.push(E(this,r,"invalid-imagemap","<imagemap> without an image")),t}getAttribute(n){return n==="invalid"?!this.image:super.getAttribute(n)}};ki=F(Hl),gr=P(ki,0,"ImagemapToken",Lo,gr),R(ki,1,gr)});var Po,vi,Gl,Ke,Ai=v(()=>{"use strict";M();xt();Ue();G();rt();Po=[ve(!1),ue("<!--")];Ke=class extends(Gl=ce){constructor(e,t,r,i){super(e,r,i);ge(this,"closed");this.closed=t}get type(){return"comment"}lint(e=this.getAbsoluteIndex()){if(this.closed)return[];let t=E(this,{start:e},"unclosed-comment",C.msg("unclosed $1","HTML comment"));return t.suggestions=[{desc:"close",range:[t.endIndex,t.endIndex],text:"-->"}],[t]}toString(e){return e?"":`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"&lt;!--",post:this.closed?"--&gt;":""})}};vi=F(Gl),Ke=P(vi,0,"CommentToken",Po,Ke),R(vi,1,Ke)});var jo={};te(jo,{CommentedToken:()=>wi});var wi,Bo=v(()=>{"use strict";B();Ai();wi=class extends A{get type(){return"ext-inner"}constructor(n,e,t=[]){if(super(void 0,e,t,{AstText:":",CommentToken:":"}),n){let r=n.indexOf("<!--"),i=r!==-1&&n.indexOf("-->",r+4),s=0;for(;i!==!1&&i!==-1;)r>s&&this.insertAt(n.slice(s,r)),this.insertAt(new Ke(n.slice(r+4,i),!0,e,t)),s=i+3,r=n.indexOf("<!--",s),i=r!==-1&&n.indexOf("-->",r+4);s<n.length&&this.insertAt(n.slice(s))}}lint(n=this.getAbsoluteIndex()){return super.lint(n,/<\s*(?:\/\s*)?(hiero)\b/giu)}}});var Oo={};te(Oo,{NowikiToken:()=>Si});var Vl,Xl,Gr,Ci,Si,qo=v(()=>{"use strict";Mt();M();G();rt();Vl=Ee(a=>new RegExp(String.raw`<\s*(?:/\s*)${a==="nowiki"?"":"?"}(${a})\b`,"giu")),Xl=new Set(["templatestyles","section","languages"]),Si=class extends ce{constructor(){super(...arguments);b(this,Gr)}get type(){return"ext-inner"}lint(e=this.getAbsoluteIndex()){let{name:t}=this;if(S(this,Gr,Ci).call(this)){let r=E(this,{start:e},"void-ext",C.msg("nothing should be in <$1>",t));return r.fix={desc:"empty",range:[e,r.endIndex],text:""},[r]}return super.lint(e,Vl(t))}getAttribute(e){return e==="invalid"?S(this,Gr,Ci).call(this):super.getAttribute(e)}};Gr=new WeakSet,Ci=function(){let{name:e,firstChild:{data:t}}=this;return Xl.has(e)&&!!t}});var _o,$i,Ql,He,gi=v(()=>{"use strict";M();se();G();gn();B();an();cn();_o=[Kt()];He=class extends(Ql=Ie){get type(){return"ext"}constructor(n,e,t,r,i=C.getConfig(),s=!1,o=[]){let l=n.toLowerCase(),g=new ot(!e||/^\s/u.test(e)?e:` ${e}`,"ext-attrs",l,i,o),p=oe(K({},i),{ext:i.ext.filter(u=>u!==l),excludes:[...i.excludes]}),d;switch(p.inExt=!0,l){case"tab":p.ext=p.ext.filter(u=>u!=="tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":case"langconvert":case"phonos":l==="poem"&&p.excludes.push("heading"),d=new A(t,p,o);break;case"pre":{let{PreToken:u}=(Ks(),H(Qs));d=new u(t,p,o);break}case"dynamicpagelist":{let{ParamTagToken:u}=(ti(),H(Ys));d=new u(s,t,p,o);break}case"inputbox":{let{InputboxToken:u}=(fo(),H(mo));d=new u(s,t,p,o);break}case"references":{let{NestedToken:u}=(yn(),H(Tn));p.excludes.push("heading"),d=new u(t,s,["ref"],p,o);break}case"choose":{let{NestedToken:u}=(yn(),H(Tn));d=new u(t,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],p,o);break}case"combobox":{let{NestedToken:u}=(yn(),H(Tn));d=new u(t,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],p,o);break}case"gallery":{let{GalleryToken:u}=(No(),H($o));d=new u(t,p,o);break}case"imagemap":{let{ImagemapToken:u}=(Ro(),H(Fo));d=new u(t,p,o);break}case"hiero":{let{CommentedToken:u}=(Bo(),H(jo));d=new u(t,p,o);break}default:{let{NowikiToken:u}=(qo(),H(Oo));d=new u(t,p,o)}}d.setAttribute("name",l),d.type==="plain"&&(d.type="ext-inner"),super(n,g,d,r,i,o),this.seal("closed",!0)}lint(n=this.getAbsoluteIndex(),e){let t=super.lint(n,e),r=new L(this,n);if(this.name!=="nowiki"){let i=this.inHtmlAttrs();i&&t.push(E(this,r,"parsing-order","extension tag in HTML tag attributes",i))}return this.name==="ref"&&this.closest("heading-title")&&t.push(E(this,r,"var-anchor","variable anchor in a section header")),t}};$i=F(Ql),He=P($i,0,"ExtToken",_o,He),R($i,1,He)});var zo={};te(zo,{parseCommentAndExt:()=>At});var Uo,Kl,Ni,Jl,Mo,At,Or=v(()=>{"use strict";Mt();ie();Ns();We();Ls();Rs();gi();Ai();Uo="<onlyinclude>",Kl="</onlyinclude>",{length:Ni}=Uo,Jl=[!1,!0].map(a=>{let n=a?"includeonly":"(?:no|only)include",e=a?"noinclude":"includeonly";return Ee(t=>new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${n}(?:\s[^>]*)?/?>|</${n}\s*>|<(${t.join("|")})(\s[^>]*?)?(?:/>|>([\s\S]*?)</(\1\s*)>)|<(${e})(\s[^>]*?)?(?:/>|>([\s\S]*?)(?:</(${e}\s*)>|$))`,"giu"))}),Mo=a=>{let n=a.indexOf(Uo);return{i:n,j:a.indexOf(Kl,n+Ni)}},At=(a,n,e,t)=>{if(t){let{i:o,j:l}=Mo(a);if(o!==-1&&l!==-1){let g="",p=d=>{new D(d,n,e),g+=`\0${e.length-1}n`};for(;o!==-1&&l!==-1;){let d=`\0${e.length}e`;new kt(a.slice(o+Ni,l),n,e),o>0&&p(a.slice(0,o)),g+=d,a=a.slice(l+Ni+1),{i:o,j:l}=Mo(a)}return a&&p(a),g}}let{ext:r}=n,i=r.filter(o=>o!=="translate"&&o!=="tvar"),s=oe(K({},n),{ext:i});if(r.includes("translate")){let o=[];a=a.replace(/<nowiki>[\s\S]*?<\/nowiki>/giu,l=>(o.push(l),`\0${o.length-1}`)).replace(/<translate( nowrap)?>([\s\S]+?)?<\/translate>/gu,(l,g,p)=>{let d=e.length;return new ln(g,p&&Le(p,o),s,e),`\0${d}g`}),a=Le(a,o)}return a.replace(Jl[t?1:0](i),(o,l,g,p,d,u,h,m,f)=>{let x=e.length,T="n";if(l)T="e",new He(l,g,p,d,s,u,e);else if(o.startsWith("<!--")){T="c";let k=o.endsWith("-->");new Ke(o.slice(4,k?-3:void 0),k,n,e)}else u?new vt(u,h,m,f,n,e):new D(o,n,e);return`\0${x}${T}`})}});var Yl,Zl,ed,Do,pr,je,pt,Je,Ii,td,It,Wo=v(()=>{"use strict";M();pe();se();gn();B();G();Yl=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),Zl=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"]),ed=new Set(["strike","big","center","font","tt"]);Do=[Kt()];It=class extends(td=A){constructor(e,t,r,i,s,o){super(void 0,s,o);b(this,pr);b(this,je);b(this,pt);b(this,Je);this.insertAt(t),this.setAttribute("name",e.toLowerCase()),y(this,pr,r),y(this,je,i),y(this,pt,e)}get type(){return"html"}get selfClosing(){return c(this,je)}get closing(){return c(this,pr)}toString(e){return`<${this.closing?"/":""}${c(this,pt)}${super.toString(e)}${c(this,je)?"/":""}>`}text(){let{closing:e}=this,t=c(this,pt)+(e?"":super.text());return`<${e?"/":""}${t}${c(this,je)?"/":""}>`}getAttribute(e){return e==="invalid"?this.inTableAttrs()==="error":e==="padding"?c(this,pt).length+(this.closing?2:1):super.getAttribute(e)}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),{name:i,parentNode:s,closing:o,selfClosing:l}=this,g=new L(this,e),p=this.inTableAttrs();if(i==="h1"&&!o){let x=E(this,g,"h1","<h1>");x.suggestions=[{desc:"h2",range:[e+2,e+3],text:"2"}],r.push(x)}if(p){let x=E(this,g,"parsing-order","HTML tag in table attributes",p);p==="error"&&(x.fix={desc:"remove",range:[e,x.endIndex],text:""}),r.push(x)}ed.has(i)&&r.push(E(this,g,"obsolete-tag","obsolete HTML tag","warning")),(i==="b"||i==="strong")&&this.closest("heading-title")&&r.push(E(this,g,"bold-header","bold in section header","warning"));let{html:[,d,u]}=this.getAttribute("config"),h=u.includes(i),m=d.includes(i);if(o&&(l||h)||l&&(!h&&!m)){let x=E(this,g,"unmatched-tag",o?"tag that is both closing and self-closing":"invalid self-closing tag"),T={desc:"open",range:[e+1,e+2],text:""},k={desc:"no self-closing",range:[x.endIndex-2,x.endIndex-1],text:""};m?x.suggestions=[T,k]:o?x.fix=h?T:k:x.suggestions=[k,{desc:"close",range:[x.endIndex-2,x.endIndex],text:`></${i}>`}],r.push(x)}else if(!this.findMatchingTag()){let x=E(this,g,"unmatched-tag",o?"unmatched closing tag":"unclosed tag");if(o){let T=this.closest("magic-word");T&&Yl.has(T.name)?x.severity="warning":x.suggestions=[{desc:"remove",range:[e,x.endIndex],text:""}]}else{let T=s==null?void 0:s.childNodes;Zl.has(i)&&(T!=null&&T.slice(0,T.indexOf(this)).some(({type:k,name:$})=>k==="html"&&$===i))?x.suggestions=[{desc:"close",range:[e+1,e+1],text:"/"}]:this.closest("heading-title")||(x.severity="warning")}r.push(x)}return r}findMatchingTag(){return Ce(c(this,Je),()=>{let{name:e,parentNode:t,closing:r,selfClosing:i}=this,{html:[,s,o]}=this.getAttribute("config"),l=o.includes(e),g=s.includes(e);if(l||g&&i)return this;if(!t)return;let{childNodes:p}=t,d=p.indexOf(this),u=r?p.slice(0,d).reverse():p.slice(d+1),h=[this],{rev:m}=le;for(let f of u)if(!(!f.is("html")||f.name!==e||g&&c(f,je)))if(c(f,pr)===r)h.push(f);else{let x=h.pop();if(x===this)return f;C.viewOnly&&(y(x,Je,[m,f]),y(f,Je,[m,x]))}if(C.viewOnly)for(let f of h)y(f,Je,[m,void 0])},e=>{y(this,Je,e),e[1]&&e[1]!==this&&y(e[1],Je,[le.rev,this])})}print(){return super.print({pre:`&lt;${this.closing?"/":""}${c(this,pt)}`,post:`${c(this,je)?"/":""}&gt;`})}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return Object.assign(r,{closing:this.closing,selfClosing:c(this,je)}),r}};Ii=F(td),pr=new WeakMap,je=new WeakMap,pt=new WeakMap,Je=new WeakMap,It=P(Ii,0,"HtmlToken",Do,It),R(Ii,1,It)});var Ho={};te(Ho,{parseHtml:()=>nd});var rd,nd,Go=v(()=>{"use strict";cn();Wo();rd=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,nd=(a,n,e)=>{var s;let{html:t}=n;(s=n.htmlElements)!=null||(n.htmlElements=new Set([...t[0],...t[1],...t[2]]));let r=a.split("<"),i=r.shift();for(let o of r){let l=rd.exec(o),g=l==null?void 0:l[2],p=g==null?void 0:g.toLowerCase();if(!l||!n.htmlElements.has(p)){i+=`<${o}`;continue}let[,d,,u="",h,m]=l,{length:f}=e,x=new ot(u,"html-attrs",p,n,e),T=x.getAttr("itemprop");if(p==="meta"&&(T===void 0||x.getAttr("content")===void 0)||p==="link"&&(T===void 0||x.getAttr("href")===void 0)){i+=`<${o}`,e.length=f;continue}i+=`\0${e.length}x${m}`,new It(g,x,d==="/",h==="/>",n,e)}return i}});var ur,Ei=v(()=>{"use strict";gn();B();bt();cn();ur=class extends Kt(1)(A){constructor(n,e,t,r,i,s=[],o){super(void 0,i,s,o),this.append(new me(e,"table-syntax",i,s),new ot(r,"table-attrs",t,i,s))}}});var Ae,Vr,Xr,Li,cr,Fi=v(()=>{"use strict";M();se();B();Ei();cr=class extends ur{constructor(e,t,r,i=[]){var g;let s=/\||\0\d+!\x7F/u.exec(t!=null?t:""),o=s?t.slice(0,s.index):"";/\[\[|-\{/u.test(o)&&(s=null,o="");super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",o,r,i);b(this,Xr);b(this,Ae,"");b(this,Vr);s&&([tn(this,Ae)._]=s);let l=new A(t==null?void 0:t.slice(((g=s==null?void 0:s.index)!=null?g:NaN)+c(this,Ae).length),r,i);l.type="td-inner",l.setAttribute("stage",4),this.insertAt(l)}get type(){return"td"}get rowspan(){return this.getAttr("rowspan")}get colspan(){return this.getAttr("colspan")}get subtype(){return S(this,Xr,Li).call(this).subtype}afterBuild(){c(this,Ae).includes("\0")&&y(this,Ae,this.buildFromStr(c(this,Ae),0)),super.afterBuild()}toString(e){let{childNodes:[t,r,i]}=this;return t.toString(e)+r.toString(e)+c(this,Ae)+i.toString(e)}text(){let{childNodes:[e,t,r]}=this;return e.text()+t.text()+c(this,Ae)+r.text()}getGaps(e){return e===1?c(this,Ae).length:0}lint(e=this.getAbsoluteIndex(),t){let r=super.lint(e,t),i=new L(this,e+this.getRelativeIndex(this.length-1));for(let s of this.lastChild.childNodes)if(s.type==="text"){let{data:o}=s;if(o.includes("|")){let l=o.includes("||"),g=N(s,i,"pipe-like",'additional "|" in a table cell',l?"error":"warning");if(l){let p={caption:"|+",td:"|",th:"!"}[this.subtype];g.fix={desc:"newline",range:[g.startIndex,g.endIndex],text:o.replace(/\|\|/gu,`
14
- ${p}`)}}else g.suggestions=[{desc:"escape",range:[g.startIndex,g.endIndex],text:o.replace(/\|/gu,"&#124;")}];r.push(g)}}return r}isIndependent(){return this.firstChild.text().startsWith(`
15
- `)}getAttr(e){let t=super.getAttr(e);return e==="rowspan"||e==="colspan"?parseInt(t)||1:t}print(){let{childNodes:[e,t,r]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${c(this,Ae)}${r.print()}</span>`}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t),{rowspan:i,colspan:s}=this;return Object.assign(r,{subtype:this.subtype},i!==1&&{rowspan:i},s!==1&&{colspan:s}),r}};Ae=new WeakMap,Vr=new WeakMap,Xr=new WeakSet,Li=function(){return Ce(c(this,Vr),()=>{var o;let e=this.firstChild.text(),t=e.slice(-1),r="td";if(t==="!"?r="th":t==="+"&&(r="caption"),this.isIndependent())return{subtype:r};let{previousSibling:i}=this;return K({},S(o=i,Xr,Li).call(o))},e=>{y(this,Vr,e)})}});var hr,Ri=v(()=>{"use strict";M();Ei();Fi();hr=class extends ur{lint(n=this.getAbsoluteIndex(),e){let t=super.lint(n,e),r=this.childNodes.find(({type:o})=>o==="table-inter");if(!r)return t;let i=zt(r);if(!i)return t;let s=N(r,{start:n},"fostered-content","content to be moved out from the table",i);return s.startIndex++,s.startLine++,s.startCol=0,t.push(s),t}getRowCount(){return Number(this.childNodes.some(n=>n instanceof cr&&n.isIndependent()&&!n.firstChild.text().endsWith("+")))}}});var id,sd,Pi,wn,Vo=v(()=>{"use strict";M();pe();se();G();Ri();bt();id=(a,n)=>new Array(a).fill(void 0).map((e,t)=>n(t)),sd=({type:a})=>a==="tr"||a==="table-syntax",Pi=class extends Array{},wn=class extends hr{get type(){return"table"}get closed(){return this.lastChild.is("table-syntax")}constructor(n,e,t,r){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,n,"table",e,t,r,{})}lint(n=this.getAbsoluteIndex(),e){let t=super.lint(n,e),r=new L(this,n);this.closed||t.push(N(this.firstChild,r,"unclosed-table",C.msg("unclosed $1","table")));let i=this.getLayout(),{length:s}=i;if(s>1){let o=1,l=1/0,g=0;for(;g<s;g++){let p=i[g],d=p.length;if(d<o)break;d<l&&(l=d);let u=p.indexOf(p[d-1])+1;if(u>l)break;u>o&&(o=u)}if(g<s){let p=N(this.getNthRow(g),r,"table-layout","inconsistent table layout","warning");p.startIndex++,p.startLine++,p.startCol=0,t.push(p)}}return t}close(n=`
16
- |}`,e){let t=this.getAttribute("config"),r=this.getAttribute("accum"),i=[n];le.run(()=>{let s=new me(void 0,"table-syntax",t,r);super.insertAt(s)}),this.lastChild.safeReplaceChildren(i)}getLayout(n){let e=this.getAllRows(),{length:t}=e,r=Pi.from(id(t,()=>[]));for(let i=0;i<r.length;i++){let s=r[i],o=0,l=0,g;for(let p of e[i].childNodes.slice(2))if(p.is("td")){if(p.isIndependent()&&(g=p.subtype!=="caption"),g){let d={row:i,column:o},{rowspan:u,colspan:h}=p;for(o++;s[l];)l++;for(let m=i;m<Math.min(i+u,t);m++)for(let f=l;f<l+h;f++)r[m][f]=d;l+=h}}else if(sd(p))break}return r}getAllRows(){return[...super.getRowCount()?[this]:[],...this.childNodes.slice(1).filter(n=>n.is("tr")&&n.getRowCount()>0)]}getNthRow(n,e,t){let r=super.getRowCount();if(n===0&&r)return this;r&&n--;for(let i of this.childNodes.slice(2)){let{type:s}=i;if(s==="tr"&&i.getRowCount()&&(n--,n<0))return i}}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e);return t.closed=this.closed,t}}});var Sn,Xo=v(()=>{"use strict";Ri();Sn=class extends hr{get type(){return"tr"}constructor(n,e,t,r){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,n,"tr",e,t,r)}}});var mr,ji=v(()=>{"use strict";rt();mr=class extends ce{get indent(){return this.innerText.split(":").length-1}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e),{indent:r}=this;return r&&(t.indent=r),t}}});var fr,Bi=v(()=>{"use strict";ji();fr=class extends mr{get type(){return"dd"}}});var Ko={};te(Ko,{parseTable:()=>ad});var od,Qo,ad,Jo=v(()=>{"use strict";B();Vo();Xo();Fi();Bi();od=a=>a.lastChild.constructor!==A,Qo=(a,n)=>a.is("td")?n.pop():a,ad=({firstChild:{data:a},type:n,name:e},t,r)=>{let i=[],s=a.split(`
17
- `),o=n==="root"||n==="parameter-value"||n==="ext-inner"&&e==="poem"?"":`
18
- ${s.shift()}`,l,g=(p,d)=>{if(!d){o+=p;return}let{lastChild:u}=d;if(od(d)){let h=new A(p,t,r);h.type="table-inter",h.setAttribute("stage",3),d.insertAt(h)}else u.setText(u.toString()+p)};for(let p of s){l=i.pop();let[d]=/^(?:\s|\0\d+[cno]\x7F)*/u.exec(p),u=p.slice(d.length),h=/^(:*)((?:\s|\0\d+[cn]\x7F)*)(\{\||\{(?:\0\d+[cn]\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(u);if(h){for(;l&&l.type!=="td";)l=i.pop();let[,$,w,I,j]=h;$&&new fr($,t,r),g(`
19
- ${d}${$&&`\0${r.length-1}d`}${w}\0${r.length}b`,l),i.push(...l?[l]:[],new wn(I,j,t,r));continue}else if(!l){o+=`
20
- ${p}`;continue}let m=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(u);if(!m){g(`
21
- ${p}`,l),i.push(l);continue}let[,f,x,T,k]=m;if(f){for(;l.type!=="table";)l=i.pop();l.close(`
22
- ${d}${f}`,!0),g(k,i[i.length-1])}else if(x){l=Qo(l,i),l.is("tr")&&(l=i.pop());let $=new Sn(`
23
- ${d}${x}`,k,t,r);i.push(l,$),l.insertAt($)}else{l=Qo(l,i);let $=T==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu,w=$.exec(k),I=0,j=`
24
- ${d}${T}`,U=J=>{let ne=new cr(j,k.slice(I,w==null?void 0:w.index),t,r);return J.insertAt(ne),ne};for(;w;)U(l),{lastIndex:I}=$,[j]=w,w=$.exec(k);i.push(l,U(l))}}return o.slice(1)}});var Cn,Yo=v(()=>{"use strict";rt();Cn=class extends ce{get type(){return"hr"}}});var Zo,Oi,ld,Et,ea=v(()=>{"use strict";xt();Ue();rt();Zo=[ve(),ue("__")];Et=class extends(ld=ce){get type(){return"double-underscore"}constructor(n,e,t,r){var l,g;super(n,t,r);let i=n.toLowerCase(),{doubleUnderscore:[,,s,o]}=t;this.setAttribute("name",(g=e?(l=o==null?void 0:o[n])==null?void 0:l.toLowerCase():s==null?void 0:s[i])!=null?g:i)}toString(){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}};Oi=F(ld),Et=P(Oi,0,"DoubleUnderscoreToken",Zo,Et),R(Oi,1,Et)});var ta={};te(ta,{parseHrAndDoubleUnderscore:()=>dd});var dd,ra=v(()=>{"use strict";Yo();ea();ri();dd=({firstChild:{data:a},type:n,name:e},t,r)=>{var l,g,p;let{doubleUnderscore:[i,s,o]}=t;return(l=t.insensitiveDoubleUnderscore)!=null||(t.insensitiveDoubleUnderscore=new Set(i)),(g=t.sensitiveDoubleUnderscore)!=null||(t.sensitiveDoubleUnderscore=new Set(s)),(p=t.regexHrAndDoubleUnderscore)!=null||(t.regexHrAndDoubleUnderscore=new RegExp(`__(${[...i,...s].join("|")})__`,"giu")),n!=="root"&&(n!=="ext-inner"||e!=="poem")&&(a=`\0${a}`),a=a.replace(/^((?:\0\d+[cno]\x7F)*)(-{4,})/gmu,(d,u,h)=>(new Cn(h,t,r),`${u}\0${r.length-1}r`)).replace(t.regexHrAndDoubleUnderscore,(d,u)=>{var x;let h=t.sensitiveDoubleUnderscore.has(u),m=u.toLowerCase(),f=t.insensitiveDoubleUnderscore.has(m);return h||f?(new Et(u,h,t,r),`\0${r.length-1}${f&&((x=o==null?void 0:o[m])!=null?x:m)==="toc"?"u":"n"}`):d}).replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(d,u,h,m,f)=>{let x=`${u}\0${r.length}h`;return new nr(h.length,[m,f],t,r),x}),n==="root"||n==="ext-inner"&&e==="poem"?a:a.slice(1)}});var xr,$n,na=v(()=>{"use strict";M();se();G();rt();$n=class extends ce{constructor(e,t,r,i){super(e,r,i);b(this,xr);y(this,xr,t)}get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}get closing(){return K(K({},this.bold?{bold:c(this,xr).bold}:void 0),this.italic?{italic:c(this,xr).italic}:void 0)}text(){let{parentNode:e,innerText:t}=this;return e!=null&&e.is("image-parameter")&&e.name!=="caption"?"":t}lint(e=this.getAbsoluteIndex()){let{previousSibling:t,nextSibling:r,bold:i,closing:s}=this,o=(t==null?void 0:t.type)==="text"?t.data:void 0,l=(r==null?void 0:r.type)==="text"?r.data:void 0,g=C.msg('lonely "$1"',"'"),p=[],d=new L(this,e),u=(h,m,f)=>[{desc:"escape",range:[h,m],text:"&apos;".repeat(f)},{desc:"remove",range:[h,m],text:""}];if(o!=null&&o.endsWith("'")){let h=E(this,d,"lonely-apos",g,(s.bold||s.italic)&&(/[a-z\d]'$/iu.test(o)||l&&/^[a-z\d]/iu.test(l))?"warning":"error"),{startIndex:m,startLine:f,startCol:x}=h,[,{length:T}]=/(?:^|[^'])('+)$/u.exec(o),k=e-T;p.push(oe(K({},h),{startIndex:k,endIndex:m,endLine:f,startCol:x-T,endCol:x,suggestions:u(k,m,T)}))}if(l!=null&&l.startsWith("'")){let h=E(this,d,"lonely-apos",g),{endIndex:m,endLine:f,endCol:x}=h,[{length:T}]=/^'+/u.exec(l),k=m+T;p.push(oe(K({},h),{startIndex:m,endIndex:k,startLine:f,startCol:x,endCol:x+T,suggestions:u(m,k,T)}))}if(i&&this.closest("heading-title")){let h=E(this,d,"bold-header","bold in section header","warning");h.suggestions=[{desc:"remove",range:[e,e+3],text:""}],p.push(h)}return p}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return Object.assign(r,{bold:this.bold,italic:this.italic}),r}};xr=new WeakMap});var ia={};te(ia,{parseQuotes:()=>qi});var qi,_i=v(()=>{"use strict";na();qi=(a,n,e,t)=>{var h;let r=a.split(/('{2,})/u),{length:i}=r;if(i===1)return a;let s=0,o=0,l,g,p;for(let m=1;m<i;m+=2){let f=r[m].length;switch(f){case 2:o++;break;case 4:r[m-1]+="'",r[m]="'''";case 3:if(s++,l!==void 0)break;r[m-1].endsWith(" ")?g===void 0&&p===void 0&&(p=m):r[m-1].slice(-2,-1)===" "?l=m:g!=null||(g=m);break;default:r[m-1]+="'".repeat(f-5),r[m]="'''''",o++,s++}}if(o%2===1&&s%2===1){let m=(h=l!=null?l:g)!=null?h:p;m!==void 0&&(r[m]="''",r[m-1]+="'")}let d=!0,u=!0;for(let m=1;m<i;m+=2){let f=r[m].length,x=f!==2,T=f!==3;x&&(d=!d),T&&(u=!u),new $n(r[m],{bold:x&&d,italic:T&&u},n,e),r[m]=`\0${e.length-1}q`}return r.join("")}});var sa={};te(sa,{parseExternalLinks:()=>Mi});var Mi,Ui=v(()=>{"use strict";ie();yi();An();Mi=(a,n,e,t)=>{var r;return(r=n.regexExternalLinks)!=null||(n.regexExternalLinks=new RegExp(String.raw`\[(\0\d+f\x7F|(?:(?:${n.protocol}|//)${Oe}|\0\d+m\x7F)${qe}(?=[[\]<>"\t${Se}]|\0\d))([${Se}]*(?![${Se}]))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),a.replace(n.regexExternalLinks,(i,s,o,l)=>{let{length:g}=e,p=/&[lg]t;/u.exec(s);return p&&(o="",l=s.slice(p.index)+o+l,s=s.slice(0,p.index)),t?(new Ve(s,"ext-link-url",n,e),`[\0${g}f${o}${l}]`):(new Qe(s,o,l,n,e),`\0${g}w`)})}});var Nn,oa=v(()=>{"use strict";ie();Fr();Nn=class extends Te{get type(){return"category"}get sortkey(){let{childNodes:[,n]}=this;return n&&mt(n.text())}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e),{sortkey:r}=this;return r&&(t.sortkey=r),t}}});var la={};te(la,{parseLinks:()=>aa});var gd,aa,da=v(()=>{"use strict";G();_i();Ui();xi();pi();oa();gd=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)([\s\S]*)$/u,aa=(a,n,e,t)=>{var o;(o=n.regexLinks)!=null||(n.regexLinks=new RegExp(String.raw`^\s*(?:${n.protocol}|//)`,"iu"));let r=n.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=a.split("[["),s=i.shift();for(let l=0;l<i.length;l++){let g=!1,p,d,u,h,m=i[l],f=r.exec(m);if(f)[,p,d,u,h]=f,h.startsWith("]")&&(u!=null&&u.includes("["))&&(u+="]",h=h.slice(1));else{let w=gd.exec(m);w&&(g=!0,[,p,d,u]=w)}if(p===void 0||n.regexLinks.test(p)||/\0\d+[exhbru]\x7F/u.test(p)){s+=`[[${m}`;continue}let x=p.trim().startsWith(":");if(x&&g){s+=`[[${m}`;continue}let{ns:T,valid:k}=C.normalizeTitle(p,0,!1,n,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0});if(k){if(g){if(T!==6){s+=`[[${m}`;continue}let w=!1;for(l++;l<i.length;l++){let I=i[l],j=I.split("]]");if(j.length>2){w=!0,u+=`[[${j[0]}]]${j[1]}`,h=j.slice(2).join("]]");break}else if(j.length===2)u+=`[[${j[0]}]]${j[1]}`;else{u+=`[[${I}`;break}}if(u=aa(u,n,e,t),!w){s+=`[[${p}${d}${u}`;continue}}}else{s+=`[[${m}`;continue}u&&(u=qi(u,n,e,t));let $=dr;x||(T===6?(u&&(u=Mi(u,n,e,!0)),$=ar):T===14&&($=Nn)),u===void 0&&d&&(u=""),s+=`\0${e.length}l${h}`,new $(p,u,n,e,d)}return s}});var ha={};te(ha,{parseMagicLinks:()=>pd});var ca,ga,pa,ua,pd,ma=v(()=>{"use strict";ie();An();ca=String.raw`[${Se}\t]|&nbsp;|&#0*160;|&#x0*a0;`,ga=`(?:${ca})+`,pa=`(?:${ca}|-)`,ua=String.raw`(?:RFC|PMID)${ga}\d+\b|ISBN${ga}(?:97[89]${pa}?)?(?:\d${pa}?){9}[\dx]\b`,pd=(a,n,e)=>{if(!n.regexMagicLinks)try{n.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${n.protocol})(${Oe}${qe})|${ua})`,"giu")}catch(t){n.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${n.protocol})(${Oe}${qe})|${ua})`,"giu")}return a.replace(n.regexMagicLinks,(t,r,i)=>{let s=r?t.slice(r.length):t;if(i){let o="",l=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(s);l&&(o=s.slice(l.index),s=s.slice(0,l.index));let g=s.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,p=g.exec(s);if(p){let d=1;p[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(s.slice(0,p.index))&&(d=2),o=s.slice(p.index+d)+o,s=s.slice(0,p.index+d)}return o.length>=i.length?t:(new Ve(s,void 0,n,e),`${r}\0${e.length-1}w${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(s))return t;return new Ve(s,"magic-link",n,e),`${r}\0${e.length-1}i`})}});var fa,xa=v(()=>{"use strict";fa=(a,n)=>a.startsWith(n)?n.length:[...n].findIndex((e,t)=>e!==a[t])});var In,ba=v(()=>{"use strict";ji();In=class extends mr{get type(){return"list"}}});var Ta={};te(Ta,{parseList:()=>ud});var ud,ya=v(()=>{"use strict";xa();ba();Bi();ud=(a,n,e,t)=>{let r=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(a);if(!r)return n.lastPrefix="",a;let[i,s,o,l]=r,g=o.replace(/;/gu,":"),p=fa(g,n.lastPrefix),d=((p>1?o.slice(p-1):o)+l).split(/(?=;)/u),u=d[0].startsWith(";"),h=d.length-(u?0:1);if(p>1){let q=o.slice(0,p-1);if(u){let W=q.split(/(?=;)/u);d.unshift(...W),h+=q.includes(";")?W.length:0}else d[0]=q+d[0]}n.lastPrefix=g;let m=s+d.map((q,W)=>`\0${t.length+W}d`).join("")+a.slice(i.length);for(let q of d)new In(q,e,t);if(!h)return m;let{html:[f,,x]}=e,T=/:+|-\{|\0\d+[xq]\x7F/gu,k=T,$=k.exec(m),w=0,I=!1,j=!1,U=0,J=(q,W)=>(new fr(q,e,t),`${m.slice(0,W)}\0${t.length-1}d${m.slice(W+q.length)}`),ne=q=>{q?w&&w--:w++};for(;$&&h;){let{0:q,index:W}=$;if(q==="-{"){if(!U){let{lastIndex:z}=k;k=/-\{|\}-/gu,k.lastIndex=z}U++}else if(q==="}-"){if(U--,!U){let{lastIndex:z}=k;k=T,k.lastIndex=z}}else if(q.endsWith("x")){let{name:z,closing:Y,selfClosing:Q}=t[Number(q.slice(1,-2))];(f.includes(z)||!Q&&!x.includes(z))&&ne(Y)}else if(q.endsWith("q")){let{bold:z,italic:Y}=t[Number(q.slice(1,-2))];z&&(ne(I),I=!I),Y&&(ne(j),j=!j)}else if(w===0){if(q.length>=h)return J(q.slice(0,h),W);h-=q.length,k.lastIndex=W+4+String(t.length).length,m=J(q,W)}$=k.exec(m)}return m}});var zi,ka,Be,Di,cd,Lt,va=v(()=>{"use strict";M();se();Rr();B();ze();zi=new Set(["A","T","R","D","-","H","N"]);ka=[it()];Lt=class extends(cd=A){constructor(e,t,r=[]){super(void 0,t,r,{});b(this,Be);this.safeAppend(e.map(i=>new Z(i,"converter-flag",t,r)))}get type(){return"converter-flags"}afterBuild(){y(this,Be,this.childNodes.map(e=>e.text().trim())),super.afterBuild()}toString(e){return super.toString(e,";")}text(){return super.text(";")}getUnknownFlags(){return new Set(c(this,Be).filter(e=>/\{{3}[^{}]+\}{3}/u.test(e)))}getVariantFlags(){let e=new Set(this.getAttribute("config").variants);return new Set(c(this,Be).filter(t=>e.has(t)))}isInvalidFlag(e,t,r,i){return typeof e=="object"&&(e=e.text().trim(),t=this.getVariantFlags(),r=this.getUnknownFlags(),i=new Set(c(this,Be).filter(s=>zi.has(s)))),!!e&&!t.has(e)&&!r.has(e)&&(t.size>0||!i.has(e))}lint(e=this.getAbsoluteIndex(),t){let r=this.getVariantFlags(),i=this.getUnknownFlags(),s=new Set(c(this,Be).filter(d=>zi.has(d))),o=c(this,Be).filter(d=>!d).length,l=c(this,Be).length-i.size-o,g=super.lint(e,t);if(r.size===l||s.size===l)return g;let p=new L(this,e);for(let d=0;d<this.length;d++){let u=this.childNodes[d],h=u.text().trim();if(this.isInvalidFlag(h,r,i,s)){let m=N(u,p,"no-ignored","invalid conversion flag");r.size===0&&zi.has(h.toUpperCase())?m.fix={desc:"uppercase",range:[m.startIndex,m.endIndex],text:h.toUpperCase()}:m.suggestions=[{desc:"remove",range:[m.startIndex-(d&&1),m.endIndex],text:""}],g.push(m)}}return g}print(){return super.print({sep:";"})}};Di=F(cd),Be=new WeakMap,Lt=P(Di,0,"ConverterFlagsToken",ka,Lt),R(Di,1,Lt)});var br,Aa=v(()=>{"use strict";G();B();ze();br=class extends A{get type(){return"converter-rule"}get variant(){var n,e;return(e=(n=this.childNodes[this.length-2])==null?void 0:n.text().trim())!=null?e:""}constructor(n,e=!0,t=C.getConfig(),r=[]){super(void 0,t,r);let i=n.indexOf(":"),s=n.slice(0,i).indexOf("=>"),o=s===-1?n.slice(0,i):n.slice(s+2,i);e&&t.variants.includes(o.trim())?(super.insertAt(new Z(o,"converter-rule-variant",t,r)),super.insertAt(new Z(n.slice(i+1),"converter-rule-to",t,r)),s!==-1&&super.insertAt(new Z(n.slice(0,s),"converter-rule-from",t,r),0)):super.insertAt(new Z(n,"converter-rule-to",t,r))}toString(n){let{childNodes:e,firstChild:t,lastChild:r}=this;return e.length===3?`${t.toString(n)}=>${e[1].toString(n)}:${r.toString(n)}`:super.toString(n,":")}text(){let{childNodes:n,firstChild:e,lastChild:t}=this;return n.length===3?`${e.text()}=>${n[1].text()}:${t.text()}`:super.text(":")}getGaps(n){return n===0&&this.length===3?2:1}print(){let{childNodes:n}=this;if(n.length===3){let[e,t,r]=n;return`<span class="wpb-converter-rule">${e.print()}=>${t.print()}:${r.print()}</span>`}return super.print({sep:":"})}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e);return t.variant=this.variant,t}}});var wa,Wi,hd,Ft,Sa=v(()=>{"use strict";ie();Ue();B();va();Aa();wa=[ue("-{")];Ft=class extends(hd=A){get type(){return"converter"}constructor(n,e,t,r=[]){super(void 0,t,r),this.insertAt(new Lt(n,t,r));let[i]=e,s=i.includes(":"),o=new br(i,s,t,r);s&&o.length===1||!s&&e.length===2&&!ae(e[1]).trim()?this.insertAt(new br(e.join(";"),!1,t,r)):this.append(o,...e.slice(1).map(l=>new br(l,!0,t,r)))}toString(n){let{childNodes:[e,...t]}=this;return`-{${e.toString(n)}${e.length>0?"|":""}${t.map(r=>r.toString(n)).join(";")}}-`}text(){let{childNodes:[n,...e]}=this;return`-{${n.text()}|${ke(e,";")}}-`}getGaps(n){return n||this.firstChild.length>0?1:0}print(){let{childNodes:[n,...e]}=this;return`<span class="wpb-converter">-{${n.print()}${n.length>0?"|":""}${Me(e,{sep:";"})}}-</span>`}};Wi=F(hd),Ft=P(Wi,0,"ConverterToken",wa,Ft),R(Wi,1,Ft)});var Ca={};te(Ca,{parseConverter:()=>md});var md,$a=v(()=>{"use strict";Sa();md=(a,n,e)=>{var l;(l=n.regexConverter)!=null||(n.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${n.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"u"));let t=/-\{/gu,r=/-\{|\}-/gu,i=[],s=t,o=s.exec(a);for(;o;){let{0:g,index:p}=o;if(g==="}-"){let d=i.pop(),{length:u}=e,h=a.slice(d.index+2,p),m=h.indexOf("|"),[f,x]=m===-1?[[],h]:[h.slice(0,m).split(";"),h.slice(m+1)],T=x.replace(/(&[#a-z\d]+);/giu,"$1"),k=T.split(n.regexConverter).map($=>$.replace(/\x01/gu,";"));new Ft(f,k,n,e),a=`${a.slice(0,d.index)}\0${u}v${a.slice(p+2)}`,i.length===0&&(s=t),s.lastIndex=d.index+3+String(u).length}else i.push(o),s=r,s.lastIndex=p+2;o=s.exec(a)}return a}});var En={};te(En,{Token:()=>A});var Qr,ye,V,ee,Rt,Tr,Kr,X,Na,Ia,Ea,La,Fa,Ra,Pa,ja,Ba,Oa,qa,_a,Hi,A,B=v(()=>{"use strict";ie();M();pe();G();ms();Ts();Hi=class Hi extends nn{constructor(e,t=C.getConfig(),r=[],i){super();b(this,X);b(this,Qr,"plain");b(this,ye,0);b(this,V);b(this,ee);b(this,Rt);b(this,Tr,!1);b(this,Kr);typeof e=="string"&&this.insertAt(e),y(this,V,t),y(this,ee,r),r.push(this)}get type(){return c(this,Qr)}set type(e){y(this,Qr,e)}parseOnce(e=c(this,ye),t=!1,r){if(e<c(this,ye)||this.length===0||!this.isPlain())return this;if(c(this,ye)>=11)return this;switch(e){case 0:if(this.type==="root"){c(this,ee).pop();let i=S(this,X,Na).call(this);t&&(t=!i)}y(this,Rt,t),S(this,X,Ia).call(this,t);break;case 1:S(this,X,Ea).call(this);break;case 2:S(this,X,La).call(this);break;case 3:S(this,X,Fa).call(this);break;case 4:S(this,X,Ra).call(this);break;case 5:S(this,X,Pa).call(this,r);break;case 6:S(this,X,ja).call(this,r);break;case 7:S(this,X,Ba).call(this);break;case 8:S(this,X,Oa).call(this);break;case 9:S(this,X,qa).call(this);break;case 10:S(this,X,_a).call(this)}if(this.type==="root")for(let i of c(this,ee))i==null||i.parseOnce(e,t,r);return tn(this,ye)._++,this}buildFromStr(e,t){let r=e.split(/[\0\x7F]/u).map((i,s)=>{if(s%2===0)return new Er(i);if(isNaN(i.slice(-1)))return c(this,ee)[Number(i.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${i}`)});return t===0?r.map(String).join(""):t===1?ke(r):r}build(){y(this,ye,11);let{length:e,firstChild:t}=this,r=t==null?void 0:t.toString();if(e===1&&t.type==="text"&&r.includes("\0")&&(Ir(this,0,1,this.buildFromStr(r)),this.normalize(),this.type==="root"))for(let i of c(this,ee))i==null||i.build()}afterBuild(){if(this.type==="root")for(let e of c(this,ee))e==null||e.afterBuild();y(this,Tr,!0)}parse(e=11,t,r){for(e=Math.min(e,11);c(this,ye)<e;)this.parseOnce(c(this,ye),t,r);return e&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===Hi}getAttribute(e){var t;switch(e){case"config":return c(this,V);case"include":return(t=c(this,Rt))!=null?t:!!c(this.getRootNode(),Rt);case"accum":return c(this,ee);case"built":return c(this,Tr);case"stage":return c(this,ye);case"invalid":return this.type==="table-inter"&&zt(this)==="error";default:return super.getAttribute(e)}}setAttribute(e,t){switch(e){case"stage":c(this,ye)===0&&this.type==="root"&&c(this,ee).shift(),y(this,ye,t);break;default:super.setAttribute(e,t)}}insertAt(e,t=this.length){let r=typeof e=="string"?new Er(e):e;super.insertAt(r,t);let{type:i}=r;return i==="root"&&(r.type="plain"),r}normalizeTitle(e,t=0,r){return C.normalizeTitle(e,t,c(this,Rt),c(this,V),r)}inTableAttrs(){var e,t;return((e=this.closest("table-attrs,ext"))==null?void 0:e.type)==="table-attrs"&&((t=this.closest("table-attrs,arg,magic-word,template"))!=null&&t.is("table-attrs")?"error":"warning")}inHtmlAttrs(){var e;return(e=this.closest("html-attrs,ext"))!=null&&e.is("html-attrs")?"error":this.inTableAttrs()}lint(e=this.getAbsoluteIndex(),t){var i;let r=super.lint(e,t);if(this.type==="root"){let s=new Map,o="category,html-attr#id,ext-attr#id,table-attr#id";for(let u of this.querySelectorAll(o)){let h;if(u.is("category"))h=u.name;else{let m=u.getValue();m&&m!==!0&&(h=`#${m}`)}if(h){let m=s.get(h);m?m.add(u):s.set(h,new Set([u]))}}for(let[u,h]of s)if(h.size>1&&!u.startsWith("#mw-customcollapsible-")){let m=!u.startsWith("#"),f=`duplicated ${m?"category":"id"}`,x=m?"error":"warning";r.push(...[...h].map(T=>{let k=E(T,{start:T.getAbsoluteIndex()},"no-duplicate",f,x);return m&&(k.suggestions=[{desc:"remove",range:[k.startIndex,k.endIndex],text:""}]),k}))}let l=/<!--\s*lint-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->/gu,g=this.toString(),p=[],d=l.exec(g);for(;d;){let{1:u,index:h}=d,m=(i=d[2])==null?void 0:i.trim();p.push({line:this.posFromIndex(h).top+(u==="disable-line"?0:1),from:u==="disable"?l.lastIndex:void 0,to:u==="enable"?l.lastIndex:void 0,rules:m?new Set(m.split(",").map(f=>f.trim())):void 0}),d=l.exec(g)}if(r=r.filter(({rule:u,startLine:h,startIndex:m})=>{let f={pos:0};for(let{line:x,from:T,to:k,rules:$}of p){if(x>h+1)break;if($&&!$.has(u))continue;if(x===h&&T===void 0&&k===void 0)return!1;T<=m&&T>f.pos?(f.pos=T,f.type="from"):k<=m&&k>f.pos&&(f.pos=k,f.type="to")}return f.type!=="from"}),r.some(({fix:u})=>u)){let u=r.map(({fix:f})=>f).filter(Boolean).sort(({range:[f,x]},{range:[T,k]})=>x===k?T-f:k-x),h=1/0,m=g;for(let{range:[f,x],text:T}of u)x<=h&&(m=m.slice(0,f)+T+m.slice(x),h=f);Object.assign(r,{output:m})}}return r}toString(e,t){return e?super.toString(!0,t):Ce(c(this,Kr),()=>super.toString(!1,t),r=>{let i=this.getRootNode();i.type==="root"&&c(i,Tr)&&y(this,Kr,r)})}};Qr=new WeakMap,ye=new WeakMap,V=new WeakMap,ee=new WeakMap,Rt=new WeakMap,Tr=new WeakMap,Kr=new WeakMap,X=new WeakSet,Na=function(){let{parseRedirect:e}=(Cs(),H(Ss)),t=this.firstChild.toString(),r=e(t,c(this,V),c(this,ee));return r&&this.setText(r),!!r},Ia=function(e){let{parseCommentAndExt:t}=(Or(),H(zo));this.setText(t(this.firstChild.toString(),c(this,V),c(this,ee),e))},Ea=function(){let{parseBraces:e}=(bn(),H(ho)),t=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,r=e(t,c(this,V),c(this,ee));this.setText(this.type==="root"?r:r.slice(1))},La=function(){if(c(this,V).excludes.includes("html"))return;let{parseHtml:e}=(Go(),H(Ho));this.setText(e(this.firstChild.toString(),c(this,V),c(this,ee)))},Fa=function(){if(c(this,V).excludes.includes("table"))return;let{parseTable:e}=(Jo(),H(Ko));this.setText(e(this,c(this,V),c(this,ee)))},Ra=function(){if(c(this,V).excludes.includes("hr"))return;let{parseHrAndDoubleUnderscore:e}=(ra(),H(ta));this.setText(e(this,c(this,V),c(this,ee)))},Pa=function(e){let{parseLinks:t}=(da(),H(la));this.setText(t(this.firstChild.toString(),c(this,V),c(this,ee),e))},ja=function(e){if(c(this,V).excludes.includes("quote"))return;let{parseQuotes:t}=(_i(),H(ia)),r=this.firstChild.toString().split(`
25
- `);for(let i=0;i<r.length;i++)r[i]=t(r[i],c(this,V),c(this,ee),e);this.setText(r.join(`
26
- `))},Ba=function(){if(c(this,V).excludes.includes("extLink"))return;let{parseExternalLinks:e}=(Ui(),H(sa));this.setText(e(this.firstChild.toString(),c(this,V),c(this,ee)))},Oa=function(){if(c(this,V).excludes.includes("magicLink"))return;let{parseMagicLinks:e}=(ma(),H(ha));this.setText(e(this.firstChild.toString(),c(this,V),c(this,ee)))},qa=function(){if(c(this,V).excludes.includes("list"))return;let{parseList:e}=(ya(),H(Ta)),{firstChild:t,type:r,name:i}=this,s=t.toString().split(`
27
- `),o={lastPrefix:""},l=r==="root"||r==="ext-inner"&&i==="poem"?0:1;for(;l<s.length;l++)s[l]=e(s[l],o,c(this,V),c(this,ee));this.setText(s.join(`
28
- `))},_a=function(){if(c(this,V).variants.length>0){let{parseConverter:e}=($a(),H(Ca));this.setText(e(this.firstChild.toString(),c(this,V),c(this,ee)))}};A=Hi});var le,ir,Ir,Fe,pe=v(()=>{"use strict";le={running:!1,run(a){let{running:n}=this;this.running=!0;try{let{Token:e}=(B(),H(En)),t=a();return t instanceof e&&!t.getAttribute("built")&&t.afterBuild(),this.running=n,t}catch(e){throw this.running=n,e}},rev:0},ir=a=>n=>n.type===a,Ir=(a,n,e,t=[])=>{var s,o;let r=a.getChildNodes(),i;r.length===e?(i=r,r=t):i=r.splice(n,e,...t);for(let l=0;l<t.length;l++){let g=t[l];g.setAttribute("parentNode",a),g.setAttribute("nextSibling",r[n+l+1]),g.setAttribute("previousSibling",r[n+l-1])}return(s=r[n-1])==null||s.setAttribute("nextSibling",r[n]),(o=r[n+t.length])==null||o.setAttribute("previousSibling",r[n+t.length-1]),r===t&&a.setAttribute("childNodes",r),i},Fe=(a,n)=>{Object.defineProperty(a,"name",{value:n.name})}});var Ma={};te(Ma,{Title:()=>Gi});var Jr,Yr,Pt,yr,jt,Gi,Ua=v(()=>{"use strict";ie();Gi=class{constructor(n,e,t,{temporary:r,decode:i,selfLink:s}={}){b(this,Jr);b(this,Yr);b(this,Pt);b(this,yr);b(this,jt);ge(this,"valid");ge(this,"encoded",!1);let o=n.trim().startsWith("../");if(i&&n.includes("%"))try{let g=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(n);n=et(n),this.encoded=g}catch(g){}if(n=mt(n).replace(/[_ ]+/gu," ").trim(),o)y(this,yr,0);else{let g=e;n.startsWith(":")&&(g=0,n=n.slice(1).trim());let p=n.split(":");if(p.length>1){let d=_e(p[0]),u=Object.prototype.hasOwnProperty.call(t.nsid,d)&&t.nsid[d];u&&(g=u,n=p.slice(1).join(":").trim())}y(this,yr,g)}let l=n.indexOf("#");if(l!==-1){let g=n.slice(l).trim().slice(1);if(g.includes("%"))try{g=et(g)}catch(p){}y(this,jt,g.replace(/ /gu,"_")),n=n.slice(0,l).trim()}this.valid=!!(n||s&&this.ns===0&&c(this,jt)!==void 0)&&mt(n)===n&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(o?/^(?:\.\.\/)+(.*)/u.exec(n)[1]:n),this.main=n,y(this,Yr,t.namespaces),y(this,Pt,t.articlePath||"/wiki/$1"),c(this,Pt).includes("$1")||y(this,Pt,c(this,Pt)+`${c(this,Pt).endsWith("/")?"":"/"}$1`),r||Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}})}get ns(){return c(this,yr)}get fragment(){return c(this,jt)}get main(){return c(this,Jr)}set main(n){n=n.replace(/_/gu," ").trim(),y(this,Jr,n&&n[0].toUpperCase()+n.slice(1))}get prefix(){let n=c(this,Yr)[this.ns];return n+(n&&":")}get title(){return this.getRedirection()[1]}get extension(){let{main:n}=this,e=n.lastIndexOf(".");return e===-1?void 0:n.slice(e+1).toLowerCase()}getRedirection(){return[!1,(this.prefix+this.main).replace(/ /gu,"_")]}setFragment(n){y(this,jt,n)}getUrl(n){throw new Error("Title.getUrl method is only available in the LSP version!")}};Jr=new WeakMap,Yr=new WeakMap,Pt=new WeakMap,yr=new WeakMap,jt=new WeakMap});var Vi,Bt,za,fd,C,G=v(()=>{os();pe();ps();ie();Vi=!0,Bt={config:Pn,i18n:void 0,rules:ss,get viewOnly(){return Vi},set viewOnly(a){Vi&&!a&&le.rev++,Vi=a},getConfig(a){let n=a!=null?a:this.config,{doubleUnderscore:e,ext:t,parserFunction:r,variable:i}=n;for(let s=0;s<2;s++)e.length>s+2&&e[s].length===0&&(e[s]=Object.keys(e[s+2]));return t.includes("translate")&&!i.includes("translationlanguage")&&(i.push("translationlanguage"),Array.isArray(r[1])?r[1].push("TRANSLATIONLANGUAGE"):r[1].TRANSLATIONLANGUAGE="translationlanguage"),oe(K(K({},Pn),n),{excludes:[]})},msg(a,n=""){var e,t;return a&&((t=(e=this.i18n)==null?void 0:e[a])!=null?t:a).replace("$1",this.msg(n))},normalizeTitle(a,n=0,e,t=Bt.getConfig(),r){let{Title:i}=(Ua(),H(Ma)),s;if(r!=null&&r.halfParsed)s=new i(a,n,t,r);else{let{Token:o}=(B(),H(En));s=le.run(()=>{let l=new o(a,t);l.type="root",l.parseOnce(0,e).parseOnce();let g=new i(l.toString(),n,t,r);for(let p of["main","fragment"]){let d=g[p];if(d!=null&&d.includes("\0")){let u=l.buildFromStr(d,1);p==="main"?g.main=u:g.setFragment(u)}}return g})}return s},parse(a,n,e=11,t=Bt.getConfig()){a=ls(a);let r;typeof e!="number"&&(r=Array.isArray(e)?e:[e],e=Math.max(...r.map(o=>is[o]||11)));let{Token:i}=(B(),H(En));return le.run(()=>{let o=new i(a,t);return o.type="root",o.parse(e,n)})},async partialParse(a,n,e,t=Bt.getConfig()){},createLanguageService(a){throw new Error("Parser.createLanguageService method is only available in the LSP version!")}},za={},fd=new Set(["normalizeTitle","parse","createLanguageService"]);for(let a in Bt)fd.has(a)||(za[a]={enumerable:!1});Object.defineProperties(Bt,za);Object.assign(typeof globalThis=="object"?globalThis:self,{Parser:Bt});C=Bt});G();})();
6
+ `})}}return lt(t,e),t}}}),bl={};Z(bl,{ParamTagToken:()=>De});var Mr,Os,zr,De,wl=_({"src/paramTag/index.ts"(){"use strict";U(),ae(),us(),Hn(),M(),B(),Ne(),Mr=[ds],De=class extends(zr=E){get type(){return"ext-inner"}constructor(e,t,s=L.getConfig(),r=[],l){if(super(void 0,s,r,{}),t){const n=ce;this.append(...t.split(`
7
+ `).map(i=>l?i:Rt(i,s,r,e)).map(i=>new n(i,"param-line",s,r,{})))}r.splice(r.indexOf(this),1),r.push(this)}lint(e=this.getAbsoluteIndex()){const t="no-ignored",s=L.lintConfig.getSeverity(t,this.name);if(!s)return[];const r=new ie(this,e),l=L.msg("invalid parameter of <$1>",this.name),n=[];for(const i of this.childNodes){i.setAttribute("aIndex",e);const o=i.childNodes.filter(({type:a})=>a!=="comment"&&a!=="include"&&a!=="noinclude");if(o.some(({type:a})=>a==="ext"))n.push(O(i,r,t,l,s));else{const a=o.findIndex(({type:d})=>d!=="text"),h=o.slice(0,a===-1?void 0:a).map(String).join("");if(h&&!(a===-1?/^[a-z]+(?:\[\])?\s*=/iu:/^[a-z]+(?:\[\])?\s*(?:=|$)/iu).test(h)){const d=O(i,r,t,l,s);d.suggestions=[{desc:"remove",range:[d.startIndex,d.endIndex],text:""}],n.push(d)}else{const d=i.lint(e,!1);d.length>0&&n.push(...d)}}e+=i.toString().length+1}return n}},Os=se(zr),De=re(Os,0,"ParamTagToken",Mr,De),ne(Os,1,De)}}),Dn,yl=_({"src/heading.ts"(){"use strict";var e,t,Yt,r;U(),ge(),ae(),M(),B(),it(),Dn=(r=class extends E{constructor(n,i,o,a=[]){super(void 0,o,a);C(this,t);C(this,e);N(this,e,n);const h=new E(i[0],o,a);h.type="heading-title",h.setAttribute("stage",2);const d=new We(i[1],"heading-trail",o,a);this.append(h,d)}get type(){return"heading"}get level(){return f(this,e)}toString(n){const i=j(this,t,Yt).call(this);return i+this.firstChild.toString(n)+i+this.lastChild.toString(n)}text(){const n=j(this,t,Yt).call(this);return n+this.firstChild.text()+n}getAttribute(n){return n==="invalid"?this.inHtmlAttrs()==="error":n==="padding"?this.level:super.getAttribute(n)}getGaps(){return this.level}lint(n=this.getAbsoluteIndex(),i){const o=super.lint(n,i),{firstChild:a,level:h}=this,d=a.toString(),u=d.startsWith("="),p=u||d.endsWith("="),g=a.childNodes.filter(cs("quote")),c=g.filter(({bold:w})=>w),x=g.filter(({italic:w})=>w),v=new ie(this,n),m=this.inHtmlAttrs();if(this.level===1){const w="h1",S=L.lintConfig.getSeverity(w);if(S){const T=O(a,v,w,"<h1>",S);p||(T.suggestions=[{desc:"h2",range:[T.startIndex,T.endIndex],text:`=${d}=`}]),o.push(T)}}if(p){const w="unbalanced-header",S=L.lintConfig.getSeverity(w);if(S){const T=L.msg("unbalanced $1 in a section header",'"="'),b=O(a,v,w,T,S);if(d!=="=")if(u){const[k]=/^=+/u.exec(d),$=h+k.length;b.suggestions=[{desc:`h${h}`,range:[b.startIndex,b.startIndex+k.length],text:""}],$<7&&b.suggestions.push({desc:`h${$}`,range:[b.endIndex,b.endIndex],text:k})}else{const k=/[^=](=+)$/u.exec(d)[1],$=h+k.length;b.suggestions=[{desc:`h${h}`,range:[b.endIndex-k.length,b.endIndex],text:""}],$<7&&b.suggestions.push({desc:`h${$}`,range:[b.startIndex,b.startIndex],text:k})}o.push(b)}}m&&o.push(Q(this,v,"parsing-order","section header in HTML tag attributes",m));const y="format-leakage",A=L.lintConfig.getSeverity(y,"apostrophe");if(A){const w=this.getRootNode().toString();if(c.length%2){const S=O(c[c.length-1],be(ue({},v),{start:n+h,left:v.left+h}),y,L.msg("unbalanced $1 in a section header","bold apostrophes"),A),T=n+h+d.length;w.slice(S.endIndex,T).trim()?S.suggestions=[{desc:"close",range:[T,T],text:"'''"}]:S.fix={desc:"remove",range:[S.startIndex,S.endIndex],text:""},o.push(S)}if(x.length%2){const S=O(x[x.length-1],{start:n+h},y,L.msg("unbalanced $1 in a section header","italic apostrophes"),A),T=n+h+d.length;w.slice(S.endIndex,T).trim()?S.suggestions=[{desc:"close",range:[T,T],text:"''"}]:S.fix={desc:"remove",range:[S.startIndex,S.endIndex],text:""},o.push(S)}}return o}print(){const n=j(this,t,Yt).call(this);return super.print({pre:n,sep:n})}json(n,i=this.getAbsoluteIndex()){const o=super.json(void 0,i);return o.level=this.level,o}},e=new WeakMap,t=new WeakSet,Yt=function(){return"=".repeat(this.level)},r)}}),Ur,Al,ua=_({"src/parameter.ts"(){"use strict";oe(),U(),M(),B(),Ur=new RegExp(`https?://${Ye}${Ze}$`,"iu"),Al=class extends E{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(t){return!1}}constructor(e,t,s,r=[]){super(void 0,s,r);const l=new E(typeof e=="number"?void 0:e,s,r,{}),n=new E(t,s,r);l.type="parameter-key",l.setAttribute("stage",2),n.type="parameter-value",n.setAttribute("stage",2),this.append(l,n)}trimName(e,t=!0){const s=(typeof e=="string"?e:e.toString(!0)).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");return this.setAttribute("name",s),s}afterBuild(){if(!this.anon){const{parentNode:e,firstChild:t}=this,s=this.trimName(t);e&&e.getArgs(s,!1,!1).add(this)}super.afterBuild()}toString(e){return this.anon?this.lastChild.toString(e):super.toString(e,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(e=this.getAbsoluteIndex(),t){var n;const s=super.lint(e,t),r="unescaped",l=L.lintConfig.getSeverity(r);if(l){const{firstChild:i}=this,o=(n=Ur.exec(i.text()))==null?void 0:n[0];try{if(o&&new URL(o).search){const a="unescaped query string in an anonymous parameter",h=O(i,{start:e},r,a,l);h.startIndex=h.endIndex,h.startLine=h.endLine,h.startCol=h.endCol,h.endIndex++,h.endCol++,h.fix={desc:"escape",range:[h.startIndex,h.endIndex],text:"{{=}}"},s.push(h)}}catch(a){}}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}}}}),Hr,Bs,Dr,Ge,ca=_({"src/transclude.ts"(){"use strict";var e,t,s,r,l,n,Zt,Sl,a;oe(),U(),ge(),ae(),ls(),B(),ua(),Ne(),it(),Hr=[Pt()],Ge=(a=class extends(Dr=E){constructor(d,u,p,g=[]){var I,H;let c;const x=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(d);x&&(c=Number(x[1]),d=d.replace(`\0${c}h`,g[c].toString().replace(/^\n/u,"")));super(void 0,p,g,{});C(this,n);Ae(this,"modifier","");C(this,e,"template");C(this,t,":");C(this,s,!1);C(this,r,new Map);C(this,l);const{parserFunction:[v,m],variable:y,functionHook:A}=p,w=(I=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(d))==null?void 0:I[0];if(w)this.setAttribute("modifier",w),d=d.slice(w.length);else if(d.includes(":")){const[R,...P]=d.split(":"),[D]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((H=P[0])!=null?H:"");this.setModifier(`${R}:${D}`)&&(d=P.join(":").slice(D.length))}const S=d.search(/[::]/u),T=d[S]===":",b=S!==-1;if(b||u.length===0&&!f(this,s)){const R=b?d.slice(0,S):d,P=b&&d.slice(S+1),D=me(R),V=b?D.slice(D.search(/\S/u))+(T?":":""):D.trim(),K=V.toLowerCase(),z=Array.isArray(m),F=z?m.includes(V):Object.prototype.hasOwnProperty.call(m,V),q=!z&&F?m[V]:Object.prototype.hasOwnProperty.call(v,K)&&v[K],G=z&&F||!("functionHook"in p)||A.includes(q),W=z&&F||y.includes(q);if(b?q&&G:W){this.setAttribute("name",q||K.replace(/^#|:$/u,"")),N(this,e,"magic-word"),T&&N(this,t,":");const J=new We(R,"magic-word-name",p,g);if(super.insertAt(J),P!==!1&&u.unshift([P]),this.name==="invoke")for(let Y=0;Y<2;Y++){const le=u.shift();if(!le)break;const ee=new ce(le.join("="),`invoke-${Y?"function":"module"}`,p,g);super.insertAt(ee)}}}if(this.type==="template"){const R=me(d).trim();if(!this.normalizeTitle(R,10,{halfParsed:!0,temporary:!0}).valid)throw g.pop(),new SyntaxError("Invalid template name");const P=new ce(d,"template-name",p,g,{});super.insertAt(P)}typeof c=="number"&&(g[c]=void 0);const k=this.isTemplate();let $=1;for(let R=0;R<u.length;R++){const P=u[R];k||this.name==="switch"&&R>0||this.name==="tag"&&R>1||(P[0]=P.join("="),P.length=1),P.length===1&&(P.unshift($),$++),this.insertAt(new Al(...P,p,g))}this.seal("modifier")}get type(){return f(this,e)}get module(){}get function(){}setModifier(d){const{parserFunction:[,,u,p]}=this.getAttribute("config"),g=me(d).trim();if(d&&!g.endsWith(":"))return!1;const c=g.slice(0,-1).toLowerCase(),x=u.includes(c),v=p.includes(c);return f(this,s)&&x||!f(this,s)&&(v||!d)||(ve.running||this.length>1)&&(x||v||!d)?(this.setAttribute("modifier",d),N(this,s,x),!!d):!1}isTemplate(){return this.type==="template"||this.name==="invoke"}afterBuild(){this.modifier.includes("\0")&&this.setAttribute("modifier",this.buildFromStr(this.modifier,0)),super.afterBuild(),this.isTemplate()&&this.type==="template"&&(N(this,l,j(this,n,Zt).call(this)),this.setAttribute("name",f(this,l).title))}toString(d){return`{{${this.modifier}${this.type==="magic-word"?this.firstChild.toString(d)+(this.length===1?"":f(this,t))+this.childNodes.slice(1).map(u=>u.toString(d)).join("|"):super.toString(d,"|")}}}`}text(){const{childNodes:d,length:u,firstChild:p,modifier:g,type:c,name:x}=this;return c==="magic-word"&&x==="vardefine"?"":`{{${g}${c==="magic-word"?p.text()+(u===1?"":f(this,t))+Oe(d.slice(1),"|"):super.text("|")}}}`}getAttribute(d){switch(d){case"padding":return this.modifier.length+2;case"title":return f(this,l);case"colon":return f(this,t);case"invalid":return this.type==="magic-word"&&this.name==="invoke"&&(this.length===2||!j(this,n,Zt).call(this).valid);default:return super.getAttribute(d)}}lint(d=this.getAbsoluteIndex(),u){const p=super.lint(d,u);if(!this.isTemplate())return p;const{type:g,childNodes:c,length:x}=this,v=new ie(this,d),m=g==="magic-word";if(m&&!j(this,n,Zt).call(this).valid)p.push(O(c[1],v,"invalid-invoke","illegal module name"));else{const A=c[m?1:0],w=A.childNodes.findIndex(T=>T.type==="text"&&Lt(T.data).includes("#")),S=A.childNodes[w];if(S){const T=O(A,v,"no-ignored","useless fragment","warning");T.fix={desc:"remove",range:[T.startIndex+A.getRelativeIndex(w)+S.data.indexOf("#"),T.endIndex],text:""},p.push(T)}}if(m&&x===2)return p.push(Q(this,v,"invalid-invoke","missing module function")),p;const y=this.getDuplicatedArgs().filter(([,A])=>!A[0].querySelector("ext"));if(y.length>0)for(const[,A]of y)p.push(...A.map(w=>{const S=O(w,v,"no-duplicate","duplicated parameter");return S.suggestions=[{desc:"remove",range:[S.startIndex-1,S.endIndex],text:""}],S}));return p}insertAt(d,u=this.length){return super.insertAt(d,u),d.anon?j(this,n,Sl).call(this,d):d.name&&this.getArgs(d.name,!1,!1).add(d),d}getAllArgs(){return this.childNodes.filter(cs("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:d})=>d)}getArgs(d,u,p=!0){const g=String(d).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");let c;return f(this,r).has(g)?c=f(this,r).get(g):(c=new Set(this.getAllArgs().filter(({name:x})=>g===x)),f(this,r).set(g,c)),c}getDuplicatedArgs(){return[...f(this,r)].filter(([,{size:d}])=>d>1).map(([d,u])=>[d,[...u]])}getPossibleValues(){const{type:d,name:u,childNodes:p}=this;if(d==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let g,c;switch(u){case"if":case"ifexist":case"ifexpr":case"iferror":g=2;break;case"ifeq":g=3;break;case"switch":{const x=p.slice(2),v=x[x.length-1];c=[...x.filter(({anon:m})=>!m),...v!=null&&v.anon?[v]:[]].map(({lastChild:m})=>m);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}c!=null||(c=p.slice(g,g+2).map(({lastChild:x})=>x));for(let x=0;x<c.length;){const{length:v,0:m}=c[x].childNodes.filter(y=>y.text().trim());if(v===0)c.splice(x,1);else if(v>1||m.type!=="magic-word")x++;else try{const y=m.getPossibleValues();c.splice(x,1,...y),x+=y.length}catch(y){x++}}return c}print(){const{childNodes:d,length:u,firstChild:p,modifier:g,type:c}=this;return`<span class="wpb-${c}${this.getAttribute("invalid")?" wpb-invalid":""}">{{${c==="magic-word"?Ft(g)+p.print()+(u===1?"":f(this,t))+tt(d.slice(1),{sep:"|"}):(g?`<span class="wpb-magic-word">${Ft(g)}</span>`:"")+tt(d,{sep:"|"})}}}</span>`}},e=new WeakMap,t=new WeakMap,s=new WeakMap,r=new WeakMap,l=new WeakMap,n=new WeakSet,Zt=function(){const d=this.type==="template";return this.normalizeTitle(this.childNodes[d?0:1].text(),d?10:828,{temporary:!0})},Sl=function(d){const u=this.getAnonArgs(),p=typeof d!="number";for(let g=p?u.indexOf(d):d-1;g<u.length;g++){const c=u[g],{name:x}=c,v=String(g+1);(x!==v||c===d)&&(c.setAttribute("name",v),this.getArgs(v,!1,!1).add(c))}},a),Bs=se(Dr),Ge=re(Bs,0,"TranscludeToken",Hr,Ge),ne(Bs,1,Ge)}}),Gr,qs,Vr,bt,ga=_({"src/hidden.ts"(){"use strict";rt(),B(),Gr=[qe()],bt=class extends(Vr=E){get type(){return"hidden"}getAttribute(e){return e==="invalid"||super.getAttribute(e)}},qs=se(Vr),bt=re(qs,0,"HiddenToken",Gr,bt),ne(qs,1,bt)}}),Qr,Ws,Jr,wt,pa=_({"src/arg.ts"(){"use strict";var e,fa,s;oe(),U(),ae(),Ce(),ls(),B(),Ne(),ga(),Qr=[ke("{{{"),Pt()],wt=(s=class extends(Jr=E){constructor(l,n,i=[]){super(void 0,n,i,{});C(this,e);for(let o=0;o<l.length;o++){const a=l[o];if(o===0){const h=new ce(a,"arg-name",n,i,{});super.insertAt(h)}else if(o>1){const h=new bt(a,n,i);super.insertAt(h)}else{const h=new E(a,n,i);h.type="arg-default",h.setAttribute("stage",2),super.insertAt(h)}}}get type(){return"arg"}get default(){var l,n;return(n=(l=this.childNodes[1])==null?void 0:l.text())!=null?n:!1}toString(l){return`{{{${super.toString(l,"|")}}}}`}text(){return`{{{${Oe(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){super.afterBuild()}lint(l=this.getAbsoluteIndex(),n){const{childNodes:[i,o,...a]}=this;i.setAttribute("aIndex",l+3);const h=i.lint(l+3,n);if(o){const d=l+4+i.toString().length;o.setAttribute("aIndex",d);const u=o.lint(d,n);u.length>0&&h.push(...u)}if(a.length>0){const d=new ie(this,l);h.push(...a.map(u=>{const p=O(u,d,"no-ignored","invisible content inside triple braces");return p.startIndex--,p.startCol--,p.suggestions=[{desc:"remove",range:[p.startIndex,p.endIndex],text:""},{desc:"escape",range:[p.startIndex,p.startIndex+1],text:"{{!}}"}],p}))}if(!this.getAttribute("include")){const d=Q(this,{start:l},"no-arg","unexpected template argument","warning");o&&(d.suggestions=[{desc:"expand",range:[l,d.endIndex],text:o.text()}]),h.push(d)}return h}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(l,n=this.getAbsoluteIndex()){const i=super.json(void 0,n);return i.default=this.default,i}},e=new WeakSet,fa=function(){},s),Ws=se(Jr),wt=re(Ws,0,"ArgToken",Qr,wt),ne(Ws,1,wt)}}),_l={};Z(_l,{parseBraces:()=>hs});var Xr,Ms,Ht,zs,Us,Hs,Kr,Ds,hs,Gn=_({"parser/braces.ts"(){"use strict";Et(),oe(),yl(),ca(),pa(),Xr={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},Ms=String.raw`\[(?!\[)`,Ht=String.raw`\n(?![=\0])`,zs=String.raw`|\{{2,}`,Us=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),Hs=Ke(e=>new RegExp(e,"gmu")),Kr=new RegExp(String.raw`\{\{((?:[^\n{}[]|${Ms}|${Ht})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${Ht})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${Ms}|${Ht})*\}-`,"gu"),Ds=e=>{const t=et(me(e));return Us.has(t)?Us.get(t):/^(?:filepath|(?:full|canonical)urle?):./u.test(t)?"m":/^#vardefine:./u.test(t)?"n":"t"},hs=(e,t,s)=>{var c,x,v,m,y;const r=String.raw`${t.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,l]}=t,n=[],i=[],o=(A,w,S,T)=>{w[w.length-1].push(_e(A.slice(S,T),i))};let a;do a!==void 0&&(e=a),a=e.replace(Kr,(A,w,S)=>{if(w!==void 0||typeof S=="string")try{const{length:T}=s,b=(w!=null?w:S).split("|");return new Ge(_e(b[0],i),b.slice(1).map(k=>{const $=k.indexOf("=");return($===-1?[k]:[k.slice(0,$),k.slice($+1)]).map(I=>_e(I,i))}),t,s),`\0${T}${Ds(b[0])}`}catch(T){if(!(T instanceof SyntaxError)||T.message!=="Invalid template name")throw T}return i.push(_e(A,i)),`\0${i.length-1}`});while(a!==e);e=a;const h=e.lastIndexOf("}}")-e.length;let d=h+e.length!==-1,u=Hs(r+(d?zs:"")),p=u.exec(e),g;for(;p||g!==void 0&&g<=e.length&&((x=(c=n[n.length-1])==null?void 0:c[0])!=null&&x.startsWith("="));){if(p!=null&&p[1]){const[,{length:P}]=p;p[0]=p[0].slice(P),p.index+=P}const{0:A,index:w}=p!=null?p:{0:`
8
+ `,index:e.length},S=(v=n.pop())!=null?v:{},{0:T,index:b,parts:k,findEqual:$,pos:I}=S,H=A==="="&&$;if(A==="]]"||A==="}-")g=w+2;else if(A===`
9
+ `){g=w+1;const{pos:P,findEqual:D}=(m=n[n.length-1])!=null?m:{};if(P===void 0||D||me(e.slice(P,b))!==""){const V=/^(={1,6})(.+)\1((?:\s|\0\d+[cn]\x7F)*)$/u.exec(e.slice(b,w));V&&(V[2]=_e(V[2],i),V[2].includes(`
10
+ `)||(e=`${e.slice(0,b)}\0${s.length}h${e.slice(w)}`,g=b+4+String(s.length).length,new Dn(V[1].length,V.slice(2),t,s)))}}else if(A==="|"||H)g=w+1,o(e,k,I,w),A==="|"&&k.push([]),S.pos=g,S.findEqual=A==="|",n.push(S);else if(A.startsWith("}}")){const P=A.slice(0,Math.min(T.length,3)),D=T.length-P.length,{length:V}=s;g=w+P.length,o(e,k,I,w);let K=!1,z="t";if(P.length===3){const F=k.map(G=>G.join("=")),q=F.length>1&&me(F[1]).trim();new wt(F,t,s),q&&q.endsWith(":")&&l.includes(q.slice(0,-1).toLowerCase())&&(z="s")}else try{new Ge(k[0][0],k.slice(1),t,s),z=Ds(k[0][0])}catch(F){if(F instanceof SyntaxError&&F.message==="Invalid template name")K=!0;else throw F}K||(e=`${e.slice(0,b+D)}\0${V}${z}${e.slice(g)}`,g=b+D+3+String(V).length,D>1?n.push({0:T.slice(0,D),index:b,pos:b+D,parts:[[]]}):D===1&&e[b-1]==="-"&&n.push({0:"-{",index:b-1,pos:b+1,parts:[[]]}))}else g=w+A.length,A.startsWith("{")&&(p.pos=g,p.parts=[[]]),n.push(..."0"in S?[S]:[],p);let R=n[n.length-1];if(d&&h+e.length<g)for(d=!1;(y=R==null?void 0:R[0])!=null&&y.startsWith("{");)n.pop(),R=n[n.length-1];u=Hs(r+(d?zs:"")+(R?`|${Xr[R[0][0]]}${R.findEqual?"|=":""}`:"")),u.lastIndex=g,p=u.exec(e)}return _e(e,i)}}}),kl={};Z(kl,{InputboxToken:()=>$l});var $l,xa=_({"src/paramTag/inputbox.ts"(){"use strict";us(),Gn(),M(),wl(),$l=class extends De{constructor(e,t,s=L.getConfig(),r=[]){const l=Symbol("InputboxToken"),n=s.excludes.includes("heading")?s:be(ue({},s),{excludes:[...s.excludes,"heading"]}),{length:i}=r;r.push(l),t&&(t=Rt(t,n,r,e)),t&&(t=hs(t,n,r)),r.splice(i,1),super(e,t,n,r,{})}}}}),es={};Z(es,{NestedToken:()=>Tl});var Yr,Zr,Tl,Gs=_({"src/nested.ts"(){"use strict";var e,t,s;U(),ae(),us(),Gn(),M(),B(),Hl(),Fe(),Yr=new Set(["comment","include","arg","template","magic-word"]),Zr=[!1,!0].map(r=>{const l=r?"includeonly":"noinclude";return new RegExp(String.raw`^(?:<${l}(?:\s[^>]*)?/?>|</${l}\s*>)$`,"iu")}),Tl=(s=class extends E{constructor(l,n,i,o,a=[]){if(typeof n=="boolean"){const h=Symbol("InputboxToken"),{length:d}=a;a.push(h),l&&(l=Rt(l,o,a,n)),l&&(l=hs(l,o,a)),a.splice(d,1)}else l&&(l=l.replace(n,(h,d,u,p,g)=>{const c=`\0${a.length+1}e`;return new Xe(d,u,p,g,o,!1,a),c}));l&&(l=l.replace(/(^|\0\d+.\x7F)([^\0]+)(?=$|\0\d+.\x7F)/gu,(h,d,u)=>(new he(u,o,a),`${d}\0${a.length}n`)));super(l,o,a);C(this,e);C(this,t);N(this,e,[...i]),N(this,t,n)}get type(){return"ext-inner"}lint(l=this.getAbsoluteIndex(),n){const i=super.lint(l,n),o="no-ignored",a=L.lintConfig.getSeverity(o,this.name);if(!a)return i;const h=new ie(this,l),d=typeof f(this,t)=="boolean"?Zr[f(this,t)?1:0]:/^<!--[\s\S]*-->$/u;return[...i,...this.childNodes.filter(u=>{const{type:p,name:g}=u;if(p==="ext")return!f(this,e).includes(g);if(Yr.has(p))return!1;const c=u.toString().trim();return c&&!d.test(c)}).map(u=>{const p=O(u,h,o,L.msg("invalid content in <$1>",this.name),a);return p.suggestions=[{desc:"remove",range:[p.startIndex,p.endIndex],text:""},{desc:"comment",range:[p.startIndex,p.endIndex],text:`<!--${u.toString()}-->`}],p})]}},e=new WeakMap,t=new WeakMap,s)}});function ei(e,t,s,r,l){t=me(t).trim();let n=t.replace(e==="link"?/\0\d+[tq]\x7F/gu:/\0\d+t\x7F/gu,"").trim();switch(e){case"width":return!n&&!!t||/^(?:\d+x?|\d*x\d+)(?:\s*px)?$/u.test(n);case"link":{if(n){if(Il(s.protocol).test(n))return Cl(s.protocol).test(n)&&t;n.startsWith("[[")&&n.endsWith("]]")&&(n=n.slice(2,-2))}else return t;const i=L.normalizeTitle(n,0,!1,s,{halfParsed:r,decode:!0,selfLink:!0});return i.valid&&i}case"lang":return(l==="svg"||l==="svgz")&&!/[^a-z\d-]/u.test(n);case"alt":case"class":case"manualthumb":return!0;case"page":return(l==="djvu"||l==="djv"||l==="pdf")&&Number(n)>0;default:return!!n&&!isNaN(n)}}var Il,Cl,ti,si,Nl,ma=_({"src/imageParameter.ts"(){"use strict";var e,t,Ll,l;Et(),oe(),U(),M(),B(),Il=Ke(n=>new RegExp(String.raw`^(?:${n}|//|\0\d+m\x7F)`,"iu")),Cl=Ke(n=>new RegExp(String.raw`^(?:(?:${n}|//)${Ye}|\0\d+m\x7F)${Ze}$`,"iu")),ti=Ke(n=>new RegExp(String.raw`^(\s*(?!\s))${n.replace("$1","(.*)")}${n.endsWith("$1")?`(?=$|
11
+ )`:""}(\s*)$`,"u")),si=new Set(["alt","link","lang","page","caption"]),Nl=(l=class extends E{constructor(i,o,a,h){var n=(...r)=>(super(...r),C(this,t),C(this,e,""),this);let d;const u=Object.entries(a.img).map(([g,c])=>[g,c,ti(g)]),p=u.find(([,g,c])=>(d=c.exec(i),d&&(d.length!==4||ei(g,d[2],a,!0,o)!==!1)));if(p&&d){d.length===3?(n(void 0,a,h),N(this,e,i)):(n(d[2],a,h,{}),N(this,e,d[1]+p[0]+d[3])),this.setAttribute("name",p[1]);return}n(i,a.excludes.includes("list")?a:be(ue({},a),{excludes:[...a.excludes,"list"]}),h),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get type(){return"image-parameter"}get link(){return this.name==="link"?ei("link",super.text(),this.getAttribute("config")):void 0}afterBuild(){var i;(i=this.parentNode)!=null&&i.is("gallery-image")&&!si.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 a=super.lint(i,o),{link:h,name:d}=this;if(d==="invalid"){const u="invalid-gallery",p=L.lintConfig.getSeverity(u,"parameter");if(p){const g=Q(this,{start:i},u,"invalid image parameter",p);g.fix={desc:"remove",range:[i-1,g.endIndex],text:""},a.push(g)}}else if(typeof h=="object"&&h.encoded){const u="url-encoding",p=L.lintConfig.getSeverity(u,"file");if(p){const g=Q(this,{start:i},u,"unnecessary URL encoding in an internal link",p);g.suggestions=[{desc:"decode",range:[i,g.endIndex],text:Nt(this.text())}],a.push(g)}}return a}getValue(){return this.name==="invalid"?this.text():j(this,t,Ll).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">${tt(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}},e=new WeakMap,t=new WeakSet,Ll=function(){return f(this,e)&&!f(this,e).includes("$1")},l)}}),Vs,ni,ri,Qs,Js,ii,li,Xs,Vn,Fl=_({"src/link/file.ts"(){"use strict";U(),ae(),M(),is(),ma(),Vs=new Map([["manualthumb","Thumb"],["frameless","Frameless"],["framed","Frame"],["thumbnail","Thumb"]]),ni=new Set(["arg"]),ri=new Set(["template","magic-word"]),Qs=new Set(["left","right","center","none"]),Js=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),ii=new Set(["tiff","tif","png","gif","jpg","jpeg","webp","xcf","pdf","svg","djvu"]),li=e=>{if(e===void 0)return[];const t=/-\{|\}-|\|/gu,s=[];let r=t.exec(e),l=0,n=0;for(;r;){const{0:i,index:o}=r;i!=="|"?l+=i==="-{"?1:-1:l===0&&(s.push(e.slice(n,o)),{lastIndex:n}=t),r=t.exec(e)}return s.push(e.slice(n)),s},Xs=(e,t)=>e.filter(({childNodes:s})=>{const r=s.filter(l=>l.text().trim());return r.length!==1||!t.has(r[0].type)}),Vn=class extends Te{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:n}=this.getTitle(!0,!0);this.safeAppend(li(t).map(i=>new Nl(i,n,s,r)))}lint(e=this.getAbsoluteIndex(),t){var g;const s=super.lint(e,t),r=Xs(this.getAllArgs(),ni),l=[...new Set(r.map(({name:c})=>c))],n=l.filter(c=>Vs.has(c)),i=l.filter(c=>Qs.has(c)),o=l.filter(c=>Js.has(c)),[a]=n,h=a==="framed"||a==="manualthumb",d=new ie(this,e);if(this.closest("ext-link-text")&&((g=this.getValue("link"))==null?void 0:g.trim())!==""&&s.push(Q(this,d,"nested-link","internal link in an external link")),h)for(const c of r.filter(({name:x})=>x==="width")){const x=O(c,d,"invalid-gallery","invalid image parameter");x.fix={desc:"remove",range:[x.startIndex-1,x.endIndex],text:""},s.push(x)}if(r.length===l.length&&n.length<2&&i.length<2&&o.length<2)return s;const u=(c,x,v=!0)=>m=>{const y=typeof v=="function"?v(m):v,A=O(m,d,"no-duplicate",L.msg(`${c} image $1 parameter`,x),y?"error":"warning");return A.suggestions=[{desc:"remove",range:[A.startIndex-1,A.endIndex],text:""}],A},{extension:p}=this;for(const c of l){if(c==="invalid"||c==="width"&&h)continue;const x=c==="caption";let v=r.filter(({name:m})=>m===c);if(x&&(v=[...v.slice(0,-1).filter(m=>m.text()),...v.slice(-1)]),v.length>1){let m=!x||!p||ii.has(p);if(x&&m){const y=Xs(v,ri);m=y.length>1&&(A=>y.includes(A))}s.push(...v.map(u("duplicated",c,m)))}}return n.length>1&&s.push(...r.filter(({name:c})=>Vs.has(c)).map(u("conflicting","frame"))),i.length>1&&s.push(...r.filter(({name:c})=>Qs.has(c)).map(u("conflicting","horizontal-alignment"))),o.length>1&&s.push(...r.filter(({name:c})=>Js.has(c)).map(u("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}}}}),oi,Ks,ai,Ve,jl=_({"src/link/galleryImage.ts"(){"use strict";var e,Cn,s;U(),Be(),Ce(),M(),B(),Fl(),oi=[ke("")],Ve=(s=class extends(ai=Vn){constructor(l,n,i,o,a=[]){let h;if(i!==void 0){const{length:d}=a;h=new E(i,o,a);for(let u=1;u<xe;u++)h.parseOnce();a.splice(d,1)}super(n,h==null?void 0:h.toString(),o,a);C(this,e);Ae(this,"privateType","imagemap-image");this.setAttribute("bracket",!1),this.privateType=`${l}-image`,this.seal("privateType",!0)}get type(){return this.privateType}getTitle(l){const n=this.type==="imagemap-image";return this.normalizeTitle(this.firstChild.toString(),n?0:6,{halfParsed:!0,temporary:l,decode:!n})}lint(l=this.getAbsoluteIndex(),n){const i=super.lint(l,n),o="invalid-gallery",a=L.lintConfig.getSeverity(o,"image");if(a&&j(this,e,Cn).call(this)){const h=Q(this,{start:l},o,"invalid gallery image",a);h.suggestions=[{desc:"prefix",range:[l,l],text:"File:"}],i.push(h)}return i}getAttribute(l){return l==="invalid"?j(this,e,Cn).call(this):super.getAttribute(l)}},e=new WeakSet,Cn=function(){const{ns:l}=this.getAttribute("title");return l!==6},s),Ks=se(ai),Ve=re(Ks,0,"GalleryImageToken",oi,Ve),ne(Ks,1,Ve)}}),El={};Z(El,{GalleryToken:()=>yt});var di,Ys,hi,yt,va=_({"src/gallery.ts"(){"use strict";var e,Pl,Nn,r;Hn(),M(),B(),jl(),Fe(),di=[ds],yt=(r=class extends(hi=E){constructor(n,i,o=[]){var a;super(void 0,i,o,{});C(this,e);for(const h of(a=n==null?void 0:n.split(`
12
+ `))!=null?a:[]){const d=/^([^|]+)(?:\|(.*))?/u.exec(h);if(!d){super.insertAt(h.trim()?new he(h,i,o):h);continue}const[,u,p]=d;j(this,e,Pl).call(this,u)?super.insertAt(new Ve("gallery",u,p,i,o)):super.insertAt(new he(h,i,o))}}get type(){return"ext-inner"}get widths(){return j(this,e,Nn).call(this,"widths")}get heights(){return j(this,e,Nn).call(this,"heights")}lint(n=this.getAbsoluteIndex(),i){const{top:o,left:a}=this.getRootNode().posFromIndex(n),h=[];for(let d=0;d<this.length;d++){const u=this.childNodes[d],p=u.toString(),{length:g}=p,c=p.trim(),{type:x}=u,v=o+d,m=d?0:a;if(u.setAttribute("aIndex",n),x==="noinclude"&&c&&!/^<!--.*-->$/u.test(c)){const y=n+g;h.push({rule:"no-ignored",message:L.msg("invalid content in <$1>","gallery"),severity:c.endsWith("-->")||/^(?:\||<!--)/u.test(c)?"warning":"error",startIndex:n,endIndex:y,startLine:v,endLine:v,startCol:m,endCol:m+g,suggestions:[{desc:"remove",range:[n,y],text:""},{desc:"comment",range:[n,y],text:`<!--${p}-->`}]})}else if(x!=="noinclude"&&x!=="text"){const y=u.lint(n,i);y.length>0&&h.push(...y)}n+=g+1}return h}json(n,i=this.getAbsoluteIndex()){const o=super.json(void 0,i);return Object.assign(o,{widths:this.widths,heights:this.heights}),o}},e=new WeakSet,Pl=function(n){return this.normalizeTitle(n,6,{halfParsed:!0,temporary:!0,decode:!0}).valid},Nn=function(n){var a,h;const i=(a=this.parentNode)==null?void 0:a.getAttr(n),o=typeof i=="string"&&((h=/^(\d+)\s*(?:px)?$/u.exec(i))==null?void 0:h[1]);return o&&Number(o)||120},r),Ys=se(hi),yt=re(Ys,0,"GalleryToken",di,yt),ne(Ys,1,yt)}}),Qn,Rl=_({"src/link/index.ts"(){"use strict";U(),M(),is(),Qn=class extends Te{get type(){return"link"}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),r="nested-link",l=L.lintConfig.getSeverity(r);return l&&this.closest("ext-link-text")&&s.push(Q(this,{start:e},r,"internal link in an external link",l)),s}}}}),ui,ci,jt,Jn=_({"src/magicLink.ts"(){"use strict";var e,t,Ln,r;U(),oe(),ae(),M(),B(),ui=String.raw`(?:[${Ie}\t]|&nbsp;|&#0*160;|&#[xX]0*[aA]0;)`,ci=new RegExp(`${ui}+`,"gu"),jt=(r=class extends E{constructor(n,i="free-ext-link",o=L.getConfig(),a){super(n,o,a,{});C(this,t);C(this,e);N(this,e,i)}get type(){return f(this,e)}get innerText(){const n=new Map([["!","|"],["=","="]]);let i=Oe(this.childNodes.map(o=>{const{type:a}=o,h=String(o.name);return a==="magic-word"&&n.has(h)?n.get(h):o}));return this.type==="magic-link"&&(i=i.replace(ci," ")),i}get link(){const{innerText:n}=this;return this.type==="magic-link"?n.startsWith("ISBN")?`ISBN ${n.slice(5).replace(/[- ]/gu,"").replace(/x$/u,"X")}`:n:sl(n).replace(/\n/gu,"%0A")}lint(n=this.getAbsoluteIndex(),i){const o=super.lint(n,i),a=new ie(this,n),{type:h,childNodes:d}=this;if(h==="magic-link")return j(this,t,Ln).call(this)&&o.push(Q(this,a,"invalid-isbn","invalid ISBN")),o;const u=h==="ext-link-url",p=u?/\|/u:/[,;。:!?()]+/u,g=d.find(c=>c.type==="text"&&p.test(c.data));if(g){const{data:c}=g,x=O(g,a,"unterminated-url",L.msg("$1 in URL",u?'"|"':"full-width punctuation"),"warning"),{index:v,0:m}=p.exec(c),y=x.startIndex+v;x.suggestions=u?[{desc:"whitespace",range:[y,y+1],text:" "}]:[{desc:"whitespace",range:[y,y],text:" "},{desc:"escape",range:[y,y+m.length],text:encodeURI(m)}],o.push(x)}return o}getUrl(n){this.lspError("MagicLinkToken.getUrl")}getAttribute(n){return n==="invalid"?j(this,t,Ln).call(this):super.getAttribute(n)}},e=new WeakMap,t=new WeakSet,Ln=function(){if(this.type==="magic-link"){const{link:n}=this;if(n.startsWith("ISBN")){const i=[...n.slice(5)].map(o=>o==="X"?10:Number(o));return i.length===10?i.reduce((o,a,h)=>o+a*(10-h),0)%11!==0:i.length===13&&(i[12]===10||i.reduce((o,a,h)=>o+a*(h%2?3:1),0)%10!==0)}}return!1},r)}}),gi,Zs,pi,Qe,Ol=_({"src/extLink.ts"(){"use strict";var e,t;Be(),U(),Ce(),M(),B(),Jn(),gi=[ke("[")],Qe=(t=class extends(pi=E){constructor(r,l="",n="",i,o=[]){super(void 0,i,o,{});C(this,e);const a=r&&/^\0\d+f\x7F$/u.test(r)?o[Number(r.slice(1,-2))]:new jt(r,"ext-link-url",i,o);if(this.insertAt(a),N(this,e,l),n){const h=new E(n,i,o,{});h.type="ext-link-text",h.setAttribute("stage",xe-1),this.insertAt(h)}}get type(){return"ext-link"}toString(r){return this.length===1?`[${super.toString(r)}${f(this,e)}]`:`[${super.toString(r,f(this,e))}]`}text(){return`[${super.text(" ")}]`}getGaps(){return f(this,e).length}lint(r=this.getAbsoluteIndex(),l){const n=super.lint(r,l),i="var-anchor",o=L.lintConfig.getSeverity(i,"extLink");return o&&this.length===1&&this.closest("heading-title")&&n.push(Q(this,{start:r},i,"variable anchor in a section header",o)),n}print(){return super.print(this.length===1?{pre:"[",post:`${f(this,e)}]`}:{pre:"[",sep:f(this,e),post:"]"})}},e=new WeakMap,t),Zs=se(pi),Qe=re(Zs,0,"ExtLinkToken",gi,Qe),ne(Zs,1,Qe)}}),Fn,ba=_({"src/imagemapLink.ts"(){"use strict";B(),Fe(),Rl(),Ol(),Fn=class extends E{get type(){return"imagemap-link"}constructor(e,t,s,r,l=[]){super(void 0,r,l),this.append(e,t.length===2?new Qn(...t,r,l):new Qe(...t,r,l),new he(s,r,l))}}}}),Bl={};Z(Bl,{ImagemapToken:()=>At});var fi,en,xi,At,wa=_({"src/imagemap.ts"(){"use strict";U(),ge(),ae(),Hn(),M(),B(),Fe(),jl(),ba(),fi=[ds],At=class extends(xi=E){get type(){return"ext-inner"}get image(){return this.childNodes.find(cs("imagemap-image"))}constructor(e,t=L.getConfig(),s=[]){if(super(void 0,t,s,{}),!e)return;const r=e.split(`
13
+ `),l=new Set(t.protocol.split("|")),n=he;let i=!0,o=!1;for(const a of r){const h=a.trim();if(!(o||!h||h.startsWith("#"))){if(i){const d=a.indexOf("|"),u=d===-1?a:a.slice(0,d),{valid:p,ns:g}=this.normalizeTitle(u,0,{halfParsed:!0,temporary:!0});if(p&&g===6){const c=new Ve("imagemap",u,d===-1?void 0:a.slice(d+1),t,s);super.insertAt(c),i=!1;continue}else o=!0}else if(a.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(a);continue}else if(a.includes("[")){const d=a.indexOf("["),u=a.slice(d),p=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(u);if(p){if(this.normalizeTitle(p[1],0,{halfParsed:!0,temporary:!0,selfLink:!0}).valid){super.insertAt(new Fn(a.slice(0,d),p.slice(1),u.slice(u.indexOf("]]")+2),t,s));continue}}else if(u.startsWith("[//")||l.has(u.slice(1,u.indexOf(":")+1))||l.has(u.slice(1,u.indexOf("//")+2))){const g=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(u);if(g){super.insertAt(new Fn(a.slice(0,d),g.slice(1),u.slice(u.indexOf("]")+1),t,s));continue}}}}super.insertAt(new n(a,t,s))}}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),r=new ie(this,e),{childNodes:l,image:n}=this,i="invalid-imagemap",o=L.lintConfig.getSeverity(i,n?"link":"image");return o&&(n?s.push(...l.filter(a=>{const h=a.toString().trim();return a.is("noinclude")&&h&&!h.startsWith("#")}).map(a=>{const h=O(a,r,i,"invalid link in <imagemap>",o);return h.suggestions=[{desc:"remove",range:[h.startIndex-1,h.endIndex],text:""},{desc:"comment",range:[h.startIndex,h.startIndex],text:"# "}],h})):s.push(Q(this,r,i,"<imagemap> without an image",o))),s}getAttribute(e){return e==="invalid"?!this.image:super.getAttribute(e)}},en=se(xi),At=re(en,0,"ImagemapToken",fi,At),ne(en,1,At)}}),mi,tn,vi,Je,ql=_({"src/nowiki/comment.ts"(){"use strict";U(),rt(),Ce(),M(),Me(),mi=[qe(!1),ke("<!--")],Je=class extends(vi=Le){constructor(t,s,r,l){super(t,r,l);Ae(this,"closed");this.closed=s}get type(){return"comment"}lint(t=this.getAbsoluteIndex()){if(this.closed)return[];const s="unclosed-comment",r=L.lintConfig.getSeverity(s);if(!r)return[];const l=Q(this,{start:t},s,L.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;":""})}},tn=se(vi),Je=re(tn,0,"CommentToken",mi,Je),ne(tn,1,Je)}}),Wl={};Z(Wl,{CommentedToken:()=>Ml});var Ml,ya=_({"src/commented.ts"(){"use strict";B(),ql(),Ml=class extends E{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),n=0;for(;l!==!1&&l!==-1;)r>n&&this.insertAt(e.slice(n,r)),this.insertAt(new Je(e.slice(r+4,l),!0,t,s)),n=l+3,r=e.indexOf("<!--",n),l=r!==-1&&e.indexOf("-->",r+4);n<e.length&&this.insertAt(e.slice(n))}}lint(e=this.getAbsoluteIndex()){return super.lint(e,/<\s*(?:\/\s*)?(hiero)\b/giu)}}}}),zl={};Z(zl,{NowikiToken:()=>Ul});var bi,wi,Ul,Aa=_({"src/nowiki/index.ts"(){"use strict";var e,jn,s;Et(),U(),M(),Me(),bi=Ke(r=>new RegExp(String.raw`<\s*(?:/\s*)${r==="nowiki"?"":"?"}(${r})\b`,"giu")),wi=new Set(["templatestyles","section","languages"]),Ul=(s=class extends Le{constructor(){super(...arguments);C(this,e)}get type(){return"ext-inner"}lint(l=this.getAbsoluteIndex()){const{name:n}=this,i="void-ext",o=L.lintConfig.getSeverity(i,n);if(o&&j(this,e,jn).call(this)){const a=Q(this,{start:l},i,L.msg("nothing should be in <$1>",n),o);return a.fix={desc:"empty",range:[l,a.endIndex],text:""},[a]}return super.lint(l,bi(n))}getAttribute(l){return l==="invalid"?j(this,e,jn).call(this):super.getAttribute(l)}},e=new WeakSet,jn=function(){const{name:l,firstChild:{data:n}}=this;return wi.has(l)&&!!n},s)}}),yi,sn,Ai,Xe,Hl=_({"src/tagPair/ext.ts"(){"use strict";U(),ae(),M(),zn(),B(),Mn(),Un(),yi=[os()],Xe=class extends(Ai=Pe){get type(){return"ext"}constructor(e,t,s,r,l=L.getConfig(),n=!1,i=[]){const o=e.toLowerCase(),a=new as(!t||/^\s/u.test(t)?t:` ${t}`,"ext-attrs",o,l,i),h=be(ue({},l),{ext:l.ext.filter(u=>u!==o),excludes:[...l.excludes]});let d;switch(h.inExt=!0,o){case"tab":h.ext=h.ext.filter(u=>u!=="tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":case"langconvert":case"phonos":o==="poem"&&h.excludes.push("heading"),d=new E(s,h,i);break;case"pre":{const{PreToken:u}=(ha(),X(ml));d=new u(s,h,i);break}case"dynamicpagelist":{const{ParamTagToken:u}=(wl(),X(bl));d=new u(n,s,h,i);break}case"inputbox":{const{InputboxToken:u}=(xa(),X(kl));d=new u(n,s,h,i);break}case"references":{const{NestedToken:u}=(Gs(),X(es));h.excludes.push("heading"),d=new u(s,n,["ref"],h,i);break}case"choose":{const{NestedToken:u}=(Gs(),X(es));d=new u(s,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],h,i);break}case"combobox":{const{NestedToken:u}=(Gs(),X(es));d=new u(s,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],h,i);break}case"gallery":{const{GalleryToken:u}=(va(),X(El));d=new u(s,h,i);break}case"imagemap":{const{ImagemapToken:u}=(wa(),X(Bl));d=new u(s,h,i);break}case"hiero":{const{CommentedToken:u}=(ya(),X(Wl));d=new u(s,h,i);break}default:{const{NowikiToken:u}=(Aa(),X(zl));d=new u(s,h,i)}}d.setAttribute("name",o),d.type==="plain"&&(d.type="ext-inner"),super(e,a,d,r,l,i),this.seal("closed",!0)}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),r=new ie(this,e);if(this.name!=="nowiki"){const i=this.inHtmlAttrs();i&&s.push(Q(this,r,"parsing-order","extension tag in HTML tag attributes",i))}const l="var-anchor",n=L.lintConfig.getSeverity(l,"ref");return n&&this.name==="ref"&&this.closest("heading-title")&&s.push(Q(this,r,l,"variable anchor in a section header",n)),s}},sn=se(Ai),Xe=re(sn,0,"ExtToken",yi,Xe),ne(sn,1,Xe)}}),Dl={};Z(Dl,{parseCommentAndExt:()=>Rt});var nn,Si,Dt,_i,rn,Rt,us=_({"parser/commentAndExt.ts"(){"use strict";Et(),oe(),ia(),Fe(),la(),oa(),Hl(),ql(),nn="<onlyinclude>",Si="</onlyinclude>",{length:Dt}=nn,_i=[!1,!0].map(e=>{const t=e?"includeonly":"(?:no|only)include",s=e?"noinclude":"includeonly";return el(r=>new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${t}(?:\s[^>]*)?/?>|</${t}\s*>|<(${r.join("|")})(\s[^>]*?)?(?:/>|>([\s\S]*?)</(\1\s*)>)|<(${s})(\s[^>]*?)?(?:/>|>([\s\S]*?)(?:</(${s}\s*)>|$))`,"giu"))}),rn=e=>{const t=e.indexOf(nn);return{i:t,j:e.indexOf(Si,t+Dt)}},Rt=(e,t,s,r)=>{if(r){let{i:o,j:a}=rn(e);if(o!==-1&&a!==-1){let h="";const d=u=>{new he(u,t,s),h+=`\0${s.length-1}n`};for(;o!==-1&&a!==-1;){const u=`\0${s.length}e`;new mt(e.slice(o+Dt,a),t,s),o>0&&d(e.slice(0,o)),h+=u,e=e.slice(a+Dt+1),{i:o,j:a}=rn(e)}return e&&d(e),h}}const{ext:l}=t,n=l.filter(o=>o!=="translate"&&o!=="tvar"),i=be(ue({},t),{ext:n});if(l.includes("translate")){const o=[];e=e.replace(/<nowiki>[\s\S]*?<\/nowiki>/giu,a=>(o.push(a),`\0${o.length-1}`)).replace(/<translate( nowrap)?>([\s\S]+?)?<\/translate>/gu,(a,h,d)=>{const u=s.length;return new ul(h,d&&_e(d,o),i,s),`\0${u}g`}),e=_e(e,o)}return e.replace(_i[r?1:0](n),(o,a,h,d,u,p,g,c,x)=>{const v=s.length;let m="n";if(a)m="e",new Xe(a,h,d,u,i,p,s);else if(o.startsWith("<!--")){m="c";const y=o.endsWith("-->");new Je(o.slice(4,y?-3:void 0),y,t,s)}else p?new vt(p,g,c,x,t,s):new he(o,t,s);return`\0${v}${m}`})}}}),ki,$i,Ti,Ii,ln,Ci,St,Sa=_({"src/html.ts"(){"use strict";var e,t,s,r,l;U(),ge(),ae(),zn(),B(),M(),ki=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),$i=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"]),Ti=new Set(["strike","big","center","font","tt"]),Ii=[os()],St=(l=class extends(Ci=E){constructor(i,o,a,h,d,u){super(void 0,d,u);C(this,e);C(this,t);C(this,s);C(this,r);this.insertAt(o),this.setAttribute("name",i.toLowerCase()),N(this,e,a),N(this,t,h),N(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 a=super.lint(i,o),{name:h,parentNode:d,closing:u,selfClosing:p}=this,g=new ie(this,i),c=this.inTableAttrs();if(h==="h1"&&!u){const w=Q(this,g,"h1","<h1>");w.suggestions=[{desc:"h2",range:[i+2,i+3],text:"2"}],a.push(w)}if(c){const w=Q(this,g,"parsing-order","HTML tag in table attributes",c);c==="error"&&(w.fix={desc:"remove",range:[i,w.endIndex],text:""}),a.push(w)}Ti.has(h)&&a.push(Q(this,g,"obsolete-tag","obsolete HTML tag","warning")),(h==="b"||h==="strong")&&this.closest("heading-title")&&a.push(Q(this,g,"bold-header","bold in section header","warning"));const{html:[,x,v]}=this.getAttribute("config"),m=v.includes(h),y=x.includes(h);if(u&&(p||m)||p&&(!m&&!y)){const w=Q(this,g,"unmatched-tag",u?"tag that is both closing and self-closing":"invalid self-closing tag"),S={desc:"open",range:[i+1,i+2],text:""},T={desc:"no self-closing",range:[w.endIndex-2,w.endIndex-1],text:""};y?w.suggestions=[S,T]:u?w.fix=m?S:T:w.suggestions=[T,{desc:"close",range:[w.endIndex-2,w.endIndex],text:`></${h}>`}],a.push(w)}else if(!this.findMatchingTag()){const w=Q(this,g,"unmatched-tag",u?"unmatched closing tag":"unclosed tag");if(u){const S=this.closest("magic-word");S&&ki.has(S.name)?w.severity="warning":w.suggestions=[{desc:"remove",range:[i,w.endIndex],text:""}]}else{const S=d==null?void 0:d.childNodes;$i.has(h)&&(S!=null&&S.slice(0,S.indexOf(this)).some(({type:T,name:b})=>T==="html"&&b===h))?w.suggestions=[{desc:"close",range:[i+1,i+1],text:"/"}]:this.closest("heading-title")||(w.severity="warning")}a.push(w)}return a}findMatchingTag(){return Re(f(this,r),()=>{const{name:i,parentNode:o,closing:a,selfClosing:h}=this,{html:[,d,u]}=this.getAttribute("config"),p=u.includes(i),g=d.includes(i);if(p||g&&h)return this;if(!o)return;const{childNodes:c}=o,x=c.indexOf(this),v=a?c.slice(0,x).reverse():c.slice(x+1),m=[this],{rev:y}=ve;for(const A of v)if(!(!A.is("html")||A.name!==i||g&&f(A,t)))if(f(A,e)===a)m.push(A);else{const w=m.pop();if(w===this)return A;L.viewOnly&&(N(w,r,[y,A]),N(A,r,[y,w]))}if(L.viewOnly)for(const A of m)N(A,r,[y,void 0])},i=>{N(this,r,i),i[1]&&i[1]!==this&&N(i[1],r,[ve.rev,this])})}print(){return super.print({pre:`&lt;${this.closing?"/":""}${f(this,s)}`,post:`${f(this,t)?"/":""}&gt;`})}json(i,o=this.getAbsoluteIndex()){const a=super.json(void 0,o);return Object.assign(a,{closing:this.closing,selfClosing:f(this,t)}),a}},e=new WeakMap,t=new WeakMap,s=new WeakMap,r=new WeakMap,l),ln=se(Ci),St=re(ln,0,"HtmlToken",Ii,St),ne(ln,1,St)}}),Gl={};Z(Gl,{parseHtml:()=>Vl});var Ni,Vl,_a=_({"parser/html.ts"(){"use strict";Un(),Sa(),Ni=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,Vl=(e,t,s)=>{var i;const{html:r}=t;(i=t.htmlElements)!=null||(t.htmlElements=new Set([...r[0],...r[1],...r[2]]));const l=e.split("<");let n=l.shift();for(const o of l){const a=Ni.exec(o),h=a==null?void 0:a[2],d=h==null?void 0:h.toLowerCase();if(!a||!t.htmlElements.has(d)){n+=`<${o}`;continue}const[,u,,p="",g,c]=a,{length:x}=s,v=new as(p,"html-attrs",d,t,s),m=v.hasAttr("itemprop");if(d==="meta"&&!(m&&v.hasAttr("content"))||d==="link"&&!(m&&v.hasAttr("href"))){n+=`<${o}`,s.length=x;continue}n+=`\0${s.length}x${c}`,new St(h,v,u==="/",g==="/>",t,s)}return n}}}),Xn,Ql=_({"src/table/base.ts"(){"use strict";zn(),B(),it(),Un(),Xn=class extends os(1)(E){constructor(e,t,s,r,l,n=[],i){super(void 0,l,n,i),this.append(new We(t,"table-syntax",l,n),new as(r,"table-attrs",s,l,n))}}}}),Li,on,ye,Gt,ct,gt,ss,Jl=_({"src/table/td.ts"(){"use strict";U(),ae(),rl(),B(),Ql(),ss=class extends(on=Xn,Li=[Wn(!1)],on){constructor(e,t,s,r=[]){var o;let l=/\||\0\d+!\x7F/u.exec(t!=null?t:""),n=l?t.slice(0,l.index):"";/\[\[|-\{/u.test(n)&&(l=null,n=""),super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",n,s,r),ne(Gt,5,this),Se(this,ct),Se(this,ye,""),l&&([Ko(this,ye)._]=l);const i=new E(t==null?void 0:t.slice(((o=l==null?void 0:l.index)!=null?o:NaN)+de(this,ye).length),s,r);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 Ct(this,ct,gt).call(this).subtype}afterBuild(){de(this,ye).includes("\0")&&fe(this,ye,this.buildFromStr(de(this,ye),0)),super.afterBuild()}toString(e){const{childNodes:[t,s,r]}=this;return t.toString(e)+s.toString(e)+de(this,ye)+r.toString(e)}text(){const{childNodes:[e,t,s]}=this;return e.text()+t.text()+de(this,ye)+s.text()}getGaps(e){return e===1?de(this,ye).length:0}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),r=new ie(this,e+this.getRelativeIndex(this.length-1));for(const l of this.lastChild.childNodes)if(l.type==="text"){const{data:n}=l;if(n.includes("|")){const i=n.includes("||"),o=O(l,r,"pipe-like",'additional "|" in a table cell',i?"error":"warning");if(i){const a={caption:"|+",td:"|",th:"!"}[this.subtype];o.fix={desc:"newline",range:[o.startIndex,o.endIndex],text:n.replace(/\|\|/gu,`
14
+ ${a}`)}}else o.suggestions=[{desc:"escape",range:[o.startIndex,o.endIndex],text:n.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()}${de(this,ye)}${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}},Gt=se(on),ye=new WeakMap,ct=new WeakSet,gt=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,n=ue({},Ct(e=l,ct,gt).call(e));return n},gt=re(Gt,17,"#getSyntax",Li,ct,gt),On(Gt,ss)}}),Kn,Xl=_({"src/table/trBase.ts"(){"use strict";U(),Ql(),Jl(),Kn=class extends Xn{lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),r=this.childNodes.find(({type:i})=>i==="table-inter");if(!r)return s;const l=Tt(r);if(!l)return s;const n=O(r,{start:e},"fostered-content","content to be moved out from the table",l);return n.startIndex++,n.startLine++,n.startCol=0,s.push(n),s}getRowCount(){return Number(this.childNodes.some(e=>e instanceof ss&&e.isIndependent()&&!e.firstChild.text().endsWith("+")))}}}}),Fi,ji,Ei,Kl,ka=_({"src/table/index.ts"(){"use strict";U(),ge(),ae(),M(),Xl(),it(),Fi=(e,t)=>new Array(e).fill(void 0).map((s,r)=>t(r)),ji=({type:e})=>e==="tr"||e==="table-syntax",Ei=class extends Array{},Kl=class extends Kn{get type(){return"table"}get closed(){return this.lastChild.is("table-syntax")}constructor(e,t,s,r){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,e,"table",t,s,r,{})}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),r=new ie(this,e);this.closed||s.push(O(this.firstChild,r,"unclosed-table",L.msg("unclosed $1","table")));const l=this.getLayout(),{length:n}=l;if(n>1){let i=1,o=1/0,a=0;for(;a<n;a++){const h=l[a],d=h.length;if(d<i)break;d<o&&(o=d);const u=h.indexOf(h[d-1])+1;if(u>o)break;u>i&&(i=u)}if(a<n){const h=O(this.getNthRow(a),r,"table-layout","inconsistent table layout","warning");h.startIndex++,h.startLine++,h.startCol=0,s.push(h)}}return s}close(e=`
16
+ |}`,t){const s=this.getAttribute("config"),r=this.getAttribute("accum"),l=[e];ve.run(()=>{const n=new We(void 0,"table-syntax",s,r);super.insertAt(n)}),this.lastChild.safeReplaceChildren(l)}getLayout(e){const t=this.getAllRows(),{length:s}=t,r=Ei.from(Fi(s,()=>[]));for(let l=0;l<r.length;l++){const n=r[l];let i=0,o=0,a;for(const h of t[l].childNodes.slice(2))if(h.is("td")){if(h.isIndependent()&&(a=h.subtype!=="caption"),a){const d={row:l,column:i},{rowspan:u,colspan:p}=h;for(i++;n[o];)o++;for(let g=l;g<Math.min(l+u,s);g++)for(let c=o;c<o+p;c++)r[g][c]=d;o+=p}}else if(ji(h))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:n}=l;if(n==="tr"&&l.getRowCount()&&(e--,e<0))return l}}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t);return s.closed=this.closed,s}}}}),Yl,$a=_({"src/table/tr.ts"(){"use strict";Xl(),Yl=class extends Kn{get type(){return"tr"}constructor(e,t,s,r){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,e,"tr",t,s,r)}}}}),Yn,Zl=_({"src/nowiki/listBase.ts"(){"use strict";Me(),Yn=class extends Le{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}}}}),Zn,eo=_({"src/nowiki/dd.ts"(){"use strict";Zl(),Zn=class extends Yn{get type(){return"dd"}}}}),to={};Z(to,{parseTable:()=>so});var Pi,an,so,Ta=_({"parser/table.ts"(){"use strict";B(),ka(),$a(),Jl(),eo(),Pi=e=>e.lastChild.constructor!==E,an=(e,t)=>e.is("td")?t.pop():e,so=({firstChild:{data:e},type:t,name:s},r,l)=>{const n=[],i=e.split(`
17
+ `);let o=t==="root"||t==="parameter-value"||t==="ext-inner"&&s==="poem"?"":`
18
+ ${i.shift()}`,a;const h=(d,u)=>{if(!u){o+=d;return}const{lastChild:p}=u;if(Pi(u)){const g=new E(d,r,l);g.type="table-inter",g.setAttribute("stage",3),u.insertAt(g)}else p.setText(p.toString()+d)};for(const d of i){a=n.pop();const[u]=/^(?:\s|\0\d+[cno]\x7F)*/u.exec(d),p=d.slice(u.length),g=/^(:*)((?:\s|\0\d+[cn]\x7F)*)(\{\||\{(?:\0\d+[cn]\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(p);if(g){for(;a&&!a.is("td");)a=n.pop();const[,A,w,S,T]=g;A&&new Zn(A,r,l),h(`
19
+ ${u}${A&&`\0${l.length-1}d`}${w}\0${l.length}b`,a),n.push(...a?[a]:[],new Kl(S,T,r,l));continue}else if(!a){o+=`
20
+ ${d}`;continue}const c=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(p);if(!c){h(`
21
+ ${d}`,a),n.push(a);continue}const[,x,v,m,y]=c;if(x){for(;!a.is("table");)a=n.pop();a.close(`
22
+ ${u}${x}`,!0),h(y,n[n.length-1])}else if(v){a=an(a,n),a.is("tr")&&(a=n.pop());const A=new Yl(`
23
+ ${u}${v}`,y,r,l);n.push(a,A),a.insertAt(A)}else{a=an(a,n);const A=m==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu;let w=A.exec(y),S=0,T=`
24
+ ${u}${m}`;const b=k=>{const $=new ss(T,y.slice(S,w==null?void 0:w.index),r,l);return k.insertAt($),$};for(;w;)b(a),{lastIndex:S}=A,[T]=w,w=A.exec(y);n.push(a,b(a))}}return o.slice(1)}}}),no,Ia=_({"src/nowiki/hr.ts"(){"use strict";Me(),no=class extends Le{get type(){return"hr"}}}}),Ri,dn,Oi,_t,Ca=_({"src/nowiki/doubleUnderscore.ts"(){"use strict";rt(),Ce(),Me(),Ri=[qe(),ke("__")],_t=class extends(Oi=Le){get type(){return"double-underscore"}constructor(e,t,s,r){var o,a;super(e,s,r);const l=e.toLowerCase(),{doubleUnderscore:[,,n,i]}=s;this.setAttribute("name",(a=t?(o=i==null?void 0:i[e])==null?void 0:o.toLowerCase():n==null?void 0:n[l])!=null?a:l)}toString(){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}},dn=se(Oi),_t=re(dn,0,"DoubleUnderscoreToken",Ri,_t),ne(dn,1,_t)}}),ro={};Z(ro,{parseHrAndDoubleUnderscore:()=>io});var io,Na=_({"parser/hrAndDoubleUnderscore.ts"(){"use strict";Ia(),Ca(),yl(),io=({firstChild:{data:e},type:t,name:s},r,l)=>{var a,h,d;const{doubleUnderscore:[n,i,o]}=r;return(a=r.insensitiveDoubleUnderscore)!=null||(r.insensitiveDoubleUnderscore=new Set(n)),(h=r.sensitiveDoubleUnderscore)!=null||(r.sensitiveDoubleUnderscore=new Set(i)),(d=r.regexHrAndDoubleUnderscore)!=null||(r.regexHrAndDoubleUnderscore=new RegExp(`__(${[...n,...i].join("|")})__`,"giu")),t!=="root"&&(t!=="ext-inner"||s!=="poem")&&(e=`\0${e}`),e=e.replace(/^((?:\0\d+[cno]\x7F)*)(-{4,})/gmu,(u,p,g)=>(new no(g,r,l),`${p}\0${l.length-1}r`)).replace(r.regexHrAndDoubleUnderscore,(u,p)=>{var v;const g=r.sensitiveDoubleUnderscore.has(p),c=p.toLowerCase(),x=r.insensitiveDoubleUnderscore.has(c);return g||x?(new _t(p,g,r,l),`\0${l.length-1}${x&&((v=o==null?void 0:o[c])!=null?v:c)==="toc"?"u":"n"}`):u}).replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(u,p,g,c,x)=>{const v=`${p}\0${l.length}h`;return new Dn(g.length,[c,x],r,l),v}),t==="root"||t==="ext-inner"&&s==="poem"?e:e.slice(1)}}}),lo,La=_({"src/nowiki/quote.ts"(){"use strict";var e,t;U(),ae(),M(),Me(),lo=(t=class extends Le{constructor(r,l,n,i){super(r,n,i);C(this,e);N(this,e,l)}get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}get closing(){return ue(ue({},this.bold?{bold:f(this,e).bold}:void 0),this.italic?{italic:f(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,nextSibling:n,bold:i,closing:o}=this,a=(l==null?void 0:l.type)==="text"?l.data:void 0,h=(n==null?void 0:n.type)==="text"?n.data:void 0,d=L.msg('lonely "$1"',"'"),u=[],p=new ie(this,r),g=(c,x,v)=>[{desc:"escape",range:[c,x],text:"&apos;".repeat(v)},{desc:"remove",range:[c,x],text:""}];if(a!=null&&a.endsWith("'")){const c=Q(this,p,"lonely-apos",d,(o.bold||o.italic)&&(/[a-z\d]'$/iu.test(a)||h&&/^[a-z\d]/iu.test(h))?"warning":"error"),{startIndex:x,startLine:v,startCol:m}=c,[,{length:y}]=/(?:^|[^'])('+)$/u.exec(a),A=r-y;u.push(be(ue({},c),{startIndex:A,endIndex:x,endLine:v,startCol:m-y,endCol:m,suggestions:g(A,x,y)}))}if(h!=null&&h.startsWith("'")){const c=Q(this,p,"lonely-apos",d),{endIndex:x,endLine:v,endCol:m}=c,[{length:y}]=/^'+/u.exec(h),A=x+y;u.push(be(ue({},c),{startIndex:x,endIndex:A,startLine:v,startCol:m,endCol:m+y,suggestions:g(x,A,y)}))}if(i&&this.closest("heading-title")){const c=Q(this,p,"bold-header","bold in section header","warning");c.suggestions=[{desc:"remove",range:[r,r+3],text:""}],u.push(c)}return u}json(r,l=this.getAbsoluteIndex()){const n=super.json(void 0,l);return Object.assign(n,{bold:this.bold,italic:this.italic}),n}},e=new WeakMap,t)}}),oo={};Z(oo,{parseQuotes:()=>er});var er,ao=_({"parser/quotes.ts"(){"use strict";La(),er=(e,t,s,r)=>{var g;const l=e.split(/('{2,})/u),{length:n}=l;if(n===1)return e;let i=0,o=0,a,h,d;for(let c=1;c<n;c+=2){const x=l[c].length;switch(x){case 2:o++;break;case 4:l[c-1]+="'",l[c]="'''";case 3:if(i++,a!==void 0)break;l[c-1].endsWith(" ")?h===void 0&&d===void 0&&(d=c):l[c-1].slice(-2,-1)===" "?a=c:h!=null||(h=c);break;default:l[c-1]+="'".repeat(x-5),l[c]="'''''",o++,i++}}if(o%2===1&&i%2===1){const c=(g=a!=null?a:h)!=null?g:d;c!==void 0&&(l[c]="''",l[c-1]+="'")}let u=!0,p=!0;for(let c=1;c<n;c+=2){const x=l[c].length,v=x!==2,m=x!==3;v&&(u=!u),m&&(p=!p),new lo(l[c],{bold:v&&u,italic:m&&p},t,s),l[c]=`\0${s.length-1}q`}return l.join("")}}}),ho={};Z(ho,{parseExternalLinks:()=>tr});var tr,uo=_({"parser/externalLinks.ts"(){"use strict";oe(),Ol(),Jn(),tr=(e,t,s,r)=>{var l;return(l=t.regexExternalLinks)!=null||(t.regexExternalLinks=new RegExp(String.raw`\[(\0\d+f\x7F|(?:(?:${t.protocol}|//)${Ye}|\0\d+m\x7F)${Ze}(?=[[\]<>"\t${Ie}]|\0\d))([${Ie}]*(?![${Ie}]))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),e.replace(t.regexExternalLinks,(n,i,o,a)=>{const{length:h}=s,d=/&[lg]t;/u.exec(i);return d&&(o="",a=i.slice(d.index)+o+a,i=i.slice(0,d.index)),r?(new jt(i,"ext-link-url",t,s),`[\0${h}f${o}${a}]`):(new Qe(i,o,a,t,s),`\0${h}w`)})}}}),co,Fa=_({"src/link/category.ts"(){"use strict";oe(),is(),co=class extends Te{get type(){return"category"}get sortkey(){const{childNodes:[,e]}=this;return e&&Lt(e.text())}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t),{sortkey:r}=this;return r&&(s.sortkey=r),s}}}}),go={};Z(go,{parseLinks:()=>En});var Bi,En,ja=_({"parser/links.ts"(){"use strict";M(),ao(),uo(),Rl(),Fl(),Fa(),Bi=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)([\s\S]*)$/u,En=(e,t,s,r)=>{var o;(o=t.regexLinks)!=null||(t.regexLinks=new RegExp(String.raw`^\s*(?:${t.protocol}|//)`,"iu"));const l=t.inExt?/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]]))?\]\]([\s\S]*)$/u:/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)([\s\S]*?[^\]])?)?\]\]([\s\S]*)$/u,n=e.split("[[");let i=n.shift();for(let a=0;a<n.length;a++){let h=!1,d,u,p,g;const c=n[a],x=l.exec(c);if(x)[,d,u,p,g]=x,g.startsWith("]")&&(p!=null&&p.includes("["))&&(p+="]",g=g.slice(1));else{const w=Bi.exec(c);w&&(h=!0,[,d,u,p]=w)}if(d===void 0||t.regexLinks.test(d)||/\0\d+[exhbru]\x7F/u.test(d)){i+=`[[${c}`;continue}const v=d.trim().startsWith(":");if(v&&h){i+=`[[${c}`;continue}const{ns:m,valid:y}=L.normalizeTitle(d,0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0});if(y){if(h){if(m!==6){i+=`[[${c}`;continue}let w=!1;for(a++;a<n.length;a++){const S=n[a],T=S.split("]]");if(T.length>2){w=!0,p+=`[[${T[0]}]]${T[1]}`,g=T.slice(2).join("]]");break}else if(T.length===2)p+=`[[${T[0]}]]${T[1]}`;else{p+=`[[${S}`;break}}if(p=En(p,t,s,r),!w){i+=`[[${d}${u}${p}`;continue}}}else{i+=`[[${c}`;continue}p&&(p=er(p,t,s,r));let A=Qn;v||(m===6?(p&&(p=tr(p,t,s,!0)),A=Vn):m===14&&(A=co)),p===void 0&&u&&(p=""),i+=`\0${s.length}l${g}`,new A(d,p,t,s,u)}return i}}}),po={};Z(po,{parseMagicLinks:()=>fo});var hn,un,cn,gn,fo,Ea=_({"parser/magicLinks.ts"(){"use strict";oe(),Jn(),hn=String.raw`[${Ie}\t]|&nbsp;|&#0*160;|&#x0*a0;`,un=`(?:${hn})+`,cn=`(?:${hn}|-)`,gn=String.raw`(?:RFC|PMID)${un}\d+\b|ISBN${un}(?:97[89]${cn}?)?(?:\d${cn}?){9}[\dx]\b`,fo=(e,t,s)=>{if(!t.regexMagicLinks)try{t.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${t.protocol})(${Ye}${Ze})|${gn})`,"giu")}catch(r){t.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${t.protocol})(${Ye}${Ze})|${gn})`,"giu")}return e.replace(t.regexMagicLinks,(r,l,n)=>{let i=l?r.slice(l.length):r;if(n){let o="";const a=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(i);a&&(o=i.slice(a.index),i=i.slice(0,a.index));const h=i.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,d=h.exec(i);if(d){let u=1;d[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(i.slice(0,d.index))&&(u=2),o=i.slice(d.index+u)+o,i=i.slice(0,d.index+u)}return o.length>=n.length?r:(new jt(i,void 0,t,s),`${l}\0${s.length-1}w${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(i))return r;return new jt(i,"magic-link",t,s),`${l}\0${s.length-1}i`})}}}),xo,Pa=_({"util/html.ts"(){"use strict";xo=(e,t)=>e.startsWith(t)?t.length:[...t].findIndex((s,r)=>s!==e[r])}}),mo,Ra=_({"src/nowiki/list.ts"(){"use strict";Zl(),mo=class extends Yn{get type(){return"list"}}}}),vo={};Z(vo,{parseList:()=>bo});var bo,Oa=_({"parser/list.ts"(){"use strict";Pa(),Ra(),eo(),bo=(e,t,s,r)=>{const l=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(e);if(!l)return t.lastPrefix="",e;const[n,i,o,a]=l,h=o.replace(/;/gu,":"),d=xo(h,t.lastPrefix),u=((d>1?o.slice(d-1):o)+a).split(/(?=;)/u),p=u[0].startsWith(";");let g=u.length-(p?0:1);if(d>1){const I=o.slice(0,d-1);if(p){const H=I.split(/(?=;)/u);u.unshift(...H),g+=I.includes(";")?H.length:0}else u[0]=I+u[0]}t.lastPrefix=h;let c=i+u.map((I,H)=>`\0${r.length+H}d`).join("")+e.slice(n.length);for(const I of u)new mo(I,s,r);if(!g)return c;const{html:[x,,v]}=s,m=/:+|-\{|\0\d+[xq]\x7F/gu;let y=m,A=y.exec(c),w=0,S=!1,T=!1,b=0;const k=(I,H)=>(new Zn(I,s,r),`${c.slice(0,H)}\0${r.length-1}d${c.slice(H+I.length)}`),$=I=>{I?w&&w--:w++};for(;A&&g;){const{0:I,index:H}=A;if(I==="-{"){if(!b){const{lastIndex:R}=y;y=/-\{|\}-/gu,y.lastIndex=R}b++}else if(I==="}-"){if(b--,!b){const{lastIndex:R}=y;y=m,y.lastIndex=R}}else if(I.endsWith("x")){const{name:R,closing:P,selfClosing:D}=r[Number(I.slice(1,-2))];(x.includes(R)||!D&&!v.includes(R))&&$(P)}else if(I.endsWith("q")){const{bold:R,italic:P}=r[Number(I.slice(1,-2))];R&&($(S),S=!S),P&&($(T),T=!T)}else if(w===0){if(I.length>=g)return k(I.slice(0,g),H);g-=I.length,y.lastIndex=H+4+String(r.length).length,c=k(I,H)}A=y.exec(c)}return c}}}),Vt,qi,pn,Wi,kt,Ba=_({"src/converterFlags.ts"(){"use strict";var e,t;U(),ae(),ls(),M(),B(),Ne(),Vt=new Set(["A","T","R","D","-","H","N"]),qi=[Pt()],kt=(t=class extends(Wi=E){constructor(r,l,n=[]){super(void 0,l,n,{});C(this,e);this.safeAppend(r.map(i=>new ce(i,"converter-flag",l,n)))}get type(){return"converter-flags"}afterBuild(){N(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(f(this,e).filter(r=>/\{{3}[^{}]+\}{3}/u.test(r)))}getVariantFlags(){const r=new Set(this.getAttribute("config").variants);return new Set(f(this,e).filter(l=>r.has(l)))}isInvalidFlag(r,l,n,i){return typeof r=="object"&&(r=r.text().trim(),l=this.getVariantFlags(),n=this.getUnknownFlags(),i=new Set(f(this,e).filter(o=>Vt.has(o)))),!!r&&!l.has(r)&&!n.has(r)&&(l.size>0||!i.has(r))}lint(r=this.getAbsoluteIndex(),l){const n=this.getVariantFlags(),i=this.getUnknownFlags(),o=new Set(f(this,e).filter(g=>Vt.has(g))),a=f(this,e).filter(g=>!g).length,h=f(this,e).length-i.size-a,d=super.lint(r,l);if(n.size===h||o.size===h)return d;const u="no-ignored",p=L.lintConfig.getSeverity(u,"conversionFlag");if(p){const g=new ie(this,r);for(let c=0;c<this.length;c++){const x=this.childNodes[c],v=x.text().trim();if(this.isInvalidFlag(v,n,i,o)){const m=O(x,g,u,"invalid conversion flag",p);n.size===0&&Vt.has(v.toUpperCase())?m.fix={desc:"uppercase",range:[m.startIndex,m.endIndex],text:v.toUpperCase()}:m.suggestions=[{desc:"remove",range:[m.startIndex-(c&&1),m.endIndex],text:""}],d.push(m)}}}return d}print(){return super.print({sep:";"})}},e=new WeakMap,t),pn=se(Wi),kt=re(pn,0,"ConverterFlagsToken",qi,kt),ne(pn,1,kt)}}),ts,qa=_({"src/converterRule.ts"(){"use strict";M(),B(),Ne(),ts=class extends E{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=L.getConfig(),r=[]){super(void 0,s,r);const l=e.indexOf(":"),n=e.slice(0,l).indexOf("=>"),i=n===-1?e.slice(0,l):e.slice(n+2,l);t&&s.variants.includes(i.trim())?(super.insertAt(new ce(i,"converter-rule-variant",s,r)),super.insertAt(new ce(e.slice(l+1),"converter-rule-to",s,r)),n!==-1&&super.insertAt(new ce(e.slice(0,n),"converter-rule-from",s,r),0)):super.insertAt(new ce(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}}}}),Mi,fn,zi,$t,Wa=_({"src/converter.ts"(){"use strict";oe(),Ce(),B(),Ba(),qa(),Mi=[ke("-{")],$t=class extends(zi=E){get type(){return"converter"}constructor(e,t,s,r=[]){super(void 0,s,r),this.insertAt(new kt(e,s,r));const[l]=t,n=l.includes(":"),i=new ts(l,n,s,r);n&&i.length===1||!n&&t.length===2&&!me(t[1]).trim()?this.insertAt(new ts(t.join(";"),!1,s,r)):this.append(i,...t.slice(1).map(o=>new ts(o,!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()}|${Oe(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?"|":""}${tt(t,{sep:";"})}}-</span>`}},fn=se(zi),$t=re(fn,0,"ConverterToken",Mi,$t),ne(fn,1,$t)}}),wo={};Z(wo,{parseConverter:()=>yo});var yo,Ma=_({"parser/converter.ts"(){"use strict";Wa(),yo=(e,t,s)=>{var a;(a=t.regexConverter)!=null||(t.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${t.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"u"));const r=/-\{/gu,l=/-\{|\}-/gu,n=[];let i=r,o=i.exec(e);for(;o;){const{0:h,index:d}=o;if(h==="}-"){const u=n.pop(),{length:p}=s,g=e.slice(u.index+2,d),c=g.indexOf("|"),[x,v]=c===-1?[[],g]:[g.slice(0,c).split(";"),g.slice(c+1)],m=v.replace(/(&[#a-z\d]+);/giu,"$1"),y=m.split(t.regexConverter).map(A=>A.replace(/\x01/gu,";"));new $t(x,y,t,s),e=`${e.slice(0,u.index)}\0${p}v${e.slice(d+2)}`,n.length===0&&(i=r),i.lastIndex=u.index+3+String(p).length}else n.push(o),i=l,i.lastIndex=d+2;o=i.exec(e)}return e}}}),ns={};Z(ns,{Token:()=>E});var Ui,E,B=_({"src/index.ts"(){"use strict";var e,t,s,r,l,n,i,o,Ao,So,_o,ko,$o,To,Io,Co,No,Lo,Fo,jo,w;oe(),Be(),U(),ge(),M(),ea(),ta(),Ui=["category","html-attr#id,ext-attr#id,table-attr#id"],E=(w=class extends ll{constructor(b,k=L.getConfig(),$=[],I){super();C(this,o);C(this,e,"plain");C(this,t,0);C(this,s);C(this,r);C(this,l);C(this,n,!1);C(this,i);typeof b=="string"&&this.insertAt(b),N(this,s,k),N(this,r,$),$.push(this)}get type(){return f(this,e)}set type(b){N(this,e,b)}parseOnce(b=f(this,t),k=!1,$){if(b<f(this,t)||this.length===0||!this.isPlain())return this;if(f(this,t)>=xe)return this;switch(b){case 0:if(this.type==="root"){f(this,r).pop();const I=j(this,o,Ao).call(this);k&&(k=!I)}N(this,l,k),j(this,o,So).call(this,k);break;case 1:j(this,o,_o).call(this);break;case 2:j(this,o,ko).call(this);break;case 3:j(this,o,$o).call(this);break;case 4:j(this,o,To).call(this);break;case 5:j(this,o,Io).call(this,$);break;case 6:j(this,o,Co).call(this,$);break;case 7:j(this,o,No).call(this);break;case 8:j(this,o,Lo).call(this);break;case 9:j(this,o,Fo).call(this);break;case 10:j(this,o,jo).call(this)}if(this.type==="root")for(const I of f(this,r))I==null||I.parseOnce(b,k,$);return ar(this,t)._++,this}buildFromStr(b,k){const $=b.split(/[\0\x7F]/u).map((I,H)=>{if(H%2===0)return new $n(I);if(isNaN(I.slice(-1)))return f(this,r)[Number(I.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${I}`)});return k===0?$.map(String).join(""):k===1?Oe($):$}build(){N(this,t,xe);const{length:b,firstChild:k}=this,$=k==null?void 0:k.toString();if(b===1&&k.type==="text"&&$.includes("\0")&&(rs(this,0,1,this.buildFromStr($)),this.normalize(),this.type==="root"))for(const I of f(this,r))I==null||I.build()}afterBuild(){if(this.type==="root")for(const b of f(this,r))b==null||b.afterBuild();N(this,n,!0)}parse(b=xe,k,$){for(b=Math.min(b,xe);f(this,t)<b;)this.parseOnce(f(this,t),k,$);return b&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===w}getAttribute(b){var k;switch(b){case"config":return f(this,s);case"include":return(k=f(this,l))!=null?k:!!f(this.getRootNode(),l);case"accum":return f(this,r);case"built":return f(this,n);case"stage":return f(this,t);case"invalid":return this.type==="table-inter"&&Tt(this)==="error";default:return super.getAttribute(b)}}setAttribute(b,k){switch(b){case"stage":f(this,t)===0&&this.type==="root"&&f(this,r).shift(),N(this,t,k);break;default:super.setAttribute(b,k)}}insertAt(b,k=this.length){const $=typeof b=="string"?new $n(b):b;super.insertAt($,k);const{type:I}=$;return I==="root"&&($.type="plain"),$}normalizeTitle(b,k=0,$){return L.normalizeTitle(b,k,f(this,l),f(this,s),$)}inTableAttrs(){var b,k;return((b=this.closest("table-attrs,ext"))==null?void 0:b.type)==="table-attrs"&&((k=this.closest("table-attrs,arg,magic-word,template"))!=null&&k.is("table-attrs")?"error":"warning")}inHtmlAttrs(){var b;return(b=this.closest("html-attrs,ext"))!=null&&b.is("html-attrs")?"error":this.inTableAttrs()}lint(b=this.getAbsoluteIndex(),k){var I;let $=super.lint(b,k);if(this.type==="root"){const H=new Map,R="no-duplicate",P=["category","id"].map(q=>L.lintConfig.getSeverity(R,q)),D=Ui.filter((q,G)=>P[G]).join();if(D){for(const q of this.querySelectorAll(D)){let G;if(q.is("category"))G=q.name;else{const W=q.getValue();W&&W!==!0&&(G=`#${W}`)}if(G){const W=H.get(G);W?W.add(q):H.set(G,new Set([q]))}}for(const[q,G]of H)if(G.size>1&&!q.startsWith("#mw-customcollapsible-")){const W=!q.startsWith("#"),J=`duplicated ${W?"category":"id"}`,Y=P[W?0:1];$.push(...[...G].map(le=>{const ee=Q(le,{start:le.getAbsoluteIndex()},R,J,Y);return W&&(ee.suggestions=[{desc:"remove",range:[ee.startIndex,ee.endIndex],text:""}]),ee}))}}const V=/<!--\s*lint-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->/gu,K=this.toString(),z=[];let F=V.exec(K);for(;F;){const{1:q,index:G}=F,W=(I=F[2])==null?void 0:I.trim();z.push({line:this.posFromIndex(G).top+(q==="disable-line"?0:1),from:q==="disable"?V.lastIndex:void 0,to:q==="enable"?V.lastIndex:void 0,rules:W?new Set(W.split(",").map(J=>J.trim())):void 0}),F=V.exec(K)}if($=$.filter(({rule:q,startLine:G,startIndex:W})=>{const J={pos:0};for(const{line:Y,from:le,to:ee,rules:ze}of z){if(Y>G+1)break;if(ze&&!ze.has(q))continue;if(Y===G&&le===void 0&&ee===void 0)return!1;le<=W&&le>J.pos?(J.pos=le,J.type="from"):ee<=W&&ee>J.pos&&(J.pos=ee,J.type="to")}return J.type!=="from"}),$.some(({fix:q})=>q)){const q=$.map(({fix:J})=>J).filter(Boolean).sort(({range:[J,Y]},{range:[le,ee]})=>Y===ee?le-J:ee-Y);let G=1/0,W=K;for(const{range:[J,Y],text:le}of q)Y<=G&&(W=W.slice(0,J)+le+W.slice(Y),G=J);Object.assign($,{output:W})}}return $}toString(b,k){return b?super.toString(!0,k):Re(f(this,i),()=>super.toString(!1,k),$=>{const I=this.getRootNode();I.type==="root"&&f(I,n)&&N(this,i,$)})}},e=new WeakMap,t=new WeakMap,s=new WeakMap,r=new WeakMap,l=new WeakMap,n=new WeakMap,i=new WeakMap,o=new WeakSet,Ao=function(){const{parseRedirect:b}=(ra(),X(dl)),k=this.firstChild.toString(),$=b(k,f(this,s),f(this,r));return $&&this.setText($),!!$},So=function(b){const{parseCommentAndExt:k}=(us(),X(Dl));this.setText(k(this.firstChild.toString(),f(this,s),f(this,r),b))},_o=function(){const{parseBraces:b}=(Gn(),X(_l)),k=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,$=b(k,f(this,s),f(this,r));this.setText(this.type==="root"?$:$.slice(1))},ko=function(){if(f(this,s).excludes.includes("html"))return;const{parseHtml:b}=(_a(),X(Gl));this.setText(b(this.firstChild.toString(),f(this,s),f(this,r)))},$o=function(){if(f(this,s).excludes.includes("table"))return;const{parseTable:b}=(Ta(),X(to));this.setText(b(this,f(this,s),f(this,r)))},To=function(){if(f(this,s).excludes.includes("hr"))return;const{parseHrAndDoubleUnderscore:b}=(Na(),X(ro));this.setText(b(this,f(this,s),f(this,r)))},Io=function(b){const{parseLinks:k}=(ja(),X(go));this.setText(k(this.firstChild.toString(),f(this,s),f(this,r),b))},Co=function(b){if(f(this,s).excludes.includes("quote"))return;const{parseQuotes:k}=(ao(),X(oo)),$=this.firstChild.toString().split(`
25
+ `);for(let I=0;I<$.length;I++)$[I]=k($[I],f(this,s),f(this,r),b);this.setText($.join(`
26
+ `))},No=function(){if(f(this,s).excludes.includes("extLink"))return;const{parseExternalLinks:b}=(uo(),X(ho));this.setText(b(this.firstChild.toString(),f(this,s),f(this,r)))},Lo=function(){if(f(this,s).excludes.includes("magicLink"))return;const{parseMagicLinks:b}=(Ea(),X(po));this.setText(b(this.firstChild.toString(),f(this,s),f(this,r)))},Fo=function(){if(f(this,s).excludes.includes("list"))return;const{parseList:b}=(Oa(),X(vo)),{firstChild:k,type:$,name:I}=this,H=k.toString().split(`
27
+ `),R={lastPrefix:""};let P=$==="root"||$==="ext-inner"&&I==="poem"?0:1;for(;P<H.length;P++)H[P]=b(H[P],R,f(this,s),f(this,r));this.setText(H.join(`
28
+ `))},jo=function(){if(f(this,s).variants.length>0){const{parseConverter:b}=(Ma(),X(wo));this.setText(b(this.firstChild.toString(),f(this,s),f(this,r)))}},w)}}),ve,cs,rs,lt,ge=_({"util/debug.ts"(){"use strict";ve={running:!1,run(e){const{running:t}=this;this.running=!0;try{const{Token:s}=(B(),X(ns)),r=e();return r instanceof s&&!r.getAttribute("built")&&r.afterBuild(),this.running=t,r}catch(s){throw this.running=t,s}},rev:0},cs=e=>t=>t.type===e,rs=(e,t,s,r=[])=>{var i,o;let l=e.getChildNodes(),n;l.length===s?(n=l,l=r):n=l.splice(t,s,...r);for(let a=0;a<r.length;a++){const h=r[a];h.setAttribute("parentNode",e),h.setAttribute("nextSibling",l[t+a+1]),h.setAttribute("previousSibling",l[t+a-1])}return(i=l[t-1])==null||i.setAttribute("nextSibling",l[t]),(o=l[t+r.length])==null||o.setAttribute("previousSibling",l[t+r.length-1]),l===r&&e.setAttribute("childNodes",l),n},lt=(e,t)=>{Object.defineProperty(e,"name",{value:t.name})}}}),Hi,pt,xn,mn,Di,vn,Gi,Pn,za=_({"lib/lintConfig.ts"(){"use strict";Zi(),Hi=new Set([0,1,2]),pt=new Map([[0,!1],[1,"warning"],[2,"error"]]),xn={"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(xn),mn=e=>typeof e=="number"&&Hi.has(e),Di=e=>mn(e)||Array.isArray(e)&&e.length===2&&mn(e[0])&&e[1]&&typeof e[1]=="object",vn=(e,t,s)=>{if(qn.includes(t)){if(Di(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)}`)},Gi=class{constructor(e){if(Object.assign(this,JSON.parse(JSON.stringify(xn))),!!e)for(const[t,s]of Object.entries(e))vn(this,t,s)}getSeverity(e,t){var r;const s=this[e];return typeof s=="number"?pt.get(s):t&&(r=pt.get(s[1][t]))!=null?r:pt.get(s[0])}},Pn=e=>new Proxy(new Gi(e),{set:vn})}}),Eo={};Z(Eo,{Title:()=>Po});var Po,Ua=_({"lib/title.ts"(){"use strict";var e,t,s,r,l,n;oe(),Po=(n=class{constructor(i,o,a,{temporary:h,decode:d,selfLink:u}={}){C(this,e);C(this,t);C(this,s);C(this,r);C(this,l);Ae(this,"valid");Ae(this,"encoded",!1);const p=i.trim().startsWith("../");if(d&&i.includes("%"))try{const c=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(i);i=Nt(i),this.encoded=c}catch(c){}if(i=Lt(i).replace(/[_ ]+/gu," ").trim(),p)N(this,r,0);else{let c=o;i.startsWith(":")&&(c=0,i=i.slice(1).trim());const x=i.split(":");if(x.length>1){const v=et(x[0]),m=Object.prototype.hasOwnProperty.call(a.nsid,v)&&a.nsid[v];m&&(c=m,i=x.slice(1).join(":").trim())}N(this,r,c)}const g=i.indexOf("#");if(g!==-1){let c=i.slice(g).trim().slice(1);if(c.includes("%"))try{c=Nt(c)}catch(x){}N(this,l,c.replace(/ /gu,"_")),i=i.slice(0,g).trim()}this.valid=!!(i||u&&this.ns===0&&f(this,l)!==void 0)&&Lt(i)===i&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(p?/^(?:\.\.\/)+(.*)/u.exec(i)[1]:i),this.main=i,N(this,t,a.namespaces),N(this,s,a.articlePath||"/wiki/$1"),f(this,s).includes("$1")||N(this,s,f(this,s)+`${f(this,s).endsWith("/")?"":"/"}$1`),h||Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}})}get ns(){return f(this,r)}get fragment(){return f(this,l)}get main(){return f(this,e)}set main(i){i=i.replace(/_/gu," ").trim(),N(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){N(this,l,i)}getUrl(i){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,n)}}),Ro={};Z(Ro,{default:()=>L});Oo.exports=X(Ro);var Qt,bn,$e,wn,Vi,L,M=_({"index.ts"(){Zi(),ge(),Be(),oe(),za(),Qt=!0,bn=Pn(),$e={config:yn,i18n:void 0,rules:qn,get lintConfig(){return bn},set lintConfig(e){bn=Pn(e)},get viewOnly(){return Qt},set viewOnly(e){Qt&&!e&&ve.rev++,Qt=e},getConfig(e){const t=e!=null?e:this.config,{doubleUnderscore:s,ext:r,parserFunction:l,variable:n}=t;for(let i=0;i<2;i++)s.length>i+2&&s[i].length===0&&(s[i]=Object.keys(s[i+2]));return r.includes("translate")&&!n.includes("translationlanguage")&&(n.push("translationlanguage"),Array.isArray(l[1])?l[1].push("TRANSLATIONLANGUAGE"):l[1].TRANSLATIONLANGUAGE="translationlanguage"),be(ue(ue({},yn),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=$e.getConfig(),l){const{Title:n}=(Ua(),X(Eo));let i;if(l!=null&&l.halfParsed)i=new n(e,t,r,l);else{const{Token:o}=(B(),X(ns));i=ve.run(()=>{const a=new o(e,r);a.type="root",a.parseOnce(0,s).parseOnce();const h=new n(a.toString(),t,r,l);for(const d of["main","fragment"]){const u=h[d];if(u!=null&&u.includes("\0")){const p=a.buildFromStr(u,1);d==="main"?h.main=p:h.setFragment(p)}}return h})}return i},parse(e,t,s=xe,r=$e.getConfig()){e=tl(e);let l;typeof s!="number"&&(l=Array.isArray(s)?s:[s],s=Math.max(...l.map(o=>Yi[o]||xe)));const{Token:n}=(B(),X(ns));return ve.run(()=>{const o=new n(e,r);return o.type="root",o.parse(s,t)})},async partialParse(e,t,s,r=$e.getConfig()){},createLanguageService(e={}){throw new Error("Parser.createLanguageService method is only available in the LSP version!")}},wn={},Vi=new Set(["normalizeTitle","parse","createLanguageService"]);for(const e in $e)Vi.has(e)||(wn[e]={enumerable:!1});Object.defineProperties($e,wn),Object.assign(typeof globalThis=="object"?globalThis:self,{Parser:$e}),L=$e}});M()});Ha();})();