wikiparser-node 1.21.2 → 1.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/README.md +9 -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/config/default.json +15 -11
  6. package/config/enwiki.json +1 -1
  7. package/config/jawiki.json +1 -1
  8. package/config/minimum.json +2 -3
  9. package/config/moegirl.json +152 -15
  10. package/config/zhwiki.json +1 -1
  11. package/dist/addon/token.js +3 -0
  12. package/dist/base.d.mts +16 -9
  13. package/dist/base.d.ts +16 -9
  14. package/dist/bin/config.js +23 -11
  15. package/dist/index.d.ts +33 -4
  16. package/dist/index.js +37 -2
  17. package/dist/lib/element.d.ts +4 -4
  18. package/dist/lib/element.js +6 -5
  19. package/dist/lib/lintConfig.d.ts +13 -0
  20. package/dist/lib/lintConfig.js +278 -0
  21. package/dist/lib/lsp.d.ts +7 -7
  22. package/dist/lib/lsp.js +18 -20
  23. package/dist/lib/node.d.ts +1 -1
  24. package/dist/lib/node.js +646 -606
  25. package/dist/lib/range.d.ts +2 -2
  26. package/dist/lib/range.js +2 -2
  27. package/dist/lib/text.js +76 -62
  28. package/dist/lib/title.d.ts +11 -4
  29. package/dist/lib/title.js +16 -6
  30. package/dist/mixin/attributesParent.d.ts +6 -6
  31. package/dist/mixin/attributesParent.js +4 -4
  32. package/dist/mixin/cached.d.ts +5 -0
  33. package/dist/mixin/cached.js +22 -0
  34. package/dist/mixin/clone.d.ts +5 -0
  35. package/dist/mixin/clone.js +23 -0
  36. package/dist/mixin/hidden.js +68 -18
  37. package/dist/mixin/sol.js +1 -1
  38. package/dist/parser/commentAndExt.js +6 -4
  39. package/dist/parser/converter.js +1 -1
  40. package/dist/parser/html.js +3 -3
  41. package/dist/parser/table.js +2 -2
  42. package/dist/src/arg.js +24 -17
  43. package/dist/src/atom.js +76 -31
  44. package/dist/src/attribute.js +79 -39
  45. package/dist/src/attributes.d.ts +7 -7
  46. package/dist/src/attributes.js +417 -366
  47. package/dist/src/commented.js +81 -35
  48. package/dist/src/converter.js +13 -7
  49. package/dist/src/converterFlags.js +33 -22
  50. package/dist/src/converterRule.js +263 -216
  51. package/dist/src/extLink.js +21 -16
  52. package/dist/src/gallery.js +44 -27
  53. package/dist/src/heading.js +48 -43
  54. package/dist/src/hidden.js +14 -9
  55. package/dist/src/html.js +92 -60
  56. package/dist/src/imageParameter.js +13 -6
  57. package/dist/src/imagemap.js +32 -25
  58. package/dist/src/index.d.ts +2 -2
  59. package/dist/src/index.js +61 -50
  60. package/dist/src/link/base.d.ts +1 -1
  61. package/dist/src/link/base.js +35 -23
  62. package/dist/src/link/file.js +409 -354
  63. package/dist/src/link/galleryImage.js +9 -5
  64. package/dist/src/link/index.d.ts +1 -1
  65. package/dist/src/link/index.js +8 -4
  66. package/dist/src/link/redirectTarget.js +7 -3
  67. package/dist/src/magicLink.js +39 -26
  68. package/dist/src/nested.js +122 -74
  69. package/dist/src/nowiki/base.js +5 -2
  70. package/dist/src/nowiki/comment.js +5 -1
  71. package/dist/src/nowiki/index.js +4 -4
  72. package/dist/src/nowiki/quote.js +32 -46
  73. package/dist/src/onlyinclude.js +17 -9
  74. package/dist/src/paramTag/index.js +21 -14
  75. package/dist/src/parameter.js +26 -20
  76. package/dist/src/pre.js +91 -45
  77. package/dist/src/syntax.js +14 -10
  78. package/dist/src/table/index.js +554 -501
  79. package/dist/src/table/td.d.ts +1 -1
  80. package/dist/src/table/td.js +91 -82
  81. package/dist/src/table/trBase.js +183 -130
  82. package/dist/src/tagPair/ext.js +38 -23
  83. package/dist/src/tagPair/include.js +5 -5
  84. package/dist/src/tagPair/index.js +2 -3
  85. package/dist/src/tagPair/translate.js +150 -103
  86. package/dist/src/transclude.d.ts +15 -1
  87. package/dist/src/transclude.js +56 -21
  88. package/dist/util/html.js +46 -41
  89. package/dist/util/lint.js +7 -9
  90. package/dist/util/sharable.js +1 -1
  91. package/dist/util/sharable.mjs +2 -2
  92. package/dist/util/string.js +13 -7
  93. package/extensions/dist/base.js +9 -2
  94. package/extensions/typings.d.ts +2 -1
  95. package/i18n/zh-hans.json +1 -1
  96. package/i18n/zh-hant.json +1 -1
  97. package/package.json +20 -15
