wikiparser-node 0.6.2-b → 0.6.5-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.
- package/bundle/bundle.min.js +36 -30
- package/package.json +6 -4
package/bundle/bundle.min.js
CHANGED
|
@@ -1,34 +1,40 @@
|
|
|
1
|
-
(()=>{var Tt=Object.defineProperty;var $t=(
|
|
2
|
-
`);return{top:
|
|
3
|
-
`);return{height:t.length,width:t.at(-1).length}},d=new WeakSet,st=function(t){var s,
|
|
4
|
-
`),
|
|
5
|
-
`,"{":"\\}{2,}|\\|","-":"\\}-","[":"\\]\\]"},
|
|
6
|
-
`,index:
|
|
7
|
-
`){
|
|
8
|
-
-\uFFFD]*)\\]`,"giu");return
|
|
9
|
-
`);let
|
|
10
|
-
${
|
|
11
|
-
${
|
|
12
|
-
${
|
|
13
|
-
${
|
|
14
|
-
${
|
|
15
|
-
${
|
|
16
|
-
${
|
|
17
|
-
`).map(
|
|
1
|
+
(()=>{var Tt=Object.defineProperty;var $t=(G,O,H)=>O in G?Tt(G,O,{enumerable:!0,configurable:!0,writable:!0,value:H}):G[O]=H;var S=(G,O,H)=>($t(G,typeof O!="symbol"?O+"":O,H),H),tt=(G,O,H)=>{if(!O.has(G))throw TypeError("Cannot "+H)};var A=(G,O,H)=>(tt(G,O,"read from private field"),H?H.call(G):O.get(G)),P=(G,O,H)=>{if(O.has(G))throw TypeError("Cannot add the same private member more than once");O instanceof WeakSet?O.add(G):O.set(G,H)},M=(G,O,H,J)=>(tt(G,O,"write to private field"),J?J.call(G,H):O.set(G,H),H),et=(G,O,H,J)=>({set _(m){M(G,O,m,H)},get _(){return A(G,O,J)}}),U=(G,O,H)=>(tt(G,O,"access private method"),H);(()=>{var G={6010:(m,C,e)=>{"use strict";const f={config:void 0,minConfig:e(8166),MAX_STAGE:11,getConfig(){return{...this.minConfig,...this.config}},normalizeTitle(c,u=0,a=!1,d=f.getConfig(),o=!1){let n;if(!o){const i=e(8138);n=this.run(()=>{const r=new i(String(c),d),l=r.getAttribute("parseOnce");return l(0,a),l()}),c=n.firstChild}const t=e(6986);return new t(String(c),u,d)},parse(c,u,a=f.MAX_STAGE,d=f.getConfig()){const o=e(8138);let n;return this.run(()=>{typeof c=="string"?n=new o(c,d):c instanceof o&&(n=c,c=String(n)),n.parse(a,u)}),n},run(c){return c()},print(c,u=!1,a=f.getConfig()){return`<div class="wikiparser">${this.parse(c,u,this.MAX_STAGE,a).print()} </div>`},lint(c,u=!1,a=f.getConfig()){return this.parse(c,u,this.MAX_STAGE,a).lint()}},x={};for(const c in f)["MAX_STAGE","minConfig"].includes(c)?x[c]={enumerable:!1,writable:!1}:["config","normalizeTitle","parse","print","lint"].includes(c)||(x[c]={enumerable:!1});Object.defineProperties(f,x),typeof window=="object"&&(window.Parser=f),m.exports=f},9205:(m,C,e)=>{"use strict";const{print:f}=e(231),x=e(3853),c=e(7507),a=class extends x{constructor(){super(...arguments);S(this,"name")}get length(){return this.childNodes.length}get children(){return this.childNodes.filter(({type:t})=>t!=="text")}get firstElementChild(){return this.childNodes.find(({type:n})=>n!=="text")}get lastElementChild(){return this.children.at(-1)}append(...n){for(const t of n)this.insertAt(t)}replaceChildren(...n){for(let t=this.childNodes.length-1;t>=0;t--)this.removeAt(t);this.append(...n)}setText(n,t=0){const s=this.childNodes.at(t),{type:i,data:r}=s;if(i==="text")return s.replaceData(n),r}toString(n,t=""){return this.childNodes.map(s=>s.toString()).join(t)}lint(n=0){const t=e(8058);if(this instanceof t||this.constructor.hidden||this.type==="ext-inner"&&a.lintIgnoredExt.has(this.name))return[];const s=[];for(let i=0,r=n+this.getPadding();i<this.childNodes.length;i++){const l=this.childNodes[i];s.push(...l.lint(r)),r+=String(l).length+this.getGaps(i)}return s}print(n={}){var t;return String(this)?`<span class="wpb-${(t=n.class)!=null?t:this.type}">${f(this.childNodes,n)}</span>`:""}};let u=a;S(u,"lintIgnoredExt",new Set(["nowiki","pre","charinsert","score","syntaxhighlight","source","math","chem","ce","graph","mapframe","maplink","quiz","templatedata","timeline"])),m.exports=u},3853:(m,C,e)=>{var c,u,Y,d,st;"use strict";const{text:f}=e(231);class x{constructor(){P(this,u);P(this,d);S(this,"type");S(this,"childNodes",[]);P(this,c,void 0)}get firstChild(){return this.childNodes[0]}get lastChild(){return this.childNodes.at(-1)}get parentNode(){return A(this,c)}get nextSibling(){var s;const t=(s=A(this,c))==null?void 0:s.childNodes;return t&&t[t.indexOf(this)+1]}get previousSibling(){var s;const t=(s=A(this,c))==null?void 0:s.childNodes;return t&&t[t.indexOf(this)-1]}hasAttribute(t){return t in this}getAttribute(t){return this.hasAttribute(t)?String(this[t]):void 0}setAttribute(t,s){return t==="parentNode"?M(this,c,s):this[t]=s,this}text(t=""){return f(this.childNodes,t)}removeAt(t){const s=[...this.childNodes],[i]=s.splice(t,1);return i.setAttribute("parentNode"),this.setAttribute("childNodes",s),i}insertAt(t,s=this.childNodes.length){const i=[...this.childNodes];return-1===-1&&t.setAttribute("parentNode",this),i.splice(s,0,t),this.setAttribute("childNodes",i),t}normalize(){var i;const t=e(7507),s=[...this.childNodes];for(let r=s.length-1;r>=0;r--){const{type:l,data:h}=s[r];this.getGaps(r-1)||(h===""?s.splice(r,1):l==="text"&&((i=s[r-1])==null?void 0:i.type)==="text"&&(s[r-1].setAttribute("data",s[r-1].data+h),s.splice(r,1)))}this.setAttribute("childNodes",s)}getRootNode(){let{parentNode:t}=this;for(;t!=null&&t.parentNode;)({parentNode:t}=t);return t!=null?t:this}posFromIndex(t){const s=String(this);if(t>=-s.length&&t<=s.length){const i=s.slice(0,t).split(`
|
|
2
|
+
`);return{top:i.length-1,left:i.at(-1).length}}}getPadding(){return 0}getGaps(){return 0}getRelativeIndex(t){let s;const i=(r,l)=>s.slice(0,r).reduce((h,p,g)=>h+String(p).length+l.getGaps(g),0)+l.getPadding();if(t===void 0){const{parentNode:r}=this;return r?({childNodes:s}=r,i(s.indexOf(this),r)):0}return{childNodes:s}=this,i(t,this)}getAbsoluteIndex(){const{parentNode:t}=this;return t?t.getAbsoluteIndex()+this.getRelativeIndex():0}getBoundingClientRect(){return{...U(this,u,Y).call(this),...this.getRootNode().posFromIndex(this.getAbsoluteIndex())}}get offsetHeight(){return U(this,u,Y).call(this).height}get offsetWidth(){return U(this,u,Y).call(this).width}get style(){return{...U(this,d,st).call(this),...U(this,u,Y).call(this),padding:this.getPadding()}}}c=new WeakMap,u=new WeakSet,Y=function(){const t=String(this).split(`
|
|
3
|
+
`);return{height:t.length,width:t.at(-1).length}},d=new WeakSet,st=function(t){var s,i;return t===void 0?(i=(s=this.parentNode)==null?void 0:s.posFromIndex(this.getRelativeIndex()))!=null?i:{top:0,left:0}:this.posFromIndex(this.getRelativeIndex(t))},m.exports=x},7507:(m,C,e)=>{var c,nt;"use strict";const f=e(3853),a=class extends f{constructor(n=""){super();P(this,c);S(this,"type","text");S(this,"data");this.data=n}toString(){return this.data}text(){return this.data}replaceData(n=""){U(this,c,nt).call(this,n)}lint(n=0){const{data:t}=this,s=[...t.matchAll(a.errorSyntax)];if(s.length>0){const{top:i,left:r}=this.getRootNode().posFromIndex(n);return s.map(({0:l,1:h,index:p})=>{h&&(p+=h.length,l=l.slice(h.length));const g=t.slice(0,p).split(`
|
|
4
|
+
`),T=g.length+i-1,{length:k}=g.at(-1),$=g.length>1?k:r+k;return{message:`\u5B64\u7ACB\u7684"${l[0]}"`,severity:l[0]==="{"||l[0]==="}"?"error":"warning",startLine:T,endLine:T,startCol:$,endCol:$+l.length}})}return[]}};let x=a;c=new WeakSet,nt=function(n){return n=String(n),this.setAttribute("data",n),this},S(x,"errorSyntax",/[{}]+|\[{2,}|\[(?!(?:(?!https?\b)[^[])*\])|((?:^|\])[^[]*?)\]+|<(?=\s*\/?\w+[\s/>])/giu),m.exports=x},6986:(m,C,e)=>{"use strict";const f=e(6010);class x{constructor(u,a=0,d=f.getConfig()){S(this,"valid",!0);S(this,"ns",0);const{namespaces:o,nsid:n}=d;let t=o[a];u=u.replaceAll("_"," ").trim(),u[0]===":"&&(t="",u=u.slice(1).trim());const s=u.split(":");if(s.length>1){const l=o[n[s[0].trim().toLowerCase()]];l!==void 0&&(t=l,u=s.slice(1).join(":").trim())}this.ns=n[t.toLowerCase()];const i=u.indexOf("#");let r="";i!==-1&&(r=u.slice(i+1).trimEnd(),u=u.slice(0,i).trim()),this.valid=Boolean(u||r)&&!/\0\d+[eh!+-]\x7F|[<>[\]{}|]/u.test(u)}}m.exports=x},2308:m=>{"use strict";const C=e=>{var f;return f=class extends e{text(){return""}},S(f,"hidden",!0),f};m.exports=C},8275:(m,C,e)=>{"use strict";const{removeComment:f}=e(231),x=e(6010),c=e(9450),u=e(1782),a=e(9544),d=(o,n=x.getConfig(),t=[])=>{var k,$,y,F,b;const s="^(\0\\d+c\x7F)*={1,6}|\\[\\[|\\{{2,}|-\\{(?!\\{)",i=[],r={"=":`
|
|
5
|
+
`,"{":"\\}{2,}|\\|","-":"\\}-","[":"\\]\\]"},l={"!":"!","!!":"+","(!":"{","!)":"}","!-":"-","=":"~"};let h=new RegExp(s,"gmu"),p=h.exec(o),g=o.includes("}}"),T;for(;p||T<=o.length&&(($=(k=i.at(-1))==null?void 0:k[0])==null?void 0:$[0])==="=";){if(p!=null&&p[1]){const[,{length:Q}]=p;p[0]=p[0].slice(Q),p.index+=Q}const{0:v,index:L}=p!=null?p:{0:`
|
|
6
|
+
`,index:o.length},E=(y=i.pop())!=null?y:{},{0:z,index:j,parts:R,findEqual:B,pos:V}=E,X=v==="="&&B;if(v==="]]"||v==="}-")T=L+2;else if(v===`
|
|
7
|
+
`){T=L+1;const{pos:Q,findEqual:W}=(F=i.at(-1))!=null?F:{};if(!Q||W||f(o.slice(Q,j))!==""){const K=/^(={1,6})(.+)\1((?:\s|\0\d+c\x7F)*)$/u.exec(o.slice(j,L));K&&(o=`${o.slice(0,j)}\0${t.length}h\x7F${o.slice(L)}`,T=j+4+String(t.length).length,new c(K[1].length,K.slice(2),n,t))}}else if(v==="|"||X)T=L+1,R.at(-1).push(o.slice(V,L)),v==="|"&&R.push([]),E.pos=T,E.findEqual=v==="|",i.push(E);else if(v.startsWith("}}")){const Q=v.slice(0,Math.min(z.length,3)),W=z.length-Q.length,{length:K}=t;T=L+Q.length,R.at(-1).push(o.slice(V,L));let q=!1,N="t";if(Q.length===3)new a(R.map(w=>w.join("=")),n,t);else{const w=f(R[0][0]);w in l?N=l[w]:/^(?:fullurl|canonicalurl|filepath):./iu.test(w)&&(N="m");try{new u(R[0][0],R.slice(1),n,t)}catch(I){if(I instanceof Error&&I.message.startsWith("\u975E\u6CD5\u7684\u6A21\u677F\u540D\u79F0\uFF1A"))T=j+z.length,q=!0;else throw I}}q||(o=`${o.slice(0,j+W)}\0${K}${N}\x7F${o.slice(T)}`,T=j+W+3+String(K).length,W>1?i.push({0:z.slice(0,W),index:j,pos:j+W,parts:[[]]}):W===1&&o[j-1]==="-"&&i.push({0:"-{",index:j-1,pos:j+1,parts:[[]]}))}else T=L+v.length,v[0]==="{"&&(p.pos=T,p.parts=[[]]),i.push(..."0"in E?[E]:[],p);g&&(g=o.slice(T).includes("}}"));let D=i.at(-1);!g&&((b=D==null?void 0:D[0])==null?void 0:b[0])==="{"&&(i.pop(),D=i.at(-1)),h=new RegExp(s+(D?`|${r[D[0][0]]}${D.findEqual?"|=":""}`:""),"gmu"),h.lastIndex=T,p=h.exec(o)}return o};m.exports=d},4907:(m,C,e)=>{"use strict";const f=e(6010),x=e(851),c=e(3423),u=e(8655),a=e(7267),d=e(5749),o=(n,t=f.getConfig(),s=[],i=!1)=>{const r=/<onlyinclude>(.*?)<\/onlyinclude>/gsu;if(i&&n.search(r)!==-1)return n.replaceAll(r,(T,k)=>{const $=`\0${s.length}e\x7F`;return new x(k,t,s),$}).replaceAll(/(^|\0\d+e\x7F)(.*?)(?=$|\0\d+e\x7F)/gsu,(T,k,$)=>$===""?k:(new c($,t,s),`${k}\0${s.length-1}c\x7F`));const l=t.ext.join("|"),h=i?"includeonly":"(?:no|only)include",p=i?"noinclude":"includeonly",g=new RegExp(`<!--.*?(?:-->|$)|<${h}(?:\\s[^>]*?)?>|</${h}\\s*>|<(${l})(\\s[^>]*?)?(?:/>|>(.*?)</(\\1\\s*)>)|<(${p})(\\s[^>]*?)?(?:/>|>(.*?)(?:</(\\5\\s*)>|$))`,"gisu");return n.replaceAll(g,(T,k,$,y,F,b,v,L,E)=>{const z=`\0${s.length}${k?"e":"c"}\x7F`;if(k)new a(k,$,y,F,t,s);else if(T.startsWith("<!--")){const j=T.endsWith("-->");new d(T.slice(4,j?-3:void 0),j,t,s)}else b?new u(b,v,L,E,t,s):new c(T,t,s);return z})};m.exports=o},3765:(m,C,e)=>{"use strict";const f=e(6010),x=e(9910),c=(u,a=f.getConfig(),d=[])=>{const o=/-\{/gu,n=/-\{|\}-/gu,t=[];let s=o,i=s.exec(u);for(;i;){const{0:r,index:l}=i;if(r==="}-"){const h=t.pop(),{length:p}=d,g=u.slice(h.index+2,l),T=g.indexOf("|"),[k,$]=T===-1?[[],g]:[g.slice(0,T).split(";"),g.slice(T+1)],y=$.replaceAll(/(&[#a-z\d]+);/giu,"$1"),F=`(?:${a.variants.join("|")})`,b=y.split(new RegExp(`;(?=\\s*(?:${F}|[^;]*?=>\\s*${F})\\s*:)`,"u")).map(v=>v.replaceAll("",";"));new x(k,b,a,d),u=`${u.slice(0,h.index)}\0${p}v\x7F${u.slice(l+2)}`,t.length===0&&(s=o),s.lastIndex=h.index+3+String(p).length}else t.push(i),s=n;i=s.exec(u)}return u};m.exports=c},7513:(m,C,e)=>{"use strict";const{extUrlChar:f}=e(231),x=e(6010),c=e(741),u=(a,d=x.getConfig(),o=[])=>{const n=new RegExp(`\\[((?:${d.protocol}|//)${f}|\0\\d+m\x7F)(\\p{Zs}*)([^\\]-\b
|
|
8
|
+
-\uFFFD]*)\\]`,"giu");return a.replaceAll(n,(t,s,i,r)=>{const{length:l}=o,h=/&[lg]t;/u.exec(s);return h&&(s=s.slice(0,h.index),i="",r=`${s.slice(h.index)}${i}${r}`),new c(s,i,r,d,o),`\0${l}w\x7F`})};m.exports=u},2937:(m,C,e)=>{"use strict";const f=e(6010),x=e(7507),c=e(8138),u=e(2582),a=e(7815),d=({firstChild:{data:o},type:n,name:t},s=f.getConfig(),i=[])=>{const{doubleUnderscore:r}=s;return n!=="root"&&(n!=="ext-inner"||t!=="poem")&&(o=`\0${o}`),o=o.replaceAll(/^((?:\0\d+c\x7F)*)(-{4,})/gmu,(l,h,p)=>(new u(p.length,s,i),`${h}\0${i.length-1}r\x7F`)).replaceAll(new RegExp(`__(${r.flat().join("|")})__`,"giu"),(l,h)=>r[0].includes(h.toLowerCase())||r[1].includes(h)?(new a(h,s,i),`\0${i.length-1}u\x7F`):l),n==="root"||n==="ext-inner"&&t==="poem"?o:o.slice(1)};m.exports=d},5130:(m,C,e)=>{"use strict";const f=e(6010),x=e(5037),c=e(2350),u=(a,d=f.getConfig(),o=[])=>{const n=/^(\/?)([a-z][^\s/>]*)(\s[^>]*?)?(\/?>)([^<]*)$/iu,t=d.html.flat(),s=a.split("<");let i=s.shift();for(const r of s){const l=n.exec(r),h=l==null?void 0:l[2],p=h==null?void 0:h.toLowerCase();if(!l||!t.includes(p)){i+=`<${r}`;continue}const[,g,,T="",k,$]=l,y=new x(T,"html-attr",p,d,o),F=y.getAttr("itemprop");if(p==="meta"&&(F===void 0||y.getAttr("content")===void 0)||p==="link"&&(F===void 0||y.getAttr("href")===void 0)){i+=`<${r}`,o.pop();continue}i+=`\0${o.length}x\x7F${$}`,new c(h,y,g==="/",k==="/>",d,o)}return i};m.exports=u},1452:(m,C,e)=>{"use strict";const f=e(6010),x=e(3905),c=e(7625),u=e(337),a=(d,o=f.getConfig(),n=[])=>{const t=e(3360),s=/^((?:(?!\0\d+!\x7F)[^\n<>[\]{}|])+)(?:(\||\0\d+!\x7F)(.*?[^\]]))?\]\](.*)$/su,i=/^((?:(?!\0\d+!\x7F)[^\n<>[\]{}|])+)(\||\0\d+!\x7F)(.*)$/su,r=new RegExp(`^\\s*(?:${o.protocol})`,"iu"),l=d.split("[[");let h=l.shift();for(let p=0;p<l.length;p++){let g,T,k,$,y;const F=l[p],b=s.exec(F);if(b)[,T,k,$,y]=b,y[0]==="]"&&($==null?void 0:$.includes("["))&&($+="]",y=y.slice(1));else{const B=i.exec(F);B&&(g=!0,[,T,k,$]=B)}if(T===void 0||r.test(T)||/\0\d+[exhbru]\x7F/u.test(T)){h+=`[[${F}`;continue}let v=T;if(T.includes("%"))try{v=decodeURIComponent(T)}catch(B){}const L=T.trim()[0]===":";if(L&&g){h+=`[[${F}`;continue}const E=f.normalizeTitle(v,0,!1,o,!0),{ns:z,valid:j}=E;if(j){if(g){if(z!==6){h+=`[[${F}`;continue}let B;for(p++;p<l.length;p++){const V=l[p],X=V.split("]]");if(X.length>2){B=!0,$+=`[[${X[0]}]]${X[1]}`,y=X.slice(2).join("]]");break}else if(X.length===2)$+=`[[${X[0]}]]${X[1]}`;else{$+=`[[${V}`;break}}if($=a($,o,n),!B){h+=`[[${T}${k}${$}`;continue}}}else{h+=`[[${F}`;continue}$&&($=t($,o,n)),h+=`\0${n.length}l\x7F${y}`;let R=x;L||(z===6?R=c:z===14&&(R=u)),new R(T,$,E,o,n,k)}return h};m.exports=a},6622:(m,C,e)=>{"use strict";const f=e(6010),x=e(962),c=e(3434),u=(a,d=f.getConfig(),o=[])=>{const n=/^((?:\0\d+c\x7F)*)([;:*#]+)/u.exec(a);if(!n)return a;const[t,s,i]=n;a=`${s}\0${o.length}d\x7F${a.slice(t.length)}`,new x(i,d,o);let r=i.split(";").length-1;if(!r)return a;let l=/:+|-\{/gu,h=l.exec(a),p=0;for(;h&&r;){const{0:g,index:T}=h;if(g[0]===":"){if(g.length>=r)return new c(":".repeat(r),d,o),`${a.slice(0,T)}\0${o.length-1}d\x7F${a.slice(T+r)}`;a=`${a.slice(0,T)}\0${o.length}d\x7F${a.slice(l.lastIndex)}`,r-=g.length,l.lastIndex=T+4+String(o.length).length,new c(g,d,o)}else if(g==="-{"){if(!p){const{lastIndex:k}=l;l=/-\{|\}-/gu,l.lastIndex=k}p++}else if(p--,!p){const{lastIndex:k}=l;l=/:+|-\{/gu,l.lastIndex=k}h=l.exec(a)}return a};m.exports=u},4737:(m,C,e)=>{"use strict";const{extUrlChar:f}=e(231),x=e(6010),c=e(8962),u=(a,d=x.getConfig(),o=[])=>{const n=new RegExp(`\\b(?:${d.protocol})(${f})`,"giu");return a.replaceAll(n,(t,s)=>{let i="",r=t;const l=/&(?:lt|gt|nbsp|#x0*(?:3[ce]|a0)|#0*(?:6[02]|160));/iu.exec(r);l&&(i=r.slice(l.index),r=r.slice(0,l.index));const h=new RegExp(`[,;.:!?${r.includes("(")?"":")"}]+$`,"u"),p=h.exec(r);if(p){let g=0;p[0][0]===";"&&/&(?:[a-z]+|#x[\da-f]+|#\d+)$/iu.test(r.slice(0,p.index))&&(g=1),i=`${r.slice(p.index+g)}${i}`,r=r.slice(0,p.index+g)}return i.length>=s.length?t:(new c(r,!1,d,o),`\0${o.length-1}w\x7F${i}`)})};m.exports=u},3360:(m,C,e)=>{"use strict";const f=e(6010),x=e(6714),c=(u,a=f.getConfig(),d=[])=>{var h;const o=u.split(/('{2,})/u),{length:n}=o;if(n===1)return u;let t=0,s=0,i,r,l;for(let p=1;p<n;p+=2){const{length:g}=o[p];switch(g){case 2:s++;break;case 4:o[p-1]+="'",o[p]="'''";case 3:if(t++,i)break;o[p-1].at(-1)===" "?!r&&!l&&(l=p):o[p-1].at(-2)===" "?i=p:r||(r=p);break;default:o[p-1]+="'".repeat(g-5),o[p]="'''''",s++,t++}}if(s%2===1&&t%2===1){const p=(h=i!=null?i:r)!=null?h:l;o[p]="''",o[p-1]+="'"}for(let p=1;p<n;p+=2)new x(o[p].length,a,d),o[p]=`\0${d.length-1}q\x7F`;return o.join("")};m.exports=c},4624:(m,C,e)=>{"use strict";const f=e(6010),x=e(7507),c=e(8138),u=e(2840),a=e(3125),d=e(5567),o=e(3434),n=({firstChild:{data:t},type:s,name:i},r=f.getConfig(),l=[])=>{const h=[],p=t.split(`
|
|
9
|
+
`);let g=s==="root"||s==="parameter-value"||s==="ext-inner"&&i==="poem"?"":`
|
|
10
|
+
${p.shift()}`;const T=(k,$)=>{if(!$){g+=k;return}const{lastChild:y}=$;if(y.constructor===c)y.setText(String(y)+k);else{const F=new c(k,r,!0,l);F.type="table-inter",$.insertAt(F.setAttribute("stage",3))}};for(const k of p){let $=h.pop();const[y]=/^(?:\s|\0\d+c\x7F)*/u.exec(k),F=k.slice(y.length),b=/^(:*)((?:\s|\0\d+c\x7F)*)(\{\||\{\0\d+!\x7F|\0\d+\{\x7F)(.*)$/u.exec(F);if(b){for(;$&&$.type!=="td";)$=h.pop();const[,R,B,V,X]=b;R&&new o(R,r,l),T(`
|
|
11
|
+
${y}${R&&`\0${l.length-1}d\x7F`}${B}\0${l.length}b\x7F`,$);const D=new u(V,X,r,l);h.push(...$?[$]:[],D);continue}else if(!$){g+=`
|
|
12
|
+
${k}`;continue}const v=/^(?:(\|\}|\0\d+!\x7F\}|\0\d+\}\x7F)|(\|-+|\0\d+!\x7F-+|\0\d+-\x7F-*)(?!-)|(!|(?:\||\0\d+!\x7F)\+?))(.*)$/u.exec(F);if(!v){T(`
|
|
13
|
+
${k}`,$),h.push(...$?[$]:[]);continue}const[,L,E,z,j]=v;if(L){for(;!($ instanceof u);)$=h.pop();$.close(`
|
|
14
|
+
${y}${L}`,!0),T(j,h.at(-1))}else if(E){$.type==="td"&&($=h.pop()),$.type==="tr"&&($=h.pop());const R=new a(`
|
|
15
|
+
${y}${E}`,j,r,l);h.push($,R),$.insertAt(R)}else{$.type==="td"&&($=h.pop());const R=z==="!"?/!!|(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu:/(?:\||\0\d+!\x7F){2}|\0\d+\+\x7F/gu;let B=R.exec(j),V=0,X=`
|
|
16
|
+
${y}${z}`;for(;B;){const Q=new d(X,j.slice(V,B.index),r,l);$.insertAt(Q),{lastIndex:V}=R,[X]=B,B=R.exec(j)}const D=new d(X,j.slice(V),r,l);h.push($,D),$.insertAt(D)}}return g.slice(1)};m.exports=n},9544:(m,C,e)=>{"use strict";const{text:f}=e(231),{generateForChild:x}=e(8277),c=e(6010),u=e(8138);class a extends u{constructor(n,t=c.getConfig(),s=[]){super(void 0,t,!0,s,{AtomToken:0,Token:1,HiddenToken:"2:"});S(this,"type","arg");for(let i=0;i<n.length;i++)if(i===0||i>1){const r=e(i===0?9237:9263),l=new r(n[i],i===0?"arg-name":void 0,t,s,{"Stage-2":":","!HeadingToken":""});super.insertAt(l)}else{const r=new u(n[i],t,!0,s);r.type="arg-default",super.insertAt(r.setAttribute("stage",2))}}toString(n){return`{{{${super.toString(n,"|")}}}}`}text(){return`{{{${f(this.childNodes.slice(0,2),"|")}}}}`}getPadding(){return 3}getGaps(){return 1}print(){return super.print({pre:"{{{",post:"}}}",sep:"|"})}lint(n=0){const{childNodes:[t,s,...i]}=this,r=t.lint(n+3);if(s&&r.push(...s.lint(n+4+String(t).length)),i.length>0){const l=this.getRootNode().posFromIndex(n);r.push(...i.map(h=>x(h,l,"\u4E09\u91CD\u62EC\u53F7\u5185\u7684\u4E0D\u53EF\u89C1\u90E8\u5206")))}return r}}m.exports=a},9263:(m,C,e)=>{"use strict";const f=e(2308),x=e(9237);class c extends f(x){constructor(){super(...arguments);S(this,"type","hidden")}}m.exports=c},9237:(m,C,e)=>{"use strict";const f=e(6010),x=e(8138);class c extends x{constructor(d,o,n=f.getConfig(),t=[],s=null){super(d,n,!0,t,s);S(this,"type","plain");o&&(this.type=o)}}m.exports=c},5037:(m,C,e)=>{var d,o,n,t,rt;"use strict";const{generateForSelf:f}=e(8277),{removeComment:x}=e(231),c=e(6010),u=e(8138);class a extends u{constructor(l,h,p,g=c.getConfig(),T=[]){super(l,g,!0,T);P(this,t);P(this,d,new Map);P(this,o,!0);P(this,n,!0);this.type=h,U(this,t,rt).call(this)}getAttr(l){return A(this,d).get(l.toLowerCase().trim())}setAttr(l,h,p){l=l.toLowerCase().trim();const g=l;if(/^(?:[\w:]|\0\d+[t!~{}+-]\x7F)(?:[\w:.-]|\0\d+[t!~{}+-]\x7F)*$/u.test(g))h===!1?A(this,d).delete(l):A(this,d).set(l,h===!0?!0:h.replaceAll(/\s/gu," ").trim());else return p,!1;return!0}lint(l=0){const h=e(2350),p=super.lint(l);let g;return this.type==="html-attr"&&this.parentNode.closing&&this.text().trim()&&(g=this.getRootNode().posFromIndex(l),p.push(f(this,g,"\u4F4D\u4E8E\u95ED\u5408\u6807\u7B7E\u7684\u5C5E\u6027"))),A(this,o)?A(this,n)||(g||(g=this.getRootNode().posFromIndex(l)),p.push(f(this,g,"\u672A\u95ED\u5408\u7684\u5F15\u53F7","warning"))):(g||(g=this.getRootNode().posFromIndex(l)),p.push(f(this,g,"\u5305\u542B\u65E0\u6548\u5C5E\u6027"))),p}}d=new WeakMap,o=new WeakMap,n=new WeakMap,t=new WeakSet,rt=function(){var h;let l=this.toString();l=x(l).replaceAll(/\0\d+~\x7F/gu,"=");for(const[,p,g,T,k,$]of l.matchAll(/([^\s/][^\s/=]*)(?:\s*=\s*(?:(["'])(.*?)(\2|$)|(\S*)))?/gsu))this.setAttr(p,(h=T!=null?T:$)!=null?h:!0,!0)?g!==k&&M(this,n,!1):M(this,o,!1)},m.exports=a},8103:(m,C,e)=>{"use strict";const f=e(6010),x=e(8138),c=e(2158);class u extends x{constructor(o,n=f.getConfig(),t=[]){super(void 0,n,!0,t,{HasNowikiToken:":"});S(this,"type","ext-inner");S(this,"name","charinsert");this.append(...o.split(`
|
|
17
|
+
`).map(s=>new c(s,"charinsert-line",n,t)))}toString(o){return super.toString(o,`
|
|
18
18
|
`)}getGaps(){return 1}print(){return super.print({sep:`
|
|
19
|
-
`})}}m.exports=u},9910:(m,C,e)=>{"use strict";const{print:
|
|
20
|
-
`))!=null?
|
|
19
|
+
`})}}m.exports=u},9910:(m,C,e)=>{"use strict";const{text:f,print:x}=e(231),c=e(6010),u=e(8138),a=e(6719),d=e(8683);class o extends u{constructor(s,i,r=c.getConfig(),l=[]){super(void 0,r,!0,l);S(this,"type","converter");this.append(new a(s,r,l));const[h]=i,p=h.includes(":"),g=new d(h,p,r,l);p&&g.childNodes.length===1?this.insertAt(new d(i.join(";"),!1,r,l)):this.append(g,...i.slice(1).map(T=>new d(T,!0,r,l)))}toString(s){const{childNodes:[i,...r]}=this;return`-{${i.toString()}${i.childNodes.length>0?"|":""}${r.map(String).join(";")}}-`}text(){const{childNodes:[s,...i]}=this;return`-{${s.text()}|${f(i,";")}}-`}getPadding(){return 2}getGaps(s=0){return s=s<0?s+this.childNodes.length:s,s||this.firstChild.childNodes.length>0?1:0}print(){const{children:[s,...i]}=this;return`<span class="wpb-converter">-{${s.print()}${s.childNodes.length>0?"|":""}${x(i,{sep:";"})}}-</span>`}}m.exports=o},6719:(m,C,e)=>{var d;"use strict";const{generateForChild:f}=e(8277),x=e(6010),c=e(8138),u=e(9237);class a extends c{constructor(t,s=x.getConfig(),i=[]){super(void 0,s,!0,i,{AtomToken:":"});S(this,"type","converter-flags");P(this,d,void 0);this.append(...t.map(r=>new u(r,"converter-flag",s,i)))}afterBuild(){return M(this,d,this.childNodes.map(t=>t.text().trim())),this}toString(t){return super.toString(t,";")}text(){return super.text(";")}getGaps(){return 1}print(){return super.print({sep:";"})}lint(t=0){const s=this.getVariantFlags(),i=this.getUnknownFlags(),r=A(this,d).filter(T=>!T),l=A(this,d).filter(T=>["A","T","R","D","-","H","N"].includes(T)),h=A(this,d).length-i.length-r,p=super.lint(t);if(s.length===h||l.length===h)return p;const g=this.getRootNode().posFromIndex(t);for(const T of this.childNodes){const k=T.text().trim();k&&!s.includes(k)&&!i.includes(k)&&(s.length>0||!l.includes(k))&&p.push(f(T,g,"\u65E0\u6548\u7684\u8F6C\u6362\u6807\u8BB0"))}return p}getUnknownFlags(){return A(this,d).filter(t=>/\{\{[^{}]+\}\}/u.test(t))}getVariantFlags(){const{variants:t}=this.getAttribute("config");return A(this,d).filter(s=>t.includes(s))}}d=new WeakMap,m.exports=a},8683:(m,C,e)=>{"use strict";const f=e(6010),x=e(8138),c=e(9237);class u extends x{constructor(o,n=!0,t=f.getConfig(),s=[]){super(void 0,t,!0,s);S(this,"type","converter-rule");if(n){const i=o.indexOf(":"),r=o.slice(0,i).indexOf("=>"),l=r===-1?o.slice(0,i):o.slice(r+2,i),{variants:h}=t;h.includes(l.trim())?(super.insertAt(new c(l,"converter-rule-variant",t,s)),super.insertAt(new c(o.slice(i+1),"converter-rule-to",t,s)),r!==-1&&super.insertAt(new c(o.slice(0,r),"converter-rule-from",t,s),0)):super.insertAt(new c(o,"converter-rule-noconvert",t,s))}else super.insertAt(new c(o,"converter-rule-noconvert",t,s))}toString(o){if(this.childNodes.length===3){const{childNodes:[n,t,s]}=this;return`${n.toString(o)}=>${t.toString(o)}:${s.toString(o)}`}return super.toString(o,":")}text(){if(this.childNodes.length===3){const{childNodes:[o,n,t]}=this;return`${o.text()}=>${n.text()}:${t.text()}`}return super.text(":")}getGaps(o=0){const{length:n}=this;return o=o<0?o+n:o,o===0&&n===3?2:1}print(){if(this.childNodes.length===3){const{childNodes:[o,n,t]}=this;return`<span class="wpb-converter-rule">${o.print()}=>${n.print()}:${t.print()}</span>`}return super.print({sep:":"})}}m.exports=u},741:(m,C,e)=>{var a;"use strict";const f=e(6010),x=e(8138),c=e(8962);class u extends x{constructor(n,t,s,i=f.getConfig(),r=[]){super(void 0,i,!0,r,{MagicLinkToken:0,Token:1});S(this,"type","ext-link");P(this,a,void 0);if(this.insertAt(new c(n,!0,i,r)),M(this,a,t),s){const l=new x(s,i,!0,r,{"Stage-7":":",ConverterToken:":"});l.type="ext-link-text",this.insertAt(l.setAttribute("stage",f.MAX_STAGE-1))}}toString(n){return this.childNodes.length===1?`[${super.toString(n)}${A(this,a)}]`:`[${super.toString(n,A(this,a))}]`}text(){return`[${super.text(" ")}]`}getPadding(){return 1}getGaps(){return A(this,a).length}print(){const{length:n}=this;return super.print(n>1?{pre:"[",sep:A(this,a),post:"]"}:{pre:"[",post:`${A(this,a)}]`})}}a=new WeakMap,m.exports=u},1891:(m,C,e)=>{"use strict";const f=e(6010),x=e(8138),c=e(1031),u=e(9263);class a extends x{constructor(n,t=f.getConfig(),s=[]){var r;super(void 0,t,!0,s,{AstText:":",GalleryImageToken:":",HiddenToken:":"});S(this,"type","ext-inner");S(this,"name","gallery");const i=structuredClone(t);for(const[l,h]of Object.entries(t.img))h==="width"&&delete i.img[l];for(const l of(r=n==null?void 0:n.split(`
|
|
20
|
+
`))!=null?r:[]){const h=/^([^|]+)(?:\|(.*))?/u.exec(l);if(!h){super.insertAt(l.trim()?new u(l,void 0,t,[],{AstText:":"}):l);continue}const[,p,g]=h;let T;try{T=this.normalizeTitle(decodeURIComponent(p),6,!0)}catch(k){T=this.normalizeTitle(p,6,!0)}T.valid?super.insertAt(new c(p,g,T,i,s)):super.insertAt(new u(l,void 0,t,[],{AstText:":"}))}}toString(n){return super.toString(n,`
|
|
21
|
+
`)}text(){return super.text(`
|
|
22
|
+
`).replaceAll(/\n\s*\n/gu,`
|
|
21
23
|
`)}getGaps(){return 1}print(){return super.print({sep:`
|
|
22
|
-
`})}lint(
|
|
23
|
-
`),
|
|
24
|
+
`})}lint(n=0){const{top:t,left:s}=this.getRootNode().posFromIndex(n),i=[];for(let r=0,l=n;r<this.childNodes.length;r++){const h=this.childNodes[r],p=String(h),g=p.trim();h.type==="hidden"&&g&&!/^<!--.*-->$/u.test(g)?i.push({message:"\u56FE\u5E93\u4E2D\u7684\u65E0\u6548\u5185\u5BB9",startLine:t+r,endLine:t+r,startCol:r?0:s,endCol:r?p.length:s+p.length}):h.type!=="hidden"&&h.type!=="text"&&i.push(...h.lint(l)),l+=p.length+1}return i}}m.exports=a},2158:(m,C,e)=>{"use strict";const f=e(6010),x=e(8138),c=e(3423);class u extends x{constructor(d,o,n=f.getConfig(),t=[]){d=d.replaceAll(/(<nowiki>)(.*?)(<\/nowiki>)/giu,(s,i,r,l)=>(new c(i,n,t),new c(l,n,t),`\0${t.length-1}c\x7F${r}\0${t.length}c\x7F`)),super(d,n,!0,t,{AstText:":",NoincludeToken:":"}),this.type=o}}m.exports=u},428:(m,C,e)=>{"use strict";const f=e(6010),x=e(2158);class c extends x{constructor(d,o=f.getConfig(),n=[]){super(d,"ext-inner",o,n);S(this,"name","pre");this.setAttribute("stage",f.MAX_STAGE-1)}isPlain(){return!0}}m.exports=c},9450:(m,C,e)=>{"use strict";const{generateForSelf:f}=e(8277),x=e(6010),c=e(8138),u=e(8058);class a extends c{constructor(n,t,s=x.getConfig(),i=[]){super(void 0,s,!0,i);S(this,"type","heading");this.setAttribute("name",String(n));const r=new c(t[0],s,!0,i);r.type="heading-title",r.setAttribute("stage",2);const l=new u(t[1],/^[^\S\n]*$/u,"heading-trail",s,i,{"Stage-1":":","!ExtToken":""});this.append(r,l)}toString(n){const t="=".repeat(Number(this.name));return`${t}${this.firstChild.toString()}${t}${this.lastChild.toString()}`}text(){const n="=".repeat(Number(this.name));return`${n}${this.firstChild.text()}${n}`}getPadding(){return super.getPadding()+Number(this.name)}getGaps(){return Number(this.name)}print(){const n="=".repeat(Number(this.name));return super.print({pre:n,sep:n})}lint(n=0){const t=super.lint(n);return this.name==="1"&&t.push(f(this,this.getRootNode().posFromIndex(n),"<h1>")),t}}m.exports=a},2350:(m,C,e)=>{var a,d,o;"use strict";const{generateForSelf:f}=e(8277),x=e(6010),c=e(8138);class u extends c{constructor(s,i,r,l,h=x.getConfig(),p=[]){super(void 0,h,!0,p);S(this,"type","html");P(this,a,void 0);P(this,d,void 0);P(this,o,void 0);this.insertAt(i),this.setAttribute("name",s.toLowerCase()),M(this,a,r),M(this,d,l),M(this,o,s)}get closing(){return A(this,a)}toString(s){return`<${A(this,a)?"/":""}${A(this,o)}${super.toString()}${A(this,d)?"/":""}>`}text(){return`<${A(this,a)?"/":""}${A(this,o)}${A(this,a)?"":super.text()}${A(this,d)?"/":""}>`}getPadding(){return A(this,o).length+(A(this,a)?2:1)}print(){return super.print({pre:`<${A(this,a)?"/":""}${A(this,o)}`,post:`${A(this,d)?"/":""}>`})}lint(s=0){const i=super.lint(s);let r;this.name==="h1"&&!A(this,a)&&(r=f(this,this.getRootNode().posFromIndex(s),"<h1>"),i.push(r));try{this.findMatchingTag()}catch({message:l}){const[h]=l.split("\uFF1A");r||(r=f(this,this.getRootNode().posFromIndex(s),"")),i.push({...r,message:h,severity:h==="\u672A\u95ED\u5408\u7684\u6807\u7B7E"?"warning":"error"})}return i}findMatchingTag(){const{html:s}=this.getAttribute("config"),{name:i,parentNode:r}=this,l=String(this);if(A(this,a)&&A(this,d))throw new SyntaxError(`\u540C\u65F6\u95ED\u5408\u548C\u81EA\u5C01\u95ED\u7684\u6807\u7B7E\uFF1A${l}`);if(s[2].includes(i)||A(this,d)&&s[1].includes(i))return this;if(A(this,d)&&s[0].includes(i))throw new SyntaxError(`\u65E0\u6548\u81EA\u5C01\u95ED\u6807\u7B7E\uFF1A${l}`);if(!r)return;const{childNodes:h}=r,p=h.indexOf(this),g=A(this,a)?h.slice(0,p).reverse().filter(({type:k,name:$})=>k==="html"&&$===i):h.slice(p+1).filter(({type:k,name:$})=>k==="html"&&$===i);let T=A(this,a)?-1:1;for(const k of g)if(k.closing?T--:T++,T===0)return k;throw new SyntaxError(`\u672A${A(this,a)?"\u5339\u914D\u7684\u95ED\u5408":"\u95ED\u5408\u7684"}\u6807\u7B7E\uFF1A${l}`)}}a=new WeakMap,d=new WeakMap,o=new WeakMap,m.exports=u},1874:(m,C,e)=>{var d,it,n;"use strict";const{print:f,extUrlChar:x}=e(231),c=e(6010),u=e(8138),s=class extends u{constructor(l,h=c.getConfig(),p=[]){var r=(...t)=>{super(...t);S(this,"type","image-parameter");P(this,n,"")};var k;const g=Object.entries(h.img).map(([$,y])=>[$,y,new RegExp(`^(\\s*)${$.replace("$1","(.*)")}(\\s*)$`,"u")]),T=g.find(([,,$])=>$.test(l));if(T){const $=T[2].exec(l);if($.length!==4||U(k=s,d,it).call(k,T[1],$[2],h,!0)){$.length===3?(r(void 0,h,!0,p),M(this,n,l)):(r($[2],h,!0,p,{"Stage-2":":","!HeadingToken":":"}),M(this,n,`${$[1]}${T[0]}${$[3]}`)),this.setAttribute("name",T[1]).setAttribute("stage",c.MAX_STAGE);return}}r(l,h,!0,p),this.setAttribute("name","caption").setAttribute("stage",7)}isPlain(){return!0}toString(l){return A(this,n)?A(this,n).replace("$1",super.toString(l)):super.toString(l)}text(){return A(this,n)?A(this,n).replace("$1",super.text()).trim():super.text().trim()}getPadding(){return Math.max(0,A(this,n).indexOf("$1"))}print(){return A(this,n)?`<span class="wpb-image-parameter">${A(this,n).replace("$1",f(this.childNodes))}</span>`:super.print({class:"image-caption"})}};let a=s;d=new WeakSet,it=function(l,h,p=c.getConfig(),g=!1){switch(h=h.replaceAll(/\0\d+t\x7F/gu,"").trim(),l){case"width":return/^\d*(?:x\d*)?$/u.test(h);case"link":{if(!h||new RegExp(`(?:${p.protocol}|//)${x}(?=\0\\d+t\x7F|$)`,"iu").test(h))return!0;if(h.startsWith("[[")&&h.endsWith("]]")&&(h=h.slice(2,-2)),h.includes("%"))try{h=decodeURIComponent(h)}catch($){}return c.normalizeTitle(h,0,!1,p,g).valid}case"lang":return p.variants.includes(h);case"alt":case"class":case"manualthumb":return!0;default:return!isNaN(h)}},n=new WeakMap,P(a,d),m.exports=a},2641:(m,C,e)=>{"use strict";const{generateForSelf:f,generateForChild:x}=e(8277),c=e(6010),u=e(8138),a=e(3423),d=e(1031),o=e(2571);class n extends u{constructor(i,r=c.getConfig(),l=[]){super(void 0,r,!0,l,{GalleryImageToken:":",ImagemapLinkToken:":",NoincludeToken:":",AstText:":"});S(this,"type","ext-inner");S(this,"name","imagemap");if(!i)return;const h=i.split(`
|
|
25
|
+
`),p=k=>{super.insertAt(new a(k,r,l))};let g=!0,T=!1;for(const k of h){const $=k.trim();if(!(T||!$||$[0]==="#")){if(g){const[y,...F]=k.split("|");let b;try{b=this.normalizeTitle(decodeURIComponent(y),0,!0)}catch(v){b=this.normalizeTitle(y,0,!0)}if(b.valid&&!b.interwiki&&b.ns===6){const v=new d(y,F.length>0?F.join("|"):void 0,b,r,l);v.type="imagemap-image",super.insertAt(v),g=!1;continue}else T=!0}else if(k.trim().split(/[\t ]/u)[0]==="desc"){super.insertAt(k);continue}else if(k.includes("[")){const y=k.indexOf("["),F=k.slice(y),b=/^\[{2}([^|]+)(?:\|([^\]]+))?\]{2}[\w\s]*$/u.exec(F);if(b){const v=this.normalizeTitle(b[1],0,!0);if(v.valid){super.insertAt(new o(k.slice(0,y),[...b.slice(1),v],F.slice(F.indexOf("]]")+2),r,l));continue}}else{const v=r.protocol.split("|");if(v.includes(F.slice(1,F.indexOf(":")+1))||v.includes(F.slice(1,F.indexOf("//")+2))){const L=/^\[([^\]\s]+)(?:(\s+)(\S[^\]]*)?)?\][\w\s]*$/u.exec(F);if(L){super.insertAt(new o(k.slice(0,y),L.slice(1),F.slice(F.indexOf("]")+1),r,l));continue}}}}}p(k)}}toString(i){return super.toString(i,`
|
|
26
|
+
`)}text(){return super.text(`
|
|
27
|
+
`).replaceAll(/\n{2,}/gu,`
|
|
24
28
|
`)}getGaps(){return 1}print(){return super.print({sep:`
|
|
25
|
-
`})}lint(
|
|
26
|
-
`);for(let
|
|
27
|
-
`))},
|
|
28
|
-
`);let
|
|
29
|
-
`))},
|
|
30
|
-
`),{length:
|
|
31
|
-
`).map(i=>new u(i,"param-line",s,
|
|
29
|
+
`})}lint(i=0){const r=super.lint(i),l=this.getRootNode().posFromIndex(i);return this.image?r.push(...this.childNodes.filter(h=>{const p=String(h).trim();return h.type==="noinclude"&&p&&p[0]!=="#"}).map(h=>x(h,l,"\u65E0\u6548\u7684<imagemap>\u94FE\u63A5"))):r.push(f(this,l,"\u7F3A\u5C11\u56FE\u7247\u7684<imagemap>")),r}}m.exports=n},2571:(m,C,e)=>{"use strict";const f=e(6986),x=e(8138),c=e(3423),u=e(3905),a=e(741);class d extends x{constructor(t,s,i,r,l){const h=s[2]instanceof f?u:a;super(void 0,r,!0,l);S(this,"type","imagemap-link");this.append(t,new h(...s,r,l),new c(i,r,l))}}m.exports=d},8138:(m,C,e)=>{var d,o,n,t,s,i,r,ot,h,lt,g,ht,k,at,y,dt,b,ut,L,pt,z,ct,R,gt,V,ft,D,xt;"use strict";const f=e(6010),x=e(9205),c=e(7507),{MAX_STAGE:u}=f,W=class extends x{constructor(N,w=f.getConfig(),I=!1,Z=[],_=null){super();P(this,r);P(this,h);P(this,g);P(this,k);P(this,y);P(this,b);P(this,L);P(this,z);P(this,R);P(this,V);P(this,D);S(this,"type","root");P(this,d,0);P(this,o,void 0);P(this,n,void 0);P(this,t,(N=A(this,d),w=!1)=>{if(N<A(this,d)||!this.isPlain()||this.childNodes.length===0)return this;switch(N){case 0:this.type==="root"&&A(this,n).shift(),U(this,r,ot).call(this,w);break;case 1:U(this,h,lt).call(this);break;case 2:U(this,g,ht).call(this);break;case 3:U(this,k,at).call(this);break;case 4:U(this,y,dt).call(this);break;case 5:U(this,b,ut).call(this);break;case 6:U(this,L,pt).call(this);break;case 7:U(this,z,ct).call(this);break;case 8:U(this,R,gt).call(this);break;case 9:U(this,V,ft).call(this);break;case 10:U(this,D,xt).call(this)}if(this.type==="root")for(const I of A(this,n))I.getAttribute("parseOnce")(N,w);return et(this,d)._++,this});P(this,s,N=>N.split(/[\0\x7F]/u).map((w,I)=>{if(I%2===0)return new c(w);if(isNaN(w.at(-1)))return A(this,n)[Number(w.slice(0,-1))];throw new Error(`\u89E3\u6790\u9519\u8BEF\uFF01\u672A\u6B63\u786E\u6807\u8BB0\u7684 Token\uFF1A${w}`)}));P(this,i,()=>{M(this,d,u);const{length:N,firstChild:w}=this,I=String(w);if(N===1&&w.type==="text"&&I.includes("\0")&&(this.replaceChildren(...A(this,s).call(this,I)),this.normalize(),this.type==="root"))for(const Z of A(this,n))Z.getAttribute("build")()});typeof N=="string"&&this.insertAt(I?N:N.replaceAll(/[\0\x7F]/gu,"")),M(this,o,w),M(this,n,Z),Z.push(this)}getAttribute(N){switch(N){case"config":return structuredClone(A(this,o));case"accum":return A(this,n);case"parseOnce":return A(this,t);case"buildFromStr":return A(this,s);case"build":return A(this,i);default:return super.getAttribute(N)}}setAttribute(N,w){switch(N){case"stage":return A(this,d)===0&&this.type==="root"&&A(this,n).shift(),M(this,d,w),this;default:return super.setAttribute(N,w)}}isPlain(){return this.constructor===W}insertAt(N,w=this.childNodes.length){return typeof N=="string"&&(N=new c(N)),super.insertAt(N,w),N.type==="root"&&(N.type="plain"),N}normalizeTitle(N,w=0,I=!1){return f.normalizeTitle(N,w,!1,A(this,o),I)}afterBuild(){if(this.type==="root")for(const N of A(this,n))N.afterBuild();return this}parse(N=u,w=!1){for(;A(this,d)<N;)A(this,t).call(this,A(this,d),w);return N&&(A(this,i).call(this),this.afterBuild()),this}};let a=W;d=new WeakMap,o=new WeakMap,n=new WeakMap,t=new WeakMap,s=new WeakMap,i=new WeakMap,r=new WeakSet,ot=function(N){const w=e(4907);this.setText(w(String(this),A(this,o),A(this,n),N))},h=new WeakSet,lt=function(){const N=e(8275),w=this.type==="root"?String(this):`\0${String(this)}`,I=N(w,A(this,o),A(this,n));this.setText(this.type==="root"?I:I.slice(1))},g=new WeakSet,ht=function(){const N=e(5130);this.setText(N(String(this),A(this,o),A(this,n)))},k=new WeakSet,at=function(){const N=e(4624),w=e(2840);this.setText(N(this,A(this,o),A(this,n)));for(const I of A(this,n))if(I instanceof w&&I.type!=="td"){I.normalize();const{childNodes:[,Z]}=I;if(typeof Z=="string"&&Z.includes("\0")){I.removeAt(1);const _=new W(Z,A(this,o),!0,A(this,n));I.insertAt(_,1),_.setAttribute("stage",4)}}},y=new WeakSet,dt=function(){const N=e(2937);this.setText(N(this,A(this,o),A(this,n)))},b=new WeakSet,ut=function(){const N=e(1452);this.setText(N(String(this),A(this,o),A(this,n)))},L=new WeakSet,pt=function(){const N=e(3360),w=String(this).split(`
|
|
30
|
+
`);for(let I=0;I<w.length;I++)w[I]=N(w[I],A(this,o),A(this,n));this.setText(w.join(`
|
|
31
|
+
`))},z=new WeakSet,ct=function(){const N=e(7513);this.setText(N(String(this),A(this,o),A(this,n)))},R=new WeakSet,gt=function(){const N=e(4737);this.setText(N(String(this),A(this,o),A(this,n)))},V=new WeakSet,ft=function(){if(this.type==="image-parameter")return;const N=e(6622),w=String(this).split(`
|
|
32
|
+
`);let I=this.type==="root"||this.type==="ext-inner"&&this.type==="poem"?0:1;for(;I<w.length;I++)w[I]=N(w[I],A(this,o),A(this,n));this.setText(w.join(`
|
|
33
|
+
`))},D=new WeakSet,xt=function(){const N=e(3765);this.setText(N(String(this),A(this,o),A(this,n)))},m.exports=a},337:(m,C,e)=>{"use strict";const f=e(3905);class x extends f{constructor(){super(...arguments);S(this,"type","category")}}m.exports=x},7625:(m,C,e)=>{"use strict";const{explode:f}=e(231),{generateForChild:x}=e(8277),c=e(6010),u=e(3905),a=e(1874);class d extends u{constructor(t,s,i,r=c.getConfig(),l=[],h="|"){super(t,void 0,i,r,l,h);S(this,"type","file");this.append(...f("-{","}-","|",s).map(p=>new a(p,r,l)))}lint(t=0){const s=super.lint(t),i=this.getFrameArgs(),r=this.getHorizAlignArgs(),l=this.getVertAlignArgs(),h=this.getArgs("caption"),p=[...h].filter((g,T)=>g.text()||T===h.size-1);if(i.length>1||r.length>1||l.length>1||h.size>1){const g=this.getRootNode().posFromIndex(t);i.length>1&&s.push(...i.map(T=>x(T,g,"\u91CD\u590D\u6216\u51B2\u7A81\u7684\u56FE\u7247\u6846\u67B6\u53C2\u6570"))),r.length>1&&s.push(...r.map(T=>x(T,g,"\u91CD\u590D\u6216\u51B2\u7A81\u7684\u56FE\u7247\u6C34\u5E73\u5BF9\u9F50\u53C2\u6570"))),l.length>1&&s.push(...l.map(T=>x(T,g,"\u91CD\u590D\u6216\u51B2\u7A81\u7684\u56FE\u7247\u5782\u76F4\u5BF9\u9F50\u53C2\u6570"))),p.length>1&&s.push(...p.map(T=>x(T,g,"\u91CD\u590D\u7684\u56FE\u7247\u8BF4\u660E")))}return s}getAllArgs(){return this.childNodes.slice(1)}getArgs(t,s=!0){const i=this.getAllArgs().filter(({name:r})=>t===r);return s?new Set(i):i}getFrameArgs(){return this.getAllArgs().filter(({name:s})=>["manualthumb","frameless","framed","thumbnail"].includes(s))}getHorizAlignArgs(){return this.getAllArgs().filter(({name:s})=>["left","right","center","none"].includes(s))}getVertAlignArgs(){return this.getAllArgs().filter(({name:s})=>["baseline","sub","super","top","text-top","middle","bottom","text-bottom"].includes(s))}}m.exports=d},1031:(m,C,e)=>{var d;"use strict";const{generateForSelf:f}=e(8277),x=e(6010),c=e(8138),u=e(7625);class a extends u{constructor(t,s,i,r=x.getConfig(),l=[]){let h;if(s!==void 0){h=new c(s,r,!0,l),h.type="temp";for(let p=1;p<x.MAX_STAGE;p++)h.getAttribute("parseOnce")();l.splice(l.indexOf(h),1)}super(t,h==null?void 0:h.toString(),i,r,l);S(this,"type","gallery-image");P(this,d,!1);this.setAttribute("bracket",!1)}afterBuild(){const{interwiki:t,ns:s}=this.normalizeTitle(String(this.firstChild),this.type==="imagemap-image"?0:6,!0);return M(this,d,t||s!==6),this}getPadding(){return 0}lint(t=0){const s=super.lint(t);return A(this,d)&&s.push(f(this,this.getRootNode().posFromIndex(t),"\u65E0\u6548\u7684\u56FE\u5E93\u56FE\u7247")),s}}d=new WeakMap,m.exports=a},3905:(m,C,e)=>{var a,d;"use strict";const f=e(6010),x=e(8138),c=e(9237);class u extends x{constructor(t,s,i,r=f.getConfig(),l=[],h="|"){super(void 0,r,!0,l,{AtomToken:0,Token:1});S(this,"type","link");P(this,a,!0);P(this,d,void 0);if(this.insertAt(new c(t,"link-target",r,l,{"Stage-2":":","!ExtToken":"","!HeadingToken":""})),s!==void 0){const p=new x(s,r,!0,l,{"Stage-5":":",ConverterToken:":"});p.type="link-text",this.insertAt(p.setAttribute("stage",f.MAX_STAGE-1))}M(this,d,h)}afterBuild(){var t;return(t=A(this,d))!=null&&t.includes("\0")&&M(this,d,this.getAttribute("buildFromStr")(A(this,d)).map(String).join("")),this}setAttribute(t,s){return t==="bracket"?(M(this,a,Boolean(s)),this):super.setAttribute(t,s)}toString(t){const s=super.toString(t,A(this,d));return A(this,a)?`[[${s}]]`:s}text(){const t=super.text("|");return A(this,a)?`[[${t}]]`:t}getPadding(){return 2}getGaps(){return A(this,d).length}print(){return super.print(A(this,a)?{pre:"[[",post:"]]",sep:A(this,d)}:{sep:A(this,d)})}}a=new WeakMap,d=new WeakMap,m.exports=u},8962:(m,C,e)=>{"use strict";const{generateForChild:f}=e(8277),x=e(6010),c=e(8138);class u extends c{constructor(o,n,t=x.getConfig(),s=[]){super(o,t,!0,s,{"Stage-1":":","!ExtToken":""});S(this,"type","free-ext-link");n&&(this.type="ext-link-url")}lint(o=0){const n=super.lint(o);let t;for(const s of this.childNodes){const i=String(s);if(s.type!=="text"||!/[,;。:!?()【】]/u.test(i))continue;t||(t=this.getRootNode().posFromIndex(o));const r=f(s,t,"URL\u4E2D\u7684\u5168\u89D2\u6807\u70B9","warning");n.push(...[...i.matchAll(/[,;。:!?()【】]/gu)].map(({index:l})=>{const h=i.slice(0,l).split(`
|
|
34
|
+
`),{length:p}=h,{length:g}=h.at(-1),T=r.startLine+p-1,k=p>1?g:r.startCol+g;return{...r,startLine:T,endLine:T,startCol:k,endCol:k+1}}))}return n}}m.exports=u},9389:(m,C,e)=>{"use strict";const f=e(6010),x=e(8889);class c extends x{constructor(d,o=f.getConfig(),n=[]){super(d,/<(option|choicetemplate)(\s[^>]*)?>(.*?)<\/(\1)>/gsu,["option","choicetemplate"],o,n);S(this,"name","choose")}}m.exports=c},9269:(m,C,e)=>{"use strict";const f=e(6010),x=e(8889);class c extends x{constructor(d,o=f.getConfig(),n=[]){super(d,/<(combooption)(\s[^>]*)?>(.*?)<\/(combooption\s*)>/gisu,["combooption"],o,n);S(this,"name","combobox")}}m.exports=c},8889:(m,C,e)=>{"use strict";const{generateForChild:f}=e(8277),x=e(6010),c=e(8138),u=e(7267),a=e(3423);class d extends c{constructor(t,s,i,r=x.getConfig(),l=[]){var p;const h=(p=t==null?void 0:t.replaceAll(s,(g,T,k,$,y)=>{const F=`\0${l.length+1}e\x7F`;return new u(T,k,$,y,r,l),F}))==null?void 0:p.replaceAll(/(^|\0\d+e\x7F)(.*?)(?=$|\0\d+e\x7F)/gsu,(g,T,k)=>k===""?T:(new a(k,r,l),`${T}\0${l.length}c\x7F`));super(h,r,!0,l,{NoincludeToken:":",ExtToken:":"});S(this,"type","ext-inner")}lint(t=0){let s;return[...super.lint(t),...this.childNodes.filter(i=>{if(i.type==="ext")return!1;const r=String(i).trim();return r&&!/^<!--.*-->$/u.test(r)}).map(i=>(s||(s=this.getRootNode().posFromIndex(t)),f(i,s,`<${this.name}>\u5185\u7684\u65E0\u6548\u5185\u5BB9`)))]}}m.exports=d},5937:(m,C,e)=>{"use strict";const f=e(6010),x=e(8889);class c extends x{constructor(d,o=f.getConfig(),n=[]){super(d,/<(ref)(\s[^>]*)?>(.*?)<\/(ref\s*)>/gisu,["ref"],o,n);S(this,"name","references")}}m.exports=c},7033:(m,C,e)=>{var f={"./":8889,"./choose":9389,"./choose.js":9389,"./combobox":9269,"./combobox.js":9269,"./index":8889,"./index.js":8889,"./references":5937,"./references.js":5937};function x(u){var a=c(u);return e(a)}function c(u){if(!e.o(f,u)){var a=new Error("Cannot find module '"+u+"'");throw a.code="MODULE_NOT_FOUND",a}return f[u]}x.keys=function(){return Object.keys(f)},x.resolve=c,m.exports=x,x.id=7033},5749:(m,C,e)=>{"use strict";const f=e(2308),{generateForSelf:x}=e(8277),c=e(6010),u=e(6935);class a extends f(u){constructor(n,t=!0,s=c.getConfig(),i=[]){super(n,s,i);S(this,"type","comment");S(this,"closed");this.closed=t}getPadding(){return 4}print(){return super.print({pre:"<!--",post:this.closed?"-->":""})}lint(n=0){return this.closed?[]:[x(this,this.getRootNode().posFromIndex(n),"\u672A\u95ED\u5408\u7684HTML\u6CE8\u91CA")]}toString(n){return`<!--${String(this.firstChild)}${this.closed?"-->":""}`}}m.exports=a},3434:(m,C,e)=>{"use strict";const f=e(6935);class x extends f{constructor(){super(...arguments);S(this,"type","dd")}}m.exports=x},7815:(m,C,e)=>{"use strict";const f=e(2308),x=e(6935);class c extends f(x){constructor(){super(...arguments);S(this,"type","double-underscore")}getPadding(){return 2}print(){return super.print({pre:"__",post:"__"})}toString(d){return`__${String(this.firstChild)}__`}}m.exports=c},2582:(m,C,e)=>{"use strict";const f=e(6010),x=e(6935);class c extends x{constructor(d,o=f.getConfig(),n=[]){super("-".repeat(d),o,n);S(this,"type","hr")}}m.exports=c},6935:(m,C,e)=>{"use strict";const{generateForSelf:f}=e(8277),x=e(6010),c=e(8138);class u extends c{constructor(o,n=x.getConfig(),t=[]){super(o,n,!0,t);S(this,"type","ext-inner")}lint(o=0){const{type:n,name:t}=this;return n==="ext-inner"&&(t==="templatestyles"||t==="section")&&String(this)?[f(this,this.getRootNode().posFromIndex(o),`<${t}>\u6807\u7B7E\u5185\u4E0D\u5E94\u6709\u4EFB\u4F55\u5185\u5BB9`)]:super.lint(o)}}m.exports=u},962:(m,C,e)=>{"use strict";const f=e(3434);class x extends f{constructor(){super(...arguments);S(this,"type","list")}}m.exports=x},3423:(m,C,e)=>{"use strict";const f=e(2308),x=e(6935);class c extends f(x){constructor(){super(...arguments);S(this,"type","noinclude")}}m.exports=c},6714:(m,C,e)=>{"use strict";const{generateForSelf:f}=e(8277),x=e(6010),c=e(7507),u=e(6935);class a extends u{constructor(n,t=x.getConfig(),s=[]){super("'".repeat(n),t,s);S(this,"type","quote")}lint(n=0){const{previousSibling:t,nextSibling:s}=this,i=`\u5B64\u7ACB\u7684"'"`,r=[];let l;if((t==null?void 0:t.type)==="text"&&t.data.at(-1)==="'"){l=f(this,this.getRootNode().posFromIndex(n),"");const{startLine:h,startCol:p}=l,[,{length:g}]=t.data.match(/(?:^|[^'])('+)$/u);r.push({message:i,startLine:h,startCol:p-g,endLine:h,endCol:p})}if((s==null?void 0:s.type)==="text"&&s.data[0]==="'"){l||(l=f(this,this.getRootNode().posFromIndex(n),""));const{endLine:h,endCol:p}=l,[{length:g}]=s.data.match(/^'+/u);r.push({message:i,startLine:h,startCol:p,endLine:h,endCol:p+g})}return r}}m.exports=a},851:(m,C,e)=>{"use strict";const f=e(6010),x=e(8138);class c extends x{constructor(d,o=f.getConfig(),n=[]){super(d,o,!0,n);S(this,"type","onlyinclude")}toString(d){return`<onlyinclude>${super.toString()}</onlyinclude>`}getPadding(){return 13}print(){return super.print({pre:"<onlyinclude>",post:"</onlyinclude>"})}isPlain(){return!0}}m.exports=c},9380:(m,C,e)=>{"use strict";const{generateForChild:f}=e(8277),x=e(6010),c=e(8138),u=e(9237);class a extends c{constructor(n,t=x.getConfig(),s=[]){super(void 0,t,!0,s,{AtomToken:":"});S(this,"type","ext-inner");n&&this.append(...n.split(`
|
|
35
|
+
`).map(i=>new u(i,"param-line",t,s,{AstText:":"})))}toString(n){return super.toString(n,`
|
|
36
|
+
`)}text(){return super.text(`
|
|
32
37
|
`)}getGaps(){return 1}print(){return super.print({sep:`
|
|
33
|
-
`})}lint(
|
|
34
|
-
|}`,t=!1){const s=this.getAttribute("config"),n=this.getAttribute("accum");super.insertAt(new a(h,null,"table-syntax",s,n))}}m.exports=u},5567:(m,C,e)=>{var d;"use strict";const g=e(6010),f=e(8138),a=e(3125);class u extends a{constructor(t,s,n=g.getConfig(),i=[]){let o=s==null?void 0:s.match(/\||\0\d+!\x7F/u),r=o?s.slice(0,o.index):"";/\[\[|-\{/u.test(r)&&(o=null,r="");super(t,r,n,i);S(this,"type","td");w(this,d,"");o&&([et(this,d)._]=o);const l=new f(s==null?void 0:s.slice((o==null?void 0:o.index)+T(this,d).length),n,!0,i);l.type="td-inner",this.insertAt(l.setAttribute("stage",4))}afterBuild(){return T(this,d).includes("\0")&&H(this,d,this.getAttribute("buildFromStr")(T(this,d)).map(String).join("")),this}toString(t){const{childNodes:[s,n,i]}=this;return`${s.toString()}${n.toString()}${T(this,d)}${i.toString()}`}getGaps(t=0){return t=t<0?t+this.childNodes.length:t,t===1?T(this,d).length:0}print(){const{childNodes:[t,s,n]}=this;return`<span class="wpb-td">${t.print()}${s.print()}${T(this,d)}${n.print()}</span>`}}d=new WeakMap,m.exports=u},3125:(m,C,e)=>{"use strict";const{generateForChild:g}=e(8277),f=e(6010),a=e(8138),u=e(8058);class d extends a{constructor(t,s="",n=f.getConfig(),i=[],o=null){super(void 0,n,!0,i,{Token:2,SyntaxToken:0,AttributeToken:1,TdToken:"2:"});S(this,"type","tr");const r=e(5037);this.append(new u(t,o,"table-syntax",n,i,{"Stage-1":":","!ExtToken":"",TranscludeToken:":"}),new r(s,"table-attr","tr",n,i))}lint(t=0){const s=super.lint(t),n=this.childNodes.find(({type:o})=>o==="table-inter"),i=String(n).trim();if(n&&i&&!/^<!--.*-->$/su.test(i)){const o=g(n,this.getRootNode().posFromIndex(t),"\u5C06\u88AB\u79FB\u51FA\u8868\u683C\u7684\u5185\u5BB9");o.startLine++,o.startCol=0,s.push(o)}return s}}m.exports=d},7267:(m,C,e)=>{"use strict";const g=e(6010),f=e(1074);class a extends f{constructor(p,h="",t="",s=void 0,n=g.getConfig(),i=[]){h=!h||h.trimStart()!==h?h:` ${h}`;const o=e(8138),r=e(5037),l=p.toLowerCase(),c=new r(h,"ext-attr",l,n,i),x=structuredClone(n),A=new Set(x.ext);let $;switch(A.delete(l),x.ext=[...A],l){case"tab":A.delete("tabs"),x.ext=[...A];case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":case"inputbox":$=new o(t,x,!0,i);break;case"gallery":{const k=e(1891);$=new k(t,x,i);break}case"pre":{const k=e(428);$=new k(t,x,i);break}case"charinsert":{const k=e(8103);$=new k(t,x,i);break}case"references":case"choose":case"combobox":{const k=e(8889),N=e(7033)(`./${l}`);$=new N(t,x,i);break}case"imagemap":{const k=e(2641);$=new k(t,n,i);break}case"dynamicpagelist":{const k=e(9380);$=new k(t,x,i);break}default:{const k=e(6935);$=new k(t,n)}}$.setAttribute("name",l).type="ext-inner";super(p,c,$,s,n,i);S(this,"type","ext");S(this,"closed",!0)}}m.exports=a},8655:(m,C,e)=>{"use strict";const{generateForSelf:g}=e(8277),f=e(2308),a=e(6010),u=e(1074);class d extends f(u){constructor(t,s="",n=void 0,i=void 0,o=a.getConfig(),r=[]){super(t,s,n!=null?n:"",n===void 0||i!=null?i:"",o,r);S(this,"type","include")}lint(t=0){return this.closed?[]:[g(this,this.getRootNode().posFromIndex(t),"\u672A\u95ED\u5408\u7684\u6807\u7B7E")]}}m.exports=d},1074:(m,C,e)=>{var u,d,p;"use strict";const g=e(6010),f=e(8138);class a extends f{constructor(s,n,i,o,r=g.getConfig(),l=[]){super(void 0,r,!0);w(this,u,void 0);w(this,d,void 0);w(this,p,void 0);H(this,p,[s,o||s]),H(this,u,o===void 0),H(this,d,o!==""),this.append(n,i);let c=l.indexOf(n);c===-1&&(c=l.indexOf(i)),c===-1&&(c=1/0),l.splice(c,0,this)}get closed(){return T(this,d)}toString(s){const{firstChild:n,lastChild:i}=this,[o,r]=T(this,p);return T(this,u)?`<${o}${String(n)}/>`:`<${o}${String(n)}>${String(i)}${T(this,d)?`</${r}>`:""}`}getPadding(){return T(this,p)[0].length+1}getGaps(){return 1}print(){const[s,n]=T(this,p);return super.print(T(this,u)?{pre:`<${s}`,post:"/>"}:{pre:`<${s}`,sep:">",post:T(this,d)?`</${n}>`:""})}}u=new WeakMap,d=new WeakMap,p=new WeakMap,m.exports=a},1782:(m,C,e)=>{var t,s,mt;"use strict";const{removeComment:g,print:f}=e(231),{generateForChild:a}=e(8277),u=e(6010),d=e(8138),p=e(9799);class h extends d{constructor(r,l,c=u.getConfig(),x=[]){super(void 0,c,!0,x,{AtomToken:0,SyntaxToken:0,ParameterToken:"1:"});w(this,s);S(this,"type","template");S(this,"modifier","");w(this,t,{});const A=e(9237),$=e(8058),{parserFunction:[k,N,v]}=c;if(r.includes(":")){const[F,...z]=r.split(":");this.setModifier(F)&&(r=z.join(":"))}if(r.includes(":")||l.length===0&&!v.includes(this.modifier.toLowerCase())){const[F,...z]=r.split(":"),O=g(F),U=N.includes(O);if(U||k.includes(O.toLowerCase())){this.setAttribute("name",O.toLowerCase().replace(/^#/u,"")).type="magic-word";const M=new RegExp(`^\\s*${O}\\s*$`,U?"u":"iu"),X=new $(F,M,"magic-word-name",c,x,{"Stage-1":":","!ExtToken":""});if(this.insertAt(X),z.length>0&&l.unshift([z.join(":")]),this.name==="invoke")for(let G=0;G<2;G++){const W=l.shift();if(!W)break;const B=new A(W.join("="),`invoke-${G?"function":"module"}`,c,x,{"Stage-1":":","!ExtToken":""});this.insertAt(B)}}}if(this.type==="template"){const[F]=g(r).split("#");if(/\0\d+[eh!+-]\x7F|[<>[\]{}]/u.test(F))throw x.pop(),new SyntaxError(`\u975E\u6CD5\u7684\u6A21\u677F\u540D\u79F0\uFF1A${F}`);const z=new A(r,"template-name",c,x,{"Stage-2":":","!HeadingToken":""});this.insertAt(z)}const b=this.isTemplate();let I=1;for(const F of l)b||(F[0]=F.join("="),F.length=1),F.length===1&&(F.unshift(I),I++),this.insertAt(new p(...F,c,x))}setModifier(r=""){const{parserFunction:[,,l,c]}=this.getAttribute("config"),x=r.trim().toLowerCase(),A=l.includes(x),$=c.includes(x);return A||$||r===""?(this.setAttribute("modifier",r),Boolean(r)):!1}toString(r){const{childNodes:l,firstChild:c,modifier:x}=this;return`{{${x}${x&&":"}${this.type==="magic-word"?`${String(c)}${l.length>1?":":""}${l.slice(1).map(String).join("|")}`:super.toString(r,"|")}}}`}getPadding(){return this.modifier?this.modifier.length+3:2}getGaps(){return 1}print(){const{childNodes:r,firstChild:l,modifier:c}=this;return`<span class="wpb-${this.type}">{{${c}${c&&":"}${this.type==="magic-word"?`${l.print()}${r.length>1?":":""}${f(r.slice(1),{sep:"|"})}`:f(r,{sep:"|"})}}}</span>`}lint(r=0){const l=super.lint(r);if(!this.isTemplate())return l;const c=this.getDuplicatedArgs();if(c.length>0){const x=this.getRootNode().posFromIndex(r);l.push(...c.flatMap(([,A])=>[...A]).map(A=>a(A,x,"\u91CD\u590D\u53C2\u6570")))}return l}isTemplate(){return this.type==="template"||this.type==="magic-word"&&this.name==="invoke"}insertAt(r,l=this.childNodes.length){return super.insertAt(r,l),r.anon?D(this,s,mt).call(this,r):r.name&&this.getArgs(r.name,!1,!1).add(r),r}getAllArgs(){return this.childNodes.filter(r=>r instanceof p)}getAnonArgs(){return this.getAllArgs().filter(({anon:r})=>r)}getArgs(r,l,c=!0){const x=String(r).trim();let A;return Object.prototype.hasOwnProperty.call(T(this,t),x)?A=T(this,t)[x]:(A=new Set(this.getAllArgs().filter(({name:$})=>x===$)),T(this,t)[x]=A),A}getDuplicatedArgs(){return this.isTemplate()?Object.entries(T(this,t)).filter(([,{size:r}])=>r>1).map(([r,l])=>[r,new Set(l)]):[]}}t=new WeakMap,s=new WeakSet,mt=function(r){const l=this.getAnonArgs(),c=l.indexOf(r);for(let x=c;x<l.length;x++){const A=l[x],{name:$}=A,k=String(x+1);$!==k&&this.getArgs(k,!1,!1).add(A.setAttribute("name",k))}},m.exports=h},8277:(m,C,e)=>{"use strict";const g=e(8138),f=(u,d,p,h="error")=>{const{style:{top:t,left:s,height:n,width:i}}=u,{top:o,left:r}=d,l=o+t,c=l+n-1,x=t?s:r+s,A=n>1?i:x+i;return{message:p,severity:h,startLine:l,endLine:c,startCol:x,endCol:A}},a=(u,d,p,h="error")=>({message:p,severity:h,startLine:d.top,endLine:d.top+u.offsetHeight-1,startCol:d.left,endCol:u.offsetHeight>1?u.offsetWidth:d.left+u.offsetWidth});m.exports={generateForChild:f,generateForSelf:a}},231:(m,C,e)=>{"use strict";const g='(?:\\[[\\da-f:.]+\\]|[^[\\]<>"\\0-\\x1F\\x7F\\p{Zs}\\uFFFD])(?:[^[\\]<>"\\0-\\x1F\\x7F\\p{Zs}\\uFFFD]|\\0\\d+c\\x7F)*',f=p=>p.replaceAll(/\0\d+c\x7F/gu,""),a=(p,h={})=>{const t=e(7507),s=e(9205),{pre:n="",post:i="",sep:o=""}=h,r={"&":"amp","<":"lt",">":"gt"};return`${n}${p.map(l=>l instanceof s?l.print():String(l).replaceAll(/[&<>]/gu,c=>`&${r[c]};`)).join(o)}${i}`},u=p=>p.replaceAll(/[\\{}()|.?*+^$[\]]/gu,"\\$&"),d=(p,h,t,s)=>{if(s===void 0)return[];const n=new RegExp(`${[p,h,t].map(u).join("|")}`,"gu"),i=[];let o=n.exec(s),r=0,l=0;for(;o;){const{0:c,index:x}=o;c!==t?r+=c===p?1:-1:r===0&&(i.push(s.slice(l,x)),{lastIndex:l}=n),o=n.exec(s)}return i.push(s.slice(l)),i};m.exports={extUrlChar:g,removeComment:f,print:a,escapeRegExp:u,explode:d}},8166:m=>{"use strict";m.exports=JSON.parse('{"ext":["nowiki","pre","gallery","indicator"],"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":{"0":"","6":"File","14":"Category"},"nsid":{"":0,"file":6,"image":6,"\u56FE\u50CF":6,"\u5716\u50CF":6,"\u6587\u4EF6":6,"\u6863\u6848":6,"\u6A94\u6848":6,"category":14,"\u5206\u7C7B":14,"\u5206\u985E":14},"parserFunction":[["\u540D\u79F0\u7A7A\u95F4","ns","\u540D\u79F0\u7A7A\u95F4e","nse","url\u7F16\u7801","urlencode","\u5C0F\u5199\u9996\u5B57","lcfirst","\u5927\u5199\u9996\u5B57","ucfirst","\u5C0F\u5199","lc","\u5927\u5199","uc","\u672C\u5730url","localurl","\u672C\u5730urle","localurle","\u5B8C\u6574url","fullurl","\u5B8C\u6574url\u7B49\u540C","fullurle","\u89C4\u8303url","canonicalurl","\u89C4\u8303url\u7B49\u540C","canonicalurle","\u683C\u5F0F\u5316\u6570\u5B57","formatnum","\u8BED\u6CD5","grammar","\u6027\u522B","gender","\u590D\u6570","plural","bidi","#\u8BED\u8A00","#language","\u5DE6\u586B\u5145","padleft","\u53F3\u586B\u5145","padright","\u951A\u7F16\u7801","anchorencode","\u6587\u4EF6\u8DEF\u5F84","filepath","\u9875\u9762id","pageid","\u754C\u9762","int","#\u7279\u6B8A","#special","#\u7279\u6B8A\u7B49\u540C","#speciale","#\u6807\u8BB0","#tag","#\u683C\u5F0F\u5316\u65E5\u671F","#\u65E5\u671F\u683C\u5F0F\u5316","#formatdate","#dateformat","#invoke","#while","#dowhile","#loop","#forargs","#fornumargs","#\u975E\u7A7A\u5F0F","#\u82E5","#\u5982\u679C","#if","#\u76F8\u540C\u5F0F","#\u5339\u914D\u5F0F","#\u82E5\u76F8\u7B49","#\u5982\u679C\u76F8\u7B49","#ifeq","#\u591A\u9009\u5F0F","#\u591A\u6761\u4EF6\u5F0F","#\u53CC\u5C04\u5F0F","#\u5F00\u5173","#\u8F6C\u6362","#switch","#\u5B58\u5728\u5F0F","#\u82E5\u6709","#\u5982\u6709","#ifexist","#\u82E5\u8868\u8FBE\u5F0F","#ifexpr","#\u9519\u8BEF\u5F0F","#\u5982\u679C\u9519\u8BEF","#iferror","#\u65F6\u95F4","#time","#\u65F6\u95F4l","#timel","#\u8BA1\u7B97\u5F0F","#\u8868\u8FBE\u5F0F","#expr","#rel2abs","#\u6807\u9898\u7EC4\u6210\u90E8\u5206","#titleparts","#categorytree","#url\u89E3\u7801","#urldecode","#choose","#\u8C03\u7528","#var","#varexists","#var_final","#vardefine","#vardefineecho","#\u5C0F\u5DE5\u5177","#widget","\u6761\u76EE\u8DEF\u5F84","articlepath","\u670D\u52A1\u5668","server","\u670D\u52A1\u5668\u540D","servername","\u811A\u672C\u8DEF\u5F84","scriptpath","\u6837\u5F0F\u8DEF\u5F84","stylepath","msgnw","#related","#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":{"thumbnail":"thumbnail","thumb":"thumbnail","\u7F29\u7565\u56FE":"thumbnail","thumbnail=$1":"manualthumb","thumb=$1":"manualthumb","\u7F29\u7565\u56FE=$1":"manualthumb","left":"left","\u5DE6":"left","right":"right","\u53F3":"right","none":"none","\u65E0":"none","$1px":"width","$1\u50CF\u7D20":"width","center":"center","centre":"center","\u5C45\u4E2D":"center","framed":"framed","enframed":"framed","frame":"framed","\u6709\u6846":"framed","frameless":"frameless","\u65E0\u6846":"frameless","upright":"upright","\u53F3\u4E0A":"upright","upright=$1":"manual-upright","upright $1":"manual-upright","\u53F3\u4E0A=$1":"manual-upright","\u53F3\u4E0A$1":"manual-upright","border":"border","\u8FB9\u6846":"border","alt=$1":"alt","\u66FF\u4EE3=$1":"alt","\u66FF\u4EE3\u6587\u672C=$1":"alt","class=$1":"class","\u7C7B=$1":"class","link=$1":"link","\u94FE\u63A5=$1":"link","baseline":"baseline","\u57FA\u7EBF":"baseline","sub":"sub","\u5B50":"sub","super":"super","sup":"super","\u8D85":"super","top":"top","\u9876\u90E8":"top","text-top":"text-top","\u6587\u5B57\u9876\u90E8":"text-top","middle":"middle","\u4E2D\u95F4":"middle","bottom":"bottom","\u5E95\u90E8":"bottom","text-bottom":"text-bottom","\u6587\u5B57\u5E95\u90E8":"text-bottom","lang=$1":"lang","\u8BED\u8A00=$1":"lang","page=$1":"page","page $1":"page","\u9875\u6570=$1":"page","$1\u9875":"page"},"variants":["zh","zh-hans","zh-hant","zh-cn","zh-tw","zh-hk","zh-sg","zh-my","zh-mo"]}')}},L={};function j(m){var C=L[m];if(C!==void 0)return C.exports;var e=L[m]={exports:{}};return R[m](e,e.exports,j),e.exports}j.o=(m,C)=>Object.prototype.hasOwnProperty.call(m,C);var K=j(6010)})();})();
|
|
38
|
+
`})}lint(n=0){let t;return this.childNodes.filter(s=>{const{childNodes:i}=s,r=i.findIndex(({type:h})=>h!=="text"),l=(r>=0?i.slice(0,r).map(String).join(""):String(s)).trim();return l&&!(r>=0?/^[a-z]+\s*(?:=|$)/iu:/^[a-z]+\s*=/iu).test(l)}).map(s=>(t||(t=this.getRootNode().posFromIndex(n)),f(s,t,`${this.name}\u7684\u65E0\u6548\u53C2\u6570`)))}}m.exports=a},9799:(m,C,e)=>{"use strict";const f=e(6010),x=e(8138),c=e(9237);class u extends x{constructor(o,n,t=f.getConfig(),s=[]){super(void 0,t,!0,s);S(this,"type","parameter");const i=new c(typeof o=="number"?void 0:o,"parameter-key",t,s,{"Stage-2":":","!HeadingToken":""}),r=new x(n,t,!0,s);r.type="parameter-value",this.append(i,r.setAttribute("stage",2))}get anon(){return this.firstChild.childNodes.length===0}afterBuild(){if(!this.anon){const o=e(1782),n=this.firstChild.text().trim(),{parentNode:t}=this;this.setAttribute("name",n),t&&t instanceof o&&t.getArgs(n,!1,!1).add(this)}return this}toString(o){return this.anon?this.lastChild.toString(o):super.toString(o,"=")}text(){return this.anon?this.lastChild.text():super.text("=")}getGaps(){return this.anon?0:1}print(){return super.print({sep:this.anon?"":"="})}}m.exports=u},8058:(m,C,e)=>{"use strict";const f=e(6010),x=e(8138);class c extends x{constructor(a,d,o="plain",n=f.getConfig(),t=[],s=null){super(a,n,!0,t,s),this.type=o}}m.exports=c},2840:(m,C,e)=>{"use strict";const{generateForChild:f}=e(8277),x=e(3125),c=e(8058);class u extends x{constructor(){super(...arguments);S(this,"type","table")}get closed(){return this.lastChild.type==="table-syntax"}lint(o=0){const n=super.lint(o);return this.closed||n.push(f(this.firstChild,this.getRootNode().posFromIndex(o),"\u672A\u95ED\u5408\u7684\u8868\u683C")),n}close(o=`
|
|
39
|
+
|}`,n=!1){const t=this.getAttribute("config"),s=this.getAttribute("accum");super.insertAt(new c(o,null,"table-syntax",t,s))}}m.exports=u},5567:(m,C,e)=>{var a;"use strict";const f=e(6010),x=e(8138),c=e(3125);class u extends c{constructor(n,t,s=f.getConfig(),i=[]){let r=t==null?void 0:t.match(/\||\0\d+!\x7F/u),l=r?t.slice(0,r.index):"";/\[\[|-\{/u.test(l)&&(r=null,l="");super(n,l,s,i);S(this,"type","td");P(this,a,"");r&&([et(this,a)._]=r);const h=new x(t==null?void 0:t.slice((r==null?void 0:r.index)+A(this,a).length),s,!0,i);h.type="td-inner",this.insertAt(h.setAttribute("stage",4))}afterBuild(){return A(this,a).includes("\0")&&M(this,a,this.getAttribute("buildFromStr")(A(this,a)).map(String).join("")),this}toString(n){const{childNodes:[t,s,i]}=this;return`${t.toString()}${s.toString()}${A(this,a)}${i.toString()}`}text(){const{childNodes:[n,t,s]}=this;return`${n.text()}${t.text()}${A(this,a)}${s.text()}`}getGaps(n=0){return n=n<0?n+this.childNodes.length:n,n===1?A(this,a).length:0}print(){const{childNodes:[n,t,s]}=this;return`<span class="wpb-td">${n.print()}${t.print()}${A(this,a)}${s.print()}</span>`}}a=new WeakMap,m.exports=u},3125:(m,C,e)=>{"use strict";const{generateForChild:f}=e(8277),x=e(6010),c=e(8138),u=e(8058),a=e(5037);class d extends c{constructor(t,s="",i=x.getConfig(),r=[],l=null){super(void 0,i,!0,r,{Token:2,SyntaxToken:0,AttributeToken:1,TdToken:"2:"});S(this,"type","tr");this.append(new u(t,l,"table-syntax",i,r,{"Stage-1":":","!ExtToken":"",TranscludeToken:":"}),new a(s,"table-attr","tr",i,r))}lint(t=0){const s=e(1782),i=super.lint(t),r=this.childNodes.find(({type:p})=>p==="table-inter");if(!r)return i;const l=r.childNodes.find(p=>p.text().trim());if(l){if((l==null?void 0:l.type)==="magic-word")try{if(l.getPossibleValues().every(g=>/^\s*(?:!|\{\{\s*![!-]?\s*\}\})/u.test(g.text())))return i}catch(p){}}else return i;const h=f(r,this.getRootNode().posFromIndex(t),"\u5C06\u88AB\u79FB\u51FA\u8868\u683C\u7684\u5185\u5BB9");return h.startLine++,h.startCol=0,i.push(h),i}text(){const t=super.text();return this.type==="tr"&&!t.trim().includes(`
|
|
40
|
+
`)?"":t}}m.exports=d},7267:(m,C,e)=>{"use strict";const f=e(6010),x=e(1074),c=e(8138),u=e(5037);class a extends x{constructor(n,t="",s="",i=void 0,r=f.getConfig(),l=[]){t=!t||t.trimStart()!==t?t:` ${t}`;const h=n.toLowerCase(),p=new u(t,"ext-attr",h,r,l),g=structuredClone(r),T=new Set(g.ext);let k;switch(T.delete(h),g.ext=[...T],h){case"tab":T.delete("tabs"),g.ext=[...T];case"indicator":case"poem":case"ref":case"option":case"combooption":case"tabs":case"poll":case"seo":case"inputbox":k=new c(s,g,!0,l);break;case"gallery":{const $=e(1891);k=new $(s,g,l);break}case"pre":{const $=e(428);k=new $(s,g,l);break}case"charinsert":{const $=e(8103);k=new $(s,g,l);break}case"references":case"choose":case"combobox":{const $=e(8889),y=e(7033)(`./${h}`);k=new y(s,g,l);break}case"imagemap":{const $=e(2641);k=new $(s,r,l);break}case"dynamicpagelist":{const $=e(9380);k=new $(s,g,l);break}default:{const $=e(6935);k=new $(s,r)}}k.setAttribute("name",h).type="ext-inner";super(n,p,k,i,r,l);S(this,"type","ext");S(this,"closed",!0)}}m.exports=a},8655:(m,C,e)=>{"use strict";const f=e(2308),{generateForSelf:x}=e(8277),c=e(6010),u=e(1074);class a extends f(u){constructor(n,t="",s=void 0,i=void 0,r=c.getConfig(),l=[]){super(n,t,s!=null?s:"",s===void 0||i!=null?i:"",r,l);S(this,"type","include")}lint(n=0){return this.closed?[]:[x(this,this.getRootNode().posFromIndex(n),"\u672A\u95ED\u5408\u7684\u6807\u7B7E")]}}m.exports=a},1074:(m,C,e)=>{var u,a,d;"use strict";const f=e(6010),x=e(8138);class c extends x{constructor(t,s,i,r,l=f.getConfig(),h=[]){super(void 0,l,!0);P(this,u,void 0);P(this,a,void 0);P(this,d,void 0);M(this,d,[t,r||t]),M(this,u,r===void 0),M(this,a,r!==""),this.append(s,i);let p=h.indexOf(s);p===-1&&(p=h.indexOf(i)),p===-1&&(p=1/0),h.splice(p,0,this)}get closed(){return A(this,a)}toString(t){const{firstChild:s,lastChild:i}=this,[r,l]=A(this,d);return A(this,u)?`<${r}${String(s)}/>`:`<${r}${String(s)}>${String(i)}${A(this,a)?`</${l}>`:""}`}text(){const[t,s]=A(this,d);return A(this,u)?`<${t}${this.firstChild.text()}/>`:`<${t}${super.text(">")}${A(this,a)?`</${s}>`:""}`}getPadding(){return A(this,d)[0].length+1}getGaps(){return 1}print(){const[t,s]=A(this,d);return super.print(A(this,u)?{pre:`<${t}`,post:"/>"}:{pre:`<${t}`,sep:">",post:A(this,a)?`</${s}>`:""})}}u=new WeakMap,a=new WeakMap,d=new WeakMap,m.exports=c},1782:(m,C,e)=>{var i,r,mt;"use strict";const{removeComment:f,print:x,text:c}=e(231),{generateForChild:u}=e(8277),a=e(6010),d=e(8138),o=e(9799),n=e(9237),t=e(8058);class s extends d{constructor(g,T,k=a.getConfig(),$=[]){super(void 0,k,!0,$,{AtomToken:0,SyntaxToken:0,ParameterToken:"1:"});P(this,r);S(this,"type","template");S(this,"modifier","");P(this,i,{});const{parserFunction:[y,F,b]}=k;if(g.includes(":")){const[E,...z]=g.split(":");this.setModifier(E)&&(g=z.join(":"))}if(g.includes(":")||T.length===0&&!b.includes(this.modifier.toLowerCase())){const[E,...z]=g.split(":"),j=f(E),R=F.includes(j),B=y[j.toLowerCase()];if(R||B){this.setAttribute("name",B||j.toLowerCase()).type="magic-word";const V=new RegExp(`^\\s*${j}\\s*$`,R?"u":"iu"),X=new t(E,V,"magic-word-name",k,$,{"Stage-1":":","!ExtToken":""});if(this.insertAt(X),z.length>0&&T.unshift([z.join(":")]),this.name==="invoke")for(let D=0;D<2;D++){const Q=T.shift();if(!Q)break;const W=new n(Q.join("="),`invoke-${D?"function":"module"}`,k,$,{"Stage-1":":","!ExtToken":""});this.insertAt(W)}}}if(this.type==="template"){const[E]=f(g).split("#");if(/\0\d+[eh!+-]\x7F|[<>[\]{}]/u.test(E))throw $.pop(),new SyntaxError(`\u975E\u6CD5\u7684\u6A21\u677F\u540D\u79F0\uFF1A${E}`);const z=new n(g,"template-name",k,$,{"Stage-2":":","!HeadingToken":""});this.insertAt(z)}const v=this.isTemplate();let L=1;for(const E of T)v||(E[0]=E.join("="),E.length=1),E.length===1&&(E.unshift(L),L++),this.insertAt(new o(...E,k,$))}setModifier(g=""){const{parserFunction:[,,T,k]}=this.getAttribute("config"),$=g.trim().toLowerCase(),y=T.includes($),F=k.includes($);return y||F||g===""?(this.setAttribute("modifier",g),Boolean(g)):!1}toString(g){const{childNodes:T,firstChild:k,modifier:$}=this;return`{{${$}${$&&":"}${this.type==="magic-word"?`${String(k)}${T.length>1?":":""}${T.slice(1).map(String).join("|")}`:super.toString(g,"|")}}}`}text(){const{childNodes:g,firstChild:T,modifier:k}=this;return`{{${k}${k&&":"}${this.type==="magic-word"?`${T.text()}${g.length>1?":":""}${c(g.slice(1),"|")}`:super.text("|")}}}`}getPadding(){return this.modifier?this.modifier.length+3:2}getGaps(){return 1}print(){const{childNodes:g,firstChild:T,modifier:k}=this;return`<span class="wpb-${this.type}">{{${k}${k&&":"}${this.type==="magic-word"?`${T.print()}${g.length>1?":":""}${x(g.slice(1),{sep:"|"})}`:x(g,{sep:"|"})}}}</span>`}lint(g=0){const T=super.lint(g);if(!this.isTemplate())return T;const k=this.getDuplicatedArgs();if(k.length>0){const $=this.getRootNode().posFromIndex(g);T.push(...k.flatMap(([,y])=>[...y]).map(y=>u(y,$,"\u91CD\u590D\u53C2\u6570")))}return T}isTemplate(){return this.type==="template"||this.type==="magic-word"&&this.name==="invoke"}insertAt(g,T=this.childNodes.length){return super.insertAt(g,T),g.anon?U(this,r,mt).call(this,g):g.name&&this.getArgs(g.name,!1,!1).add(g),g}getAllArgs(){return this.childNodes.filter(g=>g instanceof o)}getAnonArgs(){return this.getAllArgs().filter(({anon:g})=>g)}getArgs(g,T,k=!0){const $=String(g).trim();let y;return Object.prototype.hasOwnProperty.call(A(this,i),$)?y=A(this,i)[$]:(y=new Set(this.getAllArgs().filter(({name:F})=>$===F)),A(this,i)[$]=y),y}getDuplicatedArgs(){return this.isTemplate()?Object.entries(A(this,i)).filter(([,{size:g}])=>g>1).map(([g,T])=>[g,new Set(T)]):[]}getPossibleValues(){const{type:g,name:T,childNodes:k,constructor:{name:$}}=this;if(g==="template")throw new Error(`${$}.getPossibleValues \u65B9\u6CD5\u4EC5\u4F9B\u7279\u5B9A\u9B54\u672F\u5B57\u4F7F\u7528\uFF01`);let y;switch(T){case"if":case"ifexist":case"ifexpr":case"iferror":y=2;break;case"ifeq":y=3;break;default:throw new Error(`${$}.getPossibleValues \u65B9\u6CD5\u4EC5\u4F9B\u7279\u5B9A\u9B54\u672F\u5B57\u4F7F\u7528\uFF01`)}const F=k.slice(y,y+2).map(({childNodes:[,b]})=>b);for(let b=0;b<F.length;){const{length:v,0:L}=F[b].childNodes.filter(E=>E.text().trim());if(v===0)F.splice(b,1);else if(v>1||L.type!=="magic-word")b++;else try{const E=L.getPossibleValues();F.splice(b,1,...E),b+=E.length}catch(E){b++}}return F}}i=new WeakMap,r=new WeakSet,mt=function(g){const T=this.getAnonArgs(),k=T.indexOf(g);for(let $=k;$<T.length;$++){const y=T[$],{name:F}=y,b=String($+1);F!==b&&this.getArgs(b,!1,!1).add(y.setAttribute("name",b))}},m.exports=s},8277:(m,C,e)=>{"use strict";const f=e(8138),x=(u,a,d,o="error")=>{const{style:{top:n,left:t,height:s,width:i}}=u,{top:r,left:l}=a,h=r+n,p=h+s-1,g=n?t:l+t,T=s>1?i:g+i;return{message:d,severity:o,startLine:h,endLine:p,startCol:g,endCol:T}},c=(u,a,d,o="error")=>({message:d,severity:o,startLine:a.top,endLine:a.top+u.offsetHeight-1,startCol:a.left,endCol:u.offsetHeight>1?u.offsetWidth:a.left+u.offsetWidth});m.exports={generateForChild:x,generateForSelf:c}},231:(m,C,e)=>{"use strict";const f='(?:\\[[\\da-f:.]+\\]|[^[\\]<>"\\0-\\x1F\\x7F\\p{Zs}\\uFFFD])(?:[^[\\]<>"\\0-\\x1F\\x7F\\p{Zs}\\uFFFD]|\\0\\d+c\\x7F)*',x=o=>o.replaceAll(/\0\d+c\x7F/gu,""),c=(o,n={})=>{const t=e(7507),s=e(9205),{pre:i="",post:r="",sep:l=""}=n,h={"&":"amp","<":"lt",">":"gt"};return`${i}${o.map(p=>p instanceof s?p.print():String(p).replaceAll(/[&<>]/gu,g=>`&${h[g]};`)).join(l)}${r}`},u=o=>o.replaceAll(/[\\{}()|.?*+^$[\]]/gu,"\\$&"),a=(o,n,t,s)=>{if(s===void 0)return[];const i=new RegExp(`${[o,n,t].map(u).join("|")}`,"gu"),r=[];let l=i.exec(s),h=0,p=0;for(;l;){const{0:g,index:T}=l;g!==t?h+=g===o?1:-1:h===0&&(r.push(s.slice(p,T)),{lastIndex:p}=i),l=i.exec(s)}return r.push(s.slice(p)),r},d=(o,n="")=>{const t=e(3853);return o.map(s=>typeof s=="string"?s:s.text()).join(n)};m.exports={extUrlChar:f,removeComment:x,print:c,escapeRegExp:u,explode:a,text:d}},8166:m=>{"use strict";m.exports=JSON.parse('{"ext":["nowiki","pre","gallery","indicator"],"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":{"0":"","6":"File","14":"Category"},"nsid":{"":0,"file":6,"image":6,"\u56FE\u50CF":6,"\u5716\u50CF":6,"\u6587\u4EF6":6,"\u6863\u6848":6,"\u6A94\u6848":6,"category":14,"\u5206\u7C7B":14,"\u5206\u985E":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","#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":{"thumbnail":"thumbnail","thumb":"thumbnail","\u7F29\u7565\u56FE":"thumbnail","thumbnail=$1":"manualthumb","thumb=$1":"manualthumb","\u7F29\u7565\u56FE=$1":"manualthumb","left":"left","\u5DE6":"left","right":"right","\u53F3":"right","none":"none","\u65E0":"none","$1px":"width","$1\u50CF\u7D20":"width","center":"center","centre":"center","\u5C45\u4E2D":"center","framed":"framed","enframed":"framed","frame":"framed","\u6709\u6846":"framed","frameless":"frameless","\u65E0\u6846":"frameless","upright":"upright","\u53F3\u4E0A":"upright","upright=$1":"manual-upright","upright $1":"manual-upright","\u53F3\u4E0A=$1":"manual-upright","\u53F3\u4E0A$1":"manual-upright","border":"border","\u8FB9\u6846":"border","alt=$1":"alt","\u66FF\u4EE3=$1":"alt","\u66FF\u4EE3\u6587\u672C=$1":"alt","class=$1":"class","\u7C7B=$1":"class","link=$1":"link","\u94FE\u63A5=$1":"link","baseline":"baseline","\u57FA\u7EBF":"baseline","sub":"sub","\u5B50":"sub","super":"super","sup":"super","\u8D85":"super","top":"top","\u9876\u90E8":"top","text-top":"text-top","\u6587\u5B57\u9876\u90E8":"text-top","middle":"middle","\u4E2D\u95F4":"middle","bottom":"bottom","\u5E95\u90E8":"bottom","text-bottom":"text-bottom","\u6587\u5B57\u5E95\u90E8":"text-bottom","lang=$1":"lang","\u8BED\u8A00=$1":"lang","page=$1":"page","page $1":"page","\u9875\u6570=$1":"page","$1\u9875":"page"},"variants":["zh","zh-hans","zh-hant","zh-cn","zh-tw","zh-hk","zh-sg","zh-my","zh-mo"]}')}},O={};function H(m){var C=O[m];if(C!==void 0)return C.exports;var e=O[m]={exports:{}};return G[m](e,e.exports,H),e.exports}H.o=(m,C)=>Object.prototype.hasOwnProperty.call(m,C);var J=H(6010)})();})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wikiparser-node",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.5-b",
|
|
4
4
|
"description": "A Node.js parser for MediaWiki markup with AST",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mediawiki",
|
|
@@ -22,11 +22,12 @@
|
|
|
22
22
|
"url": "git+https://github.com/bhsd-harry/wikiparser-node.git"
|
|
23
23
|
},
|
|
24
24
|
"scripts": {
|
|
25
|
-
"test": "webpack && eslint ."
|
|
25
|
+
"test": "rm bundle/*.js && webpack && eslint .",
|
|
26
|
+
"real": "node test/real.js",
|
|
27
|
+
"single": "node test/single.js"
|
|
26
28
|
},
|
|
27
29
|
"devDependencies": {
|
|
28
30
|
"@types/node": "^17.0.23",
|
|
29
|
-
"types-mediawiki": "^1.2.0",
|
|
30
31
|
"webpack-cli": "^4.10.0",
|
|
31
32
|
"webpack": "^5.73.0",
|
|
32
33
|
"esbuild-loader": "^2.20.0",
|
|
@@ -35,7 +36,8 @@
|
|
|
35
36
|
"eslint-plugin-es-x": "^5.4.0",
|
|
36
37
|
"eslint-plugin-regexp": "^1.11.0",
|
|
37
38
|
"eslint-plugin-unicorn": "^45.0.2",
|
|
38
|
-
"eslint-plugin-jsdoc": "^1.0.0"
|
|
39
|
+
"eslint-plugin-jsdoc": "^1.0.0",
|
|
40
|
+
"request": "^2.88.2"
|
|
39
41
|
},
|
|
40
42
|
"engines": {
|
|
41
43
|
"node": "^18.4.0"
|