wikiparser-node 1.3.9-b → 1.4.0-b

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.
@@ -1,36 +1,36 @@
1
- "use strict";(()=>{var ht=Object.defineProperty;var Pi=Object.getOwnPropertyDescriptor;var Ri=Object.getOwnPropertyNames;var Gi=Object.prototype.hasOwnProperty;var ji=(l,i,e)=>i in l?ht(l,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):l[i]=e;var b=(l,i)=>()=>(l&&(i=l(l=0)),i);var qi=(l,i)=>()=>(i||l((i={exports:{}}).exports,i),i.exports),_=(l,i)=>{for(var e in i)ht(l,e,{get:i[e],enumerable:!0})},Bi=(l,i,e,t)=>{if(i&&typeof i=="object"||typeof i=="function")for(let r of Ri(i))!Gi.call(l,r)&&r!==e&&ht(l,r,{get:()=>i[r],enumerable:!(t=Pi(i,r))||t.enumerable});return l};var P=l=>Bi(ht({},"__esModule",{value:!0}),l);var f=(l,i,e)=>(ji(l,typeof i!="symbol"?i+"":i,e),e),dr=(l,i,e)=>{if(!i.has(l))throw TypeError("Cannot "+e)};var u=(l,i,e)=>(dr(l,i,"read from private field"),e?e.call(l):i.get(l)),y=(l,i,e)=>{if(i.has(l))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(l):i.set(l,e)},S=(l,i,e,t)=>(dr(l,i,"write to private field"),t?t.call(l,e):i.set(l,e),e);var mt=(l,i,e,t)=>({set _(r){S(l,i,r,e)},get _(){return u(l,i,t)}}),F=(l,i,e)=>(dr(l,i,"access private method"),e);var nt,we,pr,Ce=b(()=>{"use strict";nt={run(l){return l()}},we=l=>i=>i.type===l,pr=(l,i,e,t=[])=>{let r=[...l.childNodes],n=r.splice(i,e,...t);l.setAttribute("childNodes",r);for(let s of t)s.setAttribute("parentNode",l);return n}});var Vr=qi((fs,Oi)=>{Oi.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","img"]],namespaces:{},nsid:{file:6,category:14},parserFunction:[{"#language":"language","#special":"special","#speciale":"speciale","#tag":"tag","#formatdate":"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","#regex":"regex","#related":"related","#cscore":"cscore"},["!","="],["msg","\u539F\u59CB","raw"],["\u66FF\u4EE3","subst","\u5B89\u5168\u66FF\u4EE3","safesubst"]],doubleUnderscore:[[],[]],protocol:"bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|worldwind://|xmpp:",interwiki:[],img:{},variants:[]}});var Qr,de=b(()=>{"use strict";Qr=Vr()});var xe,be,ct,Y,Xr,pe,ft,Kr,ge,V=b(()=>{"use strict";xe='(?:\\[[\\da-f:.]+\\]|[^[\\]<>"\0-\x7F\\p{Zs}\uFFFD])',be='(?:[^[\\]<>"\0-\x7F\\p{Zs}\uFFFD]|\0\\d+[c!~]\x7F)*',ct=(l,i)=>e=>e.replace(l,i),Y=ct(/\0\d+c\x7F/gu,""),Xr=ct(/[\\{}()|.?*+^$[\]]/gu,"\\$&"),pe=(l,i="")=>l.map(e=>typeof e=="string"?e:e.text()).join(i),ft=ct(/&#(\d+|x[\da-f]+);/giu,(l,i)=>String.fromCodePoint(+`${i.toLowerCase().startsWith("x")?"0":""}${i}`)),Kr=ct(/\n/gu,"\\n"),ge=(l,i={})=>{let{pre:e="",post:t="",sep:r=""}=i;return`${e}${l.map(n=>n.print()).join(r)}${t}`}});var Jr={};_(Jr,{Title:()=>gr});var gr,Yr=b(()=>{"use strict";V();A();gr=class{constructor(i,e=0,t=h.getConfig(),r=!1,n=!1){f(this,"valid");f(this,"ns");f(this,"fragment");f(this,"encoded",!1);let{nsid:s}=t;if(i=ft(i),r&&i.includes("%"))try{let g=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(i);i=decodeURIComponent(i),this.encoded=g}catch(g){}i=i.replace(/_/gu," ").trim();let o=e;i.startsWith(":")&&(o=0,i=i.slice(1).trim());let a=i.split(":");if(a.length>1){let g=s[a[0].trim().toLowerCase()];g&&(o=g,i=a.slice(1).join(":").trim())}this.ns=o;let d=i.indexOf("#");if(d!==-1){let g=i.slice(d+1).trimEnd();this.fragment=g,i=i.slice(0,d).trim()}this.valid=!!(i||n&&this.fragment!==void 0)&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|]|%[\da-f]{2}/iu.test(i)}}});var it,st,ur,Ge,hr=b(()=>{"use strict";Ge=class{constructor(){y(this,st);f(this,"childNodes",[]);y(this,it,void 0)}get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get parentNode(){return u(this,it)}get nextSibling(){var e;let i=(e=this.parentNode)==null?void 0:e.childNodes;return i&&i[i.indexOf(this)+1]}get previousSibling(){var e;let i=(e=this.parentNode)==null?void 0:e.childNodes;return i&&i[i.indexOf(this)-1]}get offsetHeight(){return F(this,st,ur).call(this).height}get offsetWidth(){return F(this,st,ur).call(this).width}getAttribute(i){return i==="padding"?0:i in this?String(this[i]):void 0}setAttribute(i,e){i==="parentNode"?S(this,it,e):this[i]=e}getRootNode(){let{parentNode:i}=this;for(;i!=null&&i.parentNode;)({parentNode:i}=i);return i!=null?i:this}posFromIndex(i){let e=String(this);if(i>=-e.length&&i<=e.length){let t=e.slice(0,i).split(`
2
- `),r=t.length-1;return{top:r,left:t[r].length}}}getGaps(i){return 0}getRelativeIndex(i){let e,t=(r,n)=>e.slice(0,r).reduce((s,o,a)=>s+String(o).length+n.getGaps(a),0)+n.getAttribute("padding");if(i===void 0){let{parentNode:r}=this;return r?({childNodes:e}=r,t(e.indexOf(this),r)):0}return{childNodes:e}=this,t(i,this)}getAbsoluteIndex(){let{parentNode:i}=this;return i?i.getAbsoluteIndex()+this.getRelativeIndex():0}};it=new WeakMap,st=new WeakSet,ur=function(){let i=String(this).split(`
3
- `),e=i.length;return{height:e,width:i[e-1].length}}});var Tt,en=b(()=>{"use strict";V();Ce();hr();Tt=class extends Ge{get length(){return this.childNodes.length}text(i){return pe(this.childNodes,i)}normalize(){let i=[...this.childNodes];for(let e=i.length-1;e>=0;e--){let{type:t,data:r}=i[e],n=i[e-1];t!=="text"||this.getGaps(e-1)||(r===""?i.splice(e,1):(n==null?void 0:n.type)==="text"&&(n.setAttribute("data",n.data+r),i.splice(e,1)))}this.setAttribute("childNodes",i)}removeAt(i){return pr(this,i,1)[0]}insertAt(i,e=this.length){return pr(this,e,0,[i]),i}closest(i){let{parentNode:e}=this,t,r=new Set(i.split(",").map(n=>n.trim()));for(t=n=>r.has(n.type);e;){if(t(e))return e;({parentNode:e}=e)}}append(...i){for(let e of i)this.insertAt(e)}replaceChildren(...i){for(let e=this.length-1;e>=0;e--)this.removeAt(e);this.append(...i)}setText(i,e=0){e+=e<0?this.length:0;let t=this.childNodes[e],{data:r}=t;return t.replaceData(i),r}toString(i,e=""){return this.childNodes.map(t=>t.toString()).join(e)}lint(i=this.getAbsoluteIndex()){let e=[];for(let t=0,r=i+this.getAttribute("padding");t<this.length;t++){let n=this.childNodes[t];e.push(...n.lint(r)),r+=String(n).length+this.getGaps(t)}return e}print(i={}){var e;return String(this)?`<span class="wpb-${(e=i.class)!=null?e:this.type}">${ge(this.childNodes,i)}</span>`:""}json(i){return{...this,childNodes:this.childNodes.map(t=>t.type==="text"?{data:t.data}:t.json())}}}});var tn,v,N,R=b(()=>{"use strict";A();tn=l=>(i,e,t,r="error")=>{let{start:n}=e,{top:s,left:o}="top"in e?e:i.getRootNode().posFromIndex(n),{offsetHeight:a,offsetWidth:d}=i,{startIndex:g,startLine:p,startCol:m}=l(i,n,s,o);return{message:h.msg(t),severity:r,startIndex:g,endIndex:g+String(i).length,startLine:p,endLine:p+a-1,startCol:m,endCol:a===1?m+d:d}},v=tn((l,i,e,t)=>{let r=l.getRelativeIndex(),{top:n,left:s}=l.parentNode.posFromIndex(r);return{startIndex:i+r,startLine:e+n,startCol:n?s:t+s}}),N=tn((l,i,e,t)=>({startIndex:i,startLine:e,startCol:t}))});var Q,ke=b(()=>{"use strict";A();C();Q=class extends T{get innerText(){return this.firstChild.data}constructor(i="",e=h.getConfig(),t=[]){super(i,e,t)}}});var cr={};_(cr,{NowikiToken:()=>mr});var mr,fr=b(()=>{"use strict";R();A();ke();mr=class extends Q{constructor(){super(...arguments);f(this,"type","ext-inner")}lint(e=this.getAbsoluteIndex()){let{name:t,firstChild:{data:r}}=this;return(t==="templatestyles"||t==="section")&&r?[N(this,{start:e},h.msg("nothing should be in <$1>",t))]:super.lint(e)}}});var Mi,zi,Wi,xt,rn,ot,nn=b(()=>{"use strict";A();hr();Mi=/<\s*\/?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*\])|((?:^|\])[^[]*?)\]+|https?[:/]\/+/giu,zi=/<\s*\/?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*\])|((?:^|\])[^[]*?)\]+/giu,Wi=["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"],ot=class extends Ge{constructor(e){super();y(this,xt);f(this,"type","text");f(this,"data","");Object.defineProperties(this,{data:{value:e}})}toString(){return this.data}text(){return this.data}lint(e=this.getAbsoluteIndex()){let{data:t,parentNode:r,nextSibling:n,previousSibling:s}=this,{NowikiToken:o}=(fr(),P(cr)),{type:a,name:d}=r,g=n==null?void 0:n.type,p=s==null?void 0:s.type,m;a==="ext-inner"&&(d==="pre"||r instanceof o)?m=new RegExp(`<\\s*\\/?(${d})\\b`,"giu"):a==="free-ext-link"||a==="ext-link-url"||a==="image-parameter"&&d==="link"||a==="attr-value"?m=zi:m=Mi;let c=[],{ext:x,html:k}=this.getRootNode().getAttribute("config");if(t.search(m)!==-1){m.lastIndex=0;let w=this.getRootNode(),{top:q,left:I}=w.posFromIndex(e),$=new Set(["onlyinclude","noinclude","includeonly",x,k,Wi].flat(2));for(let E=m.exec(t);E;E=m.exec(t)){let[,B,L]=E,{0:O,index:M}=E;if(L&&L!=="]"){let{length:Zr}=L;M+=Zr,O=O.slice(Zr)}let oe=e+M,re=t.slice(0,M).split(`
4
- `),tt=re.length+q-1,ae=re[re.length-1],K=re.length===1?I+ae.length:ae.length,{0:W,length:le}=O,rt=oe+le,Te=String(w),U=Te[rt],$e=Te[oe-1],lr=le>1&&(W!=="<"||/[\s/>]/u.test(U!=null?U:""))||W==="{"&&(U===W||$e==="-")||W==="}"&&($e===W||U==="-")||W==="["&&(U===W||a==="ext-link-text"||!t.slice(M+1).trim()&&g==="free-ext-link")||W==="]"&&($e===W||!t.slice(0,M).trim()&&p==="free-ext-link")?"error":"warning";(W!=="<"||$.has(B.toLowerCase()))&&c.push({message:h.msg('lonely "$1"',W==="h"?O:W),severity:lr,startIndex:oe,endIndex:rt,startLine:tt,endLine:tt,startCol:K,endCol:K+le})}return c}return[]}replaceData(e){F(this,xt,rn).call(this,e)}print(){let e={"&":"amp","<":"lt",">":"gt"};return this.data.replace(/[&<>]/gu,t=>`&${e[t]};`)}};xt=new WeakSet,rn=function(e){this.setAttribute("data",e)}});var bt,sn=b(()=>{"use strict";C();bt=class extends T{constructor(){super(...arguments);f(this,"type","onlyinclude")}toString(e){return`<onlyinclude>${super.toString()}</onlyinclude>`}getAttribute(e){return e==="padding"?13:e==="plain"||super.getAttribute(e)}print(){return super.print({pre:'<span class="wpb-ext">&lt;onlyinclude&gt;</span>',post:'<span class="wpb-ext">&lt;/onlyinclude&gt;</span>'})}}});var ue,je=b(()=>{"use strict";ue=l=>{class i extends l{text(){return""}lint(){return[]}}return f(i,"hidden",!0),i}});var H,Ne=b(()=>{"use strict";je();ke();H=class extends ue(Q){constructor(){super(...arguments);f(this,"type","noinclude")}}});var ye,qe,Tr=b(()=>{"use strict";A();C();qe=class extends T{constructor(e,t,r,n,s=h.getConfig(),o=[]){super(void 0,s);y(this,ye,void 0);f(this,"closed");f(this,"selfClosing");this.setAttribute("name",e.toLowerCase()),S(this,ye,[e,n||e]),this.closed=n!=="",this.selfClosing=n===void 0,this.append(t,r);let a=typeof t=="string"?-1:o.indexOf(t);o.splice(a===-1?1/0:a,0,this),Object.defineProperty(this,"closed",{enumerable:!1})}toString(e){let{selfClosing:t,firstChild:r,lastChild:n}=this,[s,o]=u(this,ye);return t?`<${s}${r.toString(e)}/>`:`<${s}${r.toString(e)}>${n.toString(e)}${this.closed?`</${o}>`:""}`}text(){let[e,t]=u(this,ye);return this.selfClosing?`<${e}${this.firstChild.text()}/>`:`<${e}${super.text(">")}${this.closed?`</${t}>`:""}`}getAttribute(e){return e==="padding"?u(this,ye)[0].length+1:super.getAttribute(e)}getGaps(){return 1}print(){let[e,t]=u(this,ye);return super.print(this.selfClosing?{pre:`&lt;${e}`,post:"/&gt;"}:{pre:`&lt;${e}`,sep:"&gt;",post:this.closed?`&lt;/${t}&gt;`:""})}};ye=new WeakMap});var kt,on=b(()=>{"use strict";R();je();A();Tr();kt=class extends ue(qe){constructor(e,t="",r,n,s=h.getConfig(),o=[]){super(e,t,r!=null?r:"",r===void 0||n!=null?n:"",s,o);f(this,"type","include")}lint(e=this.getAbsoluteIndex()){return this.closed?[]:[N(this,{start:e},h.msg("unclosed $1",`<${this.name}>`))]}json(){return{...super.json(),closed:this.closed}}}});var G,me=b(()=>{"use strict";A();C();G=class extends T{constructor(i,e,t=h.getConfig(),r=[],n){super(i,t,r,n),this.type=e}}});var _i,D,an,ln,At,xr,dn,at,un,hn,mn,pn,yt,gn,Ui,Di,Z,ne,Be,cn=b(()=>{"use strict";R();V();de();A();C();me();_i=new Set(["id","class","style","lang","dir","title","tabindex","aria-describedby","aria-flowto","aria-hidden","aria-label","aria-labelledby","aria-owns","role","about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),D=new Set(["align"]),an=new Set(["cite"]),ln=new Set(["cite","datetime"]),At=new Set(["width"]),xr=new Set(["axis","align","bgcolor","height","width","valign"]),dn=new Set([...xr,"abbr","headers","scope","rowspan","colspan"]),at=new Set(["type"]),un=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),hn=new Set(["clear"]),mn=new Set(["bgcolor","align","valign"]),pn={div:D,h1:D,h2:D,h3:D,h4:D,h5:D,h6:D,blockquote:an,q:an,p:D,br:hn,pre:At,ins:ln,del:ln,ul:at,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...un,"border"]),caption:D,tr:mn,td:dn,th:dn,img:new Set(["alt","src","width","height","srcset"]),font:new Set(["size","color","face"]),hr:At,rt:new Set(["rbspan"]),data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:new Set(["mode","showfilename","caption","perrow","widths","heights","showthumbnails","type"]),poem:new Set(["compact","align"]),categorytree:new Set(["align","hideroot","onlyroot","depth","mode","hideprefix","namespaces","showcount","notranslations"]),combooption:new Set(["name","for","inline","align"])},yt=new Set,gn={nowiki:yt,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:yt,inputbox:yt,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:yt,poll:new Set(["id","show-results-before-voting"]),sm2:at,flashmp3:at,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"])},Ui=new RegExp("expression|(?:filter|accelerator|-o-link(?:-source)?|-o-replace)\\s*:|(?:url|image(?:-set)?)\\s*\\(|attr\\s*\\([^)]+[\\s,]url","u"),Di={table:un,td:new Set([...xr,"scope"]),th:xr,br:hn,caption:D,div:D,hr:At,h1:D,h2:D,h3:D,h4:D,h5:D,h6:D,li:at,p:D,pre:At,tr:mn,ul:at},Be=class extends T{constructor(e,t,r,n="",s,o=[],a=h.getConfig(),d=[]){let g=new G(r,"attr-key",a,d,{}),p;if(r==="title"||t==="img"&&r==="alt")p=new T(s,a,d,{}),p.type="attr-value",p.setAttribute("stage",10);else if(t==="gallery"&&r==="caption"){let m={...a,excludes:[...a.excludes,"quote","extLink","magicLink","list"]};p=new T(s,m,d,{}),p.type="attr-value",p.setAttribute("stage",5)}else if(t==="choose"&&(r==="before"||r==="after")){let m={...a,excludes:[...a.excludes,"heading","html","table","hr","list"]};p=new T(s,m,d,{}),p.type="attr-value",p.setAttribute("stage",1)}else p=new G(s,"attr-value",a,d,{});super(void 0,a,d);f(this,"tag");y(this,Z,void 0);y(this,ne,void 0);this.type=e,this.append(g,p),S(this,Z,n),S(this,ne,[...o]),this.tag=t,Object.defineProperty(this,"tag",{enumerable:!1}),this.setAttribute("name",Y(r).trim().toLowerCase())}get balanced(){return!u(this,Z)||u(this,ne)[0]===u(this,ne)[1]}afterBuild(){u(this,Z).includes("\0")&&S(this,Z,this.buildFromStr(u(this,Z),0)),this.parentNode&&this.setAttribute("tag",this.parentNode.name),this.setAttribute("name",this.firstChild.text().trim().toLowerCase())}toString(e){let[t="",r=""]=u(this,ne);return u(this,Z)?`${super.toString(e,`${u(this,Z)}${t}`)}${r}`:this.firstChild.toString(e)}text(){return u(this,Z)?`${super.text(`${u(this,Z).trim()}"`)}"`:this.firstChild.text()}getGaps(){var e,t;return u(this,Z)?u(this,Z).length+((t=(e=u(this,ne)[0])==null?void 0:e.length)!=null?t:0):0}lint(e=this.getAbsoluteIndex()){var m,c;let t=super.lint(e),{balanced:r,firstChild:n,lastChild:s,type:o,name:a,tag:d}=this,g=this.getValue(),p;if(!r){let x=this.getRootNode();p={start:e,...x.posFromIndex(e)};let k=v(s,p,h.msg("unclosed $1","quotes"),"warning");t.push({...k,startIndex:k.startIndex-1,startCol:k.startCol-1})}return gn[d]&&!gn[d].has(a)||(o==="ext-attr"?d in pn:!/\{\{[^{]+\}\}/u.test(a))&&!((m=pn[d])!=null&&m.has(a))&&!/^(?:xmlns:[\w:.-]+|data-[^:]*)$/u.test(a)&&(d==="meta"||d==="link"||!_i.has(a))?(p!=null||(p={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(n,p,"illegal attribute name"))):(c=Di[d])!=null&&c.has(a)?(p!=null||(p={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(n,p,"obsolete attribute","warning"))):a==="style"&&typeof g=="string"&&Ui.test(g)?(p!=null||(p={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(s,p,"insecure style"))):a==="tabindex"&&typeof g=="string"&&g.trim()!=="0"&&(p!=null||(p={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(s,p,"nonzero tabindex"))),t}getValue(){if(u(this,Z)){let e=this.lastChild.text();return u(this,ne)[1]?e:e[u(this,ne)[0]?"trimEnd":"trim"]()}return this.type==="ext-attr"||""}print(){let[e="",t=""]=u(this,ne);return u(this,Z)?super.print({sep:`${u(this,Z)}${e}`,post:t}):super.print()}};Z=new WeakMap,ne=new WeakMap});var fn,Hi,Ae,St=b(()=>{"use strict";R();V();A();C();me();cn();fn=l=>l.slice(0,-1),Hi=l=>`${fn(l)}-dirty`,Ae=class extends T{constructor(i,e,t,r=h.getConfig(),n=[]){if(super(void 0,r,n,{}),this.type=e,this.setAttribute("name",t),i){let s=new RegExp(`([^\\s/](?:(?!\0\\d+~\x7F)[^\\s/=])*)(?:((?:\\s|\0\\d+c\x7F)*(?:=|\0\\d+~\x7F)(?:\\s|\0\\d+c\x7F)*)(?:(["'])(.*?)(\\3|$)|(\\S*)))?`,"gsu"),o="",a=s.exec(i),d=0,g=()=>{o&&(super.insertAt(new G(o,Hi(e),r,n,{})),o="")};for(;a;){let{index:p,0:m,1:c,2:x,3:k,4:w,5:q,6:I}=a;if(o+=i.slice(d,p),/^(?:[\w:]|\0\d+[t!~{}+-]\x7F)(?:[\w:.-]|\0\d+[t!~{}+-]\x7F)*$/u.test(Y(c).trim())){let $=w!=null?w:I,E=[k,q],B=new Be(fn(e),t,c,x,$,E,r,n);g(),super.insertAt(B)}else o+=m;({lastIndex:d}=s),a=s.exec(i)}o+=i.slice(d),g()}}afterBuild(){if(this.type==="table-attrs"){let{parentNode:i}=this;this.setAttribute("name",(i==null?void 0:i.type)==="td"&&i.subtype==="caption"?"caption":i==null?void 0:i.type)}}getAttrTokens(i){return this.childNodes.filter(e=>e instanceof Be&&(!i||e.name===i.toLowerCase().trim()))}getAttrToken(i){let e=this.getAttrTokens(i);return e[e.length-1]}getAttr(i){var e;return(e=this.getAttrToken(i))==null?void 0:e.getValue()}lint(i=this.getAbsoluteIndex()){let e=super.lint(i),{parentNode:t,length:r,childNodes:n}=this,s=new Map,o=new Set,a;(t==null?void 0:t.type)==="html"&&t.closing&&this.text().trim()&&(a={start:i,...this.getRootNode().posFromIndex(i)},e.push(N(this,a,"attributes of a closing tag")));for(let d=0;d<r;d++){let g=n[d];if(g instanceof G&&g.text().trim())a!=null||(a={start:i,...this.getRootNode().posFromIndex(i)}),e.push(v(g,a,"containing invalid attribute"));else if(g instanceof Be){let{name:p}=g;s.has(p)?(o.add(p),s.get(p).push(g)):p!=="class"&&s.set(p,[g])}}if(o.size>0){a!=null||(a={start:i,...this.getRootNode().posFromIndex(i)});for(let d of o)e.push(...s.get(d).map(g=>v(g,a,h.msg("duplicated $1 attribute",d))))}return e}print(){return String(this)?`<span class="wpb-${this.type}">${this.childNodes.map(i=>i.print(i instanceof G&&i.text().trim()?{class:"attr-dirty"}:void 0)).join("")}</span>`:""}}});var Tn={};_(Tn,{PreToken:()=>br});var br,xn=b(()=>{"use strict";de();A();C();Ne();br=class extends T{constructor(e,t=h.getConfig(),r=[]){if(e){let n="<nowiki>",s="</nowiki>",{length:o}=n,a=e.indexOf(n),d=e.indexOf(s,a+o),g="";for(;a!==-1&&d!==-1;)new H(n,t,r),new H(s,t,r),g+=`${e.slice(0,a)}\0${r.length-1}c\x7F${e.slice(a+o,d)}\0${r.length}c\x7F`,e=e.slice(d+o+1),a=e.indexOf(n),d=e.indexOf(s,a+o);e=`${g}${e}`}super(e,t,r,{});f(this,"type","ext-inner");this.setAttribute("stage",10)}getAttribute(e){return e==="plain"||super.getAttribute(e)}}});var bn={};_(bn,{ParamTagToken:()=>lt});var lt,kr=b(()=>{"use strict";R();A();C();me();lt=class extends T{constructor(e,t=h.getConfig(),r=[],n={}){super(void 0,t,r,{});f(this,"type","ext-inner");if(e){let s=G;this.append(...e.split(`
5
- `).map(o=>new s(o,"param-line",t,r,{})))}}toString(e){return super.toString(e,`
1
+ "use strict";(()=>{var ht=Object.defineProperty;var qi=Object.getOwnPropertyDescriptor;var Bi=Object.getOwnPropertyNames;var Oi=Object.prototype.hasOwnProperty;var Mi=(l,i,e)=>i in l?ht(l,i,{enumerable:!0,configurable:!0,writable:!0,value:e}):l[i]=e;var b=(l,i)=>()=>(l&&(i=l(l=0)),i);var zi=(l,i)=>()=>(i||l((i={exports:{}}).exports,i),i.exports),_=(l,i)=>{for(var e in i)ht(l,e,{get:i[e],enumerable:!0})},Wi=(l,i,e,t)=>{if(i&&typeof i=="object"||typeof i=="function")for(let r of Bi(i))!Oi.call(l,r)&&r!==e&&ht(l,r,{get:()=>i[r],enumerable:!(t=qi(i,r))||t.enumerable});return l};var R=l=>Wi(ht({},"__esModule",{value:!0}),l);var f=(l,i,e)=>(Mi(l,typeof i!="symbol"?i+"":i,e),e),gr=(l,i,e)=>{if(!i.has(l))throw TypeError("Cannot "+e)};var u=(l,i,e)=>(gr(l,i,"read from private field"),e?e.call(l):i.get(l)),k=(l,i,e)=>{if(i.has(l))throw TypeError("Cannot add the same private member more than once");i instanceof WeakSet?i.add(l):i.set(l,e)},S=(l,i,e,t)=>(gr(l,i,"write to private field"),t?t.call(l,e):i.set(l,e),e);var mt=(l,i,e,t)=>({set _(r){S(l,i,r,e)},get _(){return u(l,i,t)}}),w=(l,i,e)=>(gr(l,i,"access private method"),e);var nt,we,ur,Ce=b(()=>{"use strict";nt={run(l){return l()}},we=l=>i=>i.type===l,ur=(l,i,e,t=[])=>{let r=[...l.childNodes],n=r.splice(i,e,...t);l.setAttribute("childNodes",r);for(let s of t)s.setAttribute("parentNode",l);return n}});var Xr=zi((ks,_i)=>{_i.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","img"]],namespaces:{},nsid:{file:6,category:14},parserFunction:[{"#language":"language","#special":"special","#speciale":"speciale","#tag":"tag","#formatdate":"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","#regex":"regex","#related":"related","#cscore":"cscore"},["!","="],["msg","\u539F\u59CB","raw"],["\u66FF\u4EE3","subst","\u5B89\u5168\u66FF\u4EE3","safesubst"]],doubleUnderscore:[[],[]],protocol:"bitcoin:|ftp://|ftps://|geo:|git://|gopher://|http://|https://|irc://|ircs://|magnet:|mailto:|mms://|news:|nntp://|redis://|sftp://|sip:|sips:|sms:|ssh://|svn://|tel:|telnet://|urn:|worldwind://|xmpp:",interwiki:[],img:{},variants:[]}});var Kr,de=b(()=>{"use strict";Kr=Xr()});var xe,be,ct,Y,Jr,pe,ft,Yr,ge,Z=b(()=>{"use strict";xe='(?:\\[[\\da-f:.]+\\]|[^[\\]<>"\0-\x7F\\p{Zs}\uFFFD])',be='(?:[^[\\]<>"\0-\x7F\\p{Zs}\uFFFD]|\0\\d+[c!~]\x7F)*',ct=(l,i)=>e=>e.replace(l,i),Y=ct(/\0\d+c\x7F/gu,""),Jr=ct(/[\\{}()|.?*+^$[\]]/gu,"\\$&"),pe=(l,i="")=>l.map(e=>typeof e=="string"?e:e.text()).join(i),ft=ct(/&#(\d+|x[\da-f]+);/giu,(l,i)=>String.fromCodePoint(+`${i.toLowerCase().startsWith("x")?"0":""}${i}`)),Yr=ct(/\n/gu,"\\n"),ge=(l,i={})=>{let{pre:e="",post:t="",sep:r=""}=i;return`${e}${l.map(n=>n.print()).join(r)}${t}`}});var en={};_(en,{Title:()=>hr});var hr,tn=b(()=>{"use strict";Z();A();hr=class{constructor(i,e=0,t=m.getConfig(),r=!1,n=!1){f(this,"valid");f(this,"ns");f(this,"fragment");f(this,"encoded",!1);let{nsid:s}=t;if(i=ft(i),r&&i.includes("%"))try{let g=/%(?!21|3[ce]|5[bd]|7[b-d])[\da-f]{2}/iu.test(i);i=decodeURIComponent(i),this.encoded=g}catch(g){}i=i.replace(/_/gu," ").trim();let a=e;i.startsWith(":")&&(a=0,i=i.slice(1).trim());let o=i.split(":");if(o.length>1){let g=s[o[0].trim().toLowerCase()];g&&(a=g,i=o.slice(1).join(":").trim())}this.ns=a;let d=i.indexOf("#");if(d!==-1){let g=i.slice(d+1).trimEnd();this.fragment=g,i=i.slice(0,d).trim()}this.valid=!!(i||n&&this.fragment!==void 0)&&!/^:|\0\d+[eh!+-]\x7F|[<>[\]{}|]|%[\da-f]{2}/iu.test(i)}}});var it,st,mr,Ge,cr=b(()=>{"use strict";Ge=class{constructor(){k(this,st);f(this,"childNodes",[]);k(this,it,void 0)}get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes[this.childNodes.length-1]}get parentNode(){return u(this,it)}get nextSibling(){var e;let i=(e=this.parentNode)==null?void 0:e.childNodes;return i&&i[i.indexOf(this)+1]}get previousSibling(){var e;let i=(e=this.parentNode)==null?void 0:e.childNodes;return i&&i[i.indexOf(this)-1]}get offsetHeight(){return w(this,st,mr).call(this).height}get offsetWidth(){return w(this,st,mr).call(this).width}getAttribute(i){return i==="padding"?0:i in this?String(this[i]):void 0}setAttribute(i,e){i==="parentNode"?S(this,it,e):this[i]=e}getRootNode(){let{parentNode:i}=this;for(;i!=null&&i.parentNode;)({parentNode:i}=i);return i!=null?i:this}posFromIndex(i){let e=String(this);if(i>=-e.length&&i<=e.length){let t=e.slice(0,i).split(`
2
+ `),r=t.length-1;return{top:r,left:t[r].length}}}getGaps(i){return 0}getRelativeIndex(i){let e,t=(r,n)=>e.slice(0,r).reduce((s,a,o)=>s+String(a).length+n.getGaps(o),0)+n.getAttribute("padding");if(i===void 0){let{parentNode:r}=this;return r?({childNodes:e}=r,t(e.indexOf(this),r)):0}return{childNodes:e}=this,t(i,this)}getAbsoluteIndex(){let{parentNode:i}=this;return i?i.getAbsoluteIndex()+this.getRelativeIndex():0}};it=new WeakMap,st=new WeakSet,mr=function(){let i=String(this).split(`
3
+ `),e=i.length;return{height:e,width:i[e-1].length}}});var xt,rn,Tt,nn=b(()=>{"use strict";Z();Ce();cr();Tt=class extends Ge{constructor(){super(...arguments);k(this,xt)}get length(){return this.childNodes.length}text(e){return pe(this.childNodes,e)}normalize(){let e=[...this.childNodes];for(let t=e.length-1;t>=0;t--){let{type:r,data:n}=e[t],s=e[t-1];r!=="text"||this.getGaps(t-1)||(n===""?e.splice(t,1):(s==null?void 0:s.type)==="text"&&(s.setAttribute("data",s.data+n),e.splice(t,1)))}this.setAttribute("childNodes",e)}removeAt(e){return ur(this,e,1)[0]}insertAt(e,t=this.length){return ur(this,t,0,[e]),e}closest(e){let t=w(this,xt,rn).call(this,e),{parentNode:r}=this;for(;r;){if(t(r))return r;({parentNode:r}=r)}}append(...e){for(let t of e)this.insertAt(t)}replaceChildren(...e){for(let t=this.length-1;t>=0;t--)this.removeAt(t);this.append(...e)}setText(e,t=0){t+=t<0?this.length:0;let r=this.childNodes[t],{data:n}=r;return r.replaceData(e),n}toString(e,t=""){return this.childNodes.map(r=>r.toString()).join(t)}lint(e=this.getAbsoluteIndex()){let t=[];for(let r=0,n=e+this.getAttribute("padding");r<this.length;r++){let s=this.childNodes[r];t.push(...s.lint(n)),n+=String(s).length+this.getGaps(r)}return t}print(e={}){var t;return String(this)?`<span class="wpb-${(t=e.class)!=null?t:this.type}">${ge(this.childNodes,e)}</span>`:""}json(e){return{...this,childNodes:this.childNodes.map(r=>r.type==="text"?{data:r.data}:r.json())}}};xt=new WeakSet,rn=function(e){let t,r=new Set(e.split(",").map(n=>n.trim()));return t=n=>r.has(n.type),t}});var sn,v,$,P=b(()=>{"use strict";A();sn=l=>(i,e,t,r="error")=>{let{start:n}=e,{top:s,left:a}="top"in e?e:i.getRootNode().posFromIndex(n),{offsetHeight:o,offsetWidth:d}=i,{startIndex:g,startLine:p,startCol:h}=l(i,n,s,a);return{message:m.msg(t),severity:r,startIndex:g,endIndex:g+String(i).length,startLine:p,endLine:p+o-1,startCol:h,endCol:o===1?h+d:d}},v=sn((l,i,e,t)=>{let r=l.getRelativeIndex(),{top:n,left:s}=l.parentNode.posFromIndex(r);return{startIndex:i+r,startLine:e+n,startCol:n?s:t+s}}),$=sn((l,i,e,t)=>({startIndex:i,startLine:e,startCol:t}))});var Q,ke=b(()=>{"use strict";A();F();Q=class extends x{get innerText(){return this.firstChild.data}constructor(i="",e=m.getConfig(),t=[]){super(i,e,t)}}});var Tr={};_(Tr,{NowikiToken:()=>fr});var fr,xr=b(()=>{"use strict";P();A();ke();fr=class extends Q{constructor(){super(...arguments);f(this,"type","ext-inner")}lint(e=this.getAbsoluteIndex()){let{name:t,firstChild:{data:r}}=this;return(t==="templatestyles"||t==="section")&&r?[$(this,{start:e},m.msg("nothing should be in <$1>",t))]:super.lint(e)}}});var Hi,Ui,Di,bt,on,ot,an=b(()=>{"use strict";A();cr();Hi=/<\s*\/?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*\])|((?:^|\])[^[]*?)\]+|https?[:/]\/+/giu,Ui=/<\s*\/?([a-z]\w*)|\{+|\}+|\[{2,}|\[(?![^[]*\])|((?:^|\])[^[]*?)\]+/giu,Di=["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"],ot=class extends Ge{constructor(e){super();k(this,bt);f(this,"type","text");f(this,"data","");Object.defineProperties(this,{data:{value:e}})}toString(){return this.data}text(){return this.data}lint(e=this.getAbsoluteIndex()){let{data:t,parentNode:r,nextSibling:n,previousSibling:s}=this,{NowikiToken:a}=(xr(),R(Tr)),{type:o,name:d}=r,g=n==null?void 0:n.type,p=s==null?void 0:s.type,h;o==="ext-inner"&&(d==="pre"||r instanceof a)?h=new RegExp(`<\\s*\\/?(${d})\\b`,"giu"):o==="free-ext-link"||o==="ext-link-url"||o==="image-parameter"&&d==="link"||o==="attr-value"?h=Ui:h=Hi;let c=[],{ext:T,html:y}=this.getRootNode().getAttribute("config");if(t.search(h)!==-1){h.lastIndex=0;let N=this.getRootNode(),{top:q,left:I}=N.posFromIndex(e),C=new Set(["onlyinclude","noinclude","includeonly",T,y,Di].flat(2));for(let E=h.exec(t);E;E=h.exec(t)){let[,B,L]=E,{0:O,index:M}=E;if(L&&L!=="]"){let{length:Qr}=L;M+=Qr,O=O.slice(Qr)}let oe=e+M,re=t.slice(0,M).split(`
4
+ `),tt=re.length+q-1,ae=re[re.length-1],J=re.length===1?I+ae.length:ae.length,{0:W,length:le}=O,rt=oe+le,Te=String(N),H=Te[rt],$e=Te[oe-1],pr=le>1&&(W!=="<"||/[\s/>]/u.test(H!=null?H:""))||W==="{"&&(H===W||$e==="-")||W==="}"&&($e===W||H==="-")||W==="["&&(H===W||o==="ext-link-text"||!t.slice(M+1).trim()&&g==="free-ext-link")||W==="]"&&($e===W||!t.slice(0,M).trim()&&p==="free-ext-link")?"error":"warning";(W!=="<"||C.has(B.toLowerCase()))&&c.push({message:m.msg('lonely "$1"',W==="h"?O:W),severity:pr,startIndex:oe,endIndex:rt,startLine:tt,endLine:tt,startCol:J,endCol:J+le})}return c}return[]}replaceData(e){w(this,bt,on).call(this,e)}print(){let e={"&":"amp","<":"lt",">":"gt"};return this.data.replace(/[&<>]/gu,t=>`&${e[t]};`)}};bt=new WeakSet,on=function(e){this.setAttribute("data",e)}});var kt,ln=b(()=>{"use strict";F();kt=class extends x{constructor(){super(...arguments);f(this,"type","onlyinclude")}toString(e){return`<onlyinclude>${super.toString()}</onlyinclude>`}getAttribute(e){return e==="padding"?13:e==="plain"||super.getAttribute(e)}print(){return super.print({pre:'<span class="wpb-ext">&lt;onlyinclude&gt;</span>',post:'<span class="wpb-ext">&lt;/onlyinclude&gt;</span>'})}}});var ue,je=b(()=>{"use strict";ue=l=>{class i extends l{text(){return""}lint(){return[]}}return i}});var D,Ne=b(()=>{"use strict";je();ke();D=class extends ue(Q){constructor(){super(...arguments);f(this,"type","noinclude")}}});var ye,qe,br=b(()=>{"use strict";A();F();qe=class extends x{constructor(e,t,r,n,s=m.getConfig(),a=[]){super(void 0,s);k(this,ye,void 0);f(this,"closed");f(this,"selfClosing");this.setAttribute("name",e.toLowerCase()),S(this,ye,[e,n||e]),this.closed=n!=="",this.selfClosing=n===void 0,this.append(t,r);let o=typeof t=="string"?-1:a.indexOf(t);a.splice(o===-1?1/0:o,0,this),Object.defineProperty(this,"closed",{enumerable:!1})}toString(e){let{selfClosing:t,firstChild:r,lastChild:n}=this,[s,a]=u(this,ye);return t?`<${s}${r.toString(e)}/>`:`<${s}${r.toString(e)}>${n.toString(e)}${this.closed?`</${a}>`:""}`}text(){let[e,t]=u(this,ye);return this.selfClosing?`<${e}${this.firstChild.text()}/>`:`<${e}${super.text(">")}${this.closed?`</${t}>`:""}`}getAttribute(e){return e==="padding"?u(this,ye)[0].length+1:super.getAttribute(e)}getGaps(){return 1}print(){let[e,t]=u(this,ye);return super.print(this.selfClosing?{pre:`&lt;${e}`,post:"/&gt;"}:{pre:`&lt;${e}`,sep:"&gt;",post:this.closed?`&lt;/${t}&gt;`:""})}};ye=new WeakMap});var yt,dn=b(()=>{"use strict";P();je();A();br();yt=class extends ue(qe){constructor(e,t="",r,n,s=m.getConfig(),a=[]){super(e,t,r!=null?r:"",r===void 0||n!=null?n:"",s,a);f(this,"type","include")}lint(e=this.getAbsoluteIndex()){return this.closed?[]:[$(this,{start:e},m.msg("unclosed $1",`<${this.name}>`))]}json(){return{...super.json(),closed:this.closed}}}});var G,me=b(()=>{"use strict";A();F();G=class extends x{constructor(i,e,t=m.getConfig(),r=[],n){super(i,t,r,n),this.type=e}}});var Vi,U,pn,gn,vt,kr,un,at,cn,fn,Tn,hn,At,mn,Zi,Qi,V,ne,Be,xn=b(()=>{"use strict";P();Z();de();A();F();me();Vi=new Set(["id","class","style","lang","dir","title","tabindex","aria-describedby","aria-flowto","aria-hidden","aria-label","aria-labelledby","aria-owns","role","about","property","resource","datatype","typeof","itemid","itemprop","itemref","itemscope","itemtype"]),U=new Set(["align"]),pn=new Set(["cite"]),gn=new Set(["cite","datetime"]),vt=new Set(["width"]),kr=new Set(["axis","align","bgcolor","height","width","valign"]),un=new Set([...kr,"abbr","headers","scope","rowspan","colspan"]),at=new Set(["type"]),cn=new Set(["summary","align","bgcolor","cellpadding","cellspacing","frame","rules","width"]),fn=new Set(["clear"]),Tn=new Set(["bgcolor","align","valign"]),hn={div:U,h1:U,h2:U,h3:U,h4:U,h5:U,h6:U,blockquote:pn,q:pn,p:U,br:fn,pre:vt,ins:gn,del:gn,ul:at,ol:new Set(["type","start","reversed"]),li:new Set(["type","value"]),table:new Set([...cn,"border"]),caption:U,tr:Tn,td:un,th:un,img:new Set(["alt","src","width","height","srcset"]),font:new Set(["size","color","face"]),hr:vt,rt:new Set(["rbspan"]),data:new Set(["value"]),time:new Set(["datetime"]),meta:new Set(["itemprop","content"]),link:new Set(["itemprop","href","title"]),gallery:new Set(["mode","showfilename","caption","perrow","widths","heights","showthumbnails","type"]),poem:new Set(["compact","align"]),categorytree:new Set(["align","hideroot","onlyroot","depth","mode","hideprefix","namespaces","showcount","notranslations"]),combooption:new Set(["name","for","inline","align"])},At=new Set,mn={nowiki:At,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:At,inputbox:At,templatestyles:new Set(["src","wrapper"]),dynamicpagelist:At,poll:new Set(["id","show-results-before-voting"]),sm2:at,flashmp3:at,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"])},Zi=new RegExp("expression|(?:filter|accelerator|-o-link(?:-source)?|-o-replace)\\s*:|(?:url|image(?:-set)?)\\s*\\(|attr\\s*\\([^)]+[\\s,]url","u"),Qi={table:cn,td:new Set([...kr,"scope"]),th:kr,br:fn,caption:U,div:U,hr:vt,h1:U,h2:U,h3:U,h4:U,h5:U,h6:U,li:at,p:U,pre:vt,tr:Tn,ul:at},Be=class extends x{constructor(e,t,r,n="",s,a=[],o=m.getConfig(),d=[]){let g=new G(r,"attr-key",o,d,{}),p;if(r==="title"||t==="img"&&r==="alt")p=new x(s,o,d,{}),p.type="attr-value",p.setAttribute("stage",10);else if(t==="gallery"&&r==="caption"){let h={...o,excludes:[...o.excludes,"quote","extLink","magicLink","list"]};p=new x(s,h,d,{}),p.type="attr-value",p.setAttribute("stage",5)}else if(t==="choose"&&(r==="before"||r==="after")){let h={...o,excludes:[...o.excludes,"heading","html","table","hr","list"]};p=new x(s,h,d,{}),p.type="attr-value",p.setAttribute("stage",1)}else p=new G(s,"attr-value",o,d,{});super(void 0,o,d);f(this,"tag");k(this,V,void 0);k(this,ne,void 0);this.type=e,this.append(g,p),S(this,V,n),S(this,ne,[...a]),this.tag=t,this.setAttribute("name",Y(r).trim().toLowerCase())}get balanced(){return!u(this,V)||u(this,ne)[0]===u(this,ne)[1]}afterBuild(){u(this,V).includes("\0")&&S(this,V,this.buildFromStr(u(this,V),0)),this.parentNode&&this.setAttribute("tag",this.parentNode.name),this.setAttribute("name",this.firstChild.text().trim().toLowerCase())}toString(e){let[t="",r=""]=u(this,ne);return u(this,V)?`${super.toString(e,`${u(this,V)}${t}`)}${r}`:this.firstChild.toString(e)}text(){return u(this,V)?`${super.text(`${u(this,V).trim()}"`)}"`:this.firstChild.text()}getGaps(){var e,t;return u(this,V)?u(this,V).length+((t=(e=u(this,ne)[0])==null?void 0:e.length)!=null?t:0):0}lint(e=this.getAbsoluteIndex()){var h,c;let t=super.lint(e),{balanced:r,firstChild:n,lastChild:s,type:a,name:o,tag:d}=this,g=this.getValue(),p;if(!r){let T=this.getRootNode();p={start:e,...T.posFromIndex(e)};let y=v(s,p,m.msg("unclosed $1","quotes"),"warning");t.push({...y,startIndex:y.startIndex-1,startCol:y.startCol-1})}return mn[d]&&!mn[d].has(o)||(a==="ext-attr"?d in hn:!/\{\{[^{]+\}\}/u.test(o))&&!((h=hn[d])!=null&&h.has(o))&&!/^(?:xmlns:[\w:.-]+|data-[^:]*)$/u.test(o)&&(d==="meta"||d==="link"||!Vi.has(o))?(p!=null||(p={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(n,p,"illegal attribute name"))):(c=Qi[d])!=null&&c.has(o)?(p!=null||(p={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(n,p,"obsolete attribute","warning"))):o==="style"&&typeof g=="string"&&Zi.test(g)?(p!=null||(p={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(s,p,"insecure style"))):o==="tabindex"&&typeof g=="string"&&g.trim()!=="0"&&(p!=null||(p={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(s,p,"nonzero tabindex"))),t}getValue(){if(u(this,V)){let e=this.lastChild.text();return u(this,ne)[1]?e:e[u(this,ne)[0]?"trimEnd":"trim"]()}return this.type==="ext-attr"||""}print(){let[e="",t=""]=u(this,ne);return u(this,V)?super.print({sep:`${u(this,V)}${e}`,post:t}):super.print()}};V=new WeakMap,ne=new WeakMap});var bn,Xi,Ae,$t=b(()=>{"use strict";P();Z();A();F();me();xn();bn=l=>l.slice(0,-1),Xi=l=>`${bn(l)}-dirty`,Ae=class extends x{constructor(i,e,t,r=m.getConfig(),n=[]){if(super(void 0,r,n,{}),this.type=e,this.setAttribute("name",t),i){let s=new RegExp(`([^\\s/](?:(?!\0\\d+~\x7F)[^\\s/=])*)(?:((?:\\s|\0\\d+c\x7F)*(?:=|\0\\d+~\x7F)(?:\\s|\0\\d+c\x7F)*)(?:(["'])(.*?)(\\3|$)|(\\S*)))?`,"gsu"),a="",o=s.exec(i),d=0,g=()=>{a&&(super.insertAt(new G(a,Xi(e),r,n,{})),a="")};for(;o;){let{index:p,0:h,1:c,2:T,3:y,4:N,5:q,6:I}=o;if(a+=i.slice(d,p),/^(?:[\w:]|\0\d+[t!~{}+-]\x7F)(?:[\w:.-]|\0\d+[t!~{}+-]\x7F)*$/u.test(Y(c).trim())){let C=N!=null?N:I,E=[y,q],B=new Be(bn(e),t,c,T,C,E,r,n);g(),super.insertAt(B)}else a+=h;({lastIndex:d}=s),o=s.exec(i)}a+=i.slice(d),g()}}afterBuild(){if(this.type==="table-attrs"){let{parentNode:i}=this;this.setAttribute("name",(i==null?void 0:i.type)==="td"&&i.subtype==="caption"?"caption":i==null?void 0:i.type)}}getAttrTokens(i){return this.childNodes.filter(e=>e instanceof Be&&(!i||e.name===i.toLowerCase().trim()))}getAttrToken(i){let e=this.getAttrTokens(i);return e[e.length-1]}getAttr(i){var e;return(e=this.getAttrToken(i))==null?void 0:e.getValue()}lint(i=this.getAbsoluteIndex()){let e=super.lint(i),{parentNode:t,length:r,childNodes:n}=this,s=new Map,a=new Set,o;(t==null?void 0:t.type)==="html"&&t.closing&&this.text().trim()&&(o={start:i,...this.getRootNode().posFromIndex(i)},e.push($(this,o,"attributes of a closing tag")));for(let d=0;d<r;d++){let g=n[d];if(g instanceof G&&g.text().trim())o!=null||(o={start:i,...this.getRootNode().posFromIndex(i)}),e.push(v(g,o,"containing invalid attribute"));else if(g instanceof Be){let{name:p}=g;s.has(p)?(a.add(p),s.get(p).push(g)):p!=="class"&&s.set(p,[g])}}if(a.size>0){o!=null||(o={start:i,...this.getRootNode().posFromIndex(i)});for(let d of a)e.push(...s.get(d).map(g=>v(g,o,m.msg("duplicated $1 attribute",d))))}return e}print(){return String(this)?`<span class="wpb-${this.type}">${this.childNodes.map(i=>i.print(i instanceof G&&i.text().trim()?{class:"attr-dirty"}:void 0)).join("")}</span>`:""}}});var kn={};_(kn,{PreToken:()=>yr});var yr,yn=b(()=>{"use strict";de();A();F();Ne();yr=class extends x{constructor(e,t=m.getConfig(),r=[]){if(e){let n="<nowiki>",s="</nowiki>",{length:a}=n,o=e.indexOf(n),d=e.indexOf(s,o+a),g="";for(;o!==-1&&d!==-1;)new D(n,t,r),new D(s,t,r),g+=`${e.slice(0,o)}\0${r.length-1}c\x7F${e.slice(o+a,d)}\0${r.length}c\x7F`,e=e.slice(d+a+1),o=e.indexOf(n),d=e.indexOf(s,o+a);e=`${g}${e}`}super(e,t,r,{});f(this,"type","ext-inner");this.setAttribute("stage",10)}getAttribute(e){return e==="plain"||super.getAttribute(e)}}});var An={};_(An,{ParamTagToken:()=>lt});var lt,Ar=b(()=>{"use strict";P();A();F();me();lt=class extends x{constructor(e,t=m.getConfig(),r=[],n={}){super(void 0,t,r,{});f(this,"type","ext-inner");if(e){let s=G;this.append(...e.split(`
5
+ `).map(a=>new s(a,"param-line",t,r,{})))}}toString(e){return super.toString(e,`
6
6
  `)}text(){return super.text(`
7
- `)}getGaps(){return 1}lint(e=this.getAbsoluteIndex()){let t;return this.childNodes.filter(r=>{let{childNodes:n}=r,s=n.findIndex(({type:a})=>a!=="text"),o=(s>=0?n.slice(0,s).map(String).join(""):String(r)).trim();return o&&!(s>=0?/^[a-z]+(?:\[\])?\s*(?:=|$)/iu:/^[a-z]+(?:\[\])?\s*=/iu).test(o)}).map(r=>(t!=null||(t={start:e,...this.getRootNode().posFromIndex(e)}),v(r,t,h.msg("invalid parameter of $1",this.name))))}print(){return super.print({sep:`
8
- `})}}});var he,dt=b(()=>{"use strict";A();C();he=class extends T{constructor(i,e,t="plain",r=h.getConfig(),n=[],s){super(i,r,n,s),this.type=t}lint(){return[]}}});var pt,Oe,$t,Me,yr=b(()=>{"use strict";R();A();C();dt();Me=class extends T{constructor(e,t,r=h.getConfig(),n=[]){super(void 0,r,n);y(this,Oe);f(this,"type","heading");y(this,pt,void 0);S(this,pt,e);let s=new T(t[0],r,n);s.type="heading-title",s.setAttribute("stage",2);let o=new he(t[1],/^[^\S\n]*$/u,"heading-trail",r,n,{});this.append(s,o)}get level(){return u(this,pt)}toString(e){let t=u(this,Oe,$t);return`${t}${this.firstChild.toString()}${t}${this.lastChild.toString()}`}text(){let e=u(this,Oe,$t);return`${e}${this.firstChild.text()}${e}`}getAttribute(e){return e==="padding"?super.getAttribute("padding")+this.level:super.getAttribute(e)}getGaps(){return this.level}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{firstChild:r,level:n}=this,s=String(r),o=r.childNodes.filter(p=>p.type==="quote"),a=o.filter(({bold:p})=>p),d=o.filter(({italic:p})=>p),g;return this.level===1&&(g={start:e,...this.getRootNode().posFromIndex(e)},t.push(v(r,g,"<h1>"))),(s.startsWith("=")||s.endsWith("="))&&(g!=null||(g={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(r,g,h.msg("unbalanced $1 in a section header",'"="')))),this.closest("html-attrs, table-attrs")&&(g!=null||(g={start:e,...this.getRootNode().posFromIndex(e)}),t.push(N(this,g,"section header in a HTML tag"))),a.length%2&&(g!=null||(g={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(a[a.length-1],{...g,start:e+n,left:g.left+n},h.msg("unbalanced $1 in a section header","bold apostrophes")))),d.length%2&&(g!=null||(g={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(d[d.length-1],{start:e+n},h.msg("unbalanced $1 in a section header","italic apostrophes")))),t}print(){let e=u(this,Oe,$t);return super.print({pre:e,sep:e})}json(){return{...super.json(),level:this.level}}};pt=new WeakMap,Oe=new WeakSet,$t=function(){return"=".repeat(this.level)}});var Zi,wt,kn=b(()=>{"use strict";V();R();A();C();Zi=l=>l.toString(new Set(["comment","noinclude","include"])).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),wt=class extends T{constructor(e,t,r=h.getConfig(),n=[]){super(void 0,r,n);f(this,"type","parameter");let s=new T(typeof e=="number"?void 0:e,r,n,{}),o=new T(t,r,n);s.type="parameter-key",o.type="parameter-value",o.setAttribute("stage",2),this.append(s,o)}get anon(){return this.firstChild.length===0}afterBuild(){if(!this.anon){let{parentNode:e,firstChild:t}=this,r=Zi(t);this.setAttribute("name",r),e&&e.getArgs(r,!1,!1).add(this)}}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()){var s;let t=super.lint(e),{firstChild:r}=this,n=(s=new RegExp(`https?://${xe}${be}$`,"iu").exec(r.toString(new Set(["comment","noinclude","include"]))))==null?void 0:s[0];if(n&&new URL(n).search){let o=v(r,{start:e},"unescaped query string in an anonymous parameter");t.push({...o,startIndex:o.endIndex,endIndex:o.endIndex+1,startLine:o.endLine,startCol:o.endCol,endCol:o.endCol+1})}return t}print(){return super.print({sep:this.anon?"":"="})}json(){return{...super.json(),anon:this.anon}}}});var Vi,Fe,Ee,Nt,yn,Ft,An,Ct,vn=b(()=>{"use strict";V();R();Ce();de();A();C();kn();me();dt();Vi=new Set(["pageid","articlepath","server","servername","scriptpath","stylepath"]),Ct=class extends T{constructor(e,t,r=h.getConfig(),n=[]){var m,c;super(void 0,r,n,{});y(this,Nt);y(this,Ft);f(this,"type","template");f(this,"modifier","");y(this,Fe,!1);y(this,Ee,new Map);let{parserFunction:[s,o]}=r,a=(m=/^(?:\s|\0\d+c\x7F)*\0\d+s\x7F/u.exec(e))==null?void 0:m[0];if(a)this.setAttribute("modifier",a),e=e.slice(a.length);else if(e.includes(":")){let[x,...k]=e.split(":"),[w]=/^(?:\s|\0\d+c\x7F)*/u.exec((c=k[0])!=null?c:"");this.setModifier(`${x}:${w}`)&&(e=k.join(":").slice(w.length))}let d=e.includes(":");if(d||t.length===0&&!u(this,Fe)){let[x,...k]=e.split(":"),w=Y(x),q=w[k.length>0?"trimStart":"trim"](),I=q.toLowerCase(),$=s[I],E=o.includes(q);if(E||Vi.has($)||d&&$){this.setAttribute("name",$!=null?$:I),this.type="magic-word";let L=new RegExp(`^\\s*${q}\\s*$`,E?"u":"iu"),O=new he(x,L,"magic-word-name",r,n,{});if(super.insertAt(O),k.length>0&&t.unshift([k.join(":")]),this.name==="invoke")for(let M=0;M<2;M++){let oe=t.shift();if(!oe)break;let re=new G(oe.join("="),`invoke-${M?"function":"module"}`,r,n);super.insertAt(re)}}}if(this.type==="template"){let x=Y(ft(e)).split("#")[0].trim();if(!x||/^:[\s_]*:|\0\d+[eh!+-]\x7F|[<>[\]{}\n]|%[\da-f]{2}/iu.test(x))throw n.pop(),new SyntaxError("\u975E\u6CD5\u7684\u6A21\u677F\u540D\u79F0");let k=new G(e,"template-name",r,n,{});super.insertAt(k)}let g=this.isTemplate(),p=1;for(let x=0;x<t.length;x++){let k=t[x];!g&&!(this.name==="switch"&&x>0)&&(k[0]=k.join("="),k.length=1),k.length===1&&(k.unshift(p),p++),this.insertAt(new wt(...k,r,n))}}setModifier(e){let{parserFunction:[,,t,r]}=this.getAttribute("config"),n=Y(e).trim();if(e&&!n.endsWith(":"))return!1;let s=n.slice(0,-1).toLowerCase(),o=t.includes(s),a=r.includes(s);return u(this,Fe)&&o||!u(this,Fe)&&(a||e==="")||this.length>1&&(o||a||e==="")?(this.setAttribute("modifier",e),S(this,Fe,o),!!e):!1}isTemplate(){return this.type==="template"||this.name==="invoke"}afterBuild(){this.modifier.includes("\0")&&this.setAttribute("modifier",this.buildFromStr(this.modifier,0))}toString(e){return`{{${this.modifier}${this.type==="magic-word"?`${this.firstChild.toString(e)}${this.length===1?"":":"}${this.childNodes.slice(1).map(t=>t.toString(e)).join("|")}`:super.toString(e,"|")}}}`}text(){let{childNodes:e,length:t,firstChild:r,modifier:n,type:s,name:o}=this;return s==="magic-word"&&o==="vardefine"?"":`{{${n}${s==="magic-word"?`${r.text()}${t===1?"":":"}${pe(e.slice(1),"|")}`:super.text("|")}}}`}getAttribute(e){switch(e){case"padding":return this.modifier.length+2;default:return super.getAttribute(e)}}getGaps(){return 1}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{type:r,childNodes:n,length:s}=this,o;if(!this.isTemplate())return t;let a=F(this,Nt,yn).call(this);if(a.fragment!==void 0&&(o={start:e,...this.getRootNode().posFromIndex(e)},t.push(v(n[r==="template"?0:1],o,"useless fragment"))),a.valid||(o!=null||(o={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(n[1],o,"illegal module name"))),r==="magic-word"&&s===2)return o!=null||(o={start:e,...this.getRootNode().posFromIndex(e)}),t.push(N(this,o,"missing module function")),t;let d=this.getDuplicatedArgs();return d.length>0&&(o!=null||(o={start:e,...this.getRootNode().posFromIndex(e)}),t.push(...d.flatMap(([,g])=>g).map(g=>v(g,o,"duplicated parameter")))),t}insertAt(e,t=this.length){return super.insertAt(e,t),e.anon?F(this,Ft,An).call(this,e):e.name&&this.getArgs(e.name,!1,!1).add(e),e}getAllArgs(){return this.childNodes.filter(we("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:e})=>e)}getArgs(e,t=!1,r=!0){let n=String(e).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),s;return u(this,Ee).has(n)?s=u(this,Ee).get(n):(s=new Set(this.getAllArgs().filter(({name:o})=>n===o)),u(this,Ee).set(n,s)),s}getDuplicatedArgs(){return this.isTemplate()?[...u(this,Ee)].filter(([,{size:e}])=>e>1).map(([e,t])=>[e,[...t]]):[]}getPossibleValues(){let{type:e,name:t,childNodes:r,constructor:{name:n}}=this;if(e==="template")throw new Error(`${n}.getPossibleValues \u65B9\u6CD5\u4EC5\u4F9B\u7279\u5B9A\u9B54\u672F\u5B57\u4F7F\u7528\uFF01`);let s;switch(t){case"if":case"ifexist":case"ifexpr":case"iferror":s=2;break;case"ifeq":s=3;break;default:throw new Error(`${n}.getPossibleValues \u65B9\u6CD5\u4EC5\u4F9B\u7279\u5B9A\u9B54\u672F\u5B57\u4F7F\u7528\uFF01`)}let o=r.slice(s,s+2).map(({childNodes:[,a]})=>a);for(let a=0;a<o.length;){let{length:d,0:g}=o[a].childNodes.filter(p=>p.text().trim());if(d===0)o.splice(a,1);else if(d>1||g.type!=="magic-word")a++;else try{let p=g.getPossibleValues();o.splice(a,1,...p),a+=p.length}catch(p){a++}}return o}print(){let{childNodes:e,length:t,firstChild:r,modifier:n,type:s}=this;return`<span class="wpb-${s}">{{${n}${s==="magic-word"?`${r.print()}${t===1?"":":"}${ge(e.slice(1),{sep:"|"})}`:ge(e,{sep:"|"})}}}</span>`}json(){return{...super.json(),modifier:this.modifier||void 0}}};Fe=new WeakMap,Ee=new WeakMap,Nt=new WeakSet,yn=function(){let e=this.type==="template",t=this.childNodes[e?0:1];return this.normalizeTitle(t.text(),e?10:828)},Ft=new WeakSet,An=function(e){let t=this.getAnonArgs(),r=typeof e!="number";for(let n=r?t.indexOf(e):e-1;n<t.length;n++){let s=t[n],{name:o}=s,a=String(n+1);o!==a&&(s.setAttribute("name",a),this.getArgs(a,!1,!1).add(s))}}});var Et,Sn=b(()=>{"use strict";je();C();Et=class extends ue(T){constructor(){super(...arguments);f(this,"type","hidden")}}});var Lt,$n=b(()=>{"use strict";V();R();A();C();me();Sn();Lt=class extends T{constructor(e,t=h.getConfig(),r=[]){super(void 0,t,r,{});f(this,"type","arg");for(let n=0;n<e.length;n++)if(n===0){let s=new G(e[n],"arg-name",t,r,{});super.insertAt(s)}else if(n>1){let s=new Et(e[n],t,r,{});super.insertAt(s)}else{let s=new T(e[n],t,r);s.type="arg-default",s.setAttribute("stage",2),super.insertAt(s)}}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`{{{${pe(this.childNodes.slice(0,2),"|")}}}}`}getAttribute(e){return e==="padding"?3:super.getAttribute(e)}getGaps(){return 1}lint(e=this.getAbsoluteIndex()){if(!this.getAttribute("include"))return[N(this,{start:e},"unexpected template argument")];let{childNodes:[t,r,...n]}=this,s=t.lint(e+3);if(r&&s.push(...r.lint(e+4+String(t).length)),n.length>0){let o={start:e,...this.getRootNode().posFromIndex(e)};s.push(...n.map(a=>{let d=v(a,o,"invisible content inside triple braces");return{...d,startIndex:d.startIndex-1,startCol:d.startCol-1}}))}return s}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(){return{...super.json(),default:this.default}}}});var wn={};_(wn,{parseBraces:()=>Ar});var Ar,vr=b(()=>{"use strict";V();A();yr();vn();$n();Ar=(l,i=h.getConfig(),e=[])=>{var m,c,x,k,w,q;let t=`${(m=i.excludes)!=null&&m.includes("heading")?"":"^(\0\\d+c\x7F)*={1,6}|"}\\[\\[|\\{{2,}|-\\{(?!\\{)`,{parserFunction:[,,,r]}=i,n=[],s={"=":`
9
- `,"{":"\\}{2,}|\\|","-":"\\}-","[":"\\]\\]"},o=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"]]),a=new RegExp(t,"gmu"),d=a.exec(l),g=l.includes("}}"),p;for(;d||p!==void 0&&p<=l.length&&((x=(c=n[n.length-1])==null?void 0:c[0])!=null&&x.startsWith("="));){if(d!=null&&d[1]){let[,{length:K}]=d;d[0]=d[0].slice(K),d.index+=K}let{0:I,index:$}=d!=null?d:{0:`
10
- `,index:l.length},E=(k=n.pop())!=null?k:{},{0:B,index:L,parts:O,findEqual:M,pos:oe}=E,re=I==="="&&M,tt=K=>{O[O.length-1].push(K.slice(oe,$))};if(I==="]]"||I==="}-")p=$+2;else if(I===`
11
- `){p=$+1;let{pos:K,findEqual:W}=(w=n[n.length-1])!=null?w:{};if(K===void 0||W||Y(l.slice(K,L))!==""){let le=/^(={1,6})(.+)\1((?:\s|\0\d+c\x7F)*)$/u.exec(l.slice(L,$));le&&(l=`${l.slice(0,L)}\0${e.length}h\x7F${l.slice($)}`,p=L+4+String(e.length).length,new Me(le[1].length,le.slice(2),i,e))}}else if(I==="|"||re)p=$+1,tt(l),I==="|"&&O.push([]),E.pos=p,E.findEqual=I==="|",n.push(E);else if(I.startsWith("}}")){let K=I.slice(0,Math.min(B.length,3)),W=B.length-K.length,{length:le}=e;p=$+K.length,tt(l);let rt=!1,Te="t";if(K.length===3){let U=O.map(lr=>lr.join("=")),$e=U.length>1&&Y(U[1]).trim();new Lt(U,i,e),$e&&$e.endsWith(":")&&r.includes($e.slice(0,-1).toLowerCase())&&(Te="s")}else try{new Ct(O[0][0],O.slice(1),i,e);let U=Y(O[0][0]).trim();o.has(U)?Te=o.get(U):/^(?:filepath|(?:full|canonical)urle?):.|^server$/iu.test(U)?Te="m":/^#vardefine:./iu.test(U)&&(Te="c")}catch(U){if(U instanceof SyntaxError&&U.message==="\u975E\u6CD5\u7684\u6A21\u677F\u540D\u79F0")rt=!0;else throw U}rt||(l=`${l.slice(0,L+W)}\0${le}${Te}\x7F${l.slice(p)}`,p=L+W+3+String(le).length,W>1?n.push({0:B.slice(0,W),index:L,pos:L+W,parts:[[]]}):W===1&&l[L-1]==="-"&&n.push({0:"-{",index:L-1,pos:L+1,parts:[[]]}))}else p=$+I.length,I.startsWith("{")&&(d.pos=p,d.parts=[[]]),n.push(..."0"in E?[E]:[],d);g&&(g=l.slice(p).includes("}}"));let ae=n[n.length-1];!g&&((q=ae==null?void 0:ae[0])!=null&&q.startsWith("{"))&&(n.pop(),ae=n[n.length-1]),a=new RegExp(t+(ae?`|${s[ae[0][0]]}${ae.findEqual?"|=":""}`:""),"gmu"),a.lastIndex=p,d=a.exec(l)}return l}});var Cn={};_(Cn,{InputboxToken:()=>Sr});var Sr,Nn=b(()=>{"use strict";vr();A();kr();Sr=class extends lt{constructor(i,e=h.getConfig(),t=[]){let r=Symbol("InputboxToken");t.push(r),i&&(i=Ar(i,e,t)),t.splice(t.indexOf(r),1),super(i,e,t,{})}}});var ze,$r=b(()=>{"use strict";R();je();A();ke();ze=class extends ue(Q){constructor(e,t=!0,r=h.getConfig(),n=[]){super(e,r,n);f(this,"type","comment");f(this,"closed");this.closed=t}getAttribute(e){return e==="padding"?4:super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){return this.closed?[]:[N(this,{start:e},h.msg("unclosed $1","HTML comment"))]}toString(e){return`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"&lt;!--",post:this.closed?"--&gt;":""})}}});var It={};_(It,{NestedToken:()=>wr});var wr,Pt=b(()=>{"use strict";R();A();C();Cr();Ne();$r();wr=class extends T{constructor(e,t,r,n=h.getConfig(),s=[]){var o;e=(o=e==null?void 0:e.replace(t,(a,d,g,p,m)=>{let c=`\0${s.length+1}${d?"e":"c"}\x7F`;if(d)new We(d,g,p,m,n,s);else{let x=a.endsWith("-->");new ze(a.slice(4,x?-3:void 0),x,n,s)}return c}))==null?void 0:o.replace(/(^|\0\d+[ce]\x7F)([^\0]+)(?=$|\0\d+[ce]\x7F)/gu,(a,d,g)=>(new H(g,n,s),`${d}\0${s.length}c\x7F`));super(e,n,s,{});f(this,"type","ext-inner")}lint(e=this.getAbsoluteIndex()){let t;return[...super.lint(e),...this.childNodes.filter(r=>{if(r.type==="ext"||r.type==="comment")return!1;let n=String(r).trim();return n&&!/^<!--.*-->$/su.test(n)}).map(r=>(t!=null||(t={start:e,...this.getRootNode().posFromIndex(e)}),v(r,t,h.msg("invalid content in <$1>",this.name))))]}}});var Le,ie,Ie,ve,Rt=b(()=>{"use strict";R();de();A();C();me();ve=class extends T{constructor(e,t,r=h.getConfig(),n=[],s="|"){super(void 0,r,n,{});y(this,Le,!0);y(this,ie,void 0);y(this,Ie,void 0);if(this.insertAt(new G(e,"link-target",r,n,{})),t!==void 0){let o=new T(t,r,n,{});o.type="link-text",o.setAttribute("stage",10),this.insertAt(o)}S(this,ie,s)}afterBuild(){S(this,Ie,this.getTitle()),u(this,ie).includes("\0")&&S(this,ie,this.buildFromStr(u(this,ie),0))}setAttribute(e,t){e==="bracket"?S(this,Le,!!t):e==="title"?S(this,Ie,t):super.setAttribute(e,t)}toString(e){let t=super.toString(e,u(this,ie));return u(this,Le)?`[[${t}]]`:t}text(){let e=super.text("|");return u(this,Le)?`[[${e}]]`:e}getAttribute(e){return e==="title"?u(this,Ie):e==="padding"?2:super.getAttribute(e)}getGaps(e){return e===0?u(this,ie).length:1}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{childNodes:[r,n],type:s}=this,{encoded:o,fragment:a}=u(this,Ie),d;return s==="link"&&r.childNodes.some(({type:g})=>g==="template")&&(d={start:e,...this.getRootNode().posFromIndex(e)},t.push(v(r,d,"template in an internal link target","warning"))),o&&(d!=null||(d={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(r,d,"unnecessary URL encoding in an internal link"))),s==="link"&&(n!=null&&n.childNodes.some(({type:g,data:p})=>g==="text"&&p.includes("|")))?(d!=null||(d={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(n,d,'additional "|" in the link text',"warning"))):s!=="link"&&a!==void 0&&(d!=null||(d={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(r,d,"useless fragment"))),s==="link"&&this.closest("ext-link-text")&&(d!=null||(d={start:e,...this.getRootNode().posFromIndex(e)}),t.push(N(this,d,"internal link in an external link"))),t}getTitle(){return this.normalizeTitle(this.firstChild.text(),0,!1,!0,!0)}print(){return super.print(u(this,Le)?{pre:"[[",post:"]]",sep:u(this,ie)}:{sep:u(this,ie)})}};Le=new WeakMap,ie=new WeakMap,Ie=new WeakMap});function Fn(l,i,e=h.getConfig(),t=!1){i=i.trim();let r=i.replace(/\0\d+t\x7F/gu,"").trim();switch(l){case"width":return!r||/^(?:\d+x?|\d*x\d+)$/u.test(r);case"link":{if(!r||new RegExp(`^(?:(?:${e.protocol}|//)${xe}|\0\\d+m\x7F)${be}$`,"iu").test(r))return i;r.startsWith("[[")&&r.endsWith("]]")&&(r=r.slice(2,-2));let s=h.normalizeTitle(r,0,!1,e,t,!0,!0);return s.valid&&s}case"lang":return!r||e.variants.includes(r);case"alt":case"class":case"manualthumb":return!0;default:return!Number.isNaN(Number(r))}}var Qi,J,Gt,En=b(()=>{"use strict";V();R();A();C();Qi=new Set(["alt","link","lang","page","caption"]);Gt=class extends T{constructor(e,t=h.getConfig(),r=[]){var i=(...args)=>{super(...args);f(this,"type","image-parameter");y(this,J,"")};var a;let n,s=Object.entries(t.img).map(([d,g])=>[d,g,new RegExp(`^(\\s*)${d.replace("$1","(.*)")}(\\s*)$`,"u")]),o=s.find(([,d,g])=>(n=g.exec(e),n&&(n.length!==4||Fn(d,n[2],t,!0)!==!1)));if(o&&n){n.length===3?(i(void 0,t,r),S(this,J,e)):(i(n[2],t,r,{}),S(this,J,`${n[1]}${o[0]}${n[3]}`)),this.setAttribute("name",o[1]);return}i(e,{...t,excludes:[...(a=t.excludes)!=null?a:[],"list"]},r),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get link(){return this.name==="link"?Fn("link",super.text(),this.getAttribute("config")):void 0}afterBuild(){var e;((e=this.parentNode)==null?void 0:e.type)==="gallery-image"&&!Qi.has(this.name)&&this.setAttribute("name","invalid")}toString(e){return u(this,J)?u(this,J).replace("$1",super.toString(e)):super.toString(e)}text(){return u(this,J)?u(this,J).replace("$1",super.text()).trim():super.text().trim()}getAttribute(e){return e==="plain"?this.name==="caption":e==="padding"?Math.max(0,u(this,J).indexOf("$1")):super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{link:r,name:n}=this;return n==="invalid"?t.push(N(this,{start:e},"invalid gallery image parameter")):typeof r=="object"&&r.encoded&&t.push(N(this,{start:e},"unnecessary URL encoding in an internal link")),t}print(){return u(this,J)?this.name==="invalid"?`<span class="wpb-image-invalid">${u(this,J).replace("$1",ge(this.childNodes))}</span>`:`<span class="wpb-image-parameter">${u(this,J).replace("$1",`<span class="wpb-image-caption">${ge(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}};J=new WeakMap});var Nr,Fr,Er,Xi,_e,jt,Ue,Lr=b(()=>{"use strict";V();R();A();Rt();En();Nr=new Set(["manualthumb","frameless","framed","thumbnail"]),Fr=new Set(["left","right","center","none"]),Er=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),Xi=(l,i,e,t)=>{if(t===void 0)return[];let r=new RegExp(`${[l,i,e].map(Xr).join("|")}`,"gu"),n=[],s=r.exec(t),o=0,a=0;for(;s;){let{0:d,index:g}=s;d!==e?o+=d===l?1:-1:o===0&&(n.push(t.slice(a,g)),{lastIndex:a}=r),s=r.exec(t)}return n.push(t.slice(a)),n},Ue=class extends ve{constructor(e,t,r=h.getConfig(),n=[],s="|"){super(e,void 0,r,n,s);y(this,_e);f(this,"type","file");this.append(...Xi("-{","}-","|",t).map(o=>new Gt(o,r,n)))}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),r=this.getAllArgs().filter(({childNodes:p})=>{let m=p.filter(c=>c.text().trim());return m.length!==1||m[0].type!=="arg"}),n=[...new Set(r.map(({name:p})=>p))].filter(p=>p!=="invalid"),s=n.filter(p=>Nr.has(p)),o=n.filter(p=>Fr.has(p)),a=n.filter(p=>Er.has(p));if(r.length===n.length&&s.length<2&&o.length<2&&a.length<2)return t;let d={start:e,...this.getRootNode().posFromIndex(e)},g=(p,m)=>c=>v(c,d,h.msg(`${p} image $1 parameter`,m));for(let p of n){let m=r.filter(({name:c})=>c===p);p==="caption"&&(m=[...m.slice(0,-1).filter(c=>c.text()),...m.slice(-1)]),m.length>1&&t.push(...m.map(g("duplicated",p)))}return s.length>1&&t.push(...r.filter(({name:p})=>Nr.has(p)).map(g("conflicting","frame"))),o.length>1&&t.push(...r.filter(({name:p})=>Fr.has(p)).map(g("conflicting","horizontal-alignment"))),a.length>1&&t.push(...r.filter(({name:p})=>Er.has(p)).map(g("conflicting","vertical-alignment"))),t}getAllArgs(){return this.childNodes.slice(1)}getArgs(e){return this.getAllArgs().filter(({name:t})=>e===t)}getFrameArgs(){return F(this,_e,jt).call(this,Nr,"\u6846\u67B6")}getHorizAlignArgs(){return F(this,_e,jt).call(this,Fr,"\u6C34\u5E73\u5BF9\u9F50")}getVertAlignArgs(){return F(this,_e,jt).call(this,Er,"\u5782\u76F4\u5BF9\u9F50")}};_e=new WeakSet,jt=function(e,t){return this.getAllArgs().filter(({name:n})=>e.has(n))}});var qt,Ln,De,Ir=b(()=>{"use strict";R();de();A();C();Lr();De=class extends Ue{constructor(e,t,r,n=h.getConfig(),s=[]){let o;if(r!==void 0){o=new T(r,n,s),o.type="plain";for(let a=1;a<11;a++)o.parseOnce();s.splice(s.indexOf(o),1)}super(t,o==null?void 0:o.toString(),n,s);y(this,qt);this.setAttribute("bracket",!1),this.type=`${e}-image`}getTitle(){let e=this.type==="imagemap-image";return this.normalizeTitle(String(this.firstChild),e?0:6,!0,!e)}getAttribute(e){return e==="padding"?0:super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{ns:r}=this.getAttribute("title");return r!==6&&t.push(N(this,{start:e},"invalid gallery image")),t}afterBuild(){F(this,qt,Ln).call(this,this.getTitle())}};qt=new WeakSet,Ln=function(e){this.setAttribute("title",e)}});var Pn={};_(Pn,{GalleryToken:()=>Pr});var Bt,In,Pr,Rn=b(()=>{"use strict";A();C();Ir();Ne();Pr=class extends T{constructor(e,t=h.getConfig(),r=[]){var n;super(void 0,t,r,{});y(this,Bt);f(this,"type","ext-inner");for(let s of(n=e==null?void 0:e.split(`
12
- `))!=null?n:[]){let o=/^([^|]+)(?:\|(.*))?/u.exec(s);if(!o){super.insertAt(s.trim()?new H(s,t):s);continue}let[,a,d]=o;F(this,Bt,In).call(this,a)?super.insertAt(new De("gallery",a,d,t,r)):super.insertAt(new H(s,t))}}toString(e){return super.toString(e,`
7
+ `)}getGaps(){return 1}lint(e=this.getAbsoluteIndex()){let t;return this.childNodes.filter(r=>{let{childNodes:n}=r,s=n.findIndex(({type:o})=>o!=="text"),a=(s>=0?n.slice(0,s).map(String).join(""):String(r)).trim();return a&&!(s>=0?/^[a-z]+(?:\[\])?\s*(?:=|$)/iu:/^[a-z]+(?:\[\])?\s*=/iu).test(a)}).map(r=>(t!=null||(t={start:e,...this.getRootNode().posFromIndex(e)}),v(r,t,m.msg("invalid parameter of $1",this.name))))}print(){return super.print({sep:`
8
+ `})}}});var he,dt=b(()=>{"use strict";A();F();he=class extends x{constructor(i,e,t="plain",r=m.getConfig(),n=[],s){super(i,r,n,s),this.type=t}lint(){return[]}}});var pt,Oe,wt,Me,vr=b(()=>{"use strict";P();A();F();dt();Me=class extends x{constructor(e,t,r=m.getConfig(),n=[]){super(void 0,r,n);k(this,Oe);f(this,"type","heading");k(this,pt,void 0);S(this,pt,e);let s=new x(t[0],r,n);s.type="heading-title",s.setAttribute("stage",2);let a=new he(t[1],/^[^\S\n]*$/u,"heading-trail",r,n,{});this.append(s,a)}get level(){return u(this,pt)}toString(e){let t=u(this,Oe,wt);return`${t}${this.firstChild.toString()}${t}${this.lastChild.toString()}`}text(){let e=u(this,Oe,wt);return`${e}${this.firstChild.text()}${e}`}getAttribute(e){return e==="padding"?super.getAttribute("padding")+this.level:super.getAttribute(e)}getGaps(){return this.level}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{firstChild:r,level:n}=this,s=String(r),a=r.childNodes.filter(p=>p.type==="quote"),o=a.filter(({bold:p})=>p),d=a.filter(({italic:p})=>p),g;return this.level===1&&(g={start:e,...this.getRootNode().posFromIndex(e)},t.push(v(r,g,"<h1>"))),(s.startsWith("=")||s.endsWith("="))&&(g!=null||(g={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(r,g,m.msg("unbalanced $1 in a section header",'"="')))),this.closest("html-attrs, table-attrs")&&(g!=null||(g={start:e,...this.getRootNode().posFromIndex(e)}),t.push($(this,g,"section header in a HTML tag"))),o.length%2&&(g!=null||(g={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(o[o.length-1],{...g,start:e+n,left:g.left+n},m.msg("unbalanced $1 in a section header","bold apostrophes")))),d.length%2&&(g!=null||(g={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(d[d.length-1],{start:e+n},m.msg("unbalanced $1 in a section header","italic apostrophes")))),t}print(){let e=u(this,Oe,wt);return super.print({pre:e,sep:e})}json(){return{...super.json(),level:this.level}}};pt=new WeakMap,Oe=new WeakSet,wt=function(){return"=".repeat(this.level)}});var Ki,Ct,vn=b(()=>{"use strict";Z();P();A();F();Ki=l=>l.toString(new Set(["comment","noinclude","include"])).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),Ct=class extends x{constructor(e,t,r=m.getConfig(),n=[]){super(void 0,r,n);f(this,"type","parameter");let s=new x(typeof e=="number"?void 0:e,r,n,{}),a=new x(t,r,n);s.type="parameter-key",a.type="parameter-value",a.setAttribute("stage",2),this.append(s,a)}get anon(){return this.firstChild.length===0}afterBuild(){if(!this.anon){let{parentNode:e,firstChild:t}=this,r=Ki(t);this.setAttribute("name",r),e&&e.getArgs(r,!1,!1).add(this)}}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()){var s;let t=super.lint(e),{firstChild:r}=this,n=(s=new RegExp(`https?://${xe}${be}$`,"iu").exec(r.toString(new Set(["comment","noinclude","include"]))))==null?void 0:s[0];if(n&&new URL(n).search){let a=v(r,{start:e},"unescaped query string in an anonymous parameter");t.push({...a,startIndex:a.endIndex,endIndex:a.endIndex+1,startLine:a.endLine,startCol:a.endCol,endCol:a.endCol+1})}return t}print(){return super.print({sep:this.anon?"":"="})}json(){return{...super.json(),anon:this.anon}}}});var Ji,Fe,Ee,Ft,Sn,Et,$n,Nt,wn=b(()=>{"use strict";Z();P();Ce();de();A();F();vn();me();dt();Ji=new Set(["pageid","articlepath","server","servername","scriptpath","stylepath"]),Nt=class extends x{constructor(e,t,r=m.getConfig(),n=[]){var h,c;super(void 0,r,n,{});k(this,Ft);k(this,Et);f(this,"type","template");f(this,"modifier","");k(this,Fe,!1);k(this,Ee,new Map);let{parserFunction:[s,a]}=r,o=(h=/^(?:\s|\0\d+c\x7F)*\0\d+s\x7F/u.exec(e))==null?void 0:h[0];if(o)this.setAttribute("modifier",o),e=e.slice(o.length);else if(e.includes(":")){let[T,...y]=e.split(":"),[N]=/^(?:\s|\0\d+c\x7F)*/u.exec((c=y[0])!=null?c:"");this.setModifier(`${T}:${N}`)&&(e=y.join(":").slice(N.length))}let d=e.includes(":");if(d||t.length===0&&!u(this,Fe)){let[T,...y]=e.split(":"),N=Y(T),q=N[y.length>0?"trimStart":"trim"](),I=q.toLowerCase(),C=s[I],E=a.includes(q);if(E||Ji.has(C)||d&&C){this.setAttribute("name",C!=null?C:I),this.type="magic-word";let L=new RegExp(`^\\s*${q}\\s*$`,E?"u":"iu"),O=new he(T,L,"magic-word-name",r,n,{});if(super.insertAt(O),y.length>0&&t.unshift([y.join(":")]),this.name==="invoke")for(let M=0;M<2;M++){let oe=t.shift();if(!oe)break;let re=new G(oe.join("="),`invoke-${M?"function":"module"}`,r,n);super.insertAt(re)}}}if(this.type==="template"){let T=Y(ft(e)).split("#")[0].trim();if(!T||/^:[\s_]*:|\0\d+[eh!+-]\x7F|[<>[\]{}\n]|%[\da-f]{2}/iu.test(T))throw n.pop(),new SyntaxError("\u975E\u6CD5\u7684\u6A21\u677F\u540D\u79F0");let y=new G(e,"template-name",r,n,{});super.insertAt(y)}let g=this.isTemplate(),p=1;for(let T=0;T<t.length;T++){let y=t[T];!g&&!(this.name==="switch"&&T>0)&&(y[0]=y.join("="),y.length=1),y.length===1&&(y.unshift(p),p++),this.insertAt(new Ct(...y,r,n))}}setModifier(e){let{parserFunction:[,,t,r]}=this.getAttribute("config"),n=Y(e).trim();if(e&&!n.endsWith(":"))return!1;let s=n.slice(0,-1).toLowerCase(),a=t.includes(s),o=r.includes(s);return u(this,Fe)&&a||!u(this,Fe)&&(o||e==="")||this.length>1&&(a||o||e==="")?(this.setAttribute("modifier",e),S(this,Fe,a),!!e):!1}isTemplate(){return this.type==="template"||this.name==="invoke"}afterBuild(){this.modifier.includes("\0")&&this.setAttribute("modifier",this.buildFromStr(this.modifier,0))}toString(e){return`{{${this.modifier}${this.type==="magic-word"?`${this.firstChild.toString(e)}${this.length===1?"":":"}${this.childNodes.slice(1).map(t=>t.toString(e)).join("|")}`:super.toString(e,"|")}}}`}text(){let{childNodes:e,length:t,firstChild:r,modifier:n,type:s,name:a}=this;return s==="magic-word"&&a==="vardefine"?"":`{{${n}${s==="magic-word"?`${r.text()}${t===1?"":":"}${pe(e.slice(1),"|")}`:super.text("|")}}}`}getAttribute(e){switch(e){case"padding":return this.modifier.length+2;default:return super.getAttribute(e)}}getGaps(){return 1}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{type:r,childNodes:n,length:s}=this,a;if(!this.isTemplate())return t;let o=w(this,Ft,Sn).call(this);if(o.fragment!==void 0&&(a={start:e,...this.getRootNode().posFromIndex(e)},t.push(v(n[r==="template"?0:1],a,"useless fragment"))),o.valid||(a!=null||(a={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(n[1],a,"illegal module name"))),r==="magic-word"&&s===2)return a!=null||(a={start:e,...this.getRootNode().posFromIndex(e)}),t.push($(this,a,"missing module function")),t;let d=this.getDuplicatedArgs();return d.length>0&&(a!=null||(a={start:e,...this.getRootNode().posFromIndex(e)}),t.push(...d.flatMap(([,g])=>g).map(g=>v(g,a,"duplicated parameter")))),t}insertAt(e,t=this.length){return super.insertAt(e,t),e.anon?w(this,Et,$n).call(this,e):e.name&&this.getArgs(e.name,!1,!1).add(e),e}getAllArgs(){return this.childNodes.filter(we("parameter"))}getAnonArgs(){return this.getAllArgs().filter(({anon:e})=>e)}getArgs(e,t=!1,r=!0){let n=String(e).replace(/^[ \t\n\0\v]+|([^ \t\n\0\v])[ \t\n\0\v]+$/gu,"$1"),s;return u(this,Ee).has(n)?s=u(this,Ee).get(n):(s=new Set(this.getAllArgs().filter(({name:a})=>n===a)),u(this,Ee).set(n,s)),s}getDuplicatedArgs(){return this.isTemplate()?[...u(this,Ee)].filter(([,{size:e}])=>e>1).map(([e,t])=>[e,[...t]]):[]}getPossibleValues(){let{type:e,name:t,childNodes:r,constructor:{name:n}}=this;if(e==="template")throw new Error(`${n}.getPossibleValues \u65B9\u6CD5\u4EC5\u4F9B\u7279\u5B9A\u9B54\u672F\u5B57\u4F7F\u7528\uFF01`);let s;switch(t){case"if":case"ifexist":case"ifexpr":case"iferror":s=2;break;case"ifeq":s=3;break;default:throw new Error(`${n}.getPossibleValues \u65B9\u6CD5\u4EC5\u4F9B\u7279\u5B9A\u9B54\u672F\u5B57\u4F7F\u7528\uFF01`)}let a=r.slice(s,s+2).map(({childNodes:[,o]})=>o);for(let o=0;o<a.length;){let{length:d,0:g}=a[o].childNodes.filter(p=>p.text().trim());if(d===0)a.splice(o,1);else if(d>1||g.type!=="magic-word")o++;else try{let p=g.getPossibleValues();a.splice(o,1,...p),o+=p.length}catch(p){o++}}return a}print(){let{childNodes:e,length:t,firstChild:r,modifier:n,type:s}=this;return`<span class="wpb-${s}">{{${n}${s==="magic-word"?`${r.print()}${t===1?"":":"}${ge(e.slice(1),{sep:"|"})}`:ge(e,{sep:"|"})}}}</span>`}json(){return{...super.json(),modifier:this.modifier||void 0}}};Fe=new WeakMap,Ee=new WeakMap,Ft=new WeakSet,Sn=function(){let e=this.type==="template",t=this.childNodes[e?0:1];return this.normalizeTitle(t.text(),e?10:828)},Et=new WeakSet,$n=function(e){let t=this.getAnonArgs(),r=typeof e!="number";for(let n=r?t.indexOf(e):e-1;n<t.length;n++){let s=t[n],{name:a}=s,o=String(n+1);a!==o&&(s.setAttribute("name",o),this.getArgs(o,!1,!1).add(s))}}});var Lt,Cn=b(()=>{"use strict";je();F();Lt=class extends ue(x){constructor(){super(...arguments);f(this,"type","hidden")}}});var It,Nn=b(()=>{"use strict";Z();P();A();F();me();Cn();It=class extends x{constructor(e,t=m.getConfig(),r=[]){super(void 0,t,r,{});f(this,"type","arg");for(let n=0;n<e.length;n++)if(n===0){let s=new G(e[n],"arg-name",t,r,{});super.insertAt(s)}else if(n>1){let s=new Lt(e[n],t,r,{});super.insertAt(s)}else{let s=new x(e[n],t,r);s.type="arg-default",s.setAttribute("stage",2),super.insertAt(s)}}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`{{{${pe(this.childNodes.slice(0,2),"|")}}}}`}getAttribute(e){return e==="padding"?3:super.getAttribute(e)}getGaps(){return 1}lint(e=this.getAbsoluteIndex()){if(!this.getAttribute("include"))return[$(this,{start:e},"unexpected template argument")];let{childNodes:[t,r,...n]}=this,s=t.lint(e+3);if(r&&s.push(...r.lint(e+4+String(t).length)),n.length>0){let a={start:e,...this.getRootNode().posFromIndex(e)};s.push(...n.map(o=>{let d=v(o,a,"invisible content inside triple braces");return{...d,startIndex:d.startIndex-1,startCol:d.startCol-1}}))}return s}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}json(){return{...super.json(),default:this.default}}}});var Fn={};_(Fn,{parseBraces:()=>Sr});var Sr,$r=b(()=>{"use strict";Z();A();vr();wn();Nn();Sr=(l,i=m.getConfig(),e=[])=>{var h,c,T,y,N,q;let t=`${(h=i.excludes)!=null&&h.includes("heading")?"":"^(\0\\d+c\x7F)*={1,6}|"}\\[\\[|\\{{2,}|-\\{(?!\\{)`,{parserFunction:[,,,r]}=i,n=[],s={"=":`
9
+ `,"{":"\\}{2,}|\\|","-":"\\}-","[":"\\]\\]"},a=new Map([["!","!"],["!!","+"],["(!","{"],["!)","}"],["!-","-"],["=","~"]]),o=new RegExp(t,"gmu"),d=o.exec(l),g=l.includes("}}"),p;for(;d||p!==void 0&&p<=l.length&&((T=(c=n[n.length-1])==null?void 0:c[0])!=null&&T.startsWith("="));){if(d!=null&&d[1]){let[,{length:J}]=d;d[0]=d[0].slice(J),d.index+=J}let{0:I,index:C}=d!=null?d:{0:`
10
+ `,index:l.length},E=(y=n.pop())!=null?y:{},{0:B,index:L,parts:O,findEqual:M,pos:oe}=E,re=I==="="&&M,tt=J=>{O[O.length-1].push(J.slice(oe,C))};if(I==="]]"||I==="}-")p=C+2;else if(I===`
11
+ `){p=C+1;let{pos:J,findEqual:W}=(N=n[n.length-1])!=null?N:{};if(J===void 0||W||Y(l.slice(J,L))!==""){let le=/^(={1,6})(.+)\1((?:\s|\0\d+c\x7F)*)$/u.exec(l.slice(L,C));le&&(l=`${l.slice(0,L)}\0${e.length}h\x7F${l.slice(C)}`,p=L+4+String(e.length).length,new Me(le[1].length,le.slice(2),i,e))}}else if(I==="|"||re)p=C+1,tt(l),I==="|"&&O.push([]),E.pos=p,E.findEqual=I==="|",n.push(E);else if(I.startsWith("}}")){let J=I.slice(0,Math.min(B.length,3)),W=B.length-J.length,{length:le}=e;p=C+J.length,tt(l);let rt=!1,Te="t";if(J.length===3){let H=O.map(pr=>pr.join("=")),$e=H.length>1&&Y(H[1]).trim();new It(H,i,e),$e&&$e.endsWith(":")&&r.includes($e.slice(0,-1).toLowerCase())&&(Te="s")}else try{new Nt(O[0][0],O.slice(1),i,e);let H=Y(O[0][0]).trim();a.has(H)?Te=a.get(H):/^(?:filepath|(?:full|canonical)urle?):.|^server$/iu.test(H)?Te="m":/^#vardefine:./iu.test(H)&&(Te="c")}catch(H){if(H instanceof SyntaxError&&H.message==="\u975E\u6CD5\u7684\u6A21\u677F\u540D\u79F0")rt=!0;else throw H}rt||(l=`${l.slice(0,L+W)}\0${le}${Te}\x7F${l.slice(p)}`,p=L+W+3+String(le).length,W>1?n.push({0:B.slice(0,W),index:L,pos:L+W,parts:[[]]}):W===1&&l[L-1]==="-"&&n.push({0:"-{",index:L-1,pos:L+1,parts:[[]]}))}else p=C+I.length,I.startsWith("{")&&(d.pos=p,d.parts=[[]]),n.push(..."0"in E?[E]:[],d);g&&(g=l.slice(p).includes("}}"));let ae=n[n.length-1];!g&&((q=ae==null?void 0:ae[0])!=null&&q.startsWith("{"))&&(n.pop(),ae=n[n.length-1]),o=new RegExp(t+(ae?`|${s[ae[0][0]]}${ae.findEqual?"|=":""}`:""),"gmu"),o.lastIndex=p,d=o.exec(l)}return l}});var En={};_(En,{InputboxToken:()=>wr});var wr,Ln=b(()=>{"use strict";$r();A();Ar();wr=class extends lt{constructor(i,e=m.getConfig(),t=[]){let r=Symbol("InputboxToken");t.push(r),i&&(i=Sr(i,e,t)),t.splice(t.indexOf(r),1),super(i,e,t,{})}}});var ze,Cr=b(()=>{"use strict";P();je();A();ke();ze=class extends ue(Q){constructor(e,t=!0,r=m.getConfig(),n=[]){super(e,r,n);f(this,"type","comment");f(this,"closed");this.closed=t}getAttribute(e){return e==="padding"?4:super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){return this.closed?[]:[$(this,{start:e},m.msg("unclosed $1","HTML comment"))]}toString(e){return`<!--${this.innerText}${this.closed?"-->":""}`}print(){return super.print({pre:"&lt;!--",post:this.closed?"--&gt;":""})}}});var Pt={};_(Pt,{NestedToken:()=>Nr});var Nr,Rt=b(()=>{"use strict";P();A();F();Fr();Ne();Cr();Nr=class extends x{constructor(e,t,r,n=m.getConfig(),s=[]){var a;e=(a=e==null?void 0:e.replace(t,(o,d,g,p,h)=>{let c=`\0${s.length+1}${d?"e":"c"}\x7F`;if(d)new We(d,g,p,h,n,s);else{let T=o.endsWith("-->");new ze(o.slice(4,T?-3:void 0),T,n,s)}return c}))==null?void 0:a.replace(/(^|\0\d+[ce]\x7F)([^\0]+)(?=$|\0\d+[ce]\x7F)/gu,(o,d,g)=>(new D(g,n,s),`${d}\0${s.length}c\x7F`));super(e,n,s,{});f(this,"type","ext-inner")}lint(e=this.getAbsoluteIndex()){let t;return[...super.lint(e),...this.childNodes.filter(r=>{if(r.type==="ext"||r.type==="comment")return!1;let n=String(r).trim();return n&&!/^<!--.*-->$/su.test(n)}).map(r=>(t!=null||(t={start:e,...this.getRootNode().posFromIndex(e)}),v(r,t,m.msg("invalid content in <$1>",this.name))))]}}});var Le,ie,Ie,ve,Gt=b(()=>{"use strict";P();de();A();F();me();ve=class extends x{constructor(e,t,r=m.getConfig(),n=[],s="|"){super(void 0,r,n,{});k(this,Le,!0);k(this,ie,void 0);k(this,Ie,void 0);if(this.insertAt(new G(e,"link-target",r,n,{})),t!==void 0){let a=new x(t,r,n,{});a.type="link-text",a.setAttribute("stage",10),this.insertAt(a)}S(this,ie,s)}afterBuild(){S(this,Ie,this.getTitle()),u(this,ie).includes("\0")&&S(this,ie,this.buildFromStr(u(this,ie),0))}setAttribute(e,t){e==="bracket"?S(this,Le,!!t):e==="title"?S(this,Ie,t):super.setAttribute(e,t)}toString(e){let t=super.toString(e,u(this,ie));return u(this,Le)?`[[${t}]]`:t}text(){let e=super.text("|");return u(this,Le)?`[[${e}]]`:e}getAttribute(e){return e==="title"?u(this,Ie):e==="padding"?2:super.getAttribute(e)}getGaps(e){return e===0?u(this,ie).length:1}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{childNodes:[r,n],type:s}=this,{encoded:a,fragment:o}=u(this,Ie),d;return r.childNodes.some(({type:g})=>g==="template")&&(d={start:e,...this.getRootNode().posFromIndex(e)},t.push(v(r,d,"template in an internal link target","warning"))),a&&(d!=null||(d={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(r,d,"unnecessary URL encoding in an internal link"))),(s==="link"||s==="category")&&(n!=null&&n.childNodes.some(({type:g,data:p})=>g==="text"&&p.includes("|")))?(d!=null||(d={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(n,d,'additional "|" in the link text',"warning"))):s!=="link"&&o!==void 0&&(d!=null||(d={start:e,...this.getRootNode().posFromIndex(e)}),t.push(v(r,d,"useless fragment"))),t}getTitle(){return this.normalizeTitle(this.firstChild.text(),0,!1,!0,!0)}print(){return super.print(u(this,Le)?{pre:"[[",post:"]]",sep:u(this,ie)}:{sep:u(this,ie)})}};Le=new WeakMap,ie=new WeakMap,Ie=new WeakMap});function In(l,i,e=m.getConfig(),t=!1){i=i.trim();let r=i.replace(/\0\d+t\x7F/gu,"").trim();switch(l){case"width":return!r||/^(?:\d+x?|\d*x\d+)$/u.test(r);case"link":{if(!r||new RegExp(`^(?:(?:${e.protocol}|//)${xe}|\0\\d+m\x7F)${be}$`,"iu").test(r))return i;r.startsWith("[[")&&r.endsWith("]]")&&(r=r.slice(2,-2));let s=m.normalizeTitle(r,0,!1,e,t,!0,!0);return s.valid&&s}case"lang":return!r||e.variants.includes(r);case"alt":case"class":case"manualthumb":return!0;default:return!Number.isNaN(Number(r))}}var Yi,K,qt,Pn,jt,Rn=b(()=>{"use strict";Z();P();A();F();Yi=new Set(["alt","link","lang","page","caption"]);jt=class extends x{constructor(e,t=m.getConfig(),r=[]){var i=(...args)=>{super(...args);k(this,qt);f(this,"type","image-parameter");k(this,K,"")};var o;let n,s=Object.entries(t.img).map(([d,g])=>[d,g,new RegExp(`^(\\s*)${d.replace("$1","(.*)")}(\\s*)$`,"u")]),a=s.find(([,d,g])=>(n=g.exec(e),n&&(n.length!==4||In(d,n[2],t,!0)!==!1)));if(a&&n){n.length===3?(i(void 0,t,r),S(this,K,e)):(i(n[2],t,r,{}),S(this,K,`${n[1]}${a[0]}${n[3]}`)),this.setAttribute("name",a[1]);return}i(e,{...t,excludes:[...(o=t.excludes)!=null?o:[],"list"]},r),this.setAttribute("name","caption"),this.setAttribute("stage",7)}get link(){return this.name==="link"?In("link",super.text(),this.getAttribute("config")):void 0}afterBuild(){var e;((e=this.parentNode)==null?void 0:e.type)==="gallery-image"&&!Yi.has(this.name)&&this.setAttribute("name","invalid")}toString(e){return u(this,K)?u(this,K).replace("$1",super.toString(e)):super.toString(e)}text(){return u(this,K)?u(this,K).replace("$1",super.text()).trim():super.text().trim()}getAttribute(e){return e==="plain"?this.name==="caption":e==="padding"?Math.max(0,u(this,K).indexOf("$1")):super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{link:r,name:n}=this;return n==="invalid"?t.push($(this,{start:e},"invalid gallery image parameter")):typeof r=="object"&&r.encoded&&t.push($(this,{start:e},"unnecessary URL encoding in an internal link")),t}getValue(){return this.name==="invalid"?this.text():w(this,qt,Pn).call(this)||super.text()}print(){return u(this,K)?this.name==="invalid"?`<span class="wpb-image-invalid">${u(this,K).replace("$1",ge(this.childNodes))}</span>`:`<span class="wpb-image-parameter">${u(this,K).replace("$1",`<span class="wpb-image-caption">${ge(this.childNodes)}</span>`)}</span>`:super.print({class:"image-caption"})}};K=new WeakMap,qt=new WeakSet,Pn=function(){return u(this,K)&&!u(this,K).includes("$1")}});var Er,Lr,Ir,es,_e,Bt,He,Pr=b(()=>{"use strict";Z();P();A();Gt();Rn();Er=new Set(["manualthumb","frameless","framed","thumbnail"]),Lr=new Set(["left","right","center","none"]),Ir=new Set(["baseline","sub","super","top","text-top","middle","bottom","text-bottom"]),es=(l,i,e,t)=>{if(t===void 0)return[];let r=new RegExp(`${[l,i,e].map(Jr).join("|")}`,"gu"),n=[],s=r.exec(t),a=0,o=0;for(;s;){let{0:d,index:g}=s;d!==e?a+=d===l?1:-1:a===0&&(n.push(t.slice(o,g)),{lastIndex:o}=r),s=r.exec(t)}return n.push(t.slice(o)),n},He=class extends ve{constructor(e,t,r=m.getConfig(),n=[],s="|"){super(e,void 0,r,n,s);k(this,_e);f(this,"type","file");this.append(...es("-{","}-","|",t).map(a=>new jt(a,r,n)))}lint(e=this.getAbsoluteIndex()){var p;let t=super.lint(e),r=this.getAllArgs().filter(({childNodes:h})=>{let c=h.filter(T=>T.text().trim());return c.length!==1||c[0].type!=="arg"}),n=[...new Set(r.map(({name:h})=>h))].filter(h=>h!=="invalid"),s=n.filter(h=>Er.has(h)),a=n.filter(h=>Lr.has(h)),o=n.filter(h=>Ir.has(h));if(this.closest("ext-link-text")&&((p=this.getValue("link"))==null?void 0:p.trim())!==""&&t.push($(this,{start:e},"internal link in an external link")),r.length===n.length&&s.length<2&&a.length<2&&o.length<2)return t;let d={start:e,...this.getRootNode().posFromIndex(e)},g=(h,c)=>T=>v(T,d,m.msg(`${h} image $1 parameter`,c));for(let h of n){let c=r.filter(({name:T})=>T===h);h==="caption"&&(c=[...c.slice(0,-1).filter(T=>T.text()),...c.slice(-1)]),c.length>1&&t.push(...c.map(g("duplicated",h)))}return s.length>1&&t.push(...r.filter(({name:h})=>Er.has(h)).map(g("conflicting","frame"))),a.length>1&&t.push(...r.filter(({name:h})=>Lr.has(h)).map(g("conflicting","horizontal-alignment"))),o.length>1&&t.push(...r.filter(({name:h})=>Ir.has(h)).map(g("conflicting","vertical-alignment"))),t}getAllArgs(){return this.childNodes.slice(1)}getArgs(e){return this.getAllArgs().filter(({name:t})=>e===t)}getFrameArgs(){return w(this,_e,Bt).call(this,Er,"\u6846\u67B6")}getHorizAlignArgs(){return w(this,_e,Bt).call(this,Lr,"\u6C34\u5E73\u5BF9\u9F50")}getVertAlignArgs(){return w(this,_e,Bt).call(this,Ir,"\u5782\u76F4\u5BF9\u9F50")}getArg(e){let t=this.getArgs(e);return t[t.length-1]}getValue(e){var t;return(t=this.getArg(e))==null?void 0:t.getValue()}};_e=new WeakSet,Bt=function(e,t){return this.getAllArgs().filter(({name:n})=>e.has(n))}});var Ot,Gn,Ue,Rr=b(()=>{"use strict";P();de();A();F();Pr();Ue=class extends He{constructor(e,t,r,n=m.getConfig(),s=[]){let a;if(r!==void 0){a=new x(r,n,s),a.type="plain";for(let o=1;o<11;o++)a.parseOnce();s.splice(s.indexOf(a),1)}super(t,a==null?void 0:a.toString(),n,s);k(this,Ot);this.setAttribute("bracket",!1),this.type=`${e}-image`}getTitle(){let e=this.type==="imagemap-image";return this.normalizeTitle(String(this.firstChild),e?0:6,!0,!e)}getAttribute(e){return e==="padding"?0:super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),{ns:r}=this.getAttribute("title");return r!==6&&t.push($(this,{start:e},"invalid gallery image")),t}afterBuild(){w(this,Ot,Gn).call(this,this.getTitle())}};Ot=new WeakSet,Gn=function(e){this.setAttribute("title",e)}});var qn={};_(qn,{GalleryToken:()=>Gr});var Mt,jn,Gr,Bn=b(()=>{"use strict";A();F();Rr();Ne();Gr=class extends x{constructor(e,t=m.getConfig(),r=[]){var n;super(void 0,t,r,{});k(this,Mt);f(this,"type","ext-inner");for(let s of(n=e==null?void 0:e.split(`
12
+ `))!=null?n:[]){let a=/^([^|]+)(?:\|(.*))?/u.exec(s);if(!a){super.insertAt(s.trim()?new D(s,t):s);continue}let[,o,d]=a;w(this,Mt,jn).call(this,o)?super.insertAt(new Ue("gallery",o,d,t,r)):super.insertAt(new D(s,t))}}toString(e){return super.toString(e,`
13
13
  `)}text(){return super.text(`
14
14
  `).replace(/\n\s*\n/gu,`
15
- `)}getGaps(){return 1}lint(e=this.getAbsoluteIndex()){let{top:t,left:r}=this.getRootNode().posFromIndex(e),n=[];for(let s=0;s<this.length;s++){let o=this.childNodes[s],a=String(o),{length:d}=a,g=a.trim(),p=t+s,m=s?0:r;o.type==="noinclude"&&g&&!/^<!--.*-->$/u.test(g)?n.push({message:h.msg("invalid content in <$1>","gallery"),severity:"error",startIndex:e,endIndex:e+d,startLine:p,endLine:p,startCol:m,endCol:m+d}):o.type!=="noinclude"&&o.type!=="text"&&n.push(...o.lint(e)),e+=d+1}return n}print(){return super.print({sep:`
16
- `})}};Bt=new WeakSet,In=function(e){return this.normalizeTitle(e,6,!0,!0).valid}});var He,Rr=b(()=>{"use strict";Rt();He=class extends ve{constructor(){super(...arguments);f(this,"type","link")}}});var Gn,jn=b(()=>{"use strict";Gn=l=>{class i extends l{}return i}});var Ze,Gr=b(()=>{"use strict";R();A();C();Ze=class extends T{constructor(i,e=!1,t=h.getConfig(),r=[]){super(i,t,r,{}),this.type=e?"ext-link-url":"free-ext-link"}lint(i=this.getAbsoluteIndex()){let e=super.lint(i),t=`[\uFF0C\uFF1B\u3002\uFF1A\uFF01\uFF1F\uFF08\uFF09]+${this.type==="ext-link-url"?"|\\|+":""}`,r=new RegExp(t,"u"),n=new RegExp(t,"gu"),s;for(let o of this.childNodes){let{type:a,data:d}=o;if(a!=="text"||!r.test(d))continue;s!=null||(s={start:i,...this.getRootNode().posFromIndex(i)});let g=v(o,s,"","warning");n.lastIndex=0;for(let p=n.exec(d);p;p=n.exec(d)){let{index:m,0:c}=p,x=d.slice(0,m).split(`
17
- `),{length:k}=x,{length:w}=x[x.length-1],q=g.startIndex+m,I=g.startLine+k-1,$=k===1?g.startCol+w:w;e.push({...g,message:h.msg("$1 in URL",c.startsWith("|")?'"|"':h.msg("full-width punctuation")),startIndex:q,endIndex:q+c.length,startLine:I,endLine:I,startCol:$,endCol:$+c.length})}}return e}}});var ce,Ve,jr=b(()=>{"use strict";de();jn();A();C();Gr();Ve=class extends Gn(T){constructor(e,t="",r="",n=h.getConfig(),s=[]){super(void 0,n,s,{});f(this,"type","ext-link");y(this,ce,void 0);if(this.insertAt(new Ze(e,!0,n,s)),S(this,ce,t),r){let o=new T(r,n,s,{});o.type="ext-link-text",o.setAttribute("stage",10),this.insertAt(o)}}toString(e){return this.length===1?`[${super.toString(e)}${u(this,ce)}]`:`[${super.toString(e,u(this,ce))}]`}text(){return`[${super.text(" ")}]`}getAttribute(e){return e==="padding"?1:super.getAttribute(e)}getGaps(){return u(this,ce).length}print(){return super.print(this.length===1?{pre:"[",post:`${u(this,ce)}]`}:{pre:"[",sep:u(this,ce),post:"]"})}};ce=new WeakMap});var gt,qn=b(()=>{"use strict";A();C();Ne();Rr();jr();gt=class extends T{constructor(e,t,r,n=h.getConfig(),s=[]){super(void 0,n,s);f(this,"type","imagemap-link");this.append(e,t.length===2?new He(...t,n,s):new Ve(...t,n,s),new H(r,n,s))}}});var Bn={};_(Bn,{ImagemapToken:()=>qr});var qr,On=b(()=>{"use strict";R();Ce();A();C();Ne();Ir();qn();qr=class extends T{constructor(e,t=h.getConfig(),r=[]){super(void 0,t,r,{});f(this,"type","ext-inner");if(!e)return;let n=e.split(`
18
- `),s=new Set(t.protocol.split("|")),o=H,a=!0,d=!1;for(let g of n){let p=g.trim();if(!(d||!p||p.startsWith("#"))){if(a){let[m,...c]=g.split("|"),x=this.normalizeTitle(m,0,!0);if(x.valid&&x.ns===6){let k=new De("imagemap",m,c.length>0?c.join("|"):void 0,t,r);super.insertAt(k),a=!1;continue}else d=!0}else if(g.trim().split(/[\t ]/u)[0]==="desc"){super.insertAt(g);continue}else if(g.includes("[")){let m=g.indexOf("["),c=g.slice(m),x=/^\[{2}([^|]+)(?:\|([^\]]+))?\]{2}[\w\s]*$/u.exec(c);if(x){if(this.normalizeTitle(x[1],0,!0,!1,!0).valid){super.insertAt(new gt(g.slice(0,m),x.slice(1),c.slice(c.indexOf("]]")+2),t,r));continue}}else if(s.has(c.slice(1,c.indexOf(":")+1))||s.has(c.slice(1,c.indexOf("//")+2))){let k=/^\[([^\]\s]+)(?:(\s+(?=\S))([^\]]*))?\][\w\s]*$/u.exec(c);if(k){super.insertAt(new gt(g.slice(0,m),k.slice(1),c.slice(c.indexOf("]")+1),t,r));continue}}}}super.insertAt(new o(g,t,r))}}get image(){return this.childNodes.find(we("imagemap-image"))}toString(e){return super.toString(e,`
15
+ `)}getGaps(){return 1}lint(e=this.getAbsoluteIndex()){let{top:t,left:r}=this.getRootNode().posFromIndex(e),n=[];for(let s=0;s<this.length;s++){let a=this.childNodes[s],o=String(a),{length:d}=o,g=o.trim(),p=t+s,h=s?0:r;a.type==="noinclude"&&g&&!/^<!--.*-->$/u.test(g)?n.push({message:m.msg("invalid content in <$1>","gallery"),severity:"error",startIndex:e,endIndex:e+d,startLine:p,endLine:p,startCol:h,endCol:h+d}):a.type!=="noinclude"&&a.type!=="text"&&n.push(...a.lint(e)),e+=d+1}return n}print(){return super.print({sep:`
16
+ `})}};Mt=new WeakSet,jn=function(e){return this.normalizeTitle(e,6,!0,!0).valid}});var De,jr=b(()=>{"use strict";P();Gt();De=class extends ve{constructor(){super(...arguments);f(this,"type","link")}lint(e=this.getAbsoluteIndex()){let t=super.lint(e);return this.closest("ext-link-text")&&t.push($(this,{start:e},"internal link in an external link")),t}}});var On,Mn=b(()=>{"use strict";On=l=>{class i extends l{}return i}});var Ve,qr=b(()=>{"use strict";P();A();F();Ve=class extends x{constructor(i,e=!1,t=m.getConfig(),r=[]){super(i,t,r,{}),this.type=e?"ext-link-url":"free-ext-link"}lint(i=this.getAbsoluteIndex()){let e=super.lint(i),t=`[\uFF0C\uFF1B\u3002\uFF1A\uFF01\uFF1F\uFF08\uFF09]+${this.type==="ext-link-url"?"|\\|+":""}`,r=new RegExp(t,"u"),n=new RegExp(t,"gu"),s;for(let a of this.childNodes){let{type:o,data:d}=a;if(o!=="text"||!r.test(d))continue;s!=null||(s={start:i,...this.getRootNode().posFromIndex(i)});let g=v(a,s,"","warning");n.lastIndex=0;for(let p=n.exec(d);p;p=n.exec(d)){let{index:h,0:c}=p,T=d.slice(0,h).split(`
17
+ `),{length:y}=T,{length:N}=T[T.length-1],q=g.startIndex+h,I=g.startLine+y-1,C=y===1?g.startCol+N:N;e.push({...g,message:m.msg("$1 in URL",c.startsWith("|")?'"|"':m.msg("full-width punctuation")),startIndex:q,endIndex:q+c.length,startLine:I,endLine:I,startCol:C,endCol:C+c.length})}}return e}}});var ce,Ze,Br=b(()=>{"use strict";de();Mn();A();F();qr();Ze=class extends On(x){constructor(e,t="",r="",n=m.getConfig(),s=[]){super(void 0,n,s,{});f(this,"type","ext-link");k(this,ce,void 0);if(this.insertAt(new Ve(e,!0,n,s)),S(this,ce,t),r){let a=new x(r,n,s,{});a.type="ext-link-text",a.setAttribute("stage",10),this.insertAt(a)}}toString(e){return this.length===1?`[${super.toString(e)}${u(this,ce)}]`:`[${super.toString(e,u(this,ce))}]`}text(){return`[${super.text(" ")}]`}getAttribute(e){return e==="padding"?1:super.getAttribute(e)}getGaps(){return u(this,ce).length}print(){return super.print(this.length===1?{pre:"[",post:`${u(this,ce)}]`}:{pre:"[",sep:u(this,ce),post:"]"})}};ce=new WeakMap});var gt,zn=b(()=>{"use strict";A();F();Ne();jr();Br();gt=class extends x{constructor(e,t,r,n=m.getConfig(),s=[]){super(void 0,n,s);f(this,"type","imagemap-link");this.append(e,t.length===2?new De(...t,n,s):new Ze(...t,n,s),new D(r,n,s))}}});var Wn={};_(Wn,{ImagemapToken:()=>Or});var Or,_n=b(()=>{"use strict";P();Ce();A();F();Ne();Rr();zn();Or=class extends x{constructor(e,t=m.getConfig(),r=[]){super(void 0,t,r,{});f(this,"type","ext-inner");if(!e)return;let n=e.split(`
18
+ `),s=new Set(t.protocol.split("|")),a=D,o=!0,d=!1;for(let g of n){let p=g.trim();if(!(d||!p||p.startsWith("#"))){if(o){let[h,...c]=g.split("|"),T=this.normalizeTitle(h,0,!0);if(T.valid&&T.ns===6){let y=new Ue("imagemap",h,c.length>0?c.join("|"):void 0,t,r);super.insertAt(y),o=!1;continue}else d=!0}else if(g.trim().split(/[\t ]/u)[0]==="desc"){super.insertAt(g);continue}else if(g.includes("[")){let h=g.indexOf("["),c=g.slice(h),T=/^\[{2}([^|]+)(?:\|([^\]]+))?\]{2}[\w\s]*$/u.exec(c);if(T){if(this.normalizeTitle(T[1],0,!0,!1,!0).valid){super.insertAt(new gt(g.slice(0,h),T.slice(1),c.slice(c.indexOf("]]")+2),t,r));continue}}else if(s.has(c.slice(1,c.indexOf(":")+1))||s.has(c.slice(1,c.indexOf("//")+2))){let y=/^\[([^\]\s]+)(?:(\s+(?=\S))([^\]]*))?\][\w\s]*$/u.exec(c);if(y){super.insertAt(new gt(g.slice(0,h),y.slice(1),c.slice(c.indexOf("]")+1),t,r));continue}}}}super.insertAt(new a(g,t,r))}}get image(){return this.childNodes.find(we("imagemap-image"))}toString(e){return super.toString(e,`
19
19
  `)}text(){return super.text(`
20
20
  `).replace(/\n{2,}/gu,`
21
- `)}getGaps(){return 1}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),r={start:e,...this.getRootNode().posFromIndex(e)};return this.image?t.push(...this.childNodes.filter(n=>{let s=String(n).trim();return n.type==="noinclude"&&s&&!s.startsWith("#")}).map(n=>v(n,r,"invalid link in <imagemap>"))):t.push(N(this,r,"<imagemap> without an image")),t}print(){return super.print({sep:`
22
- `})}}});var Mn,We,Cr=b(()=>{"use strict";R();A();C();Tr();St();Mn=(l,i)=>{let e=new Set(l);return e.delete(i),[...e]},We=class extends qe{constructor(e,t,r,n,s=h.getConfig(),o=[]){var m;let a=e.toLowerCase(),d=new Ae(!t||t.trimStart()!==t?t:` ${t}`,"ext-attrs",a,s,o),g={...s,ext:Mn(s.ext,a),excludes:[...(m=s.excludes)!=null?m:[]]},p;switch(g.inExt=!0,a){case"tab":g.ext=Mn(g.ext,"tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":a==="poem"&&g.excludes.push("heading"),p=new T(r,g,o);break;case"pre":{let{PreToken:c}=(xn(),P(Tn));p=new c(r,g,o);break}case"dynamicpagelist":{let{ParamTagToken:c}=(kr(),P(bn));p=new c(r,g,o);break}case"inputbox":{g.excludes.push("heading");let{InputboxToken:c}=(Nn(),P(Cn));p=new c(r,g,o);break}case"references":{let{NestedToken:c}=(Pt(),P(It));p=new c(r,/<!--.*?(?:-->|$)|<(ref)(\s[^>]*)?>(.*?)<\/(ref\s*)>/gisu,["ref"],g,o);break}case"choose":{let{NestedToken:c}=(Pt(),P(It));p=new c(r,/<(option|choicetemplate)(\s[^>]*)?>(.*?)<\/(\1)>/gsu,["option","choicetemplate"],g,o);break}case"combobox":{let{NestedToken:c}=(Pt(),P(It));p=new c(r,/<(combooption)(\s[^>]*)?>(.*?)<\/(combooption\s*)>/gisu,["combooption"],g,o);break}case"gallery":{let{GalleryToken:c}=(Rn(),P(Pn));p=new c(r,g,o);break}case"imagemap":{let{ImagemapToken:c}=(On(),P(Bn));p=new c(r,g,o);break}default:{let{NowikiToken:c}=(fr(),P(cr));p=new c(r,g)}}p.setAttribute("name",a),p.type="ext-inner";super(e,d,p,n,s,o);f(this,"type","ext")}lint(e=this.getAbsoluteIndex()){let t=super.lint(e);if(this.name!=="nowiki"&&this.closest("html-attrs, table-attrs")){let r={start:e,...this.getRootNode().posFromIndex(e)};t.push(N(this,r,"extension tag in HTML tag attributes"))}return t}}});var zn={};_(zn,{parseCommentAndExt:()=>Ki});var Ki,Wn=b(()=>{"use strict";A();sn();Ne();on();Cr();$r();Ki=(l,i=h.getConfig(),e=[],t=!1)=>{let r="<onlyinclude>",n="</onlyinclude>",{length:s}=r,o=()=>{let m=l.indexOf(r);return{i:m,j:l.indexOf(n,m+s)}};if(t){let{i:m,j:c}=o();if(m!==-1&&c!==-1){let x="",k=w=>{new H(w,i,e),x+=`\0${e.length-1}c\x7F`};for(;m!==-1&&c!==-1;){let w=`\0${e.length}e\x7F`;new bt(l.slice(m+s,c),i,e),m>0&&k(l.slice(0,m)),x+=w,l=l.slice(c+s+1),{i:m,j:c}=o()}return l&&k(l),x}}let a=i.ext.join("|"),d=t?"includeonly":"(?:no|only)include",g=t?"noinclude":"includeonly",p=new RegExp(`<!--.*?(?:-->|$)|<${d}(?:\\s[^>]*)?>|</${d}\\s*>|<(${a})(\\s[^>]*?)?(?:/>|>(.*?)</(\\1\\s*)>)|<(${g})(\\s[^>]*?)?(?:/>|>(.*?)(?:</(${g}\\s*)>|$))`,"gisu");return l.replace(p,(m,c,x,k,w,q,I,$,E)=>{let B=`\0${e.length}${c?"e":"c"}\x7F`;if(c)new We(c,x,k,w,i,e);else if(m.startsWith("<!--")){let L=m.endsWith("-->");new ze(m.slice(4,L?-3:void 0),L,i,e)}else q?new kt(q,I,$,E,i,e):new H(m,i,e);return B})}});var Ji,Yi,es,Qe,se,Se,Ot,_n=b(()=>{"use strict";R();V();A();C();Ji=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),Yi=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"]),es=new Set(["strike","big","center","font","tt"]),Ot=class extends T{constructor(e,t,r,n,s=h.getConfig(),o=[]){super(void 0,s,o);f(this,"type","html");y(this,Qe,void 0);y(this,se,void 0);y(this,Se,void 0);this.insertAt(t),this.setAttribute("name",e.toLowerCase()),S(this,Qe,r),S(this,se,n),S(this,Se,e)}get closing(){return u(this,Qe)}toString(e){return`<${this.closing?"/":""}${u(this,Se)}${super.toString()}${u(this,se)?"/":""}>`}text(){let{closing:e,name:t}=this,r=`${u(this,Se)}${e?"":super.text()}`,{html:n}=this.getAttribute("config");return n[2].includes(t)?e&&t!=="br"?"":`<${r}>`:`<${e?"/":""}${r}${u(this,se)&&n[1].includes(t)?"/":""}>`}getAttribute(e){return e==="padding"?u(this,Se).length+(this.closing?2:1):super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),r;this.name==="h1"&&!this.closing&&(r=N(this,{start:e},"<h1>"),t.push(r)),this.closest("table-attrs")&&(r!=null||(r=N(this,{start:e},"")),t.push({...r,message:h.msg("HTML tag in table attributes")}));try{this.findMatchingTag()}catch(n){if(n instanceof SyntaxError){let{message:s}=n;r!=null||(r=N(this,{start:e},""));let[o]=s.split(":"),a={...r,message:h.msg(o)};if(o==="unclosed tag"&&!Yi.has(this.name))a.severity="warning";else if(o==="unmatched closing tag"){let d=this.closest("magic-word");d&&Ji.has(d.name)&&(a.severity="warning")}t.push(a)}}return es.has(this.name)&&(r!=null||(r=N(this,{start:e},"")),t.push({...r,message:h.msg("obsolete HTML tag"),severity:"warning"})),t}findMatchingTag(){let{html:e}=this.getAttribute("config"),{name:t,parentNode:r,closing:n}=this,s=Kr(String(this));if(n&&(u(this,se)||e[2].includes(t)))throw new SyntaxError(`tag that is both closing and self-closing: ${s}`);if(e[2].includes(t)||u(this,se)&&e[1].includes(t))return this;if(u(this,se)&&e[0].includes(t))throw new SyntaxError(`invalid self-closing tag: ${s}`);if(!r)return;let{childNodes:o}=r,a=o.indexOf(this),d=(n?o.slice(0,a).reverse():o.slice(a+1)).filter(p=>p.type==="html"&&p.name===t),g=n?-1:1;for(let p of d)if(u(p,Qe)?g--:g++,g===0)return p;throw new SyntaxError(`${n?"unmatched closing":"unclosed"} tag: ${s}`)}print(){let{closing:e,name:t}=this,{html:r}=this.getAttribute("config");return super.print({pre:`&lt;${this.closing?"/":""}${u(this,Se)}`,post:`${u(this,se)?"/":""}&gt;`,class:e&&r[2].includes(t)&&t!=="br"?"html-invalid":"html"})}json(){return{...super.json(),closing:this.closing,selfClosing:u(this,se)}}};Qe=new WeakMap,se=new WeakMap,Se=new WeakMap});var Un={};_(Un,{parseHtml:()=>ts});var ts,Dn=b(()=>{"use strict";A();St();_n();ts=(l,i=h.getConfig(),e=[])=>{let t=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,r=new Set(i.html.flat()),n=l.split("<"),s=n.shift();for(let o of n){let a=t.exec(o),d=a==null?void 0:a[2],g=d==null?void 0:d.toLowerCase();if(!a||!r.has(g)){s+=`<${o}`;continue}let[,p,,m="",c,x]=a,k=new Ae(m,"html-attrs",g,i,e),w=k.getAttr("itemprop");if(g==="meta"&&(w===void 0||k.getAttr("content")===void 0)||g==="link"&&(w===void 0||k.getAttr("href")===void 0)){s+=`<${o}`,e.pop();continue}s+=`\0${e.length}x\x7F${x}`,new Ot(d,k,p==="/",c==="/>",i,e)}return s}});var Xe,Br=b(()=>{"use strict";A();C();dt();St();Xe=class extends T{constructor(i,e,t,r=h.getConfig(),n=[],s={}){super(void 0,r,n,s),this.append(new he(e,i,"table-syntax",r,n,{}),new Ae(t,"table-attrs",this.type,r,n))}}});var Ke,Or=b(()=>{"use strict";R();Ce();Br();Ke=class extends Xe{lint(i=this.getAbsoluteIndex()){let e=super.lint(i),t=this.childNodes.find(({type:d})=>d==="table-inter");if(!t)return e;let r=t.childNodes.find(d=>d.text().trim()),n=/^\s*(?:!|\{\{\s*![!-]?\s*\}\})/u,s=we("arg"),o=we("magic-word");if(!r||n.test(String(r))||s(r)&&n.test(r.default||""))return e;if(o(r))try{if(r.getPossibleValues().every(d=>n.test(d.text())))return e}catch(d){}let a=v(t,{start:i},"content to be moved out from the table");return e.push({...a,startIndex:a.startIndex+1,startLine:a.startLine+1,startCol:0}),e}}});var rs,Mt,Hn=b(()=>{"use strict";R();Ce();A();Or();dt();rs=/^\n[^\S\n]*(?:\|\}|\{\{\s*!\s*\}\}\}|\{\{\s*!\)\s*\}\})$/u,Mt=class extends Ke{constructor(e,t,r=h.getConfig(),n=[]){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,e,t,r,n,{});f(this,"type","table")}get closed(){return this.lastChild.type==="table-syntax"}lint(e=this.getAbsoluteIndex()){let t=super.lint(e);return this.closed||t.push(v(this.firstChild,{start:e},h.msg("unclosed $1","table"))),t}close(e=`
23
- |}`,t=!1){let r=this.getAttribute("config"),n=this.getAttribute("accum"),s=[e],o=nt.run(()=>super.insertAt(new he(void 0,rs,"table-syntax",r,n,{})));this.lastChild.replaceChildren(...s)}json(){return{...super.json(),closed:this.closed}}}});var zt,Zn=b(()=>{"use strict";A();Or();zt=class extends Ke{constructor(e,t,r=h.getConfig(),n=[]){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,e,t,r,n,{});f(this,"type","tr")}}});var ee,_t,Vn,Wt,Qn=b(()=>{"use strict";R();de();A();C();Br();Wt=class extends Xe{constructor(e,t,r=h.getConfig(),n=[]){var d;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,o,r,n);y(this,_t);f(this,"type","td");y(this,ee,"");s&&([mt(this,ee)._]=s);let a=new T(t==null?void 0:t.slice(((d=s==null?void 0:s.index)!=null?d:NaN)+u(this,ee).length),r,n);a.type="td-inner",a.setAttribute("stage",4),this.insertAt(a)}get subtype(){return F(this,_t,Vn).call(this).subtype}afterBuild(){u(this,ee).includes("\0")&&S(this,ee,this.buildFromStr(u(this,ee),0))}toString(e){let{childNodes:[t,r,n]}=this;return`${t.toString()}${r.toString()}${u(this,ee)}${n.toString()}`}text(){let{childNodes:[e,t,r]}=this;return`${e.text()}${t.text()}${u(this,ee)}${r.text()}`}getGaps(e){return e===1?u(this,ee).length:0}lint(e=this.getAbsoluteIndex()){let t=super.lint(e);e+=this.getRelativeIndex(this.length-1);for(let r of this.lastChild.childNodes)if(r.type==="text"){let{data:n}=r;n.includes("|")&&t.push(v(r,{start:e},'additional "|" in a table cell',n.includes("||")?"error":"warning"))}return t}print(){let{childNodes:[e,t,r]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${u(this,ee)}${r.print()}</span>`}json(){return{...super.json(),subtype:this.subtype}}};ee=new WeakMap,_t=new WeakSet,Vn=function(){let e=this.firstChild.text(),t=e.slice(-1),r="td";return t==="!"?r="th":t==="+"&&(r="caption"),{subtype:r}}});var Je,Mr=b(()=>{"use strict";ke();Je=class extends Q{}});var Ye,zr=b(()=>{"use strict";Mr();Ye=class extends Je{constructor(){super(...arguments);f(this,"type","dd")}}});var Xn={};_(Xn,{parseTable:()=>is});var ns,is,Kn=b(()=>{"use strict";A();C();Hn();Zn();Qn();zr();ns=l=>l.lastChild.constructor!==T,is=({firstChild:{data:l},type:i,name:e},t=h.getConfig(),r=[])=>{let n=[],s=l.split(`
24
- `),o=i==="root"||i==="parameter-value"||i==="ext-inner"&&e==="poem"?"":`
25
- ${s.shift()}`,a,d=(p,m)=>{if(!m){o+=p;return}let{lastChild:c}=m;if(ns(m)){let x=new T(p,t,r);x.type="table-inter",x.setAttribute("stage",3),m.insertAt(x)}else c.setText(String(c)+p)},g=()=>a.type==="td"?n.pop():a;for(let p of s){a=n.pop();let[m]=/^(?:\s|\0\d+c\x7F)*/u.exec(p),c=p.slice(m.length),x=/^(:*)((?:\s|\0\d+c\x7F)*)(\{\||\{(?:\0\d+c\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(c);if(x){for(;a&&a.type!=="td";)a=n.pop();let[,E,B,L,O]=x;E&&new Ye(E,t,r),d(`
26
- ${m}${E&&`\0${r.length-1}d\x7F`}${B}\0${r.length}b\x7F`,a),n.push(...a?[a]:[],new Mt(L,O,t,r));continue}else if(!a){o+=`
27
- ${p}`;continue}let k=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(c);if(!k){d(`
28
- ${p}`,a),n.push(a);continue}let[,w,q,I,$]=k;if(w){for(;a.type!=="table";)a=n.pop();a.close(`
29
- ${m}${w}`,!0),d($,n[n.length-1])}else if(q){a=g(),a.type==="tr"&&(a=n.pop());let E=new zt(`
30
- ${m}${q}`,$,t,r);n.push(a,E),a.insertAt(E)}else{a=g();let E=I==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu,B=E.exec($),L=0,O=`
31
- ${m}${I}`,M=oe=>{let re=new Wt(O,$.slice(L,B==null?void 0:B.index),t,r);return oe.insertAt(re),re};for(;B;)M(a),{lastIndex:L}=E,[O]=B,B=E.exec($);n.push(a,M(a))}}return o.slice(1)}});var Ut,Jn=b(()=>{"use strict";ke();Ut=class extends Q{constructor(){super(...arguments);f(this,"type","hr")}}});var Dt,Yn=b(()=>{"use strict";je();A();ke();Dt=class extends ue(Q){constructor(e,t,r=h.getConfig(),n=[]){super(e,r,n);f(this,"type","double-underscore")}getAttribute(e){return e==="padding"?2:super.getAttribute(e)}toString(e){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}}});var ei={};_(ei,{parseHrAndDoubleUnderscore:()=>ss});var ss,ti=b(()=>{"use strict";A();Jn();Yn();yr();ss=({firstChild:{data:l},type:i,name:e},t=h.getConfig(),r=[])=>{let{doubleUnderscore:n}=t,s=new Set(n[0]),o=new Set(n[1]);return i!=="root"&&(i!=="ext-inner"||e!=="poem")&&(l=`\0${l}`),l=l.replace(/^((?:\0\d+c\x7F)*)(-{4,})/gmu,(a,d,g)=>(new Ut(g,t,r),`${d}\0${r.length-1}r\x7F`)).replace(new RegExp(`__(${n.flat().join("|")})__`,"giu"),(a,d)=>{let g=o.has(d);return g||s.has(d.toLowerCase())?(new Dt(d,g,t,r),`\0${r.length-1}u\x7F`):a}).replace(/^((?:\0\d+c\x7F)*)(={1,6})(.+)\2((?:[^\S\n]|\0\d+c\x7F)*)$/gmu,(a,d,g,p,m)=>{let c=`${d}\0${r.length}h\x7F`;return new Me(g.length,[p,m],t,r),c}),i==="root"||i==="ext-inner"&&e==="poem"?l:l.slice(1)}});var Ht,ri=b(()=>{"use strict";Rt();Ht=class extends ve{constructor(){super(...arguments);f(this,"type","category")}}});var Zt,ni=b(()=>{"use strict";R();A();ke();Zt=class extends Q{constructor(){super(...arguments);f(this,"type","quote")}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}lint(e=this.getAbsoluteIndex()){let{previousSibling:t,nextSibling:r}=this,n=h.msg('lonely "$1"',"'"),s=[],o;if((t==null?void 0:t.type)==="text"&&t.data.endsWith("'")){o=N(this,{start:e},n);let{startIndex:a,startLine:d,startCol:g}=o,[,{length:p}]=/(?:^|[^'])('+)$/u.exec(t.data),m=e-p;s.push({...o,startIndex:m,endIndex:a,startCol:g-p,endLine:d,endCol:g})}if((r==null?void 0:r.type)==="text"&&r.data.startsWith("'")){o!=null||(o=N(this,{start:e},n));let{endIndex:a,endLine:d,endCol:g}=o,[{length:p}]=/^'+/u.exec(r.data),m=a+p;s.push({...o,startIndex:a,endIndex:m,startLine:d,startCol:g,endCol:g+p})}return s}json(){return{...super.json(),bold:this.bold,italic:this.italic}}}});var Wr={};_(Wr,{parseQuotes:()=>os});var os,_r=b(()=>{"use strict";A();ni();os=(l,i=h.getConfig(),e=[])=>{var g;let t=l.split(/('{2,})/u),{length:r}=t;if(r===1)return l;let n=0,s=0,o,a,d;for(let p=1;p<r;p+=2){let{length:m}=t[p];switch(m){case 2:s++;break;case 4:t[p-1]+="'",t[p]="'''";case 3:if(n++,o!==void 0)break;t[p-1].endsWith(" ")?a===void 0&&d===void 0&&(d=p):t[p-1].slice(-2,-1)===" "?o=p:a!=null||(a=p);break;default:t[p-1]+="'".repeat(m-5),t[p]="'''''",s++,n++}}if(s%2===1&&n%2===1){let p=(g=o!=null?o:a)!=null?g:d;p!==void 0&&(t[p]="''",t[p-1]+="'")}for(let p=1;p<r;p+=2)new Zt(t[p],i,e),t[p]=`\0${e.length-1}q\x7F`;return t.join("")}});var si={};_(si,{parseLinks:()=>ii});var ii,oi=b(()=>{"use strict";A();Rr();Lr();ri();ii=(l,i=h.getConfig(),e=[])=>{let{parseQuotes:t}=(_r(),P(Wr)),r=i.inExt?/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)(.*?[^\]]))?\]\](.*)$/su:/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)(.*?[^\]])?)?\]\](.*)$/su,n=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)(.*)$/su,s=new RegExp(`^\\s*(?:${i.protocol}|//)`,"iu"),o=l.split("[["),a=o.shift();for(let d=0;d<o.length;d++){let g=!1,p,m,c,x,k=o[d],w=r.exec(k);if(w)[,p,m,c,x]=w,x.startsWith("]")&&(c!=null&&c.includes("["))&&(c+="]",x=x.slice(1));else{let L=n.exec(k);L&&(g=!0,[,p,m,c]=L)}if(p===void 0||s.test(p)||/\0\d+[exhbru]\x7F/u.test(p)){a+=`[[${k}`;continue}let q=p.trim().startsWith(":");if(q&&g){a+=`[[${k}`;continue}let I=h.normalizeTitle(p,0,!1,i,!0,!0,!0),{ns:$,valid:E}=I;if(E){if(g){if($!==6){a+=`[[${k}`;continue}let L=!1;for(d++;d<o.length;d++){let O=o[d],M=O.split("]]");if(M.length>2){L=!0,c+=`[[${M[0]}]]${M[1]}`,x=M.slice(2).join("]]");break}else if(M.length===2)c+=`[[${M[0]}]]${M[1]}`;else{c+=`[[${O}`;break}}if(c=ii(c,i,e),!L){a+=`[[${p}${m}${c}`;continue}}}else{a+=`[[${k}`;continue}c&&(c=t(c,i,e)),a+=`\0${e.length}l\x7F${x}`;let B=He;q||($===6?B=Ue:$===14&&(B=Ht)),c===void 0&&m&&(c=""),new B(p,c,i,e,m)}return a}});var ai={};_(ai,{parseExternalLinks:()=>as});var as,li=b(()=>{"use strict";V();A();jr();as=(l,i=h.getConfig(),e=[])=>{let t=new RegExp(`\\[((?:(?:${i.protocol}|//)${xe}|\0\\d+m\x7F)${be}(?=[[\\]<>"\\t\\p{Zs}]|\0\\d))(\\p{Zs}*(?=\\P{Zs}))([^\\]-\b
32
- -\uFFFD]*)\\]`,"giu");return l.replace(t,(r,n,s,o)=>{let{length:a}=e,d=/&[lg]t;/u.exec(n);return d&&(n=n.slice(0,d.index),s="",o=`${n.slice(d.index)}${s}${o}`),new Ve(n,s,o,i,e),`\0${a}w\x7F`})}});var di={};_(di,{parseMagicLinks:()=>ls});var ls,pi=b(()=>{"use strict";V();A();Gr();ls=(l,i=h.getConfig(),e=[])=>{let t=new RegExp(`(^|[^\\p{L}\\d_])(?:${i.protocol})(${xe}${be})`,"giu");return l.replace(t,(r,n,s)=>{let o="",a=n?r.slice(1):r,d=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(a);d&&(o=a.slice(d.index),a=a.slice(0,d.index));let g=new RegExp(`[,;.:!?${a.includes("(")?"":")"}]+$`,"u"),p=g.exec(a);if(p){let m=0;p[0].startsWith(";")&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(a.slice(0,p.index))&&(m=1),o=`${a.slice(p.index+m)}${o}`,a=a.slice(0,p.index+m)}return o.length>=s.length?r:(new Ze(a,!1,i,e),`${n}\0${e.length-1}w\x7F${o}`)})}});var Vt,gi=b(()=>{"use strict";Mr();Vt=class extends Je{constructor(){super(...arguments);f(this,"type","list")}}});var ui={};_(ui,{parseList:()=>ds});var ds,hi=b(()=>{"use strict";A();gi();zr();ds=(l,i=h.getConfig(),e=[])=>{let t=/^((?:\0\d+c\x7F)*)([;:*#]+)/u.exec(l);if(!t)return l;let[r,n,s]=t,o=`${n}\0${e.length}d\x7F${l.slice(r.length)}`,a=s.split(";").length-1;if(new Vt(s,i,e),!a)return o;let d=/:+|-\{/gu,g=d.exec(o),p=0,m=(c,x)=>(new Ye(c,i,e),`${o.slice(0,x)}\0${e.length-1}d\x7F${o.slice(x+c.length)}`);for(;g&&a;){let{0:c,index:x}=g;if(c.startsWith(":")){if(c.length>=a)return m(c.slice(0,a),x);a-=c.length,d.lastIndex=x+4+String(e.length).length,o=m(c,x)}else if(c==="-{"){if(!p){let{lastIndex:k}=d;d=/-\{|\}-/gu,d.lastIndex=k}p++}else if(p--,!p){let{lastIndex:k}=d;d=/:+|-\{/gu,d.lastIndex=k}g=d.exec(o)}return o}});var mi,ci=b(()=>{"use strict";mi=l=>{class i extends l{}return i}});var ps,fe,Qt,fi=b(()=>{"use strict";R();A();C();me();ps=new Set(["A","T","R","D","-","H","N"]),Qt=class extends T{constructor(e,t=h.getConfig(),r=[]){super(void 0,t,r,{});f(this,"type","converter-flags");y(this,fe,void 0);this.append(...e.map(n=>new G(n,"converter-flag",t,r)))}afterBuild(){S(this,fe,this.childNodes.map(e=>e.text().trim()))}toString(e){return super.toString(e,";")}text(){return super.text(";")}getGaps(){return 1}getUnknownFlags(){return new Set(u(this,fe).filter(e=>/\{{3}[^{}]+\}{3}/u.test(e)))}getVariantFlags(){let e=new Set(this.getAttribute("config").variants);return new Set(u(this,fe).filter(t=>e.has(t)))}lint(e=this.getAbsoluteIndex()){let t=this.getVariantFlags(),r=this.getUnknownFlags(),n=new Set(u(this,fe).filter(m=>ps.has(m))),{length:s}=u(this,fe).filter(m=>!m),o=u(this,fe).length-r.size-s,a=super.lint(e);if(t.size===o||n.size===o)return a;let d={start:e,...this.getRootNode().posFromIndex(e)},{childNodes:g,length:p}=this;for(let m=0;m<p;m++){let c=g[m],x=c.text().trim();x&&!t.has(x)&&!r.has(x)&&(t.size>0||!n.has(x))&&a.push(v(c,d,"invalid conversion flag"))}return a}print(){return super.print({sep:";"})}};fe=new WeakMap});var et,Ti=b(()=>{"use strict";A();C();me();et=class extends T{constructor(e,t=!0,r=h.getConfig(),n=[]){super(void 0,r,n);f(this,"type","converter-rule");let s=e.indexOf(":"),o=e.slice(0,s).indexOf("=>"),a=o===-1?e.slice(0,s):e.slice(o+2,s);t&&r.variants.includes(a.trim())?(super.insertAt(new G(a,"converter-rule-variant",r,n)),super.insertAt(new G(e.slice(s+1),"converter-rule-to",r,n)),o!==-1&&super.insertAt(new G(e.slice(0,o),"converter-rule-from",r,n),0)):super.insertAt(new G(e,"converter-rule-to",r,n))}toString(e){let{childNodes:t}=this;if(t.length===3){let[r,n,s]=t;return`${r.toString(e)}=>${n.toString(e)}:${s.toString(e)}`}return super.toString(e,":")}text(){let{childNodes:e}=this;if(e.length===3){let[t,r,n]=e;return`${t.text()}=>${r.text()}:${n.text()}`}return super.text(":")}getGaps(e){return e===0&&this.length===3?2:1}print(){let{childNodes:e}=this;if(e.length===3){let[t,r,n]=e;return`<span class="wpb-converter-rule">${t.print()}=>${r.print()}:${n.print()}</span>`}return super.print({sep:":"})}}});var Xt,xi=b(()=>{"use strict";V();ci();A();C();fi();Ti();Xt=class extends mi(T){constructor(e,t,r=h.getConfig(),n=[]){super(void 0,r,n);f(this,"type","converter");this.append(new Qt(e,r,n));let[s]=t,o=s.includes(":"),a=new et(s,o,r,n);o&&a.length===1?this.insertAt(new et(t.join(";"),!1,r,n)):this.append(a,...t.slice(1).map(d=>new et(d,!0,r,n)))}toString(e){let{childNodes:[t,...r]}=this;return`-{${t.toString()}${t.length>0?"|":""}${r.map(n=>n.toString()).join(";")}}-`}text(){let{childNodes:[e,...t]}=this;return`-{${e.text()}|${pe(t,";")}}-`}getAttribute(e){return e==="padding"?2:super.getAttribute(e)}getGaps(e){return e||this.firstChild.length>0?1:0}print(){let{childNodes:[e,...t]}=this;return`<span class="wpb-converter">-{${e.print()}${e.length>0?"|":""}${ge(t,{sep:";"})}}-</span>`}}});var bi={};_(bi,{parseConverter:()=>gs});var gs,ki=b(()=>{"use strict";A();xi();gs=(l,i=h.getConfig(),e=[])=>{let t=/-\{/gu,r=/-\{|\}-/gu,n=[],s=t,o=s.exec(l);for(;o;){let{0:a,index:d}=o;if(a==="}-"){let g=n.pop(),{length:p}=e,m=l.slice(g.index+2,d),c=m.indexOf("|"),[x,k]=c===-1?[[],m]:[m.slice(0,c).split(";"),m.slice(c+1)],w=k.replace(/(&[#a-z\d]+);/giu,"$1"),q=`(?:${i.variants.join("|")})`,I=w.split(new RegExp(`;(?=(?:[^;]*?=>)?\\s*${q}\\s*:|(?:\\s|\0\\d+c\x7F)*$)`,"u")).map($=>$.replace(/\x01/gu,";"));new Xt(x,I,i,e),l=`${l.slice(0,g.index)}\0${p}v\x7F${l.slice(d+2)}`,n.length===0&&(s=t),s.lastIndex=g.index+3+String(p).length}else n.push(o),s=r,s.lastIndex=d+2;o=s.exec(l)}return l}});var Dr={};_(Dr,{Token:()=>T});var te,j,z,Pe,ut,Ur,Kt,yi,Jt,Ai,Yt,vi,er,Si,tr,$i,rr,wi,nr,Ci,ir,Ni,sr,Fi,or,Ei,ar,Li,Hr,T,C=b(()=>{"use strict";V();de();A();en();nn();Hr=class Hr extends Tt{constructor(e,t=h.getConfig(),r=[],n){super();y(this,ut);y(this,Kt);y(this,Jt);y(this,Yt);y(this,er);y(this,tr);y(this,rr);y(this,nr);y(this,ir);y(this,sr);y(this,or);y(this,ar);f(this,"type","root");y(this,te,0);y(this,j,void 0);y(this,z,void 0);y(this,Pe,void 0);typeof e=="string"&&this.insertAt(e),S(this,j,t),S(this,z,r),r.push(this)}parseOnce(e=u(this,te),t=!1){if(e<u(this,te)||!this.getAttribute("plain")||this.length===0)return this;if(u(this,te)>=11)return this;switch(e){case 0:this.type==="root"&&u(this,z).shift(),S(this,Pe,t),F(this,Kt,yi).call(this,t);break;case 1:F(this,Jt,Ai).call(this);break;case 2:F(this,Yt,vi).call(this);break;case 3:F(this,er,Si).call(this);break;case 4:F(this,tr,$i).call(this);break;case 5:F(this,rr,wi).call(this);break;case 6:F(this,nr,Ci).call(this);break;case 7:F(this,ir,Ni).call(this);break;case 8:F(this,sr,Fi).call(this);break;case 9:F(this,or,Ei).call(this);break;case 10:F(this,ar,Li).call(this)}if(this.type==="root")for(let r of u(this,z))r.parseOnce(e,t);return mt(this,te)._++,this}buildFromStr(e,t){let r=e.split(/[\0\x7F]/u).map((n,s)=>{if(s%2===0)return new ot(n);if(Number.isNaN(Number(n.slice(-1))))return u(this,z)[Number(n.slice(0,-1))];throw new Error(`\u89E3\u6790\u9519\u8BEF\uFF01\u672A\u6B63\u786E\u6807\u8BB0\u7684 Token\uFF1A${n}`)});return t===0?r.map(String).join(""):t===1?pe(r):r}afterBuild(){if(this.type==="root")for(let e of u(this,z))e.afterBuild()}parse(e=11,t=!1){for(e=Math.min(e,11);u(this,te)<e;)this.parseOnce(u(this,te),t);return e&&(F(this,ut,Ur).call(this),this.afterBuild()),this}getAttribute(e){switch(e){case"plain":return this.constructor===Hr;case"config":return JSON.parse(JSON.stringify(u(this,j)));case"accum":return u(this,z);case"include":{if(u(this,Pe)!==void 0)return u(this,Pe);let t=this.getRootNode();return t!==this&&t.getAttribute("include")}default:return super.getAttribute(e)}}setAttribute(e,t){switch(e){case"stage":u(this,te)===0&&this.type==="root"&&u(this,z).shift(),S(this,te,t);break;default:super.setAttribute(e,t)}}insertAt(e,t=this.length){let r=typeof e=="string"?new ot(e):e;return super.insertAt(r,t),r.type==="root"&&(r.type="plain"),r}normalizeTitle(e,t=0,r=!1,n=!1,s=!1){return h.normalizeTitle(e,t,u(this,Pe),u(this,j),r,n,s)}};te=new WeakMap,j=new WeakMap,z=new WeakMap,Pe=new WeakMap,ut=new WeakSet,Ur=function(){var n;S(this,te,11);let{length:e,firstChild:t}=this,r=String(t);if(e===1&&t.type==="text"&&r.includes("\0")&&(this.replaceChildren(...this.buildFromStr(r)),this.normalize(),this.type==="root"))for(let s of u(this,z))F(n=s,ut,Ur).call(n)},Kt=new WeakSet,yi=function(e){let{parseCommentAndExt:t}=(Wn(),P(zn));this.setText(t(String(this.firstChild),u(this,j),u(this,z),e))},Jt=new WeakSet,Ai=function(){let{parseBraces:e}=(vr(),P(wn)),t=this.type==="root"?String(this.firstChild):`\0${String(this.firstChild)}`,r=e(t,u(this,j),u(this,z));this.setText(this.type==="root"?r:r.slice(1))},Yt=new WeakSet,vi=function(){var t;if((t=u(this,j).excludes)!=null&&t.includes("html"))return;let{parseHtml:e}=(Dn(),P(Un));this.setText(e(String(this.firstChild),u(this,j),u(this,z)))},er=new WeakSet,Si=function(){var t;if((t=u(this,j).excludes)!=null&&t.includes("table"))return;let{parseTable:e}=(Kn(),P(Xn));this.setText(e(this,u(this,j),u(this,z)))},tr=new WeakSet,$i=function(){var t;if((t=u(this,j).excludes)!=null&&t.includes("hr"))return;let{parseHrAndDoubleUnderscore:e}=(ti(),P(ei));this.setText(e(this,u(this,j),u(this,z)))},rr=new WeakSet,wi=function(){let{parseLinks:e}=(oi(),P(si));this.setText(e(String(this.firstChild),u(this,j),u(this,z)))},nr=new WeakSet,Ci=function(){var r;if((r=u(this,j).excludes)!=null&&r.includes("quote"))return;let{parseQuotes:e}=(_r(),P(Wr)),t=String(this.firstChild).split(`
21
+ `)}getGaps(){return 1}lint(e=this.getAbsoluteIndex()){let t=super.lint(e),r={start:e,...this.getRootNode().posFromIndex(e)};return this.image?t.push(...this.childNodes.filter(n=>{let s=String(n).trim();return n.type==="noinclude"&&s&&!s.startsWith("#")}).map(n=>v(n,r,"invalid link in <imagemap>"))):t.push($(this,r,"<imagemap> without an image")),t}print(){return super.print({sep:`
22
+ `})}}});var Hn,We,Fr=b(()=>{"use strict";P();A();F();br();$t();Hn=(l,i)=>{let e=new Set(l);return e.delete(i),[...e]},We=class extends qe{constructor(e,t,r,n,s=m.getConfig(),a=[]){var h;let o=e.toLowerCase(),d=new Ae(!t||t.trimStart()!==t?t:` ${t}`,"ext-attrs",o,s,a),g={...s,ext:Hn(s.ext,o),excludes:[...(h=s.excludes)!=null?h:[]]},p;switch(g.inExt=!0,o){case"tab":g.ext=Hn(g.ext,"tabs");case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":o==="poem"&&g.excludes.push("heading"),p=new x(r,g,a);break;case"pre":{let{PreToken:c}=(yn(),R(kn));p=new c(r,g,a);break}case"dynamicpagelist":{let{ParamTagToken:c}=(Ar(),R(An));p=new c(r,g,a);break}case"inputbox":{g.excludes.push("heading");let{InputboxToken:c}=(Ln(),R(En));p=new c(r,g,a);break}case"references":{let{NestedToken:c}=(Rt(),R(Pt));p=new c(r,/<!--.*?(?:-->|$)|<(ref)(\s[^>]*)?>(.*?)<\/(ref\s*)>/gisu,["ref"],g,a);break}case"choose":{let{NestedToken:c}=(Rt(),R(Pt));p=new c(r,/<(option|choicetemplate)(\s[^>]*)?>(.*?)<\/(\1)>/gsu,["option","choicetemplate"],g,a);break}case"combobox":{let{NestedToken:c}=(Rt(),R(Pt));p=new c(r,/<(combooption)(\s[^>]*)?>(.*?)<\/(combooption\s*)>/gisu,["combooption"],g,a);break}case"gallery":{let{GalleryToken:c}=(Bn(),R(qn));p=new c(r,g,a);break}case"imagemap":{let{ImagemapToken:c}=(_n(),R(Wn));p=new c(r,g,a);break}default:{let{NowikiToken:c}=(xr(),R(Tr));p=new c(r,g)}}p.setAttribute("name",o),p.type="ext-inner";super(e,d,p,n,s,a);f(this,"type","ext")}lint(e=this.getAbsoluteIndex()){let t=super.lint(e);if(this.name!=="nowiki"&&this.closest("html-attrs, table-attrs")){let r={start:e,...this.getRootNode().posFromIndex(e)};t.push($(this,r,"extension tag in HTML tag attributes"))}return t}}});var Un={};_(Un,{parseCommentAndExt:()=>ts});var ts,Dn=b(()=>{"use strict";A();ln();Ne();dn();Fr();Cr();ts=(l,i=m.getConfig(),e=[],t=!1)=>{let r="<onlyinclude>",n="</onlyinclude>",{length:s}=r,a=()=>{let h=l.indexOf(r);return{i:h,j:l.indexOf(n,h+s)}};if(t){let{i:h,j:c}=a();if(h!==-1&&c!==-1){let T="",y=N=>{new D(N,i,e),T+=`\0${e.length-1}c\x7F`};for(;h!==-1&&c!==-1;){let N=`\0${e.length}e\x7F`;new kt(l.slice(h+s,c),i,e),h>0&&y(l.slice(0,h)),T+=N,l=l.slice(c+s+1),{i:h,j:c}=a()}return l&&y(l),T}}let o=i.ext.join("|"),d=t?"includeonly":"(?:no|only)include",g=t?"noinclude":"includeonly",p=new RegExp(`<!--.*?(?:-->|$)|<${d}(?:\\s[^>]*)?>|</${d}\\s*>|<(${o})(\\s[^>]*?)?(?:/>|>(.*?)</(\\1\\s*)>)|<(${g})(\\s[^>]*?)?(?:/>|>(.*?)(?:</(${g}\\s*)>|$))`,"gisu");return l.replace(p,(h,c,T,y,N,q,I,C,E)=>{let B=`\0${e.length}${c?"e":"c"}\x7F`;if(c)new We(c,T,y,N,i,e);else if(h.startsWith("<!--")){let L=h.endsWith("-->");new ze(h.slice(4,L?-3:void 0),L,i,e)}else q?new yt(q,I,C,E,i,e):new D(h,i,e);return B})}});var rs,ns,is,Qe,se,Se,zt,Vn=b(()=>{"use strict";P();Z();A();F();rs=new Set(["if","ifeq","ifexpr","ifexist","iferror","switch"]),ns=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"]),is=new Set(["strike","big","center","font","tt"]),zt=class extends x{constructor(e,t,r,n,s=m.getConfig(),a=[]){super(void 0,s,a);f(this,"type","html");k(this,Qe,void 0);k(this,se,void 0);k(this,Se,void 0);this.insertAt(t),this.setAttribute("name",e.toLowerCase()),S(this,Qe,r),S(this,se,n),S(this,Se,e)}get closing(){return u(this,Qe)}toString(e){return`<${this.closing?"/":""}${u(this,Se)}${super.toString()}${u(this,se)?"/":""}>`}text(){let{closing:e,name:t}=this,r=`${u(this,Se)}${e?"":super.text()}`,{html:n}=this.getAttribute("config");return n[2].includes(t)?e&&t!=="br"?"":`<${r}>`:`<${e?"/":""}${r}${u(this,se)&&n[1].includes(t)?"/":""}>`}getAttribute(e){return e==="padding"?u(this,Se).length+(this.closing?2:1):super.getAttribute(e)}lint(e=this.getAbsoluteIndex()){var n;let t=super.lint(e),r;this.name==="h1"&&!this.closing&&(r=$(this,{start:e},"<h1>"),t.push(r)),this.closest("table-attrs")&&(r!=null||(r=$(this,{start:e},"")),t.push({...r,message:m.msg("HTML tag in table attributes")}));try{this.findMatchingTag()}catch(s){if(s instanceof SyntaxError){let{message:a}=s;r!=null||(r=$(this,{start:e},""));let[o]=a.split(":"),d={...r,message:m.msg(o)};if(o==="unclosed tag"&&!this.closest("heading-title"))if(ns.has(this.name)){let g=(n=this.parentNode)==null?void 0:n.childNodes,p=g==null?void 0:g.indexOf(this);g!=null&&g.slice(0,p).some(({type:h,name:c})=>h==="html"&&c===this.name)||(d.severity="warning")}else d.severity="warning";else if(o==="unmatched closing tag"){let g=this.closest("magic-word");g&&rs.has(g.name)&&(d.severity="warning")}t.push(d)}}return is.has(this.name)&&(r!=null||(r=$(this,{start:e},"")),t.push({...r,message:m.msg("obsolete HTML tag"),severity:"warning"})),(this.name==="b"||this.name==="strong")&&this.closest("heading-title")&&(r!=null||(r=$(this,{start:e},"")),t.push({...r,message:m.msg("bold in section header"),severity:"warning"})),t}findMatchingTag(){let{html:e}=this.getAttribute("config"),{name:t,parentNode:r,closing:n}=this,s=Yr(String(this));if(n&&(u(this,se)||e[2].includes(t)))throw new SyntaxError(`tag that is both closing and self-closing: ${s}`);if(e[2].includes(t)||u(this,se)&&e[1].includes(t))return this;if(u(this,se)&&e[0].includes(t))throw new SyntaxError(`invalid self-closing tag: ${s}`);if(!r)return;let{childNodes:a}=r,o=a.indexOf(this),d=(n?a.slice(0,o).reverse():a.slice(o+1)).filter(p=>p.type==="html"&&p.name===t),g=n?-1:1;for(let p of d)if(u(p,Qe)?g--:g++,g===0)return p;throw new SyntaxError(`${n?"unmatched closing":"unclosed"} tag: ${s}`)}print(){let{closing:e,name:t}=this,{html:r}=this.getAttribute("config");return super.print({pre:`&lt;${this.closing?"/":""}${u(this,Se)}`,post:`${u(this,se)?"/":""}&gt;`,class:e&&r[2].includes(t)&&t!=="br"?"html-invalid":"html"})}json(){return{...super.json(),closing:this.closing,selfClosing:u(this,se)}}};Qe=new WeakMap,se=new WeakMap,Se=new WeakMap});var Zn={};_(Zn,{parseHtml:()=>ss});var ss,Qn=b(()=>{"use strict";A();$t();Vn();ss=(l,i=m.getConfig(),e=[])=>{let t=/^(\/?)([a-z][^\s/>]*)((?:\s|\/(?!>))[^>]*?)?(\/?>)([^<]*)$/iu,r=new Set(i.html.flat()),n=l.split("<"),s=n.shift();for(let a of n){let o=t.exec(a),d=o==null?void 0:o[2],g=d==null?void 0:d.toLowerCase();if(!o||!r.has(g)){s+=`<${a}`;continue}let[,p,,h="",c,T]=o,y=new Ae(h,"html-attrs",g,i,e),N=y.getAttr("itemprop");if(g==="meta"&&(N===void 0||y.getAttr("content")===void 0)||g==="link"&&(N===void 0||y.getAttr("href")===void 0)){s+=`<${a}`,e.pop();continue}s+=`\0${e.length}x\x7F${T}`,new zt(d,y,p==="/",c==="/>",i,e)}return s}});var Xe,Mr=b(()=>{"use strict";A();F();dt();$t();Xe=class extends x{constructor(i,e,t,r=m.getConfig(),n=[],s={}){super(void 0,r,n,s),this.append(new he(e,i,"table-syntax",r,n,{}),new Ae(t,"table-attrs",this.type,r,n))}}});var Ke,zr=b(()=>{"use strict";P();Ce();Mr();Ke=class extends Xe{lint(i=this.getAbsoluteIndex()){let e=super.lint(i),t=this.childNodes.find(({type:d})=>d==="table-inter");if(!t)return e;let r=t.childNodes.find(d=>d.text().trim()),n=/^\s*(?:!|\{\{\s*![!-]?\s*\}\})/u,s=we("arg"),a=we("magic-word");if(!r||n.test(String(r))||s(r)&&n.test(r.default||""))return e;if(a(r))try{if(r.getPossibleValues().every(d=>n.test(d.text())))return e}catch(d){}let o=v(t,{start:i},"content to be moved out from the table");return e.push({...o,startIndex:o.startIndex+1,startLine:o.startLine+1,startCol:0}),e}}});var os,Wt,Xn=b(()=>{"use strict";P();Ce();A();zr();dt();os=/^\n[^\S\n]*(?:\|\}|\{\{\s*!\s*\}\}\}|\{\{\s*!\)\s*\}\})$/u,Wt=class extends Ke{constructor(e,t,r=m.getConfig(),n=[]){super(/^(?:\{\||\{\{\{\s*!\s*\}\}|\{\{\s*\(!\s*\}\})$/u,e,t,r,n,{});f(this,"type","table")}get closed(){return this.lastChild.type==="table-syntax"}lint(e=this.getAbsoluteIndex()){let t=super.lint(e);return this.closed||t.push(v(this.firstChild,{start:e},m.msg("unclosed $1","table"))),t}close(e=`
23
+ |}`,t=!1){let r=this.getAttribute("config"),n=this.getAttribute("accum"),s=[e],a=nt.run(()=>super.insertAt(new he(void 0,os,"table-syntax",r,n,{})));this.lastChild.replaceChildren(...s)}json(){return{...super.json(),closed:this.closed}}}});var _t,Kn=b(()=>{"use strict";A();zr();_t=class extends Ke{constructor(e,t,r=m.getConfig(),n=[]){super(/^\n[^\S\n]*(?:\|-+|\{\{\s*!\s*\}\}-+|\{\{\s*!-\s*\}\}-*)$/u,e,t,r,n,{});f(this,"type","tr")}}});var ee,Ut,Jn,Ht,Yn=b(()=>{"use strict";P();de();A();F();Mr();Ht=class extends Xe{constructor(e,t,r=m.getConfig(),n=[]){var d;let s=/\||\0\d+!\x7F/u.exec(t!=null?t:""),a=s?t.slice(0,s.index):"";/\[\[|-\{/u.test(a)&&(s=null,a="");super(/^(?:\n[^\S\n]*(?:[|!]|\|\+|\{\{\s*!\s*\}\}\+?)|(?:\||\{\{\s*!\s*\}\}){2}|!!|\{\{\s*!!\s*\}\})$/u,e,a,r,n);k(this,Ut);f(this,"type","td");k(this,ee,"");s&&([mt(this,ee)._]=s);let o=new x(t==null?void 0:t.slice(((d=s==null?void 0:s.index)!=null?d:NaN)+u(this,ee).length),r,n);o.type="td-inner",o.setAttribute("stage",4),this.insertAt(o)}get subtype(){return w(this,Ut,Jn).call(this).subtype}afterBuild(){u(this,ee).includes("\0")&&S(this,ee,this.buildFromStr(u(this,ee),0))}toString(e){let{childNodes:[t,r,n]}=this;return`${t.toString()}${r.toString()}${u(this,ee)}${n.toString()}`}text(){let{childNodes:[e,t,r]}=this;return`${e.text()}${t.text()}${u(this,ee)}${r.text()}`}getGaps(e){return e===1?u(this,ee).length:0}lint(e=this.getAbsoluteIndex()){let t=super.lint(e);e+=this.getRelativeIndex(this.length-1);for(let r of this.lastChild.childNodes)if(r.type==="text"){let{data:n}=r;n.includes("|")&&t.push(v(r,{start:e},'additional "|" in a table cell',n.includes("||")?"error":"warning"))}return t}print(){let{childNodes:[e,t,r]}=this;return`<span class="wpb-td">${e.print()}${t.print()}${u(this,ee)}${r.print()}</span>`}json(){return{...super.json(),subtype:this.subtype}}};ee=new WeakMap,Ut=new WeakSet,Jn=function(){let e=this.firstChild.text(),t=e.slice(-1),r="td";return t==="!"?r="th":t==="+"&&(r="caption"),{subtype:r}}});var Je,Wr=b(()=>{"use strict";ke();Je=class extends Q{}});var Ye,_r=b(()=>{"use strict";Wr();Ye=class extends Je{constructor(){super(...arguments);f(this,"type","dd")}}});var ei={};_(ei,{parseTable:()=>ls});var as,ls,ti=b(()=>{"use strict";A();F();Xn();Kn();Yn();_r();as=l=>l.lastChild.constructor!==x,ls=({firstChild:{data:l},type:i,name:e},t=m.getConfig(),r=[])=>{let n=[],s=l.split(`
24
+ `),a=i==="root"||i==="parameter-value"||i==="ext-inner"&&e==="poem"?"":`
25
+ ${s.shift()}`,o,d=(p,h)=>{if(!h){a+=p;return}let{lastChild:c}=h;if(as(h)){let T=new x(p,t,r);T.type="table-inter",T.setAttribute("stage",3),h.insertAt(T)}else c.setText(String(c)+p)},g=()=>o.type==="td"?n.pop():o;for(let p of s){o=n.pop();let[h]=/^(?:\s|\0\d+c\x7F)*/u.exec(p),c=p.slice(h.length),T=/^(:*)((?:\s|\0\d+c\x7F)*)(\{\||\{(?:\0\d+c\x7F)*\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(c);if(T){for(;o&&o.type!=="td";)o=n.pop();let[,E,B,L,O]=T;E&&new Ye(E,t,r),d(`
26
+ ${h}${E&&`\0${r.length-1}d\x7F`}${B}\0${r.length}b\x7F`,o),n.push(...o?[o]:[],new Wt(L,O,t,r));continue}else if(!o){a+=`
27
+ ${p}`;continue}let y=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(c);if(!y){d(`
28
+ ${p}`,o),n.push(o);continue}let[,N,q,I,C]=y;if(N){for(;o.type!=="table";)o=n.pop();o.close(`
29
+ ${h}${N}`,!0),d(C,n[n.length-1])}else if(q){o=g(),o.type==="tr"&&(o=n.pop());let E=new _t(`
30
+ ${h}${q}`,C,t,r);n.push(o,E),o.insertAt(E)}else{o=g();let E=I==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu,B=E.exec(C),L=0,O=`
31
+ ${h}${I}`,M=oe=>{let re=new Ht(O,C.slice(L,B==null?void 0:B.index),t,r);return oe.insertAt(re),re};for(;B;)M(o),{lastIndex:L}=E,[O]=B,B=E.exec(C);n.push(o,M(o))}}return a.slice(1)}});var Dt,ri=b(()=>{"use strict";ke();Dt=class extends Q{constructor(){super(...arguments);f(this,"type","hr")}}});var Vt,ni=b(()=>{"use strict";je();A();ke();Vt=class extends ue(Q){constructor(e,t,r=m.getConfig(),n=[]){super(e,r,n);f(this,"type","double-underscore")}getAttribute(e){return e==="padding"?2:super.getAttribute(e)}toString(e){return`__${this.innerText}__`}print(){return super.print({pre:"__",post:"__"})}}});var ii={};_(ii,{parseHrAndDoubleUnderscore:()=>ds});var ds,si=b(()=>{"use strict";A();ri();ni();vr();ds=({firstChild:{data:l},type:i,name:e},t=m.getConfig(),r=[])=>{let{doubleUnderscore:n}=t,s=new Set(n[0]),a=new Set(n[1]);return i!=="root"&&(i!=="ext-inner"||e!=="poem")&&(l=`\0${l}`),l=l.replace(/^((?:\0\d+c\x7F)*)(-{4,})/gmu,(o,d,g)=>(new Dt(g,t,r),`${d}\0${r.length-1}r\x7F`)).replace(new RegExp(`__(${n.flat().join("|")})__`,"giu"),(o,d)=>{let g=a.has(d);return g||s.has(d.toLowerCase())?(new Vt(d,g,t,r),`\0${r.length-1}u\x7F`):o}).replace(/^((?:\0\d+c\x7F)*)(={1,6})(.+)\2((?:[^\S\n]|\0\d+c\x7F)*)$/gmu,(o,d,g,p,h)=>{let c=`${d}\0${r.length}h\x7F`;return new Me(g.length,[p,h],t,r),c}),i==="root"||i==="ext-inner"&&e==="poem"?l:l.slice(1)}});var Zt,oi=b(()=>{"use strict";Gt();Zt=class extends ve{constructor(){super(...arguments);f(this,"type","category")}}});var Qt,ai=b(()=>{"use strict";P();A();ke();Qt=class extends Q{constructor(){super(...arguments);f(this,"type","quote")}get bold(){return this.innerText.length!==2}get italic(){return this.innerText.length!==3}lint(e=this.getAbsoluteIndex()){let{previousSibling:t,nextSibling:r,bold:n}=this,s=m.msg('lonely "$1"',"'"),a=[],o;if((t==null?void 0:t.type)==="text"&&t.data.endsWith("'")){o=$(this,{start:e},s);let{startIndex:d,startLine:g,startCol:p}=o,[,{length:h}]=/(?:^|[^'])('+)$/u.exec(t.data),c=e-h;a.push({...o,startIndex:c,endIndex:d,startCol:p-h,endLine:g,endCol:p})}if((r==null?void 0:r.type)==="text"&&r.data.startsWith("'")){o!=null||(o=$(this,{start:e},s));let{endIndex:d,endLine:g,endCol:p}=o,[{length:h}]=/^'+/u.exec(r.data),c=d+h;a.push({...o,startIndex:d,endIndex:c,startLine:g,startCol:p,endCol:p+h})}return n&&this.closest("heading-title")&&(o!=null||(o=$(this,{start:e},s)),a.push({...o,message:m.msg("bold in section header"),severity:"warning"})),a}json(){return{...super.json(),bold:this.bold,italic:this.italic}}}});var Hr={};_(Hr,{parseQuotes:()=>ps});var ps,Ur=b(()=>{"use strict";A();ai();ps=(l,i=m.getConfig(),e=[])=>{var g;let t=l.split(/('{2,})/u),{length:r}=t;if(r===1)return l;let n=0,s=0,a,o,d;for(let p=1;p<r;p+=2){let{length:h}=t[p];switch(h){case 2:s++;break;case 4:t[p-1]+="'",t[p]="'''";case 3:if(n++,a!==void 0)break;t[p-1].endsWith(" ")?o===void 0&&d===void 0&&(d=p):t[p-1].slice(-2,-1)===" "?a=p:o!=null||(o=p);break;default:t[p-1]+="'".repeat(h-5),t[p]="'''''",s++,n++}}if(s%2===1&&n%2===1){let p=(g=a!=null?a:o)!=null?g:d;p!==void 0&&(t[p]="''",t[p-1]+="'")}for(let p=1;p<r;p+=2)new Qt(t[p],i,e),t[p]=`\0${e.length-1}q\x7F`;return t.join("")}});var di={};_(di,{parseLinks:()=>li});var li,pi=b(()=>{"use strict";A();jr();Pr();oi();li=(l,i=m.getConfig(),e=[])=>{let{parseQuotes:t}=(Ur(),R(Hr)),r=i.inExt?/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)(.*?[^\]]))?\]\](.*)$/su:/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(?:(\||\0\d+!\x7F)(.*?[^\]])?)?\]\](.*)$/su,n=/^((?:(?!\0\d+!\x7F)[^\n[\]{}|])+)(\||\0\d+!\x7F)(.*)$/su,s=new RegExp(`^\\s*(?:${i.protocol}|//)`,"iu"),a=l.split("[["),o=a.shift();for(let d=0;d<a.length;d++){let g=!1,p,h,c,T,y=a[d],N=r.exec(y);if(N)[,p,h,c,T]=N,T.startsWith("]")&&(c!=null&&c.includes("["))&&(c+="]",T=T.slice(1));else{let L=n.exec(y);L&&(g=!0,[,p,h,c]=L)}if(p===void 0||s.test(p)||/\0\d+[exhbru]\x7F/u.test(p)){o+=`[[${y}`;continue}let q=p.trim().startsWith(":");if(q&&g){o+=`[[${y}`;continue}let I=m.normalizeTitle(p,0,!1,i,!0,!0,!0),{ns:C,valid:E}=I;if(E){if(g){if(C!==6){o+=`[[${y}`;continue}let L=!1;for(d++;d<a.length;d++){let O=a[d],M=O.split("]]");if(M.length>2){L=!0,c+=`[[${M[0]}]]${M[1]}`,T=M.slice(2).join("]]");break}else if(M.length===2)c+=`[[${M[0]}]]${M[1]}`;else{c+=`[[${O}`;break}}if(c=li(c,i,e),!L){o+=`[[${p}${h}${c}`;continue}}}else{o+=`[[${y}`;continue}c&&(c=t(c,i,e)),o+=`\0${e.length}l\x7F${T}`;let B=De;q||(C===6?B=He:C===14&&(B=Zt)),c===void 0&&h&&(c=""),new B(p,c,i,e,h)}return o}});var gi={};_(gi,{parseExternalLinks:()=>gs});var gs,ui=b(()=>{"use strict";Z();A();Br();gs=(l,i=m.getConfig(),e=[])=>{let t=new RegExp(`\\[((?:(?:${i.protocol}|//)${xe}|\0\\d+m\x7F)${be}(?=[[\\]<>"\\t\\p{Zs}]|\0\\d))(\\p{Zs}*(?=\\P{Zs}))([^\\]-\b
32
+ -\uFFFD]*)\\]`,"giu");return l.replace(t,(r,n,s,a)=>{let{length:o}=e,d=/&[lg]t;/u.exec(n);return d&&(n=n.slice(0,d.index),s="",a=`${n.slice(d.index)}${s}${a}`),new Ze(n,s,a,i,e),`\0${o}w\x7F`})}});var hi={};_(hi,{parseMagicLinks:()=>us});var us,mi=b(()=>{"use strict";Z();A();qr();us=(l,i=m.getConfig(),e=[])=>{let t=new RegExp(`(^|[^\\p{L}\\d_])(?:${i.protocol})(${xe}${be})`,"giu");return l.replace(t,(r,n,s)=>{let a="",o=n?r.slice(1):r,d=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(o);d&&(a=o.slice(d.index),o=o.slice(0,d.index));let g=new RegExp(`[,;.:!?${o.includes("(")?"":")"}]+$`,"u"),p=g.exec(o);if(p){let h=0;p[0].startsWith(";")&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(o.slice(0,p.index))&&(h=1),a=`${o.slice(p.index+h)}${a}`,o=o.slice(0,p.index+h)}return a.length>=s.length?r:(new Ve(o,!1,i,e),`${n}\0${e.length-1}w\x7F${a}`)})}});var Xt,ci=b(()=>{"use strict";Wr();Xt=class extends Je{constructor(){super(...arguments);f(this,"type","list")}}});var fi={};_(fi,{parseList:()=>hs});var hs,Ti=b(()=>{"use strict";A();ci();_r();hs=(l,i=m.getConfig(),e=[])=>{let t=/^((?:\0\d+c\x7F)*)([;:*#]+)/u.exec(l);if(!t)return l;let[r,n,s]=t,a=`${n}\0${e.length}d\x7F${l.slice(r.length)}`,o=s.split(";").length-1;if(new Xt(s,i,e),!o)return a;let d=/:+|-\{/gu,g=d.exec(a),p=0,h=(c,T)=>(new Ye(c,i,e),`${a.slice(0,T)}\0${e.length-1}d\x7F${a.slice(T+c.length)}`);for(;g&&o;){let{0:c,index:T}=g;if(c.startsWith(":")){if(c.length>=o)return h(c.slice(0,o),T);o-=c.length,d.lastIndex=T+4+String(e.length).length,a=h(c,T)}else if(c==="-{"){if(!p){let{lastIndex:y}=d;d=/-\{|\}-/gu,d.lastIndex=y}p++}else if(p--,!p){let{lastIndex:y}=d;d=/:+|-\{/gu,d.lastIndex=y}g=d.exec(a)}return a}});var xi,bi=b(()=>{"use strict";xi=l=>{class i extends l{}return i}});var ms,fe,Kt,ki=b(()=>{"use strict";P();A();F();me();ms=new Set(["A","T","R","D","-","H","N"]),Kt=class extends x{constructor(e,t=m.getConfig(),r=[]){super(void 0,t,r,{});f(this,"type","converter-flags");k(this,fe,void 0);this.append(...e.map(n=>new G(n,"converter-flag",t,r)))}afterBuild(){S(this,fe,this.childNodes.map(e=>e.text().trim()))}toString(e){return super.toString(e,";")}text(){return super.text(";")}getGaps(){return 1}getUnknownFlags(){return new Set(u(this,fe).filter(e=>/\{{3}[^{}]+\}{3}/u.test(e)))}getVariantFlags(){let e=new Set(this.getAttribute("config").variants);return new Set(u(this,fe).filter(t=>e.has(t)))}lint(e=this.getAbsoluteIndex()){let t=this.getVariantFlags(),r=this.getUnknownFlags(),n=new Set(u(this,fe).filter(h=>ms.has(h))),{length:s}=u(this,fe).filter(h=>!h),a=u(this,fe).length-r.size-s,o=super.lint(e);if(t.size===a||n.size===a)return o;let d={start:e,...this.getRootNode().posFromIndex(e)},{childNodes:g,length:p}=this;for(let h=0;h<p;h++){let c=g[h],T=c.text().trim();T&&!t.has(T)&&!r.has(T)&&(t.size>0||!n.has(T))&&o.push(v(c,d,"invalid conversion flag"))}return o}print(){return super.print({sep:";"})}};fe=new WeakMap});var et,yi=b(()=>{"use strict";A();F();me();et=class extends x{constructor(e,t=!0,r=m.getConfig(),n=[]){super(void 0,r,n);f(this,"type","converter-rule");let s=e.indexOf(":"),a=e.slice(0,s).indexOf("=>"),o=a===-1?e.slice(0,s):e.slice(a+2,s);t&&r.variants.includes(o.trim())?(super.insertAt(new G(o,"converter-rule-variant",r,n)),super.insertAt(new G(e.slice(s+1),"converter-rule-to",r,n)),a!==-1&&super.insertAt(new G(e.slice(0,a),"converter-rule-from",r,n),0)):super.insertAt(new G(e,"converter-rule-to",r,n))}toString(e){let{childNodes:t}=this;if(t.length===3){let[r,n,s]=t;return`${r.toString(e)}=>${n.toString(e)}:${s.toString(e)}`}return super.toString(e,":")}text(){let{childNodes:e}=this;if(e.length===3){let[t,r,n]=e;return`${t.text()}=>${r.text()}:${n.text()}`}return super.text(":")}getGaps(e){return e===0&&this.length===3?2:1}print(){let{childNodes:e}=this;if(e.length===3){let[t,r,n]=e;return`<span class="wpb-converter-rule">${t.print()}=>${r.print()}:${n.print()}</span>`}return super.print({sep:":"})}}});var Jt,Ai=b(()=>{"use strict";Z();bi();A();F();ki();yi();Jt=class extends xi(x){constructor(e,t,r=m.getConfig(),n=[]){super(void 0,r,n);f(this,"type","converter");this.append(new Kt(e,r,n));let[s]=t,a=s.includes(":"),o=new et(s,a,r,n);a&&o.length===1?this.insertAt(new et(t.join(";"),!1,r,n)):this.append(o,...t.slice(1).map(d=>new et(d,!0,r,n)))}toString(e){let{childNodes:[t,...r]}=this;return`-{${t.toString()}${t.length>0?"|":""}${r.map(n=>n.toString()).join(";")}}-`}text(){let{childNodes:[e,...t]}=this;return`-{${e.text()}|${pe(t,";")}}-`}getAttribute(e){return e==="padding"?2:super.getAttribute(e)}getGaps(e){return e||this.firstChild.length>0?1:0}print(){let{childNodes:[e,...t]}=this;return`<span class="wpb-converter">-{${e.print()}${e.length>0?"|":""}${ge(t,{sep:";"})}}-</span>`}}});var vi={};_(vi,{parseConverter:()=>cs});var cs,Si=b(()=>{"use strict";A();Ai();cs=(l,i=m.getConfig(),e=[])=>{let t=/-\{/gu,r=/-\{|\}-/gu,n=[],s=t,a=s.exec(l);for(;a;){let{0:o,index:d}=a;if(o==="}-"){let g=n.pop(),{length:p}=e,h=l.slice(g.index+2,d),c=h.indexOf("|"),[T,y]=c===-1?[[],h]:[h.slice(0,c).split(";"),h.slice(c+1)],N=y.replace(/(&[#a-z\d]+);/giu,"$1"),q=`(?:${i.variants.join("|")})`,I=N.split(new RegExp(`;(?=(?:[^;]*?=>)?\\s*${q}\\s*:|(?:\\s|\0\\d+c\x7F)*$)`,"u")).map(C=>C.replace(/\x01/gu,";"));new Jt(T,I,i,e),l=`${l.slice(0,g.index)}\0${p}v\x7F${l.slice(d+2)}`,n.length===0&&(s=t),s.lastIndex=g.index+3+String(p).length}else n.push(a),s=r,s.lastIndex=d+2;a=s.exec(l)}return l}});var Vr={};_(Vr,{Token:()=>x});var te,j,z,Pe,ut,Dr,Yt,$i,er,wi,tr,Ci,rr,Ni,nr,Fi,ir,Ei,sr,Li,or,Ii,ar,Pi,lr,Ri,dr,Gi,Zr,x,F=b(()=>{"use strict";Z();de();A();nn();an();Zr=class Zr extends Tt{constructor(e,t=m.getConfig(),r=[],n){super();k(this,ut);k(this,Yt);k(this,er);k(this,tr);k(this,rr);k(this,nr);k(this,ir);k(this,sr);k(this,or);k(this,ar);k(this,lr);k(this,dr);f(this,"type","root");k(this,te,0);k(this,j,void 0);k(this,z,void 0);k(this,Pe,void 0);typeof e=="string"&&this.insertAt(e),S(this,j,t),S(this,z,r),r.push(this)}parseOnce(e=u(this,te),t=!1){if(e<u(this,te)||!this.getAttribute("plain")||this.length===0)return this;if(u(this,te)>=11)return this;switch(e){case 0:this.type==="root"&&u(this,z).shift(),S(this,Pe,t),w(this,Yt,$i).call(this,t);break;case 1:w(this,er,wi).call(this);break;case 2:w(this,tr,Ci).call(this);break;case 3:w(this,rr,Ni).call(this);break;case 4:w(this,nr,Fi).call(this);break;case 5:w(this,ir,Ei).call(this);break;case 6:w(this,sr,Li).call(this);break;case 7:w(this,or,Ii).call(this);break;case 8:w(this,ar,Pi).call(this);break;case 9:w(this,lr,Ri).call(this);break;case 10:w(this,dr,Gi).call(this)}if(this.type==="root")for(let r of u(this,z))r.parseOnce(e,t);return mt(this,te)._++,this}buildFromStr(e,t){let r=e.split(/[\0\x7F]/u).map((n,s)=>{if(s%2===0)return new ot(n);if(Number.isNaN(Number(n.slice(-1))))return u(this,z)[Number(n.slice(0,-1))];throw new Error(`\u89E3\u6790\u9519\u8BEF\uFF01\u672A\u6B63\u786E\u6807\u8BB0\u7684 Token\uFF1A${n}`)});return t===0?r.map(String).join(""):t===1?pe(r):r}afterBuild(){if(this.type==="root")for(let e of u(this,z))e.afterBuild()}parse(e=11,t=!1){for(e=Math.min(e,11);u(this,te)<e;)this.parseOnce(u(this,te),t);return e&&(w(this,ut,Dr).call(this),this.afterBuild()),this}getAttribute(e){switch(e){case"plain":return this.constructor===Zr;case"config":return JSON.parse(JSON.stringify(u(this,j)));case"accum":return u(this,z);case"include":{if(u(this,Pe)!==void 0)return u(this,Pe);let t=this.getRootNode();return t!==this&&t.getAttribute("include")}default:return super.getAttribute(e)}}setAttribute(e,t){switch(e){case"stage":u(this,te)===0&&this.type==="root"&&u(this,z).shift(),S(this,te,t);break;default:super.setAttribute(e,t)}}insertAt(e,t=this.length){let r=typeof e=="string"?new ot(e):e;return super.insertAt(r,t),r.type==="root"&&(r.type="plain"),r}normalizeTitle(e,t=0,r=!1,n=!1,s=!1){return m.normalizeTitle(e,t,u(this,Pe),u(this,j),r,n,s)}};te=new WeakMap,j=new WeakMap,z=new WeakMap,Pe=new WeakMap,ut=new WeakSet,Dr=function(){var n;S(this,te,11);let{length:e,firstChild:t}=this,r=String(t);if(e===1&&t.type==="text"&&r.includes("\0")&&(this.replaceChildren(...this.buildFromStr(r)),this.normalize(),this.type==="root"))for(let s of u(this,z))w(n=s,ut,Dr).call(n)},Yt=new WeakSet,$i=function(e){let{parseCommentAndExt:t}=(Dn(),R(Un));this.setText(t(String(this.firstChild),u(this,j),u(this,z),e))},er=new WeakSet,wi=function(){let{parseBraces:e}=($r(),R(Fn)),t=this.type==="root"?String(this.firstChild):`\0${String(this.firstChild)}`,r=e(t,u(this,j),u(this,z));this.setText(this.type==="root"?r:r.slice(1))},tr=new WeakSet,Ci=function(){var t;if((t=u(this,j).excludes)!=null&&t.includes("html"))return;let{parseHtml:e}=(Qn(),R(Zn));this.setText(e(String(this.firstChild),u(this,j),u(this,z)))},rr=new WeakSet,Ni=function(){var t;if((t=u(this,j).excludes)!=null&&t.includes("table"))return;let{parseTable:e}=(ti(),R(ei));this.setText(e(this,u(this,j),u(this,z)))},nr=new WeakSet,Fi=function(){var t;if((t=u(this,j).excludes)!=null&&t.includes("hr"))return;let{parseHrAndDoubleUnderscore:e}=(si(),R(ii));this.setText(e(this,u(this,j),u(this,z)))},ir=new WeakSet,Ei=function(){let{parseLinks:e}=(pi(),R(di));this.setText(e(String(this.firstChild),u(this,j),u(this,z)))},sr=new WeakSet,Li=function(){var r;if((r=u(this,j).excludes)!=null&&r.includes("quote"))return;let{parseQuotes:e}=(Ur(),R(Hr)),t=String(this.firstChild).split(`
33
33
  `);for(let n=0;n<t.length;n++)t[n]=e(t[n],u(this,j),u(this,z));this.setText(t.join(`
34
- `))},ir=new WeakSet,Ni=function(){var t;if((t=u(this,j).excludes)!=null&&t.includes("extLink"))return;let{parseExternalLinks:e}=(li(),P(ai));this.setText(e(String(this.firstChild),u(this,j),u(this,z)))},sr=new WeakSet,Fi=function(){var t;if((t=u(this,j).excludes)!=null&&t.includes("magicLink"))return;let{parseMagicLinks:e}=(pi(),P(di));this.setText(e(String(this.firstChild),u(this,j),u(this,z)))},or=new WeakSet,Ei=function(){var n;if((n=u(this,j).excludes)!=null&&n.includes("list"))return;let{parseList:e}=(hi(),P(ui)),t=String(this.firstChild).split(`
34
+ `))},or=new WeakSet,Ii=function(){var t;if((t=u(this,j).excludes)!=null&&t.includes("extLink"))return;let{parseExternalLinks:e}=(ui(),R(gi));this.setText(e(String(this.firstChild),u(this,j),u(this,z)))},ar=new WeakSet,Pi=function(){var t;if((t=u(this,j).excludes)!=null&&t.includes("magicLink"))return;let{parseMagicLinks:e}=(mi(),R(hi));this.setText(e(String(this.firstChild),u(this,j),u(this,z)))},lr=new WeakSet,Ri=function(){var n;if((n=u(this,j).excludes)!=null&&n.includes("list"))return;let{parseList:e}=(Ti(),R(fi)),t=String(this.firstChild).split(`
35
35
  `),r=this.type==="root"||this.type==="ext-inner"&&this.name==="poem"?0:1;for(;r<t.length;r++)t[r]=e(t[r],u(this,j),u(this,z));this.setText(t.join(`
36
- `))},ar=new WeakSet,Li=function(){if(u(this,j).variants.length>0){let{parseConverter:e}=(ki(),P(bi));this.setText(e(String(this.firstChild),u(this,j),u(this,z)))}};T=Hr});var us,Re,Ii,hs,h,A=b(()=>{Ce();de();us=l=>l.replace(/[\0\x7F]/gu,""),Re={i18n:void 0,getConfig(){return{...Qr,...this.config,excludes:[]}},msg(l,i=""){var e,t;return l&&((t=(e=this.i18n)==null?void 0:e[l])!=null?t:l).replace("$1",this.msg(i))},normalizeTitle(l,i=0,e=!1,t=Re.getConfig(),r=!1,n=!1,s=!1){let{Title:o}=(Yr(),P(Jr));if(r)return new o(l,i,t,n,s);let{Token:a}=(C(),P(Dr)),d=nt.run(()=>new a(l,t).parseOnce(0,e).parseOnce());return new o(String(d),i,t,n,s)},parse(l,i,e=11,t=Re.getConfig()){let{Token:r}=(C(),P(Dr));return nt.run(()=>new r(us(l),t).parse(e,i))}},Ii={},hs=new Set(["normalizeTitle","parse"]);for(let l in Re)hs.has(l)||(Ii[l]={enumerable:!1});Object.defineProperties(Re,Ii);typeof self=="object"?Object.assign(self,{Parser:Re}):typeof globalThis=="object"&&Object.assign(globalThis,{Parser:Re});h=Re});A();})();
36
+ `))},dr=new WeakSet,Gi=function(){if(u(this,j).variants.length>0){let{parseConverter:e}=(Si(),R(vi));this.setText(e(String(this.firstChild),u(this,j),u(this,z)))}};x=Zr});var fs,Re,ji,Ts,m,A=b(()=>{Ce();de();fs=l=>l.replace(/[\0\x7F]/gu,""),Re={i18n:void 0,getConfig(){return{...Kr,...this.config,excludes:[]}},msg(l,i=""){var e,t;return l&&((t=(e=this.i18n)==null?void 0:e[l])!=null?t:l).replace("$1",this.msg(i))},normalizeTitle(l,i=0,e=!1,t=Re.getConfig(),r=!1,n=!1,s=!1){let{Title:a}=(tn(),R(en));if(r)return new a(l,i,t,n,s);let{Token:o}=(F(),R(Vr)),d=nt.run(()=>new o(l,t).parseOnce(0,e).parseOnce());return new a(String(d),i,t,n,s)},parse(l,i,e=11,t=Re.getConfig()){let{Token:r}=(F(),R(Vr));return nt.run(()=>new r(fs(l),t).parse(e,i))}},ji={},Ts=new Set(["normalizeTitle","parse"]);for(let l in Re)Ts.has(l)||(ji[l]={enumerable:!1});Object.defineProperties(Re,ji);typeof self=="object"?Object.assign(self,{Parser:Re}):typeof globalThis=="object"&&Object.assign(globalThis,{Parser:Re});m=Re});A();})();
@@ -1,6 +1,6 @@
1
1
  (() => {
2
2
  const workerJS = () => {
3
- importScripts('https://testingcf.jsdelivr.net/npm/wikiparser-node@1.3.9-b/bundle/bundle.min.js');
3
+ importScripts('https://testingcf.jsdelivr.net/npm/wikiparser-node@1.4.0-b/bundle/bundle.min.js');
4
4
  const entities = { '&': 'amp', '<': 'lt', '>': 'gt' };
5
5
  self.onmessage = ({ data }) => {
6
6
  const [command, qid, wikitext, include, stage] = data;
package/i18n/zh-hans.json CHANGED
@@ -5,6 +5,7 @@
5
5
  "additional \"|\" in the link text": "链接文本中多余的\"|\"",
6
6
  "attributes of a closing tag": "位于闭合标签的属性",
7
7
  "bold": "粗体单引号",
8
+ "bold in section header": "段落标题中的粗体",
8
9
  "conflicting image $1 parameter": "冲突的图片$1参数",
9
10
  "containing invalid attribute": "包含无效属性",
10
11
  "content to be moved out from the table": "将被移出表格的内容",
package/i18n/zh-hant.json CHANGED
@@ -5,6 +5,7 @@
5
5
  "additional \"|\" in the link text": "連結文本中多餘的\"|\"",
6
6
  "attributes of a closing tag": "位於閉合標籤的屬性",
7
7
  "bold apostrophes": "粗體撇號",
8
+ "bold in section header": "段落標題中的粗體",
8
9
  "conflicting image $1 parameter": "衝突的圖片$1參數",
9
10
  "containing invalid attribute": "包含無效屬性",
10
11
  "content to be moved out from the table": "將被移出表格的內容",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wikiparser-node",
3
- "version": "1.3.9-b",
3
+ "version": "1.4.0-b",
4
4
  "description": "A Node.js parser for MediaWiki markup with AST",
5
5
  "keywords": [
6
6
  "mediawiki",