@@ -1,29 +1,29 @@
1
- "use strict";(()=>{var _a=Object.create;var Bt=Object.defineProperty;var Ki=Object.getOwnPropertyDescriptor;var Ma=Object.getOwnPropertyNames;var Ua=Object.prototype.hasOwnProperty;var Ji=(a,n)=>(n=Symbol[a])?n:Symbol.for("Symbol."+a),Ot=a=>{throw TypeError(a)};var Yi=(a,n,e)=>n in a?Bt(a,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[n]=e;var Qi=(a,n)=>Bt(a,"name",{value:n,configurable:!0});var v=(a,n)=>()=>(a&&(n=a(a=0)),n);var za=(a,n)=>()=>(n||a((n={exports:{}}).exports,n),n.exports),ee=(a,n)=>{for(var e in n)Bt(a,e,{get:n[e],enumerable:!0})},Da=(a,n,e,t)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of Ma(n))!Ua.call(a,r)&&r!==e&&Bt(a,r,{get:()=>n[r],enumerable:!(t=Ki(n,r))||t.enumerable});return a};var H=a=>Da(Bt({},"__esModule",{value:!0}),a);var F=a=>{var n;return[,,,_a((n=a==null?void 0:a[Ji("metadata")])!=null?n:null)]},Zi=["class","method","getter","setter","accessor","field","value","get","set"],Tr=a=>a!==void 0&&typeof a!="function"?Ot("Function expected"):a,Wa=(a,n,e,t,r)=>({kind:Zi[a],name:n,metadata:t,addInitializer:i=>e._?Ot("Already initialized"):r.push(Tr(i||null))}),Ha=(a,n)=>Yi(n,Ji("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=Zi[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)&&Ki(d<4?r:{get[e](){return c(this,i)},set[e](w){return y(this,i,w)}},e));d?h&&d<4&&Qi(i,(d>2?"set ":d>1?"get ":"")+e):Qi(r,e);for(var $=t.length-1;$>=0;$--)g=Wa(d,e,l={},a[3],T),d&&(g.static=u,g.private=h,p=g.access={has:h?w=>Ga(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?Tr(o)&&(d>4?x.unshift(o):d?h?i=o:k[f]=o:r=o):typeof o!="object"||o===null?Ot("Object expected"):(Tr(s=o.get)&&(k.get=s),Tr(s=o.set)&&(k.set=s),Tr(s=o.init)&&x.unshift(s));return d||Ha(a,r),k&&Bt(r,e,k),h?d^4?i:k:r},le=(a,n,e)=>Yi(a,typeof n!="symbol"?n+"":n,e),En=(a,n,e)=>n.has(a)||Ot("Cannot "+e),Ga=(a,n)=>Object(n)!==n?Ot('Cannot use the "in" operator on this value'):a.has(n),c=(a,n,e)=>(En(a,n,"read from private field"),e?e.call(a):n.get(a)),b=(a,n,e)=>n.has(a)?Ot("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(a):n.set(a,e),y=(a,n,e,t)=>(En(a,n,"write to private field"),t?t.call(a,e):n.set(a,e),e),S=(a,n,e)=>(En(a,n,"access private method"),e);var Yr=(a,n,e,t)=>({set _(r){y(a,n,r,e)},get _(){return c(a,n,t)}});var es,ts,rs=v(()=>{"use strict";es=(()=>{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})(),ts=(()=>{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 Ne(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 Ye,qt=v(()=>{"use strict";Ye=a=>decodeURIComponent(a.replace(/%(?![\da-f]{2})/giu,"%25"))});var Ae,ns,je,Be,Oe,Ie,ut,is,se,md,Te,Va,Xa,ct,ss,fd,Qa,Ka,ht,qe,ne=v(()=>{"use strict";qt();Ae=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,ns=String.raw`[^[\]<>"\0-\x1F\x7F${Ae}\uFFFD]`,je=String.raw`(?:\[[\da-f:.]+\]|${ns})`,Be=String.raw`(?:${ns}|\0\d+[cn!~]\x7F)*`,Oe=a=>a.trim().toLowerCase(),Ie=(a,n)=>a.replace(/\0(\d+)\x7F/gu,(e,t)=>n[t]),ut=(a,n)=>e=>e.replace(a,n),is=ut(/[\0\x7F]|\r$/gmu,""),se=ut(/\0\d+[cn]\x7F/gu,""),md=ut(/[\\{}()|.?*+^$[\]]/gu,String.raw`\$&`),Te=(a,n="")=>a.map(e=>typeof e=="string"?e:e.text()).join(n),Va={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},Xa=ut(/&(?:#(\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)):Va[e.toLowerCase()]),ct=a=>Xa(a),ss=ut(/&#(\d+|x[\da-f]+);/giu,(a,n)=>String.fromCodePoint(+((/^x/iu.test(n)?"0":"")+n))),fd=ut(/\n/gu,String.raw`\n`),Qa={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},Ka=a=>ut(a,n=>`&${Qa[n]};`),ht=Ka(/[&<>]/gu),qe=(a,n={})=>{let{pre:e="",post:t="",sep:r=""}=n;return e+a.map(i=>i.print()).join(r)+t}});var os=za((Td,Ja)=>{Ja.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 Ln,as=v(()=>{"use strict";Ln=os()});var yr,_t,kr,vr,Fn,L,ie=v(()=>{"use strict";L=class{constructor(n,e){b(this,vr);b(this,yr);b(this,_t);b(this,kr);y(this,yr,n),y(this,_t,e)}get start(){return c(this,_t)}get top(){return S(this,vr,Fn).call(this).top}get left(){return S(this,vr,Fn).call(this).left}};yr=new WeakMap,_t=new WeakMap,kr=new WeakMap,vr=new WeakSet,Fn=function(){var n;return(n=c(this,kr))!=null||y(this,kr,c(this,yr).getRootNode().posFromIndex(c(this,_t))),c(this,kr)}});var Ya,Za,Mt,Rn,ls,N,E,we,ds,M=v(()=>{"use strict";de();ie();G();Ya=new Set(["tr","td","th","caption"]),Za=new Set(["Template:!!","Template:!-"]),Mt=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")&&Za.has(n.name)||n.is("html")&&Ya.has(n.name))return!1;if(n.is("arg"))return n.length>1&&Mt(n.childNodes[1]);if(n.is("magic-word"))try{let e=n.getPossibleValues().map(Mt);return e.includes("error")?"error":e.includes("warning")&&"warning"}catch{}return n.is("template")||n.is("magic-word")&&n.name==="invoke"?"warning":"error"},Rn=(a,n,e,t)=>({line:a+e-1,character:(e===1?n:0)+t}),ls=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}=Rn(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=ls((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=ls((a,n,e,t)=>({startIndex:n,startLine:e,startCol:t})),we=(a,n,e)=>{if(a&&C.viewOnly&&a[0]===oe.rev)return a[1];let t=n();return C.viewOnly&&e([oe.rev,t]),t},ds=(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 el,Zr,gs=v(()=>{"use strict";el=(a,n,e)=>{if(a.includes("#")){let[t,...r]=a.split("#");return(!t||t===n)&&r.every(i=>i===e)}return!a||a===n},Zr=(a,n,e)=>({type:t,name:r})=>a.split(",").some(i=>el(i.trim(),t,r))});var Ar,Ut,zt,wr,Sr,Dt,Wt,Cr,Pn,Ht,jn=v(()=>{"use strict";M();de();G();Ht=class{constructor(){b(this,Cr);le(this,"childNodes",[]);b(this,Ar);b(this,Ut);b(this,zt);b(this,wr);b(this,Sr);b(this,Dt);b(this,Wt,{})}get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get parentNode(){return c(this,Ar)}get nextSibling(){return c(this,Ut)}get previousSibling(){return c(this,zt)}get offsetHeight(){return S(this,Cr,Pn).call(this).height}get offsetWidth(){return S(this,Cr,Pn).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,Ar,e),e||(y(this,Ut,void 0),y(this,zt,void 0));break;case"nextSibling":y(this,Ut,e);break;case"previousSibling":y(this,zt,e);break;case"aIndex":C.viewOnly&&y(this,Dt,[oe.rev,e]);break;default:this[n]=e}}getRootNode(){return we(c(this,Sr),()=>{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,Sr,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 we(c(this,Wt)[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,Wt)[i]=[oe.rev,r]),r+=e[i].toString().length+this.getGaps(i);return r},e=>{c(this,Wt)[n]=e})}getAbsoluteIndex(){return we(c(this,Dt),()=>{let{parentNode:n}=this;return n?n.getAbsoluteIndex()+this.getRelativeIndex():0},n=>{y(this,Dt,n)})}getBoundingClientRect(){this.lspError("AstNode.getBoundingClientRect")}is(n){return this.type===n}getLines(){return we(c(this,wr),()=>{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,wr,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!`)}};Ar=new WeakMap,Ut=new WeakMap,zt=new WeakMap,wr=new WeakMap,Sr=new WeakMap,Dt=new WeakMap,Wt=new WeakMap,Cr=new WeakSet,Pn=function(){let n=this.getLines(),e=n[n.length-1];return{height:n.length,width:e[2]-e[1]}}});var Ze,Bn,On,en,ps=v(()=>{"use strict";ne();de();gs();jn();en=class extends Ht{constructor(){super(...arguments);b(this,Ze)}get length(){return this.childNodes.length}text(e){return Te(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 $r(this,e,1)[0]}insertAt(e,t=this.length){return $r(this,t,0,[e]),e}closest(e){let t=Zr(e,this),{parentNode:r}=this;for(;r;){if(t(r))return r;({parentNode:r}=r)}}querySelector(e){let t=Zr(e,this);return S(this,Ze,Bn).call(this,t)}querySelectorAll(e){let t=Zr(e,this);return S(this,Ze,On).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":""}">`)+qe(this.childNodes,e)+(t===""?"":"</span>"):""}json(e,t=this.getAbsoluteIndex()){let r={...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}};Ze=new WeakSet,Bn=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,Ze,Bn).call(t,e);if(i)return i}},On=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,Ze,On).call(r,e)]);return t}});var qn,cs,tl,rl,nl,il,sl,us,_n,tn,hs,Nr,ms=v(()=>{"use strict";ne();M();G();jn();qn=String.raw`[${Ae}\t]*`,cs=String.raw`<\s*(?:/\s*)?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|(?:rfc|pmid)(?=[-::]?${qn}\d)|isbn(?=[-::]?${qn}(?:\d(?:${qn}|-)){6})`,tl=new RegExp(String.raw`${cs}|https?[:/]/+`,"giu"),rl=new RegExp(cs,"giu"),nl=new Set(["attr-value","ext-link-text","link-text"]),il={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},sl={"<":"tag-like","[":"lonely-bracket","{":"lonely-bracket","]":"lonely-bracket","}":"lonely-bracket",h:"lonely-http",r:"lonely-http",p:"lonely-http",i:"lonely-http"},us=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{_n=new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch{_n=/\w/u}Nr=class extends Ht{constructor(e){super();b(this,tn);le(this,"data","");this.data=e}get type(){return"text"}toString(e){var t;return e&&!((t=this.parentNode)!=null&&t.getAttribute("built"))?se(this.data):this.data}text(){return this.data}lint(e=this.getAbsoluteIndex(),t){var K,re,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:J}=p;if(W!=="ext-attr")d=!0;else if(J==="ref"&&(z==="name"||z==="extends"||z==="follow")||z==="group"&&(J==="ref"||J==="references")||J==="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?rl:tl),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],...us]);for(let W=t.exec(r);W;W=t.exec(r)){let[,z,J]=W,{index:Q,0:_}=W;if(J&&J!=="]"){let{length:fe}=J;Q+=fe,_=_.slice(fe)}_=_.toLowerCase();let[O]=_,ve=O==="r"||O==="p"||O==="i",{length:ue}=_;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"&&((K=s.innerText)!=null&&K.includes("]")))||ve&&(!i.isPlain()||nl.has(l)))continue;O==="]"&&(Q||ue>1)&&t.lastIndex--;let me=e+Q,Ke=me+ue,Je=T[Ke],Jr=T[me-1],gt=ue>1&&!(O==="<"&&(/^<\s/u.test(_)||!/[\s/>]/u.test(Je!=null?Je:"")||us.has(z))||d&&(O==="["||O==="]")||ve&&l==="parameter-value"||/^(?:rfc|pmid|isbn)$/iu.test(_))||O==="{"&&(Je===O||Jr==="-"&&w.length>0)||O==="}"&&(Jr===O||Je==="-"&&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",Nn=O==="{"||O==="[";if(gt==="warning"&&(Nn||(O==="]"||O==="}"))){let fe=il[O],In=Nn?r.slice(Q+1):r.slice(0,Q);if(O==="{"&&((re=fe.exec(In))==null?void 0:re[0])==="}"||O==="}"&&((q=fe.exec(In))==null?void 0:q[0])==="{")continue;if(!In.includes(O)){let Xi=Nn?"nextSibling":"previousSibling",pt=this[Xi];for(;pt&&(pt.type!=="text"||!fe.test(pt.data));)pt=pt[Xi];if(pt&&fe.exec(pt.data)[0]!==O)continue}}ve?_=_.toUpperCase():_==="{"&&Jr==="-"&&gt==="error"?(gt="warning",Q>0&&(_="-{",Q--,me--,ue=2)):_==="}"&&Je==="-"&&gt==="error"&&(gt="warning",Q<r.length-1&&(_="}-",Ke++,ue=2));let Hi=this.posFromIndex(Q),{line:Gi,character:Vi}=Rn(I,j,Hi.top+1,Hi.left),jt={rule:sl[O],message:C.msg('lonely "$1"',ve||O==="h"||_==="-{"||_==="}-"?_:O),severity:gt,startIndex:me,endIndex:Ke,startLine:Gi,endLine:Gi,startCol:Vi,endCol:Vi+ue};if(O==="<")jt.suggestions=[{desc:"escape",range:[me,me+1],text:"&lt;"}];else if(O==="h"&&l!=="link-text"&&_n.test(Jr||""))jt.suggestions=[{desc:"whitespace",range:[me,me],text:" "}];else if(O==="["&&l==="ext-link-text"){let fe=i.getAbsoluteIndex()+i.toString().length;jt.suggestions=[{desc:"escape",range:[fe,fe+1],text:"&#93;"}]}else if(O==="]"&&f==="free-ext-link"&&gt==="error"){let fe=e-o.toString().length;jt.suggestions=[{desc:"left bracket",range:[fe,fe],text:"["}]}else ve&&(jt.suggestions=[...W[0]===_?[]:[{desc:"uppercase",range:[me,Ke],text:_}],...Je===":"||Je===":"?[{desc:"whitespace",range:[Ke,Ke+1],text:" "}]:[]]);u.push(jt)}return u}replaceData(e){S(this,tn,hs).call(this,e)}print(){return ht(this.data)}};tn=new WeakSet,hs=function(e){this.setAttribute("data",e)}});var ye,mt=v(()=>{"use strict";de();ye=(a=!0,n=!0)=>e=>{class t extends e{text(){return""}lint(i){return a?[]:super.lint(i)}}return Ee(t,e),t}});var Ir,ce,ft=v(()=>{"use strict";B();ce=class extends A{constructor(e,t,r,i,s){super(e,r,i,s);b(this,Ir);y(this,Ir,t)}get type(){return c(this,Ir)}lint(e=this.getAbsoluteIndex()){return super.lint(e,!1)}};Ir=new WeakMap});var ge,_e=v(()=>{"use strict";de();ge=({length:a})=>n=>{class e extends n{getAttribute(r){return r==="padding"?a:super.getAttribute(r)}}return Ee(e,n),e}});var Gt,Y,Me=v(()=>{"use strict";B();Y=class extends A{constructor(e,t,r,i,s){super(e,r,i,s);b(this,Gt);y(this,Gt,t)}get type(){return c(this,Gt)}set type(e){y(this,Gt,e)}getAttribute(e){var t;return e==="invalid"?this.type==="converter-flag"&&!!((t=this.parentNode)!=null&&t.isInvalidFlag(this)):super.getAttribute(e)}};Gt=new WeakMap});var ol,fs,xt,Se,Ue,Mn,al,xe,Er=v(()=>{"use strict";M();ne();ie();_e();B();Me();ol=a=>a==="redirect-target"||a==="link";fs=[ge("[[")];xe=class extends(al=A){constructor(e,t,r,i=[],s="|"){super(void 0,r,i,{});b(this,xt,!0);b(this,Se);b(this,Ue);if(this.insertAt(new Y(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,Se,s)}get link(){}get fragment(){return c(this,Ue).fragment}afterBuild(){y(this,Ue,this.getTitle()),c(this,Se).includes("\0")&&y(this,Se,this.buildFromStr(c(this,Se),0)),this.setAttribute("name",c(this,Ue).title),super.afterBuild()}setAttribute(e,t){e==="bracket"?y(this,xt,t):e==="title"?y(this,Ue,t):super.setAttribute(e,t)}toString(e){let t=super.toString(e,c(this,Se));return c(this,xt)?`[[${t}]]`:t}text(){let e=super.text("|");return c(this,xt)?`[[${e}]]`:e}getAttribute(e){return e==="title"?c(this,Ue):super.getAttribute(e)}getGaps(e){return e===0?c(this,Se).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,Ue),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:Ye(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&&!ol(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,xt)?{pre:"[[",post:"]]",sep:c(this,Se)}:{sep:c(this,Se)})}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}};Mn=F(al),xt=new WeakMap,Se=new WeakMap,Ue=new WeakMap,xe=P(Mn,0,"LinkBaseToken",fs,xe),R(Mn,1,xe)});var pe,et=v(()=>{"use strict";B();pe=class extends A{get innerText(){return this.firstChild.data}constructor(n="",e,t){super(n,e,t)}}});var xs,Un,ll,D,ze=v(()=>{"use strict";mt();et();xs=[ye()];D=class extends(ll=pe){get type(){return"noinclude"}toString(n){return n?"":super.toString()}};Un=F(ll),D=P(Un,0,"NoincludeToken",xs,D),R(Un,1,D)});var rn,bs=v(()=>{"use strict";M();Er();ze();rn=class extends xe{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 Ts,tt,Vt,zn,dl,bt,ys=v(()=>{"use strict";mt();B();ft();bs();Ts=[ye(!1,!1)];bt=class extends(dl=A){constructor(e,t,r,i,s,o,l=[]){super(void 0,o,l);b(this,tt);b(this,Vt);y(this,tt,e),y(this,Vt,s),this.append(new ce(t,"redirect-syntax",o,l),new rn(r,i==null?void 0:i.slice(1),o,l))}get type(){return"redirect"}getAttribute(e){return e==="padding"?c(this,tt).length:super.getAttribute(e)}toString(e){return c(this,tt)+super.toString(e)+c(this,Vt)}lint(e=this.getAbsoluteIndex()){let t=e+c(this,tt).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",t),this.lastChild.lint(t)}print(){return super.print({pre:c(this,tt),post:c(this,Vt)})}};zn=F(dl),tt=new WeakMap,Vt=new WeakMap,bt=P(zn,0,"RedirectToken",Ts,bt),R(zn,1,bt)});var ks={};ee(ks,{parseRedirect:()=>gl});var gl,vs=v(()=>{"use strict";G();ys();gl=(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 bt(...t.slice(1),n,e),a):!1}});var As,Dn,pl,Tt,ws=v(()=>{"use strict";_e();B();As=[ge("<onlyinclude>")];Tt=class extends(pl=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>'})}};Dn=F(pl),Tt=P(Dn,0,"OnlyincludeToken",As,Tt),R(Dn,1,Tt)});var rt,Lr=v(()=>{"use strict";de();rt=(a=1)=>n=>{class e extends n{getGaps(){return a}}return Ee(e,n),e}});var Ss,nt,Wn,ul,$e,nn=v(()=>{"use strict";Lr();B();Ss=[rt()];$e=class extends(ul=A){constructor(e,t,r,i,s,o=[]){super(void 0,s);b(this,nt);le(this,"closed");le(this,"selfClosing");this.setAttribute("name",e.toLowerCase()),y(this,nt,[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,nt);return t?`<${s}${r.toString(e)}/>`:`<${s}${r.toString(e)}>${i.toString(e)}${this.closed?`</${o}>`:""}`}text(){let[e,t]=c(this,nt);return this.selfClosing?`<${e}${this.firstChild.text()}/>`:`<${e}${super.text(">")}${this.closed?`</${t}>`:""}`}getAttribute(e){return e==="padding"?c(this,nt)[0].length+1:super.getAttribute(e)}print(){let[e,t]=c(this,nt);return super.print(this.selfClosing?{pre:`&lt;${e}`,post:"/&gt;"}:{pre:`&lt;${e}`,sep:"&gt;",post:this.closed?`&lt;/${t}&gt;`:""})}};Wn=F(ul),nt=new WeakMap,$e=P(Wn,0,"TagPairToken",Ss,$e),R(Wn,1,$e)});var on,Cs,sn,$s=v(()=>{"use strict";B();nn();ft();ze();sn=class extends $e{constructor(e,t,r,i=[]){let s=new ce(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,on);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,on,Cs).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>`}};on=new WeakSet,Cs=function(){return this.firstChild.toString()===" nowrap"}});var Ns,Hn,cl,yt,Is=v(()=>{"use strict";M();ie();mt();G();nn();Ns=[ye(!1)];yt=class extends(cl=$e){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}};Hn=F(cl),yt=P(Hn,0,"IncludeToken",Ns,yt),R(Hn,1,yt)});var Xt,an=v(()=>{"use strict";de();Xt=(a=0)=>n=>{var t,Es;class e extends n{constructor(){super(...arguments);b(this,t)}getAttr(o){return S(this,t,Es).call(this).getAttr(o)}}return t=new WeakSet,Es=function(){return this.childNodes[a]},Ee(e,n),e}});var te,Ls,Fs,ln,Vn,Rs,Qt,js,Bs,Os,Gn,Ps,Le,qs,_s,Ms,Us,zs=v(()=>{"use strict";te=new Set(["align"]),Ls=new Set(["cite"]),Fs=new Set(["cite","datetime"]),ln=new Set(["width"]),Vn=new Set(["axis","align","bgcolor","height","width","valign"]),Rs=new Set([...Vn,"abbr","headers","scope","rowspan","colspan"]),Qt=new Set(["type"]),js=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),Bs=new Set(["clear"]),Os=new Set(["bgcolor","align","valign"]),Gn=new Set(["qid","forcemathmode","type","display"]),Ps=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),Le=new Set,qs=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"]),_s={div:te,h1:te,h2:te,h3:te,h4:te,h5:te,h6:te,blockquote:Ls,q:Ls,p:te,br:Bs,pre:ln,ins:Fs,del:Fs,ul:Qt,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...js,"border"]),caption:te,tr:Os,td:Rs,th:Rs,img:new Set(["alt","src","width","height","srcset"]),font:new Set(["size","color","face"]),hr:ln,data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:Qt,poem:te,categorytree:te,combooption:te,math:Le,chem:Le,ce:Le},Ms={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:Le,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:Le,inputbox:Le,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:Le,poll:new Set(["id","show-results-before-voting"]),sm2:Qt,flashmp3:Qt,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([...Gn,"chem"]),chem:Gn,ce:Gn,hiero:Le,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:Ps,syntaxhighlight:Ps,templatedata:Le,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:Le},Us={table:js,td:new Set([...Vn,"scope"]),th:Vn,br:Bs,caption:te,div:te,hr:ln,h1:te,h2:te,h3:te,h4:te,h5:te,h6:te,li:Qt,p:te,pre:ln,tr:Os,ul:Qt}});var hl,ml,Fr,Kt,ae,Fe,Rr,Xn,Jt,Ds=v(()=>{"use strict";M();ne();zs();ie();G();B();Me();hl=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,ml=new Set(["ext","arg","magic-word","template"]),Jt=class extends A{constructor(e,t,r,i="",s,o=[],l=C.getConfig(),g=[]){let p=new Y(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={...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 Y(s,"attr-value",l,g,{});super(void 0,l,g);b(this,Rr);b(this,Fr);b(this,Kt);b(this,ae);b(this,Fe);y(this,Fr,e),this.append(p,d),y(this,ae,i),y(this,Fe,[...o]),y(this,Kt,t),this.setAttribute("name",Oe(se(r)))}get type(){return c(this,Fr)}get tag(){return c(this,Kt)}get balanced(){return!c(this,ae)||c(this,Fe)[0]===c(this,Fe)[1]}afterBuild(){c(this,ae).includes("\0")&&y(this,ae,this.buildFromStr(c(this,ae),0)),this.parentNode&&y(this,Kt,this.parentNode.name),this.setAttribute("name",Oe(this.firstChild.text())),super.afterBuild()}toString(e){let[t="",r=""]=c(this,Fe);return c(this,ae)?super.toString(e,c(this,ae)+t)+r:this.firstChild.toString(e)}text(){return c(this,ae)?`${super.text(`${c(this,ae).trim()}"`)}"`:this.firstChild.text()}getGaps(){var e,t;return c(this,ae)?c(this,ae).length+((t=(e=c(this,Fe)[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,Fe)[0]}],r.push(h)}let d=S(this,Rr,Xn).call(this,e,p);return d&&r.push(d),(u=Us[g])!=null&&u.has(l)&&r.push(N(s,p,"obsolete-attr","obsolete attribute","warning")),r}getValue(){return c(this,ae)?this.lastChild.text().trim():this.type==="ext-attr"||""}getAttribute(e){return e==="invalid"?S(this,Rr,Xn).call(this):super.getAttribute(e)}print(){let[e="",t=""]=c(this,Fe);return c(this,ae)?super.print({sep:ht(c(this,ae))+e,post:t}):super.print()}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return r.tag=this.tag,r}};Fr=new WeakMap,Kt=new WeakMap,ae=new WeakMap,Fe=new WeakMap,Rr=new WeakSet,Xn=function(e,t){let{firstChild:r,lastChild:i,type:s,name:o,tag:l}=this,g=this.getValue(),p=Ms[l],d=_s[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"||!qs.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"&&hl.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})=>ml.has(h))){let h=ds(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 Ws,fl,Qn,Pr,Yt,dn,it,gn=v(()=>{"use strict";M();ne();ie();G();B();Me();Ds();Ws=a=>a.slice(0,-1),fl=a=>`${Ws(a)}-dirty`;try{Qn=new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch{Qn=/[^\W_]/u}it=class extends A{constructor(e,t,r,i,s=[]){super(void 0,i,s,{});b(this,Yt);b(this,Pr);if(y(this,Pr,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 Y(l,fl(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(se(m).trim())){let w=T!=null?T:$,I=[x,k],j=new Jt(Ws(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,Pr)}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 Jt&&(!e||t.name===Oe(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,Yt,dn).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 Jt){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",Qn.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,Yt,dn).call(this):super.getAttribute(e)}print(){return this.toString()?`<span class="wpb-${this.type}${S(this,Yt,dn).call(this)?" wpb-invalid":""}">${this.childNodes.map(e=>e.print(e instanceof Y?{class:e.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}};Pr=new WeakMap,Yt=new WeakSet,dn=function(){let{parentNode:e}=this;return(e==null?void 0:e.type)==="html"&&e.closing&&this.text().trim()!==""}});var Hs={};ee(Hs,{PreToken:()=>Kn});var Kn,Gs=v(()=>{"use strict";B();ze();Kn=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 Zt,pn=v(()=>{"use strict";de();Zt=a=>{class n extends a{toString(t){return super.toString(t,`
1
+ "use strict";(()=>{var zo=Object.defineProperty;var pn=e=>{throw TypeError(e)};var Ho=(e,t,s)=>t in e?zo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var Do=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Se=(e,t,s)=>Ho(e,typeof t!="symbol"?t+"":t,s),Ss=(e,t,s)=>t.has(e)||pn("Cannot "+s);var f=(e,t,s)=>(Ss(e,t,"read from private field"),s?s.call(e):t.get(e)),N=(e,t,s)=>t.has(e)?pn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),L=(e,t,s,n)=>(Ss(e,t,"write to private field"),n?n.call(e,s):t.set(e,s),s),j=(e,t,s)=>(Ss(e,t,"access private method"),s);var fn=(e,t,s,n)=>({set _(l){L(e,t,l,s)},get _(){return f(e,t,n)}});var Ga=Do((Qa,Uo)=>{var Go=Object.create,st=Object.defineProperty,tl=Object.getOwnPropertyDescriptor,zi=Object.getOwnPropertyNames,Vo=Object.prototype.hasOwnProperty,sl=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),it=e=>{throw TypeError(e)},il=(e,t,s)=>t in e?st(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,xn=(e,t)=>st(e,"name",{value:t,configurable:!0}),T=(e,t)=>function(){return e&&(t=(0,e[zi(e)[0]])(e=0)),t},Qo=(e,t)=>function(){return t||(0,e[zi(e)[0]])((t={exports:{}}).exports,t),t.exports},Y=(e,t)=>{for(var s in t)st(e,s,{get:t[s],enumerable:!0})},Jo=(e,t,s,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of zi(t))!Vo.call(e,l)&&l!==s&&st(e,l,{get:()=>t[l],enumerable:!(n=tl(t,l))||n.enumerable});return e},G=e=>Jo(st({},"__esModule",{value:!0}),e),Z=e=>{var t;return[,,,Go((t=e==null?void 0:e[sl("metadata")])!=null?t:null)]},nl=["class","method","getter","setter","accessor","field","value","get","set"],ft=e=>e!==void 0&&typeof e!="function"?it("Function expected"):e,Xo=(e,t,s,n,l)=>({kind:nl[e],name:t,metadata:n,addInitializer:i=>s._?it("Already initialized"):l.push(ft(i||null))}),os=(e,t)=>il(t,sl("metadata"),e[3]),ee=(e,t,s,n)=>{for(var l=0,i=e[t>>1],r=i&&i.length;l<r;l++)t&1?i[l].call(s):n=i[l].call(s,n);return n},te=(e,t,s,n,l,i)=>{var r,o,a,h,d,u=t&7,g=!!(t&8),c=!!(t&16),p=u>3?e.length+1:u?g?1:2:0,v=nl[u+5],m=u>3&&(e[p-1]=[]),x=e[p]||(e[p]=[]),b=u&&(!c&&!g&&(l=l.prototype),u<5&&(u>3||!c)&&tl(u<4?l:{get[s](){return de(this,i)},set[s](y){return fe(this,i,y)}},s));u?c&&u<4&&xn(i,(u>2?"set ":u>1?"get ":"")+s):xn(l,s);for(var w=n.length-1;w>=0;w--)h=Xo(u,s,a={},e[3],x),u&&(h.static=g,h.private=c,d=h.access={has:c?y=>Yo(l,y):y=>s in y},u^3&&(d.get=c?y=>(u^1?de:It)(y,l,u^4?i:b.get):y=>y[s]),u>2&&(d.set=c?(y,A)=>fe(y,l,A,u^4?i:b.set):(y,A)=>y[s]=A)),o=(0,n[w])(u?u<4?c?i:b[v]:u>4?void 0:{get:b.get,set:b.set}:l,h),a._=1,u^4||o===void 0?ft(o)&&(u>4?m.unshift(o):u?c?i=o:b[v]=o:l=o):typeof o!="object"||o===null?it("Object expected"):(ft(r=o.get)&&(b.get=r),ft(r=o.set)&&(b.set=r),ft(r=o.init)&&m.unshift(r));return u||os(e,l),b&&st(l,s,b),c?u^4?i:b:l},Ko=(e,t,s)=>il(e,typeof t!="symbol"?t+"":t,s),Hi=(e,t,s)=>t.has(e)||it("Cannot "+s),Yo=(e,t)=>Object(t)!==t?it('Cannot use the "in" operator on this value'):e.has(t),de=(e,t,s)=>(Hi(e,t,"read from private field"),s?s.call(e):t.get(e)),Ae=(e,t,s)=>t.has(e)?it("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,s),fe=(e,t,s,n)=>(Hi(e,t,"write to private field"),n?n.call(e,s):t.set(e,s),s),It=(e,t,s)=>(Hi(e,t,"access private method"),s),Zo=(e,t,s,n)=>({set _(l){fe(e,t,l,s)},get _(){return de(e,t,n)}}),rl,Di,ll=T({"base.ts"(){"use strict";rl=(()=>{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})(),Di=(()=>{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 n=>{const l=typeof n=="string"?t:s;if(l.has(n)){const r=l.get(n);return r.lastIndex=0,r}const i=e(n);return l.set(n,i),i}}var Nt,ol,Et=T({"../common/dist/index.mjs"(){"use strict";Nt=e=>decodeURIComponent(e.replace(/%(?![\da-f]{2})/giu,"%25")),ol=Ke}}),Ce,As,Ye,Ze,et,ke,He,al,me,Be,mn,vn,Lt,dl,bn,wn,Ft,tt,oe=T({"util/string.ts"(){"use strict";Et(),Ce=String.raw` \xA0\u1680\u2000-\u200A\u202F\u205F\u3000`,As=String.raw`[^[\]<>"\0-\x1F\x7F${Ce}\uFFFD]`,Ye=String.raw`(?:\[[\da-f:.]+\]|${As})`,Ze=String.raw`(?:${As}|\0\d+[cn!~]\x7F)*`,et=e=>e.trim().toLowerCase(),ke=(e,t)=>e.replace(/\0(\d+)\x7F/gu,(s,n)=>t[n]),He=(e,t)=>s=>s.replace(e,t),al=He(/[\0\x7F]|\r$/gmu,""),me=He(/\0\d+[cn]\x7F/gu,""),Be=(e,t="")=>e.map(s=>typeof s=="string"?s:s.text()).join(t),mn={lt:"<",gt:">",lbrack:"[",rbrack:"]",lbrace:"{",rbrace:"}",nbsp:" ",amp:"&",quot:'"'},vn=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)):mn[s.toLowerCase()]),Lt=e=>vn(e),dl=He(/&#(\d+|x[\da-f]+);/giu,(e,t)=>String.fromCodePoint(+((/^x/iu.test(t)?"0":"")+t))),bn={"&":"amp","<":"lt",">":"gt",'"':"quot","\n":"#10"},wn=e=>He(e,t=>`&${bn[t]};`),Ft=wn(/[&<>]/gu),tt=(e,t={})=>{const{pre:s="",post:n="",sep:l=""}=t;return s+e.map(i=>i.print()).join(l)+n}}}),ea=Qo({"config/minimum.json"(e,t){t.exports={ext:[],html:[["b","bdi","del","i","ins","u","font","big","small","sub","sup","h1","h2","h3","h4","h5","h6","cite","code","em","s","strike","strong","tt","var","div","center","blockquote","ol","ul","dl","table","caption","pre","ruby","rb","rp","rt","rtc","p","span","abbr","dfn","kbd","samp","data","time","mark","tr","td","th","q","bdo"],["li","dt","dd"],["br","wbr","hr","meta","link"]],namespaces:{0:"",6:"File",10:"Template",14:"Category",828:"Module"},nsid:{"":0,file:6,template:10,category:14,module:828},functionHook:["msgnw"],variable:["!","=","pageid","articlepath","server","servername","scriptpath","stylepath"],parserFunction:[{msgnw:"msgnw",pageid:"pageid",articlepath:"articlepath",server:"server",servername:"servername",scriptpath:"scriptpath",stylepath:"stylepath","#language":"language","#special":"special","#speciale":"speciale","#tag":"tag","#formatdate":"formatdate","#dateformat":"formatdate","#invoke":"invoke","#while":"while","#dowhile":"dowhile","#loop":"loop","#forargs":"forargs","#fornumargs":"fornumargs","#if":"if","#ifeq":"ifeq","#switch":"switch","#ifexist":"ifexist","#ifexpr":"ifexpr","#iferror":"iferror","#time":"time","#timel":"timel","#expr":"expr","#rel2abs":"rel2abs","#titleparts":"titleparts","#categorytree":"categorytree","#urldecode":"urldecode","#choose":"choose","#var":"var","#varexists":"varexists","#var_final":"var_final","#vardefine":"vardefine","#vardefineecho":"vardefineecho","#widget":"widget","#related":"related","#regex":"regex","#regex_var":"regex_var","#regexquote":"regexquote","#regexall":"regexall","#len":"len","#pos":"pos","#rpos":"rpos","#sub":"sub","#count":"count","#rmatch":"rmatch","#rreplace":"rreplace","#replace":"replace","#rsplit":"rsplit","#explode":"explode","#tab":"tab","#seo":"seo","#babel":"babel","#translation":"translation","#commaseparatedlist":"commaseparatedlist","#coordinates":"coordinates","#lst":"lst","#lsth":"lsth","#lstx":"lstx","#assessment":"assessment","#mentor":"mentor","#property":"property","#target":"target","#section":"lst","#section-x":"lstx","#section-h":"lsth","#statements":"statements","#useliquidthreads":"useliquidthreads","#lqtpagelimit":"lqtpagelimit","#avatar":"avatar","#chart":"chart"},{"!":"!","=":"=","#FORMAL":"formal","#bcp47":"bcp47","#dir":"dir","#interwikilink":"interwikilink","#interlanguagelink":"interlanguagelink","#timef":"timef","#timefl":"timefl"},["msg","raw"],["subst","safesubst"]],doubleUnderscore:[[],[]],protocol:"bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|matrix:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|wikipedia://|worldwind://|xmpp:",interwiki:[],img:{},redirection:["#redirect"],variants:[]}}}),xe,Ci,qe=T({"util/constants.ts"(){"use strict";xe=11,Ci=ea()}}),le,ae=T({"lib/rect.ts"(){"use strict";var e,t,s,n,Ii,i;le=(i=class{constructor(r,o){N(this,n);N(this,e);N(this,t);N(this,s);L(this,e,r),L(this,t,o)}get start(){return f(this,t)}get top(){return j(this,n,Ii).call(this).top}get left(){return j(this,n,Ii).call(this).left}},e=new WeakMap,t=new WeakMap,s=new WeakMap,n=new WeakSet,Ii=function(){var r;return(r=f(this,s))!=null||L(this,s,f(this,e).getRootNode().posFromIndex(f(this,t))),f(this,s)},i)}}),yn,Sn,Tt,Ni,ks,R,V,Oe,hl,M=T({"util/lint.ts"(){"use strict";pe(),ae(),B(),yn=new Set(["tr","td","th","caption"]),Sn=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")&&Sn.has(t.name)||t.is("html")&&yn.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(2)?2:s.includes(1)&&1}catch{}return t.is("template")||t.is("magic-word")&&t.name==="invoke"?1:2},Ni=(e,t,s,n)=>({line:e+s-1,character:(s===1?t:0)+n}),ks=e=>(t,s,n,l,i="error")=>{const{start:r}=s,{top:o,left:a}=s instanceof le?s:new le(t,r),{offsetHeight:h,offsetWidth:d}=t,{startIndex:u,startLine:g,startCol:c}=e(t,r,o,a),{line:p,character:v}=Ni(g,c,h,d);return{rule:n,message:_.msg(l),severity:i,startIndex:u,endIndex:u+t.toString().length,startLine:g,endLine:p,startCol:c,endCol:v}},R=ks((e,t,s,n)=>{const l=e.getRelativeIndex(),{top:i,left:r}=e.parentNode.posFromIndex(l);return{startIndex:t+l,startLine:s+i,startCol:i?r:n+r}}),V=ks((e,t,s,n)=>({startIndex:t,startLine:s,startCol:n})),Oe=(e,t,s,n)=>{if(e&&(n||_.viewOnly&&e[0]===ve.rev))return e[1];const l=t();return(n||_.viewOnly)&&s([ve.rev,l]),l},hl=(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"]:[]}}),An,Xt,ta=T({"parser/selector.ts"(){"use strict";An=(e,t,s)=>{if(e.includes("#")){const[n,...l]=e.split("#");return(!n||n===t)&&l.every(i=>i===s)}return!e||e===t},Xt=(e,t,s)=>({type:n,name:l})=>e.split(",").some(i=>An(i.trim(),n,l))}}),as,Gi=T({"mixin/cached.ts"(){"use strict";M(),as=(e=!0)=>t=>{const s=new WeakMap;return function(...n){return Oe(s.get(this),()=>t.apply(this,n),l=>{s.set(this,l)},e)}}}}),kn,Ot,ot,at,Bt,dt,ht,qt,_s,Wt,Ct,ul=T({"lib/node.ts"(){"use strict";M(),pe(),Gi(),B(),kn=[as(!1)],Ct=class{constructor(){ee(Wt,5,this),Ae(this,qt),Ko(this,"childNodes",[]),Ae(this,Ot),Ae(this,ot),Ae(this,at),Ae(this,Bt),Ae(this,dt),Ae(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 It(this,qt,_s).call(this).height}get offsetWidth(){return It(this,qt,_s).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":_.viewOnly&&fe(this,dt,[ve.rev,t]);break;default:this[e]=t}}getRootNode(){return Oe(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(),n=s.findIndex(([,,l])=>e<=l);return{top:n,left:e-s[n][1]}}}getGaps(e){return 0}getRelativeIndex(e){if(e===void 0){const{parentNode:t}=this;return t?t.getRelativeIndex(t.childNodes.indexOf(this)):0}return Oe(de(this,ht)[e],()=>{const{childNodes:t}=this,s=e+(e<0?t.length:0);let n=this.getAttribute("padding");for(let l=0;l<s;l++)_.viewOnly&&(de(this,ht)[l]=[ve.rev,n]),n+=t[l].toString().length+this.getGaps(l);return n},t=>{de(this,ht)[e]=t})}getAbsoluteIndex(){return Oe(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 n=t+s.length;e.push([s,t,n]),t=n+1}return e}seal(e,t){const s=!t&&!!this[e];Object.defineProperty(this,e,{enumerable:s,configurable:!0})}lspError(e){throw new Error(`${e} method is only available in the LSP version!`)}},Wt=Z(null),Ot=new WeakMap,ot=new WeakMap,at=new WeakMap,Bt=new WeakMap,dt=new WeakMap,ht=new WeakMap,qt=new WeakSet,_s=function(){const e=this.getLines(),t=e[e.length-1];return{height:e.length,width:t[2]-t[1]}},te(Wt,1,"getLines",kn,Ct),os(Wt,Ct)}}),cl,sa=T({"lib/element.ts"(){"use strict";var e,Li,Fi,n;oe(),pe(),ta(),ul(),cl=(n=class extends Ct{constructor(){super(...arguments);N(this,e)}get length(){return this.childNodes.length}text(i){return Be(this.childNodes,i)}normalize(){const i=this.getChildNodes(),r=o=>{var a,h;i.splice(o,1),(a=i[o-1])==null||a.setAttribute("nextSibling",i[o]),(h=i[o])==null||h.setAttribute("previousSibling",i[o-1])};for(let o=i.length-1;o>=0;o--){const{type:a,data:h}=i[o];a!=="text"||i.length===1||this.getGaps(o-(o&&1))||h===""&&r(o)}this.setAttribute("childNodes",i)}removeAt(i){return ls(this,i,1)[0]}insertAt(i,r=this.length){return ls(this,r,0,[i]),i}closest(i){const r=Xt(i,this);let{parentNode:o}=this;for(;o;){if(r(o))return o;({parentNode:o}=o)}}querySelector(i){const r=Xt(i,this);return j(this,e,Li).call(this,r)}querySelectorAll(i){const r=Xt(i,this);return j(this,e,Fi).call(this,r)}append(...i){this.safeAppend(i)}safeAppend(i){for(const r of i)this.insertAt(r)}replaceChildren(...i){this.safeReplaceChildren(i)}safeReplaceChildren(i){for(let r=this.length-1;r>=0;r--)this.removeAt(r);this.safeAppend(i)}setText(i,r=0){r+=r<0?this.length:0;const o=this.childNodes[r],{data:a}=o;return o.replaceData(i),a}toString(i,r=""){return this.childNodes.map(o=>o.toString(i)).join(r)}caretPositionFromIndex(i){this.lspError("AstElement.caretPositionFromIndex")}elementFromIndex(i){this.lspError("AstElement.elementFromIndex")}elementFromPoint(i,r){this.lspError("AstElement.elementFromPoint")}lint(i=this.getAbsoluteIndex(),r){const o=[];for(let a=0,h=i+this.getAttribute("padding");a<this.length;a++){const d=this.childNodes[a];d.setAttribute("aIndex",h);const u=d.lint(h,r);u.length>0&&o.push(...u),h+=d.toString().length+this.getGaps(a)}return o}print(i={}){const r=i.class;return this.toString()?(r===""?"":`<span class="wpb-${r!=null?r:this.type}${this.getAttribute("invalid")?" wpb-invalid":""}">`)+tt(this.childNodes,i)+(r===""?"":"</span>"):""}json(i,r=this.getAbsoluteIndex()){const o={...this,type:this.type,range:[r,r+this.toString().length],childNodes:[]};for(let a=0,h=r+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,Li=function(i){var r;for(const o of this.childNodes){if(o.type==="text")continue;if(i(o))return o;const a=j(r=o,e,Li).call(r,i);if(a)return a}},Fi=function(i){var o;let r=[];for(const a of this.childNodes)a.type!=="text"&&(i(a)&&r.push(a),r=[...r,...j(o=a,e,Fi).call(o,i)]);return r},n)}}),Mt,$s,_n,$n,Tn,Cn,Ts,Cs,ji,ia=T({"lib/text.ts"(){"use strict";var e,gl,s;oe(),M(),B(),ul(),Mt=String.raw`[${Ce}\t]*`,$s=String.raw`<\s*(?:/\s*)?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*?\])|((?:^|\])[^[]*?)\]+|(?:rfc|pmid)(?=[-::]?${Mt}\d)|isbn(?=[-::]?${Mt}(?:\d(?:${Mt}|-)){6})`,_n=new RegExp(String.raw`${$s}|https?[:/]/+`,"giu"),$n=new RegExp($s,"giu"),Tn=new Set(["attr-value","ext-link-text","link-text"]),Cn={"[":/[[\]]/u,"{":/[{}]/u,"]":/[[\]](?=[^[\]]*$)/u,"}":/[{}](?=[^{}]*$)/u},Ts=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{Cs=new RegExp(String.raw`[\p{L}\p{N}_]`,"u")}catch{Cs=/\w/u}ji=(s=class extends Ct{constructor(l){super();N(this,e);Se(this,"data","");this.data=l}get type(){return"text"}toString(l){var i;return l&&!((i=this.parentNode)!=null&&i.getAttribute("built"))?me(this.data):this.data}text(){return this.data}lint(l=this.getAbsoluteIndex(),i){var C,I,U;if(i===!1)return[];const{data:r,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:g}=o;if(d==="attr-value"){const{name:F,tag:P}=g;if(P==="ref"&&(F==="name"||F==="extends"||F==="follow")||F==="group"&&(P==="ref"||P==="references")||P==="choose"&&(F==="before"||F==="after"))return[]}if(i!=null||(i=d==="free-ext-link"||d==="ext-link-url"||d==="ext-link-text"||d==="image-parameter"&&u==="link"||d==="attr-value"?$n:_n),r.search(i)===-1)return[];i.lastIndex=0;const c=[],p=a==null?void 0:a.type,v=a==null?void 0:a.name,m=h==null?void 0:h.type,x=this.getRootNode(),b=x.toString(),{ext:w,html:y,variants:A}=x.getAttribute("config"),{top:k,left:S}=x.posFromIndex(l),$=new Set(["onlyinclude","noinclude","includeonly",...w,...y[0],...y[1],...y[2],...Ts]);for(let F=i.exec(r);F;F=i.exec(r)){const[,P,X]=F;let{index:W,0:Q}=F;if(X&&X!=="]"){const{length:ce}=X;W+=ce,Q=Q.slice(ce)}Q=Q.toLowerCase();const[z]=Q,ie=z==="r"||z==="p"||z==="i",q=z==="{",D=z==="}",H=z==="[",J=z==="]";let{length:ne}=Q;if(z==="<"&&!$.has(P.toLowerCase())||H&&d==="ext-link-text"&&(/&(?:rbrack|#93|#x5[Dd];);/u.test(r.slice(W+1))||a!=null&&a.is("ext")&&v==="nowiki"&&((C=a.innerText)!=null&&C.includes("]")))||ie&&(!o.isPlain()||Tn.has(d)))continue;J&&(W||ne>1)&&i.lastIndex--;let K=l+W,re=K+ne,ue,ye;const je=b[re],ms=b[K-1],vs=q||H,bs=q&&ms==="-"&&A.length>0,ws=D&&je==="-"&&A.length>0,dn=H&&p==="free-ext-link"&&!r.slice(W+1).trim()||J&&m==="free-ext-link"&&!r.slice(0,W).includes("]");if(ie)ue="lonely-http",Q=Q.toUpperCase(),ye=_.lintConfig.getSeverity(ue,Q);else if(z==="<"){ue="tag-like";let ce;/^<\s/u.test(Q)||!/[\s/>]/u.test(je!=null?je:"")?ce="invalid":Ts.has(P)&&(ce="disallowed"),ye=_.lintConfig.getSeverity(ue,ce)}else if(bs||ws)ue="lonely-bracket",ye=_.lintConfig.getSeverity(ue,"converter"),bs&&W>0?(Q="-{",W--,K--,ne=2):ws&&W<r.length-1&&(Q="}-",re++,ne=2);else if(dn)ue="lonely-bracket",ye=_.lintConfig.getSeverity(ue,"extLink");else if(vs||D||J)if(ue="lonely-bracket",ne>1||q&&je===z||D&&ms===z)ye=_.lintConfig.getSeverity(ue,"double");else{if(!H||d!=="ext-link-text"){const ce=Cn[z],ys=vs?r.slice(W+1):r.slice(0,W);if(q&&((I=ce.exec(ys))==null?void 0:I[0])==="}"||D&&((U=ce.exec(ys))==null?void 0:U[0])==="{")continue;if(!ys.includes(z)){const gn=vs?"nextSibling":"previousSibling";let Ee=this[gn];for(;Ee&&(Ee.type!=="text"||!ce.test(Ee.data));)Ee=Ee[gn];if(Ee&&ce.exec(Ee.data)[0]!==z)continue}}ye=_.lintConfig.getSeverity(ue,"single")}else ue="lonely-http",ye=_.lintConfig.getSeverity(ue);if(!ye)continue;const hn=this.posFromIndex(W),{line:un,character:cn}=Ni(k,S,hn.top+1,hn.left),ze={rule:ue,message:_.msg('lonely "$1"',ie||z==="h"||bs||ws?Q:z),severity:ye,startIndex:K,endIndex:re,startLine:un,endLine:un,startCol:cn,endCol:cn+ne};if(z==="<")ze.suggestions=[{desc:"escape",range:[K,K+1],text:"&lt;"}];else if(z==="h"&&d!=="link-text"&&Cs.test(ms||""))ze.suggestions=[{desc:"whitespace",range:[K,K],text:" "}];else if(H&&d==="ext-link-text"){const ce=o.getAbsoluteIndex()+o.toString().length;ze.suggestions=[{desc:"escape",range:[ce,ce+1],text:"&#93;"}]}else if(J&&dn){const ce=l-h.toString().length;ze.suggestions=[{desc:"left bracket",range:[ce,ce],text:"["}]}else ie&&(ze.suggestions=[...F[0]===Q?[]:[{desc:"uppercase",range:[K,re],text:Q}],...je===":"||je===":"?[{desc:"whitespace",range:[re,re+1],text:" "}]:[]]);c.push(ze)}return c}replaceData(l){j(this,e,gl).call(this,l)}print(){return Ft(this.data)}},e=new WeakSet,gl=function(l){this.setAttribute("data",l)},s)}}),We,nt=T({"mixin/hidden.ts"(){"use strict";pe(),We=(e=!0,t=!0)=>s=>{class n extends s{text(){return""}lint(i){return e?[]:super.lint(i)}}return lt(n,s),n}}}),Me,rt=T({"src/syntax.ts"(){"use strict";var e,t;O(),Me=(t=class extends E{constructor(n,l,i,r,o){super(n,i,r,o);N(this,e);L(this,e,l)}get type(){return f(this,e)}lint(n=this.getAbsoluteIndex()){return super.lint(n,!1)}},e=new WeakMap,t)}}),_e,Ie=T({"mixin/padded.ts"(){"use strict";pe(),_e=({length:e})=>t=>{class s extends t{getAttribute(l){return l==="padding"?e:super.getAttribute(l)}}return lt(s,t),s}}}),ge,Ne=T({"src/atom.ts"(){"use strict";var e,t;O(),ge=(t=class extends E{constructor(n,l,i,r,o){super(n,i,r,o);N(this,e);L(this,e,l)}get type(){return f(this,e)}set type(n){L(this,e,n)}getAttribute(n){var l;return n==="invalid"?this.type==="converter-flag"&&!!((l=this.parentNode)!=null&&l.isInvalidFlag(this)):super.getAttribute(n)}},e=new WeakMap,t)}}),In,Nn,Is,Ln,Te,ds=T({"src/link/base.ts"(){"use strict";var e,t,s,n;M(),qe(),oe(),ae(),Ie(),B(),O(),Ne(),In=l=>l==="redirect-target"||l==="link",Nn=[_e("[[")],Te=(n=class extends(Ln=E){constructor(i,r,o,a=[],h="|"){super(void 0,o,a,{});N(this,e,!0);N(this,t);N(this,s);if(this.insertAt(new ge(i,"link-target",o,a,{})),r!==void 0){const d=new E(r,o,a,{});d.type="link-text",d.setAttribute("stage",xe-1),this.insertAt(d)}L(this,t,h)}get link(){}get fragment(){return f(this,s).fragment}afterBuild(){L(this,s,this.getTitle()),f(this,t).includes("\0")&&L(this,t,this.buildFromStr(f(this,t),0)),this.setAttribute("name",f(this,s).title),super.afterBuild()}setAttribute(i,r){i==="bracket"?L(this,e,r):i==="title"?L(this,s,r):super.setAttribute(i,r)}toString(i){const r=super.toString(i,f(this,t));return f(this,e)?`[[${r}]]`:r}text(){const i=super.text("|");return f(this,e)?`[[${i}]]`:i}getAttribute(i){return i==="title"?f(this,s):super.getAttribute(i)}getGaps(i){return i===0?f(this,t).length:1}lint(i=this.getAbsoluteIndex(),r){const o=super.lint(i,r),{childNodes:[a,h],type:d}=this,{encoded:u,fragment:g}=f(this,s),c=new le(this,i);let p="unknown-page",v=_.lintConfig.getSeverity(p);if(v&&a.childNodes.some(({type:m})=>m==="template")&&o.push(R(a,c,p,"template in an internal link target",v)),p="url-encoding",v=_.lintConfig.getSeverity(p),v&&u){const m=R(a,c,p,"unnecessary URL encoding in an internal link",v);m.fix={desc:"decode",range:[m.startIndex,m.endIndex],text:Nt(a.text())},o.push(m)}if(p="pipe-like",v=_.lintConfig.getSeverity(p,"link"),v&&(d==="link"||d==="category")){const m=h==null?void 0:h.childNodes.findIndex(b=>b.type==="text"&&b.data.includes("|")),x=h==null?void 0:h.childNodes[m];if(x){const b=R(h,c,p,'additional "|" in the link text',v),w=b.startIndex+h.getRelativeIndex(m);b.suggestions=[{desc:"escape",range:[w,w+x.data.length],text:x.data.replace(/\|/gu,"&#124;")}],o.push(b)}}if(p="no-ignored",v=_.lintConfig.getSeverity(p,"fragment"),v&&g!==void 0&&!In(d)){const m=R(a,c,p,"useless fragment",v),x=a.childNodes.findIndex(w=>w.type==="text"&&w.data.includes("#")),b=a.childNodes[x];b&&(m.fix={desc:"remove",range:[m.startIndex+a.getRelativeIndex(x)+b.data.indexOf("#"),m.endIndex],text:""}),o.push(m)}return o}getTitle(i,r){return this.normalizeTitle(this.firstChild.text(),0,{halfParsed:r,temporary:i,decode:!0,selfLink:!0})}print(){return super.print(f(this,e)?{pre:"[[",post:"]]",sep:f(this,t)}:{sep:f(this,t)})}json(i,r=this.getAbsoluteIndex()){const o=super.json(void 0,r),{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,n),Is=Z(Ln),Te=te(Is,0,"LinkBaseToken",Nn,Te),ee(Is,1,Te)}}),Le,Ue=T({"src/nowiki/base.ts"(){"use strict";O(),Le=class extends E{get innerText(){return this.firstChild.data}constructor(e="",t,s){super(e,t,s)}}}}),Fn,Ns,jn,he,Fe=T({"src/nowiki/noinclude.ts"(){"use strict";nt(),Ue(),Fn=[We()],he=class extends(jn=Le){get type(){return"noinclude"}toString(e){return e?"":super.toString()}},Ns=Z(jn),he=te(Ns,0,"NoincludeToken",Fn,he),ee(Ns,1,he)}}),pl,na=T({"src/link/redirectTarget.ts"(){"use strict";M(),B(),ds(),Fe(),pl=class extends Te{get type(){return"redirect-target"}constructor(e,t,s,n){super(e,void 0,s,n),t!==void 0&&this.insertAt(new he(t,s,n))}getTitle(){return this.normalizeTitle(this.firstChild.toString(),0,{halfParsed:!0,decode:!0})}lint(e=this.getAbsoluteIndex()){const t=super.lint(e,!1),s="no-ignored",n=_.lintConfig.getSeverity(s,"redirect");if(n&&this.length===2){const l=R(this.lastChild,{start:e},s,"useless link text",n);l.startIndex--,l.startCol--,l.fix={desc:"remove",range:[l.startIndex,l.endIndex],text:""},t.push(l)}return t}}}}),En,Ls,Pn,xt,ra=T({"src/redirect.ts"(){"use strict";var e,t,s;nt(),O(),rt(),na(),En=[We(!1,!1)],xt=(s=class extends(Pn=E){constructor(l,i,r,o,a,h,d=[]){super(void 0,h,d);N(this,e);N(this,t);L(this,e,l),L(this,t,a),this.append(new Me(i,"redirect-syntax",h,d),new pl(r,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 i=l+f(this,e).length+this.firstChild.toString().length;return this.lastChild.setAttribute("aIndex",i),this.lastChild.lint(i)}print(){return super.print({pre:f(this,e),post:f(this,t)})}},e=new WeakMap,t=new WeakMap,s),Ls=Z(Pn),xt=te(Ls,0,"RedirectToken",En,xt),ee(Ls,1,xt)}}),fl={};Y(fl,{parseRedirect:()=>xl});var xl,la=T({"parser/redirect.ts"(){"use strict";B(),ra(),xl=(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 n=t.regexRedirect.exec(e);return n&&_.normalizeTitle(n[3],0,!1,t,{halfParsed:!0,temporary:!0,decode:!0}).valid?(e=`\0${s.length}o${e.slice(n[0].length)}`,new xt(...n.slice(1),t,s),e):!1}}}),Rn,Fs,On,mt,oa=T({"src/onlyinclude.ts"(){"use strict";Ie(),O(),Rn=[_e("<onlyinclude>")],mt=class extends(On=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>'})}},Fs=Z(On),mt=te(Fs,0,"OnlyincludeToken",Rn,mt),ee(Fs,1,mt)}}),Pt,hs=T({"mixin/gapped.ts"(){"use strict";pe(),Pt=(e=1)=>t=>{class s extends t{getGaps(){return e}}return lt(s,t),s}}}),Bn,js,qn,Re,Vi=T({"src/tagPair/index.ts"(){"use strict";var e,t;hs(),O(),Bn=[Pt()],Re=(t=class extends(qn=E){constructor(n,l,i,r,o,a=[]){super(void 0,o);N(this,e);Se(this,"closed");Se(this,"selfClosing");this.setAttribute("name",n.toLowerCase()),L(this,e,[n,r||n]),this.closed=r!=="",this.selfClosing=r===void 0,this.append(l,i);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(n){const{selfClosing:l,firstChild:i,lastChild:r}=this,[o,a]=f(this,e);return l?`<${o}${i.toString(n)}/>`:`<${o}${i.toString(n)}>${r.toString(n)}${this.closed?`</${a}>`:""}`}text(){const[n,l]=f(this,e);return this.selfClosing?`<${n}${this.firstChild.text()}/>`:`<${n}${super.text(">")}${this.closed?`</${l}>`:""}`}getAttribute(n){return n==="padding"?f(this,e)[0].length+1:super.getAttribute(n)}print(){const[n,l]=f(this,e);return super.print(this.selfClosing?{pre:`&lt;${n}`,post:"/&gt;"}:{pre:`&lt;${n}`,sep:"&gt;",post:this.closed?`&lt;/${l}&gt;`:""})}},e=new WeakMap,t),js=Z(qn),Re=te(js,0,"TagPairToken",Bn,Re),ee(js,1,Re)}}),ml,aa=T({"src/tagPair/translate.ts"(){"use strict";var e,vl,s;O(),Vi(),rt(),Fe(),ml=(s=class extends Re{constructor(l,i,r,o=[]){const a=new Me(l,"translate-attr",r,o);i=i==null?void 0:i.replace(/(<tvar\|[^>]+>)([\s\S]*?)(<\/>)/gu,(d,u,g,c)=>(new he(u,r,o),new he(c,r,o),`\0${o.length-1}n${g}\0${o.length}n`)).replace(/(<tvar\s+name\s*=(?:\s*(?:(["'])[\s\S]*?\2|[^"'\s>]+))?\s*>)([\s\S]*?)(<\/tvar\s*>)/giu,(d,u,g,c,p)=>(new he(u,r,o),new he(p,r,o),`\0${o.length-1}n${c}\0${o.length}n`));const h=new E(i,r,o);h.type="translate-inner";super("translate",a,h,"translate",r,o);N(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,vl).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,vl=function(){return this.firstChild.toString()===" nowrap"},s)}}),Wn,Es,Mn,vt,da=T({"src/tagPair/include.ts"(){"use strict";M(),ae(),nt(),B(),Vi(),Wn=[We(!1)],vt=class extends(Mn=Re){get type(){return"include"}constructor(e,t="",s,n,l,i){super(e,t,s!=null?s:"",s===void 0||n!=null?n:"",l,i)}toString(e){return e?"":super.toString()}lint(e=this.getAbsoluteIndex()){const t=[],{firstChild:s,closed:n,name:l}=this,i=new le(this,e),r=["no-ignored","unclosed-comment"],o=r.map(a=>_.lintConfig.getSeverity(a,"include"));if(o[0]&&s.data.trim()){const a=R(s,i,r[0],"useless attribute",o[0]);a.suggestions=[{desc:"remove",range:[a.startIndex,a.endIndex],text:""}],t.push(a)}if(o[1]&&!n){const a=V(this,i,r[1],_.msg("unclosed $1",`<${l}>`),o[1]);a.suggestions=[{desc:"close",range:[a.endIndex,a.endIndex],text:`</${l}>`}],t.push(a)}return t}},Es=Z(Mn),vt=te(Es,0,"IncludeToken",Wn,vt),ee(Es,1,vt)}}),us,Qi=T({"mixin/attributesParent.ts"(){"use strict";pe(),us=(e=0)=>t=>{var n,Ei;class s extends t{constructor(){super(...arguments);N(this,n)}hasAttr(o){return j(this,n,Ei).call(this).hasAttr(o)}getAttr(o){return j(this,n,Ei).call(this).getAttr(o)}}return n=new WeakSet,Ei=function(){return this.childNodes[e]},lt(s,t),s}}}),se,Ps,Rs,ut,Ut,Os,Pe,Bs,qs,Ws,zt,Ms,be,bl,wl,yl,Sl,ha=T({"util/sharable.ts"(){"use strict";se=new Set(["align"]),Ps=new Set(["cite"]),Rs=new Set(["cite","datetime"]),ut=new Set(["width"]),Ut=new Set(["axis","align","bgcolor","height","width","valign"]),Os=new Set([...Ut,"abbr","headers","scope","rowspan","colspan"]),Pe=new Set(["type"]),Bs=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),qs=new Set(["clear"]),Ws=new Set(["bgcolor","align","valign"]),zt=new Set(["qid","forcemathmode","type","display"]),Ms=new Set(["enclose","inline","lang","line","linelinks","style","class","id","dir","copy","highlight","start"]),be=new Set,bl=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"]),wl={div:se,h1:se,h2:se,h3:se,h4:se,h5:se,h6:se,blockquote:Ps,q:Ps,p:se,br:qs,pre:ut,ins:Rs,del:Rs,ul:Pe,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...Bs,"border"]),caption:se,tr:Ws,td:Os,th:Os,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:Pe,poem:se,categorytree:se,combooption:se,math:be,chem:be,ce:be,img:new Set(["alt","src","width","height","loading"])},yl={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:be,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:be,inputbox:be,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:be,poll:new Set(["id","show-results-before-voting"]),sm2:Pe,flashmp3:Pe,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([...zt,"chem"]),chem:zt,ce:zt,hiero:be,phonos:new Set(["ipa","class","text","lang","wikibase","file"]),section:new Set(["begin","end"]),source:Ms,syntaxhighlight:Ms,templatedata:be,timeline:new Set(["method","font"]),quiz:new Set(["display","shuffleanswers","points","shuffle","case"]),languages:be},Sl={table:Bs,td:new Set([...Ut,"scope"]),th:Ut,br:qs,caption:se,div:se,hr:ut,h1:se,h2:se,h3:se,h4:se,h5:se,h6:se,li:Pe,p:se,pre:ut,tr:Ws,ul:Pe}}}),Un,zn,Hn,Dn,Kt,ua=T({"src/attribute.ts"(){"use strict";var e,t,s,n,l,Pi,r;M(),oe(),qe(),ha(),ae(),B(),O(),Ne(),Un=/expression|(?:accelerator|-o-link(?:-source)?|-o-replace)\s*:|(?:url|src|image(?:-set)?)\s*\(|attr\s*\([^)]+[\s,]url/u,zn=/(?:^|\s|\*\/)(?:javascript|vbscript)(?:\W|$)/iu,Hn=new Set(["ext","arg","magic-word","template"]),Dn=new Set(["about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),Kt=(r=class extends E{constructor(a,h,d,u="",g,c=[],p=_.getConfig(),v=[]){const m=new ge(d,"attr-key",p,v);let x;if(d==="title"||h==="img"&&d==="alt")x=new E(g,p,v,{}),x.type="attr-value",x.setAttribute("stage",xe-1);else if(h==="gallery"&&d==="caption"||h==="choose"&&(d==="before"||d==="after")||h==="img"&&d==="src"&&(g!=null&&g.includes("{{"))){const b={...p,excludes:[...p.excludes,"heading","html","table","hr","list"]};x=new E(g,b,v,{}),x.type="attr-value",x.setAttribute("stage",1)}else x=new ge(g,"attr-value",p,v,{});super(void 0,p,v);N(this,l);N(this,e);N(this,t);N(this,s);N(this,n);L(this,e,a),this.append(m,x),L(this,s,u),L(this,n,[...c]),L(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,n)[0]===f(this,n)[1]}afterBuild(){f(this,s).includes("\0")&&L(this,s,this.buildFromStr(f(this,s),0)),this.parentNode&&L(this,t,this.parentNode.name),this.setAttribute("name",et(this.firstChild.text())),super.afterBuild()}toString(a){const[h="",d=""]=f(this,n);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,n)[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:g,lastChild:c,name:p,tag:v}=this,m=new le(this,a),x=["unclosed-quote","obsolete-attr"],b=x.map(A=>_.lintConfig.getSeverity(A,p));if(b[0]&&!u){const A=R(c,m,x[0],_.msg("unclosed $1","quotes"),b[0]);A.startIndex--,A.startCol--,A.suggestions=[{desc:"close",range:[A.endIndex,A.endIndex],text:f(this,n)[0]}],d.push(A)}const w=j(this,l,Pi).call(this,a,m);return w&&d.push(w),b[1]&&((y=Sl[v])!=null&&y.has(p))&&d.push(R(g,m,x[1],"obsolete attribute",b[1])),d}getValue(){return f(this,s)?this.lastChild.text().trim():this.type==="ext-attr"||""}getAttribute(a){return a==="invalid"?j(this,l,Pi).call(this):super.getAttribute(a)}print(){const[a="",h=""]=f(this,n);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,n=new WeakMap,l=new WeakSet,Pi=function(a,h){const{firstChild:d,lastChild:u,type:g,name:c,tag:p,parentNode:v}=this,m=!u.childNodes.some(({type:k})=>Hn.has(k)),x=this.getValue(),b=yl[p],w=wl[p],{length:y}=this.toString();let A="illegal-attr";if(!(b!=null&&b.has(c))&&!(w!=null&&w.has(c))&&(g==="ext-attr"?b||w:!/\{\{[^{]+\}\}/u.test(c))&&(g==="ext-attr"&&!w||!/^(?:xmlns:[\w:.-]+|data-(?!ooui|mw|parsoid)[^:]*)$/u.test(c)&&(p==="meta"||p==="link"||!bl.has(c)))||(c==="itemtype"||c==="itemid"||c==="itemref")&&!(v!=null&&v.hasAttr("itemscope"))){if(a===void 0)return!0;const k=_.lintConfig.getSeverity(A,"unknown");if(k){const S=R(d,h,A,"illegal attribute name",k);return S.suggestions=[{desc:"remove",range:[a,a+y],text:""}],S}}else if(c==="style"&&typeof x=="string"&&Un.test(x)){if(a===void 0)return!0;A="insecure-style";const k=_.lintConfig.getSeverity(A);return k&&R(u,h,A,"insecure style",k)}else if(c==="tabindex"&&typeof x=="string"&&x!=="0"){if(a===void 0)return!0;const k=_.lintConfig.getSeverity(A,"tabindex");if(k){const S=R(u,h,A,"nonzero tabindex",k);return S.suggestions=[{desc:"remove",range:[a,a+y],text:""},{desc:"0 tabindex",range:[S.startIndex,S.endIndex],text:"0"}],S}}else if(m&&g!=="ext-attr"){const k=hl(p,c),S=String(x).toLowerCase();if(k.length>0&&k.every($=>$!==S)){if(a===void 0)return!0;const $=_.lintConfig.getSeverity(A,"value");return $&&R(u,h,A,"illegal attribute value",$)}}else if(typeof x=="string"&&((/^xmlns:[\w:.-]+$/u.test(c)||Dn.has(c))&&zn.test(x)||m&&(c==="href"||p==="img"&&c==="src")&&!new RegExp(String.raw`^(?:${this.getAttribute("config").protocol}|//)\S+$`,"iu").test(x))){if(a===void 0)return!0;const k=_.lintConfig.getSeverity(A,"value");return k&&R(u,h,A,"illegal attribute value",k)}return!1},r)}}),Us,Gn,zs,cs,Ji=T({"src/attributes.ts"(){"use strict";var e,t,Yt,n;M(),oe(),ae(),B(),O(),Ne(),ua(),Us=l=>l.slice(0,-1),Gn=l=>`${Us(l)}-dirty`;try{zs=new RegExp(String.raw`[\p{L}\p{N}]`,"u")}catch{zs=/[^\W_]/u}cs=(n=class extends E{constructor(i,r,o,a,h=[]){super(void 0,a,h,{});N(this,t);N(this,e);if(L(this,e,r),this.setAttribute("name",o),i){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="",g=d.exec(i),c=0;const p=()=>{u&&(super.insertAt(new ge(u,Gn(r),a,h,{})),u="")};for(;g;){const{index:v,0:m,1:x,2:b,3:w,4:y,5:A,6:k}=g;if(u+=i.slice(c,v),/^(?:[\w:]|\0\d+t\x7F)(?:[\w:.-]|\0\d+t\x7F)*$/u.test(me(x).trim())){const S=y!=null?y:k,$=[w,A],C=new Kt(Us(r),o,x,b,S,$,a,h);p(),super.insertAt(C)}else u+=m;({lastIndex:c}=d),g=d.exec(i)}u+=i.slice(c),p()}}get type(){return f(this,e)}afterBuild(){const{parentNode:i}=this;i!=null&&i.is("td")&&this.setAttribute("name",i.subtype),super.afterBuild()}getAttrTokens(i){return this.childNodes.filter(r=>r instanceof Kt&&(!i||r.name===et(i)))}hasAttr(i){return this.getAttrTokens(i).length>0}getAttrToken(i){const r=this.getAttrTokens(i);return r[r.length-1]}getAttr(i){var r;return(r=this.getAttrToken(i))==null?void 0:r.getValue()}lint(i=this.getAbsoluteIndex(),r){const o=super.lint(i,r),{parentNode:a,childNodes:h}=this,d=new Map,u=new Set,g=new le(this,i),c=["no-ignored","no-duplicate"],p=["closingTag","invalidAttributes","nonWordAttributes"].map(m=>_.lintConfig.getSeverity(c[0],m));if(p[0]&&j(this,t,Yt).call(this)){const m=V(this,g,c[0],"attributes of a closing tag",p[0]),x=a.getAbsoluteIndex();m.suggestions=[{desc:"remove",range:[i,m.endIndex],text:""},{desc:"open",range:[x+1,x+2],text:""}],o.push(m)}for(const m of h)if(m instanceof Kt){const{name:x}=m;d.has(x)?(u.add(x),d.get(x).push(m)):d.set(x,[m])}else{const x=m.text().trim(),b=p[zs.test(x)?1:2];if(x&&b){const w=R(m,g,c[0],"containing invalid attribute",b);w.suggestions=[{desc:"remove",range:[w.startIndex,w.endIndex],text:" "}],o.push(w)}}const v=_.lintConfig.getSeverity(c[1],"attribute");if(v&&u.size>0)for(const m of u){const x=d.get(m).map(b=>{const w=b.getValue();return[b,w===!0?"":w]});o.push(...x.map(([b,w],y)=>{const A=R(b,g,c[1],_.msg("duplicated $1 attribute",m),v),k={desc:"remove",range:[A.startIndex,A.endIndex],text:""};return!w||x.slice(0,y).some(([,S])=>S===w)?A.fix=k:A.suggestions=[k],A}))}return o}getAttribute(i){return i==="invalid"?j(this,t,Yt).call(this):super.getAttribute(i)}print(){return this.toString()?`<span class="wpb-${this.type}${j(this,t,Yt).call(this)?" wpb-invalid":""}">${this.childNodes.map(i=>i.print(i instanceof ge?{class:i.toString().trim()&&"attr-dirty"}:void 0)).join("")}</span>`:""}},e=new WeakMap,t=new WeakSet,Yt=function(){const{parentNode:i}=this;return(i==null?void 0:i.type)==="html"&&i.closing&&this.text().trim()!==""},n)}}),Al={};Y(Al,{PreToken:()=>kl});var kl,ca=T({"src/pre.ts"(){"use strict";qe(),O(),Fe(),kl=class extends E{get type(){return"ext-inner"}constructor(e,t,s=[]){if(e){const n=/<nowiki>/giu,l=/<\/nowiki>/giu,{length:i}=n.source;let r=n.exec(e);r&&(l.lastIndex=r.index+i);let o=l.exec(e),a=0,h="";for(;r&&o;)new he(r[0],t,s),new he(o[0],t,s),h+=`${e.slice(a,r.index)}\0${s.length-1}n${e.slice(r.index+i,o.index)}\0${s.length}n`,a=o.index+i+1,n.lastIndex=a,r=n.exec(e),r&&(l.lastIndex=r.index+i),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)}}}}),gs,Xi=T({"mixin/multiLine.ts"(){"use strict";pe(),gs=e=>{class t extends e{toString(n){return super.toString(n,`
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 Ee(n,a),n}});var Xs={};ee(Xs,{ParamTagToken:()=>st});var Vs,Jn,xl,st,Yn=v(()=>{"use strict";M();ie();jr();pn();G();B();Me();Vs=[Zt];st=class extends(xl=A){get type(){return"ext-inner"}constructor(n,e,t=C.getConfig(),r=[],i){if(super(void 0,t,r,{}),e){let s=Y;this.append(...e.split(`
7
- `).map(o=>i?o:kt(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}};Jn=F(xl),st=P(Jn,0,"ParamTagToken",Vs,st),R(Jn,1,st)});var Br,er,un,tr,Zn=v(()=>{"use strict";M();de();ie();G();B();ft();tr=class extends A{constructor(e,t,r,i=[]){super(void 0,r,i);b(this,er);b(this,Br);y(this,Br,e);let s=new A(t[0],r,i);s.type="heading-title",s.setAttribute("stage",2);let o=new ce(t[1],"heading-trail",r,i);this.append(s,o)}get type(){return"heading"}get level(){return c(this,Br)}toString(e){let t=S(this,er,un).call(this);return t+this.firstChild.toString(e)+t+this.lastChild.toString(e)}text(){let e=S(this,er,un).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(rr("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],{...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,er,un).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}};Br=new WeakMap,er=new WeakSet,un=function(){return"=".repeat(this.level)}});var bl,cn,Qs=v(()=>{"use strict";ne();M();B();bl=new RegExp(`https?://${je}${Be}$`,"iu"),cn=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{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=bl.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 Ks,Or,at,vt,At,nr,lt,hn,Js,ei,Tl,ot,Ys=v(()=>{"use strict";ne();M();de();ie();Lr();B();Qs();Me();ft();Ks=[rt()];ot=class extends(Tl=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,lt);le(this,"modifier","");b(this,Or,"template");b(this,at,":");b(this,vt,!1);b(this,At,new Map);b(this,nr);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,vt)){let w=f?e.slice(0,h):e,I=f&&e.slice(h+1),j=se(w),U=f?j.slice(j.search(/\S/u))+(m?":":""):j.trim(),K=U.toLowerCase(),re=Array.isArray(g),q=re?g.includes(U):Object.prototype.hasOwnProperty.call(g,U),W=!re&&q?g[U]:Object.prototype.hasOwnProperty.call(l,K)&&l[K],z=re&&q||!("functionHook"in r)||d.includes(W),J=re&&q||p.includes(W);if(f?W&&z:J){this.setAttribute("name",W||K.replace(/^#|:$/u,"")),y(this,Or,"magic-word"),m&&y(this,at,":");let Q=new ce(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 ve=new Y(O.join("="),`invoke-${_?"function":"module"}`,r,i);super.insertAt(ve)}}}if(this.type==="template"){let w=se(e).trim();if(!this.normalizeTitle(w,10,{halfParsed:!0,temporary:!0}).valid)throw i.pop(),new SyntaxError("Invalid template name");let I=new Y(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 cn(...I,r,i))}this.seal("modifier")}get type(){return c(this,Or)}get module(){}get function(){}setModifier(e){let{parserFunction:[,,t,r]}=this.getAttribute("config"),i=se(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,vt)&&o||!c(this,vt)&&(l||!e)||(oe.running||this.length>1)&&(o||l||!e)?(this.setAttribute("modifier",e),y(this,vt,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,nr,S(this,lt,hn).call(this)),this.setAttribute("name",c(this,nr).title))}toString(e){return`{{${this.modifier}${this.type==="magic-word"?this.firstChild.toString(e)+(this.length===1?"":c(this,at))+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,at))+Te(e.slice(1),"|"):super.text("|")}}}`}getAttribute(e){switch(e){case"padding":return this.modifier.length+2;case"title":return c(this,nr);case"colon":return c(this,at);case"invalid":return this.type==="magic-word"&&this.name==="invoke"&&(this.length===2||!S(this,lt,hn).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,lt,hn).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"&&ct(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,lt,Js).call(this,e):e.name&&this.getArgs(e.name,!1,!1).add(e),e}getAllArgs(){return this.childNodes.filter(rr("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,At).has(i)?s=c(this,At).get(i):(s=new Set(this.getAllArgs().filter(({name:o})=>i===o)),c(this,At).set(i,s)),s}getDuplicatedArgs(){return[...c(this,At)].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{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"?ht(i)+r.print()+(t===1?"":c(this,at))+qe(e.slice(1),{sep:"|"}):(i?`<span class="wpb-magic-word">${ht(i)}</span>`:"")+qe(e,{sep:"|"})}}}</span>`}};ei=F(Tl),Or=new WeakMap,at=new WeakMap,vt=new WeakMap,At=new WeakMap,nr=new WeakMap,lt=new WeakSet,hn=function(){let e=this.type==="template";return this.normalizeTitle(this.childNodes[e?0:1].text(),e?10:828,{temporary:!0})},Js=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))}},ot=P(ei,0,"TranscludeToken",Ks,ot),R(ei,1,ot)});var Zs,ti,yl,wt,eo=v(()=>{"use strict";mt();B();Zs=[ye()];wt=class extends(yl=A){get type(){return"hidden"}getAttribute(n){return n==="invalid"||super.getAttribute(n)}};ti=F(yl),wt=P(ti,0,"HiddenToken",Zs,wt),R(ti,1,wt)});var to,ni,kl,ri,vl,St,ro=v(()=>{"use strict";ne();M();ie();_e();Lr();B();Me();eo();to=[ge("{{{"),rt()];St=class extends(vl=A){constructor(e,t,r=[]){super(void 0,t,r,{});b(this,ni);for(let i=0;i<e.length;i++){let s=e[i];if(i===0){let o=new Y(s,"arg-name",t,r,{});super.insertAt(o)}else if(i>1){let o=new wt(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`{{{${Te(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}};ri=F(vl),ni=new WeakSet,kl=function(){},St=P(ri,0,"ArgToken",to,St),R(ri,1,St)});var go={};ee(go,{parseBraces:()=>qr});var Al,no,ii,io,so,oo,lo,ao,qr,mn=v(()=>{"use strict";qt();ne();Zn();Ys();ro();Al={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},no=String.raw`\[(?!\[)`,ii=String.raw`\n(?![=\0])`,io=String.raw`|\{{2,}`,so=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),oo=Ne(a=>new RegExp(a,"gmu"));lo=new RegExp(String.raw`\{\{((?:[^\n{}[]|${no}|${ii})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${ii})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${no}|${ii})*\}-`,"gu");ao=a=>{let n=Oe(se(a));return so.has(n)?so.get(n):/^(?:filepath|(?:full|canonical)urle?):./u.test(n)?"m":/^#vardefine:./u.test(n)?"n":"t"},qr=(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(Ie($.slice(I,j),s))},l;do l!==void 0&&(a=l),l=a.replace(lo,($,w,I)=>{if(w!==void 0||typeof I=="string")try{let{length:j}=e,U=(w!=null?w:I).split("|");return new ot(Ie(U[0],s),U.slice(1).map(K=>{let re=K.indexOf("=");return(re===-1?[K]:[K.slice(0,re),K.slice(re+1)]).map(q=>Ie(q,s))}),n,e),`\0${j}${ao(U[0])}`}catch(j){if(!(j instanceof SyntaxError)||j.message!=="Invalid template name")throw j}return s.push(Ie($,s)),`\0${s.length-1}`});while(l!==a);a=l;let g=a.lastIndexOf("}}")-a.length,p=g+a.length!==-1,d=oo(t+(p?io:"")),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:J}]=u;u[0]=u[0].slice(J),u.index+=J}let{0:$,index:w}=u!=null?u:{0:`
8
- `,index:a.length},I=(x=i.pop())!=null?x:{},{0:j,index:U,parts:K,findEqual:re,pos:q}=I,W=$==="="&&re;if($==="]]"||$==="}-")h=w+2;else if($===`
9
- `){h=w+1;let{pos:J,findEqual:Q}=(T=i[i.length-1])!=null?T:{};if(J===void 0||Q||se(a.slice(J,U))!==""){let _=/^(={1,6})(.+)\1((?:\s|\0\d+[cn]\x7F)*)$/u.exec(a.slice(U,w));_&&(_[2]=Ie(_[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 tr(_[1].length,_.slice(2),n,e)))}}else if($==="|"||W)h=w+1,o(a,K,q,w),$==="|"&&K.push([]),I.pos=h,I.findEqual=$==="|",i.push(I);else if($.startsWith("}}")){let J=$.slice(0,Math.min(j.length,3)),Q=j.length-J.length,{length:_}=e;h=w+J.length,o(a,K,q,w);let O=!1,ve="t";if(J.length===3){let ue=K.map(Ke=>Ke.join("=")),me=ue.length>1&&se(ue[1]).trim();new St(ue,n,e),me&&me.endsWith(":")&&r.includes(me.slice(0,-1).toLowerCase())&&(ve="s")}else try{new ot(K[0][0],K.slice(1),n,e),ve=ao(K[0][0])}catch(ue){if(ue instanceof SyntaxError&&ue.message==="Invalid template name")O=!0;else throw ue}O||(a=`${a.slice(0,U+Q)}\0${_}${ve}${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=oo(t+(p?io:"")+(z?`|${Al[z[0][0]]}${z.findEqual?"|=":""}`:"")),d.lastIndex=h,u=d.exec(a)}return Ie(a,s)}});var po={};ee(po,{InputboxToken:()=>si});var si,uo=v(()=>{"use strict";jr();mn();G();Yn();si=class extends st{constructor(n,e,t=C.getConfig(),r=[]){let i=Symbol("InputboxToken"),s=t.excludes.includes("heading")?t:{...t,excludes:[...t.excludes,"heading"]},{length:o}=r;r.push(i),e&&(e=kt(e,s,r,n)),e&&(e=qr(e,s,r)),r.splice(o,1),super(n,e,s,r,{})}}});var fn={};ee(fn,{NestedToken:()=>oi});var wl,Sl,_r,ir,oi,xn=v(()=>{"use strict";M();ie();jr();mn();G();B();ai();ze();wl=new Set(["comment","include","arg","template","magic-word"]),Sl=[!1,!0].map(a=>{let n=a?"includeonly":"noinclude";return new RegExp(String.raw`^(?:<${n}(?:\s[^>]*)?/?>|</${n}\s*>)$`,"iu")}),oi=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=kt(e,i,s,t)),e&&(e=qr(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 De(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,_r);b(this,ir);y(this,_r,[...r]),y(this,ir,t)}get type(){return"ext-inner"}lint(e=this.getAbsoluteIndex(),t){let r=new L(this,e),i=typeof c(this,ir)=="boolean"?Sl[c(this,ir)?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,_r).includes(l);if(wl.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})]}};_r=new WeakMap,ir=new WeakMap});function co(a,n,e,t,r){n=se(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(Cl(e.protocol).test(i))return $l(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 Cl,$l,Nl,Il,he,Tn,ho,bn,mo=v(()=>{"use strict";qt();ne();M();G();B();Cl=Ne(a=>new RegExp(String.raw`^(?:${a}|//|\0\d+m\x7F)`,"iu")),$l=Ne(a=>new RegExp(String.raw`^(?:(?:${a}|//)${je}|\0\d+m\x7F)${Be}$`,"iu")),Nl=Ne(a=>new RegExp(String.raw`^(\s*(?!\s))${a.replace("$1","(.*)")}${a.endsWith("$1")?`(?=$|
11
- )`:""}(\s*)$`,"u")),Il=new Set(["alt","link","lang","page","caption"]);bn=class extends A{constructor(e,t,r,i){var n=(...Ou)=>(super(...Ou),b(this,Tn),b(this,he,""),this);let s,o=Object.entries(r.img).map(([g,p])=>[g,p,Nl(g)]),l=o.find(([,g,p])=>(s=p.exec(e),s&&(s.length!==4||co(g,s[2],r,!0,t)!==!1)));if(l&&s){s.length===3?(n(void 0,r,i),y(this,he,e)):(n(s[2],r,i,{}),y(this,he,s[1]+l[0]+s[3])),this.setAttribute("name",l[1]);return}n(e,r.excludes.includes("list")?r:{...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"?co("link",super.text(),this.getAttribute("config")):void 0}afterBuild(){var e;(e=this.parentNode)!=null&&e.is("gallery-image")&&!Il.has(this.name)&&this.setAttribute("name","invalid"),super.afterBuild()}toString(e){return c(this,he)?c(this,he).replace("$1",super.toString(e)):super.toString(e)}text(){return c(this,he)?c(this,he).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,he).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:Ye(this.text())}],r.push(o)}return r}getValue(){return this.name==="invalid"?this.text():S(this,Tn,ho).call(this)||super.text()}print(){return c(this,he)?`<span class="wpb-image-parameter${this.name==="invalid"?" wpb-invalid":""}">${c(this,he).replace("$1",`<span class="wpb-image-caption">${qe(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}};he=new WeakMap,Tn=new WeakSet,ho=function(){return c(this,he)&&!c(this,he).includes("$1")}});var fo,El,Ll,xo,bo,Fl,Rl,To,sr,li=v(()=>{"use strict";M();ie();G();Er();mo();fo=new Map([["manualthumb","Thumb"],["frameless","Frameless"],["framed","Frame"],["thumbnail","Thumb"]]),El=new Set(["arg"]),Ll=new Set(["template","magic-word"]),xo=new Set(["left","right","center","none"]),bo=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),Fl=new Set(["tiff","tif","png","gif","jpg","jpeg","webp","xcf","pdf","svg","djvu"]),Rl=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},To=(a,n)=>a.filter(({childNodes:e})=>{let t=e.filter(r=>r.text().trim());return t.length!==1||!n.has(t[0].type)}),sr=class extends xe{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(Rl(e).map(o=>new bn(o,s,t,r)))}lint(n=this.getAbsoluteIndex(),e){var m;let t=super.lint(n,e),r=To(this.getAllArgs(),El),i=[...new Set(r.map(({name:f})=>f))],s=i.filter(f=>fo.has(f)),o=i.filter(f=>xo.has(f)),l=i.filter(f=>bo.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||Fl.has(h);if(x&&k){let $=To(T,Ll);k=$.length>1&&(w=>$.includes(w))}t.push(...T.map(u("duplicated",f,k)))}}return s.length>1&&t.push(...r.filter(({name:f})=>fo.has(f)).map(u("conflicting","frame"))),o.length>1&&t.push(...r.filter(({name:f})=>xo.has(f)).map(u("conflicting","horizontal-alignment"))),l.length>1&&t.push(...r.filter(({name:f})=>bo.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 yo,Mr,gi,di,Pl,We,pi=v(()=>{"use strict";M();_e();B();li();yo=[ge("")];We=class extends(Pl=sr){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,Mr);le(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,Mr,gi).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,Mr,gi).call(this):super.getAttribute(e)}};di=F(Pl),Mr=new WeakSet,gi=function(){let{ns:e}=this.getAttribute("title");return e!==6},We=P(di,0,"GalleryImageToken",yo,We),R(di,1,We)});var Ao={};ee(Ao,{GalleryToken:()=>or});var ko,Ct,vo,ci,ui,jl,or,wo=v(()=>{"use strict";pn();G();B();pi();ze();ko=[Zt];or=class extends(jl=A){constructor(e,t,r=[]){var i;super(void 0,t,r,{});b(this,Ct);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,Ct,vo).call(this,l)?super.insertAt(new We("gallery",l,g,t,r)):super.insertAt(new D(s,t,r))}}get type(){return"ext-inner"}get widths(){return S(this,Ct,ci).call(this,"widths")}get heights(){return S(this,Ct,ci).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}};ui=F(jl),Ct=new WeakSet,vo=function(e){return this.normalizeTitle(e,6,{halfParsed:!0,temporary:!0,decode:!0}).valid},ci=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},or=P(ui,0,"GalleryToken",ko,or),R(ui,1,or)});var ar,hi=v(()=>{"use strict";M();Er();ar=class extends xe{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 Bl,Ol,Ur,zr,mi,He,yn=v(()=>{"use strict";M();ne();ie();G();B();Bl=String.raw`(?:[${Ae}\t]|&nbsp;|&#0*160;|&#[xX]0*[aA]0;)`,Ol=new RegExp(`${Bl}+`,"gu"),He=class extends A{constructor(e,t="free-ext-link",r=C.getConfig(),i){super(e,r,i,{});b(this,zr);b(this,Ur);y(this,Ur,t)}get type(){return c(this,Ur)}get innerText(){let e=new Map([["!","|"],["=","="]]),t=Te(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(Ol," ")),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:ss(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,zr,mi).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,zr,mi).call(this):super.getAttribute(e)}};Ur=new WeakMap,zr=new WeakSet,mi=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 So,Ge,fi,ql,Ve,xi=v(()=>{"use strict";M();_e();B();yn();So=[ge("[")];Ve=class extends(ql=A){constructor(e,t="",r="",i,s=[]){super(void 0,i,s,{});b(this,Ge);let o=e&&/^\0\d+f\x7F$/u.test(e)?s[Number(e.slice(1,-2))]:new He(e,"ext-link-url",i,s);if(this.insertAt(o),y(this,Ge,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,Ge)}]`:`[${super.toString(e,c(this,Ge))}]`}text(){return`[${super.text(" ")}]`}getGaps(){return c(this,Ge).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,Ge)}]`}:{pre:"[",sep:c(this,Ge),post:"]"})}};fi=F(ql),Ge=new WeakMap,Ve=P(fi,0,"ExtLinkToken",So,Ve),R(fi,1,Ve)});var Dr,Co=v(()=>{"use strict";B();ze();hi();xi();Dr=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 ar(...e,r,i):new Ve(...e,r,i),new D(t,r,i))}}});var No={};ee(No,{ImagemapToken:()=>lr});var $o,bi,_l,lr,Io=v(()=>{"use strict";M();de();ie();pn();G();B();ze();pi();Co();$o=[Zt];lr=class extends(_l=A){get type(){return"ext-inner"}get image(){return this.childNodes.find(rr("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 We("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 Dr(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 Dr(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)}};bi=F(_l),lr=P(bi,0,"ImagemapToken",$o,lr),R(bi,1,lr)});var Eo,Ti,Ml,Xe,yi=v(()=>{"use strict";M();mt();_e();G();et();Eo=[ye(!1),ge("<!--")];Xe=class extends(Ml=pe){constructor(e,t,r,i){super(e,r,i);le(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;":""})}};Ti=F(Ml),Xe=P(Ti,0,"CommentToken",Eo,Xe),R(Ti,1,Xe)});var Lo={};ee(Lo,{CommentedToken:()=>ki});var ki,Fo=v(()=>{"use strict";B();yi();ki=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 Xe(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 Ro={};ee(Ro,{NowikiToken:()=>vi});var Ul,zl,Wr,Ai,vi,Po=v(()=>{"use strict";qt();M();G();et();Ul=Ne(a=>new RegExp(String.raw`<\s*(?:/\s*)${a==="nowiki"?"":"?"}(${a})\b`,"giu")),zl=new Set(["templatestyles","section","languages"]),vi=class extends pe{constructor(){super(...arguments);b(this,Wr)}get type(){return"ext-inner"}lint(e=this.getAbsoluteIndex()){let{name:t}=this;if(S(this,Wr,Ai).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,Ul(t))}getAttribute(e){return e==="invalid"?S(this,Wr,Ai).call(this):super.getAttribute(e)}};Wr=new WeakSet,Ai=function(){let{name:e,firstChild:{data:t}}=this;return zl.has(e)&&!!t}});var jo,wi,Dl,De,ai=v(()=>{"use strict";M();ie();G();an();B();nn();gn();jo=[Xt()];De=class extends(Dl=$e){get type(){return"ext"}constructor(n,e,t,r,i=C.getConfig(),s=!1,o=[]){let l=n.toLowerCase(),g=new it(!e||/^\s/u.test(e)?e:` ${e}`,"ext-attrs",l,i,o),p={...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}=(Gs(),H(Hs));d=new u(t,p,o);break}case"dynamicpagelist":{let{ParamTagToken:u}=(Yn(),H(Xs));d=new u(s,t,p,o);break}case"inputbox":{let{InputboxToken:u}=(uo(),H(po));d=new u(s,t,p,o);break}case"references":{let{NestedToken:u}=(xn(),H(fn));p.excludes.push("heading"),d=new u(t,s,["ref"],p,o);break}case"choose":{let{NestedToken:u}=(xn(),H(fn));d=new u(t,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],p,o);break}case"combobox":{let{NestedToken:u}=(xn(),H(fn));d=new u(t,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],p,o);break}case"gallery":{let{GalleryToken:u}=(wo(),H(Ao));d=new u(t,p,o);break}case"imagemap":{let{ImagemapToken:u}=(Io(),H(No));d=new u(t,p,o);break}case"hiero":{let{CommentedToken:u}=(Fo(),H(Lo));d=new u(t,p,o);break}default:{let{NowikiToken:u}=(Po(),H(Ro));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}};wi=F(Dl),De=P(wi,0,"ExtToken",jo,De),R(wi,1,De)});var qo={};ee(qo,{parseCommentAndExt:()=>kt});var Oo,Wl,Si,Hl,Bo,kt,jr=v(()=>{"use strict";qt();ne();ws();ze();$s();Is();ai();yi();Oo="<onlyinclude>",Wl="</onlyinclude>",{length:Si}=Oo,Hl=[!1,!0].map(a=>{let n=a?"includeonly":"(?:no|only)include",e=a?"noinclude":"includeonly";return Ne(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"))}),Bo=a=>{let n=a.indexOf(Oo);return{i:n,j:a.indexOf(Wl,n+Si)}},kt=(a,n,e,t)=>{if(t){let{i:o,j:l}=Bo(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 Tt(a.slice(o+Si,l),n,e),o>0&&p(a.slice(0,o)),g+=d,a=a.slice(l+Si+1),{i:o,j:l}=Bo(a)}return a&&p(a),g}}let{ext:r}=n,i=r.filter(o=>o!=="translate"&&o!=="tvar"),s={...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 sn(g,p&&Ie(p,o),s,e),`\0${d}g`}),a=Ie(a,o)}return a.replace(Hl[t?1:0](i),(o,l,g,p,d,u,h,m,f)=>{let x=e.length,T="n";if(l)T="e",new De(l,g,p,d,s,u,e);else if(o.startsWith("<!--")){T="c";let k=o.endsWith("-->");new Xe(o.slice(4,k?-3:void 0),k,n,e)}else u?new yt(u,h,m,f,n,e):new D(o,n,e);return`\0${x}${T}`})}});var Gl,Vl,Xl,_o,dr,Re,dt,Qe,Ci,Ql,$t,Mo=v(()=>{"use strict";M();de();ie();an();B();G();Gl=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),Vl=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"]),Xl=new Set(["strike","big","center","font","tt"]);_o=[Xt()];$t=class extends(Ql=A){constructor(e,t,r,i,s,o){super(void 0,s,o);b(this,dr);b(this,Re);b(this,dt);b(this,Qe);this.insertAt(t),this.setAttribute("name",e.toLowerCase()),y(this,dr,r),y(this,Re,i),y(this,dt,e)}get type(){return"html"}get selfClosing(){return c(this,Re)}get closing(){return c(this,dr)}toString(e){return`<${this.closing?"/":""}${c(this,dt)}${super.toString(e)}${c(this,Re)?"/":""}>`}text(){let{closing:e}=this,t=c(this,dt)+(e?"":super.text());return`<${e?"/":""}${t}${c(this,Re)?"/":""}>`}getAttribute(e){return e==="invalid"?this.inTableAttrs()==="error":e==="padding"?c(this,dt).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)}Xl.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&&Gl.has(T.name)?x.severity="warning":x.suggestions=[{desc:"remove",range:[e,x.endIndex],text:""}]}else{let T=s==null?void 0:s.childNodes;Vl.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 we(c(this,Qe),()=>{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}=oe;for(let f of u)if(!(!f.is("html")||f.name!==e||g&&c(f,Re)))if(c(f,dr)===r)h.push(f);else{let x=h.pop();if(x===this)return f;C.viewOnly&&(y(x,Qe,[m,f]),y(f,Qe,[m,x]))}if(C.viewOnly)for(let f of h)y(f,Qe,[m,void 0])},e=>{y(this,Qe,e),e[1]&&e[1]!==this&&y(e[1],Qe,[oe.rev,this])})}print(){return super.print({pre:`&lt;${this.closing?"/":""}${c(this,dt)}`,post:`${c(this,Re)?"/":""}&gt;`})}json(e,t=this.getAbsoluteIndex()){let r=super.json(void 0,t);return Object.assign(r,{closing:this.closing,selfClosing:c(this,Re)}),r}};Ci=F(Ql),dr=new WeakMap,Re=new WeakMap,dt=new WeakMap,Qe=new WeakMap,$t=P(Ci,0,"HtmlToken",_o,$t),R(Ci,1,$t)});var Uo={};ee(Uo,{parseHtml:()=>Jl});var Kl,Jl,zo=v(()=>{"use strict";gn();Mo();Kl=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,Jl=(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=Kl.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 it(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 $t(g,x,d==="/",h==="/>",n,e)}return i}});var gr,$i=v(()=>{"use strict";an();B();ft();gn();gr=class extends Xt(1)(A){constructor(n,e,t,r,i,s=[],o){super(void 0,i,s,o),this.append(new ce(e,"table-syntax",i,s),new it(r,"table-attrs",t,i,s))}}});var ke,Hr,Gr,Ni,pr,Ii=v(()=>{"use strict";M();ie();B();$i();pr=class extends gr{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,Gr);b(this,ke,"");b(this,Hr);s&&([Yr(this,ke)._]=s);let l=new A(t==null?void 0:t.slice(((g=s==null?void 0:s.index)!=null?g:NaN)+c(this,ke).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,Gr,Ni).call(this).subtype}afterBuild(){c(this,ke).includes("\0")&&y(this,ke,this.buildFromStr(c(this,ke),0)),super.afterBuild()}toString(e){let{childNodes:[t,r,i]}=this;return t.toString(e)+r.toString(e)+c(this,ke)+i.toString(e)}text(){let{childNodes:[e,t,r]}=this;return e.text()+t.text()+c(this,ke)+r.text()}getGaps(e){return e===1?c(this,ke).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,ke)}${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}};ke=new WeakMap,Hr=new WeakMap,Gr=new WeakSet,Ni=function(){return we(c(this,Hr),()=>{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{...S(o=i,Gr,Ni).call(o)}},e=>{y(this,Hr,e)})}});var ur,Ei=v(()=>{"use strict";M();$i();Ii();ur=class extends gr{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=Mt(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 pr&&n.isIndependent()&&!n.firstChild.text().endsWith("+")))}}});var Yl,Zl,Li,kn,Do=v(()=>{"use strict";M();de();ie();G();Ei();ft();Yl=(a,n)=>new Array(a).fill(void 0).map((e,t)=>n(t)),Zl=({type:a})=>a==="tr"||a==="table-syntax",Li=class extends Array{},kn=class extends ur{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];oe.run(()=>{let s=new ce(void 0,"table-syntax",t,r);super.insertAt(s)}),this.lastChild.safeReplaceChildren(i)}getLayout(n){let e=this.getAllRows(),{length:t}=e,r=Li.from(Yl(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(Zl(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 vn,Wo=v(()=>{"use strict";Ei();vn=class extends ur{get type(){return"tr"}constructor(n,e,t,r){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,n,"tr",e,t,r)}}});var cr,Fi=v(()=>{"use strict";et();cr=class extends pe{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 hr,Ri=v(()=>{"use strict";Fi();hr=class extends cr{get type(){return"dd"}}});var Go={};ee(Go,{parseTable:()=>td});var ed,Ho,td,Vo=v(()=>{"use strict";B();Do();Wo();Ii();Ri();ed=a=>a.lastChild.constructor!==A,Ho=(a,n)=>a.is("td")?n.pop():a,td=({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(ed(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 hr($,t,r),g(`
19
- ${d}${$&&`\0${r.length-1}d`}${w}\0${r.length}b`,l),i.push(...l?[l]:[],new kn(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=Ho(l,i),l.is("tr")&&(l=i.pop());let $=new vn(`
23
- ${d}${x}`,k,t,r);i.push(l,$),l.insertAt($)}else{l=Ho(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=K=>{let re=new pr(j,k.slice(I,w==null?void 0:w.index),t,r);return K.insertAt(re),re};for(;w;)U(l),{lastIndex:I}=$,[j]=w,w=$.exec(k);i.push(l,U(l))}}return o.slice(1)}});var An,Xo=v(()=>{"use strict";et();An=class extends pe{get type(){return"hr"}}});var Qo,Pi,rd,Nt,Ko=v(()=>{"use strict";mt();_e();et();Qo=[ye(),ge("__")];Nt=class extends(rd=pe){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:"__"})}};Pi=F(rd),Nt=P(Pi,0,"DoubleUnderscoreToken",Qo,Nt),R(Pi,1,Nt)});var Jo={};ee(Jo,{parseHrAndDoubleUnderscore:()=>nd});var nd,Yo=v(()=>{"use strict";Xo();Ko();Zn();nd=({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 An(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 Nt(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 tr(h.length,[m,f],t,r),x}),n==="root"||n==="ext-inner"&&e==="poem"?a:a.slice(1)}});var mr,wn,Zo=v(()=>{"use strict";M();ie();G();et();wn=class extends pe{constructor(e,t,r,i){super(e,r,i);b(this,mr);y(this,mr,t)}get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}get closing(){return{...this.bold?{bold:c(this,mr).bold}:void 0,...this.italic?{italic:c(this,mr).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({...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({...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}};mr=new WeakMap});var ea={};ee(ea,{parseQuotes:()=>ji});var ji,Bi=v(()=>{"use strict";Zo();ji=(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 wn(r[m],{bold:x&&d,italic:T&&u},n,e),r[m]=`\0${e.length-1}q`}return r.join("")}});var ta={};ee(ta,{parseExternalLinks:()=>Oi});var Oi,qi=v(()=>{"use strict";ne();xi();yn();Oi=(a,n,e,t)=>{var r;return(r=n.regexExternalLinks)!=null||(n.regexExternalLinks=new RegExp(String.raw`\[(\0\d+f\x7F|(?:(?:${n.protocol}|//)${je}|\0\d+m\x7F)${Be}(?=[[\]<>"\t${Ae}]|\0\d))([${Ae}]*(?![${Ae}]))([^\]\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 He(s,"ext-link-url",n,e),`[\0${g}f${o}${l}]`):(new Ve(s,o,l,n,e),`\0${g}w`)})}});var Sn,ra=v(()=>{"use strict";ne();Er();Sn=class extends xe{get type(){return"category"}get sortkey(){let{childNodes:[,n]}=this;return n&&ct(n.text())}json(n,e=this.getAbsoluteIndex()){let t=super.json(void 0,e),{sortkey:r}=this;return r&&(t.sortkey=r),t}}});var ia={};ee(ia,{parseLinks:()=>na});var id,na,sa=v(()=>{"use strict";G();Bi();qi();hi();li();ra();id=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)([\s\S]*)$/u,na=(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=id.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=na(u,n,e,t),!w){s+=`[[${p}${d}${u}`;continue}}}else{s+=`[[${m}`;continue}u&&(u=ji(u,n,e,t));let $=ar;x||(T===6?(u&&(u=Oi(u,n,e,!0)),$=sr):T===14&&($=Sn)),u===void 0&&d&&(u=""),s+=`\0${e.length}l${h}`,new $(p,u,n,e,d)}return s}});var ga={};ee(ga,{parseMagicLinks:()=>sd});var da,oa,aa,la,sd,pa=v(()=>{"use strict";ne();yn();da=String.raw`[${Ae}\t]|&nbsp;|&#0*160;|&#x0*a0;`,oa=`(?:${da})+`,aa=`(?:${da}|-)`,la=String.raw`(?:RFC|PMID)${oa}\d+\b|ISBN${oa}(?:97[89]${aa}?)?(?:\d${aa}?){9}[\dx]\b`,sd=(a,n,e)=>{if(!n.regexMagicLinks)try{n.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${n.protocol})(${je}${Be})|${la})`,"giu")}catch{n.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${n.protocol})(${je}${Be})|${la})`,"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 He(s,void 0,n,e),`${r}\0${e.length-1}w${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(s))return t;return new He(s,"magic-link",n,e),`${r}\0${e.length-1}i`})}});var ua,ca=v(()=>{"use strict";ua=(a,n)=>a.startsWith(n)?n.length:[...n].findIndex((e,t)=>e!==a[t])});var Cn,ha=v(()=>{"use strict";Fi();Cn=class extends cr{get type(){return"list"}}});var ma={};ee(ma,{parseList:()=>od});var od,fa=v(()=>{"use strict";ca();ha();Ri();od=(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=ua(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 Cn(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,K=(q,W)=>(new hr(q,e,t),`${m.slice(0,W)}\0${t.length-1}d${m.slice(W+q.length)}`),re=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:J,selfClosing:Q}=t[Number(q.slice(1,-2))];(f.includes(z)||!Q&&!x.includes(z))&&re(J)}else if(q.endsWith("q")){let{bold:z,italic:J}=t[Number(q.slice(1,-2))];z&&(re(I),I=!I),J&&(re(j),j=!j)}else if(w===0){if(q.length>=h)return K(q.slice(0,h),W);h-=q.length,k.lastIndex=W+4+String(t.length).length,m=K(q,W)}$=k.exec(m)}return m}});var _i,xa,Pe,Mi,ad,It,ba=v(()=>{"use strict";M();ie();Lr();B();Me();_i=new Set(["A","T","R","D","-","H","N"]);xa=[rt()];It=class extends(ad=A){constructor(e,t,r=[]){super(void 0,t,r,{});b(this,Pe);this.safeAppend(e.map(i=>new Y(i,"converter-flag",t,r)))}get type(){return"converter-flags"}afterBuild(){y(this,Pe,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,Pe).filter(e=>/\{{3}[^{}]+\}{3}/u.test(e)))}getVariantFlags(){let e=new Set(this.getAttribute("config").variants);return new Set(c(this,Pe).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,Pe).filter(s=>_i.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,Pe).filter(d=>_i.has(d))),o=c(this,Pe).filter(d=>!d).length,l=c(this,Pe).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&&_i.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:";"})}};Mi=F(ad),Pe=new WeakMap,It=P(Mi,0,"ConverterFlagsToken",xa,It),R(Mi,1,It)});var fr,Ta=v(()=>{"use strict";G();B();Me();fr=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 Y(o,"converter-rule-variant",t,r)),super.insertAt(new Y(n.slice(i+1),"converter-rule-to",t,r)),s!==-1&&super.insertAt(new Y(n.slice(0,s),"converter-rule-from",t,r),0)):super.insertAt(new Y(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 ya,Ui,ld,Et,ka=v(()=>{"use strict";ne();_e();B();ba();Ta();ya=[ge("-{")];Et=class extends(ld=A){get type(){return"converter"}constructor(n,e,t,r=[]){super(void 0,t,r),this.insertAt(new It(n,t,r));let[i]=e,s=i.includes(":"),o=new fr(i,s,t,r);s&&o.length===1||!s&&e.length===2&&!se(e[1]).trim()?this.insertAt(new fr(e.join(";"),!1,t,r)):this.append(o,...e.slice(1).map(l=>new fr(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()}|${Te(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?"|":""}${qe(e,{sep:";"})}}-</span>`}};Ui=F(ld),Et=P(Ui,0,"ConverterToken",ya,Et),R(Ui,1,Et)});var va={};ee(va,{parseConverter:()=>dd});var dd,Aa=v(()=>{"use strict";ka();dd=(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 Et(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 $n={};ee($n,{Token:()=>A});var Vr,be,V,Z,Lt,xr,Xr,X,wa,Sa,Ca,$a,Na,Ia,Ea,La,Fa,Ra,Pa,ja,zi,A,B=v(()=>{"use strict";ne();M();de();G();ps();ms();zi=class zi extends en{constructor(e,t=C.getConfig(),r=[],i){super();b(this,X);b(this,Vr,"plain");b(this,be,0);b(this,V);b(this,Z);b(this,Lt);b(this,xr,!1);b(this,Xr);typeof e=="string"&&this.insertAt(e),y(this,V,t),y(this,Z,r),r.push(this)}get type(){return c(this,Vr)}set type(e){y(this,Vr,e)}parseOnce(e=c(this,be),t=!1,r){if(e<c(this,be)||this.length===0||!this.isPlain())return this;if(c(this,be)>=11)return this;switch(e){case 0:if(this.type==="root"){c(this,Z).pop();let i=S(this,X,wa).call(this);t&&(t=!i)}y(this,Lt,t),S(this,X,Sa).call(this,t);break;case 1:S(this,X,Ca).call(this);break;case 2:S(this,X,$a).call(this);break;case 3:S(this,X,Na).call(this);break;case 4:S(this,X,Ia).call(this);break;case 5:S(this,X,Ea).call(this,r);break;case 6:S(this,X,La).call(this,r);break;case 7:S(this,X,Fa).call(this);break;case 8:S(this,X,Ra).call(this);break;case 9:S(this,X,Pa).call(this);break;case 10:S(this,X,ja).call(this)}if(this.type==="root")for(let i of c(this,Z))i==null||i.parseOnce(e,t,r);return Yr(this,be)._++,this}buildFromStr(e,t){let r=e.split(/[\0\x7F]/u).map((i,s)=>{if(s%2===0)return new Nr(i);if(isNaN(i.slice(-1)))return c(this,Z)[Number(i.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${i}`)});return t===0?r.map(String).join(""):t===1?Te(r):r}build(){y(this,be,11);let{length:e,firstChild:t}=this,r=t==null?void 0:t.toString();if(e===1&&t.type==="text"&&r.includes("\0")&&($r(this,0,1,this.buildFromStr(r)),this.normalize(),this.type==="root"))for(let i of c(this,Z))i==null||i.build()}afterBuild(){if(this.type==="root")for(let e of c(this,Z))e==null||e.afterBuild();y(this,xr,!0)}parse(e=11,t,r){for(e=Math.min(e,11);c(this,be)<e;)this.parseOnce(c(this,be),t,r);return e&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===zi}getAttribute(e){var t;switch(e){case"config":return c(this,V);case"include":return(t=c(this,Lt))!=null?t:!!c(this.getRootNode(),Lt);case"accum":return c(this,Z);case"built":return c(this,xr);case"stage":return c(this,be);case"invalid":return this.type==="table-inter"&&Mt(this)==="error";default:return super.getAttribute(e)}}setAttribute(e,t){switch(e){case"stage":c(this,be)===0&&this.type==="root"&&c(this,Z).shift(),y(this,be,t);break;default:super.setAttribute(e,t)}}insertAt(e,t=this.length){let r=typeof e=="string"?new Nr(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,Lt),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):we(c(this,Xr),()=>super.toString(!1,t),r=>{let i=this.getRootNode();i.type==="root"&&c(i,xr)&&y(this,Xr,r)})}};Vr=new WeakMap,be=new WeakMap,V=new WeakMap,Z=new WeakMap,Lt=new WeakMap,xr=new WeakMap,Xr=new WeakMap,X=new WeakSet,wa=function(){let{parseRedirect:e}=(vs(),H(ks)),t=this.firstChild.toString(),r=e(t,c(this,V),c(this,Z));return r&&this.setText(r),!!r},Sa=function(e){let{parseCommentAndExt:t}=(jr(),H(qo));this.setText(t(this.firstChild.toString(),c(this,V),c(this,Z),e))},Ca=function(){let{parseBraces:e}=(mn(),H(go)),t=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,r=e(t,c(this,V),c(this,Z));this.setText(this.type==="root"?r:r.slice(1))},$a=function(){if(c(this,V).excludes.includes("html"))return;let{parseHtml:e}=(zo(),H(Uo));this.setText(e(this.firstChild.toString(),c(this,V),c(this,Z)))},Na=function(){if(c(this,V).excludes.includes("table"))return;let{parseTable:e}=(Vo(),H(Go));this.setText(e(this,c(this,V),c(this,Z)))},Ia=function(){if(c(this,V).excludes.includes("hr"))return;let{parseHrAndDoubleUnderscore:e}=(Yo(),H(Jo));this.setText(e(this,c(this,V),c(this,Z)))},Ea=function(e){let{parseLinks:t}=(sa(),H(ia));this.setText(t(this.firstChild.toString(),c(this,V),c(this,Z),e))},La=function(e){if(c(this,V).excludes.includes("quote"))return;let{parseQuotes:t}=(Bi(),H(ea)),r=this.firstChild.toString().split(`
25
- `);for(let i=0;i<r.length;i++)r[i]=t(r[i],c(this,V),c(this,Z),e);this.setText(r.join(`
26
- `))},Fa=function(){if(c(this,V).excludes.includes("extLink"))return;let{parseExternalLinks:e}=(qi(),H(ta));this.setText(e(this.firstChild.toString(),c(this,V),c(this,Z)))},Ra=function(){if(c(this,V).excludes.includes("magicLink"))return;let{parseMagicLinks:e}=(pa(),H(ga));this.setText(e(this.firstChild.toString(),c(this,V),c(this,Z)))},Pa=function(){if(c(this,V).excludes.includes("list"))return;let{parseList:e}=(fa(),H(ma)),{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,Z));this.setText(s.join(`
28
- `))},ja=function(){if(c(this,V).variants.length>0){let{parseConverter:e}=(Aa(),H(va));this.setText(e(this.firstChild.toString(),c(this,V),c(this,Z)))}};A=zi});var oe,rr,$r,Ee,de=v(()=>{"use strict";oe={running:!1,run(a){let{running:n}=this;this.running=!0;try{let{Token:e}=(B(),H($n)),t=a();return t instanceof e&&!t.getAttribute("built")&&t.afterBuild(),this.running=n,t}catch(e){throw this.running=n,e}},rev:0},rr=a=>n=>n.type===a,$r=(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},Ee=(a,n)=>{Object.defineProperty(a,"name",{value:n.name})}});var Ba={};ee(Ba,{Title:()=>Di});var Qr,Kr,Ft,br,Rt,Di,Oa=v(()=>{"use strict";ne();Di=class{constructor(n,e,t,{temporary:r,decode:i,selfLink:s}={}){b(this,Qr);b(this,Kr);b(this,Ft);b(this,br);b(this,Rt);le(this,"valid");le(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=Ye(n),this.encoded=g}catch{}if(n=ct(n).replace(/[_ ]+/gu," ").trim(),o)y(this,br,0);else{let g=e;n.startsWith(":")&&(g=0,n=n.slice(1).trim());let p=n.split(":");if(p.length>1){let d=Oe(p[0]),u=Object.prototype.hasOwnProperty.call(t.nsid,d)&&t.nsid[d];u&&(g=u,n=p.slice(1).join(":").trim())}y(this,br,g)}let l=n.indexOf("#");if(l!==-1){let g=n.slice(l).trim().slice(1);if(g.includes("%"))try{g=Ye(g)}catch{}y(this,Rt,g.replace(/ /gu,"_")),n=n.slice(0,l).trim()}this.valid=!!(n||s&&this.ns===0&&c(this,Rt)!==void 0)&&ct(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,Kr,t.namespaces),y(this,Ft,t.articlePath||"/wiki/$1"),c(this,Ft).includes("$1")||y(this,Ft,c(this,Ft)+`${c(this,Ft).endsWith("/")?"":"/"}$1`),r||Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}})}get ns(){return c(this,br)}get fragment(){return c(this,Rt)}get main(){return c(this,Qr)}set main(n){n=n.replace(/_/gu," ").trim(),y(this,Qr,n&&n[0].toUpperCase()+n.slice(1))}get prefix(){let n=c(this,Kr)[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,Rt,n)}getUrl(n){throw new Error("Title.getUrl method is only available in the LSP version!")}};Qr=new WeakMap,Kr=new WeakMap,Ft=new WeakMap,br=new WeakMap,Rt=new WeakMap});var Wi,Pt,qa,gd,C,G=v(()=>{rs();de();as();ne();Wi=!0,Pt={config:Ln,i18n:void 0,rules:ts,get viewOnly(){return Wi},set viewOnly(a){Wi&&!a&&oe.rev++,Wi=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"),{...Ln,...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=Pt.getConfig(),r){let{Title:i}=(Oa(),H(Ba)),s;if(r!=null&&r.halfParsed)s=new i(a,n,t,r);else{let{Token:o}=(B(),H($n));s=oe.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=Pt.getConfig()){a=is(a);let r;typeof e!="number"&&(r=Array.isArray(e)?e:[e],e=Math.max(...r.map(o=>es[o]||11)));let{Token:i}=(B(),H($n));return oe.run(()=>{let o=new i(a,t);return o.type="root",o.parse(e,n)})},async partialParse(a,n,e,t=Pt.getConfig()){},createLanguageService(a){throw new Error("Parser.createLanguageService method is only available in the LSP version!")}},qa={},gd=new Set(["normalizeTitle","parse","createLanguageService"]);for(let a in Pt)gd.has(a)||(qa[a]={enumerable:!1});Object.defineProperties(Pt,qa);Object.assign(typeof globalThis=="object"?globalThis:self,{Parser:Pt});C=Pt});G();})();
6
+ `})}}return lt(t,e),t}}}),_l={};Y(_l,{ParamTagToken:()=>De});var Vn,Hs,Qn,De,$l=T({"src/paramTag/index.ts"(){"use strict";M(),ae(),fs(),Xi(),B(),O(),Ne(),Vn=[gs],De=class extends(Qn=E){get type(){return"ext-inner"}constructor(e,t,s=_.getConfig(),n=[],l){if(super(void 0,s,n,{}),t){const i=ge;this.append(...t.split(`
7
+ `).map(r=>l?r:Rt(r,s,n,e)).map(r=>new i(r,"param-line",s,n,{})))}n.splice(n.indexOf(this),1),n.push(this)}lint(e=this.getAbsoluteIndex()){const t="no-ignored",s=_.lintConfig.getSeverity(t,this.name);if(!s)return[];const n=new le(this,e),l=_.msg("invalid parameter of <$1>",this.name),i=[];for(const r of this.childNodes){r.setAttribute("aIndex",e);const o=r.childNodes.filter(({type:a})=>a!=="comment"&&a!=="include"&&a!=="noinclude");if(o.some(({type:a})=>a==="ext"))i.push(R(r,n,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=R(r,n,t,l,s);d.suggestions=[{desc:"remove",range:[d.startIndex,d.endIndex],text:""}],i.push(d)}else{const d=r.lint(e,!1);d.length>0&&i.push(...d)}}e+=r.toString().length+1}return i}},Hs=Z(Qn),De=te(Hs,0,"ParamTagToken",Vn,De),ee(Hs,1,De)}}),Ki,Tl=T({"src/heading.ts"(){"use strict";var e,t,Zt,n;M(),pe(),ae(),B(),O(),rt(),Ki=(n=class extends E{constructor(i,r,o,a=[]){super(void 0,o,a);N(this,t);N(this,e);L(this,e,i);const h=new E(r[0],o,a);h.type="heading-title",h.setAttribute("stage",2);const d=new Me(r[1],"heading-trail",o,a);this.append(h,d)}get type(){return"heading"}get level(){return f(this,e)}toString(i){const r=j(this,t,Zt).call(this);return r+this.firstChild.toString(i)+r+this.lastChild.toString(i)}text(){const i=j(this,t,Zt).call(this);return i+this.firstChild.text()+i}getAttribute(i){return i==="invalid"?this.inHtmlAttrs()===2:i==="padding"?this.level:super.getAttribute(i)}getGaps(){return this.level}lint(i=this.getAbsoluteIndex(),r){const o=super.lint(i,r),{firstChild:a,level:h}=this,d=a.toString(),u=d.startsWith("="),g=u||d.endsWith("="),c=new le(this,i),p=this.inHtmlAttrs(),v=["h1","unbalanced-header","format-leakage"],m=v.map(x=>_.lintConfig.getSeverity(x,"apostrophe"));if(m[0]&&this.level===1){const x=R(a,c,v[0],"<h1>",m[0]);g||(x.suggestions=[{desc:"h2",range:[x.startIndex,x.endIndex],text:`=${d}=`}]),o.push(x)}if(m[1]&&g){const x=_.msg("unbalanced $1 in a section header",'"="'),b=R(a,c,v[1],x,m[1]);if(d!=="=")if(u){const[w]=/^=+/u.exec(d),y=h+w.length;b.suggestions=[{desc:`h${h}`,range:[b.startIndex,b.startIndex+w.length],text:""}],y<7&&b.suggestions.push({desc:`h${y}`,range:[b.endIndex,b.endIndex],text:w})}else{const w=/[^=](=+)$/u.exec(d)[1],y=h+w.length;b.suggestions=[{desc:`h${h}`,range:[b.endIndex-w.length,b.endIndex],text:""}],y<7&&b.suggestions.push({desc:`h${y}`,range:[b.startIndex,b.startIndex],text:w})}o.push(b)}if(p){const x="parsing-order",b=_.lintConfig.getSeverity(x,p===2?"heading":"templateInTable");b&&o.push(V(this,c,x,"section header in HTML tag attributes",b))}if(m[2]){const x=this.getRootNode().toString(),b=a.childNodes.filter(xs("quote")),w=b.filter(({bold:A})=>A),y=b.filter(({italic:A})=>A);if(w.length%2){const A=R(w[w.length-1],{...c,start:i+h,left:c.left+h},v[2],_.msg("unbalanced $1 in a section header","bold apostrophes"),m[2]),k=i+h+d.length;x.slice(A.endIndex,k).trim()?A.suggestions=[{desc:"close",range:[k,k],text:"'''"}]:A.fix={desc:"remove",range:[A.startIndex,A.endIndex],text:""},o.push(A)}if(y.length%2){const A=R(y[y.length-1],{start:i+h},v[2],_.msg("unbalanced $1 in a section header","italic apostrophes"),m[2]),k=i+h+d.length;x.slice(A.endIndex,k).trim()?A.suggestions=[{desc:"close",range:[k,k],text:"''"}]:A.fix={desc:"remove",range:[A.startIndex,A.endIndex],text:""},o.push(A)}}return o}print(){const i=j(this,t,Zt).call(this);return super.print({pre:i,sep:i})}json(i,r=this.getAbsoluteIndex()){const o=super.json(void 0,r);return o.level=this.level,o}},e=new WeakMap,t=new WeakSet,Zt=function(){return"=".repeat(this.level)},n)}}),Jn,Cl,ga=T({"src/parameter.ts"(){"use strict";oe(),M(),B(),O(),Jn=new RegExp(`https?://${Ye}${Ze}$`,"iu"),Cl=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{return!1}}constructor(e,t,s,n=[]){super(void 0,s,n);const l=new E(typeof e=="number"?void 0:e,s,n,{}),i=new E(t,s,n);l.type="parameter-key",l.setAttribute("stage",2),i.type="parameter-value",i.setAttribute("stage",2),this.append(l,i)}trimName(e,t=!0){const s=(typeof e=="string"?e:e.toString(!0)).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");return this.setAttribute("name",s),s}afterBuild(){if(!this.anon){const{parentNode:e,firstChild:t}=this,s=this.trimName(t);e&&e.getArgs(s,!1,!1).add(this)}super.afterBuild()}toString(e){return this.anon?this.lastChild.toString(e):super.toString(e,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}lint(e=this.getAbsoluteIndex(),t){var i;const s=super.lint(e,t),n="unescaped",l=_.lintConfig.getSeverity(n);if(l){const{firstChild:r}=this,o=(i=Jn.exec(r.text()))==null?void 0:i[0];try{if(o&&new URL(o).search){const a="unescaped query string in an anonymous parameter",h=R(r,{start:e},n,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{}}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}}}}),Xn,Ds,Kn,Ge,pa=T({"src/transclude.ts"(){"use strict";var e,t,s,n,l,i,es,Il,a;oe(),M(),pe(),ae(),hs(),B(),O(),ga(),Ne(),rt(),Xn=[Pt()],Ge=(a=class extends(Kn=E){constructor(d,u,g,c=[]){var I,U;let p;const v=/^(?:\s|\0\d+[cn]\x7F)*\0(\d+)h\x7F(?:\s|\0\d+[cn]\x7F)*/u.exec(d);v&&(p=Number(v[1]),d=d.replace(`\0${p}h`,c[p].toString().replace(/^\n/u,"")));super(void 0,g,c,{});N(this,i);Se(this,"modifier","");N(this,e,"template");N(this,t,":");N(this,s,!1);N(this,n,new Map);N(this,l);const{parserFunction:[m,x],variable:b,functionHook:w}=g,y=(I=/^(?:\s|\0\d+[cn]\x7F)*\0\d+s\x7F/u.exec(d))==null?void 0:I[0];if(y)this.setAttribute("modifier",y),d=d.slice(y.length);else if(d.includes(":")){const[F,...P]=d.split(":"),[X]=/^(?:\s|\0\d+[cn]\x7F)*/u.exec((U=P[0])!=null?U:"");this.setModifier(`${F}:${X}`)&&(d=P.join(":").slice(X.length))}const A=d.search(/[::]/u),k=d[A]===":",S=A!==-1;if(S||u.length===0&&!f(this,s)){const F=S?d.slice(0,A):d,P=S&&d.slice(A+1),X=me(F),W=S?X.slice(X.search(/\S/u))+(k?":":""):X.trim(),Q=W.toLowerCase(),z=Array.isArray(x),ie=z?x.includes(W):Object.prototype.hasOwnProperty.call(x,W),q=!z&&ie?x[W]:Object.prototype.hasOwnProperty.call(m,Q)&&m[Q],D=z&&ie||!("functionHook"in g)||w.includes(q),H=z&&ie||b.includes(q);if(S?q&&D:H){this.setAttribute("name",q||Q.replace(/^#|:$/u,"")),L(this,e,"magic-word"),k&&L(this,t,":");const J=new Me(F,"magic-word-name",g,c);if(super.insertAt(J),P!==!1&&u.unshift([P]),this.name==="invoke")for(let ne=0;ne<2;ne++){const K=u.shift();if(!K)break;const re=new ge(K.join("="),`invoke-${ne?"function":"module"}`,g,c);super.insertAt(re)}}}if(this.type==="template"){const F=me(d).trim();if(!this.normalizeTitle(F,10,{halfParsed:!0,temporary:!0}).valid)throw c.pop(),new SyntaxError("Invalid template name");const P=new ge(d,"template-name",g,c,{});super.insertAt(P)}typeof p=="number"&&(c[p]=void 0);const $=this.isTemplate();let C=1;for(let F=0;F<u.length;F++){const P=u[F];$||this.name==="switch"&&F>0||this.name==="tag"&&F>1||(P[0]=P.join("="),P.length=1),P.length===1&&(P.unshift(C),C++),this.insertAt(new Cl(...P,g,c))}this.seal("modifier")}get type(){return f(this,e)}get module(){}get function(){}setModifier(d){const{parserFunction:[,,u,g]}=this.getAttribute("config"),c=me(d).trim();if(d&&!c.endsWith(":"))return!1;const p=c.slice(0,-1).toLowerCase(),v=u.includes(p),m=g.includes(p);return f(this,s)&&v||!f(this,s)&&(m||!d)||(ve.running||this.length>1)&&(v||m||!d)?(this.setAttribute("modifier",d),L(this,s,v),!!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"&&(L(this,l,j(this,i,es).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:g,modifier:c,type:p,name:v}=this;return p==="magic-word"&&v==="vardefine"?"":`{{${c}${p==="magic-word"?g.text()+(u===1?"":f(this,t))+Be(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,i,es).call(this).valid);default:return super.getAttribute(d)}}lint(d=this.getAbsoluteIndex(),u){const g=super.lint(d,u);if(!this.isTemplate())return g;const{type:c,childNodes:p,length:v}=this,m=new le(this,d),x=c==="magic-word";let b="no-ignored",w=_.lintConfig.getSeverity(b,"fragment");if(x&&!j(this,i,es).call(this).valid)b="invalid-invoke",w=_.lintConfig.getSeverity(b,"name"),w&&g.push(R(p[1],m,b,"illegal module name",w));else if(w){const y=p[x?1:0],A=y.childNodes.findIndex(S=>S.type==="text"&&Lt(S.data).includes("#")),k=y.childNodes[A];if(k){const S=R(y,m,b,"useless fragment",w);S.fix={desc:"remove",range:[S.startIndex+y.getRelativeIndex(A)+k.data.indexOf("#"),S.endIndex],text:""},g.push(S)}}if(b="invalid-invoke",w=_.lintConfig.getSeverity(b,"function"),w&&x&&v===2)return g.push(V(this,m,b,"missing module function",w)),g;if(b="no-duplicate",w=_.lintConfig.getSeverity(b,"parameter"),w){const y=this.getDuplicatedArgs().filter(([,k])=>!k[0].querySelector("ext")),A="duplicated parameter";for(const[,k]of y)g.push(...k.map(S=>{const $=R(S,m,b,A,w);return $.suggestions=[{desc:"remove",range:[$.startIndex-1,$.endIndex],text:""}],$}))}return g}insertAt(d,u=this.length){return super.insertAt(d,u),d.anon?j(this,i,Il).call(this,d):d.name&&this.getArgs(d.name,!1,!1).add(d),d}getAllArgs(){return this.childNodes.filter(xs("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:d})=>d)}getArgs(d,u,g=!0){const c=String(d).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1");let p;return f(this,n).has(c)?p=f(this,n).get(c):(p=new Set(this.getAllArgs().filter(({name:v})=>c===v)),f(this,n).set(c,p)),p}getDuplicatedArgs(){return[...f(this,n)].filter(([,{size:d}])=>d>1).map(([d,u])=>[d,[...u]])}getPossibleValues(){const{type:d,name:u,childNodes:g}=this;if(d==="template")throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!");let c,p;switch(u){case"if":case"ifexist":case"ifexpr":case"iferror":c=2;break;case"ifeq":c=3;break;case"switch":{const v=g.slice(2),m=v[v.length-1];p=[...v.filter(({anon:x})=>!x),...m!=null&&m.anon?[m]:[]].map(({lastChild:x})=>x);break}default:throw new Error("TranscludeToken.getPossibleValues method is only for specific magic words!")}p!=null||(p=g.slice(c,c+2).map(({lastChild:v})=>v));for(let v=0;v<p.length;){const{length:m,0:x}=p[v].childNodes.filter(b=>b.text().trim());if(m===0)p.splice(v,1);else if(m>1||x.type!=="magic-word")v++;else try{const b=x.getPossibleValues();p.splice(v,1,...b),v+=b.length}catch{v++}}return p}print(){const{childNodes:d,length:u,firstChild:g,modifier:c,type:p}=this;return`<span class="wpb-${p}${this.getAttribute("invalid")?" wpb-invalid":""}">{{${p==="magic-word"?Ft(c)+g.print()+(u===1?"":f(this,t))+tt(d.slice(1),{sep:"|"}):(c?`<span class="wpb-magic-word">${Ft(c)}</span>`:"")+tt(d,{sep:"|"})}}}</span>`}},e=new WeakMap,t=new WeakMap,s=new WeakMap,n=new WeakMap,l=new WeakMap,i=new WeakSet,es=function(){const d=this.type==="template";return this.normalizeTitle(this.childNodes[d?0:1].text(),d?10:828,{temporary:!0})},Il=function(d){const u=this.getAnonArgs(),g=typeof d!="number";for(let c=g?u.indexOf(d):d-1;c<u.length;c++){const p=u[c],{name:v}=p,m=String(c+1);(v!==m||p===d)&&(p.setAttribute("name",m),this.getArgs(m,!1,!1).add(p))}},a),Ds=Z(Kn),Ge=te(Ds,0,"TranscludeToken",Xn,Ge),ee(Ds,1,Ge)}}),Yn,Gs,Zn,bt,fa=T({"src/hidden.ts"(){"use strict";nt(),O(),Yn=[We()],bt=class extends(Zn=E){get type(){return"hidden"}getAttribute(e){return e==="invalid"||super.getAttribute(e)}},Gs=Z(Zn),bt=te(Gs,0,"HiddenToken",Yn,bt),ee(Gs,1,bt)}}),er,Vs,tr,wt,xa=T({"src/arg.ts"(){"use strict";var e,ma,s;oe(),M(),ae(),Ie(),hs(),B(),O(),Ne(),fa(),er=[_e("{{{"),Pt()],wt=(s=class extends(tr=E){constructor(l,i,r=[]){super(void 0,i,r,{});N(this,e);for(let o=0;o<l.length;o++){const a=l[o];if(o===0){const h=new ge(a,"arg-name",i,r,{});super.insertAt(h)}else if(o>1){const h=new bt(a,i,r);super.insertAt(h)}else{const h=new E(a,i,r);h.type="arg-default",h.setAttribute("stage",2),super.insertAt(h)}}}get type(){return"arg"}get default(){var l,i;return(i=(l=this.childNodes[1])==null?void 0:l.text())!=null?i:!1}toString(l){return`{{{${super.toString(l,"|")}}}}`}text(){return`{{{${Be(this.childNodes.slice(0,2),"|")}}}}`}afterBuild(){super.afterBuild()}lint(l=this.getAbsoluteIndex(),i){const{childNodes:[r,o,...a]}=this;r.setAttribute("aIndex",l+3);const h=r.lint(l+3,i);if(o){const g=l+4+r.toString().length;o.setAttribute("aIndex",g);const c=o.lint(g,i);c.length>0&&h.push(...c)}const d=["no-ignored","no-arg"],u=d.map(g=>_.lintConfig.getSeverity(g,"arg"));if(u[0]&&a.length>0){const g=new le(this,l);h.push(...a.map(c=>{const p=R(c,g,d[0],"invisible content inside triple braces",u[0]);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(u[1]&&!this.getAttribute("include")){const g=V(this,{start:l},d[1],"unexpected template argument",u[1]);o&&(g.suggestions=[{desc:"expand",range:[l,g.endIndex],text:o.text()}]),h.push(g)}return h}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(l,i=this.getAbsoluteIndex()){const r=super.json(void 0,i);return r.default=this.default,r}},e=new WeakSet,ma=function(){},s),Vs=Z(tr),wt=te(Vs,0,"ArgToken",er,wt),ee(Vs,1,wt)}}),Nl={};Y(Nl,{parseBraces:()=>ps});var sr,Qs,Ht,Js,Xs,Ks,ir,Ys,ps,Yi=T({"parser/braces.ts"(){"use strict";Et(),oe(),Tl(),pa(),xa(),sr={"=":String.raw`\n(?!(?:[^\S\n]|\0\d+[cn]\x7F)*\n)`,"{":String.raw`\}{2,}|\|`,"-":String.raw`\}-`,"[":String.raw`\]\]`},Qs=String.raw`\[(?!\[)`,Ht=String.raw`\n(?![=\0])`,Js=String.raw`|\{{2,}`,Xs=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"],["server","m"]]),Ks=Ke(e=>new RegExp(e,"gmu")),ir=new RegExp(String.raw`\{\{((?:[^\n{}[]|${Qs}|${Ht})*)\}\}(?!\})`+"|"+String.raw`\[\[(?:[^\n[\]{]|${Ht})*\]\]`+"|"+String.raw`-\{(?:[^\n{}[]|${Qs}|${Ht})*\}-`,"gu"),Ys=e=>{const t=et(me(e));return Xs.has(t)?Xs.get(t):/^(?:filepath|(?:full|canonical)urle?):./u.test(t)?"m":/^#vardefine:./u.test(t)?"n":"t"},ps=(e,t,s)=>{var p,v,m,x,b;const n=String.raw`${t.excludes.includes("heading")?"":String.raw`^((?:\0\d+[cno]\x7F)*)={1,6}|`}\[\[|-\{(?!\{)`,{parserFunction:[,,,l]}=t,i=[],r=[],o=(w,y,A,k)=>{y[y.length-1].push(ke(w.slice(A,k),r))};let a;do a!==void 0&&(e=a),a=e.replace(ir,(w,y,A)=>{if(y!==void 0||typeof A=="string")try{const{length:k}=s,S=(y!=null?y:A).split("|");return new Ge(ke(S[0],r),S.slice(1).map($=>{const C=$.indexOf("=");return(C===-1?[$]:[$.slice(0,C),$.slice(C+1)]).map(I=>ke(I,r))}),t,s),`\0${k}${Ys(S[0])}`}catch(k){if(!(k instanceof SyntaxError)||k.message!=="Invalid template name")throw k}return r.push(ke(w,r)),`\0${r.length-1}`});while(a!==e);e=a;const h=e.lastIndexOf("}}")-e.length;let d=h+e.length!==-1,u=Ks(n+(d?Js:"")),g=u.exec(e),c;for(;g||c!==void 0&&c<=e.length&&((v=(p=i[i.length-1])==null?void 0:p[0])!=null&&v.startsWith("="));){if(g!=null&&g[1]){const[,{length:P}]=g;g[0]=g[0].slice(P),g.index+=P}const{0:w,index:y}=g!=null?g:{0:`
8
+ `,index:e.length},A=(m=i.pop())!=null?m:{},{0:k,index:S,parts:$,findEqual:C,pos:I}=A,U=w==="="&&C;if(w==="]]"||w==="}-")c=y+2;else if(w===`
9
+ `){c=y+1;const{pos:P,findEqual:X}=(x=i[i.length-1])!=null?x:{};if(P===void 0||X||me(e.slice(P,S))!==""){const W=/^(={1,6})(.+)\1((?:\s|\0\d+[cn]\x7F)*)$/u.exec(e.slice(S,y));W&&(W[2]=ke(W[2],r),W[2].includes(`
10
+ `)||(e=`${e.slice(0,S)}\0${s.length}h${e.slice(y)}`,c=S+4+String(s.length).length,new Ki(W[1].length,W.slice(2),t,s)))}}else if(w==="|"||U)c=y+1,o(e,$,I,y),w==="|"&&$.push([]),A.pos=c,A.findEqual=w==="|",i.push(A);else if(w.startsWith("}}")){const P=w.slice(0,Math.min(k.length,3)),X=k.length-P.length,{length:W}=s;c=y+P.length,o(e,$,I,y);let Q=!1,z="t";if(P.length===3){const ie=$.map(D=>D.join("=")),q=ie.length>1&&me(ie[1]).trim();new wt(ie,t,s),q&&q.endsWith(":")&&l.includes(q.slice(0,-1).toLowerCase())&&(z="s")}else try{new Ge($[0][0],$.slice(1),t,s),z=Ys($[0][0])}catch(ie){if(ie instanceof SyntaxError&&ie.message==="Invalid template name")Q=!0;else throw ie}Q||(e=`${e.slice(0,S+X)}\0${W}${z}${e.slice(c)}`,c=S+X+3+String(W).length,X>1?i.push({0:k.slice(0,X),index:S,pos:S+X,parts:[[]]}):X===1&&e[S-1]==="-"&&i.push({0:"-{",index:S-1,pos:S+1,parts:[[]]}))}else c=y+w.length,w.startsWith("{")&&(g.pos=c,g.parts=[[]]),i.push(..."0"in A?[A]:[],g);let F=i[i.length-1];if(d&&h+e.length<c)for(d=!1;(b=F==null?void 0:F[0])!=null&&b.startsWith("{");)i.pop(),F=i[i.length-1];u=Ks(n+(d?Js:"")+(F?`|${sr[F[0][0]]}${F.findEqual?"|=":""}`:"")),u.lastIndex=c,g=u.exec(e)}return ke(e,r)}}}),Ll={};Y(Ll,{InputboxToken:()=>Fl});var Fl,va=T({"src/paramTag/inputbox.ts"(){"use strict";fs(),Yi(),B(),$l(),Fl=class extends De{constructor(e,t,s=_.getConfig(),n=[]){const l=Symbol("InputboxToken"),i=s.excludes.includes("heading")?s:{...s,excludes:[...s.excludes,"heading"]},{length:r}=n;n.push(l),t&&(t=Rt(t,i,n,e)),t&&(t=ps(t,i,n)),n.splice(r,1),super(e,t,i,n,{})}}}}),ts={};Y(ts,{NestedToken:()=>jl});var nr,rr,jl,Zs=T({"src/nested.ts"(){"use strict";var e,t,s;M(),ae(),fs(),Yi(),B(),O(),Xl(),Fe(),nr=new Set(["comment","include","arg","template","magic-word"]),rr=[!1,!0].map(n=>{const l=n?"includeonly":"noinclude";return new RegExp(String.raw`^(?:<${l}(?:\s[^>]*)?/?>|</${l}\s*>)$`,"iu")}),jl=(s=class extends E{constructor(l,i,r,o,a=[]){if(typeof i=="boolean"){const h=Symbol("InputboxToken"),{length:d}=a;a.push(h),l&&(l=Rt(l,o,a,i)),l&&(l=ps(l,o,a)),a.splice(d,1)}else l&&(l=l.replace(i,(h,d,u,g,c)=>{const p=`\0${a.length+1}e`;return new Xe(d,u,g,c,o,!1,a),p}));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);N(this,e);N(this,t);L(this,e,[...r]),L(this,t,i)}get type(){return"ext-inner"}lint(l=this.getAbsoluteIndex(),i){const r=super.lint(l,i),o="no-ignored",a=_.lintConfig.getSeverity(o,this.name);if(!a)return r;const h=new le(this,l),d=typeof f(this,t)=="boolean"?rr[f(this,t)?1:0]:/^<!--[\s\S]*-->$/u;return[...r,...this.childNodes.filter(u=>{const{type:g,name:c}=u;if(g==="ext")return!f(this,e).includes(c);if(nr.has(g))return!1;const p=u.toString().trim();return p&&!d.test(p)}).map(u=>{const g=R(u,h,o,_.msg("invalid content in <$1>",this.name),a);return g.suggestions=[{desc:"remove",range:[g.startIndex,g.endIndex],text:""},{desc:"comment",range:[g.startIndex,g.endIndex],text:`<!--${u.toString()}-->`}],g})]}},e=new WeakMap,t=new WeakMap,s)}});function lr(e,t,s,n,l){t=me(t).trim();let i=t.replace(e==="link"?/\0\d+[tq]\x7F/gu:/\0\d+t\x7F/gu,"").trim();switch(e){case"width":return!i&&!!t||/^(?:\d+x?|\d*x\d+)(?:\s*px)?$/u.test(i);case"link":{if(i){if(El(s.protocol).test(i))return Pl(s.protocol).test(i)&&t;i.startsWith("[[")&&i.endsWith("]]")&&(i=i.slice(2,-2))}else return t;const r=_.normalizeTitle(i,0,!1,s,{halfParsed:n,decode:!0,selfLink:!0});return r.valid&&r}case"lang":return(l==="svg"||l==="svgz")&&!/[^a-z\d-]/u.test(i);case"alt":case"class":case"manualthumb":return!0;case"page":return(l==="djvu"||l==="djv"||l==="pdf")&&Number(i)>0;default:return!!i&&!isNaN(i)}}var El,Pl,or,ar,Rl,ba=T({"src/imageParameter.ts"(){"use strict";var e,t,Ol,l;Et(),oe(),M(),B(),O(),El=Ke(i=>new RegExp(String.raw`^(?:${i}|//|\0\d+m\x7F)`,"iu")),Pl=Ke(i=>new RegExp(String.raw`^(?:(?:${i}|//)${Ye}|\0\d+m\x7F)${Ze}$`,"iu")),or=Ke(i=>new RegExp(String.raw`^(\s*(?!\s))${i.replace("$1","(.*)")}${i.endsWith("$1")?`(?=$|
11
+ )`:""}(\s*)$`,"u")),ar=new Set(["alt","link","lang","page","caption"]),Rl=(l=class extends E{constructor(r,o,a,h){var i=(...n)=>(super(...n),N(this,t),N(this,e,""),this);let d;const u=Object.entries(a.img).map(([c,p])=>[c,p,or(c)]),g=u.find(([,c,p])=>(d=p.exec(r),d&&(d.length!==4||lr(c,d[2],a,!0,o)!==!1)));if(g&&d){d.length===3?(i(void 0,a,h),L(this,e,r)):(i(d[2],a,h,{}),L(this,e,d[1]+g[0]+d[3])),this.setAttribute("name",g[1]);return}i(r,a.excludes.includes("list")?a:{...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"?lr("link",super.text(),this.getAttribute("config")):void 0}afterBuild(){var r;(r=this.parentNode)!=null&&r.is("gallery-image")&&!ar.has(this.name)&&this.setAttribute("name","invalid"),super.afterBuild()}toString(r){return f(this,e)?f(this,e).replace("$1",super.toString(r)):super.toString(r)}text(){return f(this,e)?f(this,e).replace("$1",super.text()).trim():super.text().trim()}isPlain(){return this.name==="caption"}getAttribute(r){return r==="invalid"?this.name==="invalid":r==="padding"?Math.max(0,f(this,e).indexOf("$1")):super.getAttribute(r)}lint(r=this.getAbsoluteIndex(),o){const a=super.lint(r,o),{link:h,name:d}=this;if(d==="invalid"){const u="invalid-gallery",g=_.lintConfig.getSeverity(u,"parameter");if(g){const c=V(this,{start:r},u,"invalid image parameter",g);c.fix={desc:"remove",range:[r-1,c.endIndex],text:""},a.push(c)}}else if(typeof h=="object"&&h.encoded){const u="url-encoding",g=_.lintConfig.getSeverity(u,"file");if(g){const c=V(this,{start:r},u,"unnecessary URL encoding in an internal link",g);c.suggestions=[{desc:"decode",range:[r,c.endIndex],text:Nt(this.text())}],a.push(c)}}return a}getValue(){return this.name==="invalid"?this.text():j(this,t,Ol).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,Ol=function(){return f(this,e)&&!f(this,e).includes("$1")},l)}}),ei,dr,hr,ti,si,ur,cr,ii,Zi,Bl=T({"src/link/file.ts"(){"use strict";M(),ae(),B(),ds(),ba(),ei=new Map([["manualthumb","Thumb"],["frameless","Frameless"],["framed","Frame"],["thumbnail","Thumb"]]),dr=new Set(["arg"]),hr=new Set(["template","magic-word"]),ti=new Set(["left","right","center","none"]),si=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),ur=new Set(["tiff","tif","png","gif","jpg","jpeg","webp","xcf","pdf","svg","djvu"]),cr=e=>{if(e===void 0)return[];const t=/-\{|\}-|\|/gu,s=[];let n=t.exec(e),l=0,i=0;for(;n;){const{0:r,index:o}=n;r!=="|"?l+=r==="-{"?1:-1:l===0&&(s.push(e.slice(i,o)),{lastIndex:i}=t),n=t.exec(e)}return s.push(e.slice(i)),s},ii=(e,t)=>e.filter(({childNodes:s})=>{const n=s.filter(l=>l.text().trim());return n.length!==1||!t.has(n[0].type)}),Zi=class extends Te{get type(){return"file"}get extension(){return this.getAttribute("title").extension}constructor(e,t,s,n=[],l="|"){super(e,void 0,s,n,l);const{extension:i}=this.getTitle(!0,!0);this.safeAppend(cr(t).map(r=>new Rl(r,i,s,n)))}lint(e=this.getAbsoluteIndex(),t){var m;const s=super.lint(e,t),n=ii(this.getAllArgs(),dr),l=[...new Set(n.map(({name:x})=>x))],i=l.filter(x=>ei.has(x)),r=l.filter(x=>ti.has(x)),o=l.filter(x=>si.has(x)),[a]=i,h=a==="framed"||a==="manualthumb",d=new le(this,e);let u="nested-link",g=_.lintConfig.getSeverity(u,"file");if(g&&this.closest("ext-link-text")&&((m=this.getValue("link"))==null?void 0:m.trim())!==""&&s.push(V(this,d,u,"internal link in an external link",g)),u="invalid-gallery",g=_.lintConfig.getSeverity(u,"parameter"),g&&h)for(const x of n.filter(({name:b})=>b==="width")){const b=R(x,d,u,"invalid image parameter",g);b.fix={desc:"remove",range:[b.startIndex-1,b.endIndex],text:""},s.push(b)}if(n.length===l.length&&i.length<2&&r.length<2&&o.length<2)return s;u="no-duplicate";const{extension:c}=this,p=["unknownImageParameter","imageParameter"].map(x=>_.lintConfig.getSeverity(u,x)),v=(x,b,w,y=!0)=>x.map(A=>{if(g=p[Number(typeof y=="function"?y(A):y)],!g)return!1;const k=R(A,d,u,_.msg(`${b} image $1 parameter`,w),g);return k.suggestions=[{desc:"remove",range:[k.startIndex-1,k.endIndex],text:""}],k}).filter(A=>A!==!1);for(const x of l){if(x==="invalid"||x==="width"&&h)continue;const b=x==="caption";let w=n.filter(({name:y})=>y===x);if(b&&(w=[...w.slice(0,-1).filter(y=>y.text()),...w.slice(-1)]),w.length>1){let y=!b||!c||ur.has(c);if(b&&y){const A=ii(w,hr);y=A.length>1&&(k=>A.includes(k))}s.push(...v(w,"duplicated",x,y))}}return i.length>1&&s.push(...v(n.filter(({name:x})=>ei.has(x)),"conflicting","frame")),r.length>1&&s.push(...v(n.filter(({name:x})=>ti.has(x)),"conflicting","horizontal-alignment")),o.length>1&&s.push(...v(n.filter(({name:x})=>si.has(x)),"conflicting","vertical-alignment")),s}getAllArgs(){return this.childNodes.slice(1)}getArgs(e){return this.getAllArgs().filter(({name:t})=>e===t)}getArg(e){const t=this.getArgs(e);return t[e==="manualthumb"?0:t.length-1]}getValue(e){var t;return(t=this.getArg(e))==null?void 0:t.getValue()}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t),{extension:n}=this;return n&&(s.extension=n),s}}}}),gr,ni,pr,Ve,ql=T({"src/link/galleryImage.ts"(){"use strict";var e,Ri,s;M(),qe(),Ie(),B(),O(),Bl(),gr=[_e("")],Ve=(s=class extends(pr=Zi){constructor(l,i,r,o,a=[]){let h;if(r!==void 0){const{length:d}=a;h=new E(r,o,a);for(let u=1;u<xe;u++)h.parseOnce();a.splice(d,1)}super(i,h==null?void 0:h.toString(),o,a);N(this,e);Se(this,"privateType","imagemap-image");this.setAttribute("bracket",!1),this.privateType=`${l}-image`,this.seal("privateType",!0)}get type(){return this.privateType}getTitle(l){const i=this.type==="imagemap-image";return this.normalizeTitle(this.firstChild.toString(),i?0:6,{halfParsed:!0,temporary:l,decode:!i})}lint(l=this.getAbsoluteIndex(),i){const r=super.lint(l,i),o="invalid-gallery",a=_.lintConfig.getSeverity(o,"image");if(a&&j(this,e,Ri).call(this)){const h=V(this,{start:l},o,"invalid gallery image",a);h.suggestions=[{desc:"prefix",range:[l,l],text:"File:"}],r.push(h)}return r}getAttribute(l){return l==="invalid"?j(this,e,Ri).call(this):super.getAttribute(l)}},e=new WeakSet,Ri=function(){const{ns:l}=this.getAttribute("title");return l!==6},s),ni=Z(pr),Ve=te(ni,0,"GalleryImageToken",gr,Ve),ee(ni,1,Ve)}}),Wl={};Y(Wl,{GalleryToken:()=>yt});var fr,ri,xr,yt,wa=T({"src/gallery.ts"(){"use strict";var e,Ml,Oi,n;Xi(),B(),O(),ql(),Fe(),fr=[gs],yt=(n=class extends(xr=E){constructor(i,r,o=[]){var a;super(void 0,r,o,{});N(this,e);for(const h of(a=i==null?void 0:i.split(`
12
+ `))!=null?a:[]){const d=/^([^|]+)(?:\|(.*))?/u.exec(h);if(!d){super.insertAt(h.trim()?new he(h,r,o):h);continue}const[,u,g]=d;j(this,e,Ml).call(this,u)?super.insertAt(new Ve("gallery",u,g,r,o)):super.insertAt(new he(h,r,o))}}get type(){return"ext-inner"}get widths(){return j(this,e,Oi).call(this,"widths")}get heights(){return j(this,e,Oi).call(this,"heights")}lint(i=this.getAbsoluteIndex(),r){const{top:o,left:a}=this.getRootNode().posFromIndex(i),h=[],d="no-ignored",u=["Image","NoImage","Comment"].map(g=>_.lintConfig.getSeverity(d,`gallery${g}`));for(let g=0;g<this.length;g++){const c=this.childNodes[g],p=c.toString(),{length:v}=p,m=p.trim(),{type:x}=c,b=o+g,w=g?0:a;if(c.setAttribute("aIndex",i),x==="noinclude"&&m&&!/^<!--.*-->$/u.test(m)){let[y]=u;if(m.startsWith("|")?[,y]=u:(m.startsWith("<!--")||m.endsWith("-->"))&&([,,y]=u),y){const A=i+v;h.push({rule:d,message:_.msg("invalid content in <$1>","gallery"),severity:y,startIndex:i,endIndex:A,startLine:b,endLine:b,startCol:w,endCol:w+v,suggestions:[{desc:"remove",range:[i,A],text:""},{desc:"comment",range:[i,A],text:`<!--${p}-->`}]})}}else if(x!=="noinclude"&&x!=="text"){const y=c.lint(i,r);y.length>0&&h.push(...y)}i+=v+1}return h}json(i,r=this.getAbsoluteIndex()){const o=super.json(void 0,r);return Object.assign(o,{widths:this.widths,heights:this.heights}),o}},e=new WeakSet,Ml=function(i){return this.normalizeTitle(i,6,{halfParsed:!0,temporary:!0,decode:!0}).valid},Oi=function(i){var a,h;const r=(a=this.parentNode)==null?void 0:a.getAttr(i),o=typeof r=="string"&&((h=/^(\d+)\s*(?:px)?$/u.exec(r))==null?void 0:h[1]);return o&&Number(o)||120},n),ri=Z(xr),yt=te(ri,0,"GalleryToken",fr,yt),ee(ri,1,yt)}}),en,Ul=T({"src/link/index.ts"(){"use strict";M(),B(),ds(),en=class extends Te{get type(){return"link"}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),n="nested-link",l=_.lintConfig.getSeverity(n);return l&&this.closest("ext-link-text")&&s.push(V(this,{start:e},n,"internal link in an external link",l)),s}}}}),mr,vr,jt,tn=T({"src/magicLink.ts"(){"use strict";var e,t,Bi,n;M(),oe(),ae(),B(),O(),mr=String.raw`(?:[${Ce}\t]|&nbsp;|&#0*160;|&#[xX]0*[aA]0;)`,vr=new RegExp(`${mr}+`,"gu"),jt=(n=class extends E{constructor(i,r="free-ext-link",o=_.getConfig(),a){super(i,o,a,{});N(this,t);N(this,e);L(this,e,r)}get type(){return f(this,e)}get innerText(){const i=new Map([["!","|"],["=","="]]);let r=Be(this.childNodes.map(o=>{const{type:a}=o,h=String(o.name);return a==="magic-word"&&i.has(h)?i.get(h):o}));return this.type==="magic-link"&&(r=r.replace(vr," ")),r}get link(){const{innerText:i}=this;return this.type==="magic-link"?i.startsWith("ISBN")?`ISBN ${i.slice(5).replace(/[- ]/gu,"").replace(/x$/u,"X")}`:i:dl(i).replace(/\n/gu,"%0A")}lint(i=this.getAbsoluteIndex(),r){const o=super.lint(i,r),a=new le(this,i),{type:h,childNodes:d}=this;if(h==="magic-link"){const p="invalid-isbn",v=_.lintConfig.getSeverity(p);return v&&j(this,t,Bi).call(this)&&o.push(V(this,a,p,"invalid ISBN",v)),o}const u=h==="ext-link-url",g="unterminated-url",c=_.lintConfig.getSeverity(g,u?"pipe":"punctuation");if(c){const p=u?/\|/u:/[,;。:!?()]+/u,v=d.find(m=>m.type==="text"&&p.test(m.data));if(v){const{data:m}=v,x=R(v,a,g,_.msg("$1 in URL",u?'"|"':"full-width punctuation"),c),{index:b,0:w}=p.exec(m),y=x.startIndex+b;x.suggestions=u?[{desc:"whitespace",range:[y,y+1],text:" "}]:[{desc:"whitespace",range:[y,y],text:" "},{desc:"escape",range:[y,y+w.length],text:encodeURI(w)}],o.push(x)}}return o}getUrl(i){this.lspError("MagicLinkToken.getUrl")}getAttribute(i){return i==="invalid"?j(this,t,Bi).call(this):super.getAttribute(i)}},e=new WeakMap,t=new WeakSet,Bi=function(){if(this.type==="magic-link"){const{link:i}=this;if(i.startsWith("ISBN")){const r=[...i.slice(5)].map(o=>o==="X"?10:Number(o));return r.length===10?r.reduce((o,a,h)=>o+a*(10-h),0)%11!==0:r.length===13&&(r[12]===10||r.reduce((o,a,h)=>o+a*(h%2?3:1),0)%10!==0)}}return!1},n)}}),br,li,wr,Qe,zl=T({"src/extLink.ts"(){"use strict";var e,t;qe(),M(),Ie(),B(),O(),tn(),br=[_e("[")],Qe=(t=class extends(wr=E){constructor(n,l="",i="",r,o=[]){super(void 0,r,o,{});N(this,e);const a=n&&/^\0\d+f\x7F$/u.test(n)?o[Number(n.slice(1,-2))]:new jt(n,"ext-link-url",r,o);if(this.insertAt(a),L(this,e,l),i){const h=new E(i,r,o,{});h.type="ext-link-text",h.setAttribute("stage",xe-1),this.insertAt(h)}}get type(){return"ext-link"}toString(n){return this.length===1?`[${super.toString(n)}${f(this,e)}]`:`[${super.toString(n,f(this,e))}]`}text(){return`[${super.text(" ")}]`}getGaps(){return f(this,e).length}lint(n=this.getAbsoluteIndex(),l){const i=super.lint(n,l),r="var-anchor",o=_.lintConfig.getSeverity(r,"extLink");return o&&this.length===1&&this.closest("heading-title")&&i.push(V(this,{start:n},r,"variable anchor in a section header",o)),i}print(){return super.print(this.length===1?{pre:"[",post:`${f(this,e)}]`}:{pre:"[",sep:f(this,e),post:"]"})}},e=new WeakMap,t),li=Z(wr),Qe=te(li,0,"ExtLinkToken",br,Qe),ee(li,1,Qe)}}),qi,ya=T({"src/imagemapLink.ts"(){"use strict";O(),Fe(),Ul(),zl(),qi=class extends E{get type(){return"imagemap-link"}constructor(e,t,s,n,l=[]){super(void 0,n,l),this.append(e,t.length===2?new en(...t,n,l):new Qe(...t,n,l),new he(s,n,l))}}}}),Hl={};Y(Hl,{ImagemapToken:()=>St});var yr,oi,Sr,St,Sa=T({"src/imagemap.ts"(){"use strict";M(),pe(),ae(),Xi(),B(),O(),Fe(),ql(),ya(),yr=[gs],St=class extends(Sr=E){get type(){return"ext-inner"}get image(){return this.childNodes.find(xs("imagemap-image"))}constructor(e,t=_.getConfig(),s=[]){if(super(void 0,t,s,{}),!e)return;const n=e.split(`
13
+ `),l=new Set(t.protocol.split("|")),i=he;let r=!0,o=!1;for(const a of n){const h=a.trim();if(!(o||!h||h.startsWith("#"))){if(r){const d=a.indexOf("|"),u=d===-1?a:a.slice(0,d),{valid:g,ns:c}=this.normalizeTitle(u,0,{halfParsed:!0,temporary:!0});if(g&&c===6){const p=new Ve("imagemap",u,d===-1?void 0:a.slice(d+1),t,s);super.insertAt(p),r=!1;continue}else o=!0}else if(a.trim().split(/[\t ]/u,1)[0]==="desc"){super.insertAt(a);continue}else if(a.includes("[")){const d=a.indexOf("["),u=a.slice(d),g=/^\[\[([^|]+)(?:\|([^\]]*))?\]\][\w\s]*$/u.exec(u);if(g){if(this.normalizeTitle(g[1],0,{halfParsed:!0,temporary:!0,selfLink:!0}).valid){super.insertAt(new qi(a.slice(0,d),g.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 c=/^\[([^\]\s]+)(?:(\s+(?!\s))([^\]]*))?\][\w\s]*$/u.exec(u);if(c){super.insertAt(new qi(a.slice(0,d),c.slice(1),u.slice(u.indexOf("]")+1),t,s));continue}}}}super.insertAt(new i(a,t,s))}}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),n=new le(this,e),{childNodes:l,image:i}=this,r="invalid-imagemap",o=_.lintConfig.getSeverity(r,i?"link":"image");return o&&(i?s.push(...l.filter(a=>{const h=a.toString().trim();return a.is("noinclude")&&h&&!h.startsWith("#")}).map(a=>{const h=R(a,n,r,"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(V(this,n,r,"<imagemap> without an image",o))),s}getAttribute(e){return e==="invalid"?!this.image:super.getAttribute(e)}},oi=Z(Sr),St=te(oi,0,"ImagemapToken",yr,St),ee(oi,1,St)}}),Ar,ai,kr,Je,Dl=T({"src/nowiki/comment.ts"(){"use strict";M(),nt(),Ie(),B(),Ue(),Ar=[We(!1),_e("<!--")],Je=class extends(kr=Le){constructor(t,s,n,l){super(t,n,l);Se(this,"closed");this.closed=s}get type(){return"comment"}lint(t=this.getAbsoluteIndex()){if(this.closed)return[];const s="unclosed-comment",n=_.lintConfig.getSeverity(s);if(!n)return[];const l=V(this,{start:t},s,_.msg("unclosed $1","HTML comment"),n);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;":""})}},ai=Z(kr),Je=te(ai,0,"CommentToken",Ar,Je),ee(ai,1,Je)}}),Gl={};Y(Gl,{CommentedToken:()=>Vl});var Vl,Aa=T({"src/commented.ts"(){"use strict";O(),Dl(),Vl=class extends E{get type(){return"ext-inner"}constructor(e,t,s=[]){if(super(void 0,t,s,{AstText:":",CommentToken:":"}),e){let n=e.indexOf("<!--"),l=n!==-1&&e.indexOf("-->",n+4),i=0;for(;l!==!1&&l!==-1;)n>i&&this.insertAt(e.slice(i,n)),this.insertAt(new Je(e.slice(n+4,l),!0,t,s)),i=l+3,n=e.indexOf("<!--",i),l=n!==-1&&e.indexOf("-->",n+4);i<e.length&&this.insertAt(e.slice(i))}}lint(e=this.getAbsoluteIndex()){return super.lint(e,new RegExp(String.raw`<\s*(?:\/\s*)?(${this.name})\b`,"giu"))}}}}),Ql={};Y(Ql,{NowikiToken:()=>Jl});var _r,$r,Jl,ka=T({"src/nowiki/index.ts"(){"use strict";var e,Wi,s;Et(),M(),B(),Ue(),_r=Ke(n=>new RegExp(String.raw`<\s*(?:/\s*)${n==="nowiki"?"":"?"}(${n})\b`,"giu")),$r=new Set(["img","languages","section","templatestyles"]),Jl=(s=class extends Le{constructor(){super(...arguments);N(this,e)}get type(){return"ext-inner"}lint(l=this.getAbsoluteIndex()){const{name:i}=this,r="void-ext",o=_.lintConfig.getSeverity(r,i);if(o&&j(this,e,Wi).call(this)){const a=V(this,{start:l},r,_.msg("nothing should be in <$1>",i),o);return a.fix={desc:"empty",range:[l,a.endIndex],text:""},[a]}return super.lint(l,_r(i))}getAttribute(l){return l==="invalid"?j(this,e,Wi).call(this):super.getAttribute(l)}},e=new WeakSet,Wi=function(){const{name:l,firstChild:{data:i}}=this;return $r.has(l)&&!!i},s)}}),Tr,di,Cr,Xe,Xl=T({"src/tagPair/ext.ts"(){"use strict";M(),ae(),B(),Qi(),O(),Vi(),Ji(),Tr=[us()],Xe=class extends(Cr=Re){get type(){return"ext"}constructor(e,t,s,n,l=_.getConfig(),i=!1,r=[]){const o=e.toLowerCase(),a=new cs(!t||/^\s/u.test(t)?t:` ${t}`,"ext-attrs",o,l,r),h={...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,r);break;case"pre":{const{PreToken:u}=(ca(),G(Al));d=new u(s,h,r);break}case"dynamicpagelist":{const{ParamTagToken:u}=($l(),G(_l));d=new u(i,s,h,r);break}case"inputbox":{const{InputboxToken:u}=(va(),G(Ll));d=new u(i,s,h,r);break}case"references":{const{NestedToken:u}=(Zs(),G(ts));h.excludes.push("heading"),d=new u(s,i,["ref"],h,r);break}case"choose":{const{NestedToken:u}=(Zs(),G(ts));d=new u(s,/<(option|choicetemplate)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(\1)>)/gu,["option","choicetemplate"],h,r);break}case"combobox":{const{NestedToken:u}=(Zs(),G(ts));d=new u(s,/<(combooption)(\s[^>]*?)?(?:\/>|>([\s\S]*?)<\/(combooption\s*)>)/giu,["combooption"],h,r);break}case"gallery":{const{GalleryToken:u}=(wa(),G(Wl));d=new u(s,h,r);break}case"imagemap":{const{ImagemapToken:u}=(Sa(),G(Hl));d=new u(s,h,r);break}case"hiero":{const{CommentedToken:u}=(Aa(),G(Gl));d=new u(s,h,r);break}default:{const{NowikiToken:u}=(ka(),G(Ql));d=new u(s,h,r)}}d.setAttribute("name",o),d.type==="plain"&&(d.type="ext-inner"),super(e,a,d,n,l,r),this.seal("closed",!0)}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),n=new le(this,e);if(this.name!=="nowiki"){const r=this.inHtmlAttrs(),o="parsing-order",a=r&&_.lintConfig.getSeverity(o,r===2?"ext":"templateInTable");a&&s.push(V(this,n,o,"extension tag in HTML tag attributes",a))}const l="var-anchor",i=_.lintConfig.getSeverity(l,"ref");return i&&this.name==="ref"&&this.closest("heading-title")&&s.push(V(this,n,l,"variable anchor in a section header",i)),s}},di=Z(Cr),Xe=te(di,0,"ExtToken",Tr,Xe),ee(di,1,Xe)}}),Kl={};Y(Kl,{parseCommentAndExt:()=>Rt});var hi,Ir,Dt,Nr,ui,Rt,fs=T({"parser/commentAndExt.ts"(){"use strict";Et(),oe(),oa(),Fe(),aa(),da(),Xl(),Dl(),hi="<onlyinclude>",Ir="</onlyinclude>",{length:Dt}=hi,Nr=[!1,!0].map(e=>{const t=e?"includeonly":"(?:no|only)include",s=e?"noinclude":"includeonly";return ol(n=>new RegExp(String.raw`<!--[\s\S]*?(?:-->|$)|<${t}(?:\s[^>]*)?/?>|</${t}\s*>|<(${n.filter(l=>l!=="img").join("|")})(\s[^>]*?)?(?:/>|>([\s\S]*?)</(${"\\1"}\s*)>)|<(${s})(\s[^>]*?)?(?:/>|>([\s\S]*?)(?:</(${s}\s*)>|$))${n.includes("img")?String.raw`|<img(\s[^>]*?)?(/?)>`:""}`,"giu"))}),ui=e=>{const t=e.indexOf(hi);return{i:t,j:e.indexOf(Ir,t+Dt)}},Rt=(e,t,s,n)=>{if(n){let{i:o,j:a}=ui(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}=ui(e)}return e&&d(e),h}}const{ext:l}=t,i=l.filter(o=>o!=="translate"&&o!=="tvar"),r={...t,ext:i};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 ml(h,d&&ke(d,o),r,s),`\0${u}g`}),e=ke(e,o)}return e.replace(Nr[n?1:0](i),(o,a,h,d,u,g,c,p,v,m,x)=>{const b=s.length;let w="n";if(a||i.includes("img")&&x!==void 0)w="e",new Xe(a!=null?a:"img",a?h:m,d,a?u:x&&void 0,r,g,s);else if(o.startsWith("<!--")){w="c";const y=o.endsWith("-->");new Je(o.slice(4,y?-3:void 0),y,t,s)}else g?new vt(g,c,p,v,t,s):new he(o,t,s);return`\0${b}${w}`})}}}),Lr,Fr,jr,Er,ci,Pr,At,_a=T({"src/html.ts"(){"use strict";var e,t,s,n,l;M(),pe(),ae(),Qi(),B(),O(),Lr=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),Fr=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"]),jr=new Set(["strike","big","center","font","tt"]),Er=[us()],At=(l=class extends(Pr=E){constructor(r,o,a,h,d,u){super(void 0,d,u);N(this,e);N(this,t);N(this,s);N(this,n);this.insertAt(o),this.setAttribute("name",r.toLowerCase()),L(this,e,a),L(this,t,h),L(this,s,r)}get type(){return"html"}get selfClosing(){return f(this,t)}get closing(){return f(this,e)}toString(r){return`<${this.closing?"/":""}${f(this,s)}${super.toString(r)}${f(this,t)?"/":""}>`}text(){const{closing:r}=this,o=f(this,s)+(r?"":super.text());return`<${r?"/":""}${o}${f(this,t)?"/":""}>`}getAttribute(r){return r==="invalid"?this.inTableAttrs()===2:r==="padding"?f(this,s).length+(this.closing?2:1):super.getAttribute(r)}lint(r=this.getAbsoluteIndex(),o){const a=super.lint(r,o),{name:h,parentNode:d,closing:u,selfClosing:g}=this,c=new le(this,r),p=this.inTableAttrs();let v="h1",m=_.lintConfig.getSeverity(v,"html");if(m&&h==="h1"&&!u){const k=V(this,c,v,"<h1>",m);k.suggestions=[{desc:"h2",range:[r+2,r+3],text:"2"}],a.push(k)}if(v="parsing-order",m=p&&_.lintConfig.getSeverity(v,p===2?"html":"templateInTable"),m){const k=V(this,c,v,"HTML tag in table attributes",m);p===2&&(k.fix={desc:"remove",range:[r,k.endIndex],text:""}),a.push(k)}v="obsolete-tag",m=_.lintConfig.getSeverity(v,h),m&&jr.has(h)&&a.push(V(this,c,v,"obsolete HTML tag",m)),v="bold-header",m=_.lintConfig.getSeverity(v,h),m&&(h==="b"||h==="strong")&&this.closest("heading-title")&&a.push(V(this,c,v,"bold in section header",m));const{html:[,x,b]}=this.getAttribute("config"),w=b.includes(h),y=x.includes(h),A=!w&&!y;if(v="unmatched-tag",u&&(g||w)||g&&A){if(m=_.lintConfig.getSeverity(v,u?"both":"selfClosing"),m){const k=V(this,c,v,u?"tag that is both closing and self-closing":"invalid self-closing tag",m),S={desc:"open",range:[r+1,r+2],text:""},$={desc:"no self-closing",range:[k.endIndex-2,k.endIndex-1],text:""};y?k.suggestions=[S,$]:u?k.fix=w?S:$:k.suggestions=[$,{desc:"close",range:[k.endIndex-2,k.endIndex],text:`></${h}>`}],a.push(k)}}else if(!this.findMatchingTag()){const k=V(this,c,v,u?"unmatched closing tag":"unclosed tag"),S=this.closest("magic-word");if(S&&Lr.has(S.name))m=_.lintConfig.getSeverity(v,"conditional");else if(u)m=_.lintConfig.getSeverity(v,"closing"),k.suggestions=[{desc:"remove",range:[r,k.endIndex],text:""}];else{m=_.lintConfig.getSeverity(v,"opening");const $=d==null?void 0:d.childNodes;Fr.has(h)&&($!=null&&$.slice(0,$.indexOf(this)).some(({type:C,name:I})=>C==="html"&&I===h)&&(k.suggestions=[{desc:"close",range:[r+1,r+1],text:"/"}]),this.closest("heading-title")&&(k.rule="format-leakage",m=_.lintConfig.getSeverity("format-leakage",h)))}m&&(k.severity=m,a.push(k))}return a}findMatchingTag(){return Oe(f(this,n),()=>{const{name:r,parentNode:o,closing:a,selfClosing:h}=this,{html:[,d,u]}=this.getAttribute("config"),g=u.includes(r),c=d.includes(r);if(g||c&&h)return this;if(!o)return;const{childNodes:p}=o,v=p.indexOf(this),m=a?p.slice(0,v).reverse():p.slice(v+1),x=[this],{rev:b}=ve;for(const w of m)if(!(!w.is("html")||w.name!==r||c&&f(w,t)))if(f(w,e)===a)x.push(w);else{const y=x.pop();if(y===this)return w;_.viewOnly&&(L(y,n,[b,w]),L(w,n,[b,y]))}if(_.viewOnly)for(const w of x)L(w,n,[b,void 0])},r=>{L(this,n,r),r[1]&&r[1]!==this&&L(r[1],n,[ve.rev,this])})}print(){return super.print({pre:`&lt;${this.closing?"/":""}${f(this,s)}`,post:`${f(this,t)?"/":""}&gt;`})}json(r,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,n=new WeakMap,l),ci=Z(Pr),At=te(ci,0,"HtmlToken",Er,At),ee(ci,1,At)}}),Yl={};Y(Yl,{parseHtml:()=>Zl});var Rr,Zl,$a=T({"parser/html.ts"(){"use strict";Ji(),_a(),Rr=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,Zl=(e,t,s)=>{var r;const{html:n}=t;(r=t.htmlElements)!=null||(t.htmlElements=new Set([...n[0],...n[1],...n[2]]));const l=e.split("<");let i=l.shift();for(const o of l){const a=Rr.exec(o),h=a==null?void 0:a[2],d=h==null?void 0:h.toLowerCase();if(!a||!t.htmlElements.has(d)){i+=`<${o}`;continue}const[,u,,g="",c,p]=a,{length:v}=s,m=new cs(g,"html-attrs",d,t,s),x=m.hasAttr("itemprop");if(d==="meta"&&!(x&&m.hasAttr("content"))||d==="link"&&!(x&&m.hasAttr("href"))){i+=`<${o}`,s.length=v;continue}i+=`\0${s.length}x${p}`,new At(h,m,u==="/",c==="/>",t,s)}return i}}}),sn,eo=T({"src/table/base.ts"(){"use strict";Qi(),O(),rt(),Ji(),sn=class extends us(1)(E){constructor(e,t,s,n,l,i=[],r){super(void 0,l,i,r),this.append(new Me(t,"table-syntax",l,i),new cs(n,"table-attrs",s,l,i))}}}}),Or,gi,we,Gt,ct,gt,ns,to=T({"src/table/td.ts"(){"use strict";M(),ae(),Gi(),B(),O(),eo(),ns=class extends(gi=sn,Or=[as(!1)],gi){constructor(e,t,s,n=[]){var o;let l=/\||\0\d+!\x7F/u.exec(t!=null?t:""),i=l?t.slice(0,l.index):"";/\[\[|-\{/u.test(i)&&(l=null,i=""),super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,"td",i,s,n),ee(Gt,5,this),Ae(this,ct),Ae(this,we,""),l&&([Zo(this,we)._]=l);const r=new E(t==null?void 0:t.slice(((o=l==null?void 0:l.index)!=null?o:NaN)+de(this,we).length),s,n);r.type="td-inner",r.setAttribute("stage",4),this.insertAt(r)}get type(){return"td"}get rowspan(){return this.getAttr("rowspan")}get colspan(){return this.getAttr("colspan")}get subtype(){return It(this,ct,gt).call(this).subtype}afterBuild(){de(this,we).includes("\0")&&fe(this,we,this.buildFromStr(de(this,we),0)),super.afterBuild()}toString(e){const{childNodes:[t,s,n]}=this;return t.toString(e)+s.toString(e)+de(this,we)+n.toString(e)}text(){const{childNodes:[e,t,s]}=this;return e.text()+t.text()+de(this,we)+s.text()}getGaps(e){return e===1?de(this,we).length:0}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),n=new le(this,e+this.getRelativeIndex(this.length-1)),l="pipe-like",i=["td","double"].map(r=>_.lintConfig.getSeverity(l,r));for(const r of this.lastChild.childNodes)if(r.type==="text"){const{data:o}=r;if(o.includes("|")){const a=o.includes("||"),h=i[a?1:0];if(h){const d=R(r,n,l,'additional "|" in a table cell',h);if(a){const u={caption:"|+",td:"|",th:"!"}[this.subtype];d.fix={desc:"newline",range:[d.startIndex,d.endIndex],text:o.replace(/\|\|/gu,`
14
+ ${u}`)}}else d.suggestions=[{desc:"escape",range:[d.startIndex,d.endIndex],text:o.replace(/\|/gu,"&#124;")}];s.push(d)}}}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,we)}${s.print()}</span>`}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t),{rowspan:n,colspan:l}=this;return Object.assign(s,{subtype:this.subtype},n!==1&&{rowspan:n},l!==1&&{colspan:l}),s}},Gt=Z(gi),we=new WeakMap,ct=new WeakSet,gt=function(){var e;const t=this.firstChild.text(),s=t.slice(-1);let n="td";if(s==="!"?n="th":s==="+"&&(n="caption"),this.isIndependent())return{subtype:n};const{previousSibling:l}=this;return{...It(e=l,ct,gt).call(e)}},gt=te(Gt,17,"#getSyntax",Or,ct,gt),os(Gt,ns)}}),nn,so=T({"src/table/trBase.ts"(){"use strict";M(),B(),eo(),to(),nn=class extends sn{lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),n=this.childNodes.find(({type:o})=>o==="table-inter");if(!n)return s;const l=Tt(n),i="fostered-content",r=l&&_.lintConfig.getSeverity(i,l===2?void 0:"transclusion");if(r){const o=R(n,{start:e},i,"content to be moved outside the table",r);o.startIndex++,o.startLine++,o.startCol=0,s.push(o)}return s}getRowCount(){return Number(this.childNodes.some(e=>e instanceof ns&&e.isIndependent()&&!e.firstChild.text().endsWith("+")))}}}}),Br,qr,Wr,Mr,pi,Vt,ss,Ta=T({"src/table/index.ts"(){"use strict";M(),pe(),ae(),Gi(),B(),so(),rt(),Br=(e,t)=>new Array(e).fill(void 0).map((s,n)=>t(n)),qr=({type:e})=>e==="tr"||e==="table-syntax",Wr=class extends Array{},ss=class extends(pi=nn,Mr=[as(!1)],pi){constructor(e,t,s,n){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,e,"table",t,s,n,{}),ee(Vt,5,this)}get type(){return"table"}get closed(){return this.lastChild.is("table-syntax")}lint(e=this.getAbsoluteIndex(),t){const s=super.lint(e,t),n=new le(this,e),l=["unclosed-table","table-layout"],i=l.map(r=>_.lintConfig.getSeverity(r));if(i[0]&&!this.closed&&s.push(R(this.firstChild,n,l[0],_.msg("unclosed $1","table"),i[0])),i[1]){const r=this.getLayout(),{length:o}=r;if(o>1){let a=1,h=1/0,d=0;for(;d<o;d++){const u=r[d],g=u.length;if(g<a)break;g<h&&(h=g);const c=u.indexOf(u[g-1])+1;if(c>h)break;c>a&&(a=c)}if(d<o){const u=this.getNthRow(d),g=R(u,n,l[1],"inconsistent table layout",i[1]);g.startIndex++,g.startLine++,g.startCol=0,s.push(g)}}}return s}close(e=`
16
+ |}`,t){const s=this.getAttribute("config"),n=this.getAttribute("accum"),l=[e];ve.run(()=>{const i=new Me(void 0,"table-syntax",s,n);super.insertAt(i)}),this.lastChild.safeReplaceChildren(l)}getLayout(e){const t=this.getAllRows(),{length:s}=t,n=Wr.from(Br(s,()=>[]));for(let l=0;l<n.length;l++){const i=n[l];let r=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:r},{rowspan:u,colspan:g}=h;for(r++;i[o];)o++;for(let c=l;c<Math.min(l+u,s);c++)for(let p=o;p<o+g;p++)n[c][p]=d;o+=g}}else if(qr(h))break}return n}getAllRows(){return[...super.getRowCount()?[this]:[],...this.childNodes.slice(1).filter(e=>e.is("tr")&&e.getRowCount()>0)]}getNthRow(e,t,s){const n=super.getRowCount();if(e===0&&n)return this;n&&e--;for(const l of this.childNodes.slice(2)){const{type:i}=l;if(i==="tr"&&l.getRowCount()&&(e--,e<0))return l}}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t);return s.closed=this.closed,s}},Vt=Z(pi),te(Vt,1,"getLayout",Mr,ss),os(Vt,ss)}}),io,Ca=T({"src/table/tr.ts"(){"use strict";so(),io=class extends nn{get type(){return"tr"}constructor(e,t,s,n){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,e,"tr",t,s,n)}}}}),rn,no=T({"src/nowiki/listBase.ts"(){"use strict";Ue(),rn=class extends Le{get indent(){return this.innerText.split(":").length-1}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t),{indent:n}=this;return n&&(s.indent=n),s}}}}),ln,ro=T({"src/nowiki/dd.ts"(){"use strict";no(),ln=class extends rn{get type(){return"dd"}}}}),lo={};Y(lo,{parseTable:()=>oo});var Ur,fi,oo,Ia=T({"parser/table.ts"(){"use strict";O(),Ta(),Ca(),to(),ro(),Ur=e=>e.lastChild.constructor!==E,fi=(e,t)=>e.is("td")?t.pop():e,oo=({firstChild:{data:e},type:t,name:s},n,l)=>{const i=[],r=e.split(`
17
+ `);let o=t==="root"||t==="parameter-value"||t==="ext-inner"&&s==="poem"?"":`
18
+ ${r.shift()}`,a;const h=(d,u)=>{if(!u){o+=d;return}const{lastChild:g}=u;if(Ur(u)){const c=new E(d,n,l);c.type="table-inter",c.setAttribute("stage",3),u.insertAt(c)}else g.setText(g.toString()+d)};for(const d of r){a=i.pop();const[u]=/^(?:\s|\0\d+[cno]\x7F)*/u.exec(d),g=d.slice(u.length),c=/^(:*)((?:\s|\0\d+[cn]\x7F)*)(\{\||\{(?:\0\d+[cn]\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(g);if(c){for(;a&&!a.is("td");)a=i.pop();const[,w,y,A,k]=c;w&&new ln(w,n,l),h(`
19
+ ${u}${w&&`\0${l.length-1}d`}${y}\0${l.length}b`,a),i.push(...a?[a]:[],new ss(A,k,n,l));continue}else if(!a){o+=`
20
+ ${d}`;continue}const p=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(g);if(!p){h(`
21
+ ${d}`,a),i.push(a);continue}const[,v,m,x,b]=p;if(v){for(;!a.is("table");)a=i.pop();a.close(`
22
+ ${u}${v}`,!0),h(b,i[i.length-1])}else if(m){a=fi(a,i),a.is("tr")&&(a=i.pop());const w=new io(`
23
+ ${u}${m}`,b,n,l);i.push(a,w),a.insertAt(w)}else{a=fi(a,i);const w=x==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu;let y=w.exec(b),A=0,k=`
24
+ ${u}${x}`;const S=$=>{const C=new ns(k,b.slice(A,y==null?void 0:y.index),n,l);return $.insertAt(C),C};for(;y;)S(a),{lastIndex:A}=w,[k]=y,y=w.exec(b);i.push(a,S(a))}}return o.slice(1)}}}),ao,Na=T({"src/nowiki/hr.ts"(){"use strict";Ue(),ao=class extends Le{get type(){return"hr"}}}}),zr,xi,Hr,kt,La=T({"src/nowiki/doubleUnderscore.ts"(){"use strict";nt(),Ie(),Ue(),zr=[We(),_e("__")],kt=class extends(Hr=Le){get type(){return"double-underscore"}constructor(e,t,s,n){var o,a;super(e,s,n);const l=e.toLowerCase(),{doubleUnderscore:[,,i,r]}=s;this.setAttribute("name",(a=t?(o=r==null?void 0:r[e])==null?void 0:o.toLowerCase():i==null?void 0:i[l])!=null?a:l)}toString(){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}},xi=Z(Hr),kt=te(xi,0,"DoubleUnderscoreToken",zr,kt),ee(xi,1,kt)}}),ho={};Y(ho,{parseHrAndDoubleUnderscore:()=>uo});var uo,Fa=T({"parser/hrAndDoubleUnderscore.ts"(){"use strict";Na(),La(),Tl(),uo=({firstChild:{data:e},type:t,name:s},n,l)=>{var a,h,d;const{doubleUnderscore:[i,r,o]}=n;return(a=n.insensitiveDoubleUnderscore)!=null||(n.insensitiveDoubleUnderscore=new Set(i)),(h=n.sensitiveDoubleUnderscore)!=null||(n.sensitiveDoubleUnderscore=new Set(r)),(d=n.regexHrAndDoubleUnderscore)!=null||(n.regexHrAndDoubleUnderscore=new RegExp(`__(${[...i,...r].join("|")})__`,"giu")),t!=="root"&&(t!=="ext-inner"||s!=="poem")&&(e=`\0${e}`),e=e.replace(/^((?:\0\d+[cno]\x7F)*)(-{4,})/gmu,(u,g,c)=>(new ao(c,n,l),`${g}\0${l.length-1}r`)).replace(n.regexHrAndDoubleUnderscore,(u,g)=>{var m;const c=n.sensitiveDoubleUnderscore.has(g),p=g.toLowerCase(),v=n.insensitiveDoubleUnderscore.has(p);return c||v?(new kt(g,c,n,l),`\0${l.length-1}${v&&((m=o==null?void 0:o[p])!=null?m:p)==="toc"?"u":"n"}`):u}).replace(/^((?:\0\d+[cn]\x7F)*)(={1,6})(.+)\2((?:\s|\0\d+[cn]\x7F)*)$/gmu,(u,g,c,p,v)=>{const m=`${g}\0${l.length}h`;return new Ki(c.length,[p,v],n,l),m}),t==="root"||t==="ext-inner"&&s==="poem"?e:e.slice(1)}}}),co,ja=T({"src/nowiki/quote.ts"(){"use strict";var e,t;M(),ae(),B(),Ue(),co=(t=class extends Le{constructor(n,l,i,r){super(n,i,r);N(this,e);L(this,e,l)}get type(){return"quote"}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}get closing(){return{...this.bold?{bold:f(this,e).bold}:void 0,...this.italic?{italic:f(this,e).italic}:void 0}}text(){const{parentNode:n,innerText:l}=this;return n!=null&&n.is("image-parameter")&&n.name!=="caption"?"":l}lint(n=this.getAbsoluteIndex()){const{previousSibling:l,bold:i,closing:r}=this,o=(l==null?void 0:l.type)==="text"?l.data:void 0,a=[],h=new le(this,n),d=["lonely-apos","bold-header"],u=[void 0,"word"].map(c=>_.lintConfig.getSeverity(d[0],c)),g=_.lintConfig.getSeverity(d[1]);if(o!=null&&o.endsWith("'")){const c=u[(r.bold||r.italic)&&/[a-z\d]'$/iu.test(o)?1:0];if(c){const p=V(this,h,d[0],_.msg('lonely "$1"',"'"),c),{startIndex:v,startLine:m,startCol:x}=p,[,{length:b}]=/(?:^|[^'])('+)$/u.exec(o),w=n-b;a.push({...p,startIndex:w,endIndex:v,endLine:m,startCol:x-b,endCol:x,suggestions:[{desc:"escape",range:[w,v],text:"&apos;".repeat(b)},{desc:"remove",range:[w,v],text:""}]})}}if(g&&i&&this.closest("heading-title")){const c=V(this,h,d[1],"bold in section header",g);c.suggestions=[{desc:"remove",range:[n,n+3],text:""}],a.push(c)}return a}json(n,l=this.getAbsoluteIndex()){const i=super.json(void 0,l);return Object.assign(i,{bold:this.bold,italic:this.italic}),i}},e=new WeakMap,t)}}),go={};Y(go,{parseQuotes:()=>on});var on,po=T({"parser/quotes.ts"(){"use strict";ja(),on=(e,t,s,n)=>{var c;const l=e.split(/('{2,})/u),{length:i}=l;if(i===1)return e;let r=0,o=0,a,h,d;for(let p=1;p<i;p+=2){const v=l[p].length;switch(v){case 2:o++;break;case 4:l[p-1]+="'",l[p]="'''";case 3:if(r++,a!==void 0)break;l[p-1].endsWith(" ")?h===void 0&&d===void 0&&(d=p):l[p-1].slice(-2,-1)===" "?a=p:h!=null||(h=p);break;default:l[p-1]+="'".repeat(v-5),l[p]="'''''",o++,r++}}if(o%2===1&&r%2===1){const p=(c=a!=null?a:h)!=null?c:d;p!==void 0&&(l[p]="''",l[p-1]+="'")}let u=!0,g=!0;for(let p=1;p<i;p+=2){const v=l[p].length,m=v!==2,x=v!==3;m&&(u=!u),x&&(g=!g),new co(l[p],{bold:m&&u,italic:x&&g},t,s),l[p]=`\0${s.length-1}q`}return l.join("")}}}),fo={};Y(fo,{parseExternalLinks:()=>an});var an,xo=T({"parser/externalLinks.ts"(){"use strict";oe(),zl(),tn(),an=(e,t,s,n)=>{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${Ce}]|\0\d))([${Ce}]*(?![${Ce}]))([^\]\x01-\x08\x0A-\x1F\uFFFD]*)\]`,"giu")),e.replace(t.regexExternalLinks,(i,r,o,a)=>{const{length:h}=s,d=/&[lg]t;/u.exec(r);return d&&(o="",a=r.slice(d.index)+o+a,r=r.slice(0,d.index)),n?(new jt(r,"ext-link-url",t,s),`[\0${h}f${o}${a}]`):(new Qe(r,o,a,t,s),`\0${h}w`)})}}}),mo,Ea=T({"src/link/category.ts"(){"use strict";oe(),ds(),mo=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:n}=this;return n&&(s.sortkey=n),s}}}}),vo={};Y(vo,{parseLinks:()=>Mi});var Dr,Mi,Pa=T({"parser/links.ts"(){"use strict";B(),po(),xo(),Ul(),Bl(),Ea(),Dr=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)([\s\S]*)$/u,Mi=(e,t,s,n)=>{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,i=e.split("[[");let r=i.shift();for(let a=0;a<i.length;a++){let h=!1,d,u,g,c;const p=i[a],v=l.exec(p);if(v)[,d,u,g,c]=v,c.startsWith("]")&&(g!=null&&g.includes("["))&&(g+="]",c=c.slice(1));else{const y=Dr.exec(p);y&&(h=!0,[,d,u,g]=y)}if(d===void 0||t.regexLinks.test(d)||/\0\d+[exhbru]\x7F/u.test(d)){r+=`[[${p}`;continue}const m=d.trim().startsWith(":");if(m&&h){r+=`[[${p}`;continue}const{ns:x,valid:b}=_.normalizeTitle(d,0,!1,t,{halfParsed:!0,temporary:!0,decode:!0,selfLink:!0});if(b){if(h){if(x!==6){r+=`[[${p}`;continue}let y=!1;for(a++;a<i.length;a++){const A=i[a],k=A.split("]]");if(k.length>2){y=!0,g+=`[[${k[0]}]]${k[1]}`,c=k.slice(2).join("]]");break}else if(k.length===2)g+=`[[${k[0]}]]${k[1]}`;else{g+=`[[${A}`;break}}if(g=Mi(g,t,s,n),!y){r+=`[[${d}${u}${g}`;continue}}}else{r+=`[[${p}`;continue}g&&(g=on(g,t,s,n));let w=en;m||(x===6?(g&&(g=an(g,t,s,!0)),w=Zi):x===14&&(w=mo)),g===void 0&&u&&(g=""),r+=`\0${s.length}l${c}`,new w(d,g,t,s,u)}return r}}}),bo={};Y(bo,{parseMagicLinks:()=>wo});var mi,vi,bi,wi,wo,Ra=T({"parser/magicLinks.ts"(){"use strict";oe(),tn(),mi=String.raw`[${Ce}\t]|&nbsp;|&#0*160;|&#x0*a0;`,vi=`(?:${mi})+`,bi=`(?:${mi}|-)`,wi=String.raw`(?:RFC|PMID)${vi}\d+\b|ISBN${vi}(?:97[89]${bi}?)?(?:\d${bi}?){9}[\dx]\b`,wo=(e,t,s)=>{if(!t.regexMagicLinks)try{t.regexMagicLinks=new RegExp(String.raw`(^|[^\p{L}\p{N}_])(?:(?:${t.protocol})(${Ye}${Ze})|${wi})`,"giu")}catch{t.regexMagicLinks=new RegExp(String.raw`(^|\W)(?:(?:${t.protocol})(${Ye}${Ze})|${wi})`,"giu")}return e.replace(t.regexMagicLinks,(n,l,i)=>{let r=l?n.slice(l.length):n;if(i){let o="";const a=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(r);a&&(o=r.slice(a.index),r=r.slice(0,a.index));const h=r.includes("(")?/[^,;\\.:!?][,;\\.:!?]+$/u:/[^,;\\.:!?)][,;\\.:!?)]+$/u,d=h.exec(r);if(d){let u=1;d[0][1]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(r.slice(0,d.index))&&(u=2),o=r.slice(d.index+u)+o,r=r.slice(0,d.index+u)}return o.length>=i.length?n:(new jt(r,void 0,t,s),`${l}\0${s.length-1}w${o}`)}else if(!/^(?:RFC|PMID|ISBN)/u.test(r))return n;return new jt(r,"magic-link",t,s),`${l}\0${s.length-1}i`})}}}),yo,Oa=T({"util/html.ts"(){"use strict";yo=(e,t)=>e.startsWith(t)?t.length:[...t].findIndex((s,n)=>s!==e[n])}}),So,Ba=T({"src/nowiki/list.ts"(){"use strict";no(),So=class extends rn{get type(){return"list"}}}}),Ao={};Y(Ao,{parseList:()=>ko});var ko,qa=T({"parser/list.ts"(){"use strict";Oa(),Ba(),ro(),ko=(e,t,s,n)=>{const l=/^((?:\0\d+[cno]\x7F)*)([;:*#]+)(\s*)/u.exec(e);if(!l)return t.lastPrefix="",e;const[i,r,o,a]=l,h=o.replace(/;/gu,":"),d=yo(h,t.lastPrefix),u=((d>1?o.slice(d-1):o)+a).split(/(?=;)/u),g=u[0].startsWith(";");let c=u.length-(g?0:1);if(d>1){const I=o.slice(0,d-1);if(g){const U=I.split(/(?=;)/u);u.unshift(...U),c+=I.includes(";")?U.length:0}else u[0]=I+u[0]}t.lastPrefix=h;let p=r+u.map((I,U)=>`\0${n.length+U}d`).join("")+e.slice(i.length);for(const I of u)new So(I,s,n);if(!c)return p;const{html:[v,,m]}=s,x=/:+|-\{|\0\d+[xq]\x7F/gu;let b=x,w=b.exec(p),y=0,A=!1,k=!1,S=0;const $=(I,U)=>(new ln(I,s,n),`${p.slice(0,U)}\0${n.length-1}d${p.slice(U+I.length)}`),C=I=>{I?y&&y--:y++};for(;w&&c;){const{0:I,index:U}=w;if(I==="-{"){if(!S){const{lastIndex:F}=b;b=/-\{|\}-/gu,b.lastIndex=F}S++}else if(I==="}-"){if(S--,!S){const{lastIndex:F}=b;b=x,b.lastIndex=F}}else if(I.endsWith("x")){const{name:F,closing:P,selfClosing:X}=n[Number(I.slice(1,-2))];(v.includes(F)||!X&&!m.includes(F))&&C(P)}else if(I.endsWith("q")){const{bold:F,italic:P}=n[Number(I.slice(1,-2))];F&&(C(A),A=!A),P&&(C(k),k=!k)}else if(y===0){if(I.length>=c)return $(I.slice(0,c),U);c-=I.length,b.lastIndex=U+4+String(n.length).length,p=$(I,U)}w=b.exec(p)}return p}}}),Qt,Gr,yi,Vr,_t,Wa=T({"src/converterFlags.ts"(){"use strict";var e,t;M(),ae(),hs(),B(),O(),Ne(),Qt=new Set(["A","T","R","D","-","H","N"]),Gr=[Pt()],_t=(t=class extends(Vr=E){constructor(n,l,i=[]){super(void 0,l,i,{});N(this,e);this.safeAppend(n.map(r=>new ge(r,"converter-flag",l,i)))}get type(){return"converter-flags"}afterBuild(){L(this,e,this.childNodes.map(n=>n.text().trim())),super.afterBuild()}toString(n){return super.toString(n,";")}text(){return super.text(";")}getUnknownFlags(){return new Set(f(this,e).filter(n=>/\{{3}[^{}]+\}{3}/u.test(n)))}getVariantFlags(){const n=new Set(this.getAttribute("config").variants);return new Set(f(this,e).filter(l=>n.has(l)))}isInvalidFlag(n,l,i,r){return typeof n=="object"&&(n=n.text().trim(),l=this.getVariantFlags(),i=this.getUnknownFlags(),r=new Set(f(this,e).filter(o=>Qt.has(o)))),!!n&&!l.has(n)&&!i.has(n)&&(l.size>0||!r.has(n))}lint(n=this.getAbsoluteIndex(),l){const i=this.getVariantFlags(),r=this.getUnknownFlags(),o=new Set(f(this,e).filter(c=>Qt.has(c))),a=f(this,e).filter(c=>!c).length,h=f(this,e).length-r.size-a,d=super.lint(n,l);if(i.size===h||o.size===h)return d;const u="no-ignored",g=_.lintConfig.getSeverity(u,"conversionFlag");if(g){const c=new le(this,n);for(let p=0;p<this.length;p++){const v=this.childNodes[p],m=v.text().trim();if(this.isInvalidFlag(m,i,r,o)){const x=R(v,c,u,"invalid conversion flag",g);i.size===0&&Qt.has(m.toUpperCase())?x.fix={desc:"uppercase",range:[x.startIndex,x.endIndex],text:m.toUpperCase()}:x.suggestions=[{desc:"remove",range:[x.startIndex-(p&&1),x.endIndex],text:""}],d.push(x)}}}return d}print(){return super.print({sep:";"})}},e=new WeakMap,t),yi=Z(Vr),_t=te(yi,0,"ConverterFlagsToken",Gr,_t),ee(yi,1,_t)}}),is,Ma=T({"src/converterRule.ts"(){"use strict";B(),O(),Ne(),is=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().toLowerCase())!=null?t:""}constructor(e,t=!0,s=_.getConfig(),n=[]){super(void 0,s,n);const l=e.indexOf(":"),i=e.slice(0,l).indexOf("=>"),r=i===-1?e.slice(0,l):e.slice(i+2,l);t&&s.variants.includes(r.trim().toLowerCase())?(super.insertAt(new ge(r,"converter-rule-variant",s,n)),super.insertAt(new ge(e.slice(l+1),"converter-rule-to",s,n)),i!==-1&&super.insertAt(new ge(e.slice(0,i),"converter-rule-from",s,n),0)):super.insertAt(new ge(e,"converter-rule-to",s,n))}toString(e){const{childNodes:t,firstChild:s,lastChild:n}=this;return t.length===3?`${s.toString(e)}=>${t[1].toString(e)}:${n.toString(e)}`:super.toString(e,":")}text(){const{childNodes:e,firstChild:t,lastChild:s}=this;return e.length===3?`${t.text()}=>${e[1].text()}:${s.text()}`:super.text(":")}getGaps(e){return e===0&&this.length===3?2:1}print(){const{childNodes:e}=this;if(e.length===3){const[t,s,n]=e;return`<span class="wpb-converter-rule">${t.print()}=>${s.print()}:${n.print()}</span>`}return super.print({sep:":"})}json(e,t=this.getAbsoluteIndex()){const s=super.json(void 0,t);return s.variant=this.variant,s}}}}),Qr,Si,Jr,$t,Ua=T({"src/converter.ts"(){"use strict";oe(),Ie(),O(),Wa(),Ma(),Qr=[_e("-{")],$t=class extends(Jr=E){get type(){return"converter"}constructor(e,t,s,n=[]){super(void 0,s,n),this.insertAt(new _t(e,s,n));const[l]=t,i=l.includes(":"),r=new is(l,i,s,n);i&&r.length===1||!i&&t.length===2&&!me(t[1]).trim()?this.insertAt(new is(t.join(";"),!1,s,n)):this.append(r,...t.slice(1).map(o=>new is(o,!0,s,n)))}toString(e){const{childNodes:[t,...s]}=this;return`-{${t.toString(e)}${t.length>0?"|":""}${s.map(n=>n.toString(e)).join(";")}}-`}text(){const{childNodes:[e,...t]}=this;return`-{${e.text()}|${Be(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>`}},Si=Z(Jr),$t=te(Si,0,"ConverterToken",Qr,$t),ee(Si,1,$t)}}),_o={};Y(_o,{parseConverter:()=>$o});var $o,za=T({"parser/converter.ts"(){"use strict";Ua(),$o=(e,t,s)=>{var a;(a=t.regexConverter)!=null||(t.regexConverter=new RegExp(String.raw`;(?=(?:[^;]*?=>)?\s*(?:${t.variants.join("|")})\s*:|(?:\s|\0\d+[cn]\x7F)*$)`,"iu"));const n=/-\{/gu,l=/-\{|\}-/gu,i=[];let r=n,o=r.exec(e);for(;o;){const{0:h,index:d}=o;if(h==="}-"){const u=i.pop(),{length:g}=s,c=e.slice(u.index+2,d),p=c.indexOf("|"),[v,m]=p===-1?[[],c]:[c.slice(0,p).split(";"),c.slice(p+1)],x=m.replace(/(&[#a-z\d]+);/giu,"$1"),b=x.split(t.regexConverter).map(w=>w.replace(/\x01/gu,";"));new $t(v,b,t,s),e=`${e.slice(0,u.index)}\0${g}v${e.slice(d+2)}`,i.length===0&&(r=n),r.lastIndex=u.index+3+String(g).length}else i.push(o),r=l,r.lastIndex=d+2;o=r.exec(e)}return e}}}),rs={};Y(rs,{Token:()=>E});var Xr,E,O=T({"src/index.ts"(){"use strict";var e,t,s,n,l,i,r,o,To,Co,Io,No,Lo,Fo,jo,Eo,Po,Ro,Oo,Bo,y;oe(),qe(),M(),pe(),B(),sa(),ia(),Xr=["category","html-attr#id,ext-attr#id,table-attr#id"],E=(y=class extends cl{constructor(S,$=_.getConfig(),C=[],I){super();N(this,o);N(this,e,"plain");N(this,t,0);N(this,s);N(this,n);N(this,l);N(this,i,!1);N(this,r);typeof S=="string"&&this.insertAt(S),L(this,s,$),L(this,n,C),C.push(this)}get type(){return f(this,e)}set type(S){L(this,e,S)}parseOnce(S=f(this,t),$=!1,C){if(S<f(this,t)||this.length===0||!this.isPlain())return this;if(f(this,t)>=xe)return this;switch(S){case 0:if(this.type==="root"){f(this,n).pop();const I=j(this,o,To).call(this);$&&($=!I)}L(this,l,$),j(this,o,Co).call(this,$);break;case 1:j(this,o,Io).call(this);break;case 2:j(this,o,No).call(this);break;case 3:j(this,o,Lo).call(this);break;case 4:j(this,o,Fo).call(this);break;case 5:j(this,o,jo).call(this,C);break;case 6:j(this,o,Eo).call(this,C);break;case 7:j(this,o,Po).call(this);break;case 8:j(this,o,Ro).call(this);break;case 9:j(this,o,Oo).call(this);break;case 10:j(this,o,Bo).call(this)}if(this.type==="root")for(const I of f(this,n))I==null||I.parseOnce(S,$,C);return fn(this,t)._++,this}buildFromStr(S,$){const C=S.split(/[\0\x7F]/u).map((I,U)=>{if(U%2===0)return new ji(I);if(isNaN(I.slice(-1)))return f(this,n)[Number(I.slice(0,-1))];throw new Error(`Failed to build! Unrecognized token: ${I}`)});return $===0?C.map(String).join(""):$===1?Be(C):C}build(){L(this,t,xe);const{length:S,firstChild:$}=this,C=$==null?void 0:$.toString();if(S===1&&$.type==="text"&&C.includes("\0")&&(ls(this,0,1,this.buildFromStr(C)),this.normalize(),this.type==="root"))for(const I of f(this,n))I==null||I.build()}afterBuild(){if(this.type==="root")for(const S of f(this,n))S==null||S.afterBuild();L(this,i,!0)}parse(S=xe,$,C){for(S=Math.min(S,xe);f(this,t)<S;)this.parseOnce(f(this,t),$,C);return S&&(this.build(),this.afterBuild()),this}isPlain(){return this.constructor===y}getAttribute(S){var $;switch(S){case"config":return f(this,s);case"include":return($=f(this,l))!=null?$:!!f(this.getRootNode(),l);case"accum":return f(this,n);case"built":return f(this,i);case"stage":return f(this,t);case"invalid":return this.type==="table-inter"&&Tt(this)===2;default:return super.getAttribute(S)}}setAttribute(S,$){switch(S){case"stage":f(this,t)===0&&this.type==="root"&&f(this,n).shift(),L(this,t,$);break;default:super.setAttribute(S,$)}}insertAt(S,$=this.length){const C=typeof S=="string"?new ji(S):S;super.insertAt(C,$);const{type:I}=C;return I==="root"&&(C.type="plain"),C}normalizeTitle(S,$=0,C){return _.normalizeTitle(S,$,f(this,l),f(this,s),C)}inTableAttrs(){var S,$;return((S=this.closest("table-attrs,ext"))==null?void 0:S.type)==="table-attrs"&&(($=this.closest("table-attrs,arg,magic-word,template"))!=null&&$.is("table-attrs")?2:1)}inHtmlAttrs(){var S;return(S=this.closest("html-attrs,ext"))!=null&&S.is("html-attrs")?2:this.inTableAttrs()}lint(S=this.getAbsoluteIndex(),$){var I;let C=super.lint(S,$);if(this.type==="root"){const U=new Map,F="no-duplicate",P=["category","id"].map(q=>_.lintConfig.getSeverity(F,q)),X=Xr.filter((q,D)=>P[D]).join();if(X){for(const q of this.querySelectorAll(X)){let D;if(q.is("category"))D=q.name;else{const H=q.getValue();H&&H!==!0&&(D=`#${H}`)}if(D){const H=U.get(D);H?H.add(q):U.set(D,new Set([q]))}}for(const[q,D]of U)if(D.size>1&&!q.startsWith("#mw-customcollapsible-")){const H=!q.startsWith("#"),J=`duplicated ${H?"category":"id"}`,ne=P[H?0:1];C.push(...[...D].map(K=>{const re=V(K,{start:K.getAbsoluteIndex()},F,J,ne);return H&&(re.suggestions=[{desc:"remove",range:[re.startIndex,re.endIndex],text:""}]),re}))}}const W=/<!--\s*lint-(disable(?:(?:-next)?-line)?|enable)(\s[\sa-z,-]*)?-->/gu,Q=this.toString(),z=[];let ie=W.exec(Q);for(;ie;){const{1:q,index:D}=ie,H=(I=ie[2])==null?void 0:I.trim();z.push({line:this.posFromIndex(D).top+(q==="disable-line"?0:1),from:q==="disable"?W.lastIndex:void 0,to:q==="enable"?W.lastIndex:void 0,rules:H?new Set(H.split(",").map(J=>J.trim())):void 0}),ie=W.exec(Q)}if(C=C.filter(({rule:q,startLine:D,startIndex:H})=>{const J={pos:0};for(const{line:ne,from:K,to:re,rules:ue}of z){if(ne>D+1)break;if(ue&&!ue.has(q))continue;if(ne===D&&K===void 0&&re===void 0)return!1;K<=H&&K>J.pos?(J.pos=K,J.type="from"):re<=H&&re>J.pos&&(J.pos=re,J.type="to")}return J.type!=="from"}),C.some(({fix:q})=>q)){const q=C.map(({fix:J})=>J).filter(Boolean).sort(({range:[J,ne]},{range:[K,re]})=>ne===re?K-J:re-ne);let D=1/0,H=Q;for(const{range:[J,ne],text:K}of q)ne<=D&&(H=H.slice(0,J)+K+H.slice(ne),D=J);Object.assign(C,{output:H})}}return C}toString(S,$){return S?super.toString(!0,$):Oe(f(this,r),()=>super.toString(!1,$),C=>{const I=this.getRootNode();I.type==="root"&&f(I,i)&&L(this,r,C)})}},e=new WeakMap,t=new WeakMap,s=new WeakMap,n=new WeakMap,l=new WeakMap,i=new WeakMap,r=new WeakMap,o=new WeakSet,To=function(){const{parseRedirect:S}=(la(),G(fl)),$=this.firstChild.toString(),C=S($,f(this,s),f(this,n));return C&&this.setText(C),!!C},Co=function(S){const{parseCommentAndExt:$}=(fs(),G(Kl));this.setText($(this.firstChild.toString(),f(this,s),f(this,n),S))},Io=function(){const{parseBraces:S}=(Yi(),G(Nl)),$=this.type==="root"?this.firstChild.toString():`\0${this.firstChild.toString()}`,C=S($,f(this,s),f(this,n));this.setText(this.type==="root"?C:C.slice(1))},No=function(){if(f(this,s).excludes.includes("html"))return;const{parseHtml:S}=($a(),G(Yl));this.setText(S(this.firstChild.toString(),f(this,s),f(this,n)))},Lo=function(){if(f(this,s).excludes.includes("table"))return;const{parseTable:S}=(Ia(),G(lo));this.setText(S(this,f(this,s),f(this,n)))},Fo=function(){if(f(this,s).excludes.includes("hr"))return;const{parseHrAndDoubleUnderscore:S}=(Fa(),G(ho));this.setText(S(this,f(this,s),f(this,n)))},jo=function(S){const{parseLinks:$}=(Pa(),G(vo));this.setText($(this.firstChild.toString(),f(this,s),f(this,n),S))},Eo=function(S){if(f(this,s).excludes.includes("quote"))return;const{parseQuotes:$}=(po(),G(go)),C=this.firstChild.toString().split(`
25
+ `);for(let I=0;I<C.length;I++)C[I]=$(C[I],f(this,s),f(this,n),S);this.setText(C.join(`
26
+ `))},Po=function(){if(f(this,s).excludes.includes("extLink"))return;const{parseExternalLinks:S}=(xo(),G(fo));this.setText(S(this.firstChild.toString(),f(this,s),f(this,n)))},Ro=function(){if(f(this,s).excludes.includes("magicLink"))return;const{parseMagicLinks:S}=(Ra(),G(bo));this.setText(S(this.firstChild.toString(),f(this,s),f(this,n)))},Oo=function(){if(f(this,s).excludes.includes("list"))return;const{parseList:S}=(qa(),G(Ao)),{firstChild:$,type:C,name:I}=this,U=$.toString().split(`
27
+ `),F={lastPrefix:""};let P=C==="root"||C==="ext-inner"&&I==="poem"?0:1;for(;P<U.length;P++)U[P]=S(U[P],F,f(this,s),f(this,n));this.setText(U.join(`
28
+ `))},Bo=function(){if(f(this,s).variants.length>0){const{parseConverter:S}=(za(),G(_o));this.setText(S(this.firstChild.toString(),f(this,s),f(this,n)))}},y)}}),ve,xs,ls,lt,pe=T({"util/debug.ts"(){"use strict";ve={running:!1,run(e){const{running:t}=this;this.running=!0;try{const{Token:s}=(O(),G(rs)),n=e();return n instanceof s&&!n.getAttribute("built")&&n.afterBuild(),this.running=t,n}catch(s){throw this.running=t,s}},rev:0},xs=e=>t=>t.type===e,ls=(e,t,s,n=[])=>{var r,o;let l=e.getChildNodes(),i;l.length===s?(i=l,l=n):i=l.splice(t,s,...n);for(let a=0;a<n.length;a++){const h=n[a];h.setAttribute("parentNode",e),h.setAttribute("nextSibling",l[t+a+1]),h.setAttribute("previousSibling",l[t+a-1])}return(r=l[t-1])==null||r.setAttribute("nextSibling",l[t]),(o=l[t+n.length])==null||o.setAttribute("previousSibling",l[t+n.length-1]),l===n&&e.setAttribute("childNodes",l),i},lt=(e,t)=>{Object.defineProperty(e,"name",{value:t.name})}}}),Kr,pt,Ai,ki,Yr,_i,Zr,Ui,Ha=T({"lib/lintConfig.ts"(){"use strict";ll(),Kr=new Set([0,1,2]),pt=new Map([[0,!1],[1,"warning"],[2,"error"]]),Ai={"bold-header":[1,{}],"format-leakage":[1,{}],"fostered-content":[1,{}],h1:[1,{}],"illegal-attr":[2,{}],"insecure-style":2,"invalid-gallery":[2,{parameter:1}],"invalid-imagemap":[2,{}],"invalid-invoke":[2,{}],"invalid-isbn":2,"lonely-apos":[1,{}],"lonely-bracket":[1,{extLink:2}],"lonely-http":[1,{}],"nested-link":[2,{}],"no-arg":1,"no-duplicate":[2,{category:1,id:1,unknownImageParameter:1}],"no-ignored":[2,{fragment:1,galleryComment:1,galleryNoImage:1,include:1,nonWordAttributes:1,redirect:1}],"obsolete-attr":1,"obsolete-tag":1,"parsing-order":[2,{templateInTable:1}],"pipe-like":[1,{double:2}],"table-layout":1,"tag-like":[2,{disallowed:1,invalid:1}],"unbalanced-header":2,"unclosed-comment":[1,{}],"unclosed-quote":1,"unclosed-table":2,unescaped:2,"unknown-page":1,"unmatched-tag":[1,{}],"unterminated-url":[1,{}],"url-encoding":[1,{}],"var-anchor":[1,{}],"void-ext":[2,{}]},Object.freeze(Ai),ki=e=>typeof e=="number"&&Kr.has(e),Yr=e=>ki(e)||Array.isArray(e)&&e.length===2&&ki(e[0])&&e[1]&&typeof e[1]=="object",_i=(e,t,s)=>{if(Di.includes(t)){if(Yr(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)}`)},Zr=class{constructor(e){if(Object.assign(this,JSON.parse(JSON.stringify(Ai))),!!e)for(const[t,s]of Object.entries(e))_i(this,t,s)}getSeverity(e,t){var n;if(!(e in this))throw new RangeError(`Unknown rule: ${e}`);const s=this[e];return typeof s=="number"?pt.get(s):t&&(n=pt.get(s[1][t]))!=null?n:pt.get(s[0])}},Ui=e=>new Proxy(new Zr(e),{set:_i})}}),qo={};Y(qo,{Title:()=>Wo});var Wo,Da=T({"lib/title.ts"(){"use strict";var e,t,s,n,l,i;oe(),Wo=(i=class{constructor(r,o,a,{temporary:h,decode:d,selfLink:u}={}){N(this,e);N(this,t);N(this,s);N(this,n);N(this,l);Se(this,"valid");Se(this,"encoded",!1);const g=r.trim().startsWith("../");if(d&&r.includes("%"))try{const p=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(r);r=Nt(r),this.encoded=p}catch{}if(r=Lt(r).replace(/[_ ]+/gu," ").trim(),g)L(this,n,0);else{let p=o;r.startsWith(":")&&(p=0,r=r.slice(1).trim());const v=r.split(":");if(v.length>1){const m=et(v[0]),x=Object.prototype.hasOwnProperty.call(a.nsid,m)&&a.nsid[m];x&&(p=x,r=v.slice(1).join(":").trim())}L(this,n,p)}const c=r.indexOf("#");if(c!==-1){let p=r.slice(c).trim().slice(1);if(p.includes("%"))try{p=Nt(p)}catch{}L(this,l,p.replace(/ /gu,"_")),r=r.slice(0,c).trim()}this.valid=!!(r||u&&this.ns===0&&f(this,l)!==void 0)&&Lt(r)===r&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|\n]|%[\da-f]{2}|(?:^|\/)\.{1,2}(?:$|\/)/iu.test(g?/^(?:\.\.\/)+(.*)/u.exec(r)[1]:r),this.main=r,L(this,t,a.namespaces),L(this,s,a.articlePath||"/wiki/$1"),f(this,s).includes("$1")||L(this,s,f(this,s)+`${f(this,s).endsWith("/")?"":"/"}$1`),h||Object.defineProperties(this,{encoded:{enumerable:!1,writable:!1}})}get ns(){return f(this,n)}get fragment(){return f(this,l)}get main(){return f(this,e)}set main(r){r=r.replace(/_/gu," ").trim(),L(this,e,r&&r[0].toUpperCase()+r.slice(1))}get prefix(){const r=f(this,t)[this.ns];return r+(r&&":")}get title(){return this.getRedirection()[1]}get extension(){const{main:r}=this,o=r.lastIndexOf(".");return o===-1?void 0:r.slice(o+1).toLowerCase()}getRedirection(){return[!1,(this.prefix+this.main).replace(/ /gu,"_")]}setFragment(r){L(this,l,r)}getUrl(r){throw new Error("Title.getUrl method is only available in the LSP version!")}},e=new WeakMap,t=new WeakMap,s=new WeakMap,n=new WeakMap,l=new WeakMap,i)}}),Mo={};Y(Mo,{default:()=>_});Uo.exports=G(Mo);var Jt,$i,$e,Ti,el,_,B=T({"index.ts"(){ll(),pe(),qe(),oe(),Ha(),Jt=!0,$i=Ui(),$e={config:Ci,i18n:void 0,rules:Di,get lintConfig(){return $i},set lintConfig(e){$i=Ui(e)},get viewOnly(){return Jt},set viewOnly(e){Jt&&!e&&ve.rev++,Jt=e},getConfig(e){const t=e!=null?e:this.config,{doubleUnderscore:s,ext:n,parserFunction:l,variable:i}=t;for(let r=0;r<2;r++)s.length>r+2&&s[r].length===0&&(s[r]=Object.keys(s[r+2]));return n.includes("translate")&&!i.includes("translationlanguage")&&(i.push("translationlanguage"),Array.isArray(l[1])?l[1].push("TRANSLATIONLANGUAGE"):l[1].TRANSLATIONLANGUAGE="translationlanguage"),{...Ci,...t,excludes:[]}},msg(e,t=""){var s,n;return e&&((n=(s=this.i18n)==null?void 0:s[e])!=null?n:e).replace("$1",this.msg(t))},normalizeTitle(e,t=0,s,n=$e.getConfig(),l){const{Title:i}=(Da(),G(qo));let r;if(l!=null&&l.halfParsed)r=new i(e,t,n,l);else{const{Token:o}=(O(),G(rs));r=ve.run(()=>{const a=new o(e,n);a.type="root",a.parseOnce(0,s).parseOnce();const h=new i(a.toString(),t,n,l);a.build();for(const d of["main","fragment"]){const u=h[d];if(u!=null&&u.includes("\0")){const g=a.buildFromStr(u,1);d==="main"?h.main=g:h.setFragment(g)}}return h})}return r},parse(e,t,s=xe,n=$e.getConfig()){e=al(e);let l;typeof s!="number"&&(l=Array.isArray(s)?s:[s],s=Math.max(...l.map(o=>rl[o]||xe)));const{Token:i}=(O(),G(rs));return ve.run(()=>{const o=new i(e,n);return o.type="root",o.parse(s,t)})},async partialParse(e,t,s,n=$e.getConfig()){},createLanguageService(e={}){throw new Error("Parser.createLanguageService method is only available in the LSP version!")}},Ti={},el=new Set(["lintConfig","normalizeTitle","parse","createLanguageService"]);for(const e in $e)el.has(e)||(Ti[e]={enumerable:!1});Object.defineProperties($e,Ti),Object.assign(typeof globalThis=="object"?globalThis:self,{Parser:$e}),_=$e}});B()});Ga();})();
29
29
  //# sourceMappingURL=bundle.min.js.map