index-10409578.js 301 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. var Ai=Object.defineProperty,Hi=Object.defineProperties;var Ni=Object.getOwnPropertyDescriptors;var Un=Object.getOwnPropertySymbols;var Di=Object.prototype.hasOwnProperty,Oi=Object.prototype.propertyIsEnumerable;var Wn=(xe,De,Ae)=>De in xe?Ai(xe,De,{enumerable:!0,configurable:!0,writable:!0,value:Ae}):xe[De]=Ae,Et=(xe,De)=>{for(var Ae in De||(De={}))Di.call(De,Ae)&&Wn(xe,Ae,De[Ae]);if(Un)for(var Ae of Un(De))Oi.call(De,Ae)&&Wn(xe,Ae,De[Ae]);return xe},zn=(xe,De)=>Hi(xe,Ni(De));var Kn=(xe,De,Ae)=>new Promise((je,St)=>{var Rt=Ke=>{try{pt(Ae.next(Ke))}catch(mt){St(mt)}},It=Ke=>{try{pt(Ae.throw(Ke))}catch(mt){St(mt)}},pt=Ke=>Ke.done?je(Ke.value):Promise.resolve(Ke.value).then(Rt,It);pt((Ae=Ae.apply(xe,De)).next())});import{c0 as Fn,bX as Gn,d as Xn,r as dt,c2 as Ri,d4 as Jn,j as Ot,A as Ii,u as ut,c3 as Zn,c4 as Qn,p as ji,_ as Pi,o as $n,l as Yn,X as qi,ax as er,__tla as Bi}from"./index-b5895273.js";import{b as Vi,__tla as Ui}from"./index-5eb30ce0.js";import{o as tr,__tla as Wi}from"./onMountedOrActivated-6125a24a.js";let nr,rr,zi=Promise.all([(()=>{try{return Bi}catch(xe){}})(),(()=>{try{return Ui}catch(xe){}})(),(()=>{try{return Wi}catch(xe){}})()]).then(()=>Kn(void 0,null,function*(){var xe={exports:{}};(function(Be,Ge){(function(He,Ne){Be.exports=Ne()})(Fn,()=>(()=>{var He={471:I=>{var T=function(){this.Diff_Timeout=1,this.Diff_EditCost=4,this.Match_Threshold=.5,this.Match_Distance=1e3,this.Patch_DeleteThreshold=.5,this.Patch_Margin=4,this.Match_MaxBits=32},m=-1;T.Diff=function(d,u){return[d,u]},T.prototype.diff_main=function(d,u,l,g){g===void 0&&(g=this.Diff_Timeout<=0?Number.MAX_VALUE:new Date().getTime()+1e3*this.Diff_Timeout);var a=g;if(d==null||u==null)throw new Error("Null input. (diff_main)");if(d==u)return d?[new T.Diff(0,d)]:[];l===void 0&&(l=!0);var c=l,p=this.diff_commonPrefix(d,u),v=d.substring(0,p);d=d.substring(p),u=u.substring(p),p=this.diff_commonSuffix(d,u);var L=d.substring(d.length-p);d=d.substring(0,d.length-p),u=u.substring(0,u.length-p);var S=this.diff_compute_(d,u,c,a);return v&&S.unshift(new T.Diff(0,v)),L&&S.push(new T.Diff(0,L)),this.diff_cleanupMerge(S),S},T.prototype.diff_compute_=function(d,u,l,g){var a;if(!d)return[new T.Diff(1,u)];if(!u)return[new T.Diff(m,d)];var c=d.length>u.length?d:u,p=d.length>u.length?u:d,v=c.indexOf(p);if(v!=-1)return a=[new T.Diff(1,c.substring(0,v)),new T.Diff(0,p),new T.Diff(1,c.substring(v+p.length))],d.length>u.length&&(a[0][0]=a[2][0]=m),a;if(p.length==1)return[new T.Diff(m,d),new T.Diff(1,u)];var L=this.diff_halfMatch_(d,u);if(L){var S=L[0],_=L[1],E=L[2],k=L[3],h=L[4],N=this.diff_main(S,E,l,g),O=this.diff_main(_,k,l,g);return N.concat([new T.Diff(0,h)],O)}return l&&d.length>100&&u.length>100?this.diff_lineMode_(d,u,g):this.diff_bisect_(d,u,g)},T.prototype.diff_lineMode_=function(d,u,l){var g=this.diff_linesToChars_(d,u);d=g.chars1,u=g.chars2;var a=g.lineArray,c=this.diff_main(d,u,!1,l);this.diff_charsToLines_(c,a),this.diff_cleanupSemantic(c),c.push(new T.Diff(0,""));for(var p=0,v=0,L=0,S="",_="";p<c.length;){switch(c[p][0]){case 1:L++,_+=c[p][1];break;case m:v++,S+=c[p][1];break;case 0:if(v>=1&&L>=1){c.splice(p-v-L,v+L),p=p-v-L;for(var E=this.diff_main(S,_,!1,l),k=E.length-1;k>=0;k--)c.splice(p,0,E[k]);p+=E.length}L=0,v=0,S="",_=""}p++}return c.pop(),c},T.prototype.diff_bisect_=function(d,u,l){for(var g=d.length,a=u.length,c=Math.ceil((g+a)/2),p=c,v=2*c,L=new Array(v),S=new Array(v),_=0;_<v;_++)L[_]=-1,S[_]=-1;L[p+1]=0,S[p+1]=0;for(var E=g-a,k=E%2!=0,h=0,N=0,O=0,G=0,Z=0;Z<c&&!(new Date().getTime()>l);Z++){for(var oe=-Z+h;oe<=Z-N;oe+=2){for(var ae=p+oe,ve=(Se=oe==-Z||oe!=Z&&L[ae-1]<L[ae+1]?L[ae+1]:L[ae-1]+1)-oe;Se<g&&ve<a&&d.charAt(Se)==u.charAt(ve);)Se++,ve++;if(L[ae]=Se,Se>g)N+=2;else if(ve>a)h+=2;else if(k&&(fe=p+E-oe)>=0&&fe<v&&S[fe]!=-1&&Se>=(de=g-S[fe]))return this.diff_bisectSplit_(d,u,Se,ve,l)}for(var pe=-Z+O;pe<=Z-G;pe+=2){for(var de,fe=p+pe,ke=(de=pe==-Z||pe!=Z&&S[fe-1]<S[fe+1]?S[fe+1]:S[fe-1]+1)-pe;de<g&&ke<a&&d.charAt(g-de-1)==u.charAt(a-ke-1);)de++,ke++;if(S[fe]=de,de>g)G+=2;else if(ke>a)O+=2;else if(!k&&(ae=p+E-pe)>=0&&ae<v&&L[ae]!=-1){var Se;if(ve=p+(Se=L[ae])-ae,Se>=(de=g-de))return this.diff_bisectSplit_(d,u,Se,ve,l)}}}return[new T.Diff(m,d),new T.Diff(1,u)]},T.prototype.diff_bisectSplit_=function(d,u,l,g,a){var c=d.substring(0,l),p=u.substring(0,g),v=d.substring(l),L=u.substring(g),S=this.diff_main(c,p,!1,a),_=this.diff_main(v,L,!1,a);return S.concat(_)},T.prototype.diff_linesToChars_=function(d,u){var l=[],g={};function a(v){for(var L="",S=0,_=-1,E=l.length;_<v.length-1;){(_=v.indexOf(`
  2. `,S))==-1&&(_=v.length-1);var k=v.substring(S,_+1);(g.hasOwnProperty?g.hasOwnProperty(k):g[k]!==void 0)?L+=String.fromCharCode(g[k]):(E==c&&(k=v.substring(S),_=v.length),L+=String.fromCharCode(E),g[k]=E,l[E++]=k),S=_+1}return L}l[0]="";var c=4e4,p=a(d);return c=65535,{chars1:p,chars2:a(u),lineArray:l}},T.prototype.diff_charsToLines_=function(d,u){for(var l=0;l<d.length;l++){for(var g=d[l][1],a=[],c=0;c<g.length;c++)a[c]=u[g.charCodeAt(c)];d[l][1]=a.join("")}},T.prototype.diff_commonPrefix=function(d,u){if(!d||!u||d.charAt(0)!=u.charAt(0))return 0;for(var l=0,g=Math.min(d.length,u.length),a=g,c=0;l<a;)d.substring(c,a)==u.substring(c,a)?c=l=a:g=a,a=Math.floor((g-l)/2+l);return a},T.prototype.diff_commonSuffix=function(d,u){if(!d||!u||d.charAt(d.length-1)!=u.charAt(u.length-1))return 0;for(var l=0,g=Math.min(d.length,u.length),a=g,c=0;l<a;)d.substring(d.length-a,d.length-c)==u.substring(u.length-a,u.length-c)?c=l=a:g=a,a=Math.floor((g-l)/2+l);return a},T.prototype.diff_commonOverlap_=function(d,u){var l=d.length,g=u.length;if(l==0||g==0)return 0;l>g?d=d.substring(l-g):l<g&&(u=u.substring(0,l));var a=Math.min(l,g);if(d==u)return a;for(var c=0,p=1;;){var v=d.substring(a-p),L=u.indexOf(v);if(L==-1)return c;p+=L,L!=0&&d.substring(a-p)!=u.substring(0,p)||(c=p,p++)}},T.prototype.diff_halfMatch_=function(d,u){if(this.Diff_Timeout<=0)return null;var l=d.length>u.length?d:u,g=d.length>u.length?u:d;if(l.length<4||2*g.length<l.length)return null;var a=this;function c(h,N,O){for(var G,Z,oe,ae,ve=h.substring(O,O+Math.floor(h.length/4)),pe=-1,de="";(pe=N.indexOf(ve,pe+1))!=-1;){var fe=a.diff_commonPrefix(h.substring(O),N.substring(pe)),ke=a.diff_commonSuffix(h.substring(0,O),N.substring(0,pe));de.length<ke+fe&&(de=N.substring(pe-ke,pe)+N.substring(pe,pe+fe),G=h.substring(0,O-ke),Z=h.substring(O+fe),oe=N.substring(0,pe-ke),ae=N.substring(pe+fe))}return 2*de.length>=h.length?[G,Z,oe,ae,de]:null}var p,v,L,S,_,E=c(l,g,Math.ceil(l.length/4)),k=c(l,g,Math.ceil(l.length/2));return E||k?(p=k?E&&E[4].length>k[4].length?E:k:E,d.length>u.length?(v=p[0],L=p[1],S=p[2],_=p[3]):(S=p[0],_=p[1],v=p[2],L=p[3]),[v,L,S,_,p[4]]):null},T.prototype.diff_cleanupSemantic=function(d){for(var u=!1,l=[],g=0,a=null,c=0,p=0,v=0,L=0,S=0;c<d.length;)d[c][0]==0?(l[g++]=c,p=L,v=S,L=0,S=0,a=d[c][1]):(d[c][0]==1?L+=d[c][1].length:S+=d[c][1].length,a&&a.length<=Math.max(p,v)&&a.length<=Math.max(L,S)&&(d.splice(l[g-1],0,new T.Diff(m,a)),d[l[g-1]+1][0]=1,g--,c=--g>0?l[g-1]:-1,p=0,v=0,L=0,S=0,a=null,u=!0)),c++;for(u&&this.diff_cleanupMerge(d),this.diff_cleanupSemanticLossless(d),c=1;c<d.length;){if(d[c-1][0]==m&&d[c][0]==1){var _=d[c-1][1],E=d[c][1],k=this.diff_commonOverlap_(_,E),h=this.diff_commonOverlap_(E,_);k>=h?(k>=_.length/2||k>=E.length/2)&&(d.splice(c,0,new T.Diff(0,E.substring(0,k))),d[c-1][1]=_.substring(0,_.length-k),d[c+1][1]=E.substring(k),c++):(h>=_.length/2||h>=E.length/2)&&(d.splice(c,0,new T.Diff(0,_.substring(0,h))),d[c-1][0]=1,d[c-1][1]=E.substring(0,E.length-h),d[c+1][0]=m,d[c+1][1]=_.substring(h),c++),c++}c++}},T.prototype.diff_cleanupSemanticLossless=function(d){function u(h,N){if(!h||!N)return 6;var O=h.charAt(h.length-1),G=N.charAt(0),Z=O.match(T.nonAlphaNumericRegex_),oe=G.match(T.nonAlphaNumericRegex_),ae=Z&&O.match(T.whitespaceRegex_),ve=oe&&G.match(T.whitespaceRegex_),pe=ae&&O.match(T.linebreakRegex_),de=ve&&G.match(T.linebreakRegex_),fe=pe&&h.match(T.blanklineEndRegex_),ke=de&&N.match(T.blanklineStartRegex_);return fe||ke?5:pe||de?4:Z&&!ae&&ve?3:ae||ve?2:Z||oe?1:0}for(var l=1;l<d.length-1;){if(d[l-1][0]==0&&d[l+1][0]==0){var g=d[l-1][1],a=d[l][1],c=d[l+1][1],p=this.diff_commonSuffix(g,a);if(p){var v=a.substring(a.length-p);g=g.substring(0,g.length-p),a=v+a.substring(0,a.length-p),c=v+c}for(var L=g,S=a,_=c,E=u(g,a)+u(a,c);a.charAt(0)===c.charAt(0);){g+=a.charAt(0),a=a.substring(1)+c.charAt(0),c=c.substring(1);var k=u(g,a)+u(a,c);k>=E&&(E=k,L=g,S=a,_=c)}d[l-1][1]!=L&&(L?d[l-1][1]=L:(d.splice(l-1,1),l--),d[l][1]=S,_?d[l+1][1]=_:(d.splice(l+1,1),l--))}l++}},T.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/,T.whitespaceRegex_=/\s/,T.linebreakRegex_=/[\r\n]/,T.blanklineEndRegex_=/\n\r?\n$/,T.blanklineStartRegex_=/^\r?\n\r?\n/,T.prototype.diff_cleanupEfficiency=function(d){for(var u=!1,l=[],g=0,a=null,c=0,p=!1,v=!1,L=!1,S=!1;c<d.length;)d[c][0]==0?(d[c][1].length<this.Diff_EditCost&&(L||S)?(l[g++]=c,p=L,v=S,a=d[c][1]):(g=0,a=null),L=S=!1):(d[c][0]==m?S=!0:L=!0,a&&(p&&v&&L&&S||a.length<this.Diff_EditCost/2&&p+v+L+S==3)&&(d.splice(l[g-1],0,new T.Diff(m,a)),d[l[g-1]+1][0]=1,g--,a=null,p&&v?(L=S=!0,g=0):(c=--g>0?l[g-1]:-1,L=S=!1),u=!0)),c++;u&&this.diff_cleanupMerge(d)},T.prototype.diff_cleanupMerge=function(d){d.push(new T.Diff(0,""));for(var u,l=0,g=0,a=0,c="",p="";l<d.length;)switch(d[l][0]){case 1:a++,p+=d[l][1],l++;break;case m:g++,c+=d[l][1],l++;break;case 0:g+a>1?(g!==0&&a!==0&&((u=this.diff_commonPrefix(p,c))!==0&&(l-g-a>0&&d[l-g-a-1][0]==0?d[l-g-a-1][1]+=p.substring(0,u):(d.splice(0,0,new T.Diff(0,p.substring(0,u))),l++),p=p.substring(u),c=c.substring(u)),(u=this.diff_commonSuffix(p,c))!==0&&(d[l][1]=p.substring(p.length-u)+d[l][1],p=p.substring(0,p.length-u),c=c.substring(0,c.length-u))),l-=g+a,d.splice(l,g+a),c.length&&(d.splice(l,0,new T.Diff(m,c)),l++),p.length&&(d.splice(l,0,new T.Diff(1,p)),l++),l++):l!==0&&d[l-1][0]==0?(d[l-1][1]+=d[l][1],d.splice(l,1)):l++,a=0,g=0,c="",p=""}d[d.length-1][1]===""&&d.pop();var v=!1;for(l=1;l<d.length-1;)d[l-1][0]==0&&d[l+1][0]==0&&(d[l][1].substring(d[l][1].length-d[l-1][1].length)==d[l-1][1]?(d[l][1]=d[l-1][1]+d[l][1].substring(0,d[l][1].length-d[l-1][1].length),d[l+1][1]=d[l-1][1]+d[l+1][1],d.splice(l-1,1),v=!0):d[l][1].substring(0,d[l+1][1].length)==d[l+1][1]&&(d[l-1][1]+=d[l+1][1],d[l][1]=d[l][1].substring(d[l+1][1].length)+d[l+1][1],d.splice(l+1,1),v=!0)),l++;v&&this.diff_cleanupMerge(d)},T.prototype.diff_xIndex=function(d,u){var l,g=0,a=0,c=0,p=0;for(l=0;l<d.length&&(d[l][0]!==1&&(g+=d[l][1].length),d[l][0]!==m&&(a+=d[l][1].length),!(g>u));l++)c=g,p=a;return d.length!=l&&d[l][0]===m?p:p+(u-c)},T.prototype.diff_prettyHtml=function(d){for(var u=[],l=/&/g,g=/</g,a=/>/g,c=/\n/g,p=0;p<d.length;p++){var v=d[p][0],L=d[p][1].replace(l,"&amp;").replace(g,"&lt;").replace(a,"&gt;").replace(c,"&para;<br>");switch(v){case 1:u[p]='<ins style="background:#e6ffe6;">'+L+"</ins>";break;case m:u[p]='<del style="background:#ffe6e6;">'+L+"</del>";break;case 0:u[p]="<span>"+L+"</span>"}}return u.join("")},T.prototype.diff_text1=function(d){for(var u=[],l=0;l<d.length;l++)d[l][0]!==1&&(u[l]=d[l][1]);return u.join("")},T.prototype.diff_text2=function(d){for(var u=[],l=0;l<d.length;l++)d[l][0]!==m&&(u[l]=d[l][1]);return u.join("")},T.prototype.diff_levenshtein=function(d){for(var u=0,l=0,g=0,a=0;a<d.length;a++){var c=d[a][0],p=d[a][1];switch(c){case 1:l+=p.length;break;case m:g+=p.length;break;case 0:u+=Math.max(l,g),l=0,g=0}}return u+=Math.max(l,g)},T.prototype.diff_toDelta=function(d){for(var u=[],l=0;l<d.length;l++)switch(d[l][0]){case 1:u[l]="+"+encodeURI(d[l][1]);break;case m:u[l]="-"+d[l][1].length;break;case 0:u[l]="="+d[l][1].length}return u.join(" ").replace(/%20/g," ")},T.prototype.diff_fromDelta=function(d,u){for(var l=[],g=0,a=0,c=u.split(/\t/g),p=0;p<c.length;p++){var v=c[p].substring(1);switch(c[p].charAt(0)){case"+":try{l[g++]=new T.Diff(1,decodeURI(v))}catch(_){throw new Error("Illegal escape in diff_fromDelta: "+v)}break;case"-":case"=":var L=parseInt(v,10);if(isNaN(L)||L<0)throw new Error("Invalid number in diff_fromDelta: "+v);var S=d.substring(a,a+=L);c[p].charAt(0)=="="?l[g++]=new T.Diff(0,S):l[g++]=new T.Diff(m,S);break;default:if(c[p])throw new Error("Invalid diff operation in diff_fromDelta: "+c[p])}}if(a!=d.length)throw new Error("Delta length ("+a+") does not equal source text length ("+d.length+").");return l},T.prototype.match_main=function(d,u,l){if(d==null||u==null||l==null)throw new Error("Null input. (match_main)");return l=Math.max(0,Math.min(l,d.length)),d==u?0:d.length?d.substring(l,l+u.length)==u?l:this.match_bitap_(d,u,l):-1},T.prototype.match_bitap_=function(d,u,l){if(u.length>this.Match_MaxBits)throw new Error("Pattern too long for this browser.");var g=this.match_alphabet_(u),a=this;function c(ve,pe){var de=ve/u.length,fe=Math.abs(l-pe);return a.Match_Distance?de+fe/a.Match_Distance:fe?1:de}var p=this.Match_Threshold,v=d.indexOf(u,l);v!=-1&&(p=Math.min(c(0,v),p),(v=d.lastIndexOf(u,l+u.length))!=-1&&(p=Math.min(c(0,v),p)));var L,S,_=1<<u.length-1;v=-1;for(var E,k=u.length+d.length,h=0;h<u.length;h++){for(L=0,S=k;L<S;)c(h,l+S)<=p?L=S:k=S,S=Math.floor((k-L)/2+L);k=S;var N=Math.max(1,l-S+1),O=Math.min(l+S,d.length)+u.length,G=Array(O+2);G[O+1]=(1<<h)-1;for(var Z=O;Z>=N;Z--){var oe=g[d.charAt(Z-1)];if(G[Z]=h===0?(G[Z+1]<<1|1)&oe:(G[Z+1]<<1|1)&oe|(E[Z+1]|E[Z])<<1|1|E[Z+1],G[Z]&_){var ae=c(h,Z-1);if(ae<=p){if(p=ae,!((v=Z-1)>l))break;N=Math.max(1,2*l-v)}}}if(c(h+1,l)>p)break;E=G}return v},T.prototype.match_alphabet_=function(d){for(var u={},l=0;l<d.length;l++)u[d.charAt(l)]=0;for(l=0;l<d.length;l++)u[d.charAt(l)]|=1<<d.length-l-1;return u},T.prototype.patch_addContext_=function(d,u){if(u.length!=0){if(d.start2===null)throw Error("patch not initialized");for(var l=u.substring(d.start2,d.start2+d.length1),g=0;u.indexOf(l)!=u.lastIndexOf(l)&&l.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)g+=this.Patch_Margin,l=u.substring(d.start2-g,d.start2+d.length1+g);g+=this.Patch_Margin;var a=u.substring(d.start2-g,d.start2);a&&d.diffs.unshift(new T.Diff(0,a));var c=u.substring(d.start2+d.length1,d.start2+d.length1+g);c&&d.diffs.push(new T.Diff(0,c)),d.start1-=a.length,d.start2-=a.length,d.length1+=a.length+c.length,d.length2+=a.length+c.length}},T.prototype.patch_make=function(d,u,l){var g,a;if(typeof d=="string"&&typeof u=="string"&&l===void 0)g=d,(a=this.diff_main(g,u,!0)).length>2&&(this.diff_cleanupSemantic(a),this.diff_cleanupEfficiency(a));else if(d&&typeof d=="object"&&u===void 0&&l===void 0)a=d,g=this.diff_text1(a);else if(typeof d=="string"&&u&&typeof u=="object"&&l===void 0)g=d,a=u;else{if(typeof d!="string"||typeof u!="string"||!l||typeof l!="object")throw new Error("Unknown call format to patch_make.");g=d,a=l}if(a.length===0)return[];for(var c=[],p=new T.patch_obj,v=0,L=0,S=0,_=g,E=g,k=0;k<a.length;k++){var h=a[k][0],N=a[k][1];switch(v||h===0||(p.start1=L,p.start2=S),h){case 1:p.diffs[v++]=a[k],p.length2+=N.length,E=E.substring(0,S)+N+E.substring(S);break;case m:p.length1+=N.length,p.diffs[v++]=a[k],E=E.substring(0,S)+E.substring(S+N.length);break;case 0:N.length<=2*this.Patch_Margin&&v&&a.length!=k+1?(p.diffs[v++]=a[k],p.length1+=N.length,p.length2+=N.length):N.length>=2*this.Patch_Margin&&v&&(this.patch_addContext_(p,_),c.push(p),p=new T.patch_obj,v=0,_=E,L=S)}h!==1&&(L+=N.length),h!==m&&(S+=N.length)}return v&&(this.patch_addContext_(p,_),c.push(p)),c},T.prototype.patch_deepCopy=function(d){for(var u=[],l=0;l<d.length;l++){var g=d[l],a=new T.patch_obj;a.diffs=[];for(var c=0;c<g.diffs.length;c++)a.diffs[c]=new T.Diff(g.diffs[c][0],g.diffs[c][1]);a.start1=g.start1,a.start2=g.start2,a.length1=g.length1,a.length2=g.length2,u[l]=a}return u},T.prototype.patch_apply=function(d,u){if(d.length==0)return[u,[]];d=this.patch_deepCopy(d);var l=this.patch_addPadding(d);u=l+u+l,this.patch_splitMax(d);for(var g=0,a=[],c=0;c<d.length;c++){var p,v,L=d[c].start2+g,S=this.diff_text1(d[c].diffs),_=-1;if(S.length>this.Match_MaxBits?(p=this.match_main(u,S.substring(0,this.Match_MaxBits),L))!=-1&&((_=this.match_main(u,S.substring(S.length-this.Match_MaxBits),L+S.length-this.Match_MaxBits))==-1||p>=_)&&(p=-1):p=this.match_main(u,S,L),p==-1)a[c]=!1,g-=d[c].length2-d[c].length1;else if(a[c]=!0,g=p-L,S==(v=_==-1?u.substring(p,p+S.length):u.substring(p,_+this.Match_MaxBits)))u=u.substring(0,p)+this.diff_text2(d[c].diffs)+u.substring(p+S.length);else{var E=this.diff_main(S,v,!1);if(S.length>this.Match_MaxBits&&this.diff_levenshtein(E)/S.length>this.Patch_DeleteThreshold)a[c]=!1;else{this.diff_cleanupSemanticLossless(E);for(var k,h=0,N=0;N<d[c].diffs.length;N++){var O=d[c].diffs[N];O[0]!==0&&(k=this.diff_xIndex(E,h)),O[0]===1?u=u.substring(0,p+k)+O[1]+u.substring(p+k):O[0]===m&&(u=u.substring(0,p+k)+u.substring(p+this.diff_xIndex(E,h+O[1].length))),O[0]!==m&&(h+=O[1].length)}}}}return[u=u.substring(l.length,u.length-l.length),a]},T.prototype.patch_addPadding=function(d){for(var u=this.Patch_Margin,l="",g=1;g<=u;g++)l+=String.fromCharCode(g);for(g=0;g<d.length;g++)d[g].start1+=u,d[g].start2+=u;var a=d[0],c=a.diffs;if(c.length==0||c[0][0]!=0)c.unshift(new T.Diff(0,l)),a.start1-=u,a.start2-=u,a.length1+=u,a.length2+=u;else if(u>c[0][1].length){var p=u-c[0][1].length;c[0][1]=l.substring(c[0][1].length)+c[0][1],a.start1-=p,a.start2-=p,a.length1+=p,a.length2+=p}return(c=(a=d[d.length-1]).diffs).length==0||c[c.length-1][0]!=0?(c.push(new T.Diff(0,l)),a.length1+=u,a.length2+=u):u>c[c.length-1][1].length&&(p=u-c[c.length-1][1].length,c[c.length-1][1]+=l.substring(0,p),a.length1+=p,a.length2+=p),l},T.prototype.patch_splitMax=function(d){for(var u=this.Match_MaxBits,l=0;l<d.length;l++)if(!(d[l].length1<=u)){var g=d[l];d.splice(l--,1);for(var a=g.start1,c=g.start2,p="";g.diffs.length!==0;){var v=new T.patch_obj,L=!0;for(v.start1=a-p.length,v.start2=c-p.length,p!==""&&(v.length1=v.length2=p.length,v.diffs.push(new T.Diff(0,p)));g.diffs.length!==0&&v.length1<u-this.Patch_Margin;){var S=g.diffs[0][0],_=g.diffs[0][1];S===1?(v.length2+=_.length,c+=_.length,v.diffs.push(g.diffs.shift()),L=!1):S===m&&v.diffs.length==1&&v.diffs[0][0]==0&&_.length>2*u?(v.length1+=_.length,a+=_.length,L=!1,v.diffs.push(new T.Diff(S,_)),g.diffs.shift()):(_=_.substring(0,u-v.length1-this.Patch_Margin),v.length1+=_.length,a+=_.length,S===0?(v.length2+=_.length,c+=_.length):L=!1,v.diffs.push(new T.Diff(S,_)),_==g.diffs[0][1]?g.diffs.shift():g.diffs[0][1]=g.diffs[0][1].substring(_.length))}p=(p=this.diff_text2(v.diffs)).substring(p.length-this.Patch_Margin);var E=this.diff_text1(g.diffs).substring(0,this.Patch_Margin);E!==""&&(v.length1+=E.length,v.length2+=E.length,v.diffs.length!==0&&v.diffs[v.diffs.length-1][0]===0?v.diffs[v.diffs.length-1][1]+=E:v.diffs.push(new T.Diff(0,E))),L||d.splice(++l,0,v)}}},T.prototype.patch_toText=function(d){for(var u=[],l=0;l<d.length;l++)u[l]=d[l];return u.join("")},T.prototype.patch_fromText=function(d){var u=[];if(!d)return u;for(var l=d.split(`
  3. `),g=0,a=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;g<l.length;){var c=l[g].match(a);if(!c)throw new Error("Invalid patch string: "+l[g]);var p=new T.patch_obj;for(u.push(p),p.start1=parseInt(c[1],10),c[2]===""?(p.start1--,p.length1=1):c[2]=="0"?p.length1=0:(p.start1--,p.length1=parseInt(c[2],10)),p.start2=parseInt(c[3],10),c[4]===""?(p.start2--,p.length2=1):c[4]=="0"?p.length2=0:(p.start2--,p.length2=parseInt(c[4],10)),g++;g<l.length;){var v=l[g].charAt(0);try{var L=decodeURI(l[g].substring(1))}catch(S){throw new Error("Illegal escape in patch_fromText: "+L)}if(v=="-")p.diffs.push(new T.Diff(m,L));else if(v=="+")p.diffs.push(new T.Diff(1,L));else if(v==" ")p.diffs.push(new T.Diff(0,L));else{if(v=="@")break;if(v!=="")throw new Error('Invalid patch mode "'+v+'" in: '+L)}g++}}return u},(T.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0}).prototype.toString=function(){for(var d,u=["@@ -"+(this.length1===0?this.start1+",0":this.length1==1?this.start1+1:this.start1+1+","+this.length1)+" +"+(this.length2===0?this.start2+",0":this.length2==1?this.start2+1:this.start2+1+","+this.length2)+` @@
  4. `],l=0;l<this.diffs.length;l++){switch(this.diffs[l][0]){case 1:d="+";break;case m:d="-";break;case 0:d=" "}u[l+1]=d+encodeURI(this.diffs[l][1])+`
  5. `}return u.join("").replace(/%20/g," ")},I.exports=T,I.exports.diff_match_patch=T,I.exports.DIFF_DELETE=m,I.exports.DIFF_INSERT=1,I.exports.DIFF_EQUAL=0},872:(I,T,m)=>{m.d(T,{default:()=>ee});var d=m(478),u=m(156),l=m(314),g=m(730),a=m(66),c=m(218),p=m(702),v=function(A){A===void 0&&(A=document);var q=function(P){var D=document.createElement("img");D.src=P.getAttribute("data-src"),D.addEventListener("load",function(){P.getAttribute("style")||P.getAttribute("class")||P.getAttribute("width")||P.getAttribute("height")||D.naturalHeight>D.naturalWidth&&D.naturalWidth/D.naturalHeight<document.querySelector(".vditor-reset").clientWidth/(window.innerHeight-40)&&D.naturalHeight>window.innerHeight-40&&(P.style.height=window.innerHeight-40+"px"),P.src=D.src}),P.removeAttribute("data-src")};if(!("IntersectionObserver"in window))return A.querySelectorAll("img").forEach(function(P){P.getAttribute("data-src")&&q(P)}),!1;window.vditorImageIntersectionObserver?(window.vditorImageIntersectionObserver.disconnect(),A.querySelectorAll("img").forEach(function(P){window.vditorImageIntersectionObserver.observe(P)})):(window.vditorImageIntersectionObserver=new IntersectionObserver(function(P){P.forEach(function(D){(D.isIntersecting===void 0?D.intersectionRatio!==0:D.isIntersecting)&&D.target.getAttribute("data-src")&&q(D.target)})}),A.querySelectorAll("img").forEach(function(P){window.vditorImageIntersectionObserver.observe(P)}))},L=m(466),S=m(554),_=m(40),E=m(563),k=m(749),h=m(818),N=m(408),O=m(54),G=m(227),Z=m(526),oe=m(827),ae=m(640),ve=m(895),pe=m(393),de=function(A,q){if(q===void 0&&(q="zh_CN"),typeof speechSynthesis<"u"&&typeof SpeechSynthesisUtterance<"u"){var P='<svg><use xlink:href="#vditor-icon-play"></use></svg>',D='<svg><use xlink:href="#vditor-icon-pause"></use></svg>';document.getElementById("vditorIconScript")||(P='<svg viewBox="0 0 32 32"><path d="M3.436 0l25.128 16-25.128 16v-32z"></path></svg>',D='<svg viewBox="0 0 32 32"><path d="M20.617 0h9.128v32h-9.128v-32zM2.255 32v-32h9.128v32h-9.128z"></path></svg>');var U=document.querySelector(".vditor-speech");if(!U){(U=document.createElement("div")).className="vditor-speech",document.body.insertAdjacentElement("beforeend",U);var se=function(){var $,me;return speechSynthesis.getVoices().forEach(function(ye){ye.lang===q.replace("_","-")&&($=ye),ye.default&&(me=ye)}),$||($=me),$};speechSynthesis.onvoiceschanged!==void 0&&(speechSynthesis.onvoiceschanged=se);var te=se();U.onclick=function(){if(U.className==="vditor-speech"){var $=new SpeechSynthesisUtterance(U.getAttribute("data-text"));$.voice=te,$.onend=function(){U.className="vditor-speech",speechSynthesis.cancel(),U.innerHTML=P},speechSynthesis.speak($),U.className="vditor-speech vditor-speech--current",U.innerHTML=D}else speechSynthesis.speaking&&(speechSynthesis.paused?(speechSynthesis.resume(),U.innerHTML=D):(speechSynthesis.pause(),U.innerHTML=P));(0,pe.Hc)(window.vditorSpeechRange)},document.body.addEventListener("click",function(){getSelection().toString().trim()===""&&U.style.display==="block"&&(U.className="vditor-speech",speechSynthesis.cancel(),U.style.display="none")})}A.addEventListener("mouseup",function($){var me=getSelection().toString().trim();if(speechSynthesis.cancel(),getSelection().toString().trim()!==""){window.vditorSpeechRange=getSelection().getRangeAt(0).cloneRange();var ye=getSelection().getRangeAt(0).getBoundingClientRect();U.innerHTML=P,U.style.display="block",U.style.top=ye.top+ye.height+document.querySelector("html").scrollTop-20+"px",U.style.left=$.clientX+2+"px",U.setAttribute("data-text",me)}else U.style.display==="block"&&(U.className="vditor-speech",U.style.display="none")})}},fe=function(A,q,P,D){return new(P||(P=Promise))(function(U,se){function te(ye){try{me(D.next(ye))}catch(ce){se(ce)}}function $(ye){try{me(D.throw(ye))}catch(ce){se(ce)}}function me(ye){var ce;ye.done?U(ye.value):(ce=ye.value,ce instanceof P?ce:new P(function(Qe){Qe(ce)})).then(te,$)}me((D=D.apply(A,q||[])).next())})},ke=function(A,q){var P,D,U,se,te={label:0,sent:function(){if(1&U[0])throw U[1];return U[1]},trys:[],ops:[]};return se={next:$(0),throw:$(1),return:$(2)},typeof Symbol=="function"&&(se[Symbol.iterator]=function(){return this}),se;function $(me){return function(ye){return function(ce){if(P)throw new TypeError("Generator is already executing.");for(;te;)try{if(P=1,D&&(U=2&ce[0]?D.return:ce[0]?D.throw||((U=D.return)&&U.call(D),0):D.next)&&!(U=U.call(D,ce[1])).done)return U;switch(D=0,U&&(ce=[2&ce[0],U.value]),ce[0]){case 0:case 1:U=ce;break;case 4:return te.label++,{value:ce[1],done:!1};case 5:te.label++,D=ce[1],ce=[0];continue;case 7:ce=te.ops.pop(),te.trys.pop();continue;default:if(U=te.trys,!((U=U.length>0&&U[U.length-1])||ce[0]!==6&&ce[0]!==2)){te=0;continue}if(ce[0]===3&&(!U||ce[1]>U[0]&&ce[1]<U[3])){te.label=ce[1];break}if(ce[0]===6&&te.label<U[1]){te.label=U[1],U=ce;break}if(U&&te.label<U[2]){te.label=U[2],te.ops.push(ce);break}U[2]&&te.ops.pop(),te.trys.pop();continue}ce=q.call(A,te)}catch(Qe){ce=[6,Qe],D=0}finally{P=U=0}if(5&ce[0])throw ce[1];return{value:ce[0]?ce[1]:void 0,done:!0}}([me,ye])}}},Se=function(A){var q={anchor:0,cdn:O.g.CDN,customEmoji:{},emojiPath:(A&&A.emojiPath||O.g.CDN)+"/dist/images/emoji",hljs:O.g.HLJS_OPTIONS,icon:"ant",lang:"zh_CN",markdown:O.g.MARKDOWN_OPTIONS,math:O.g.MATH_OPTIONS,mode:"light",speech:{enable:!1},theme:O.g.THEME_OPTIONS};return(0,ae.T)(q,A)},Pe=function(A,q){var P=Se(q);return(0,Z.G)(P.cdn+"/dist/js/lute/lute.min.js","vditorLuteScript").then(function(){var D=(0,ve.X)({autoSpace:P.markdown.autoSpace,gfmAutoLink:P.markdown.gfmAutoLink,codeBlockPreview:P.markdown.codeBlockPreview,emojiSite:P.emojiPath,emojis:P.customEmoji,fixTermTypo:P.markdown.fixTermTypo,footnotes:P.markdown.footnotes,headingAnchor:P.anchor!==0,inlineMathDigit:P.math.inlineDigit,lazyLoadImage:P.lazyLoadImage,linkBase:P.markdown.linkBase,linkPrefix:P.markdown.linkPrefix,listStyle:P.markdown.listStyle,mark:P.markdown.mark,mathBlockPreview:P.markdown.mathBlockPreview,paragraphBeginningSpace:P.markdown.paragraphBeginningSpace,sanitize:P.markdown.sanitize,toc:P.markdown.toc});return q!=null&&q.renderers&&D.SetJSRenderers({renderers:{Md2HTML:q.renderers}}),D.SetHeadingID(!0),D.Md2HTML(A)})},ge=function(A,q,P){return fe(void 0,void 0,void 0,function(){var D,U,se;return ke(this,function(te){switch(te.label){case 0:return D=Se(P),[4,Pe(q,D)];case 1:if(U=te.sent(),D.transform&&(U=D.transform(U)),A.innerHTML=U,A.classList.add("vditor-reset"),D.i18n)return[3,5];if(["en_US","fr_FR","pt_BR","ja_JP","ko_KR","ru_RU","sv_SE","zh_CN","zh_TW"].includes(D.lang))return[3,2];throw new Error("options.lang error, see https://ld246.com/article/1549638745630#options");case 2:return se="vditorI18nScript"+D.lang,document.querySelectorAll('head script[id^="vditorI18nScript"]').forEach(function(me){me.id!==se&&document.head.removeChild(me)}),[4,(0,Z.G)(D.cdn+"/dist/js/i18n/"+D.lang+".js",se)];case 3:te.sent(),te.label=4;case 4:return[3,6];case 5:window.VditorI18n=D.i18n,te.label=6;case 6:return D.icon?[4,(0,Z.G)(D.cdn+"/dist/js/icons/"+D.icon+".js","vditorIconScript")]:[3,8];case 7:te.sent(),te.label=8;case 8:return(0,G.Z)(D.theme.current,D.theme.path),D.anchor===1&&A.classList.add("vditor-reset--anchor"),(0,g.O)(A),(0,p.s)(D.hljs,A,D.cdn),(0,L.H)(A,{cdn:D.cdn,math:D.math}),(0,_.i)(A,D.cdn,D.mode),(0,E.K)(A,D.cdn,D.mode),(0,a.P)(A,D.cdn),(0,c.v)(A,D.cdn),(0,l.p)(A,D.cdn,D.mode),(0,k.P)(A,D.cdn,D.mode),(0,N.B)(A,D.cdn),(0,d.Q)(A,D.cdn),(0,S.Y)(A),D.speech.enable&&de(A),D.anchor!==0&&($=D.anchor,document.querySelectorAll(".vditor-anchor").forEach(function(me){$===1&&me.classList.add("vditor-anchor--left"),me.onclick=function(){var ye=me.getAttribute("href").substr(1),ce=document.getElementById("vditorAnchor-"+ye).offsetTop;document.querySelector("html").scrollTop=ce}}),window.onhashchange=function(){var me=document.getElementById("vditorAnchor-"+decodeURIComponent(window.location.hash.substr(1)));me&&(document.querySelector("html").scrollTop=me.offsetTop)}),D.after&&D.after(),D.lazyLoadImage&&v(A),A.addEventListener("click",function(me){var ye=(0,oe.lG)(me.target,"SPAN");if(ye&&(0,oe.fb)(ye,"vditor-toc")){var ce=A.querySelector("#"+ye.getAttribute("data-target-id"));ce&&window.scrollTo(window.scrollX,ce.offsetTop)}}),[2]}var $})})},M=m(863),he=m(312);const ee=function(){function A(){}return A.adapterRender=u,A.previewImage=M.E,A.codeRender=g.O,A.graphvizRender=c.v,A.highlightRender=p.s,A.mathRender=L.H,A.mermaidRender=_.i,A.markmapRender=E.K,A.flowchartRender=a.P,A.chartRender=l.p,A.abcRender=d.Q,A.mindmapRender=k.P,A.plantumlRender=N.B,A.outlineRender=h.k,A.mediaRender=S.Y,A.speechRender=de,A.lazyLoadImageRender=v,A.md2html=Pe,A.preview=ge,A.setCodeTheme=he.Y,A.setContentTheme=G.Z,A}()},54:(I,T,m)=>{m.d(T,{H:()=>d,g:()=>u});var d="3.9.6",u=function(){function l(){}return l.ZWSP="\u200B",l.DROP_EDITOR="application/editor",l.MOBILE_WIDTH=520,l.CLASS_MENU_DISABLED="vditor-menu--disabled",l.EDIT_TOOLBARS=["emoji","headings","bold","italic","strike","link","list","ordered-list","outdent","indent","check","line","quote","code","inline-code","insert-after","insert-before","upload","record","table"],l.CODE_THEME=["abap","algol","algol_nu","arduino","autumn","borland","bw","colorful","dracula","emacs","friendly","fruity","github","igor","lovelace","manni","monokai","monokailight","murphy","native","paraiso-dark","paraiso-light","pastie","perldoc","pygments","rainbow_dash","rrt","solarized-dark","solarized-dark256","solarized-light","swapoff","tango","trac","vim","vs","xcode","ant-design"],l.CODE_LANGUAGES=["mermaid","echarts","mindmap","plantuml","abc","graphviz","flowchart","apache","js","ts","html","markmap","properties","apache","bash","c","csharp","cpp","css","coffeescript","diff","go","xml","http","json","java","javascript","kotlin","less","lua","makefile","markdown","nginx","objectivec","php","php-template","perl","plaintext","python","python-repl","r","ruby","rust","scss","sql","shell","swift","ini","typescript","vbnet","yaml","ada","clojure","dart","erb","fortran","gradle","haskell","julia","julia-repl","lisp","matlab","pgsql","powershell","sql_more","stata","cmake","mathematica","solidity","yul"],l.CDN="https://unpkg.com/vditor@3.9.6",l.MARKDOWN_OPTIONS={autoSpace:!1,gfmAutoLink:!0,codeBlockPreview:!0,fixTermTypo:!1,footnotes:!0,linkBase:"",linkPrefix:"",listStyle:!1,mark:!1,mathBlockPreview:!0,paragraphBeginningSpace:!1,sanitize:!0,toc:!1},l.HLJS_OPTIONS={enable:!0,lineNumber:!1,defaultLang:"",style:"github"},l.MATH_OPTIONS={engine:"KaTeX",inlineDigit:!1,macros:{}},l.THEME_OPTIONS={current:"light",list:{"ant-design":"Ant Design",dark:"Dark",light:"Light",wechat:"WeChat"},path:l.CDN+"/dist/css/content-theme"},l}()},478:(I,T,m)=>{m.d(T,{Q:()=>g});var d=m(54),u=m(526),l=m(156),g=function(a,c){a===void 0&&(a=document),c===void 0&&(c=d.g.CDN);var p=l.abcRenderAdapter.getElements(a);p.length>0&&(0,u.G)(c+"/dist/js/abcjs/abcjs_basic.min.js","vditorAbcjsScript").then(function(){p.forEach(function(v){v.parentElement.classList.contains("vditor-wysiwyg__pre")||v.parentElement.classList.contains("vditor-ir__marker--pre")||v.getAttribute("data-processed")!=="true"&&(ABCJS.renderAbc(v,l.abcRenderAdapter.getCode(v).trim()),v.style.overflowX="auto",v.setAttribute("data-processed","true"))})})}},156:(I,T,m)=>{m.r(T),m.d(T,{abcRenderAdapter:()=>c,chartRenderAdapter:()=>a,flowchartRenderAdapter:()=>v,graphvizRenderAdapter:()=>p,markmapRenderAdapter:()=>l,mathRenderAdapter:()=>d,mermaidRenderAdapter:()=>u,mindmapRenderAdapter:()=>g,plantumlRenderAdapter:()=>L});var d={getCode:function(S){return S.textContent},getElements:function(S){return S.querySelectorAll(".language-math")}},u={getCode:function(S){return S.textContent},getElements:function(S){return S.querySelectorAll(".language-mermaid")}},l={getCode:function(S){return S.textContent},getElements:function(S){return S.querySelectorAll(".language-markmap")}},g={getCode:function(S){return S.getAttribute("data-code")},getElements:function(S){return S.querySelectorAll(".language-mindmap")}},a={getCode:function(S){return S.innerText},getElements:function(S){return S.querySelectorAll(".language-echarts")}},c={getCode:function(S){return S.textContent},getElements:function(S){return S.querySelectorAll(".language-abc")}},p={getCode:function(S){return S.textContent},getElements:function(S){return S.querySelectorAll(".language-graphviz")}},v={getCode:function(S){return S.textContent},getElements:function(S){return S.querySelectorAll(".language-flowchart")}},L={getCode:function(S){return S.textContent},getElements:function(S){return S.querySelectorAll(".language-plantuml")}}},314:(I,T,m)=>{m.d(T,{p:()=>g});var d=m(54),u=m(526),l=m(156),g=function(a,c,p){a===void 0&&(a=document),c===void 0&&(c=d.g.CDN);var v=l.chartRenderAdapter.getElements(a);v.length>0&&(0,u.G)(c+"/dist/js/echarts/echarts.min.js","vditorEchartsScript").then(function(){v.forEach(function(L){if(!L.parentElement.classList.contains("vditor-wysiwyg__pre")&&!L.parentElement.classList.contains("vditor-ir__marker--pre")){var S=l.chartRenderAdapter.getCode(L).trim();if(S)try{if(L.getAttribute("data-processed")==="true")return;var _=JSON.parse(S);echarts.init(L,p==="dark"?"dark":void 0).setOption(_),L.setAttribute("data-processed","true")}catch(E){L.className="vditor-reset--error",L.innerHTML="echarts render error: <br>"+E}}})})}},730:(I,T,m)=>{m.d(T,{O:()=>l});var d=m(51),u=m(54),l=function(g){g.querySelectorAll("pre > code").forEach(function(a,c){var p,v,L;if(!a.parentElement.classList.contains("vditor-wysiwyg__pre")&&!a.parentElement.classList.contains("vditor-ir__marker--pre")&&!(a.classList.contains("language-mermaid")||a.classList.contains("language-flowchart")||a.classList.contains("language-echarts")||a.classList.contains("language-mindmap")||a.classList.contains("language-plantuml")||a.classList.contains("language-markmap")||a.classList.contains("language-abc")||a.classList.contains("language-graphviz")||a.classList.contains("language-math")||a.style.maxHeight.indexOf("px")>-1||g.classList.contains("vditor-preview")&&c>5)){var S=a.innerText;if(a.classList.contains("highlight-chroma")){var _=document.createElement("code");_.innerHTML=a.innerHTML,_.querySelectorAll(".highlight-ln").forEach(function(N){N.remove()}),S=_.innerText}else S.endsWith(`
  6. `)&&(S=S.substr(0,S.length-1));var E='<svg><use xlink:href="#vditor-icon-copy"></use></svg>';document.getElementById("vditorIconScript")||(E='<svg viewBox="0 0 32 32"><path d="M22.545-0h-17.455c-1.6 0-2.909 1.309-2.909 2.909v20.364h2.909v-20.364h17.455v-2.909zM26.909 5.818h-16c-1.6 0-2.909 1.309-2.909 2.909v20.364c0 1.6 1.309 2.909 2.909 2.909h16c1.6 0 2.909-1.309 2.909-2.909v-20.364c0-1.6-1.309-2.909-2.909-2.909zM26.909 29.091h-16v-20.364h16v20.364z"></path></svg>');var k=document.createElement("div");k.className="vditor-copy",k.innerHTML='<span aria-label="'+(((p=window.VditorI18n)===null||p===void 0?void 0:p.copy)||"\u590D\u5236")+`"
  7. onmouseover="this.setAttribute('aria-label', '`+(((v=window.VditorI18n)===null||v===void 0?void 0:v.copy)||"\u590D\u5236")+`')"
  8. class="vditor-tooltipped vditor-tooltipped__w"
  9. onclick="this.previousElementSibling.select();document.execCommand('copy');this.setAttribute('aria-label', '`+(((L=window.VditorI18n)===null||L===void 0?void 0:L.copied)||"\u5DF2\u590D\u5236")+`')">`+E+"</span>";var h=document.createElement("textarea");h.value=(0,d.X)(S),k.insertAdjacentElement("afterbegin",h),a.before(k),a.style.maxHeight=window.outerHeight-40+"px",a.insertAdjacentHTML("afterend",'<span style="position: absolute">'+u.g.ZWSP+"</span>")}})}},66:(I,T,m)=>{m.d(T,{P:()=>g});var d=m(54),u=m(526),l=m(156),g=function(a,c){c===void 0&&(c=d.g.CDN);var p=l.flowchartRenderAdapter.getElements(a);p.length!==0&&(0,u.G)(c+"/dist/js/flowchart.js/flowchart.min.js","vditorFlowchartScript").then(function(){p.forEach(function(v){if(v.getAttribute("data-processed")!=="true"){var L=flowchart.parse(l.flowchartRenderAdapter.getCode(v));v.innerHTML="",L.drawSVG(v),v.setAttribute("data-processed","true")}})})}},218:(I,T,m)=>{m.d(T,{v:()=>g});var d=m(54),u=m(526),l=m(156),g=function(a,c){c===void 0&&(c=d.g.CDN);var p=l.graphvizRenderAdapter.getElements(a);p.length!==0&&(0,u.G)(c+"/dist/js/graphviz/viz.js","vditorGraphVizScript").then(function(){p.forEach(function(v){var L=l.graphvizRenderAdapter.getCode(v);if(!v.parentElement.classList.contains("vditor-wysiwyg__pre")&&!v.parentElement.classList.contains("vditor-ir__marker--pre")&&v.getAttribute("data-processed")!=="true"&&L.trim()!==""){try{var S=new Blob(["importScripts('"+document.getElementById("vditorGraphVizScript").src.replace("viz.js","full.render.js")+"');"],{type:"application/javascript"}),_=(window.URL||window.webkitURL).createObjectURL(S),E=new Worker(_);new Viz({worker:E}).renderSVGElement(L).then(function(k){v.innerHTML=k.outerHTML}).catch(function(k){v.innerHTML="graphviz render error: <br>"+k,v.className="vditor-reset--error"})}catch(k){}v.setAttribute("data-processed","true")}})})}},702:(I,T,m)=>{m.d(T,{s:()=>g});var d=m(54),u=m(526),l=m(578),g=function(a,c,p){c===void 0&&(c=document),p===void 0&&(p=d.g.CDN);var v=a.style;d.g.CODE_THEME.includes(v)||(v="github");var L=document.getElementById("vditorHljsStyle"),S=p+"/dist/js/highlight.js/styles/"+v+".css";L&&L.href!==S&&L.remove(),(0,l.c)(p+"/dist/js/highlight.js/styles/"+v+".css","vditorHljsStyle"),a.enable!==!1&&c.querySelectorAll("pre > code").length!==0&&(0,u.G)(p+"/dist/js/highlight.js/highlight.pack.js","vditorHljsScript").then(function(){(0,u.G)(p+"/dist/js/highlight.js/solidity.min.js","vditorHljsSolidityScript").then(function(){(0,u.G)(p+"/dist/js/highlight.js/yul.min.js","vditorHljsYulScript").then(function(){c.querySelectorAll("pre > code").forEach(function(_){if(!_.parentElement.classList.contains("vditor-ir__marker--pre")&&!_.parentElement.classList.contains("vditor-wysiwyg__pre")&&!(_.classList.contains("language-mermaid")||_.classList.contains("language-flowchart")||_.classList.contains("language-echarts")||_.classList.contains("language-mindmap")||_.classList.contains("language-plantuml")||_.classList.contains("language-abc")||_.classList.contains("language-graphviz")||_.classList.contains("language-math"))&&(a.defaultLang!==""&&_.className.indexOf("language-")===-1&&_.classList.add("language-"+a.defaultLang),hljs.highlightElement(_),a.lineNumber)){_.classList.add("vditor-linenumber");var E=_.querySelector(".vditor-linenumber__temp");E||((E=document.createElement("div")).className="vditor-linenumber__temp",_.insertAdjacentElement("beforeend",E));var k=getComputedStyle(_).whiteSpace,h=!1;k!=="pre-wrap"&&k!=="pre-line"||(h=!0);var N="",O=_.textContent.split(/\r\n|\r|\n/g);O.pop(),O.map(function(G){var Z="";h&&(E.textContent=G||`
  10. `,Z=' style="height:'+E.getBoundingClientRect().height+'px"'),N+="<span"+Z+"></span>"}),E.style.display="none",N='<span class="vditor-linenumber__rows">'+N+"</span>",_.insertAdjacentHTML("beforeend",N)}})})})})}},563:(I,T,m)=>{m.d(T,{K:()=>c});var d=m(54),u=m(526),l=m(156),g={},a=function(p,v){var L=window.markmap,S=L.Transformer,_=L.Markmap,E=L.deriveOptions,k=(L.globalCSS,new S);p.innerHTML='<svg style="width:100%"></svg>';var h=p.firstChild,N=_.create(h,null),O=function(ae,ve){var pe=ae.transform(ve),de=Object.keys(pe.features).filter(function(ge){return!g[ge]});de.forEach(function(ge){g[ge]=!0});var fe=ae.getAssets(de),ke=fe.styles,Se=fe.scripts,Pe=window.markmap;return ke&&Pe.loadCSS(ke),Se&&Pe.loadJS(Se),pe}(k,v),G=O.root,Z=O.frontmatter,oe=E(Z==null?void 0:Z.markmap);N.setData(G,oe),N.fit()},c=function(p,v,L){v===void 0&&(v=d.g.CDN);var S=l.markmapRenderAdapter.getElements(p);S.length!==0&&(0,u.G)(v+"/dist/js/markmap/markmap.min.js","vditorMermaidScript").then(function(){S.forEach(function(_){var E=l.markmapRenderAdapter.getCode(_);if(_.getAttribute("data-processed")!=="true"&&E.trim()!==""){var k=document.createElement("div");k.className="language-markmap",_.parentNode.appendChild(k),a(k,E),_.parentNode.childNodes[0].nodeName=="CODE"&&_.parentNode.removeChild(_.parentNode.childNodes[0])}})})}},466:(I,T,m)=>{m.d(T,{H:()=>c});var d=m(54),u=m(526),l=m(578),g=m(51),a=m(156),c=function(p,v){var L=a.mathRenderAdapter.getElements(p);if(L.length!==0){var S={cdn:d.g.CDN,math:{engine:"KaTeX",inlineDigit:!1,macros:{}}};if(v&&v.math&&(v.math=Object.assign({},S.math,v.math)),(v=Object.assign({},S,v)).math.engine==="KaTeX")(0,l.c)(v.cdn+"/dist/js/katex/katex.min.css","vditorKatexStyle"),(0,u.G)(v.cdn+"/dist/js/katex/katex.min.js","vditorKatexScript").then(function(){(0,u.G)(v.cdn+"/dist/js/katex/mhchem.min.js","vditorKatexChemScript").then(function(){L.forEach(function(E){if(!E.parentElement.classList.contains("vditor-wysiwyg__pre")&&!E.parentElement.classList.contains("vditor-ir__marker--pre")&&!E.getAttribute("data-math")){var k=(0,g.X)(a.mathRenderAdapter.getCode(E));E.setAttribute("data-math",k);try{E.innerHTML=katex.renderToString(k,{displayMode:E.tagName==="DIV",output:"html"})}catch(h){E.innerHTML=h.message,E.className="language-math vditor-reset--error"}E.addEventListener("copy",function(h){h.stopPropagation(),h.preventDefault();var N=h.currentTarget.closest(".language-math");h.clipboardData.setData("text/html",N.innerHTML),h.clipboardData.setData("text/plain",N.getAttribute("data-math"))})}})})});else if(v.math.engine==="MathJax"){window.MathJax||(window.MathJax={loader:{paths:{mathjax:v.cdn+"/dist/js/mathjax"}},startup:{typeset:!1},tex:{macros:v.math.macros}},Object.assign(window.MathJax,v.math.mathJaxOptions)),(0,u.J)(v.cdn+"/dist/js/mathjax/tex-svg-full.js","protyleMathJaxScript");var _=function(E,k){var h=(0,g.X)(E.textContent).trim(),N=window.MathJax.getMetricsFor(E);N.display=E.tagName==="DIV",window.MathJax.tex2svgPromise(h,N).then(function(O){E.innerHTML="",E.setAttribute("data-math",h),E.append(O),window.MathJax.startup.document.clear(),window.MathJax.startup.document.updateDocument();var G=O.querySelector('[data-mml-node="merror"]');G&&G.textContent.trim()!==""&&(E.innerHTML=G.textContent.trim(),E.className="vditor-reset--error"),k&&k()})};window.MathJax.startup.promise.then(function(){for(var E=[],k=function(N){var O=L[N];O.parentElement.classList.contains("vditor-wysiwyg__pre")||O.parentElement.classList.contains("vditor-ir__marker--pre")||O.getAttribute("data-math")||!(0,g.X)(O.textContent).trim()||E.push(function(G){N===L.length-1?_(O):_(O,G)})},h=0;h<L.length;h++)k(h);(function(N){if(N.length!==0){var O=0,G=N[N.length-1],Z=function(){var oe=N[O++];oe===G?oe():oe(Z)};Z()}})(E)})}}}},554:(I,T,m)=>{m.d(T,{Y:()=>d});var d=function(u){u&&u.querySelectorAll("a").forEach(function(l){var g=l.getAttribute("href");g&&(g.match(/^.+.(mp4|m4v|ogg|ogv|webm)$/)?function(a,c){a.insertAdjacentHTML("afterend",'<video controls="controls" src="'+c+'"></video>'),a.remove()}(l,g):g.match(/^.+.(mp3|wav|flac)$/)?function(a,c){a.insertAdjacentHTML("afterend",'<audio controls="controls" src="'+c+'"></audio>'),a.remove()}(l,g):function(a,c){var p=c.match(/\/\/(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))([\w|-]{11})(?:(?:[\?&]t=)(\S+))?/),v=c.match(/\/\/v\.youku\.com\/v_show\/id_(\w+)=*\.html/),L=c.match(/\/\/v\.qq\.com\/x\/cover\/.*\/([^\/]+)\.html\??.*/),S=c.match(/(?:www\.|\/\/)coub\.com\/view\/(\w+)/),_=c.match(/(?:www\.|\/\/)facebook\.com\/([^\/]+)\/videos\/([0-9]+)/),E=c.match(/.+dailymotion.com\/(video|hub)\/(\w+)\?/),k=c.match(/(?:www\.|\/\/)bilibili\.com\/video\/(\w+)/),h=c.match(/(?:www\.|\/\/)ted\.com\/talks\/(\w+)/);p&&p[1].length===11?(a.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//www.youtube.com/embed/'+p[1]+(p[2]?"?start="+p[2]:"")+'"></iframe>'),a.remove()):v&&v[1]?(a.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//player.youku.com/embed/'+v[1]+'"></iframe>'),a.remove()):L&&L[1]?(a.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="https://v.qq.com/txp/iframe/player.html?vid='+L[1]+'"></iframe>'),a.remove()):S&&S[1]?(a.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
  11. src="//coub.com/embed/`+S[1]+'?muted=false&autostart=false&originalSize=true&startWithHD=true"></iframe>'),a.remove()):_&&_[0]?(a.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
  12. src="https://www.facebook.com/plugins/video.php?href=`+encodeURIComponent(_[0])+'"></iframe>'),a.remove()):E&&E[2]?(a.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
  13. src="https://www.dailymotion.com/embed/video/`+E[2]+'"></iframe>'),a.remove()):k&&k[1]?(a.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
  14. src="//player.bilibili.com/player.html?bvid=`+k[1]+'"></iframe>'),a.remove()):h&&h[1]&&(a.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//embed.ted.com/talks/'+h[1]+'"></iframe>'),a.remove())}(l,g))})}},40:(I,T,m)=>{m.d(T,{i:()=>g});var d=m(54),u=m(526),l=m(156),g=function(a,c,p){c===void 0&&(c=d.g.CDN);var v=l.mermaidRenderAdapter.getElements(a);v.length!==0&&(0,u.G)(c+"/dist/js/mermaid/mermaid.min.js","vditorMermaidScript").then(function(){var L={securityLevel:"loose",altFontFamily:"sans-serif",fontFamily:"sans-serif",startOnLoad:!1,flowchart:{htmlLabels:!0,useMaxWidth:!0},sequence:{useMaxWidth:!0,diagramMarginX:8,diagramMarginY:8,boxMargin:8},gantt:{leftPadding:75,rightPadding:20}};p==="dark"&&(L.theme="dark"),mermaid.initialize(L),v.forEach(function(S){var _=l.mermaidRenderAdapter.getCode(S);S.getAttribute("data-processed")!=="true"&&_.trim()!==""&&(mermaid.init(void 0,S),S.setAttribute("data-processed","true"))})})}},749:(I,T,m)=>{m.d(T,{P:()=>g});var d=m(54),u=m(526),l=m(156),g=function(a,c,p){a===void 0&&(a=document),c===void 0&&(c=d.g.CDN);var v=l.mindmapRenderAdapter.getElements(a);v.length>0&&(0,u.G)(c+"/dist/js/echarts/echarts.min.js","vditorEchartsScript").then(function(){v.forEach(function(L){if(!L.parentElement.classList.contains("vditor-wysiwyg__pre")&&!L.parentElement.classList.contains("vditor-ir__marker--pre")){var S=l.mindmapRenderAdapter.getCode(L);if(S)try{if(L.getAttribute("data-processed")==="true")return;echarts.init(L,p==="dark"?"dark":void 0).setOption({series:[{data:[JSON.parse(decodeURIComponent(S))],initialTreeDepth:-1,itemStyle:{borderWidth:0,color:"#4285f4"},label:{backgroundColor:"#f6f8fa",borderColor:"#d1d5da",borderRadius:5,borderWidth:.5,color:"#586069",lineHeight:20,offset:[-5,0],padding:[0,5],position:"insideRight"},lineStyle:{color:"#d1d5da",width:1},roam:!0,symbol:function(_,E){var k;return!((k=E==null?void 0:E.data)===null||k===void 0)&&k.children?"circle":"path://"},type:"tree"}],tooltip:{trigger:"item",triggerOn:"mousemove"}}),L.setAttribute("data-processed","true")}catch(_){L.className="vditor-reset--error",L.innerHTML="mindmap render error: <br>"+_}}})})}},818:(I,T,m)=>{m.d(T,{k:()=>l});var d=m(64),u=m(466),l=function(g,a,c){var p="",v=[];if(Array.from(g.children).forEach(function(E,k){if((0,d.W)(E)){if(c){var h=E.id.lastIndexOf("_");E.id=E.id.substring(0,h===-1?void 0:h)+"_"+k}v.push(E.id),p+=E.outerHTML.replace("<wbr>","")}}),p==="")return a.innerHTML="","";var L=document.createElement("div");if(c)c.lute.SetToC(!0),c.currentMode!=="wysiwyg"||c.preview.element.contains(g)?c.currentMode!=="ir"||c.preview.element.contains(g)?L.innerHTML=c.lute.HTML2VditorDOM("<p>[ToC]</p>"+p):L.innerHTML=c.lute.SpinVditorIRDOM("<p>[ToC]</p>"+p):L.innerHTML=c.lute.SpinVditorDOM("<p>[ToC]</p>"+p),c.lute.SetToC(c.options.preview.markdown.toc);else{a.classList.add("vditor-outline");var S=Lute.New();S.SetToC(!0),L.innerHTML=S.HTML2VditorDOM("<p>[ToC]</p>"+p)}var _=L.firstElementChild.querySelectorAll("li > span[data-target-id]");return _.forEach(function(E,k){if(E.nextElementSibling&&E.nextElementSibling.tagName==="UL"){var h="<svg class='vditor-outline__action'><use xlink:href='#vditor-icon-down'></use></svg>";document.getElementById("vditorIconScript")||(h='<svg class="vditor-outline__action" viewBox="0 0 32 32"><path d="M3.76 6.12l12.24 12.213 12.24-12.213 3.76 3.76-16 16-16-16 3.76-3.76z"></path></svg>'),E.innerHTML=h+"<span>"+E.innerHTML+"</span>"}else E.innerHTML="<svg></svg><span>"+E.innerHTML+"</span>";E.setAttribute("data-target-id",v[k])}),p=L.firstElementChild.innerHTML,_.length===0?(a.innerHTML="",p):(a.innerHTML=p,c&&(0,u.H)(a,{cdn:c.options.cdn,math:c.options.preview.math}),a.firstElementChild.addEventListener("click",function(E){for(var k=E.target;k&&!k.isEqualNode(a);){if(k.classList.contains("vditor-outline__action")){k.classList.contains("vditor-outline__action--close")?(k.classList.remove("vditor-outline__action--close"),k.parentElement.nextElementSibling.setAttribute("style","display:block")):(k.classList.add("vditor-outline__action--close"),k.parentElement.nextElementSibling.setAttribute("style","display:none")),E.preventDefault(),E.stopPropagation();break}if(k.getAttribute("data-target-id")){E.preventDefault(),E.stopPropagation();var h=document.getElementById(k.getAttribute("data-target-id"));if(!h)return;if(c)if(c.options.height==="auto"){var N=h.offsetTop+c.element.offsetTop;c.options.toolbarConfig.pin||(N+=c.toolbar.element.offsetHeight),window.scrollTo(window.scrollX,N)}else c.element.offsetTop<window.scrollY&&window.scrollTo(window.scrollX,c.element.offsetTop),c.preview.element.contains(g)?g.parentElement.scrollTop=h.offsetTop:g.scrollTop=h.offsetTop;else window.scrollTo(window.scrollX,h.offsetTop);break}k=k.parentElement}}),p)}},408:(I,T,m)=>{m.d(T,{B:()=>g});var d=m(54),u=m(526),l=m(156),g=function(a,c){a===void 0&&(a=document),c===void 0&&(c=d.g.CDN);var p=l.plantumlRenderAdapter.getElements(a);p.length!==0&&(0,u.G)(c+"/dist/js/plantuml/plantuml-encoder.min.js","vditorPlantumlScript").then(function(){p.forEach(function(v){if(!v.parentElement.classList.contains("vditor-wysiwyg__pre")&&!v.parentElement.classList.contains("vditor-ir__marker--pre")){var L=l.plantumlRenderAdapter.getCode(v).trim();if(L)try{v.innerHTML='<img src="http://www.plantuml.com/plantuml/svg/~1'+plantumlEncoder.encode(L)+'">'}catch(S){v.className="vditor-reset--error",v.innerHTML="plantuml render error: <br>"+S}}})})}},895:(I,T,m)=>{m.d(T,{X:()=>d});var d=function(u){var l=Lute.New();return l.PutEmojis(u.emojis),l.SetEmojiSite(u.emojiSite),l.SetHeadingAnchor(u.headingAnchor),l.SetInlineMathAllowDigitAfterOpenMarker(u.inlineMathDigit),l.SetAutoSpace(u.autoSpace),l.SetToC(u.toc),l.SetFootnotes(u.footnotes),l.SetFixTermTypo(u.fixTermTypo),l.SetVditorCodeBlockPreview(u.codeBlockPreview),l.SetVditorMathBlockPreview(u.mathBlockPreview),l.SetSanitize(u.sanitize),l.SetChineseParagraphBeginningSpace(u.paragraphBeginningSpace),l.SetRenderListStyle(u.listStyle),l.SetLinkBase(u.linkBase),l.SetLinkPrefix(u.linkPrefix),l.SetMark(u.mark),l.SetGFMAutoLink(u.gfmAutoLink),u.lazyLoadImage&&l.SetImageLazyLoading(u.lazyLoadImage),l}},863:(I,T,m)=>{m.d(T,{E:()=>d});var d=function(u,l,g){g===void 0&&(g="classic");var a=u.getBoundingClientRect();document.body.insertAdjacentHTML("beforeend",'<div class="vditor vditor-img'+(g==="dark"?" vditor--dark":"")+`">
  15. <div class="vditor-img__bar">
  16. <span class="vditor-img__btn" data-deg="0">
  17. <svg><use xlink:href="#vditor-icon-redo"></use></svg>
  18. `+window.VditorI18n.spin+`
  19. </span>
  20. <span class="vditor-img__btn" onclick="this.parentElement.parentElement.outerHTML = '';document.body.style.overflow = ''">
  21. X &nbsp;`+window.VditorI18n.close+`
  22. </span>
  23. </div>
  24. <div class="vditor-img__img" onclick="this.parentElement.outerHTML = '';document.body.style.overflow = ''">
  25. <img style="width: `+u.width+"px;height:"+u.height+"px;transform: translate3d("+a.left+"px, "+(a.top-36)+'px, 0)" src="'+u.getAttribute("src")+`">
  26. </div>
  27. </div>`),document.body.style.overflow="hidden";var c=document.querySelector(".vditor-img img"),p="translate3d("+Math.max(0,window.innerWidth-u.naturalWidth)/2+"px, "+Math.max(0,window.innerHeight-36-u.naturalHeight)/2+"px, 0)";setTimeout(function(){c.setAttribute("style","transition: transform .3s ease-in-out;transform: "+p),setTimeout(function(){c.parentElement.scrollTo((c.parentElement.scrollWidth-c.parentElement.clientWidth)/2,(c.parentElement.scrollHeight-c.parentElement.clientHeight)/2)},400)});var v=document.querySelector(".vditor-img__btn");v.addEventListener("click",function(){var L=parseInt(v.getAttribute("data-deg"),10)+90;L/90%2==1&&u.naturalWidth>c.parentElement.clientHeight?c.style.transform="translate3d("+Math.max(0,window.innerWidth-u.naturalWidth)/2+"px, "+(u.naturalWidth/2-u.naturalHeight/2)+"px, 0) rotateZ("+L+"deg)":c.style.transform=p+" rotateZ("+L+"deg)",v.setAttribute("data-deg",L.toString()),setTimeout(function(){c.parentElement.scrollTo((c.parentElement.scrollWidth-c.parentElement.clientWidth)/2,(c.parentElement.scrollHeight-c.parentElement.clientHeight)/2)},400)})}},312:(I,T,m)=>{m.d(T,{Y:()=>l});var d=m(54),u=m(578),l=function(g,a){a===void 0&&(a=d.g.CDN),d.g.CODE_THEME.includes(g)||(g="github");var c=document.getElementById("vditorHljsStyle"),p=a+"/dist/js/highlight.js/styles/"+g+".css";c?c.href!==p&&(c.remove(),(0,u.c)(p,"vditorHljsStyle")):(0,u.c)(p,"vditorHljsStyle")}},227:(I,T,m)=>{m.d(T,{Z:()=>u});var d=m(578),u=function(l,g){if(l&&g){var a=document.getElementById("vditorContentTheme"),c=g+"/"+l+".css";a?a.getAttribute("href")!==c&&(a.remove(),(0,d.c)(c,"vditorContentTheme")):(0,d.c)(c,"vditorContentTheme")}}},526:(I,T,m)=>{m.d(T,{G:()=>u,J:()=>d});var d=function(l,g){if(document.getElementById(g))return!1;var a=new XMLHttpRequest;a.open("GET",l,!1),a.setRequestHeader("Accept","text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01"),a.send("");var c=document.createElement("script");c.type="text/javascript",c.text=a.responseText,c.id=g,document.head.appendChild(c)},u=function(l,g){return new Promise(function(a,c){if(document.getElementById(g))return a(),!1;var p=document.createElement("script");p.src=l,p.async=!0,document.head.appendChild(p),p.onload=function(){if(document.getElementById(g))return p.remove(),a(),!1;p.id=g,a()}})}},578:(I,T,m)=>{m.d(T,{c:()=>d});var d=function(u,l){if(!document.getElementById(l)){var g=document.createElement("link");g.id=l,g.rel="stylesheet",g.type="text/css",g.href=u,document.getElementsByTagName("head")[0].appendChild(g)}}},51:(I,T,m)=>{m.d(T,{X:()=>d});var d=function(u){return u.replace(/\u00a0/g," ")}},794:(I,T,m)=>{m.d(T,{G6:()=>d,Le:()=>g,i7:()=>p,ns:()=>c,pK:()=>l,vU:()=>u,yl:()=>a});var d=function(){return navigator.userAgent.indexOf("Safari")>-1&&navigator.userAgent.indexOf("Chrome")===-1},u=function(){return navigator.userAgent.toLowerCase().indexOf("firefox")>-1},l=function(){try{return typeof localStorage<"u"}catch(v){return!1}},g=function(){return navigator.userAgent.indexOf("iPhone")>-1?"touchstart":"click"},a=function(v){return navigator.platform.toUpperCase().indexOf("MAC")>=0?!(!v.metaKey||v.ctrlKey):!(v.metaKey||!v.ctrlKey)},c=function(v){return/Mac/.test(navigator.platform)||navigator.platform==="iPhone"?v.indexOf("\u21E7")>-1&&u()&&(v=v.replace(";",":").replace("=","+").replace("-","_")):(v=(v=v.startsWith("\u2318")?v.replace("\u2318","\u2318+"):v.startsWith("\u2325")&&v.substr(1,1)!=="\u2318"?v.replace("\u2325","\u2325+"):v.replace("\u21E7\u2318","\u2318+\u21E7+").replace("\u2325\u2318","\u2325+\u2318+")).replace("\u2318","Ctrl").replace("\u21E7","Shift").replace("\u2325","Alt")).indexOf("Shift")>-1&&(v=v.replace(";",":").replace("=","+").replace("-","_")),v},p=function(){return/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}},827:(I,T,m)=>{m.d(T,{DX:()=>L,E2:()=>l,F9:()=>c,JQ:()=>u,O9:()=>g,a1:()=>a,fb:()=>v,lG:()=>p});var d=m(64),u=function(S,_){for(var E=v(S,_),k=!1,h=!1;E&&!E.classList.contains("vditor-reset")&&!h;)(k=v(E.parentElement,_))?E=k:h=!0;return E||!1},l=function(S,_){for(var E=(0,d.S)(S,_),k=!1,h=!1;E&&!E.classList.contains("vditor-reset")&&!h;)(k=(0,d.S)(E.parentElement,_))?E=k:h=!0;return E||!1},g=function(S){var _=l(S,"UL"),E=l(S,"OL"),k=_;return E&&(!_||_&&E.contains(_))&&(k=E),k},a=function(S,_,E){if(!S)return!1;S.nodeType===3&&(S=S.parentElement);for(var k=S,h=!1;k&&!h&&!k.classList.contains("vditor-reset");)k.getAttribute(_)===E?h=!0:k=k.parentElement;return h&&k},c=function(S){if(!S)return!1;S.nodeType===3&&(S=S.parentElement);var _=S,E=!1,k=a(S,"data-block","0");if(k)return k;for(;_&&!E&&!_.classList.contains("vditor-reset");)_.tagName==="H1"||_.tagName==="H2"||_.tagName==="H3"||_.tagName==="H4"||_.tagName==="H5"||_.tagName==="H6"||_.tagName==="P"||_.tagName==="BLOCKQUOTE"||_.tagName==="OL"||_.tagName==="UL"?E=!0:_=_.parentElement;return E&&_},p=function(S,_){if(!S)return!1;S.nodeType===3&&(S=S.parentElement);for(var E=S,k=!1;E&&!k&&!E.classList.contains("vditor-reset");)E.nodeName===_?k=!0:E=E.parentElement;return k&&E},v=function(S,_){if(!S)return!1;S.nodeType===3&&(S=S.parentElement);for(var E=S,k=!1;E&&!k&&!E.classList.contains("vditor-reset");)E.classList.contains(_)?k=!0:E=E.parentElement;return k&&E},L=function(S){for(;S&&S.lastChild;)S=S.lastChild;return S}},64:(I,T,m)=>{m.d(T,{S:()=>d,W:()=>u});var d=function(l,g){if(!l)return!1;l.nodeType===3&&(l=l.parentElement);for(var a=l,c=!1;a&&!c&&!a.classList.contains("vditor-reset");)a.nodeName.indexOf(g)===0?c=!0:a=a.parentElement;return c&&a},u=function(l){var g=d(l,"H");return!(!g||g.tagName.length!==2||g.tagName==="HR")&&g}},640:(I,T,m)=>{m.d(T,{T:()=>d});var d=function(){for(var u=[],l=0;l<arguments.length;l++)u[l]=arguments[l];for(var g={},a=function(p){for(var v in p)p.hasOwnProperty(v)&&(Object.prototype.toString.call(p[v])==="[object Object]"?g[v]=d(g[v],p[v]):g[v]=p[v])},c=0;c<u.length;c++)a(u[c]);return g}},393:(I,T,m)=>{m.d(T,{$j:()=>L,Gb:()=>c,Hc:()=>p,Ny:()=>a,ib:()=>S,im:()=>v,oC:()=>_,zh:()=>g});var d=m(54),u=m(794),l=m(827),g=function(E){var k,h=E[E.currentMode].element;return getSelection().rangeCount>0&&(k=getSelection().getRangeAt(0),h.isEqualNode(k.startContainer)||h.contains(k.startContainer))?k:E[E.currentMode].range?E[E.currentMode].range:(h.focus(),(k=h.ownerDocument.createRange()).setStart(h,0),k.collapse(!0),k)},a=function(E){var k=window.getSelection().getRangeAt(0);if(!E.contains(k.startContainer)&&!(0,l.fb)(k.startContainer,"vditor-panel--none"))return{left:0,top:0};var h,N=E.parentElement.getBoundingClientRect();if(k.getClientRects().length===0)if(k.startContainer.nodeType===3){var O=k.startContainer.parentElement;if(!(O&&O.getClientRects().length>0))return{left:0,top:0};h=O.getClientRects()[0]}else{var G=k.startContainer.children;if(G[k.startOffset]&&G[k.startOffset].getClientRects().length>0)h=G[k.startOffset].getClientRects()[0];else if(k.startContainer.childNodes.length>0){var Z=k.cloneRange();k.selectNode(k.startContainer.childNodes[Math.max(0,k.startOffset-1)]),h=k.getClientRects()[0],k.setEnd(Z.endContainer,Z.endOffset),k.setStart(Z.startContainer,Z.startOffset)}else h=k.startContainer.getClientRects()[0];if(!h){for(var oe=k.startContainer.childNodes[k.startOffset];!oe.getClientRects||oe.getClientRects&&oe.getClientRects().length===0;)oe=oe.parentElement;h=oe.getClientRects()[0]}}else h=k.getClientRects()[0];return{left:h.left-N.left,top:h.top-N.top}},c=function(E,k){if(!k){if(getSelection().rangeCount===0)return!1;k=getSelection().getRangeAt(0)}var h=k.commonAncestorContainer;return E.isEqualNode(h)||E.contains(h)},p=function(E){var k=window.getSelection();k.removeAllRanges(),k.addRange(E)},v=function(E,k,h){var N={end:0,start:0};if(!h){if(getSelection().rangeCount===0)return N;h=window.getSelection().getRangeAt(0)}if(c(k,h)){var O=h.cloneRange();E.childNodes[0]&&E.childNodes[0].childNodes[0]?O.setStart(E.childNodes[0].childNodes[0],0):O.selectNodeContents(E),O.setEnd(h.startContainer,h.startOffset),N.start=O.toString().length,N.end=N.start+h.toString().length}return N},L=function(E,k,h){var N=0,O=0,G=h.childNodes[O],Z=!1,oe=!1;E=Math.max(0,E),k=Math.max(0,k);var ae=h.ownerDocument.createRange();for(ae.setStart(G||h,0),ae.collapse(!0);!oe&&G;){var ve=N+G.textContent.length;if(!Z&&E>=N&&E<=ve&&(E===0?ae.setStart(G,0):G.childNodes[0].nodeType===3?ae.setStart(G.childNodes[0],E-N):G.nextSibling?ae.setStartBefore(G.nextSibling):ae.setStartAfter(G),Z=!0,E===k)){oe=!0;break}Z&&k>=N&&k<=ve&&(k===0?ae.setEnd(G,0):G.childNodes[0].nodeType===3?ae.setEnd(G.childNodes[0],k-N):G.nextSibling?ae.setEndBefore(G.nextSibling):ae.setEndAfter(G),oe=!0),N=ve,G=h.childNodes[++O]}return!oe&&h.childNodes[O-1]&&ae.setStartBefore(h.childNodes[O-1]),p(ae),ae},S=function(E,k){var h=E.querySelector("wbr");if(h){if(h.previousElementSibling)if(h.previousElementSibling.isSameNode(h.previousSibling)){if(h.previousElementSibling.lastChild)return k.setStartBefore(h),k.collapse(!0),p(k),!(0,u.i7)()||h.previousElementSibling.tagName!=="EM"&&h.previousElementSibling.tagName!=="STRONG"&&h.previousElementSibling.tagName!=="S"||(k.insertNode(document.createTextNode(d.g.ZWSP)),k.collapse(!1)),void h.remove();k.setStartAfter(h.previousElementSibling)}else k.setStart(h.previousSibling,h.previousSibling.textContent.length);else h.previousSibling?k.setStart(h.previousSibling,h.previousSibling.textContent.length):h.nextSibling?h.nextSibling.nodeType===3?k.setStart(h.nextSibling,0):k.setStartBefore(h.nextSibling):k.setStart(h.parentElement,0);k.collapse(!0),h.remove(),p(k)}},_=function(E,k){var h=document.createElement("div");h.innerHTML=E;var N=h.querySelectorAll("p");N.length===1&&!N[0].previousSibling&&!N[0].nextSibling&&k[k.currentMode].element.children.length>0&&h.firstElementChild.tagName==="P"&&(E=N[0].innerHTML.trim());var O=document.createElement("div");O.innerHTML=E;var G=g(k);if(G.toString()!==""&&(k[k.currentMode].preventInput=!0,document.execCommand("delete",!1,"")),O.firstElementChild&&O.firstElementChild.getAttribute("data-block")==="0"){O.lastElementChild.insertAdjacentHTML("beforeend","<wbr>");var Z=(0,l.F9)(G.startContainer);Z?Z.insertAdjacentHTML("afterend",O.innerHTML):k[k.currentMode].element.insertAdjacentHTML("beforeend",O.innerHTML),S(k[k.currentMode].element,G)}else{var oe=document.createElement("template");oe.innerHTML=E,G.insertNode(oe.content.cloneNode(!0)),G.collapse(!1),p(G)}}}},Ne={};function F(I){var T=Ne[I];if(T!==void 0)return T.exports;var m=Ne[I]={exports:{}};return He[I](m,m.exports,F),m.exports}F.d=(I,T)=>{for(var m in T)F.o(T,m)&&!F.o(I,m)&&Object.defineProperty(I,m,{enumerable:!0,get:T[m]})},F.o=(I,T)=>Object.prototype.hasOwnProperty.call(I,T),F.r=I=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(I,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(I,"__esModule",{value:!0})};var Oe={};return(()=>{F.d(Oe,{default:()=>xi});var I,T=F(872),m=F(54),d=F(51),u=function(e){return e.currentMode==="sv"?(0,d.X)((e.sv.element.textContent+`
  28. `).replace(/\n\n$/,`
  29. `)):e.currentMode==="wysiwyg"?e.lute.VditorDOM2Md(e.wysiwyg.element.innerHTML):e.currentMode==="ir"?e.lute.VditorIRDOM2Md(e.ir.element.innerHTML):""},l=F(526),g=function(){function e(){this.element=document.createElement("div"),this.element.className="vditor-devtools",this.element.innerHTML='<div class="vditor-reset--error"></div><div style="height: 100%;"></div>'}return e.prototype.renderEchart=function(t){var n=this;t.devtools.element.style.display==="block"&&(0,l.G)(t.options.cdn+"/dist/js/echarts/echarts.min.js","vditorEchartsScript").then(function(){n.ASTChart||(n.ASTChart=echarts.init(t.devtools.element.lastElementChild));try{n.element.lastElementChild.style.display="block",n.element.firstElementChild.innerHTML="",n.ASTChart.setOption({series:[{data:JSON.parse(t.lute.RenderEChartsJSON(u(t))),initialTreeDepth:-1,label:{align:"left",backgroundColor:"rgba(68, 77, 86, .68)",borderRadius:3,color:"#d1d5da",fontSize:12,lineHeight:12,offset:[9,12],padding:[2,4,2,4],position:"top",verticalAlign:"middle"},lineStyle:{color:"#4285f4",type:"curve",width:1},orient:"vertical",roam:!0,type:"tree"}],toolbox:{bottom:25,emphasis:{iconStyle:{color:"#4285f4"}},feature:{restore:{show:!0},saveAsImage:{show:!0}},right:15,show:!0}}),n.ASTChart.resize()}catch(i){n.element.lastElementChild.style.display="none",n.element.firstElementChild.innerHTML=i}})},e}(),a=F(794),c=function(e,t){t.forEach(function(n){if(e[n]){var i=e[n].children[0];i&&i.classList.contains("vditor-menu--current")&&i.classList.remove("vditor-menu--current")}})},p=function(e,t){t.forEach(function(n){if(e[n]){var i=e[n].children[0];i&&!i.classList.contains("vditor-menu--current")&&i.classList.add("vditor-menu--current")}})},v=function(e,t){t.forEach(function(n){if(e[n]){var i=e[n].children[0];i&&i.classList.contains(m.g.CLASS_MENU_DISABLED)&&i.classList.remove(m.g.CLASS_MENU_DISABLED)}})},L=function(e,t){t.forEach(function(n){if(e[n]){var i=e[n].children[0];i&&!i.classList.contains(m.g.CLASS_MENU_DISABLED)&&i.classList.add(m.g.CLASS_MENU_DISABLED)}})},S=function(e,t){t.forEach(function(n){e[n]&&e[n]&&(e[n].style.display="none")})},_=function(e,t){t.forEach(function(n){e[n]&&e[n]&&(e[n].style.display="block")})},E=function(e,t,n){t.includes("subToolbar")&&(e.toolbar.element.querySelectorAll(".vditor-hint").forEach(function(i){n&&i.isEqualNode(n)||(i.style.display="none")}),e.toolbar.elements.emoji&&(e.toolbar.elements.emoji.lastElementChild.style.display="none")),t.includes("hint")&&(e.hint.element.style.display="none"),e.wysiwyg.popover&&t.includes("popover")&&(e.wysiwyg.popover.style.display="none")},k=function(e,t,n,i){n.addEventListener((0,a.Le)(),function(r){r.preventDefault(),r.stopPropagation(),n.classList.contains(m.g.CLASS_MENU_DISABLED)||(e.toolbar.element.querySelectorAll(".vditor-hint--current").forEach(function(o){o.classList.remove("vditor-hint--current")}),t.style.display==="block"?t.style.display="none":(E(e,["subToolbar","hint","popover"],n.parentElement.parentElement),n.classList.contains("vditor-tooltipped")||n.classList.add("vditor-hint--current"),t.style.display="block",e.toolbar.element.getBoundingClientRect().right-n.getBoundingClientRect().right<250?t.classList.add("vditor-panel--left"):t.classList.remove("vditor-panel--left")))})},h=F(827),N=F(64),O=function(e,t,n,i){},G=F(478),Z=F(314),oe=F(730),ae=F(66),ve=F(218),pe=F(702),de=F(466),fe=F(40),ke=F(563),Se=F(749),Pe=F(408),ge=function(e,t){if(e)if(e.parentElement.getAttribute("data-type")!=="html-block"){var n=e.firstElementChild.className.replace("language-","");n==="abc"?(0,G.Q)(e,t.options.cdn):n==="mermaid"?(0,fe.i)(e,t.options.cdn,t.options.theme):n==="markmap"?(0,ke.K)(e,t.options.cdn,t.options.theme):n==="flowchart"?(0,ae.P)(e,t.options.cdn):n==="echarts"?(0,Z.p)(e,t.options.cdn,t.options.theme):n==="mindmap"?(0,Se.P)(e,t.options.cdn,t.options.theme):n==="plantuml"?(0,Pe.B)(e,t.options.cdn):n==="graphviz"?(0,ve.v)(e,t.options.cdn):n==="math"?(0,de.H)(e,{cdn:t.options.cdn,math:t.options.preview.math}):((0,pe.s)(Object.assign({},t.options.preview.hljs),e,t.options.cdn),(0,oe.O)(e)),e.setAttribute("data-render","1")}else e.setAttribute("data-render","1")},M=F(393),he=function(e){if(e.currentMode!=="sv"){var t=e[e.currentMode].element,n=e.outline.render(e);n===""&&(n="[ToC]"),t.querySelectorAll('[data-type="toc-block"]').forEach(function(i){i.innerHTML=n,(0,de.H)(i,{cdn:e.options.cdn,math:e.options.preview.math})})}},ee=function(e,t){var n=(0,h.lG)(e.target,"SPAN");if(n&&(0,h.fb)(n,"vditor-toc")){var i=t[t.currentMode].element.querySelector("#"+n.getAttribute("data-target-id"));if(i)if(t.options.height==="auto"){var r=i.offsetTop+t.element.offsetTop;t.options.toolbarConfig.pin||(r+=t.toolbar.element.offsetHeight),window.scrollTo(window.scrollX,r)}else t.element.offsetTop<window.scrollY&&window.scrollTo(window.scrollX,t.element.offsetTop),t[t.currentMode].element.scrollTop=i.offsetTop}},A=function(e,t,n,i){if(e.previousElementSibling&&e.previousElementSibling.classList.contains("vditor-toc")){if(n.key==="Backspace"&&(0,M.im)(e,t[t.currentMode].element,i).start===0)return e.previousElementSibling.remove(),ue(t),!0;if(ot(t,n,i,e,e.previousElementSibling))return!0}if(e.nextElementSibling&&e.nextElementSibling.classList.contains("vditor-toc")){if(n.key==="Delete"&&(0,M.im)(e,t[t.currentMode].element,i).start>=e.textContent.trimRight().length)return e.nextElementSibling.remove(),ue(t),!0;if(yt(t,n,i,e,e.nextElementSibling))return!0}if(n.key==="Backspace"||n.key==="Delete"){var r=(0,h.fb)(i.startContainer,"vditor-toc");if(r)return r.remove(),ue(t),!0}},q=function(e,t,n,i){n===void 0&&(n=!1);var r=(0,h.F9)(t.startContainer);if(r&&!n&&r.getAttribute("data-type")!=="code-block"){if(Xt(r.innerHTML)&&r.previousElementSibling||Jt(r.innerHTML))return;for(var o=(0,M.im)(r,e.ir.element,t).start,s=!0,f=o-1;f>r.textContent.substr(0,o).lastIndexOf(`
  30. `);f--)if(r.textContent.charAt(f)!==" "&&r.textContent.charAt(f)!==" "){s=!1;break}o===0&&(s=!1);var b=!0;for(f=o-1;f<r.textContent.length;f++)if(r.textContent.charAt(f)!==" "&&r.textContent.charAt(f)!==`
  31. `){b=!1;break}if(s)return void(typeof e.options.input=="function"&&e.options.input(u(e)));if(b&&!(0,h.fb)(t.startContainer,"vditor-ir__marker")){var w=t.startContainer.previousSibling;return w&&w.nodeType!==3&&w.classList.contains("vditor-ir__node--expand")&&w.classList.remove("vditor-ir__node--expand"),void(typeof e.options.input=="function"&&e.options.input(u(e)))}}if(e.ir.element.querySelectorAll(".vditor-ir__node--expand").forEach(function(Q){Q.classList.remove("vditor-ir__node--expand")}),r||(r=e.ir.element),!r.querySelector("wbr")){var y=(0,h.fb)(t.startContainer,"vditor-ir__preview");y?y.previousElementSibling.insertAdjacentHTML("beforeend","<wbr>"):t.insertNode(document.createElement("wbr"))}r.querySelectorAll("[style]").forEach(function(Q){Q.removeAttribute("style")}),r.getAttribute("data-type")==="link-ref-defs-block"&&(r=e.ir.element);var x,j=r.isEqualNode(e.ir.element),B=(0,h.a1)(r,"data-type","footnotes-block"),C="";if(j)C=r.innerHTML;else{var R=(0,N.S)(t.startContainer,"BLOCKQUOTE"),K=(0,h.O9)(t.startContainer);if(K&&(r=K),R&&(!K||K&&!R.contains(K))&&(r=R),B&&(r=B),C=r.outerHTML,r.tagName==="UL"||r.tagName==="OL"){var W=r.previousElementSibling,z=r.nextElementSibling;!W||W.tagName!=="UL"&&W.tagName!=="OL"||(C=W.outerHTML+C,W.remove()),!z||z.tagName!=="UL"&&z.tagName!=="OL"||(C+=z.outerHTML,z.remove()),C=C.replace("<div><wbr><br></div>","<li><p><wbr><br></p></li>")}else r.previousElementSibling&&r.previousElementSibling.textContent.replace(m.g.ZWSP,"")!==""&&i&&i.inputType==="insertParagraph"&&(C=r.previousElementSibling.outerHTML+C,r.previousElementSibling.remove());r.innerText.startsWith("```")||(e.ir.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(Q){Q&&!r.isEqualNode(Q)&&(C+=Q.outerHTML,Q.remove())}),e.ir.element.querySelectorAll("[data-type='footnotes-block']").forEach(function(Q){Q&&!r.isEqualNode(Q)&&(C+=Q.outerHTML,Q.remove())}))}if(O("SpinVditorIRDOM",C,"argument",e.options.debugger),C=e.lute.SpinVditorIRDOM(C),O("SpinVditorIRDOM",C,"result",e.options.debugger),j)r.innerHTML=C;else if(r.outerHTML=C,B){var V=(0,h.a1)(e.ir.element.querySelector("wbr"),"data-type","footnotes-def");if(V){var H=V.textContent,J=H.substring(1,H.indexOf("]:")),ie=e.ir.element.querySelector('sup[data-type="footnotes-ref"][data-footnotes-label="'+J+'"]');ie&&ie.setAttribute("aria-label",H.substr(J.length+3).trim().substr(0,24))}}var Y,re=e.ir.element.querySelectorAll("[data-type='link-ref-defs-block']");re.forEach(function(Q,le){le===0?x=Q:(x.insertAdjacentHTML("beforeend",Q.innerHTML),Q.remove())}),re.length>0&&e.ir.element.insertAdjacentElement("beforeend",re[0]);var ne=e.ir.element.querySelectorAll("[data-type='footnotes-block']");ne.forEach(function(Q,le){le===0?Y=Q:(Y.insertAdjacentHTML("beforeend",Q.innerHTML),Q.remove())}),ne.length>0&&e.ir.element.insertAdjacentElement("beforeend",ne[0]),(0,M.ib)(e.ir.element,t),e.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function(Q){ge(Q,e)}),he(e),Xe(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})},P=function(e,t){if(e==="")return!1;if(e.indexOf("\u21E7")===-1&&e.indexOf("\u2318")===-1&&e.indexOf("\u2325")===-1)return!((0,a.yl)(t)||t.altKey||t.shiftKey||t.code!==e);if(e==="\u21E7Tab")return!((0,a.yl)(t)||t.altKey||!t.shiftKey||t.code!=="Tab");var n=e.split("");if(e.startsWith("\u2325")){var i=n.length===3?n[2]:n[1];return!((n.length===3?!(0,a.yl)(t):(0,a.yl)(t))||!t.altKey||t.shiftKey||t.code!==(/^[0-9]$/.test(i)?"Digit":"Key")+i)}e==="\u2318Enter"&&(n=["\u2318","Enter"]);var r=n.length>2&&n[0]==="\u21E7",o=r?n[2]:n[1];return!r||!(0,a.vU)()&&/Mac/.test(navigator.platform)||(o==="-"?o="_":o==="="&&(o="+")),!(!(0,a.yl)(t)||t.key.toLowerCase()!==o.toLowerCase()||t.altKey||!(!r&&!t.shiftKey||r&&t.shiftKey))},D=function(e,t){t.ir.element.querySelectorAll(".vditor-ir__node--expand").forEach(function(s){s.classList.remove("vditor-ir__node--expand")});var n=(0,h.JQ)(e.startContainer,"vditor-ir__node"),i=!e.collapsed&&(0,h.JQ)(e.endContainer,"vditor-ir__node");if(e.collapsed||n&&n===i){n&&(n.classList.add("vditor-ir__node--expand"),n.classList.remove("vditor-ir__node--hidden"),(0,M.Hc)(e));var r=function(s){var f=s.startContainer;if(f.nodeType===3&&f.nodeValue.length!==s.startOffset)return!1;for(var b=f.nextSibling;b&&b.textContent==="";)b=b.nextSibling;if(!b){var w=(0,h.fb)(f,"vditor-ir__marker");if(w&&!w.nextSibling){var y=f.parentElement.parentElement.nextSibling;if(y&&y.nodeType!==3&&y.classList.contains("vditor-ir__node"))return y}return!1}return!(!b||b.nodeType===3||!b.classList.contains("vditor-ir__node")||b.getAttribute("data-block"))&&b}(e);if(r)return r.classList.add("vditor-ir__node--expand"),void r.classList.remove("vditor-ir__node--hidden");var o=function(s){var f=s.startContainer,b=f.previousSibling;return!(f.nodeType!==3||s.startOffset!==0||!b||b.nodeType===3||!b.classList.contains("vditor-ir__node")||b.getAttribute("data-block"))&&b}(e);return o?(o.classList.add("vditor-ir__node--expand"),void o.classList.remove("vditor-ir__node--hidden")):void 0}},U=F(863),se=function(e,t){var n,i=getSelection().getRangeAt(0).cloneRange(),r=i.startContainer;i.startContainer.nodeType!==3&&i.startContainer.tagName==="DIV"&&(r=i.startContainer.childNodes[i.startOffset-1]);var o=(0,h.a1)(r,"data-block","0");if(o&&t&&(t.inputType==="deleteContentBackward"||t.data===" ")){for(var s=(0,M.im)(o,e.sv.element,i).start,f=!0,b=s-1;b>o.textContent.substr(0,s).lastIndexOf(`
  32. `);b--)if(o.textContent.charAt(b)!==" "&&o.textContent.charAt(b)!==" "){f=!1;break}if(s===0&&(f=!1),f)return void Ce(e);if(t.inputType==="deleteContentBackward"){var w=(0,h.a1)(r,"data-type","code-block-open-marker")||(0,h.a1)(r,"data-type","code-block-close-marker");if(w){var y;if(w.getAttribute("data-type")==="code-block-close-marker"&&(y=Tt(r,"code-block-open-marker"))||w.getAttribute("data-type")==="code-block-open-marker"&&(y=Tt(r,"code-block-close-marker",!1)))return y.textContent=w.textContent,void Ce(e)}var x=(0,h.a1)(r,"data-type","math-block-open-marker");if(x){var j=x.nextElementSibling.nextElementSibling;return void(j&&j.getAttribute("data-type")==="math-block-close-marker"&&(j.remove(),Ce(e)))}o.querySelectorAll('[data-type="code-block-open-marker"]').forEach(function(H){H.textContent.length===1&&H.remove()}),o.querySelectorAll('[data-type="code-block-close-marker"]').forEach(function(H){H.textContent.length===1&&H.remove()});var B=(0,h.a1)(r,"data-type","heading-marker");if(B&&B.textContent.indexOf("#")===-1)return void Ce(e)}if((t.data===" "||t.inputType==="deleteContentBackward")&&((0,h.a1)(r,"data-type","padding")||(0,h.a1)(r,"data-type","li-marker")||(0,h.a1)(r,"data-type","task-marker")||(0,h.a1)(r,"data-type","blockquote-marker")))return void Ce(e)}if(o&&o.textContent.trimRight()==="$$")Ce(e);else{o||(o=e.sv.element),((n=o.firstElementChild)===null||n===void 0?void 0:n.getAttribute("data-type"))==="link-ref-defs-block"&&(o=e.sv.element),(0,h.a1)(r,"data-type","footnotes-link")&&(o=e.sv.element),o.textContent.indexOf(Lute.Caret)===-1&&i.insertNode(document.createTextNode(Lute.Caret)),o.querySelectorAll("[style]").forEach(function(H){H.removeAttribute("style")}),o.querySelectorAll("font").forEach(function(H){H.outerHTML=H.innerHTML});var C,R=o.textContent,K=o.isEqualNode(e.sv.element);K?R=o.textContent:(o.previousElementSibling&&(R=o.previousElementSibling.textContent+R,o.previousElementSibling.remove()),o.previousElementSibling&&R.indexOf(`---
  33. `)===0&&(R=o.previousElementSibling.textContent+R,o.previousElementSibling.remove()),o.innerText.startsWith("```")||(e.sv.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(H,J){J===0&&H&&!o.isEqualNode(H.parentElement)&&(R+=`
  34. `+H.parentElement.textContent,H.parentElement.remove())}),e.sv.element.querySelectorAll("[data-type='footnotes-link']").forEach(function(H,J){J===0&&H&&!o.isEqualNode(H.parentElement)&&(R+=`
  35. `+H.parentElement.textContent,H.parentElement.remove())}))),R=dn(R,e),K?o.innerHTML=R:o.outerHTML=R;var W,z=e.sv.element.querySelectorAll("[data-type='link-ref-defs-block']");z.forEach(function(H,J){J===0?C=H.parentElement:(C.lastElementChild.remove(),C.insertAdjacentHTML("beforeend",""+H.parentElement.innerHTML),H.parentElement.remove())}),z.length>0&&e.sv.element.insertAdjacentElement("beforeend",C);var V=e.sv.element.querySelectorAll("[data-type='footnotes-link']");V.forEach(function(H,J){J===0?W=H.parentElement:(W.lastElementChild.remove(),W.insertAdjacentHTML("beforeend",""+H.parentElement.innerHTML),H.parentElement.remove())}),V.length>0&&e.sv.element.insertAdjacentElement("beforeend",W),(0,M.ib)(e.sv.element,i),Me(e),Ce(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})}},te=F(227),$=function(e){e.options.theme==="dark"?e.element.classList.add("vditor--dark"):e.element.classList.remove("vditor--dark")},me=function(e){var t=window.innerWidth<=m.g.MOBILE_WIDTH?10:35;if(e.wysiwyg.element.parentElement.style.display!=="none"){var n=(e.wysiwyg.element.parentElement.clientWidth-e.options.preview.maxWidth)/2;e.wysiwyg.element.style.padding="10px "+Math.max(t,n)+"px"}e.ir.element.parentElement.style.display!=="none"&&(n=(e.ir.element.parentElement.clientWidth-e.options.preview.maxWidth)/2,e.ir.element.style.padding="10px "+Math.max(t,n)+"px"),e.preview.element.style.display!=="block"?e.toolbar.element.style.paddingLeft=Math.max(5,parseInt(e[e.currentMode].element.style.paddingLeft||"0",10)+(e.options.outline.position==="left"?e.outline.element.offsetWidth:0))+"px":e.toolbar.element.style.paddingLeft=5+(e.options.outline.position==="left"?e.outline.element.offsetWidth:0)+"px"},ye=function(e){if(e.options.typewriterMode){var t=window.innerHeight;typeof e.options.height=="number"?(t=e.options.height,typeof e.options.minHeight=="number"&&(t=Math.max(t,e.options.minHeight)),t=Math.min(window.innerHeight,t)):t=e.element.clientHeight,e.element.classList.contains("vditor--fullscreen")&&(t=window.innerHeight),e[e.currentMode].element.style.setProperty("--editor-bottom",(t-e.toolbar.element.offsetHeight)/2+"px")}};function ce(){window.removeEventListener("resize",I)}var Qe,tn,ir=function(e){ye(e),ce(),window.addEventListener("resize",I=function(){me(e),ye(e)});var t=(0,a.pK)()&&localStorage.getItem(e.options.cache.id);return e.options.cache.enable&&t||(e.options.value?t=e.options.value:e.originalInnerHTML?t=e.lute.HTML2Md(e.originalInnerHTML):e.options.cache.enable||(t="")),t||""},ft=function(e){clearTimeout(e[e.currentMode].hlToolbarTimeoutId),e[e.currentMode].hlToolbarTimeoutId=window.setTimeout(function(){if(e[e.currentMode].element.getAttribute("contenteditable")!=="false"&&(0,M.Gb)(e[e.currentMode].element)){c(e.toolbar.elements,m.g.EDIT_TOOLBARS),v(e.toolbar.elements,m.g.EDIT_TOOLBARS);var t=(0,M.zh)(e),n=t.startContainer;t.startContainer.nodeType===3&&(n=t.startContainer.parentElement),n.classList.contains("vditor-reset")&&(n=n.childNodes[t.startOffset]),(e.currentMode==="sv"?(0,h.a1)(n,"data-type","heading"):(0,N.W)(n))&&p(e.toolbar.elements,["headings"]),(e.currentMode==="sv"?(0,h.a1)(n,"data-type","blockquote"):(0,h.lG)(n,"BLOCKQUOTE"))&&p(e.toolbar.elements,["quote"]),(0,h.a1)(n,"data-type","strong")&&p(e.toolbar.elements,["bold"]),(0,h.a1)(n,"data-type","em")&&p(e.toolbar.elements,["italic"]),(0,h.a1)(n,"data-type","s")&&p(e.toolbar.elements,["strike"]),(0,h.a1)(n,"data-type","a")&&p(e.toolbar.elements,["link"]);var i=(0,h.lG)(n,"LI");i?(i.classList.contains("vditor-task")?p(e.toolbar.elements,["check"]):i.parentElement.tagName==="OL"?p(e.toolbar.elements,["ordered-list"]):i.parentElement.tagName==="UL"&&p(e.toolbar.elements,["list"]),v(e.toolbar.elements,["outdent","indent"])):L(e.toolbar.elements,["outdent","indent"]),(0,h.a1)(n,"data-type","code-block")&&(L(e.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","inline-code","upload","link","table","record"]),p(e.toolbar.elements,["code"])),(0,h.a1)(n,"data-type","code")&&(L(e.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","upload","link","table","record"]),p(e.toolbar.elements,["inline-code"])),(0,h.a1)(n,"data-type","table")&&L(e.toolbar.elements,["headings","list","ordered-list","check","line","quote","code","table"])}},200)},we=function(e,t){t===void 0&&(t={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),t.enableHint&&e.hint.render(e),clearTimeout(e.wysiwyg.afterRenderTimeoutId),e.wysiwyg.afterRenderTimeoutId=window.setTimeout(function(){if(!e.wysiwyg.composingLock){var n=u(e);typeof e.options.input=="function"&&t.enableInput&&e.options.input(n),e.options.counter.enable&&e.counter.render(e,n),e.options.cache.enable&&(0,a.pK)()&&(localStorage.setItem(e.options.cache.id,n),e.options.cache.after&&e.options.cache.after(n)),e.devtools&&e.devtools.renderEchart(e),t.enableAddUndoStack&&e.undo.addToUndoStack(e)}},e.options.undoDelay)},nn=function(e){for(var t="",n=e.nextSibling;n;)n.nodeType===3?t+=n.textContent:t+=n.outerHTML,n=n.nextSibling;return t},rn=function(e){for(var t="",n=e.previousSibling;n;)t=n.nodeType===3?n.textContent+t:n.outerHTML+t,n=n.previousSibling;return t},on=function(e,t){Array.from(e.wysiwyg.element.childNodes).find(function(n){if(n.nodeType===3){var i=document.createElement("p");i.setAttribute("data-block","0"),i.textContent=n.textContent;var r=t.startContainer.nodeType===3?t.startOffset:n.textContent.length;return n.parentNode.insertBefore(i,n),n.remove(),t.setStart(i.firstChild,Math.min(i.firstChild.textContent.length,r)),t.collapse(!0),(0,M.Hc)(t),!0}if(!n.getAttribute("data-block"))return n.tagName==="P"?n.remove():(n.tagName==="DIV"?(t.insertNode(document.createElement("wbr")),n.outerHTML='<p data-block="0">'+n.innerHTML+"</p>"):n.tagName==="BR"?n.outerHTML='<p data-block="0">'+n.outerHTML+"<wbr></p>":(t.insertNode(document.createElement("wbr")),n.outerHTML='<p data-block="0">'+n.outerHTML+"</p>"),(0,M.ib)(e.wysiwyg.element,t),t=getSelection().getRangeAt(0)),!0})},Lt=function(e,t){var n=(0,M.zh)(e),i=(0,h.F9)(n.startContainer);i||(i=n.startContainer.childNodes[n.startOffset]),i||e.wysiwyg.element.children.length!==0||(i=e.wysiwyg.element),i&&!i.classList.contains("vditor-wysiwyg__block")&&(n.insertNode(document.createElement("wbr")),i.innerHTML.trim()==="<wbr>"&&(i.innerHTML="<wbr><br>"),i.tagName==="BLOCKQUOTE"||i.classList.contains("vditor-reset")?i.innerHTML="<"+t+' data-block="0">'+i.innerHTML.trim()+"</"+t+">":i.outerHTML="<"+t+' data-block="0">'+i.innerHTML.trim()+"</"+t+">",(0,M.ib)(e.wysiwyg.element,n),he(e))},jt=function(e){var t=getSelection().getRangeAt(0),n=(0,h.F9)(t.startContainer);n||(n=t.startContainer.childNodes[t.startOffset]),n&&(t.insertNode(document.createElement("wbr")),n.outerHTML='<p data-block="0">'+n.innerHTML+"</p>",(0,M.ib)(e.wysiwyg.element,t)),e.wysiwyg.popover.style.display="none"},ht=function(e,t,n){n===void 0&&(n=!0);var i=e.previousElementSibling,r=i.ownerDocument.createRange();i.tagName==="CODE"?(i.style.display="inline-block",n?r.setStart(i.firstChild,1):r.selectNodeContents(i)):(i.style.display="block",i.firstChild.firstChild||i.firstChild.appendChild(document.createTextNode("")),r.selectNodeContents(i.firstChild)),n?r.collapse(!0):r.collapse(!1),(0,M.Hc)(r),e.firstElementChild.classList.contains("language-mindmap")||Me(t)},Re=function(e,t){if(P("\u21E7\u2318X",t)){var n=e.wysiwyg.popover.querySelector('[data-type="remove"]');return n&&n.click(),t.preventDefault(),!0}},Ye=function(e){clearTimeout(e.wysiwyg.hlToolbarTimeoutId),e.wysiwyg.hlToolbarTimeoutId=window.setTimeout(function(){if(e.wysiwyg.element.getAttribute("contenteditable")!=="false"&&(0,M.Gb)(e.wysiwyg.element)){c(e.toolbar.elements,m.g.EDIT_TOOLBARS),v(e.toolbar.elements,m.g.EDIT_TOOLBARS);var t=getSelection().getRangeAt(0),n=t.startContainer;n=t.startContainer.nodeType===3?t.startContainer.parentElement:n.childNodes[t.startOffset>=n.childNodes.length?n.childNodes.length-1:t.startOffset];var i=(0,h.a1)(n,"data-type","footnotes-block");if(i)return e.wysiwyg.popover.innerHTML="",Ue(i,e),void Ve(e,i);var r=(0,h.lG)(n,"LI");r?(r.classList.contains("vditor-task")?p(e.toolbar.elements,["check"]):r.parentElement.tagName==="OL"?p(e.toolbar.elements,["ordered-list"]):r.parentElement.tagName==="UL"&&p(e.toolbar.elements,["list"]),v(e.toolbar.elements,["outdent","indent"])):L(e.toolbar.elements,["outdent","indent"]),(0,h.lG)(n,"BLOCKQUOTE")&&p(e.toolbar.elements,["quote"]),((0,h.lG)(n,"B")||(0,h.lG)(n,"STRONG"))&&p(e.toolbar.elements,["bold"]),((0,h.lG)(n,"I")||(0,h.lG)(n,"EM"))&&p(e.toolbar.elements,["italic"]),((0,h.lG)(n,"STRIKE")||(0,h.lG)(n,"S"))&&p(e.toolbar.elements,["strike"]),e.wysiwyg.element.querySelectorAll(".vditor-comment--focus").forEach(function(X){X.classList.remove("vditor-comment--focus")});var o=(0,h.fb)(n,"vditor-comment");if(o){var s=o.getAttribute("data-cmtids").split(" ");if(s.length>1&&o.nextSibling.isSameNode(o.nextElementSibling)){var f=o.nextElementSibling.getAttribute("data-cmtids").split(" ");s.find(function(X){if(f.includes(X))return s=[X],!0})}e.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(X){X.getAttribute("data-cmtids").indexOf(s[0])>-1&&X.classList.add("vditor-comment--focus")})}var b=(0,h.lG)(n,"A");b&&p(e.toolbar.elements,["link"]);var w=(0,h.lG)(n,"TABLE"),y=(0,N.W)(n);(0,h.lG)(n,"CODE")?(0,h.lG)(n,"PRE")?(L(e.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","inline-code","upload","link","table","record"]),p(e.toolbar.elements,["code"])):(L(e.toolbar.elements,["headings","bold","italic","strike","line","quote","list","ordered-list","check","code","upload","link","table","record"]),p(e.toolbar.elements,["inline-code"])):y?(L(e.toolbar.elements,["bold"]),p(e.toolbar.elements,["headings"])):w&&L(e.toolbar.elements,["table"]);var x=(0,h.fb)(n,"vditor-toc");if(x)return e.wysiwyg.popover.innerHTML="",Ue(x,e),void Ve(e,x);var j=(0,N.S)(n,"BLOCKQUOTE");if(j&&(e.wysiwyg.popover.innerHTML="",nt(t,j,e),rt(t,j,e),Ue(j,e),Ve(e,j)),r&&(e.wysiwyg.popover.innerHTML="",nt(t,r,e),rt(t,r,e),Ue(r,e),Ve(e,r)),w){e.options.lang,e.options,e.wysiwyg.popover.innerHTML="";var B=function(){var X=w.rows.length,Ee=w.rows[0].cells.length,tt=parseInt(le.value,10)||X,Ze=parseInt(Te.value,10)||Ee;if(tt!==X||Ee!==Ze){if(Ee!==Ze)for(var Pn=Ze-Ee,lt=0;lt<w.rows.length;lt++)if(Pn>0)for(var qn=0;qn<Pn;qn++)lt===0?w.rows[lt].lastElementChild.insertAdjacentHTML("afterend","<th> </th>"):w.rows[lt].lastElementChild.insertAdjacentHTML("afterend","<td> </td>");else for(var $t=Ee-1;$t>=Ze;$t--)w.rows[lt].cells[$t].remove();if(X!==tt){var Bn=tt-X;if(Bn>0){for(var Yt="<tr>",ct=0;ct<Ze;ct++)Yt+="<td> </td>";for(var Vn=0;Vn<Bn;Vn++)w.querySelector("tbody")?w.querySelector("tbody").insertAdjacentHTML("beforeend",Yt):w.querySelector("thead").insertAdjacentHTML("afterend",Yt+"</tr>")}else for(ct=X-1;ct>=tt;ct--)w.rows[ct].remove(),w.rows.length===1&&w.querySelector("tbody").remove()}}},C=function(X){xt(w,X),X==="right"?(z.classList.remove("vditor-icon--current"),V.classList.remove("vditor-icon--current"),H.classList.add("vditor-icon--current")):X==="center"?(z.classList.remove("vditor-icon--current"),H.classList.remove("vditor-icon--current"),V.classList.add("vditor-icon--current")):(V.classList.remove("vditor-icon--current"),H.classList.remove("vditor-icon--current"),z.classList.add("vditor-icon--current")),(0,M.Hc)(t),we(e)},R=(0,h.lG)(n,"TD"),K=(0,h.lG)(n,"TH"),W="left";R?W=R.getAttribute("align")||"left":K&&(W=K.getAttribute("align")||"center");var z=document.createElement("button");z.setAttribute("type","button"),z.setAttribute("aria-label",window.VditorI18n.alignLeft+"<"+(0,a.ns)("\u21E7\u2318L")+">"),z.setAttribute("data-type","left"),z.innerHTML='<svg><use xlink:href="#vditor-icon-align-left"></use></svg>',z.className="vditor-icon vditor-tooltipped vditor-tooltipped__n"+(W==="left"?" vditor-icon--current":""),z.onclick=function(){C("left")};var V=document.createElement("button");V.setAttribute("type","button"),V.setAttribute("aria-label",window.VditorI18n.alignCenter+"<"+(0,a.ns)("\u21E7\u2318C")+">"),V.setAttribute("data-type","center"),V.innerHTML='<svg><use xlink:href="#vditor-icon-align-center"></use></svg>',V.className="vditor-icon vditor-tooltipped vditor-tooltipped__n"+(W==="center"?" vditor-icon--current":""),V.onclick=function(){C("center")};var H=document.createElement("button");H.setAttribute("type","button"),H.setAttribute("aria-label",window.VditorI18n.alignRight+"<"+(0,a.ns)("\u21E7\u2318R")+">"),H.setAttribute("data-type","right"),H.innerHTML='<svg><use xlink:href="#vditor-icon-align-right"></use></svg>',H.className="vditor-icon vditor-tooltipped vditor-tooltipped__n"+(W==="right"?" vditor-icon--current":""),H.onclick=function(){C("right")};var J=document.createElement("button");J.setAttribute("type","button"),J.setAttribute("aria-label",window.VditorI18n.insertRowBelow+"<"+(0,a.ns)("\u2318=")+">"),J.setAttribute("data-type","insertRow"),J.innerHTML='<svg><use xlink:href="#vditor-icon-insert-row"></use></svg>',J.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",J.onclick=function(){var X=getSelection().getRangeAt(0).startContainer,Ee=(0,h.lG)(X,"TD")||(0,h.lG)(X,"TH");Ee&&En(e,t,Ee)};var ie=document.createElement("button");ie.setAttribute("type","button"),ie.setAttribute("aria-label",window.VditorI18n.insertRowAbove+"<"+(0,a.ns)("\u21E7\u2318F")+">"),ie.setAttribute("data-type","insertRow"),ie.innerHTML='<svg><use xlink:href="#vditor-icon-insert-rowb"></use></svg>',ie.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",ie.onclick=function(){var X=getSelection().getRangeAt(0).startContainer,Ee=(0,h.lG)(X,"TD")||(0,h.lG)(X,"TH");Ee&&Sn(e,t,Ee)};var Y=document.createElement("button");Y.setAttribute("type","button"),Y.setAttribute("aria-label",window.VditorI18n.insertColumnRight+"<"+(0,a.ns)("\u21E7\u2318=")+">"),Y.setAttribute("data-type","insertColumn"),Y.innerHTML='<svg><use xlink:href="#vditor-icon-insert-column"></use></svg>',Y.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",Y.onclick=function(){var X=getSelection().getRangeAt(0).startContainer,Ee=(0,h.lG)(X,"TD")||(0,h.lG)(X,"TH");Ee&&At(e,w,Ee)};var re=document.createElement("button");re.setAttribute("type","button"),re.setAttribute("aria-label",window.VditorI18n.insertColumnLeft+"<"+(0,a.ns)("\u21E7\u2318G")+">"),re.setAttribute("data-type","insertColumn"),re.innerHTML='<svg><use xlink:href="#vditor-icon-insert-columnb"></use></svg>',re.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",re.onclick=function(){var X=getSelection().getRangeAt(0).startContainer,Ee=(0,h.lG)(X,"TD")||(0,h.lG)(X,"TH");Ee&&At(e,w,Ee,"beforebegin")};var ne=document.createElement("button");ne.setAttribute("type","button"),ne.setAttribute("aria-label",window.VditorI18n["delete-row"]+"<"+(0,a.ns)("\u2318-")+">"),ne.setAttribute("data-type","deleteRow"),ne.innerHTML='<svg><use xlink:href="#vditor-icon-delete-row"></use></svg>',ne.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",ne.onclick=function(){var X=getSelection().getRangeAt(0).startContainer,Ee=(0,h.lG)(X,"TD")||(0,h.lG)(X,"TH");Ee&&kn(e,t,Ee)};var Q=document.createElement("button");Q.setAttribute("type","button"),Q.setAttribute("aria-label",window.VditorI18n["delete-column"]+"<"+(0,a.ns)("\u21E7\u2318-")+">"),Q.setAttribute("data-type","deleteColumn"),Q.innerHTML='<svg><use xlink:href="#vditor-icon-delete-column"></use></svg>',Q.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",Q.onclick=function(){var X=getSelection().getRangeAt(0).startContainer,Ee=(0,h.lG)(X,"TD")||(0,h.lG)(X,"TH");Ee&&Ln(e,t,w,Ee)},(We=document.createElement("span")).setAttribute("aria-label",window.VditorI18n.row),We.className="vditor-tooltipped vditor-tooltipped__n";var le=document.createElement("input");We.appendChild(le),le.type="number",le.min="1",le.className="vditor-input",le.style.width="42px",le.style.textAlign="center",le.setAttribute("placeholder",window.VditorI18n.row),le.value=w.rows.length.toString(),le.oninput=function(){B()},le.onkeydown=function(X){if(!X.isComposing)return X.key==="Tab"?(Te.focus(),Te.select(),void X.preventDefault()):void(Re(e,X)||Fe(X,t))};var be=document.createElement("span");be.setAttribute("aria-label",window.VditorI18n.column),be.className="vditor-tooltipped vditor-tooltipped__n";var Te=document.createElement("input");be.appendChild(Te),Te.type="number",Te.min="1",Te.className="vditor-input",Te.style.width="42px",Te.style.textAlign="center",Te.setAttribute("placeholder",window.VditorI18n.column),Te.value=w.rows[0].cells.length.toString(),Te.oninput=function(){B()},Te.onkeydown=function(X){if(!X.isComposing)return X.key==="Tab"?(le.focus(),le.select(),void X.preventDefault()):void(Re(e,X)||Fe(X,t))},nt(t,w,e),rt(t,w,e),Ue(w,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",z),e.wysiwyg.popover.insertAdjacentElement("beforeend",V),e.wysiwyg.popover.insertAdjacentElement("beforeend",H),e.wysiwyg.popover.insertAdjacentElement("beforeend",ie),e.wysiwyg.popover.insertAdjacentElement("beforeend",J),e.wysiwyg.popover.insertAdjacentElement("beforeend",re),e.wysiwyg.popover.insertAdjacentElement("beforeend",Y),e.wysiwyg.popover.insertAdjacentElement("beforeend",ne),e.wysiwyg.popover.insertAdjacentElement("beforeend",Q),e.wysiwyg.popover.insertAdjacentElement("beforeend",We),e.wysiwyg.popover.insertAdjacentHTML("beforeend"," x "),e.wysiwyg.popover.insertAdjacentElement("beforeend",be),Ve(e,w)}var Je=(0,h.a1)(n,"data-type","link-ref");Je&&an(e,Je,t);var Ie=(0,h.a1)(n,"data-type","footnotes-ref");if(Ie){e.options.lang,e.options,e.wysiwyg.popover.innerHTML="",(We=document.createElement("span")).setAttribute("aria-label",window.VditorI18n.footnoteRef+"<"+(0,a.ns)("\u2325Enter")+">"),We.className="vditor-tooltipped vditor-tooltipped__n";var qe=document.createElement("input");We.appendChild(qe),qe.className="vditor-input",qe.setAttribute("placeholder",window.VditorI18n.footnoteRef+"<"+(0,a.ns)("\u2325Enter")+">"),qe.style.width="120px",qe.value=Ie.getAttribute("data-footnotes-label"),qe.oninput=function(){qe.value.trim()!==""&&Ie.setAttribute("data-footnotes-label",qe.value)},qe.onkeydown=function(X){X.isComposing||Re(e,X)||Fe(X,t)},Ue(Ie,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",We),Ve(e,Ie)}var _e=(0,h.fb)(n,"vditor-wysiwyg__block"),at=!!_e&&_e.getAttribute("data-type").indexOf("block")>-1;if(e.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview").forEach(function(X){(!_e||_e&&at&&!_e.contains(X))&&(X.previousElementSibling.style.display="none")}),_e&&at){if(e.wysiwyg.popover.innerHTML="",nt(t,_e,e),rt(t,_e,e),Ue(_e,e),_e.getAttribute("data-type")==="code-block"){var Dt=document.createElement("span");Dt.setAttribute("aria-label",window.VditorI18n.language+"<"+(0,a.ns)("\u2325Enter")+">"),Dt.className="vditor-tooltipped vditor-tooltipped__n";var ze=document.createElement("input");Dt.appendChild(ze);var wt=_e.firstElementChild.firstElementChild;ze.className="vditor-input",ze.setAttribute("placeholder",window.VditorI18n.language+"<"+(0,a.ns)("\u2325Enter")+">"),ze.value=wt.className.indexOf("language-")>-1?wt.className.split("-")[1].split(" ")[0]:"",ze.oninput=function(X){ze.value.trim()!==""?wt.className="language-"+ze.value:(wt.className="",e.hint.recentLanguage=""),_e.lastElementChild.classList.contains("vditor-wysiwyg__preview")&&(_e.lastElementChild.innerHTML=_e.firstElementChild.innerHTML,ge(_e.lastElementChild,e)),we(e),X.detail===1&&(t.setStart(wt.firstChild,0),t.collapse(!0),(0,M.Hc)(t))},ze.onkeydown=function(X){if(!X.isComposing&&!Re(e,X)){if(X.key==="Escape"&&e.hint.element.style.display==="block")return e.hint.element.style.display="none",void X.preventDefault();e.hint.select(X,e),Fe(X,t)}},ze.onkeyup=function(X){if(!X.isComposing&&X.key!=="Enter"&&X.key!=="ArrowUp"&&X.key!=="Escape"&&X.key!=="ArrowDown"){var Ee=[],tt=ze.value.substring(0,ze.selectionStart);(e.options.preview.hljs.langs||m.g.CODE_LANGUAGES).forEach(function(Ze){Ze.indexOf(tt.toLowerCase())>-1&&Ee.push({html:Ze,value:Ze})}),e.hint.genHTML(Ee,tt,e),X.preventDefault()}},e.wysiwyg.popover.insertAdjacentElement("beforeend",Dt)}Ve(e,_e)}else _e=void 0;if(y){var We;e.wysiwyg.popover.innerHTML="",(We=document.createElement("span")).setAttribute("aria-label","ID<"+(0,a.ns)("\u2325Enter")+">"),We.className="vditor-tooltipped vditor-tooltipped__n";var $e=document.createElement("input");We.appendChild($e),$e.className="vditor-input",$e.setAttribute("placeholder","ID<"+(0,a.ns)("\u2325Enter")+">"),$e.style.width="120px",$e.value=y.getAttribute("data-id")||"",$e.oninput=function(){y.setAttribute("data-id",$e.value)},$e.onkeydown=function(X){X.isComposing||Re(e,X)||Fe(X,t)},nt(t,y,e),rt(t,y,e),Ue(y,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",We),Ve(e,y)}if(b&&Pt(e,b,t),!(j||r||w||_e||b||Je||Ie||y||x)){var st=(0,h.a1)(n,"data-block","0");st&&st.parentElement.isEqualNode(e.wysiwyg.element)?(e.wysiwyg.popover.innerHTML="",nt(t,st,e),rt(t,st,e),Ue(st,e),Ve(e,st)):e.wysiwyg.popover.style.display="none"}e.wysiwyg.element.querySelectorAll('span[data-type="backslash"] > span').forEach(function(X){X.style.display="none"});var jn=(0,h.a1)(t.startContainer,"data-type","backslash");jn&&(jn.querySelector("span").style.display="inline")}},200)},Ve=function(e,t){var n=t,i=(0,h.lG)(t,"TABLE");i&&(n=i),e.wysiwyg.popover.style.left="0",e.wysiwyg.popover.style.display="block",e.wysiwyg.popover.style.top=Math.max(-8,n.offsetTop-21-e.wysiwyg.element.scrollTop)+"px",e.wysiwyg.popover.style.left=Math.min(n.offsetLeft,e.wysiwyg.element.clientWidth-e.wysiwyg.popover.clientWidth)+"px",e.wysiwyg.popover.setAttribute("data-top",(n.offsetTop-21).toString())},an=function(e,t,n){n===void 0&&(n=getSelection().getRangeAt(0)),e.wysiwyg.popover.innerHTML="";var i=function(){o.value.trim()!==""&&(t.tagName==="IMG"?t.setAttribute("alt",o.value):t.textContent=o.value),f.value.trim()!==""&&t.setAttribute("data-link-label",f.value)},r=document.createElement("span");r.setAttribute("aria-label",window.VditorI18n.textIsNotEmpty),r.className="vditor-tooltipped vditor-tooltipped__n";var o=document.createElement("input");r.appendChild(o),o.className="vditor-input",o.setAttribute("placeholder",window.VditorI18n.textIsNotEmpty),o.style.width="120px",o.value=t.getAttribute("alt")||t.textContent,o.oninput=function(){i()},o.onkeydown=function(b){Re(e,b)||Fe(b,n)||vt(e,t,b,f)};var s=document.createElement("span");s.setAttribute("aria-label",window.VditorI18n.linkRef),s.className="vditor-tooltipped vditor-tooltipped__n";var f=document.createElement("input");s.appendChild(f),f.className="vditor-input",f.setAttribute("placeholder",window.VditorI18n.linkRef),f.value=t.getAttribute("data-link-label"),f.oninput=function(){i()},f.onkeydown=function(b){Re(e,b)||Fe(b,n)||vt(e,t,b,o)},Ue(t,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",r),e.wysiwyg.popover.insertAdjacentElement("beforeend",s),Ve(e,t)},nt=function(e,t,n){var i=t.previousElementSibling;if(i&&(t.parentElement.isEqualNode(n.wysiwyg.element)||t.tagName==="LI")){var r=document.createElement("button");r.setAttribute("type","button"),r.setAttribute("data-type","up"),r.setAttribute("aria-label",window.VditorI18n.up+"<"+(0,a.ns)("\u21E7\u2318U")+">"),r.innerHTML='<svg><use xlink:href="#vditor-icon-up"></use></svg>',r.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",r.onclick=function(){e.insertNode(document.createElement("wbr")),i.insertAdjacentElement("beforebegin",t),(0,M.ib)(n.wysiwyg.element,e),we(n),Ye(n),Me(n)},n.wysiwyg.popover.insertAdjacentElement("beforeend",r)}},rt=function(e,t,n){var i=t.nextElementSibling;if(i&&(t.parentElement.isEqualNode(n.wysiwyg.element)||t.tagName==="LI")){var r=document.createElement("button");r.setAttribute("type","button"),r.setAttribute("data-type","down"),r.setAttribute("aria-label",window.VditorI18n.down+"<"+(0,a.ns)("\u21E7\u2318D")+">"),r.innerHTML='<svg><use xlink:href="#vditor-icon-down"></use></svg>',r.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",r.onclick=function(){e.insertNode(document.createElement("wbr")),i.insertAdjacentElement("afterend",t),(0,M.ib)(n.wysiwyg.element,e),we(n),Ye(n),Me(n)},n.wysiwyg.popover.insertAdjacentElement("beforeend",r)}},Ue=function(e,t){var n=document.createElement("button");n.setAttribute("type","button"),n.setAttribute("data-type","remove"),n.setAttribute("aria-label",window.VditorI18n.remove+"<"+(0,a.ns)("\u21E7\u2318X")+">"),n.innerHTML='<svg><use xlink:href="#vditor-icon-trashcan"></use></svg>',n.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",n.onclick=function(){var i=(0,M.zh)(t);i.setStartAfter(e),(0,M.Hc)(i),e.remove(),we(t),Ye(t),["H1","H2","H3","H4","H5","H6"].includes(e.tagName)&&he(t)},t.wysiwyg.popover.insertAdjacentElement("beforeend",n)},vt=function(e,t,n,i){if(!n.isComposing){if(n.key==="Tab")return i.focus(),i.select(),void n.preventDefault();if(!(0,a.yl)(n)&&!n.shiftKey&&n.altKey&&n.key==="Enter"){var r=(0,M.zh)(e);t.insertAdjacentHTML("afterend",m.g.ZWSP),r.setStartAfter(t.nextSibling),r.collapse(!0),(0,M.Hc)(r),n.preventDefault()}}},Pt=function(e,t,n){e.wysiwyg.popover.innerHTML="";var i=function(){o.value.trim()!==""&&(t.innerHTML=o.value),t.setAttribute("href",f.value),t.setAttribute("title",w.value),we(e)};t.querySelectorAll("[data-marker]").forEach(function(y){y.removeAttribute("data-marker")});var r=document.createElement("span");r.setAttribute("aria-label",window.VditorI18n.textIsNotEmpty),r.className="vditor-tooltipped vditor-tooltipped__n";var o=document.createElement("input");r.appendChild(o),o.className="vditor-input",o.setAttribute("placeholder",window.VditorI18n.textIsNotEmpty),o.style.width="120px",o.value=t.innerHTML||"",o.oninput=function(){i()},o.onkeydown=function(y){Re(e,y)||Fe(y,n)||vt(e,t,y,f)};var s=document.createElement("span");s.setAttribute("aria-label",window.VditorI18n.link),s.className="vditor-tooltipped vditor-tooltipped__n";var f=document.createElement("input");s.appendChild(f),f.className="vditor-input",f.setAttribute("placeholder",window.VditorI18n.link),f.value=t.getAttribute("href")||"",f.oninput=function(){i()},f.onkeydown=function(y){Re(e,y)||Fe(y,n)||vt(e,t,y,w)};var b=document.createElement("span");b.setAttribute("aria-label",window.VditorI18n.tooltipText),b.className="vditor-tooltipped vditor-tooltipped__n";var w=document.createElement("input");b.appendChild(w),w.className="vditor-input",w.setAttribute("placeholder",window.VditorI18n.tooltipText),w.style.width="60px",w.value=t.getAttribute("title")||"",w.oninput=function(){i()},w.onkeydown=function(y){Re(e,y)||Fe(y,n)||vt(e,t,y,o)},Ue(t,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",r),e.wysiwyg.popover.insertAdjacentElement("beforeend",s),e.wysiwyg.popover.insertAdjacentElement("beforeend",b),Ve(e,t)},Fe=function(e,t){if(!(0,a.yl)(e)&&!e.shiftKey&&e.key==="Enter"||e.key==="Escape")return t&&(0,M.Hc)(t),e.preventDefault(),e.stopPropagation(),!0},it=function(e){e.currentMode==="wysiwyg"?Ye(e):e.currentMode==="ir"&&ft(e)},sn=function(e,t,n){n===void 0&&(n={enableAddUndoStack:!0,enableHint:!1,enableInput:!0});var i=e.wysiwyg.element;i.innerHTML=e.lute.Md2VditorDOM(t),i.querySelectorAll(".vditor-wysiwyg__preview[data-render='2']").forEach(function(r){ge(r,e),r.previousElementSibling.setAttribute("style","display:none")}),we(e,n)},or=function(e,t,n){for(var i=e.startContainer.parentElement,r=!1,o="",s="",f=function(C){var R=rn(C.startContainer),K=nn(C.startContainer),W=C.startContainer.textContent,z=C.startOffset,V="",H="";return(W.substr(0,z)!==""&&W.substr(0,z)!==m.g.ZWSP||R)&&(V=""+R+W.substr(0,z)),(W.substr(z)!==""&&W.substr(z)!==m.g.ZWSP||K)&&(H=""+W.substr(z)+K),{afterHTML:H,beforeHTML:V}}(e),b=f.beforeHTML,w=f.afterHTML;i&&!r;){var y=i.tagName;if(y==="STRIKE"&&(y="S"),y==="I"&&(y="EM"),y==="B"&&(y="STRONG"),y==="S"||y==="STRONG"||y==="EM"){var x="",j="",B="";i.parentElement.getAttribute("data-block")!=="0"&&(j=rn(i),B=nn(i)),(b||j)&&(b=x=j+"<"+y+">"+b+"</"+y+">"),(n==="bold"&&y==="STRONG"||n==="italic"&&y==="EM"||n==="strikeThrough"&&y==="S")&&(x+=""+o+m.g.ZWSP+"<wbr>"+s,r=!0),(w||B)&&(x+=w="<"+y+">"+w+"</"+y+">"+B),i.parentElement.getAttribute("data-block")!=="0"?(i=i.parentElement).innerHTML=x:(i.outerHTML=x,i=i.parentElement),o="<"+y+">"+o,s="</"+y+">"+s}else r=!0}(0,M.ib)(t.wysiwyg.element,e)},Le=function(e,t){var n,i=this;this.element=document.createElement("div"),t.className&&(n=this.element.classList).add.apply(n,t.className.split(" "));var r=t.hotkey?" <"+(0,a.ns)(t.hotkey)+">":"";t.level===2&&(r=t.hotkey?" &lt;"+(0,a.ns)(t.hotkey)+"&gt;":"");var o=t.tip?t.tip+r:""+window.VditorI18n[t.name]+r,s=t.name==="upload"?"div":"button";if(t.level===2)this.element.innerHTML="<"+s+' data-type="'+t.name+'">'+o+"</"+s+">";else{this.element.classList.add("vditor-toolbar__item");var f=document.createElement(s);f.setAttribute("data-type",t.name),f.className="vditor-tooltipped vditor-tooltipped__"+t.tipPosition,f.setAttribute("aria-label",o),f.innerHTML=t.icon,this.element.appendChild(f)}t.prefix&&this.element.children[0].addEventListener((0,a.Le)(),function(b){b.preventDefault(),i.element.firstElementChild.classList.contains(m.g.CLASS_MENU_DISABLED)||(e.currentMode==="wysiwyg"?function(w,y,x){if(!(w.wysiwyg.composingLock&&x instanceof CustomEvent)){var j=!0,B=!0;w.wysiwyg.element.querySelector("wbr")&&w.wysiwyg.element.querySelector("wbr").remove();var C=(0,M.zh)(w),R=y.getAttribute("data-type");if(y.classList.contains("vditor-menu--current"))if(R==="strike"&&(R="strikeThrough"),R==="quote"){var K=(0,h.lG)(C.startContainer,"BLOCKQUOTE");K||(K=C.startContainer.childNodes[C.startOffset]),K&&(j=!1,y.classList.remove("vditor-menu--current"),C.insertNode(document.createElement("wbr")),K.outerHTML=K.innerHTML.trim()===""?'<p data-block="0">'+K.innerHTML+"</p>":K.innerHTML,(0,M.ib)(w.wysiwyg.element,C))}else if(R==="inline-code"){var W=(0,h.lG)(C.startContainer,"CODE");W||(W=C.startContainer.childNodes[C.startOffset]),W&&(W.outerHTML=W.innerHTML.replace(m.g.ZWSP,"")+"<wbr>",(0,M.ib)(w.wysiwyg.element,C))}else R==="link"?(C.collapsed&&C.selectNode(C.startContainer.parentElement),document.execCommand("unlink",!1,"")):R==="check"||R==="list"||R==="ordered-list"?(Ct(w,C,R),(0,M.ib)(w.wysiwyg.element,C),j=!1,y.classList.remove("vditor-menu--current")):(j=!1,y.classList.remove("vditor-menu--current"),C.toString()===""?or(C,w,R):document.execCommand(R,!1,""));else{w.wysiwyg.element.childNodes.length===0&&(w.wysiwyg.element.innerHTML='<p data-block="0"><wbr></p>',(0,M.ib)(w.wysiwyg.element,C));var z=(0,h.F9)(C.startContainer);if(R==="quote"){if(z||(z=C.startContainer.childNodes[C.startOffset]),z){j=!1,y.classList.add("vditor-menu--current"),C.insertNode(document.createElement("wbr"));var V=(0,h.lG)(C.startContainer,"LI");V&&z.contains(V)?V.innerHTML='<blockquote data-block="0">'+V.innerHTML+"</blockquote>":z.outerHTML='<blockquote data-block="0">'+z.outerHTML+"</blockquote>",(0,M.ib)(w.wysiwyg.element,C)}}else if(R==="check"||R==="list"||R==="ordered-list")Ct(w,C,R,!1),(0,M.ib)(w.wysiwyg.element,C),j=!1,c(w.toolbar.elements,["check","list","ordered-list"]),y.classList.add("vditor-menu--current");else if(R==="inline-code"){if(C.toString()==="")(H=document.createElement("code")).textContent=m.g.ZWSP,C.insertNode(H),C.setStart(H.firstChild,1),C.collapse(!0),(0,M.Hc)(C);else if(C.startContainer.nodeType===3){var H=document.createElement("code");C.surroundContents(H),C.insertNode(H),(0,M.Hc)(C)}y.classList.add("vditor-menu--current")}else if(R==="code")(H=document.createElement("div")).className="vditor-wysiwyg__block",H.setAttribute("data-type","code-block"),H.setAttribute("data-block","0"),H.setAttribute("data-marker","```"),C.toString()===""?H.innerHTML=`<pre><code><wbr>
  36. </code></pre>`:(H.innerHTML="<pre><code>"+C.toString()+"<wbr></code></pre>",C.deleteContents()),C.insertNode(H),z&&(z.outerHTML=w.lute.SpinVditorDOM(z.outerHTML)),(0,M.ib)(w.wysiwyg.element,C),w.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview[data-render='2']").forEach(function(Te){ge(Te,w)}),y.classList.add("vditor-menu--disabled");else if(R==="link"){if(C.toString()===""){var J=document.createElement("a");J.innerText=m.g.ZWSP,C.insertNode(J),C.setStart(J.firstChild,1),C.collapse(!0),Pt(w,J,C);var ie=w.wysiwyg.popover.querySelector("input");ie.value="",ie.focus(),B=!1}else{(H=document.createElement("a")).setAttribute("href",""),H.innerHTML=C.toString(),C.surroundContents(H),C.insertNode(H),(0,M.Hc)(C),Pt(w,H,C);var Y=w.wysiwyg.popover.querySelectorAll("input");Y[0].value=H.innerText,Y[1].focus()}j=!1,y.classList.add("vditor-menu--current")}else if(R==="table"){var re='<table data-block="0"><thead><tr><th>col1<wbr></th><th>col2</th><th>col3</th></tr></thead><tbody><tr><td> </td><td> </td><td> </td></tr><tr><td> </td><td> </td><td> </td></tr></tbody></table>';if(C.toString().trim()==="")z&&z.innerHTML.trim().replace(m.g.ZWSP,"")===""?z.outerHTML=re:document.execCommand("insertHTML",!1,re),C.selectNode(w.wysiwyg.element.querySelector("wbr").previousSibling),w.wysiwyg.element.querySelector("wbr").remove(),(0,M.Hc)(C);else{re='<table data-block="0"><thead><tr>';var ne=C.toString().split(`
  37. `),Q=ne[0].split(",").length>ne[0].split(" ").length?",":" ";ne.forEach(function(Te,Je){Je===0?(Te.split(Q).forEach(function(Ie,qe){re+=qe===0?"<th>"+Ie+"<wbr></th>":"<th>"+Ie+"</th>"}),re+="</tr></thead>"):(re+=Je===1?"<tbody><tr>":"<tr>",Te.split(Q).forEach(function(Ie){re+="<td>"+Ie+"</td>"}),re+="</tr>")}),re+="</tbody></table>",document.execCommand("insertHTML",!1,re),(0,M.ib)(w.wysiwyg.element,C)}j=!1,y.classList.add("vditor-menu--disabled")}else if(R==="line"){if(z){var le=`<hr data-block="0"><p data-block="0"><wbr>
  38. </p>`;z.innerHTML.trim()===""?z.outerHTML=le:z.insertAdjacentHTML("afterend",le),(0,M.ib)(w.wysiwyg.element,C)}}else if(j=!1,y.classList.add("vditor-menu--current"),R==="strike"&&(R="strikeThrough"),C.toString()!==""||R!=="bold"&&R!=="italic"&&R!=="strikeThrough")document.execCommand(R,!1,"");else{var be="strong";R==="italic"?be="em":R==="strikeThrough"&&(be="s"),(H=document.createElement(be)).textContent=m.g.ZWSP,C.insertNode(H),H.previousSibling&&H.previousSibling.textContent===m.g.ZWSP&&(H.previousSibling.textContent=""),C.setStart(H.firstChild,1),C.collapse(!0),(0,M.Hc)(C)}}j&&Ye(w),B&&we(w)}}(e,i.element.children[0],b):e.currentMode==="ir"?yr(e,i.element.children[0],t.prefix||"",t.suffix||""):cr(e,i.element.children[0],t.prefix||"",t.suffix||""))})},ar=(Qe=function(e,t){return Qe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var r in i)i.hasOwnProperty(r)&&(n[r]=i[r])},Qe(e,t)},function(e,t){function n(){this.constructor=e}Qe(e,t),e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}),et=function(e,t,n){var i;if(typeof n!="string"?(E(e,["subToolbar","hint"]),n.preventDefault(),i=u(e)):i=n,e.currentMode!==t||typeof n=="string"){if(e.devtools&&e.devtools.renderEchart(e),e.options.preview.mode==="both"&&t==="sv"?e.preview.element.style.display="block":e.preview.element.style.display="none",v(e.toolbar.elements,m.g.EDIT_TOOLBARS),c(e.toolbar.elements,m.g.EDIT_TOOLBARS),L(e.toolbar.elements,["outdent","indent"]),t==="ir")S(e.toolbar.elements,["both"]),_(e.toolbar.elements,["outdent","indent","outline","insert-before","insert-after"]),e.sv.element.style.display="none",e.wysiwyg.element.parentElement.style.display="none",e.ir.element.parentElement.style.display="block",e.lute.SetVditorIR(!0),e.lute.SetVditorWYSIWYG(!1),e.lute.SetVditorSV(!1),e.currentMode="ir",e.ir.element.innerHTML=e.lute.Md2VditorIRDOM(i),Xe(e,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),me(e),e.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function(o){ge(o,e)}),e.ir.element.querySelectorAll(".vditor-toc").forEach(function(o){(0,de.H)(o,{cdn:e.options.cdn,math:e.options.preview.math})});else if(t==="wysiwyg")S(e.toolbar.elements,["both"]),_(e.toolbar.elements,["outdent","indent","outline","insert-before","insert-after"]),e.sv.element.style.display="none",e.wysiwyg.element.parentElement.style.display="block",e.ir.element.parentElement.style.display="none",e.lute.SetVditorIR(!1),e.lute.SetVditorWYSIWYG(!0),e.lute.SetVditorSV(!1),e.currentMode="wysiwyg",me(e),sn(e,i,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),e.wysiwyg.element.querySelectorAll(".vditor-toc").forEach(function(o){(0,de.H)(o,{cdn:e.options.cdn,math:e.options.preview.math})}),e.wysiwyg.popover.style.display="none";else if(t==="sv"){_(e.toolbar.elements,["both"]),S(e.toolbar.elements,["outdent","indent","outline","insert-before","insert-after"]),e.wysiwyg.element.parentElement.style.display="none",e.ir.element.parentElement.style.display="none",(e.options.preview.mode==="both"||e.options.preview.mode==="editor")&&(e.sv.element.style.display="block"),e.lute.SetVditorIR(!1),e.lute.SetVditorWYSIWYG(!1),e.lute.SetVditorSV(!0),e.currentMode="sv";var r=dn(i,e);r==="<div data-block='0'></div>"&&(r=""),e.sv.element.innerHTML=r,Ce(e,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),me(e)}e.undo.resetIcon(e),typeof n!="string"&&(e[e.currentMode].element.focus(),it(e)),he(e),ye(e),e.toolbar.elements["edit-mode"]&&(e.toolbar.elements["edit-mode"].querySelectorAll("button").forEach(function(o){o.classList.remove("vditor-menu--current")}),e.toolbar.elements["edit-mode"].querySelector('button[data-mode="'+e.currentMode+'"]').classList.add("vditor-menu--current")),e.outline.toggle(e,e.currentMode!=="sv"&&e.options.outline.enable,typeof n!="string")}},sr=function(e){function t(n,i){var r=e.call(this,n,i)||this,o=document.createElement("div");return o.className="vditor-hint"+(i.level===2?"":" vditor-panel--arrow"),o.innerHTML='<button data-mode="wysiwyg">'+window.VditorI18n.wysiwyg+" &lt;"+(0,a.ns)("\u2325\u23187")+`></button>
  39. <button data-mode="ir">`+window.VditorI18n.instantRendering+" &lt;"+(0,a.ns)("\u2325\u23188")+`></button>
  40. <button data-mode="sv">`+window.VditorI18n.splitView+" &lt;"+(0,a.ns)("\u2325\u23189")+"></button>",r.element.appendChild(o),r._bindEvent(n,o,i),r}return ar(t,e),t.prototype._bindEvent=function(n,i,r){var o=this.element.children[0];k(n,i,o,r.level),i.children.item(0).addEventListener((0,a.Le)(),function(s){et(n,"wysiwyg",s),s.preventDefault(),s.stopPropagation()}),i.children.item(1).addEventListener((0,a.Le)(),function(s){et(n,"ir",s),s.preventDefault(),s.stopPropagation()}),i.children.item(2).addEventListener((0,a.Le)(),function(s){et(n,"sv",s),s.preventDefault(),s.stopPropagation()})},t}(Le),gt=function(e,t){return(0,M.Gb)(e,t)?getSelection().toString():""},qt=function(e,t){t.addEventListener("focus",function(){e.options.focus&&e.options.focus(u(e)),E(e,["subToolbar","hint"])})},ln=function(e,t){t.addEventListener("dblclick",function(n){n.target.tagName==="IMG"&&(e.options.image.preview?e.options.image.preview(n.target):e.options.image.isPreview&&(0,U.E)(n.target,e.options.lang,e.options.theme))})},Bt=function(e,t){t.addEventListener("blur",function(n){if(e.currentMode==="ir"){var i=e.ir.element.querySelector(".vditor-ir__node--expand");i&&i.classList.remove("vditor-ir__node--expand")}else e.currentMode!=="wysiwyg"||e.wysiwyg.selectPopover.contains(n.relatedTarget)||e.wysiwyg.hideComment();e[e.currentMode].range=(0,M.zh)(e),e.options.blur&&e.options.blur(u(e))})},Vt=function(e,t){t.addEventListener("dragstart",function(n){n.dataTransfer.setData(m.g.DROP_EDITOR,m.g.DROP_EDITOR)}),t.addEventListener("drop",function(n){n.dataTransfer.getData(m.g.DROP_EDITOR)?ue(e):(n.dataTransfer.types.includes("Files")||n.dataTransfer.types.includes("text/html"))&&Ht(e,n,{pasteCode:function(i){document.execCommand("insertHTML",!1,i)}})})},Ut=function(e,t,n){t.addEventListener("copy",function(i){return n(i,e)})},Wt=function(e,t,n){t.addEventListener("cut",function(i){n(i,e),e.options.comment.enable&&e.currentMode==="wysiwyg"&&e.wysiwyg.getComments(e),document.execCommand("delete")})},Me=function(e){if(e.currentMode==="wysiwyg"&&e.options.comment.enable&&e.options.comment.adjustTop(e.wysiwyg.getComments(e,!0)),e.options.typewriterMode){var t=e[e.currentMode].element,n=(0,M.Ny)(t).top;e.options.height!=="auto"||e.element.classList.contains("vditor--fullscreen")||window.scrollTo(window.scrollX,n+e.element.offsetTop+e.toolbar.element.offsetHeight-window.innerHeight/2+10),(e.options.height!=="auto"||e.element.classList.contains("vditor--fullscreen"))&&(t.scrollTop=n+t.scrollTop-t.clientHeight/2+10)}},zt=function(e,t){t.addEventListener("keydown",function(n){if(!n.isComposing&&e.options.keydown&&e.options.keydown(n),!(e.options.hint.extend.length>1||e.toolbar.elements.emoji)||!e.hint.select(n,e)){if(e.options.comment.enable&&e.currentMode==="wysiwyg"&&(n.key==="Backspace"||P("\u2318X",n))&&e.wysiwyg.getComments(e),e.currentMode==="sv"){if(function(r,o){var s,f,b,w,y;if(r.sv.composingLock=o.isComposing,o.isComposing||(o.key.indexOf("Arrow")!==-1||o.key==="Meta"||o.key==="Control"||o.key==="Alt"||o.key==="Shift"||o.key==="CapsLock"||o.key==="Escape"||/^F\d{1,2}$/.test(o.key)||r.undo.recordFirstPosition(r,o),o.key!=="Enter"&&o.key!=="Tab"&&o.key!=="Backspace"&&o.key.indexOf("Arrow")===-1&&!(0,a.yl)(o)&&o.key!=="Escape"))return!1;var x=(0,M.zh)(r),j=x.startContainer;x.startContainer.nodeType!==3&&x.startContainer.tagName==="DIV"&&(j=x.startContainer.childNodes[x.startOffset-1]);var B=(0,h.a1)(j,"data-type","text"),C=(0,h.a1)(j,"data-type","blockquote-marker");if(!C&&x.startOffset===0&&B&&B.previousElementSibling&&B.previousElementSibling.getAttribute("data-type")==="blockquote-marker"&&(C=B.previousElementSibling),C&&o.key==="Enter"&&!(0,a.yl)(o)&&!o.altKey&&C.nextElementSibling.textContent.trim()===""&&(0,M.im)(C,r.sv.element,x).start===C.textContent.length)return((s=C.previousElementSibling)===null||s===void 0?void 0:s.getAttribute("data-type"))==="padding"&&C.previousElementSibling.setAttribute("data-action","enter-remove"),C.remove(),Ce(r),o.preventDefault(),!0;var R=(0,h.a1)(j,"data-type","li-marker"),K=(0,h.a1)(j,"data-type","task-marker"),W=R;if(W||K&&K.nextElementSibling.getAttribute("data-type")!=="task-marker"&&(W=K),W||x.startOffset!==0||!B||!B.previousElementSibling||B.previousElementSibling.getAttribute("data-type")!=="li-marker"&&B.previousElementSibling.getAttribute("data-type")!=="task-marker"||(W=B.previousElementSibling),W){var z=(0,M.im)(W,r.sv.element,x).start,V=W.getAttribute("data-type")==="task-marker",H=W;if(V&&(H=W.previousElementSibling.previousElementSibling.previousElementSibling),z===W.textContent.length){if(o.key==="Enter"&&!(0,a.yl)(o)&&!o.altKey&&!o.shiftKey&&W.nextElementSibling.textContent.trim()==="")return((f=H.previousElementSibling)===null||f===void 0?void 0:f.getAttribute("data-type"))==="padding"?(H.previousElementSibling.remove(),se(r)):(V&&(H.remove(),W.previousElementSibling.previousElementSibling.remove(),W.previousElementSibling.remove()),W.nextElementSibling.remove(),W.remove(),Ce(r)),o.preventDefault(),!0;if(o.key==="Tab")return H.insertAdjacentHTML("beforebegin",'<span data-type="padding">'+H.textContent.replace(/\S/g," ")+"</span>"),/^\d/.test(H.textContent)&&(H.textContent=H.textContent.replace(/^\d{1,}/,"1"),x.selectNodeContents(W.firstChild),x.collapse(!1)),se(r),o.preventDefault(),!0}}if(Zt(r,x,o))return!0;var J=(0,h.a1)(j,"data-block","0"),ie=(0,N.S)(j,"SPAN");if(o.key==="Enter"&&!(0,a.yl)(o)&&!o.altKey&&!o.shiftKey&&J){var Y=!1,re=J.textContent.match(/^\n+/);(0,M.im)(J,r.sv.element).start<=(re?re[0].length:0)&&(Y=!0);var ne=`
  41. `;if(ie){if(((b=ie.previousElementSibling)===null||b===void 0?void 0:b.getAttribute("data-action"))==="enter-remove")return ie.previousElementSibling.remove(),Ce(r),o.preventDefault(),!0;ne+=lr(ie)}return x.insertNode(document.createTextNode(ne)),x.collapse(!1),J&&J.textContent.trim()!==""&&!Y?se(r):Ce(r),o.preventDefault(),!0}if(o.key==="Backspace"&&!(0,a.yl)(o)&&!o.altKey&&!o.shiftKey){if(ie&&((w=ie.previousElementSibling)===null||w===void 0?void 0:w.getAttribute("data-type"))==="newline"&&(0,M.im)(ie,r.sv.element,x).start===1&&ie.getAttribute("data-type").indexOf("code-block-")===-1)return x.setStart(ie,0),x.extractContents(),ie.textContent.trim()!==""?se(r):Ce(r),o.preventDefault(),!0;if(J&&(0,M.im)(J,r.sv.element,x).start===0&&J.previousElementSibling){x.extractContents();var Q=J.previousElementSibling.lastElementChild;return Q.getAttribute("data-type")==="newline"&&(Q.remove(),Q=J.previousElementSibling.lastElementChild),Q.getAttribute("data-type")!=="newline"&&(Q.insertAdjacentHTML("afterend",J.innerHTML),J.remove()),J.textContent.trim()===""||!((y=J.previousElementSibling)===null||y===void 0)&&y.querySelector('[data-type="code-block-open-marker"]')?(Q.getAttribute("data-type")!=="newline"&&(x.selectNodeContents(Q.lastChild),x.collapse(!1)),Ce(r)):se(r),o.preventDefault(),!0}}return!1}(e,n))return}else if(e.currentMode==="wysiwyg"){if(function(r,o){if(r.wysiwyg.composingLock=o.isComposing,o.isComposing)return!1;o.key.indexOf("Arrow")!==-1||o.key==="Meta"||o.key==="Control"||o.key==="Alt"||o.key==="Shift"||o.key==="CapsLock"||o.key==="Escape"||/^F\d{1,2}$/.test(o.key)||r.undo.recordFirstPosition(r,o);var s=(0,M.zh)(r),f=s.startContainer;if(!fn(o,r,f)||(hn(s,r,o),An(s),o.key!=="Enter"&&o.key!=="Tab"&&o.key!=="Backspace"&&o.key.indexOf("Arrow")===-1&&!(0,a.yl)(o)&&o.key!=="Escape"&&o.key!=="Delete"))return!1;var b=(0,h.F9)(f),w=(0,h.lG)(f,"P");if(wn(o,r,w,s)||bn(s,r,w,o)||Tn(r,o,s))return!0;var y=(0,h.fb)(f,"vditor-wysiwyg__block");if(y){if(o.key==="Escape"&&y.children.length===2)return r.wysiwyg.popover.style.display="none",y.firstElementChild.style.display="none",r.wysiwyg.element.blur(),o.preventDefault(),!0;if(!(0,a.yl)(o)&&!o.shiftKey&&o.altKey&&o.key==="Enter"&&y.getAttribute("data-type")==="code-block"){var x=r.wysiwyg.popover.querySelector(".vditor-input");return x.focus(),x.select(),o.preventDefault(),!0}if(y.getAttribute("data-block")==="0"&&(Mn(r,o,y.firstElementChild,s)||yt(r,o,s,y.firstElementChild,y)||y.getAttribute("data-type")!=="yaml-front-matter"&&ot(r,o,s,y.firstElementChild,y)))return!0}if(_n(r,s,o,w))return!0;var j=(0,h.E2)(f,"BLOCKQUOTE");if(j&&!o.shiftKey&&o.altKey&&o.key==="Enter"){(0,a.yl)(o)?s.setStartBefore(j):s.setStartAfter(j),(0,M.Hc)(s);var B=document.createElement("p");return B.setAttribute("data-block","0"),B.innerHTML=`
  42. `,s.insertNode(B),s.collapse(!0),(0,M.Hc)(s),we(r),Me(r),o.preventDefault(),!0}var C,R=(0,N.W)(f);if(R){if(R.tagName==="H6"&&f.textContent.length===s.startOffset&&!(0,a.yl)(o)&&!o.shiftKey&&!o.altKey&&o.key==="Enter"){var K=document.createElement("p");return K.textContent=`
  43. `,K.setAttribute("data-block","0"),f.parentElement.insertAdjacentElement("afterend",K),s.setStart(K,0),(0,M.Hc)(s),we(r),Me(r),o.preventDefault(),!0}var W;if(P("\u2318=",o))return(W=parseInt(R.tagName.substr(1),10)-1)>0&&(Lt(r,"h"+W),we(r)),o.preventDefault(),!0;if(P("\u2318-",o))return(W=parseInt(R.tagName.substr(1),10)+1)<7&&(Lt(r,"h"+W),we(r)),o.preventDefault(),!0;o.key!=="Backspace"||(0,a.yl)(o)||o.shiftKey||o.altKey||R.textContent.length!==1||jt(r)}if(Cn(r,s,o))return!0;if(o.altKey&&o.key==="Enter"&&!(0,a.yl)(o)&&!o.shiftKey){var z=(0,h.lG)(f,"A"),V=(0,h.a1)(f,"data-type","link-ref"),H=(0,h.a1)(f,"data-type","footnotes-ref");if(z||V||H||R&&R.tagName.length===2){var J=r.wysiwyg.popover.querySelector("input");J.focus(),J.select()}}if(Re(r,o))return!0;if(P("\u21E7\u2318U",o)&&(C=r.wysiwyg.popover.querySelector('[data-type="up"]'))||P("\u21E7\u2318D",o)&&(C=r.wysiwyg.popover.querySelector('[data-type="down"]')))return C.click(),o.preventDefault(),!0;if(Zt(r,s,o))return!0;if(!(0,a.yl)(o)&&o.shiftKey&&!o.altKey&&o.key==="Enter"&&f.parentElement.tagName!=="LI"&&f.parentElement.tagName!=="P")return["STRONG","STRIKE","S","I","EM","B"].includes(f.parentElement.tagName)?s.insertNode(document.createTextNode(`
  44. `+m.g.ZWSP)):s.insertNode(document.createTextNode(`
  45. `)),s.collapse(!1),(0,M.Hc)(s),we(r),Me(r),o.preventDefault(),!0;if(o.key==="Backspace"&&!(0,a.yl)(o)&&!o.shiftKey&&!o.altKey&&s.toString()===""){if(xn(r,s,o,w))return!0;if(b){if(b.previousElementSibling&&b.previousElementSibling.classList.contains("vditor-wysiwyg__block")&&b.previousElementSibling.getAttribute("data-block")==="0"&&b.tagName!=="UL"&&b.tagName!=="OL"){var ie=(0,M.im)(b,r.wysiwyg.element,s).start;if(ie===0&&s.startOffset===0||ie===1&&b.innerText.startsWith(m.g.ZWSP))return ht(b.previousElementSibling.lastElementChild,r,!1),b.innerHTML.trim().replace(m.g.ZWSP,"")===""&&(b.remove(),we(r)),o.preventDefault(),!0}var Y=s.startOffset;if(s.toString()===""&&f.nodeType===3&&f.textContent.charAt(Y-2)===`
  46. `&&f.textContent.charAt(Y-1)!==m.g.ZWSP&&["STRONG","STRIKE","S","I","EM","B"].includes(f.parentElement.tagName))return f.textContent=f.textContent.substring(0,Y-1)+m.g.ZWSP,s.setStart(f,Y),s.collapse(!0),we(r),o.preventDefault(),!0;f.textContent===m.g.ZWSP&&s.startOffset===1&&!f.previousSibling&&function(ne){for(var Q=ne.startContainer.nextSibling;Q&&Q.textContent==="";)Q=Q.nextSibling;return!(!Q||Q.nodeType===3||Q.tagName!=="CODE"&&Q.getAttribute("data-type")!=="math-inline"&&Q.getAttribute("data-type")!=="html-entity"&&Q.getAttribute("data-type")!=="html-inline")}(s)&&(f.textContent=""),b.querySelectorAll("span.vditor-wysiwyg__block[data-type='math-inline']").forEach(function(ne){ne.firstElementChild.style.display="inline",ne.lastElementChild.style.display="none"}),b.querySelectorAll("span.vditor-wysiwyg__block[data-type='html-entity']").forEach(function(ne){ne.firstElementChild.style.display="inline",ne.lastElementChild.style.display="none"})}}if((0,a.vU)()&&s.startOffset===1&&f.textContent.indexOf(m.g.ZWSP)>-1&&f.previousSibling&&f.previousSibling.nodeType!==3&&f.previousSibling.tagName==="CODE"&&(o.key==="Backspace"||o.key==="ArrowLeft"))return s.selectNodeContents(f.previousSibling),s.collapse(!1),o.preventDefault(),!0;if(Hn(o,b,s))return o.preventDefault(),!0;if(vn(s,o.key),o.key==="ArrowDown"){var re=f.nextSibling;re&&re.nodeType!==3&&re.getAttribute("data-type")==="math-inline"&&s.setStartAfter(re)}return!(!b||!A(b,r,o,s)||(o.preventDefault(),0))}(e,n))return}else if(e.currentMode==="ir"&&function(r,o){if(r.ir.composingLock=o.isComposing,o.isComposing)return!1;o.key.indexOf("Arrow")!==-1||o.key==="Meta"||o.key==="Control"||o.key==="Alt"||o.key==="Shift"||o.key==="CapsLock"||o.key==="Escape"||/^F\d{1,2}$/.test(o.key)||r.undo.recordFirstPosition(r,o);var s=(0,M.zh)(r),f=s.startContainer;if(!fn(o,r,f)||(hn(s,r,o),An(s),o.key!=="Enter"&&o.key!=="Tab"&&o.key!=="Backspace"&&o.key.indexOf("Arrow")===-1&&!(0,a.yl)(o)&&o.key!=="Escape"&&o.key!=="Delete"))return!1;var b=(0,h.a1)(f,"data-newline","1");if(!(0,a.yl)(o)&&!o.altKey&&!o.shiftKey&&o.key==="Enter"&&b&&s.startOffset<b.textContent.length){var w=b.previousElementSibling;w&&(s.insertNode(document.createTextNode(w.textContent)),s.collapse(!1));var y=b.nextSibling;y&&(s.insertNode(document.createTextNode(y.textContent)),s.collapse(!0))}var x=(0,h.lG)(f,"P");if(wn(o,r,x,s)||bn(s,r,x,o)||_n(r,s,o,x))return!0;var j=(0,h.fb)(f,"vditor-ir__marker--pre");if(j&&j.tagName==="PRE"){var B=j.firstChild;if(Mn(r,o,j,s)||(B.getAttribute("data-type")==="math-block"||B.getAttribute("data-type")==="html-block")&&ot(r,o,s,B,j.parentElement)||yt(r,o,s,B,j.parentElement))return!0}var C=(0,h.a1)(f,"data-type","code-block-info");if(C){if(o.key==="Enter"||o.key==="Tab")return s.selectNodeContents(C.nextElementSibling.firstChild),s.collapse(!0),o.preventDefault(),E(r,["hint"]),!0;if(o.key==="Backspace"){var R=(0,M.im)(C,r.ir.element).start;R===1&&s.setStart(f,0),R===2&&(r.hint.recentLanguage="")}if(ot(r,o,s,C,C.parentElement))return E(r,["hint"]),!0}var K=(0,h.lG)(f,"TD")||(0,h.lG)(f,"TH");if(o.key.indexOf("Arrow")>-1&&K){var W=vr(K);if(W&&ot(r,o,s,K,W))return!0;var z=gr(K);if(z&&yt(r,o,s,K,z))return!0}if(Tn(r,o,s)||Cn(r,s,o)||Zt(r,s,o))return!0;var V=(0,N.W)(f);if(V){var H;if(P("\u2318=",o))return(H=V.querySelector(".vditor-ir__marker--heading"))&&H.textContent.trim().length>1&&bt(r,H.textContent.substr(1)),o.preventDefault(),!0;if(P("\u2318-",o))return(H=V.querySelector(".vditor-ir__marker--heading"))&&H.textContent.trim().length<6&&bt(r,H.textContent.trim()+"# "),o.preventDefault(),!0}var J=(0,h.F9)(f);if(o.key==="Backspace"&&!(0,a.yl)(o)&&!o.shiftKey&&!o.altKey&&s.toString()===""){if(xn(r,s,o,x))return!0;if(J&&J.previousElementSibling&&J.tagName!=="UL"&&J.tagName!=="OL"&&(J.previousElementSibling.getAttribute("data-type")==="code-block"||J.previousElementSibling.getAttribute("data-type")==="math-block")){var ie=(0,M.im)(J,r.ir.element,s).start;if(ie===0||ie===1&&J.innerText.startsWith(m.g.ZWSP))return s.selectNodeContents(J.previousElementSibling.querySelector(".vditor-ir__marker--pre code")),s.collapse(!1),D(s,r),J.textContent.trim().replace(m.g.ZWSP,"")===""&&(J.remove(),Xe(r)),o.preventDefault(),!0}if(V){var Y=V.firstElementChild.textContent.length;(0,M.im)(V,r.ir.element).start===Y&&(s.setStart(V.firstElementChild.firstChild,Y-1),s.collapse(!0),(0,M.Hc)(s))}}return!((o.key!=="ArrowUp"&&o.key!=="ArrowDown"||!J||(J.querySelectorAll(".vditor-ir__node").forEach(function(re){re.contains(f)||re.classList.add("vditor-ir__node--hidden")}),!Hn(o,J,s)))&&(vn(s,o.key),!J||!A(J,r,o,s)||(o.preventDefault(),0)))}(e,n))return;if(e.options.ctrlEnter&&P("\u2318Enter",n))return e.options.ctrlEnter(u(e)),void n.preventDefault();if(P("\u2318Z",n)&&!e.toolbar.elements.undo)return e.undo.undo(e),void n.preventDefault();if(P("\u2318Y",n)&&!e.toolbar.elements.redo)return e.undo.redo(e),void n.preventDefault();if(n.key==="Escape")return e.hint.element.style.display==="block"?e.hint.element.style.display="none":e.options.esc&&!n.isComposing&&e.options.esc(u(e)),void n.preventDefault();if((0,a.yl)(n)&&n.altKey&&!n.shiftKey&&/^Digit[1-6]$/.test(n.code)){if(e.currentMode==="wysiwyg"){var i=n.code.replace("Digit","H");(0,h.lG)(getSelection().getRangeAt(0).startContainer,i)?jt(e):Lt(e,i),we(e)}else e.currentMode==="sv"?un(e,"#".repeat(parseInt(n.code.replace("Digit",""),10))+" "):e.currentMode==="ir"&&bt(e,"#".repeat(parseInt(n.code.replace("Digit",""),10))+" ");return n.preventDefault(),!0}if((0,a.yl)(n)&&n.altKey&&!n.shiftKey&&/^Digit[7-9]$/.test(n.code))return n.code==="Digit7"?et(e,"wysiwyg",n):n.code==="Digit8"?et(e,"ir",n):n.code==="Digit9"&&et(e,"sv",n),!0;e.options.toolbar.find(function(r){return!r.hotkey||r.toolbar?!!r.toolbar&&!!r.toolbar.find(function(o){return!!o.hotkey&&(P(o.hotkey,n)?(e.toolbar.elements[o.name].children[0].dispatchEvent(new CustomEvent((0,a.Le)())),n.preventDefault(),!0):void 0)}):P(r.hotkey,n)?(e.toolbar.elements[r.name].children[0].dispatchEvent(new CustomEvent((0,a.Le)())),n.preventDefault(),!0):void 0})}})},Kt=function(e,t){t.addEventListener("selectstart",function(n){t.onmouseup=function(){setTimeout(function(){var i=gt(e[e.currentMode].element);i.trim()?(e.currentMode==="wysiwyg"&&e.options.comment.enable&&((0,h.a1)(n.target,"data-type","footnotes-block")||(0,h.a1)(n.target,"data-type","link-ref-defs-block")?e.wysiwyg.hideComment():e.wysiwyg.showComment()),e.options.select&&e.options.select(i)):e.currentMode==="wysiwyg"&&e.options.comment.enable&&e.wysiwyg.hideComment()})}})},cn=function(e,t){var n=(0,M.zh)(e);n.extractContents(),n.insertNode(document.createTextNode(Lute.Caret)),n.insertNode(document.createTextNode(t));var i=(0,h.a1)(n.startContainer,"data-block","0");i||(i=e.sv.element);var r=e.lute.SpinVditorSVDOM(i.textContent);r=r.indexOf('data-type="footnotes-link"')>-1||r.indexOf('data-type="link-ref-defs-block"')>-1?"<div data-block='0'>"+r+"</div>":"<div data-block='0'>"+r.replace(/<span data-type="newline"><br \/><span style="display: none">\n<\/span><\/span><span data-type="newline"><br \/><span style="display: none">\n<\/span><\/span></g,`<span data-type="newline"><br /><span style="display: none">
  47. </span></span><span data-type="newline"><br /><span style="display: none">
  48. </span></span></div><div data-block="0"><`)+"</div>",i.isEqualNode(e.sv.element)?i.innerHTML=r:i.outerHTML=r,(0,M.ib)(e.sv.element,n),Me(e)},Tt=function(e,t,n){n===void 0&&(n=!0);var i=e;for(i.nodeType===3&&(i=i.parentElement);i;){if(i.getAttribute("data-type")===t)return i;i=n?i.previousElementSibling:i.nextElementSibling}return!1},dn=function(e,t){O("SpinVditorSVDOM",e,"argument",t.options.debugger);var n=t.lute.SpinVditorSVDOM(e);return e=n.indexOf('data-type="footnotes-link"')>-1||n.indexOf('data-type="link-ref-defs-block"')>-1?"<div data-block='0'>"+n+"</div>":"<div data-block='0'>"+n.replace(/<span data-type="newline"><br \/><span style="display: none">\n<\/span><\/span><span data-type="newline"><br \/><span style="display: none">\n<\/span><\/span></g,`<span data-type="newline"><br /><span style="display: none">
  49. </span></span><span data-type="newline"><br /><span style="display: none">
  50. </span></span></div><div data-block="0"><`)+"</div>",O("SpinVditorSVDOM",e,"result",t.options.debugger),e},lr=function(e){var t=e.getAttribute("data-type"),n=e.previousElementSibling,i=t&&t!=="text"&&t!=="table"&&t!=="heading-marker"&&t!=="newline"&&t!=="yaml-front-matter-open-marker"&&t!=="yaml-front-matter-close-marker"&&t!=="code-block-info"&&t!=="code-block-close-marker"&&t!=="code-block-open-marker"?e.textContent:"",r=!1;for(t==="newline"&&(r=!0);n&&!r;){var o=n.getAttribute("data-type");if(o==="li-marker"||o==="blockquote-marker"||o==="task-marker"||o==="padding"){var s=n.textContent;if(o!=="li-marker"||t!=="code-block-open-marker"&&t!=="code-block-info")if(t==="code-block-close-marker"&&n.nextElementSibling.isSameNode(e)){var f=Tt(e,"code-block-open-marker");f&&f.previousElementSibling&&(n=f.previousElementSibling,i=s+i)}else i=s+i;else i=s.replace(/\S/g," ")+i}else o==="newline"&&(r=!0);n=n.previousElementSibling}return i},Ce=function(e,t){t===void 0&&(t={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),t.enableHint&&e.hint.render(e),e.preview.render(e);var n=u(e);typeof e.options.input=="function"&&t.enableInput&&e.options.input(n),e.options.counter.enable&&e.counter.render(e,n),e.options.cache.enable&&(0,a.pK)()&&(localStorage.setItem(e.options.cache.id,n),e.options.cache.after&&e.options.cache.after(n)),e.devtools&&e.devtools.renderEchart(e),clearTimeout(e.sv.processTimeoutId),e.sv.processTimeoutId=window.setTimeout(function(){t.enableAddUndoStack&&!e.sv.composingLock&&e.undo.addToUndoStack(e)},e.options.undoDelay)},un=function(e,t){var n=(0,M.zh)(e),i=(0,N.S)(n.startContainer,"SPAN");i&&i.textContent.trim()!==""&&(t=`
  51. `+t),n.collapse(!0),document.execCommand("insertHTML",!1,t)},cr=function(e,t,n,i){var r=(0,M.zh)(e),o=t.getAttribute("data-type");e.sv.element.childNodes.length===0&&(e.sv.element.innerHTML=`<span data-type="p" data-block="0"><span data-type="text"><wbr></span></span><span data-type="newline"><br><span style="display: none">
  52. </span></span>`,(0,M.ib)(e.sv.element,r));var s=(0,h.F9)(r.startContainer),f=(0,N.S)(r.startContainer,"SPAN");if(s){if(o==="link"){var b=void 0;return b=r.toString()===""?""+n+Lute.Caret+i:""+n+r.toString()+i.replace(")",Lute.Caret+")"),void document.execCommand("insertHTML",!1,b)}if(o==="italic"||o==="bold"||o==="strike"||o==="inline-code"||o==="code"||o==="table"||o==="line")return b=void 0,b=r.toString()===""?""+n+Lute.Caret+(o==="code"?"":i):""+n+r.toString()+Lute.Caret+(o==="code"?"":i),o==="table"||o==="code"&&f&&f.textContent!==""?b=`
  53. `+b:o==="line"&&(b=`
  54. `+n+`
  55. `+Lute.Caret),void document.execCommand("insertHTML",!1,b);if((o==="check"||o==="list"||o==="ordered-list"||o==="quote")&&f){var w="* ";o==="check"?w="* [ ] ":o==="ordered-list"?w="1. ":o==="quote"&&(w="> ");var y=Tt(f,"newline");return y?y.insertAdjacentText("afterend",w):s.insertAdjacentText("afterbegin",w),void se(e)}(0,M.ib)(e.sv.element,r),Ce(e)}},pn=function(e){switch(e.currentMode){case"ir":return e.ir.element;case"wysiwyg":return e.wysiwyg.element;case"sv":return e.sv.element}},mn=function(e,t){e.options.upload.setHeaders&&(e.options.upload.headers=e.options.upload.setHeaders()),e.options.upload.headers&&Object.keys(e.options.upload.headers).forEach(function(n){t.setRequestHeader(n,e.options.upload.headers[n])})},dr=function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function s(w){try{b(i.next(w))}catch(y){o(y)}}function f(w){try{b(i.throw(w))}catch(y){o(y)}}function b(w){var y;w.done?r(w.value):(y=w.value,y instanceof n?y:new n(function(x){x(y)})).then(s,f)}b((i=i.apply(e,t||[])).next())})},ur=function(e,t){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function f(b){return function(w){return function(y){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=2&y[0]?i.return:y[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,y[1])).done)return r;switch(i=0,r&&(y=[2&y[0],r.value]),y[0]){case 0:case 1:r=y;break;case 4:return s.label++,{value:y[1],done:!1};case 5:s.label++,i=y[1],y=[0];continue;case 7:y=s.ops.pop(),s.trys.pop();continue;default:if(r=s.trys,!((r=r.length>0&&r[r.length-1])||y[0]!==6&&y[0]!==2)){s=0;continue}if(y[0]===3&&(!r||y[1]>r[0]&&y[1]<r[3])){s.label=y[1];break}if(y[0]===6&&s.label<r[1]){s.label=r[1],r=y;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(y);break}r[2]&&s.ops.pop(),s.trys.pop();continue}y=t.call(e,s)}catch(x){y=[6,x],i=0}finally{n=r=0}if(5&y[0])throw y[1];return{value:y[0]?y[1]:void 0,done:!0}}([b,w])}}},pr=function(){this.isUploading=!1,this.element=document.createElement("div"),this.element.className="vditor-upload"},Ft=function(e,t,n){return dr(void 0,void 0,void 0,function(){var i,r,o,s,f,b,w,y,x,j,B,C,R,K;return ur(this,function(W){switch(W.label){case 0:for(i=[],r=e.options.upload.multiple===!0?t.length:1,C=0;C<r;C++)(o=t[C])instanceof DataTransferItem&&(o=o.getAsFile()),i.push(o);return e.options.upload.handler?[4,e.options.upload.handler(i)]:[3,2];case 1:return s=W.sent(),n&&(n.value=""),typeof s=="string"?(e.tip.show(s),[2]):[2];case 2:return e.options.upload.url&&e.upload?e.options.upload.file?[4,e.options.upload.file(i)]:[3,4]:(n&&(n.value=""),e.tip.show("please config: options.upload.url"),[2]);case 3:i=W.sent(),W.label=4;case 4:if(e.options.upload.validate&&typeof(s=e.options.upload.validate(i))=="string")return e.tip.show(s),[2];if(f=pn(e),e.upload.range=(0,M.zh)(e),b=function(z,V){z.tip.hide();for(var H=[],J="",ie="",Y=(z.options.lang,z.options,function(Q,le){var be=V[le],Te=!0;be.name||(J+="<li>"+window.VditorI18n.nameEmpty+"</li>",Te=!1),be.size>z.options.upload.max&&(J+="<li>"+be.name+" "+window.VditorI18n.over+" "+z.options.upload.max/1024/1024+"M</li>",Te=!1);var Je=be.name.lastIndexOf("."),Ie=be.name.substr(Je),qe=z.options.upload.filename(be.name.substr(0,Je))+Ie;z.options.upload.accept&&(z.options.upload.accept.split(",").some(function(_e){var at=_e.trim();if(at.indexOf(".")===0){if(Ie.toLowerCase()===at.toLowerCase())return!0}else if(be.type.split("/")[0]===at.split("/")[0])return!0;return!1})||(J+="<li>"+be.name+" "+window.VditorI18n.fileTypeError+"</li>",Te=!1)),Te&&(H.push(be),ie+="<li>"+qe+" "+window.VditorI18n.uploading+"</li>")}),re=V.length,ne=0;ne<re;ne++)Y(0,ne);return z.tip.show("<ul>"+J+ie+"</ul>"),H}(e,i),b.length===0)return n&&(n.value=""),[2];for(w=new FormData,y=e.options.upload.extraData,x=0,j=Object.keys(y);x<j.length;x++)B=j[x],w.append(B,y[B]);for(C=0,R=b.length;C<R;C++)w.append(e.options.upload.fieldName,b[C]);return(K=new XMLHttpRequest).open("POST",e.options.upload.url),e.options.upload.token&&K.setRequestHeader("X-Upload-Token",e.options.upload.token),e.options.upload.withCredentials&&(K.withCredentials=!0),mn(e,K),e.upload.isUploading=!0,f.setAttribute("contenteditable","false"),K.onreadystatechange=function(){if(K.readyState===XMLHttpRequest.DONE){if(e.upload.isUploading=!1,f.setAttribute("contenteditable","true"),K.status>=200&&K.status<300)if(e.options.upload.success)e.options.upload.success(f,K.responseText);else{var z=K.responseText;e.options.upload.format&&(z=e.options.upload.format(t,K.responseText)),function(V,H){pn(H).focus();var J=JSON.parse(V),ie="";J.code===1&&(ie=""+J.msg),J.data.errFiles&&J.data.errFiles.length>0&&(ie="<ul><li>"+ie+"</li>",J.data.errFiles.forEach(function(re){var ne=re.lastIndexOf("."),Q=H.options.upload.filename(re.substr(0,ne))+re.substr(ne);ie+="<li>"+Q+" "+window.VditorI18n.uploadError+"</li>"}),ie+="</ul>"),ie?H.tip.show(ie):H.tip.hide();var Y="";Object.keys(J.data.succMap).forEach(function(re){var ne=J.data.succMap[re],Q=re.lastIndexOf("."),le=re.substr(Q),be=H.options.upload.filename(re.substr(0,Q))+le;(le=le.toLowerCase()).indexOf(".wav")===0||le.indexOf(".mp3")===0||le.indexOf(".ogg")===0?H.currentMode==="wysiwyg"?Y+=`<div class="vditor-wysiwyg__block" data-type="html-block"
  56. data-block="0"><pre><code>&lt;audio controls="controls" src="`+ne+'"&gt;&lt;/audio&gt;</code></pre><pre class="vditor-wysiwyg__preview" data-render="1"><audio controls="controls" src="'+ne+`"></audio></pre></div>
  57. `:H.currentMode==="ir"?Y+='<audio controls="controls" src="'+ne+`"></audio>
  58. `:Y+="["+be+"]("+ne+`)
  59. `:le.indexOf(".apng")===0||le.indexOf(".bmp")===0||le.indexOf(".gif")===0||le.indexOf(".ico")===0||le.indexOf(".cur")===0||le.indexOf(".jpg")===0||le.indexOf(".jpeg")===0||le.indexOf(".jfif")===0||le.indexOf(".pjp")===0||le.indexOf(".pjpeg")===0||le.indexOf(".png")===0||le.indexOf(".svg")===0||le.indexOf(".webp")===0?H.currentMode==="wysiwyg"?Y+='<img alt="'+be+'" src="'+ne+`">
  60. `:Y+="!["+be+"]("+ne+`)
  61. `:H.currentMode==="wysiwyg"?Y+='<a href="'+ne+'">'+be+`</a>
  62. `:Y+="["+be+"]("+ne+`)
  63. `}),(0,M.Hc)(H.upload.range),document.execCommand("insertHTML",!1,Y),H.upload.range=getSelection().getRangeAt(0).cloneRange()}(z,e)}else e.options.upload.error?e.options.upload.error(K.responseText):e.tip.show(K.responseText);n&&(n.value=""),e.upload.element.style.display="none"}},K.upload.onprogress=function(z){if(z.lengthComputable){var V=z.loaded/z.total*100;e.upload.element.style.display="block",e.upload.element.style.width=V+"%"}},K.send(w),[2]}})})},Mt=function(e,t,n){var i,r=(0,h.F9)(t.startContainer);if(r||(r=e.wysiwyg.element),n&&n.inputType!=="formatItalic"&&n.inputType!=="deleteByDrag"&&n.inputType!=="insertFromDrop"&&n.inputType!=="formatBold"&&n.inputType!=="formatRemove"&&n.inputType!=="formatStrikeThrough"&&n.inputType!=="insertUnorderedList"&&n.inputType!=="insertOrderedList"&&n.inputType!=="formatOutdent"&&n.inputType!=="formatIndent"&&n.inputType!==""||!n){var o=function(V){for(var H=V.previousSibling;H;){if(H.nodeType!==3&&H.tagName==="A"&&!H.previousSibling&&H.innerHTML.replace(m.g.ZWSP,"")===""&&H.nextSibling)return H;H=H.previousSibling}return!1}(t.startContainer);o&&o.remove(),e.wysiwyg.element.querySelectorAll("wbr").forEach(function(V){V.remove()}),t.insertNode(document.createElement("wbr")),r.querySelectorAll("[style]").forEach(function(V){V.removeAttribute("style")}),r.querySelectorAll(".vditor-comment").forEach(function(V){V.textContent.trim()===""&&(V.classList.remove("vditor-comment","vditor-comment--focus"),V.removeAttribute("data-cmtids"))}),(i=r.previousElementSibling)===null||i===void 0||i.querySelectorAll(".vditor-comment").forEach(function(V){V.textContent.trim()===""&&(V.classList.remove("vditor-comment","vditor-comment--focus"),V.removeAttribute("data-cmtids"))});var s="";r.getAttribute("data-type")==="link-ref-defs-block"&&(r=e.wysiwyg.element);var f,b=r.isEqualNode(e.wysiwyg.element),w=(0,h.a1)(r,"data-type","footnotes-block");if(b)s=r.innerHTML;else{var y=(0,h.O9)(t.startContainer);if(y&&!w){var x=(0,N.S)(t.startContainer,"BLOCKQUOTE");r=x?(0,h.F9)(t.startContainer)||r:y}if(w&&(r=w),s=r.outerHTML,r.tagName==="UL"||r.tagName==="OL"){var j=r.previousElementSibling,B=r.nextElementSibling;!j||j.tagName!=="UL"&&j.tagName!=="OL"||(s=j.outerHTML+s,j.remove()),!B||B.tagName!=="UL"&&B.tagName!=="OL"||(s+=B.outerHTML,B.remove()),s=s.replace("<div><wbr><br></div>","<li><p><wbr><br></p></li>")}r.innerText.startsWith("```")||(e.wysiwyg.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(V){V&&!r.isEqualNode(V)&&(s+=V.outerHTML,V.remove())}),e.wysiwyg.element.querySelectorAll("[data-type='footnotes-block']").forEach(function(V){V&&!r.isEqualNode(V)&&(s+=V.outerHTML,V.remove())}))}if((s=s.replace(/<\/(strong|b)><strong data-marker="\W{2}">/g,"").replace(/<\/(em|i)><em data-marker="\W{1}">/g,"").replace(/<\/(s|strike)><s data-marker="~{1,2}">/g,""))==='<p data-block="0">```<wbr></p>'&&e.hint.recentLanguage&&(s='<p data-block="0">```<wbr></p>'.replace("```","```"+e.hint.recentLanguage)),O("SpinVditorDOM",s,"argument",e.options.debugger),s=e.lute.SpinVditorDOM(s),O("SpinVditorDOM",s,"result",e.options.debugger),b)r.innerHTML=s;else if(r.outerHTML=s,w){var C=(0,h.E2)(e.wysiwyg.element.querySelector("wbr"),"LI");if(C){var R=e.wysiwyg.element.querySelector('sup[data-type="footnotes-ref"][data-footnotes-label="'+C.getAttribute("data-marker")+'"]');R&&R.setAttribute("aria-label",C.textContent.trim().substr(0,24))}}var K,W=e.wysiwyg.element.querySelectorAll("[data-type='link-ref-defs-block']");W.forEach(function(V,H){H===0?f=V:(f.insertAdjacentHTML("beforeend",V.innerHTML),V.remove())}),W.length>0&&e.wysiwyg.element.insertAdjacentElement("beforeend",W[0]);var z=e.wysiwyg.element.querySelectorAll("[data-type='footnotes-block']");z.forEach(function(V,H){H===0?K=V:(K.insertAdjacentHTML("beforeend",V.innerHTML),V.remove())}),z.length>0&&e.wysiwyg.element.insertAdjacentElement("beforeend",z[0]),(0,M.ib)(e.wysiwyg.element,t),e.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview[data-render='2']").forEach(function(V){ge(V,e)}),n&&(n.inputType==="deleteContentBackward"||n.inputType==="deleteContentForward")&&e.options.comment.enable&&(e.wysiwyg.triggerRemoveComment(e),e.options.comment.adjustTop(e.wysiwyg.getComments(e,!0)))}he(e),we(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})},mr=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},fr=function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function s(w){try{b(i.next(w))}catch(y){o(y)}}function f(w){try{b(i.throw(w))}catch(y){o(y)}}function b(w){var y;w.done?r(w.value):(y=w.value,y instanceof n?y:new n(function(x){x(y)})).then(s,f)}b((i=i.apply(e,t||[])).next())})},hr=function(e,t){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function f(b){return function(w){return function(y){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=2&y[0]?i.return:y[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,y[1])).done)return r;switch(i=0,r&&(y=[2&y[0],r.value]),y[0]){case 0:case 1:r=y;break;case 4:return s.label++,{value:y[1],done:!1};case 5:s.label++,i=y[1],y=[0];continue;case 7:y=s.ops.pop(),s.trys.pop();continue;default:if(r=s.trys,!((r=r.length>0&&r[r.length-1])||y[0]!==6&&y[0]!==2)){s=0;continue}if(y[0]===3&&(!r||y[1]>r[0]&&y[1]<r[3])){s.label=y[1];break}if(y[0]===6&&s.label<r[1]){s.label=r[1],r=y;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(y);break}r[2]&&s.ops.pop(),s.trys.pop();continue}y=t.call(e,s)}catch(x){y=[6,x],i=0}finally{n=r=0}if(5&y[0])throw y[1];return{value:y[0]?y[1]:void 0,done:!0}}([b,w])}}},fn=function(e,t,n){if(e.keyCode===229&&e.code===""&&e.key==="Unidentified"&&t.currentMode!=="sv"){var i=(0,h.F9)(n);if(i&&i.textContent.trim()==="")return t[t.currentMode].composingLock=!0,!1}return!0},hn=function(e,t,n){if(!(n.key==="Enter"||n.key==="Tab"||n.key==="Backspace"||n.key.indexOf("Arrow")>-1||(0,a.yl)(n)||n.key==="Escape"||n.shiftKey||n.altKey)){var i=(0,h.lG)(e.startContainer,"P")||(0,h.lG)(e.startContainer,"LI");if(i&&(0,M.im)(i,t[t.currentMode].element,e).start===0){i.nodeValue&&(i.nodeValue=i.nodeValue.replace(/\u2006/g,""));var r=document.createTextNode(m.g.ZWSP);e.insertNode(r),e.setStartAfter(r)}}},vn=function(e,t){if(t==="ArrowDown"||t==="ArrowUp"){var n=(0,h.a1)(e.startContainer,"data-type","math-inline")||(0,h.a1)(e.startContainer,"data-type","html-entity")||(0,h.a1)(e.startContainer,"data-type","html-inline");n&&(t==="ArrowDown"&&e.setStartAfter(n.parentElement),t==="ArrowUp"&&e.setStartBefore(n.parentElement))}},_t=function(e,t){var n=(0,M.zh)(e),i=(0,h.F9)(n.startContainer);i&&(i.insertAdjacentHTML(t,'<p data-block="0">'+m.g.ZWSP+`<wbr>
  64. </p>`),(0,M.ib)(e[e.currentMode].element,n),it(e),ue(e))},vr=function(e){var t=(0,h.lG)(e,"TABLE");return!(!t||!t.rows[0].cells[0].isSameNode(e))&&t},gr=function(e){var t=(0,h.lG)(e,"TABLE");return!(!t||!t.lastElementChild.lastElementChild.lastElementChild.isSameNode(e))&&t},gn=function(e,t,n){n===void 0&&(n=!0);var i=e.previousElementSibling;return i||(i=e.parentElement.previousElementSibling?e.parentElement.previousElementSibling.lastElementChild:e.parentElement.parentElement.tagName==="TBODY"&&e.parentElement.parentElement.previousElementSibling?e.parentElement.parentElement.previousElementSibling.lastElementChild.lastElementChild:null),i&&(t.selectNodeContents(i),n||t.collapse(!1),(0,M.Hc)(t)),i},yt=function(e,t,n,i,r){var o=(0,M.im)(i,e[e.currentMode].element,n);if(t.key==="ArrowDown"&&i.textContent.trimRight().substr(o.start).indexOf(`
  65. `)===-1||t.key==="ArrowRight"&&o.start>=i.textContent.trimRight().length){var s=r.nextElementSibling;return!s||s&&(s.tagName==="TABLE"||s.getAttribute("data-type"))?(r.insertAdjacentHTML("afterend",'<p data-block="0">'+m.g.ZWSP+"<wbr></p>"),(0,M.ib)(e[e.currentMode].element,n)):(n.selectNodeContents(s),n.collapse(!0),(0,M.Hc)(n)),t.preventDefault(),!0}return!1},ot=function(e,t,n,i,r){var o=(0,M.im)(i,e[e.currentMode].element,n);if(t.key==="ArrowUp"&&i.textContent.substr(0,o.start).indexOf(`
  66. `)===-1||(t.key==="ArrowLeft"||t.key==="Backspace"&&n.toString()==="")&&o.start===0){var s=r.previousElementSibling;return!s||s&&(s.tagName==="TABLE"||s.getAttribute("data-type"))?(r.insertAdjacentHTML("beforebegin",'<p data-block="0">'+m.g.ZWSP+"<wbr></p>"),(0,M.ib)(e[e.currentMode].element,n)):(n.selectNodeContents(s),n.collapse(!1),(0,M.Hc)(n)),t.preventDefault(),!0}return!1},Ct=function(e,t,n,i){i===void 0&&(i=!0);var r=(0,h.lG)(t.startContainer,"LI");if(e[e.currentMode].element.querySelectorAll("wbr").forEach(function(y){y.remove()}),t.insertNode(document.createElement("wbr")),i&&r){for(var o="",s=0;s<r.parentElement.childElementCount;s++){var f=r.parentElement.children[s].querySelector("input");f&&f.remove(),o+='<p data-block="0">'+r.parentElement.children[s].innerHTML.trimLeft()+"</p>"}r.parentElement.insertAdjacentHTML("beforebegin",o),r.parentElement.remove()}else if(r)if(n==="check")r.parentElement.querySelectorAll("li").forEach(function(y){y.insertAdjacentHTML("afterbegin",'<input type="checkbox" />'+(y.textContent.indexOf(" ")===0?"":" ")),y.classList.add("vditor-task")});else{r.querySelector("input")&&r.parentElement.querySelectorAll("li").forEach(function(y){y.querySelector("input").remove(),y.classList.remove("vditor-task")});var b=void 0;n==="list"?(b=document.createElement("ul")).setAttribute("data-marker","*"):(b=document.createElement("ol")).setAttribute("data-marker","1."),b.setAttribute("data-block","0"),b.setAttribute("data-tight",r.parentElement.getAttribute("data-tight")),b.innerHTML=r.parentElement.innerHTML,r.parentElement.parentNode.replaceChild(b,r.parentElement)}else{var w=(0,h.a1)(t.startContainer,"data-block","0");w||(e[e.currentMode].element.querySelector("wbr").remove(),(w=e[e.currentMode].element.querySelector("p")).innerHTML="<wbr>"),n==="check"?(w.insertAdjacentHTML("beforebegin",'<ul data-block="0"><li class="vditor-task"><input type="checkbox" /> '+w.innerHTML+"</li></ul>"),w.remove()):n==="list"?(w.insertAdjacentHTML("beforebegin",'<ul data-block="0"><li>'+w.innerHTML+"</li></ul>"),w.remove()):n==="ordered-list"&&(w.insertAdjacentHTML("beforebegin",'<ol data-block="0"><li>'+w.innerHTML+"</li></ol>"),w.remove())}},yn=function(e,t,n){var i=t.previousElementSibling;if(t&&i){var r=[t];Array.from(n.cloneContents().children).forEach(function(b,w){b.nodeType!==3&&t&&b.textContent.trim()!==""&&t.getAttribute("data-node-id")===b.getAttribute("data-node-id")&&(w!==0&&r.push(t),t=t.nextElementSibling)}),e[e.currentMode].element.querySelectorAll("wbr").forEach(function(b){b.remove()}),n.insertNode(document.createElement("wbr"));var o=i.parentElement,s="";r.forEach(function(b){var w=b.getAttribute("data-marker");w.length!==1&&(w="1"+w.slice(-1)),s+='<li data-node-id="'+b.getAttribute("data-node-id")+'" data-marker="'+w+'">'+b.innerHTML+"</li>",b.remove()}),i.insertAdjacentHTML("beforeend","<"+o.tagName+' data-block="0">'+s+"</"+o.tagName+">"),e.currentMode==="wysiwyg"?o.outerHTML=e.lute.SpinVditorDOM(o.outerHTML):o.outerHTML=e.lute.SpinVditorIRDOM(o.outerHTML),(0,M.ib)(e[e.currentMode].element,n);var f=(0,h.O9)(n.startContainer);f&&f.querySelectorAll(".vditor-"+e.currentMode+"__preview[data-render='2']").forEach(function(b){ge(b,e),e.currentMode==="wysiwyg"&&b.previousElementSibling.setAttribute("style","display:none")}),ue(e),it(e)}else e[e.currentMode].element.focus()},Gt=function(e,t,n,i){var r=(0,h.lG)(t.parentElement,"LI");if(r){e[e.currentMode].element.querySelectorAll("wbr").forEach(function(x){x.remove()}),n.insertNode(document.createElement("wbr"));var o=t.parentElement,s=o.cloneNode(),f=[t];Array.from(n.cloneContents().children).forEach(function(x,j){x.nodeType!==3&&t&&x.textContent.trim()!==""&&t.getAttribute("data-node-id")===x.getAttribute("data-node-id")&&(j!==0&&f.push(t),t=t.nextElementSibling)});var b=!1,w="";o.querySelectorAll("li").forEach(function(x){b&&(w+=x.outerHTML,x.nextElementSibling||x.previousElementSibling?x.remove():x.parentElement.remove()),x.isSameNode(f[f.length-1])&&(b=!0)}),f.reverse().forEach(function(x){r.insertAdjacentElement("afterend",x)}),w&&(s.innerHTML=w,f[0].insertAdjacentElement("beforeend",s)),e.currentMode==="wysiwyg"?i.outerHTML=e.lute.SpinVditorDOM(i.outerHTML):i.outerHTML=e.lute.SpinVditorIRDOM(i.outerHTML),(0,M.ib)(e[e.currentMode].element,n);var y=(0,h.O9)(n.startContainer);y&&y.querySelectorAll(".vditor-"+e.currentMode+"__preview[data-render='2']").forEach(function(x){ge(x,e),e.currentMode==="wysiwyg"&&x.previousElementSibling.setAttribute("style","display:none")}),ue(e),it(e)}else e[e.currentMode].element.focus()},xt=function(e,t){for(var n=getSelection().getRangeAt(0).startContainer.parentElement,i=e.rows[0].cells.length,r=e.rows.length,o=0,s=0;s<r;s++)for(var f=0;f<i;f++)if(e.rows[s].cells[f].isSameNode(n)){o=f;break}for(var b=0;b<r;b++)e.rows[b].cells[o].setAttribute("align",t)},Xt=function(e){var t=e.trimRight().split(`
  67. `).pop();return t!==""&&(t.replace(/ |-/g,"")===""||t.replace(/ |_/g,"")===""||t.replace(/ |\*/g,"")==="")&&t.replace(/ /g,"").length>2&&!(t.indexOf("-")>-1&&t.trimLeft().indexOf(" ")===-1&&e.trimRight().split(`
  68. `).length>1)&&t.indexOf(" ")!==0&&t.indexOf(" ")!==0},Jt=function(e){var t=e.trimRight().split(`
  69. `);return(e=t.pop()).indexOf(" ")!==0&&e.indexOf(" ")!==0&&(e=e.trimLeft())!==""&&t.length!==0&&(e.replace(/-/g,"")===""||e.replace(/=/g,"")==="")},ue=function(e,t){t===void 0&&(t={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),e.currentMode==="wysiwyg"?we(e,t):e.currentMode==="ir"?Xe(e,t):e.currentMode==="sv"&&Ce(e,t)},bn=function(e,t,n,i){var r,o=e.startContainer,s=(0,h.lG)(o,"LI");if(s){if(!(0,a.yl)(i)&&!i.altKey&&i.key==="Enter"&&!i.shiftKey&&n&&s.contains(n)&&n.nextElementSibling)return s&&!s.textContent.endsWith(`
  70. `)&&s.insertAdjacentText("beforeend",`
  71. `),e.insertNode(document.createTextNode(`
  72. `)),e.collapse(!1),ue(t),i.preventDefault(),!0;if(!((0,a.yl)(i)||i.shiftKey||i.altKey||i.key!=="Backspace"||s.previousElementSibling||e.toString()!==""||(0,M.im)(s,t[t.currentMode].element,e).start!==0))return s.nextElementSibling?(s.parentElement.insertAdjacentHTML("beforebegin",'<p data-block="0"><wbr>'+s.innerHTML+"</p>"),s.remove()):s.parentElement.outerHTML='<p data-block="0"><wbr>'+s.innerHTML+"</p>",(0,M.ib)(t[t.currentMode].element,e),ue(t),i.preventDefault(),!0;if(!(0,a.yl)(i)&&!i.shiftKey&&!i.altKey&&i.key==="Backspace"&&s.textContent.trim().replace(m.g.ZWSP,"")===""&&e.toString()===""&&((r=s.previousElementSibling)===null||r===void 0?void 0:r.tagName)==="LI")return s.previousElementSibling.insertAdjacentText("beforeend",`
  73. `),e.selectNodeContents(s.previousElementSibling),e.collapse(!1),s.remove(),(0,M.ib)(t[t.currentMode].element,e),ue(t),i.preventDefault(),!0;if(!(0,a.yl)(i)&&!i.altKey&&i.key==="Tab"){var f=!1;if((e.startOffset===0&&(o.nodeType===3&&!o.previousSibling||o.nodeType!==3&&o.nodeName==="LI")||s.classList.contains("vditor-task")&&e.startOffset===1&&o.previousSibling.nodeType!==3&&o.previousSibling.tagName==="INPUT")&&(f=!0),f||e.toString()!=="")return i.shiftKey?Gt(t,s,e,s.parentElement):yn(t,s,e),i.preventDefault(),!0}}return!1},Zt=function(e,t,n){if(e.options.tab&&n.key==="Tab")return n.shiftKey||(t.toString()===""?(t.insertNode(document.createTextNode(e.options.tab)),t.collapse(!1)):(t.extractContents(),t.insertNode(document.createTextNode(e.options.tab)),t.collapse(!1))),(0,M.Hc)(t),ue(e),n.preventDefault(),!0},wn=function(e,t,n,i){if(n){if(!(0,a.yl)(e)&&!e.altKey&&e.key==="Enter"){var r=String.raw(tn||(tn=mr(["",""],["",""])),n.textContent).replace(/\\\|/g,"").trim(),o=r.split("|");if(r.startsWith("|")&&r.endsWith("|")&&o.length>3){var s=o.map(function(){return"---"}).join("|");return s=n.textContent+`
  74. `+s.substring(3,s.length-3)+`
  75. |<wbr>`,n.outerHTML=t.lute.SpinVditorDOM(s),(0,M.ib)(t[t.currentMode].element,i),ue(t),Me(t),e.preventDefault(),!0}if(Xt(n.innerHTML)&&n.previousElementSibling){var f="",b=n.innerHTML.trimRight().split(`
  76. `);return b.length>1&&(b.pop(),f='<p data-block="0">'+b.join(`
  77. `)+"</p>"),n.insertAdjacentHTML("afterend",f+`<hr data-block="0"><p data-block="0"><wbr>
  78. </p>`),n.remove(),(0,M.ib)(t[t.currentMode].element,i),ue(t),Me(t),e.preventDefault(),!0}if(Jt(n.innerHTML))return t.currentMode==="wysiwyg"?n.outerHTML=t.lute.SpinVditorDOM(n.innerHTML+`<p data-block="0"><wbr>
  79. </p>`):n.outerHTML=t.lute.SpinVditorIRDOM(n.innerHTML+`<p data-block="0"><wbr>
  80. </p>`),(0,M.ib)(t[t.currentMode].element,i),ue(t),Me(t),e.preventDefault(),!0}if(i.collapsed&&n.previousElementSibling&&e.key==="Backspace"&&!(0,a.yl)(e)&&!e.altKey&&!e.shiftKey&&n.textContent.trimRight().split(`
  81. `).length>1&&(0,M.im)(n,t[t.currentMode].element,i).start===0){var w=(0,h.DX)(n.previousElementSibling);return w.textContent.endsWith(`
  82. `)||(w.textContent=w.textContent+`
  83. `),w.parentElement.insertAdjacentHTML("beforeend","<wbr>"+n.innerHTML),n.remove(),(0,M.ib)(t[t.currentMode].element,i),!1}return!1}},En=function(e,t,n){for(var i="",r=0;r<n.parentElement.childElementCount;r++)i+='<td align="'+n.parentElement.children[r].getAttribute("align")+'"> </td>';n.tagName==="TH"?n.parentElement.parentElement.insertAdjacentHTML("afterend","<tbody><tr>"+i+"</tr></tbody>"):n.parentElement.insertAdjacentHTML("afterend","<tr>"+i+"</tr>"),ue(e)},Sn=function(e,t,n){for(var i="",r=0;r<n.parentElement.childElementCount;r++)n.tagName==="TH"?i+='<th align="'+n.parentElement.children[r].getAttribute("align")+'"> </th>':i+='<td align="'+n.parentElement.children[r].getAttribute("align")+'"> </td>';if(n.tagName==="TH"){n.parentElement.parentElement.insertAdjacentHTML("beforebegin","<thead><tr>"+i+"</tr></thead>"),t.insertNode(document.createElement("wbr"));var o=n.parentElement.innerHTML.replace(/<th>/g,"<td>").replace(/<\/th>/g,"</td>");n.parentElement.parentElement.nextElementSibling.insertAdjacentHTML("afterbegin",o),n.parentElement.parentElement.remove(),(0,M.ib)(e.ir.element,t)}else n.parentElement.insertAdjacentHTML("beforebegin","<tr>"+i+"</tr>");ue(e)},At=function(e,t,n,i){i===void 0&&(i="afterend");for(var r=0,o=n.previousElementSibling;o;)r++,o=o.previousElementSibling;for(var s=0;s<t.rows.length;s++)s===0?t.rows[s].cells[r].insertAdjacentHTML(i,"<th> </th>"):t.rows[s].cells[r].insertAdjacentHTML(i,"<td> </td>");ue(e)},kn=function(e,t,n){if(n.tagName==="TD"){var i=n.parentElement.parentElement;n.parentElement.previousElementSibling?t.selectNodeContents(n.parentElement.previousElementSibling.lastElementChild):t.selectNodeContents(i.previousElementSibling.lastElementChild.lastElementChild),i.childElementCount===1?i.remove():n.parentElement.remove(),t.collapse(!1),(0,M.Hc)(t),ue(e)}},Ln=function(e,t,n,i){for(var r=0,o=i.previousElementSibling;o;)r++,o=o.previousElementSibling;(i.previousElementSibling||i.nextElementSibling)&&(t.selectNodeContents(i.previousElementSibling||i.nextElementSibling),t.collapse(!0));for(var s=0;s<n.rows.length;s++){var f=n.rows[s].cells;if(f.length===1){n.remove(),it(e);break}f[r].remove()}(0,M.Hc)(t),ue(e)},Tn=function(e,t,n){var i=n.startContainer,r=(0,h.lG)(i,"TD")||(0,h.lG)(i,"TH");if(r){if(!(0,a.yl)(t)&&!t.altKey&&t.key==="Enter"){r.lastElementChild&&(!r.lastElementChild||r.lastElementChild.isSameNode(r.lastChild)&&r.lastElementChild.tagName==="BR")||r.insertAdjacentHTML("beforeend","<br>");var o=document.createElement("br");return n.insertNode(o),n.setStartAfter(o),ue(e),Me(e),t.preventDefault(),!0}if(t.key==="Tab")return t.shiftKey?(gn(r,n),t.preventDefault(),!0):((y=r.nextElementSibling)||(y=r.parentElement.nextElementSibling?r.parentElement.nextElementSibling.firstElementChild:r.parentElement.parentElement.tagName==="THEAD"&&r.parentElement.parentElement.nextElementSibling?r.parentElement.parentElement.nextElementSibling.firstElementChild.firstElementChild:null),y&&(n.selectNodeContents(y),(0,M.Hc)(n)),t.preventDefault(),!0);var s=r.parentElement.parentElement.parentElement;if(t.key==="ArrowUp"){if(t.preventDefault(),r.tagName==="TH")return s.previousElementSibling?(n.selectNodeContents(s.previousElementSibling),n.collapse(!1),(0,M.Hc)(n)):_t(e,"beforebegin"),!0;for(var f=0,b=r.parentElement;f<b.cells.length&&!b.cells[f].isSameNode(r);f++);var w=b.previousElementSibling;return w||(w=b.parentElement.previousElementSibling.firstChild),n.selectNodeContents(w.cells[f]),n.collapse(!1),(0,M.Hc)(n),!0}if(t.key==="ArrowDown"){var y;if(t.preventDefault(),!(b=r.parentElement).nextElementSibling&&r.tagName==="TD")return s.nextElementSibling?(n.selectNodeContents(s.nextElementSibling),n.collapse(!0),(0,M.Hc)(n)):_t(e,"afterend"),!0;for(f=0;f<b.cells.length&&!b.cells[f].isSameNode(r);f++);return(y=b.nextElementSibling)||(y=b.parentElement.nextElementSibling.firstChild),n.selectNodeContents(y.cells[f]),n.collapse(!0),(0,M.Hc)(n),!0}if(e.currentMode==="wysiwyg"&&!(0,a.yl)(t)&&t.key==="Enter"&&!t.shiftKey&&t.altKey){var x=e.wysiwyg.popover.querySelector(".vditor-input");return x.focus(),x.select(),t.preventDefault(),!0}if(!(0,a.yl)(t)&&!t.shiftKey&&!t.altKey&&t.key==="Backspace"&&n.startOffset===0&&n.toString()==="")return!gn(r,n,!1)&&s&&(s.textContent.trim()===""?(s.outerHTML=`<p data-block="0"><wbr>
  84. </p>`,(0,M.ib)(e[e.currentMode].element,n)):(n.setStartBefore(s),n.collapse(!0)),ue(e)),t.preventDefault(),!0;if(P("\u21E7\u2318F",t))return Sn(e,n,r),t.preventDefault(),!0;if(P("\u2318=",t))return En(e,n,r),t.preventDefault(),!0;if(P("\u21E7\u2318G",t))return At(e,s,r,"beforebegin"),t.preventDefault(),!0;if(P("\u21E7\u2318=",t))return At(e,s,r),t.preventDefault(),!0;if(P("\u2318-",t))return kn(e,n,r),t.preventDefault(),!0;if(P("\u21E7\u2318-",t))return Ln(e,n,s,r),t.preventDefault(),!0;if(P("\u21E7\u2318L",t)){if(e.currentMode==="ir")return xt(s,"left"),ue(e),t.preventDefault(),!0;if(j=e.wysiwyg.popover.querySelector('[data-type="left"]'))return j.click(),t.preventDefault(),!0}if(P("\u21E7\u2318C",t)){if(e.currentMode==="ir")return xt(s,"center"),ue(e),t.preventDefault(),!0;if(j=e.wysiwyg.popover.querySelector('[data-type="center"]'))return j.click(),t.preventDefault(),!0}if(P("\u21E7\u2318R",t)){if(e.currentMode==="ir")return xt(s,"right"),ue(e),t.preventDefault(),!0;var j;if(j=e.wysiwyg.popover.querySelector('[data-type="right"]'))return j.click(),t.preventDefault(),!0}}return!1},Mn=function(e,t,n,i){if(n.tagName==="PRE"&&P("\u2318A",t))return i.selectNodeContents(n.firstElementChild),t.preventDefault(),!0;if(e.options.tab&&t.key==="Tab"&&!t.shiftKey&&i.toString()==="")return i.insertNode(document.createTextNode(e.options.tab)),i.collapse(!1),ue(e),t.preventDefault(),!0;if(t.key==="Backspace"&&!(0,a.yl)(t)&&!t.shiftKey&&!t.altKey){var r=(0,M.im)(n,e[e.currentMode].element,i);if((r.start===0||r.start===1&&n.innerText===`
  85. `)&&i.toString()==="")return n.parentElement.outerHTML='<p data-block="0"><wbr>'+n.firstElementChild.innerHTML+"</p>",(0,M.ib)(e[e.currentMode].element,i),ue(e),t.preventDefault(),!0}return!(0,a.yl)(t)&&!t.altKey&&t.key==="Enter"&&(n.firstElementChild.textContent.endsWith(`
  86. `)||n.firstElementChild.insertAdjacentText("beforeend",`
  87. `),i.extractContents(),i.insertNode(document.createTextNode(`
  88. `)),i.collapse(!1),(0,M.Hc)(i),(0,a.vU)()||(e.currentMode==="wysiwyg"?Mt(e,i):q(e,i)),Me(e),t.preventDefault(),!0)},_n=function(e,t,n,i){var r=t.startContainer,o=(0,h.lG)(r,"BLOCKQUOTE");if(o&&t.toString()===""){if(n.key==="Backspace"&&!(0,a.yl)(n)&&!n.shiftKey&&!n.altKey&&(0,M.im)(o,e[e.currentMode].element,t).start===0)return t.insertNode(document.createElement("wbr")),o.outerHTML=o.innerHTML,(0,M.ib)(e[e.currentMode].element,t),ue(e),n.preventDefault(),!0;if(i&&n.key==="Enter"&&!(0,a.yl)(n)&&!n.shiftKey&&!n.altKey&&i.parentElement.tagName==="BLOCKQUOTE"){var s=!1;if(i.innerHTML.replace(m.g.ZWSP,"")===`
  89. `||i.innerHTML.replace(m.g.ZWSP,"")===""?(s=!0,i.remove()):i.innerHTML.endsWith(`
  90. `)&&(0,M.im)(i,e[e.currentMode].element,t).start===i.textContent.length-1&&(i.innerHTML=i.innerHTML.substr(0,i.innerHTML.length-2),s=!0),s)return o.insertAdjacentHTML("afterend",'<p data-block="0">'+m.g.ZWSP+`<wbr>
  91. </p>`),(0,M.ib)(e[e.currentMode].element,t),ue(e),n.preventDefault(),!0}var f=(0,h.F9)(r);if(e.currentMode==="wysiwyg"&&f&&P("\u21E7\u2318;",n))return t.insertNode(document.createElement("wbr")),f.outerHTML='<blockquote data-block="0">'+f.outerHTML+"</blockquote>",(0,M.ib)(e.wysiwyg.element,t),we(e),n.preventDefault(),!0;if(yt(e,n,t,o,o)||ot(e,n,t,o,o))return!0}return!1},Cn=function(e,t,n){var i=t.startContainer,r=(0,h.fb)(i,"vditor-task");if(r){if(P("\u21E7\u2318J",n)){var o=r.firstElementChild;return o.checked?o.removeAttribute("checked"):o.setAttribute("checked","checked"),ue(e),n.preventDefault(),!0}if(n.key==="Backspace"&&!(0,a.yl)(n)&&!n.shiftKey&&!n.altKey&&t.toString()===""&&t.startOffset===1&&(i.nodeType===3&&i.previousSibling&&i.previousSibling.tagName==="INPUT"||i.nodeType!==3)){var s=r.previousElementSibling;return r.querySelector("input").remove(),s?((0,h.DX)(s).parentElement.insertAdjacentHTML("beforeend","<wbr>"+r.innerHTML.trim()),r.remove()):(r.parentElement.insertAdjacentHTML("beforebegin",'<p data-block="0"><wbr>'+(r.innerHTML.trim()||`
  92. `)+"</p>"),r.nextElementSibling?r.remove():r.parentElement.remove()),(0,M.ib)(e[e.currentMode].element,t),ue(e),n.preventDefault(),!0}if(n.key==="Enter"&&!(0,a.yl)(n)&&!n.shiftKey&&!n.altKey){if(r.textContent.trim()==="")if((0,h.fb)(r.parentElement,"vditor-task")){var f=(0,h.O9)(i);f&&Gt(e,r,t,f)}else if(r.nextElementSibling){var b="",w="",y=!1;Array.from(r.parentElement.children).forEach(function(C){r.isSameNode(C)?y=!0:y?b+=C.outerHTML:w+=C.outerHTML});var x=r.parentElement.tagName,j=r.parentElement.tagName==="OL"?"":' data-marker="'+r.parentElement.getAttribute("data-marker")+'"',B="";w&&(B=r.parentElement.tagName==="UL"?"":' start="1"',w="<"+x+' data-tight="true"'+j+' data-block="0">'+w+"</"+x+">"),r.parentElement.outerHTML=w+`<p data-block="0"><wbr>
  93. </p><`+x+`
  94. data-tight="true"`+j+' data-block="0"'+B+">"+b+"</"+x+">"}else r.parentElement.insertAdjacentHTML("afterend",`<p data-block="0"><wbr>
  95. </p>`),r.parentElement.querySelectorAll("li").length===1?r.parentElement.remove():r.remove();else i.nodeType!==3&&t.startOffset===0&&i.firstChild.tagName==="INPUT"?t.setStart(i.childNodes[1],1):(t.setEndAfter(r.lastChild),r.insertAdjacentHTML("afterend",'<li class="vditor-task" data-marker="'+r.getAttribute("data-marker")+'"><input type="checkbox"> <wbr></li>'),document.querySelector("wbr").after(t.extractContents()));return(0,M.ib)(e[e.currentMode].element,t),ue(e),Me(e),n.preventDefault(),!0}}return!1},xn=function(e,t,n,i){if(t.startContainer.nodeType!==3){var r=t.startContainer.children[t.startOffset];if(r&&r.tagName==="HR")return t.selectNodeContents(r.previousElementSibling),t.collapse(!1),n.preventDefault(),!0}if(i){var o=i.previousElementSibling;if(o&&(0,M.im)(i,e[e.currentMode].element,t).start===0&&((0,a.vU)()&&o.tagName==="HR"||o.tagName==="TABLE")){if(o.tagName==="TABLE"){var s=o.lastElementChild.lastElementChild.lastElementChild;s.innerHTML=s.innerHTML.trimLeft()+"<wbr>"+i.textContent.trim(),i.remove()}else o.remove();return(0,M.ib)(e[e.currentMode].element,t),ue(e),n.preventDefault(),!0}}return!1},An=function(e){(0,a.vU)()&&e.startContainer.nodeType!==3&&e.startContainer.tagName==="HR"&&e.setStartBefore(e.startContainer)},Hn=function(e,t,n){var i,r;if(!(0,a.vU)())return!1;if(e.key==="ArrowUp"&&t&&((i=t.previousElementSibling)===null||i===void 0?void 0:i.tagName)==="TABLE"){var o=t.previousElementSibling;return n.selectNodeContents(o.rows[o.rows.length-1].lastElementChild),n.collapse(!1),e.preventDefault(),!0}return!(e.key!=="ArrowDown"||!t||((r=t.nextElementSibling)===null||r===void 0?void 0:r.tagName)!=="TABLE")&&(n.selectNodeContents(t.nextElementSibling.rows[0].cells[0]),n.collapse(!0),e.preventDefault(),!0)},Ht=function(e,t,n){return fr(void 0,void 0,void 0,function(){var i,r,o,s,f,b,w,y,x,j,B,C,R,K,W,z;return hr(this,function(V){switch(V.label){case 0:return e[e.currentMode].element.getAttribute("contenteditable")!=="true"?[2]:(t.stopPropagation(),t.preventDefault(),"clipboardData"in t?(i=t.clipboardData.getData("text/html"),r=t.clipboardData.getData("text/plain"),o=t.clipboardData.files):(i=t.dataTransfer.getData("text/html"),r=t.dataTransfer.getData("text/plain"),t.dataTransfer.types.includes("Files")&&(o=t.dataTransfer.items)),s={},f=function(H,J){if(!J)return["",Lute.WalkContinue];var ie=H.TokensStr();if(H.__internal_object__.Parent.Type===34&&ie&&ie.indexOf("file://")===-1&&e.options.upload.linkToImgUrl){var Y=new XMLHttpRequest;Y.open("POST",e.options.upload.linkToImgUrl),e.options.upload.token&&Y.setRequestHeader("X-Upload-Token",e.options.upload.token),e.options.upload.withCredentials&&(Y.withCredentials=!0),mn(e,Y),Y.setRequestHeader("Content-Type","application/json; charset=utf-8"),Y.onreadystatechange=function(){if(Y.readyState===XMLHttpRequest.DONE){if(Y.status===200){var re=Y.responseText;e.options.upload.linkToImgFormat&&(re=e.options.upload.linkToImgFormat(Y.responseText));var ne=JSON.parse(re);if(ne.code!==0)return void e.tip.show(ne.msg);var Q=ne.data.originalURL;if(e.currentMode==="sv")e.sv.element.querySelectorAll(".vditor-sv__marker--link").forEach(function(be){be.textContent===Q&&(be.textContent=ne.data.url)});else{var le=e[e.currentMode].element.querySelector('img[src="'+Q+'"]');le.src=ne.data.url,e.currentMode==="ir"&&(le.previousElementSibling.previousElementSibling.innerHTML=ne.data.url)}ue(e)}else e.tip.show(Y.responseText);e.options.upload.linkToImgCallback&&e.options.upload.linkToImgCallback(Y.responseText)}},Y.send(JSON.stringify({url:ie}))}return e.currentMode==="ir"?['<span class="vditor-ir__marker vditor-ir__marker--link">'+Lute.EscapeHTMLStr(ie)+"</span>",Lute.WalkContinue]:e.currentMode==="wysiwyg"?["",Lute.WalkContinue]:['<span class="vditor-sv__marker--link">'+Lute.EscapeHTMLStr(ie)+"</span>",Lute.WalkContinue]},i.replace(/&amp;/g,"&").replace(/<(|\/)(html|body|meta)[^>]*?>/gi,"").trim()!=='<a href="'+r+'">'+r+"</a>"&&i.replace(/&amp;/g,"&").replace(/<(|\/)(html|body|meta)[^>]*?>/gi,"").trim()!=='<!--StartFragment--><a href="'+r+'">'+r+"</a><!--EndFragment-->"||(i=""),(b=new DOMParser().parseFromString(i,"text/html")).body&&(i=b.body.innerHTML),i=Lute.Sanitize(i),e.wysiwyg.getComments(e),w=e[e.currentMode].element.scrollHeight,y=function(H,J,ie){ie===void 0&&(ie="sv");var Y=document.createElement("div");Y.innerHTML=H;var re=!1;Y.childElementCount===1&&Y.lastElementChild.style.fontFamily.indexOf("monospace")>-1&&(re=!0);var ne=Y.querySelectorAll("pre");if(Y.childElementCount===1&&ne.length===1&&ne[0].className!=="vditor-wysiwyg"&&ne[0].className!=="vditor-sv"&&(re=!0),H.indexOf(`
  96. <p class="p1">`)===0&&(re=!0),Y.childElementCount===1&&Y.firstElementChild.tagName==="TABLE"&&Y.querySelector(".line-number")&&Y.querySelector(".line-content")&&(re=!0),re){var Q=J||H;return/\n/.test(Q)||ne.length===1?ie==="wysiwyg"?'<div class="vditor-wysiwyg__block" data-block="0" data-type="code-block"><pre><code>'+Q.replace(/&/g,"&amp;").replace(/</g,"&lt;")+"<wbr></code></pre></div>":"\n```\n"+Q.replace(/&/g,"&amp;").replace(/</g,"&lt;")+"\n```":ie==="wysiwyg"?"<code>"+Q.replace(/&/g,"&amp;").replace(/</g,"&lt;")+"</code><wbr>":"`"+Q+"`"}return!1}(i,r,e.currentMode),(x=e.currentMode==="sv"?(0,h.a1)(t.target,"data-type","code-block"):(0,h.lG)(t.target,"CODE"))?(e.currentMode==="sv"?document.execCommand("insertHTML",!1,r.replace(/&/g,"&amp;").replace(/</g,"&lt;")):(j=(0,M.im)(t.target,e[e.currentMode].element),x.parentElement.tagName!=="PRE"&&(r+=m.g.ZWSP),x.textContent=x.textContent.substring(0,j.start)+r+x.textContent.substring(j.end),(0,M.$j)(j.start+r.length,j.start+r.length,x.parentElement),!((z=x.parentElement)===null||z===void 0)&&z.nextElementSibling.classList.contains("vditor-"+e.currentMode+"__preview")&&(x.parentElement.nextElementSibling.innerHTML=x.outerHTML,ge(x.parentElement.nextElementSibling,e))),[3,8]):[3,1]);case 1:return y?(n.pasteCode(y),[3,8]):[3,2];case 2:return i.trim()===""?[3,3]:((B=document.createElement("div")).innerHTML=i,B.querySelectorAll("[style]").forEach(function(H){H.removeAttribute("style")}),B.querySelectorAll(".vditor-copy").forEach(function(H){H.remove()}),e.currentMode==="ir"?(s.HTML2VditorIRDOM={renderLinkDest:f},e.lute.SetJSRenderers({renderers:s}),(0,M.oC)(e.lute.HTML2VditorIRDOM(B.innerHTML),e)):e.currentMode==="wysiwyg"?(s.HTML2VditorDOM={renderLinkDest:f},e.lute.SetJSRenderers({renderers:s}),(0,M.oC)(e.lute.HTML2VditorDOM(B.innerHTML),e)):(s.Md2VditorSVDOM={renderLinkDest:f},e.lute.SetJSRenderers({renderers:s}),cn(e,e.lute.HTML2Md(B.innerHTML).trimRight())),e.outline.render(e),[3,8]);case 3:return o.length>0?e.options.upload.url||e.options.upload.handler?[4,Ft(e,o)]:[3,5]:[3,7];case 4:return V.sent(),[3,6];case 5:C=new FileReader,"clipboardData"in t?(o=t.clipboardData.files,R=o[0]):t.dataTransfer.types.includes("Files")&&(o=t.dataTransfer.items,R=o[0].getAsFile()),R&&R.type.startsWith("image")&&(C.readAsDataURL(R),C.onload=function(){var H="";e.currentMode==="wysiwyg"?H+='<img alt="'+R.name+'" src="'+C.result.toString()+`">
  97. `:H+="!["+R.name+"]("+C.result.toString()+`)
  98. `,document.execCommand("insertHTML",!1,H)}),V.label=6;case 6:return[3,8];case 7:r.trim()!==""&&o.length===0&&((W=(0,M.zh)(e)).toString()!==""&&e.lute.IsValidLinkDest(r)&&(r="["+W.toString()+"]("+r+")"),e.currentMode==="ir"?(s.Md2VditorIRDOM={renderLinkDest:f},e.lute.SetJSRenderers({renderers:s}),(0,M.oC)(e.lute.Md2VditorIRDOM(r),e)):e.currentMode==="wysiwyg"?(s.Md2VditorDOM={renderLinkDest:f},e.lute.SetJSRenderers({renderers:s}),(0,M.oC)(e.lute.Md2VditorDOM(r),e)):(s.Md2VditorSVDOM={renderLinkDest:f},e.lute.SetJSRenderers({renderers:s}),cn(e,r)),e.outline.render(e)),V.label=8;case 8:return e.currentMode!=="sv"&&((K=(0,h.F9)((0,M.zh)(e).startContainer))&&(W=(0,M.zh)(e),e[e.currentMode].element.querySelectorAll("wbr").forEach(function(H){H.remove()}),W.insertNode(document.createElement("wbr")),e.currentMode==="wysiwyg"?K.outerHTML=e.lute.SpinVditorDOM(K.outerHTML):K.outerHTML=e.lute.SpinVditorIRDOM(K.outerHTML),(0,M.ib)(e[e.currentMode].element,W)),e[e.currentMode].element.querySelectorAll(".vditor-"+e.currentMode+"__preview[data-render='2']").forEach(function(H){ge(H,e)})),e.wysiwyg.triggerRemoveComment(e),ue(e),e[e.currentMode].element.scrollHeight-w>Math.min(e[e.currentMode].element.clientHeight,window.innerHeight)/2&&Me(e),[2]}})})},Nn=function(e){e.hint.render(e);var t=(0,M.zh)(e).startContainer,n=(0,h.a1)(t,"data-type","code-block-info");if(n)if(n.textContent.replace(m.g.ZWSP,"")===""&&e.hint.recentLanguage)n.textContent=m.g.ZWSP+e.hint.recentLanguage,(0,M.zh)(e).selectNodeContents(n);else{var i=[],r=n.textContent.substring(0,(0,M.im)(n,e.ir.element).start).replace(m.g.ZWSP,"");(e.options.preview.hljs.langs||m.g.CODE_LANGUAGES).forEach(function(o){o.indexOf(r.toLowerCase())>-1&&i.push({html:o,value:o})}),e.hint.genHTML(i,r,e)}},Xe=function(e,t){t===void 0&&(t={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),t.enableHint&&Nn(e),clearTimeout(e.ir.processTimeoutId),e.ir.processTimeoutId=window.setTimeout(function(){if(!e.ir.composingLock){var n=u(e);typeof e.options.input=="function"&&t.enableInput&&e.options.input(n),e.options.counter.enable&&e.counter.render(e,n),e.options.cache.enable&&(0,a.pK)()&&(localStorage.setItem(e.options.cache.id,n),e.options.cache.after&&e.options.cache.after(n)),e.devtools&&e.devtools.renderEchart(e),t.enableAddUndoStack&&e.undo.addToUndoStack(e)}},e.options.undoDelay)},bt=function(e,t){var n=(0,M.zh)(e),i=(0,h.F9)(n.startContainer)||n.startContainer;if(i){var r=i.querySelector(".vditor-ir__marker--heading");r?r.innerHTML=t:(i.insertAdjacentText("afterbegin",t),n.selectNodeContents(i),n.collapse(!1)),q(e,n.cloneRange()),ft(e)}},Nt=function(e,t,n){var i=(0,h.a1)(e.startContainer,"data-type",n);if(i){i.firstElementChild.remove(),i.lastElementChild.remove(),e.insertNode(document.createElement("wbr"));var r=document.createElement("div");r.innerHTML=t.lute.SpinVditorIRDOM(i.outerHTML),i.outerHTML=r.firstElementChild.innerHTML.trim()}},yr=function(e,t,n,i){var r=(0,M.zh)(e),o=t.getAttribute("data-type"),s=r.startContainer;s.nodeType===3&&(s=s.parentElement);var f=!0;if(t.classList.contains("vditor-menu--current"))if(o==="quote"){var b=(0,h.lG)(s,"BLOCKQUOTE");b&&(r.insertNode(document.createElement("wbr")),b.outerHTML=b.innerHTML.trim()===""?'<p data-block="0">'+b.innerHTML+"</p>":b.innerHTML)}else if(o==="link"){var w=(0,h.a1)(r.startContainer,"data-type","a");if(w){var y=(0,h.fb)(r.startContainer,"vditor-ir__link");y?(r.insertNode(document.createElement("wbr")),w.outerHTML=y.innerHTML):w.outerHTML=w.querySelector(".vditor-ir__link").innerHTML+"<wbr>"}}else o==="italic"?Nt(r,e,"em"):o==="bold"?Nt(r,e,"strong"):o==="strike"?Nt(r,e,"s"):o==="inline-code"?Nt(r,e,"code"):o!=="check"&&o!=="list"&&o!=="ordered-list"||(Ct(e,r,o),f=!1,t.classList.remove("vditor-menu--current"));else{e.ir.element.childNodes.length===0&&(e.ir.element.innerHTML='<p data-block="0"><wbr></p>',(0,M.ib)(e.ir.element,r));var x=(0,h.F9)(r.startContainer);if(o==="line"){if(x){var j=`<hr data-block="0"><p data-block="0"><wbr>
  99. </p>`;x.innerHTML.trim()===""?x.outerHTML=j:x.insertAdjacentHTML("afterend",j)}}else if(o==="quote")x&&(r.insertNode(document.createElement("wbr")),x.outerHTML='<blockquote data-block="0">'+x.outerHTML+"</blockquote>",f=!1,t.classList.add("vditor-menu--current"));else if(o==="link"){var B=void 0;B=r.toString()===""?n+"<wbr>"+i:""+n+r.toString()+i.replace(")","<wbr>)"),document.execCommand("insertHTML",!1,B),f=!1,t.classList.add("vditor-menu--current")}else if(o==="italic"||o==="bold"||o==="strike"||o==="inline-code"||o==="code"||o==="table"){B=void 0,r.toString()===""?B=n+"<wbr>"+i:(B=o==="code"?n+`
  100. `+r.toString()+"<wbr>"+i:o==="table"?""+n+r.toString()+"<wbr>"+i:""+n+r.toString()+i+"<wbr>",r.deleteContents()),o!=="table"&&o!=="code"||(B=`
  101. `+B+`
  102. `);var C=document.createElement("span");C.innerHTML=B,r.insertNode(C),q(e,r),o==="table"&&(r.selectNodeContents(getSelection().getRangeAt(0).startContainer.parentElement),(0,M.Hc)(r))}else o!=="check"&&o!=="list"&&o!=="ordered-list"||(Ct(e,r,o,!1),f=!1,c(e.toolbar.elements,["check","list","ordered-list"]),t.classList.add("vditor-menu--current"))}(0,M.ib)(e.ir.element,r),Xe(e),f&&ft(e)},br=function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function s(w){try{b(i.next(w))}catch(y){o(y)}}function f(w){try{b(i.throw(w))}catch(y){o(y)}}function b(w){var y;w.done?r(w.value):(y=w.value,y instanceof n?y:new n(function(x){x(y)})).then(s,f)}b((i=i.apply(e,t||[])).next())})},wr=function(e,t){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function f(b){return function(w){return function(y){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=2&y[0]?i.return:y[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,y[1])).done)return r;switch(i=0,r&&(y=[2&y[0],r.value]),y[0]){case 0:case 1:r=y;break;case 4:return s.label++,{value:y[1],done:!1};case 5:s.label++,i=y[1],y=[0];continue;case 7:y=s.ops.pop(),s.trys.pop();continue;default:if(r=s.trys,!((r=r.length>0&&r[r.length-1])||y[0]!==6&&y[0]!==2)){s=0;continue}if(y[0]===3&&(!r||y[1]>r[0]&&y[1]<r[3])){s.label=y[1];break}if(y[0]===6&&s.label<r[1]){s.label=r[1],r=y;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(y);break}r[2]&&s.ops.pop(),s.trys.pop();continue}y=t.call(e,s)}catch(x){y=[6,x],i=0}finally{n=r=0}if(5&y[0])throw y[1];return{value:y[0]?y[1]:void 0,done:!0}}([b,w])}}},Er=function(){function e(t){var n=this;this.splitChar="",this.lastIndex=-1,this.fillEmoji=function(i,r){n.element.style.display="none";var o=decodeURIComponent(i.getAttribute("data-value")),s=window.getSelection().getRangeAt(0);if(r.currentMode==="ir"){var f=(0,h.a1)(s.startContainer,"data-type","code-block-info");if(f)return f.textContent=m.g.ZWSP+o.trimRight(),s.selectNodeContents(f),s.collapse(!1),Xe(r),f.parentElement.querySelectorAll("code").forEach(function(x){x.className="language-"+o.trimRight()}),ge(f.parentElement.querySelector(".vditor-ir__preview"),r),void(n.recentLanguage=o.trimRight())}if(r.currentMode==="wysiwyg"&&s.startContainer.nodeType!==3){var b=s.startContainer,w=void 0;if((w=b.classList.contains("vditor-input")?b:b.firstElementChild)&&w.classList.contains("vditor-input"))return w.value=o.trimRight(),s.selectNodeContents(w),s.collapse(!1),w.dispatchEvent(new CustomEvent("input",{detail:1})),void(n.recentLanguage=o.trimRight())}if(s.setStart(s.startContainer,n.lastIndex),s.deleteContents(),r.options.hint.parse?r.currentMode==="sv"?(0,M.oC)(r.lute.SpinVditorSVDOM(o),r):r.currentMode==="wysiwyg"?(0,M.oC)(r.lute.SpinVditorDOM(o),r):(0,M.oC)(r.lute.SpinVditorIRDOM(o),r):(0,M.oC)(o,r),n.splitChar===":"&&o.indexOf(":")>-1&&r.currentMode!=="sv"&&s.insertNode(document.createTextNode(" ")),s.collapse(!1),(0,M.Hc)(s),r.currentMode==="wysiwyg")(y=(0,h.fb)(s.startContainer,"vditor-wysiwyg__block"))&&y.lastElementChild.classList.contains("vditor-wysiwyg__preview")&&(y.lastElementChild.innerHTML=y.firstElementChild.innerHTML,ge(y.lastElementChild,r));else if(r.currentMode==="ir"){var y;(y=(0,h.fb)(s.startContainer,"vditor-ir__marker--pre"))&&y.nextElementSibling.classList.contains("vditor-ir__preview")&&(y.nextElementSibling.innerHTML=y.innerHTML,ge(y.nextElementSibling,r))}ue(r)},this.timeId=-1,this.element=document.createElement("div"),this.element.className="vditor-hint",this.recentLanguage="",t.push({key:":"})}return e.prototype.render=function(t){var n=this;if(window.getSelection().focusNode){var i,r=getSelection().getRangeAt(0);i=r.startContainer.textContent.substring(0,r.startOffset)||"";var o=this.getKey(i,t.options.hint.extend);if(o===void 0)this.element.style.display="none",clearTimeout(this.timeId);else if(this.splitChar===":"){var s=o===""?t.options.hint.emoji:t.lute.GetEmojis(),f=[];Object.keys(s).forEach(function(b){b.indexOf(o.toLowerCase())===0&&(s[b].indexOf(".")>-1?f.push({html:'<img src="'+s[b]+'" title=":'+b+':"/> :'+b+":",value:":"+b+":"}):f.push({html:'<span class="vditor-hint__emoji">'+s[b]+"</span>"+b,value:s[b]}))}),this.genHTML(f,o,t)}else t.options.hint.extend.forEach(function(b){b.key===n.splitChar&&(clearTimeout(n.timeId),n.timeId=window.setTimeout(function(){return br(n,void 0,void 0,function(){var w;return wr(this,function(y){switch(y.label){case 0:return w=this.genHTML,[4,b.hint(o)];case 1:return w.apply(this,[y.sent(),o,t]),[2]}})})},t.options.hint.delay))})}},e.prototype.genHTML=function(t,n,i){var r=this;if(t.length!==0){var o=i[i.currentMode].element,s=(0,M.Ny)(o),f=s.left+(i.options.outline.position==="left"?i.outline.element.offsetWidth:0),b=s.top,w="";t.forEach(function(x,j){if(!(j>7)){var B=x.html;if(n!==""){var C=B.lastIndexOf(">")+1,R=B.substr(C),K=R.toLowerCase().indexOf(n.toLowerCase());K>-1&&(R=R.substring(0,K)+"<b>"+R.substring(K,K+n.length)+"</b>"+R.substring(K+n.length),B=B.substr(0,C)+R)}w+='<button type="button" data-value="'+encodeURIComponent(x.value)+` "
  103. `+(j===0?"class='vditor-hint--current'":"")+"> "+B+"</button>"}}),this.element.innerHTML=w;var y=parseInt(document.defaultView.getComputedStyle(o,null).getPropertyValue("line-height"),10);this.element.style.top=b+(y||22)+"px",this.element.style.left=f+"px",this.element.style.display="block",this.element.style.right="auto",this.element.querySelectorAll("button").forEach(function(x){x.addEventListener("click",function(j){r.fillEmoji(x,i),j.preventDefault()})}),this.element.getBoundingClientRect().bottom>window.innerHeight&&(this.element.style.top=b-this.element.offsetHeight+"px"),this.element.getBoundingClientRect().right>window.innerWidth&&(this.element.style.left="auto",this.element.style.right="0")}else this.element.style.display="none"},e.prototype.select=function(t,n){if(this.element.querySelectorAll("button").length===0||this.element.style.display==="none")return!1;var i=this.element.querySelector(".vditor-hint--current");if(t.key==="ArrowDown")return t.preventDefault(),t.stopPropagation(),i.removeAttribute("class"),i.nextElementSibling?i.nextElementSibling.className="vditor-hint--current":this.element.children[0].className="vditor-hint--current",!0;if(t.key==="ArrowUp"){if(t.preventDefault(),t.stopPropagation(),i.removeAttribute("class"),i.previousElementSibling)i.previousElementSibling.className="vditor-hint--current";else{var r=this.element.children.length;this.element.children[r-1].className="vditor-hint--current"}return!0}return!((0,a.yl)(t)||t.shiftKey||t.altKey||t.key!=="Enter"||t.isComposing)&&(t.preventDefault(),t.stopPropagation(),this.fillEmoji(i,n),!0)},e.prototype.getKey=function(t,n){var i,r=this;if(this.lastIndex=-1,this.splitChar="",n.forEach(function(b){var w=t.lastIndexOf(b.key);r.lastIndex<w&&(r.splitChar=b.key,r.lastIndex=w)}),this.lastIndex===-1)return i;var o=t.split(this.splitChar),s=o[o.length-1];if(o.length>1&&s.trim()===s)if(o.length===2&&o[0]===""&&o[1].length<32)i=o[1];else{var f=o[o.length-2].slice(-1);(0,d.X)(f)===" "&&s.length<32&&(i=s)}return i},e}(),Sr=function(){function e(t){this.composingLock=!1;var n=document.createElement("div");n.className="vditor-ir",n.innerHTML='<pre class="vditor-reset" placeholder="'+t.options.placeholder+`"
  104. contenteditable="true" spellcheck="false"></pre>`,this.element=n.firstElementChild,this.bindEvent(t),qt(t,this.element),ln(t,this.element),Bt(t,this.element),zt(t,this.element),Kt(t,this.element),Vt(t,this.element),Ut(t,this.element,this.copy),Wt(t,this.element,this.copy)}return e.prototype.copy=function(t,n){var i=getSelection().getRangeAt(0);if(i.toString()!==""){t.stopPropagation(),t.preventDefault();var r=document.createElement("div");r.appendChild(i.cloneContents()),t.clipboardData.setData("text/plain",n.lute.VditorIRDOM2Md(r.innerHTML).trim()),t.clipboardData.setData("text/html","")}},e.prototype.bindEvent=function(t){var n=this;this.element.addEventListener("paste",function(i){Ht(t,i,{pasteCode:function(r){document.execCommand("insertHTML",!1,r)}})}),this.element.addEventListener("compositionstart",function(i){n.composingLock=!0}),this.element.addEventListener("compositionend",function(i){(0,a.vU)()||q(t,getSelection().getRangeAt(0).cloneRange()),n.composingLock=!1}),this.element.addEventListener("input",function(i){if(i.inputType!=="deleteByDrag"&&i.inputType!=="insertFromDrop")return n.preventInput?(n.preventInput=!1,void Xe(t,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})):void(n.composingLock||i.data==="\u2018"||i.data==="\u201C"||i.data==="\u300A"||q(t,getSelection().getRangeAt(0).cloneRange(),!1,i))}),this.element.addEventListener("click",function(i){if(i.target.tagName==="INPUT")return i.target.checked?i.target.setAttribute("checked","checked"):i.target.removeAttribute("checked"),n.preventInput=!0,void Xe(t);var r=(0,M.zh)(t),o=(0,h.fb)(i.target,"vditor-ir__preview");if(o||(o=(0,h.fb)(r.startContainer,"vditor-ir__preview")),o&&(o.previousElementSibling.firstElementChild?r.selectNodeContents(o.previousElementSibling.firstElementChild):r.selectNodeContents(o.previousElementSibling),r.collapse(!0),(0,M.Hc)(r),Me(t)),i.target.tagName==="IMG"){var s=i.target.parentElement.querySelector(".vditor-ir__marker--link");s&&(r.selectNode(s),(0,M.Hc)(r))}var f=(0,h.a1)(i.target,"data-type","a");if(!f||f.classList.contains("vditor-ir__node--expand")){if(i.target.isEqualNode(n.element)&&n.element.lastElementChild&&r.collapsed){var b=n.element.lastElementChild.getBoundingClientRect();i.y>b.top+b.height&&(n.element.lastElementChild.tagName==="P"&&n.element.lastElementChild.textContent.trim().replace(m.g.ZWSP,"")===""?(r.selectNodeContents(n.element.lastElementChild),r.collapse(!1)):(n.element.insertAdjacentHTML("beforeend",'<p data-block="0">'+m.g.ZWSP+"<wbr></p>"),(0,M.ib)(n.element,r)))}r.toString()===""?D(r,t):setTimeout(function(){D((0,M.zh)(t),t)}),ee(i,t),ft(t)}else t.options.link.click?t.options.link.click(f.querySelector(":scope > .vditor-ir__marker--link")):t.options.link.isOpen&&window.open(f.querySelector(":scope > .vditor-ir__marker--link").textContent)}),this.element.addEventListener("keyup",function(i){if(!i.isComposing&&!(0,a.yl)(i))if(i.key==="Enter"&&Me(t),ft(t),i.key!=="Backspace"&&i.key!=="Delete"||t.ir.element.innerHTML===""||t.ir.element.childNodes.length!==1||!t.ir.element.firstElementChild||t.ir.element.firstElementChild.tagName!=="P"||t.ir.element.firstElementChild.childElementCount!==0||t.ir.element.textContent!==""&&t.ir.element.textContent!==`
  105. `){var r=(0,M.zh)(t);i.key==="Backspace"?((0,a.vU)()&&r.startContainer.textContent===`
  106. `&&r.startOffset===1&&(r.startContainer.textContent="",D(r,t)),n.element.querySelectorAll(".language-math").forEach(function(s){var f=s.querySelector("br");f&&f.remove()})):i.key.indexOf("Arrow")>-1?(i.key!=="ArrowLeft"&&i.key!=="ArrowRight"||Nn(t),D(r,t)):i.keyCode===229&&i.code===""&&i.key==="Unidentified"&&D(r,t);var o=(0,h.fb)(r.startContainer,"vditor-ir__preview");if(o){if(i.key==="ArrowUp"||i.key==="ArrowLeft")return o.previousElementSibling.firstElementChild?r.selectNodeContents(o.previousElementSibling.firstElementChild):r.selectNodeContents(o.previousElementSibling),r.collapse(!1),i.preventDefault(),!0;if(o.tagName==="SPAN"&&(i.key==="ArrowDown"||i.key==="ArrowRight"))return o.parentElement.getAttribute("data-type")==="html-entity"?(o.parentElement.insertAdjacentText("afterend",m.g.ZWSP),r.setStart(o.parentElement.nextSibling,1)):r.selectNodeContents(o.parentElement.lastElementChild),r.collapse(!1),i.preventDefault(),!0}}else t.ir.element.innerHTML=""})},e}(),Dn=function(e){return e.currentMode==="sv"?e.lute.Md2HTML(u(e)):e.currentMode==="wysiwyg"?e.lute.VditorDOM2HTML(e.wysiwyg.element.innerHTML):e.currentMode==="ir"?e.lute.VditorIRDOM2HTML(e.ir.element.innerHTML):void 0},kr=F(895),On=F(818),Lr=function(){function e(t){this.element=document.createElement("div"),this.element.className="vditor-outline",this.element.innerHTML='<div class="vditor-outline__title">'+t+`</div>
  107. <div class="vditor-outline__content"></div>`}return e.prototype.render=function(t){return t.preview.element.style.display==="block"?(0,On.k)(t.preview.previewElement,this.element.lastElementChild,t):(0,On.k)(t[t.currentMode].element,this.element.lastElementChild,t)},e.prototype.toggle=function(t,n,i){var r;n===void 0&&(n=!0),i===void 0&&(i=!0);var o=(r=t.toolbar.elements.outline)===null||r===void 0?void 0:r.firstElementChild;if(n&&window.innerWidth>=m.g.MOBILE_WIDTH?(this.element.style.display="block",this.render(t),o==null||o.classList.add("vditor-menu--current")):(this.element.style.display="none",o==null||o.classList.remove("vditor-menu--current")),i&&getSelection().rangeCount>0){var s=getSelection().getRangeAt(0);t[t.currentMode].element.contains(s.startContainer)&&(0,M.Hc)(s)}me(t)},e}(),Tr=F(554),Mr=function(){function e(t){var n=this;this.element=document.createElement("div"),this.element.className="vditor-preview",this.previewElement=document.createElement("div"),this.previewElement.className="vditor-reset",t.options.classes.preview&&this.previewElement.classList.add(t.options.classes.preview),this.previewElement.style.maxWidth=t.options.preview.maxWidth+"px",this.previewElement.addEventListener("copy",function(b){if(b.target.tagName!=="TEXTAREA"){var w=document.createElement("div");w.className="vditor-reset",w.appendChild(getSelection().getRangeAt(0).cloneContents()),n.copyToX(t,w,"default"),b.preventDefault()}}),this.previewElement.addEventListener("click",function(b){var w=(0,h.lG)(b.target,"SPAN");if(w&&(0,h.fb)(w,"vditor-toc")){var y=n.previewElement.querySelector("#"+w.getAttribute("data-target-id"));y&&(n.element.scrollTop=y.offsetTop)}else{if(b.target.tagName==="A")return t.options.link.click?t.options.link.click(b.target):t.options.link.isOpen&&window.open(b.target.getAttribute("href")),void b.preventDefault();b.target.tagName==="IMG"&&(t.options.image.preview?t.options.image.preview(b.target):t.options.image.isPreview&&(0,U.E)(b.target,t.options.lang,t.options.theme))}}),this.element.appendChild(this.previewElement);var i=t.options.preview.actions;if(i.length!==0){var r=document.createElement("div");r.className="vditor-preview__action";for(var o=[],s=0;s<i.length;s++){var f=i[s];if(typeof f!="object")switch(f){case"desktop":o.push('<button type="button" class="vditor-preview__action--current" data-type="desktop">Desktop</button>');break;case"tablet":o.push('<button type="button" data-type="tablet">Tablet</button>');break;case"mobile":o.push('<button type="button" data-type="mobile">Mobile/Wechat</button>');break;case"mp-wechat":o.push('<button type="button" data-type="mp-wechat" class="vditor-tooltipped vditor-tooltipped__w" aria-label="\u590D\u5236\u5230\u516C\u4F17\u53F7"><svg><use xlink:href="#vditor-icon-mp-wechat"></use></svg></button>');break;case"zhihu":o.push('<button type="button" data-type="zhihu" class="vditor-tooltipped vditor-tooltipped__w" aria-label="\u590D\u5236\u5230\u77E5\u4E4E"><svg><use xlink:href="#vditor-icon-zhihu"></use></svg></button>')}else o.push('<button type="button" data-type="'+f.key+'" class="'+f.className+'"'+(f.tooltip?' aria-label="'+f.tooltip+'"':"")+'">'+f.text+"</button>")}r.innerHTML=o.join(""),r.addEventListener((0,a.Le)(),function(b){var w=(0,N.S)(b.target,"BUTTON");if(w){var y=w.getAttribute("data-type"),x=i.find(function(j){return(j==null?void 0:j.key)===y});x?x.click(y):y!=="mp-wechat"&&y!=="zhihu"?(n.previewElement.style.width=y==="desktop"?"auto":y==="tablet"?"780px":"360px",n.previewElement.scrollWidth>n.previewElement.parentElement.clientWidth&&(n.previewElement.style.width="auto"),n.render(t),r.querySelectorAll("button").forEach(function(j){j.classList.remove("vditor-preview__action--current")}),w.classList.add("vditor-preview__action--current")):n.copyToX(t,n.previewElement.cloneNode(!0),y)}}),this.element.insertBefore(r,this.previewElement)}}return e.prototype.render=function(t,n){var i=this;if(clearTimeout(this.mdTimeoutId),this.element.style.display!=="none")if(n)this.previewElement.innerHTML=n;else if(u(t).replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")!==""){var r=new Date().getTime(),o=u(t);this.mdTimeoutId=window.setTimeout(function(){if(t.options.preview.url){var s=new XMLHttpRequest;s.open("POST",t.options.preview.url),s.setRequestHeader("Content-Type","application/json;charset=UTF-8"),s.onreadystatechange=function(){if(s.readyState===XMLHttpRequest.DONE)if(s.status===200){var b=JSON.parse(s.responseText);if(b.code!==0)return void t.tip.show(b.msg);t.options.preview.transform&&(b.data=t.options.preview.transform(b.data)),i.previewElement.innerHTML=b.data,i.afterRender(t,r)}else{var w=t.lute.Md2HTML(o);t.options.preview.transform&&(w=t.options.preview.transform(w)),i.previewElement.innerHTML=w,i.afterRender(t,r)}},s.send(JSON.stringify({markdownText:o}))}else{var f=t.lute.Md2HTML(o);t.options.preview.transform&&(f=t.options.preview.transform(f)),i.previewElement.innerHTML=f,i.afterRender(t,r)}},t.options.preview.delay)}else this.previewElement.innerHTML="";else this.element.getAttribute("data-type")==="renderPerformance"&&t.tip.hide()},e.prototype.afterRender=function(t,n){t.options.preview.parse&&t.options.preview.parse(this.element);var i=new Date().getTime()-n;new Date().getTime()-n>2600?(t.tip.show(window.VditorI18n.performanceTip.replace("${x}",i.toString())),t.preview.element.setAttribute("data-type","renderPerformance")):t.preview.element.getAttribute("data-type")==="renderPerformance"&&(t.tip.hide(),t.preview.element.removeAttribute("data-type"));var r=t.preview.element.querySelector(".vditor-comment--focus");r&&r.classList.remove("vditor-comment--focus"),(0,oe.O)(t.preview.previewElement),(0,pe.s)(t.options.preview.hljs,t.preview.previewElement,t.options.cdn),(0,fe.i)(t.preview.previewElement,t.options.cdn,t.options.theme),(0,ke.K)(t.preview.previewElement,t.options.cdn,t.options.theme),(0,ae.P)(t.preview.previewElement,t.options.cdn),(0,ve.v)(t.preview.previewElement,t.options.cdn),(0,Z.p)(t.preview.previewElement,t.options.cdn,t.options.theme),(0,Se.P)(t.preview.previewElement,t.options.cdn,t.options.theme),(0,Pe.B)(t.preview.previewElement,t.options.cdn),(0,G.Q)(t.preview.previewElement,t.options.cdn),(0,Tr.Y)(t.preview.previewElement);var o=t.preview.element,s=t.outline.render(t);s===""&&(s="[ToC]"),o.querySelectorAll('[data-type="toc-block"]').forEach(function(f){f.innerHTML=s,(0,de.H)(f,{cdn:t.options.cdn,math:t.options.preview.math})}),(0,de.H)(t.preview.previewElement,{cdn:t.options.cdn,math:t.options.preview.math})},e.prototype.copyToX=function(t,n,i){i===void 0&&(i="mp-wechat"),i!=="zhihu"?n.querySelectorAll(".katex-html .base").forEach(function(o){o.style.display="initial"}):n.querySelectorAll(".language-math").forEach(function(o){o.outerHTML='<img class="Formula-image" data-eeimg="true" src="//www.zhihu.com/equation?tex=" alt="'+o.getAttribute("data-math")+'\\" style="display: block; margin: 0 auto; max-width: 100%;">'}),n.style.backgroundColor="#fff",n.querySelectorAll("code").forEach(function(o){o.style.backgroundImage="none"}),this.element.append(n);var r=n.ownerDocument.createRange();r.selectNode(n),(0,M.Hc)(r),document.execCommand("copy"),n.remove(),t.tip.show(["zhihu","mp-wechat"].includes(i)?"\u5DF2\u590D\u5236\uFF0C\u53EF\u5230"+(i==="zhihu"?"\u77E5\u4E4E":"\u5FAE\u4FE1\u516C\u4F17\u53F7\u5E73\u53F0")+"\u8FDB\u884C\u7C98\u8D34":"\u5DF2\u590D\u5236\u5230\u526A\u5207\u677F")},e}(),_r=function(){function e(t){this.element=document.createElement("div"),this.element.className="vditor-resize vditor-resize--"+t.options.resize.position,this.element.innerHTML='<div><svg><use xlink:href="#vditor-icon-resize"></use></svg></div>',this.bindEvent(t)}return e.prototype.bindEvent=function(t){var n=this;this.element.addEventListener("mousedown",function(i){var r=document,o=i.clientY,s=t.element.offsetHeight,f=63+t.element.querySelector(".vditor-toolbar").clientHeight;r.ondragstart=function(){return!1},window.captureEvents&&window.captureEvents(),n.element.classList.add("vditor-resize--selected"),r.onmousemove=function(b){t.options.resize.position==="top"?t.element.style.height=Math.max(f,s+(o-b.clientY))+"px":t.element.style.height=Math.max(f,s+(b.clientY-o))+"px",t.options.typewriterMode&&(t.sv.element.style.paddingBottom=t.sv.element.parentElement.offsetHeight/2+"px")},r.onmouseup=function(){t.options.resize.after&&t.options.resize.after(t.element.offsetHeight-s),window.captureEvents&&window.captureEvents(),r.onmousemove=null,r.onmouseup=null,r.ondragstart=null,r.onselectstart=null,r.onselect=null,n.element.classList.remove("vditor-resize--selected")}})},e}(),Cr=function(){function e(t){this.composingLock=!1,this.element=document.createElement("pre"),this.element.className="vditor-sv vditor-reset",this.element.setAttribute("placeholder",t.options.placeholder),this.element.setAttribute("contenteditable","true"),this.element.setAttribute("spellcheck","false"),this.bindEvent(t),qt(t,this.element),Bt(t,this.element),zt(t,this.element),Kt(t,this.element),Vt(t,this.element),Ut(t,this.element,this.copy),Wt(t,this.element,this.copy)}return e.prototype.copy=function(t,n){t.stopPropagation(),t.preventDefault(),t.clipboardData.setData("text/plain",gt(n[n.currentMode].element))},e.prototype.bindEvent=function(t){var n=this;this.element.addEventListener("paste",function(i){Ht(t,i,{pasteCode:function(r){document.execCommand("insertHTML",!1,r)}})}),this.element.addEventListener("scroll",function(){if(t.preview.element.style.display==="block"){var i=n.element.scrollTop,r=n.element.clientHeight,o=n.element.scrollHeight-parseFloat(n.element.style.paddingBottom||"0"),s=t.preview.element;s.scrollTop=i/r>.5?(i+r)*s.scrollHeight/o-r:i*s.scrollHeight/o}}),this.element.addEventListener("compositionstart",function(i){n.composingLock=!0}),this.element.addEventListener("compositionend",function(i){(0,a.vU)()||se(t,i),n.composingLock=!1}),this.element.addEventListener("input",function(i){if(i.inputType!=="deleteByDrag"&&i.inputType!=="insertFromDrop"&&!n.composingLock&&i.data!=="\u2018"&&i.data!=="\u201C"&&i.data!=="\u300A")return n.preventInput?(n.preventInput=!1,void Ce(t,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})):void se(t,i)}),this.element.addEventListener("keyup",function(i){i.isComposing||(0,a.yl)(i)||(i.key!=="Backspace"&&i.key!=="Delete"||t.sv.element.innerHTML===""||t.sv.element.childNodes.length!==1||!t.sv.element.firstElementChild||t.sv.element.firstElementChild.tagName!=="DIV"||t.sv.element.firstElementChild.childElementCount!==2||t.sv.element.firstElementChild.textContent!==""&&t.sv.element.textContent!==`
  108. `?i.key==="Enter"&&Me(t):t.sv.element.innerHTML="")})},e}(),xr=function(){function e(){this.element=document.createElement("div"),this.element.className="vditor-tip"}return e.prototype.show=function(t,n){var i=this;n===void 0&&(n=6e3),this.element.className="vditor-tip vditor-tip--show",n===0?(this.element.innerHTML='<div class="vditor-tip__content">'+t+`
  109. <div class="vditor-tip__close">X</div></div>`,this.element.querySelector(".vditor-tip__close").addEventListener("click",function(){i.hide()})):(this.element.innerHTML='<div class="vditor-tip__content">'+t+"</div>",setTimeout(function(){i.hide()},n)),this.element.removeAttribute("style"),setTimeout(function(){i.element.getBoundingClientRect().top<46&&(i.element.style.position="fixed",i.element.style.top="46px")},150)},e.prototype.hide=function(){this.element.className="vditor-messageElementtip",this.element.innerHTML=""},e}(),Qt=function(e,t){if(t.options.preview.mode!==e){switch(t.options.preview.mode=e,e){case"both":t.sv.element.style.display="block",t.preview.element.style.display="block",t.preview.render(t),p(t.toolbar.elements,["both"]);break;case"editor":t.sv.element.style.display="block",t.preview.element.style.display="none",c(t.toolbar.elements,["both"])}t.devtools&&t.devtools.renderEchart(t)}},Ar=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),Hr=function(e){function t(n,i){var r=e.call(this,n,i)||this;return n.options.preview.mode==="both"&&r.element.children[0].classList.add("vditor-menu--current"),r.element.children[0].addEventListener((0,a.Le)(),function(o){r.element.firstElementChild.classList.contains(m.g.CLASS_MENU_DISABLED)||(o.preventDefault(),n.currentMode==="sv"&&(n.options.preview.mode==="both"?Qt("editor",n):Qt("both",n)))}),r}return Ar(t,e),t}(Le),Nr=function(){this.element=document.createElement("div"),this.element.className="vditor-toolbar__br"},Rn=F(312),Dr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),Or=function(e){function t(n,i){var r=e.call(this,n,i)||this,o=r.element.children[0],s=document.createElement("div");s.className="vditor-hint"+(i.level===2?"":" vditor-panel--arrow");var f="";return m.g.CODE_THEME.forEach(function(b){f+="<button>"+b+"</button>"}),s.innerHTML='<div style="overflow: auto;max-height:'+window.innerHeight/2+'px">'+f+"</div>",s.addEventListener((0,a.Le)(),function(b){b.target.tagName==="BUTTON"&&(E(n,["subToolbar"]),n.options.preview.hljs.style=b.target.textContent,(0,Rn.Y)(b.target.textContent,n.options.cdn),b.preventDefault(),b.stopPropagation())}),r.element.appendChild(s),k(n,s,o,i.level),r}return Dr(t,e),t}(Le),Rr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ir=function(e){function t(n,i){var r=e.call(this,n,i)||this,o=r.element.children[0],s=document.createElement("div");s.className="vditor-hint"+(i.level===2?"":" vditor-panel--arrow");var f="";return Object.keys(n.options.preview.theme.list).forEach(function(b){f+='<button data-type="'+b+'">'+n.options.preview.theme.list[b]+"</button>"}),s.innerHTML='<div style="overflow: auto;max-height:'+window.innerHeight/2+'px">'+f+"</div>",s.addEventListener((0,a.Le)(),function(b){b.target.tagName==="BUTTON"&&(E(n,["subToolbar"]),n.options.preview.theme.current=b.target.getAttribute("data-type"),(0,te.Z)(n.options.preview.theme.current,n.options.preview.theme.path),b.preventDefault(),b.stopPropagation())}),r.element.appendChild(s),k(n,s,o,i.level),r}return Rr(t,e),t}(Le),jr=function(){function e(t){this.element=document.createElement("span"),this.element.className="vditor-counter vditor-tooltipped vditor-tooltipped__nw",this.render(t,"")}return e.prototype.render=function(t,n){var i=n.endsWith(`
  110. `)?n.length-1:n.length;if(t.options.counter.type==="text"&&t[t.currentMode]){var r=t[t.currentMode].element.cloneNode(!0);r.querySelectorAll(".vditor-wysiwyg__preview").forEach(function(o){o.remove()}),i=r.textContent.length}typeof t.options.counter.max=="number"?(i>t.options.counter.max?this.element.className="vditor-counter vditor-counter--error":this.element.className="vditor-counter",this.element.innerHTML=i+"/"+t.options.counter.max):this.element.innerHTML=""+i,this.element.setAttribute("aria-label",t.options.counter.type),t.options.counter.after&&t.options.counter.after(i,{enable:t.options.counter.enable,max:t.options.counter.max,type:t.options.counter.type})},e}(),Pr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),qr=function(e){function t(n,i){var r=e.call(this,n,i)||this;return r.element.children[0].innerHTML=i.icon,r.element.children[0].addEventListener((0,a.Le)(),function(o){o.preventDefault(),o.currentTarget.classList.contains(m.g.CLASS_MENU_DISABLED)||i.click(o,n)}),r}return Pr(t,e),t}(Le),Br=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),Vr=function(e){function t(n,i){var r=e.call(this,n,i)||this;return r.element.firstElementChild.addEventListener((0,a.Le)(),function(o){var s=r.element.firstElementChild;s.classList.contains(m.g.CLASS_MENU_DISABLED)||(o.preventDefault(),s.classList.contains("vditor-menu--current")?(s.classList.remove("vditor-menu--current"),n.devtools.element.style.display="none",me(n)):(s.classList.add("vditor-menu--current"),n.devtools.element.style.display="block",me(n),n.devtools.renderEchart(n)))}),r}return Br(t,e),t}(Le),Ur=function(){this.element=document.createElement("div"),this.element.className="vditor-toolbar__divider"},Wr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),zr=function(e){function t(n,i){var r=e.call(this,n,i)||this,o=document.createElement("div");o.className="vditor-panel vditor-panel--arrow";var s="";return Object.keys(n.options.hint.emoji).forEach(function(f){var b=n.options.hint.emoji[f];b.indexOf(".")>-1?s+='<button data-value=":'+f+': " data-key=":'+f+`:"><img
  111. data-value=":`+f+': " data-key=":'+f+':" class="vditor-emojis__icon" src="'+b+'"/></button>':s+='<button data-value="'+b+` "
  112. data-key="`+f+'"><span class="vditor-emojis__icon">'+b+"</span></button>"}),o.innerHTML='<div class="vditor-emojis" style="max-height: '+(n.options.height==="auto"?"auto":n.options.height-80)+'px">'+s+`</div><div class="vditor-emojis__tail">
  113. <span class="vditor-emojis__tip"></span><span>`+(n.options.hint.emojiTail||"")+`</span>
  114. </div>`,r.element.appendChild(o),k(n,o,r.element.firstElementChild,i.level),r.bindEvent(n),r}return Wr(t,e),t.prototype.bindEvent=function(n){var i=this;this.element.lastElementChild.addEventListener((0,a.Le)(),function(r){var o=(0,N.S)(r.target,"BUTTON");if(o){r.preventDefault();var s=o.getAttribute("data-value"),f=(0,M.zh)(n),b=s;if(n.currentMode==="wysiwyg"?b=n.lute.SpinVditorDOM(s):n.currentMode==="ir"&&(b=n.lute.SpinVditorIRDOM(s)),s.indexOf(":")>-1&&n.currentMode!=="sv"){var w=document.createElement("div");w.innerHTML=b,b=w.firstElementChild.firstElementChild.outerHTML+" ",(0,M.oC)(b,n)}else f.extractContents(),f.insertNode(document.createTextNode(s));f.collapse(!1),(0,M.Hc)(f),i.element.lastElementChild.style.display="none",ue(n)}}),this.element.lastElementChild.addEventListener("mouseover",function(r){var o=(0,N.S)(r.target,"BUTTON");o&&(i.element.querySelector(".vditor-emojis__tip").innerHTML=o.getAttribute("data-key"))})},t}(Le),In=function(e,t,n){var i=document.createElement("a");"download"in i?(i.download=n,i.style.display="none",i.href=URL.createObjectURL(new Blob([t])),document.body.appendChild(i),i.click(),i.remove()):e.tip.show(window.VditorI18n.downloadTip,0)},Kr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),Fr=function(e){function t(n,i){var r=e.call(this,n,i)||this,o=r.element.children[0],s=document.createElement("div");return s.className="vditor-hint"+(i.level===2?"":" vditor-panel--arrow"),s.innerHTML=`<button data-type="markdown">Markdown</button>
  115. <button data-type="pdf">PDF</button>
  116. <button data-type="html">HTML</button>`,s.addEventListener((0,a.Le)(),function(f){var b=f.target;if(b.tagName==="BUTTON"){switch(b.getAttribute("data-type")){case"markdown":(function(w){var y=u(w);In(w,y,y.substr(0,10)+".md")})(n);break;case"pdf":(function(w){w.tip.show(window.VditorI18n.generate,3800);var y=document.querySelector("#vditorExportIframe");y.contentDocument.open(),y.contentDocument.write('<link rel="stylesheet" href="'+w.options.cdn+`/dist/index.css"/>
  117. <script src="`+w.options.cdn+`/dist/method.min.js"><\/script>
  118. <div id="preview" style="width: 800px"></div>
  119. <script>
  120. window.addEventListener("message", (e) => {
  121. if(!e.data) {
  122. return;
  123. }
  124. Vditor.preview(document.getElementById('preview'), e.data, {
  125. markdown: {
  126. theme: "`+w.options.preview.theme+`"
  127. },
  128. hljs: {
  129. style: "`+w.options.preview.hljs.style+`"
  130. }
  131. });
  132. setTimeout(() => {
  133. window.print();
  134. }, 3600);
  135. }, false);
  136. <\/script>`),y.contentDocument.close(),setTimeout(function(){y.contentWindow.postMessage(u(w),"*")},200)})(n);break;case"html":(function(w){var y=Dn(w),x='<html><head><link rel="stylesheet" type="text/css" href="'+w.options.cdn+`/dist/index.css"/>
  137. <script src="`+w.options.cdn+"/dist/js/i18n/"+w.options.lang+`.js"><\/script>
  138. <script src="`+w.options.cdn+`/dist/method.min.js"><\/script></head>
  139. <body><div class="vditor-reset" id="preview">`+y+`</div>
  140. <script>
  141. const previewElement = document.getElementById('preview')
  142. Vditor.setContentTheme('`+w.options.preview.theme.current+"', '"+w.options.preview.theme.path+`');
  143. Vditor.codeRender(previewElement);
  144. Vditor.highlightRender(`+JSON.stringify(w.options.preview.hljs)+", previewElement, '"+w.options.cdn+`');
  145. Vditor.mathRender(previewElement, {
  146. cdn: '`+w.options.cdn+`',
  147. math: `+JSON.stringify(w.options.preview.math)+`,
  148. });
  149. Vditor.mermaidRender(previewElement, '`+w.options.cdn+"', '"+w.options.theme+`');
  150. Vditor.markmapRender(previewElement, '`+w.options.cdn+"', '"+w.options.theme+`');
  151. Vditor.flowchartRender(previewElement, '`+w.options.cdn+`');
  152. Vditor.graphvizRender(previewElement, '`+w.options.cdn+`');
  153. Vditor.chartRender(previewElement, '`+w.options.cdn+"', '"+w.options.theme+`');
  154. Vditor.mindmapRender(previewElement, '`+w.options.cdn+"', '"+w.options.theme+`');
  155. Vditor.abcRender(previewElement, '`+w.options.cdn+`');
  156. Vditor.mediaRender(previewElement);
  157. Vditor.speechRender(previewElement);
  158. <\/script>
  159. <script src="`+w.options.cdn+"/dist/js/icons/"+w.options.icon+'.js"><\/script></body></html>';In(w,x,y.substr(0,10)+".html")})(n)}E(n,["subToolbar"]),f.preventDefault(),f.stopPropagation()}}),r.element.appendChild(s),k(n,s,o,i.level),r}return Kr(t,e),t}(Le),Gr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),Xr=function(e){function t(n,i){var r=e.call(this,n,i)||this;return r._bindEvent(n,i),r}return Gr(t,e),t.prototype._bindEvent=function(n,i){this.element.children[0].addEventListener((0,a.Le)(),function(r){r.preventDefault(),n.element.className.includes("vditor--fullscreen")?(i.level||(this.innerHTML=i.icon),n.element.style.zIndex="",document.body.style.overflow="",n.element.classList.remove("vditor--fullscreen"),Object.keys(n.toolbar.elements).forEach(function(o){var s=n.toolbar.elements[o].firstChild;s&&(s.className=s.className.replace("__s","__n"))}),n.counter&&(n.counter.element.className=n.counter.element.className.replace("__s","__n"))):(i.level||(this.innerHTML='<svg><use xlink:href="#vditor-icon-contract"></use></svg>'),n.element.style.zIndex=n.options.fullscreen.index.toString(),document.body.style.overflow="hidden",n.element.classList.add("vditor--fullscreen"),Object.keys(n.toolbar.elements).forEach(function(o){var s=n.toolbar.elements[o].firstChild;s&&(s.className=s.className.replace("__n","__s"))}),n.counter&&(n.counter.element.className=n.counter.element.className.replace("__n","__s"))),n.devtools&&n.devtools.renderEchart(n),i.click&&i.click(r,n),me(n),ye(n)})},t}(Le),Jr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),Zr=function(e){function t(n,i){var r=e.call(this,n,i)||this,o=document.createElement("div");return o.className="vditor-hint vditor-panel--arrow",o.innerHTML='<button data-tag="h1" data-value="# ">'+window.VditorI18n.heading1+" "+(0,a.ns)("&lt;\u2325\u23181>")+`</button>
  160. <button data-tag="h2" data-value="## ">`+window.VditorI18n.heading2+" &lt;"+(0,a.ns)("\u2325\u23182")+`></button>
  161. <button data-tag="h3" data-value="### ">`+window.VditorI18n.heading3+" &lt;"+(0,a.ns)("\u2325\u23183")+`></button>
  162. <button data-tag="h4" data-value="#### ">`+window.VditorI18n.heading4+" &lt;"+(0,a.ns)("\u2325\u23184")+`></button>
  163. <button data-tag="h5" data-value="##### ">`+window.VditorI18n.heading5+" &lt;"+(0,a.ns)("\u2325\u23185")+`></button>
  164. <button data-tag="h6" data-value="###### ">`+window.VditorI18n.heading6+" &lt;"+(0,a.ns)("\u2325\u23186")+"></button>",r.element.appendChild(o),r._bindEvent(n,o),r}return Jr(t,e),t.prototype._bindEvent=function(n,i){var r=this.element.children[0];r.addEventListener((0,a.Le)(),function(s){s.preventDefault(),clearTimeout(n.wysiwyg.afterRenderTimeoutId),clearTimeout(n.ir.processTimeoutId),clearTimeout(n.sv.processTimeoutId),r.classList.contains(m.g.CLASS_MENU_DISABLED)||(r.blur(),r.classList.contains("vditor-menu--current")?(n.currentMode==="wysiwyg"?(jt(n),we(n)):n.currentMode==="ir"&&bt(n,""),r.classList.remove("vditor-menu--current")):(E(n,["subToolbar"]),i.style.display="block"))});for(var o=0;o<6;o++)i.children.item(o).addEventListener((0,a.Le)(),function(s){s.preventDefault(),n.currentMode==="wysiwyg"?(Lt(n,s.target.getAttribute("data-tag")),we(n),r.classList.add("vditor-menu--current")):n.currentMode==="ir"?(bt(n,s.target.getAttribute("data-value")),r.classList.add("vditor-menu--current")):un(n,s.target.getAttribute("data-value")),i.style.display="none"})},t}(Le),Qr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),$r=function(e){function t(n,i){var r=e.call(this,n,i)||this;return r.element.children[0].addEventListener((0,a.Le)(),function(o){o.preventDefault(),n.tip.show(`<div style="margin-bottom:14px;font-size: 14px;line-height: 22px;min-width:300px;max-width: 360px;display: flex;">
  165. <div style="margin-top: 14px;flex: 1">
  166. <div>Markdown \u4F7F\u7528\u6307\u5357</div>
  167. <ul style="list-style: none">
  168. <li><a href="https://ld246.com/article/1583308420519" target="_blank">\u8BED\u6CD5\u901F\u67E5\u624B\u518C</a></li>
  169. <li><a href="https://ld246.com/article/1583129520165" target="_blank">\u57FA\u7840\u8BED\u6CD5</a></li>
  170. <li><a href="https://ld246.com/article/1583305480675" target="_blank">\u6269\u5C55\u8BED\u6CD5</a></li>
  171. <li><a href="https://ld246.com/article/1582778815353" target="_blank">\u952E\u76D8\u5FEB\u6377\u952E</a></li>
  172. </ul>
  173. </div>
  174. <div style="margin-top: 14px;flex: 1">
  175. <div>Vditor \u652F\u6301</div>
  176. <ul style="list-style: none">
  177. <li><a href="https://github.com/Vanessa219/vditor/issues" target="_blank">Issues</a></li>
  178. <li><a href="https://ld246.com/tag/vditor" target="_blank">\u5B98\u65B9\u8BA8\u8BBA\u533A</a></li>
  179. <li><a href="https://ld246.com/article/1549638745630" target="_blank">\u5F00\u53D1\u624B\u518C</a></li>
  180. <li><a href="https://ld246.com/guide/markdown" target="_blank">\u6F14\u793A\u5730\u5740</a></li>
  181. </ul>
  182. </div></div>`,0)}),r}return Qr(t,e),t}(Le),Yr=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),ei=function(e){function t(n,i){var r=e.call(this,n,i)||this;return r.element.children[0].addEventListener((0,a.Le)(),function(o){if(o.preventDefault(),!r.element.firstElementChild.classList.contains(m.g.CLASS_MENU_DISABLED)&&n.currentMode!=="sv"){var s=(0,M.zh)(n),f=(0,h.lG)(s.startContainer,"LI");f&&yn(n,f,s)}}),r}return Yr(t,e),t}(Le),ti=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),ni=function(e){function t(n,i){var r=e.call(this,n,i)||this;return r.element.children[0].addEventListener((0,a.Le)(),function(o){o.preventDefault(),n.tip.show(`<div style="max-width: 520px; font-size: 14px;line-height: 22px;margin-bottom: 14px;">
  183. <p style="text-align: center;margin: 14px 0">
  184. <em>\u4E0B\u4E00\u4EE3\u7684 Markdown \u7F16\u8F91\u5668\uFF0C\u4E3A\u672A\u6765\u800C\u6784\u5EFA</em>
  185. </p>
  186. <div style="display: flex;margin-bottom: 14px;flex-wrap: wrap;align-items: center">
  187. <img src="https://unpkg.com/vditor/dist/images/logo.png" style="margin: 0 auto;height: 68px"/>
  188. <div>&nbsp;&nbsp;</div>
  189. <div style="flex: 1;min-width: 250px">
  190. Vditor \u662F\u4E00\u6B3E\u6D4F\u89C8\u5668\u7AEF\u7684 Markdown \u7F16\u8F91\u5668\uFF0C\u652F\u6301\u6240\u89C1\u5373\u6240\u5F97\u3001\u5373\u65F6\u6E32\u67D3\uFF08\u7C7B\u4F3C Typora\uFF09\u548C\u5206\u5C4F\u9884\u89C8\u6A21\u5F0F\u3002
  191. \u5B83\u4F7F\u7528 TypeScript \u5B9E\u73B0\uFF0C\u652F\u6301\u539F\u751F JavaScript \u4EE5\u53CA Vue\u3001React\u3001Angular \u548C Svelte \u7B49\u6846\u67B6\u3002
  192. </div>
  193. </div>
  194. <div style="display: flex;flex-wrap: wrap;">
  195. <ul style="list-style: none;flex: 1;min-width:148px">
  196. <li>
  197. \u9879\u76EE\u5730\u5740\uFF1A<a href="https://b3log.org/vditor" target="_blank">b3log.org/vditor</a>
  198. </li>
  199. <li>
  200. \u5F00\u6E90\u534F\u8BAE\uFF1AMIT
  201. </li>
  202. </ul>
  203. <ul style="list-style: none;margin-right: 18px">
  204. <li>
  205. \u7EC4\u4EF6\u7248\u672C\uFF1AVditor v`+m.H+" / Lute v"+Lute.Version+`
  206. </li>
  207. <li>
  208. \u8D5E\u52A9\u6350\u8D60\uFF1A<a href="https://ld246.com/sponsor" target="_blank">https://ld246.com/sponsor</a>
  209. </li>
  210. </ul>
  211. </div>
  212. </div>`,0)}),r}return ti(t,e),t}(Le),ri=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),ii=function(e){function t(n,i){var r=e.call(this,n,i)||this;return r.element.children[0].addEventListener((0,a.Le)(),function(o){o.preventDefault(),r.element.firstElementChild.classList.contains(m.g.CLASS_MENU_DISABLED)||n.currentMode==="sv"||_t(n,"afterend")}),r}return ri(t,e),t}(Le),oi=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),ai=function(e){function t(n,i){var r=e.call(this,n,i)||this;return r.element.children[0].addEventListener((0,a.Le)(),function(o){o.preventDefault(),r.element.firstElementChild.classList.contains(m.g.CLASS_MENU_DISABLED)||n.currentMode==="sv"||_t(n,"beforebegin")}),r}return oi(t,e),t}(Le),si=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),li=function(e){function t(n,i){var r=e.call(this,n,i)||this;return r.element.children[0].addEventListener((0,a.Le)(),function(o){if(o.preventDefault(),!r.element.firstElementChild.classList.contains(m.g.CLASS_MENU_DISABLED)&&n.currentMode!=="sv"){var s=(0,M.zh)(n),f=(0,h.lG)(s.startContainer,"LI");f&&Gt(n,f,s,f.parentElement)}}),r}return si(t,e),t}(Le),ci=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),di=function(e){function t(n,i){var r=e.call(this,n,i)||this;return n.options.outline&&r.element.firstElementChild.classList.add("vditor-menu--current"),r.element.children[0].addEventListener((0,a.Le)(),function(o){o.preventDefault(),n.toolbar.elements.outline.firstElementChild.classList.contains(m.g.CLASS_MENU_DISABLED)||(n.options.outline.enable=!r.element.firstElementChild.classList.contains("vditor-menu--current"),n.outline.toggle(n,n.options.outline.enable))}),r}return ci(t,e),t}(Le),ui=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),pi=function(e){function t(n,i){var r=e.call(this,n,i)||this;return r._bindEvent(n),r}return ui(t,e),t.prototype._bindEvent=function(n){var i=this;this.element.children[0].addEventListener((0,a.Le)(),function(r){r.preventDefault();var o=i.element.firstElementChild;if(!o.classList.contains(m.g.CLASS_MENU_DISABLED)){var s=m.g.EDIT_TOOLBARS.concat(["both","edit-mode","devtools"]);o.classList.contains("vditor-menu--current")?(o.classList.remove("vditor-menu--current"),n.currentMode==="sv"?(n.sv.element.style.display="block",n.options.preview.mode==="both"?n.preview.element.style.display="block":n.preview.element.style.display="none"):(n[n.currentMode].element.parentElement.style.display="block",n.preview.element.style.display="none"),v(n.toolbar.elements,s),n.outline.render(n)):(L(n.toolbar.elements,s),n.preview.element.style.display="block",n.currentMode==="sv"?n.sv.element.style.display="none":n[n.currentMode].element.parentElement.style.display="none",n.preview.render(n),o.classList.add("vditor-menu--current"),E(n,["subToolbar","hint","popover"]),setTimeout(function(){n.outline.render(n)},n.options.preview.delay+10)),me(n)}})},t}(Le),mi=function(){function e(t){var n;if(this.SAMPLE_RATE=5e3,this.isRecording=!1,this.readyFlag=!1,this.leftChannel=[],this.rightChannel=[],this.recordingLength=0,typeof AudioContext<"u")n=new AudioContext;else{if(!webkitAudioContext)return;n=new webkitAudioContext}this.DEFAULT_SAMPLE_RATE=n.sampleRate;var i=n.createGain();n.createMediaStreamSource(t).connect(i),this.recorder=n.createScriptProcessor(2048,2,1),this.recorder.onaudioprocess=null,i.connect(this.recorder),this.recorder.connect(n.destination),this.readyFlag=!0}return e.prototype.cloneChannelData=function(t,n){this.leftChannel.push(new Float32Array(t)),this.rightChannel.push(new Float32Array(n)),this.recordingLength+=2048},e.prototype.startRecordingNewWavFile=function(){this.readyFlag&&(this.isRecording=!0,this.leftChannel.length=this.rightChannel.length=0,this.recordingLength=0)},e.prototype.stopRecording=function(){this.isRecording=!1},e.prototype.buildWavFileBlob=function(){for(var t=this.mergeBuffers(this.leftChannel),n=this.mergeBuffers(this.rightChannel),i=new Float32Array(t.length),r=0;r<t.length;++r)i[r]=.5*(t[r]+n[r]);this.DEFAULT_SAMPLE_RATE>this.SAMPLE_RATE&&(i=this.downSampleBuffer(i,this.SAMPLE_RATE));var o=44+2*i.length,s=new ArrayBuffer(o),f=new DataView(s);this.writeUTFBytes(f,0,"RIFF"),f.setUint32(4,o,!0),this.writeUTFBytes(f,8,"WAVE"),this.writeUTFBytes(f,12,"fmt "),f.setUint32(16,16,!0),f.setUint16(20,1,!0),f.setUint16(22,1,!0),f.setUint32(24,this.SAMPLE_RATE,!0),f.setUint32(28,2*this.SAMPLE_RATE,!0),f.setUint16(32,2,!0),f.setUint16(34,16,!0);var b=2*i.length;this.writeUTFBytes(f,36,"data"),f.setUint32(40,b,!0);for(var w=i.length,y=44,x=0;x<w;x++)f.setInt16(y,32767*i[x],!0),y+=2;return new Blob([f],{type:"audio/wav"})},e.prototype.downSampleBuffer=function(t,n){if(n===this.DEFAULT_SAMPLE_RATE||n>this.DEFAULT_SAMPLE_RATE)return t;for(var i=this.DEFAULT_SAMPLE_RATE/n,r=Math.round(t.length/i),o=new Float32Array(r),s=0,f=0;s<o.length;){for(var b=Math.round((s+1)*i),w=0,y=0,x=f;x<b&&x<t.length;x++)w+=t[x],y++;o[s]=w/y,s++,f=b}return o},e.prototype.mergeBuffers=function(t){for(var n=new Float32Array(this.recordingLength),i=0,r=t.length,o=0;o<r;++o){var s=t[o];n.set(s,i),i+=s.length}return n},e.prototype.writeUTFBytes=function(t,n,i){for(var r=i.length,o=0;o<r;o++)t.setUint8(n+o,i.charCodeAt(o))},e}(),fi=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),hi=function(e){function t(n,i){var r=e.call(this,n,i)||this;return r._bindEvent(n),r}return fi(t,e),t.prototype._bindEvent=function(n){var i,r=this;this.element.children[0].addEventListener((0,a.Le)(),function(o){if(o.preventDefault(),!r.element.firstElementChild.classList.contains(m.g.CLASS_MENU_DISABLED)){var s=n[n.currentMode].element;if(i)if(i.isRecording){i.stopRecording(),n.tip.hide();var f=new File([i.buildWavFileBlob()],"record"+new Date().getTime()+".wav",{type:"video/webm"});Ft(n,[f]),r.element.children[0].classList.remove("vditor-menu--current")}else n.tip.show(window.VditorI18n.recording),s.setAttribute("contenteditable","false"),i.startRecordingNewWavFile(),r.element.children[0].classList.add("vditor-menu--current");else navigator.mediaDevices.getUserMedia({audio:!0}).then(function(b){(i=new mi(b)).recorder.onaudioprocess=function(w){if(i.isRecording){var y=w.inputBuffer.getChannelData(0),x=w.inputBuffer.getChannelData(1);i.cloneChannelData(y,x)}},i.startRecordingNewWavFile(),n.tip.show(window.VditorI18n.recording),s.setAttribute("contenteditable","false"),r.element.children[0].classList.add("vditor-menu--current")}).catch(function(){n.tip.show(window.VditorI18n["record-tip"])})}})},t}(Le),vi=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),gi=function(e){function t(n,i){var r=e.call(this,n,i)||this;return L({redo:r.element},["redo"]),r.element.children[0].addEventListener((0,a.Le)(),function(o){o.preventDefault(),r.element.firstElementChild.classList.contains(m.g.CLASS_MENU_DISABLED)||n.undo.redo(n)}),r}return vi(t,e),t}(Le),yi=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),bi=function(e){function t(n,i){var r=e.call(this,n,i)||this;return L({undo:r.element},["undo"]),r.element.children[0].addEventListener((0,a.Le)(),function(o){o.preventDefault(),r.element.firstElementChild.classList.contains(m.g.CLASS_MENU_DISABLED)||n.undo.undo(n)}),r}return yi(t,e),t}(Le),wi=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}(),Ei=function(e){function t(n,i){var r=e.call(this,n,i)||this,o='<input type="file"';return n.options.upload.multiple&&(o+=' multiple="multiple"'),n.options.upload.accept&&(o+=' accept="'+n.options.upload.accept+'"'),r.element.children[0].innerHTML=""+(i.icon||'<svg><use xlink:href="#vditor-icon-upload"></use></svg>')+o+">",r._bindEvent(n),r}return wi(t,e),t.prototype._bindEvent=function(n){var i=this;this.element.children[0].addEventListener((0,a.Le)(),function(r){if(i.element.firstElementChild.classList.contains(m.g.CLASS_MENU_DISABLED))return r.stopPropagation(),void r.preventDefault()}),this.element.querySelector("input").addEventListener("change",function(r){if(i.element.firstElementChild.classList.contains(m.g.CLASS_MENU_DISABLED))return r.stopPropagation(),void r.preventDefault();r.target.files.length!==0&&Ft(n,r.target.files,r.target)})},t}(Le),Si=function(){function e(t){var n=this,i=t.options;this.elements={},this.element=document.createElement("div"),this.element.className="vditor-toolbar",i.toolbar.forEach(function(r,o){var s=n.genItem(t,r,o);if(n.element.appendChild(s),r.toolbar){var f=document.createElement("div");f.className="vditor-hint vditor-panel--arrow",f.addEventListener((0,a.Le)(),function(b){f.style.display="none"}),r.toolbar.forEach(function(b,w){b.level=2,f.appendChild(n.genItem(t,b,o+w))}),s.appendChild(f),k(t,f,s.children[0])}}),t.options.toolbarConfig.hide&&this.element.classList.add("vditor-toolbar--hide"),t.options.toolbarConfig.pin&&this.element.classList.add("vditor-toolbar--pin"),t.options.counter.enable&&(t.counter=new jr(t),this.element.appendChild(t.counter.element))}return e.prototype.genItem=function(t,n,i){var r;switch(n.name){case"bold":case"italic":case"more":case"strike":case"line":case"quote":case"list":case"ordered-list":case"check":case"code":case"inline-code":case"link":case"table":r=new Le(t,n);break;case"emoji":r=new zr(t,n);break;case"headings":r=new Zr(t,n);break;case"|":r=new Ur;break;case"br":r=new Nr;break;case"undo":r=new bi(t,n);break;case"redo":r=new gi(t,n);break;case"help":r=new $r(t,n);break;case"both":r=new Hr(t,n);break;case"preview":r=new pi(t,n);break;case"fullscreen":r=new Xr(t,n);break;case"upload":r=new Ei(t,n);break;case"record":r=new hi(t,n);break;case"info":r=new ni(t,n);break;case"edit-mode":r=new sr(t,n);break;case"devtools":r=new Vr(t,n);break;case"outdent":r=new li(t,n);break;case"indent":r=new ei(t,n);break;case"outline":r=new di(t,n);break;case"insert-after":r=new ii(t,n);break;case"insert-before":r=new ai(t,n);break;case"code-theme":r=new Or(t,n);break;case"content-theme":r=new Ir(t,n);break;case"export":r=new Fr(t,n);break;default:r=new qr(t,n)}if(r){var o=n.name;return o!=="br"&&o!=="|"||(o+=i),this.elements[o]=r.element,r.element}},e}(),ki=F(471),Li=function(){function e(){this.stackSize=50,this.resetStack(),this.dmp=new ki}return e.prototype.clearStack=function(t){this.resetStack(),this.resetIcon(t)},e.prototype.resetIcon=function(t){t.toolbar&&(this[t.currentMode].undoStack.length>1?v(t.toolbar.elements,["undo"]):L(t.toolbar.elements,["undo"]),this[t.currentMode].redoStack.length!==0?v(t.toolbar.elements,["redo"]):L(t.toolbar.elements,["redo"]))},e.prototype.undo=function(t){if(t[t.currentMode].element.getAttribute("contenteditable")!=="false"&&!(this[t.currentMode].undoStack.length<2)){var n=this[t.currentMode].undoStack.pop();n&&(this[t.currentMode].redoStack.push(n),this.renderDiff(n,t),this[t.currentMode].hasUndo=!0,E(t,["hint"]))}},e.prototype.redo=function(t){if(t[t.currentMode].element.getAttribute("contenteditable")!=="false"){var n=this[t.currentMode].redoStack.pop();n&&(this[t.currentMode].undoStack.push(n),this.renderDiff(n,t,!0))}},e.prototype.recordFirstPosition=function(t,n){if(getSelection().rangeCount!==0&&!(this[t.currentMode].undoStack.length!==1||this[t.currentMode].undoStack[0].length===0||this[t.currentMode].redoStack.length>0||(0,a.vU)()&&n.key==="Backspace"||(0,a.G6)())){var i=this.addCaret(t);i.replace("<wbr>","").replace(" vditor-ir__node--expand","")===this[t.currentMode].undoStack[0][0].diffs[0][1].replace("<wbr>","")&&(this[t.currentMode].undoStack[0][0].diffs[0][1]=i,this[t.currentMode].lastText=i)}},e.prototype.addToUndoStack=function(t){var n=this.addCaret(t,!0),i=this.dmp.diff_main(n,this[t.currentMode].lastText,!0),r=this.dmp.patch_make(n,this[t.currentMode].lastText,i);r.length===0&&this[t.currentMode].undoStack.length>0||(this[t.currentMode].lastText=n,this[t.currentMode].undoStack.push(r),this[t.currentMode].undoStack.length>this.stackSize&&this[t.currentMode].undoStack.shift(),this[t.currentMode].hasUndo&&(this[t.currentMode].redoStack=[],this[t.currentMode].hasUndo=!1,L(t.toolbar.elements,["redo"])),this[t.currentMode].undoStack.length>1&&v(t.toolbar.elements,["undo"]))},e.prototype.renderDiff=function(t,n,i){var r;if(i===void 0&&(i=!1),i){var o=this.dmp.patch_deepCopy(t).reverse();o.forEach(function(f){f.diffs.forEach(function(b){b[0]=-b[0]})}),r=this.dmp.patch_apply(o,this[n.currentMode].lastText)[0]}else r=this.dmp.patch_apply(t,this[n.currentMode].lastText)[0];if(this[n.currentMode].lastText=r,n[n.currentMode].element.innerHTML=r,n.currentMode!=="sv"&&n[n.currentMode].element.querySelectorAll(".vditor-"+n.currentMode+"__preview[data-render='2']").forEach(function(f){ge(f,n)}),n[n.currentMode].element.querySelector("wbr"))(0,M.ib)(n[n.currentMode].element,n[n.currentMode].element.ownerDocument.createRange()),Me(n);else{var s=getSelection().getRangeAt(0);s.setEndBefore(n[n.currentMode].element),s.collapse(!1)}he(n),ue(n,{enableAddUndoStack:!1,enableHint:!1,enableInput:!0}),it(n),n[n.currentMode].element.querySelectorAll(".vditor-"+n.currentMode+"__preview[data-render='2']").forEach(function(f){ge(f,n)}),this[n.currentMode].undoStack.length>1?v(n.toolbar.elements,["undo"]):L(n.toolbar.elements,["undo"]),this[n.currentMode].redoStack.length!==0?v(n.toolbar.elements,["redo"]):L(n.toolbar.elements,["redo"])},e.prototype.resetStack=function(){this.ir={hasUndo:!1,lastText:"",redoStack:[],undoStack:[]},this.sv={hasUndo:!1,lastText:"",redoStack:[],undoStack:[]},this.wysiwyg={hasUndo:!1,lastText:"",redoStack:[],undoStack:[]}},e.prototype.addCaret=function(t,n){var i;if(n===void 0&&(n=!1),getSelection().rangeCount!==0&&!t[t.currentMode].element.querySelector("wbr")){var r=getSelection().getRangeAt(0);if(t[t.currentMode].element.contains(r.startContainer)){i=r.cloneRange();var o=document.createElement("span");o.className="vditor-wbr",r.insertNode(o)}}t.ir.element.cloneNode(!0).querySelectorAll(".vditor-"+t.currentMode+"__preview[data-render='1']").forEach(function(f){f.firstElementChild&&(f.firstElementChild.classList.contains("language-echarts")||f.firstElementChild.classList.contains("language-plantuml")||f.firstElementChild.classList.contains("language-mindmap")?(f.firstElementChild.removeAttribute("_echarts_instance_"),f.firstElementChild.removeAttribute("data-processed"),f.firstElementChild.innerHTML=f.previousElementSibling.firstElementChild.innerHTML,f.setAttribute("data-render","2")):f.firstElementChild.classList.contains("language-math")&&(f.setAttribute("data-render","2"),f.firstElementChild.textContent=f.firstElementChild.getAttribute("data-math"),f.firstElementChild.removeAttribute("data-math")))});var s=t[t.currentMode].element.innerHTML;return t[t.currentMode].element.querySelectorAll(".vditor-wbr").forEach(function(f){f.remove()}),n&&i&&(0,M.Hc)(i),s.replace('<span class="vditor-wbr"></span>',"<wbr>")},e}(),Ti=F(640),Mi=function(){function e(t){this.defaultOptions={rtl:!1,after:void 0,cache:{enable:!0},cdn:m.g.CDN,classes:{preview:""},comment:{enable:!1},counter:{enable:!1,type:"markdown"},debugger:!1,fullscreen:{index:90},height:"auto",hint:{delay:200,emoji:{"+1":"\u{1F44D}","-1":"\u{1F44E}",confused:"\u{1F615}",eyes:"\u{1F440}\uFE0F",heart:"\u2764\uFE0F",rocket:"\u{1F680}\uFE0F",smile:"\u{1F604}",tada:"\u{1F389}\uFE0F"},emojiPath:m.g.CDN+"/dist/images/emoji",extend:[],parse:!0},icon:"ant",lang:"zh_CN",mode:"ir",outline:{enable:!1,position:"left"},placeholder:"",preview:{actions:["desktop","tablet","mobile","mp-wechat","zhihu"],delay:1e3,hljs:m.g.HLJS_OPTIONS,markdown:m.g.MARKDOWN_OPTIONS,math:m.g.MATH_OPTIONS,maxWidth:800,mode:"both",theme:m.g.THEME_OPTIONS},link:{isOpen:!0},image:{isPreview:!0},resize:{enable:!1,position:"bottom"},theme:"classic",toolbar:["emoji","headings","bold","italic","strike","link","|","list","ordered-list","check","outdent","indent","|","quote","line","code","inline-code","insert-before","insert-after","|","upload","record","table","|","undo","redo","|","fullscreen","edit-mode",{name:"more",toolbar:["both","code-theme","content-theme","export","outline","preview","devtools","info","help"]}],toolbarConfig:{hide:!1,pin:!1},typewriterMode:!1,undoDelay:800,upload:{extraData:{},fieldName:"file[]",filename:function(n){return n.replace(/\W/g,"")},linkToImgUrl:"",max:10485760,multiple:!0,url:"",withCredentials:!1},value:"",width:"auto"},this.options=t}return e.prototype.merge=function(){var t,n,i;this.options&&(this.options.toolbar?this.options.toolbar=this.mergeToolbar(this.options.toolbar):this.options.toolbar=this.mergeToolbar(this.defaultOptions.toolbar),!((n=(t=this.options.preview)===null||t===void 0?void 0:t.theme)===null||n===void 0)&&n.list&&(this.defaultOptions.preview.theme.list=this.options.preview.theme.list),!((i=this.options.hint)===null||i===void 0)&&i.emoji&&(this.defaultOptions.hint.emoji=this.options.hint.emoji),this.options.comment&&(this.defaultOptions.comment=this.options.comment));var r=(0,Ti.T)(this.defaultOptions,this.options);if(r.cache.enable&&!r.cache.id)throw new Error("need options.cache.id, see https://ld246.com/article/1549638745630#options");return r},e.prototype.mergeToolbar=function(t){var n=this,i=[{icon:'<svg><use xlink:href="#vditor-icon-export"></use></svg>',name:"export",tipPosition:"ne"},{hotkey:"\u2318E",icon:'<svg><use xlink:href="#vditor-icon-emoji"></use></svg>',name:"emoji",tipPosition:"ne"},{hotkey:"\u2318H",icon:'<svg><use xlink:href="#vditor-icon-headings"></use></svg>',name:"headings",tipPosition:"ne"},{hotkey:"\u2318B",icon:'<svg><use xlink:href="#vditor-icon-bold"></use></svg>',name:"bold",prefix:"**",suffix:"**",tipPosition:"ne"},{hotkey:"\u2318I",icon:'<svg><use xlink:href="#vditor-icon-italic"></use></svg>',name:"italic",prefix:"*",suffix:"*",tipPosition:"ne"},{hotkey:"\u2318D",icon:'<svg><use xlink:href="#vditor-icon-strike"></use></svg>',name:"strike",prefix:"~~",suffix:"~~",tipPosition:"ne"},{hotkey:"\u2318K",icon:'<svg><use xlink:href="#vditor-icon-link"></use></svg>',name:"link",prefix:"[",suffix:"](https://)",tipPosition:"n"},{name:"|"},{hotkey:"\u2318L",icon:'<svg><use xlink:href="#vditor-icon-list"></use></svg>',name:"list",prefix:"* ",tipPosition:"n"},{hotkey:"\u2318O",icon:'<svg><use xlink:href="#vditor-icon-ordered-list"></use></svg>',name:"ordered-list",prefix:"1. ",tipPosition:"n"},{hotkey:"\u2318J",icon:'<svg><use xlink:href="#vditor-icon-check"></use></svg>',name:"check",prefix:"* [ ] ",tipPosition:"n"},{hotkey:"\u21E7\u2318I",icon:'<svg><use xlink:href="#vditor-icon-outdent"></use></svg>',name:"outdent",tipPosition:"n"},{hotkey:"\u21E7\u2318O",icon:'<svg><use xlink:href="#vditor-icon-indent"></use></svg>',name:"indent",tipPosition:"n"},{name:"|"},{hotkey:"\u2318;",icon:'<svg><use xlink:href="#vditor-icon-quote"></use></svg>',name:"quote",prefix:"> ",tipPosition:"n"},{hotkey:"\u21E7\u2318H",icon:'<svg><use xlink:href="#vditor-icon-line"></use></svg>',name:"line",prefix:"---",tipPosition:"n"},{hotkey:"\u2318U",icon:'<svg><use xlink:href="#vditor-icon-code"></use></svg>',name:"code",prefix:"```",suffix:"\n```",tipPosition:"n"},{hotkey:"\u2318G",icon:'<svg><use xlink:href="#vditor-icon-inline-code"></use></svg>',name:"inline-code",prefix:"`",suffix:"`",tipPosition:"n"},{hotkey:"\u21E7\u2318B",icon:'<svg><use xlink:href="#vditor-icon-before"></use></svg>',name:"insert-before",tipPosition:"n"},{hotkey:"\u21E7\u2318E",icon:'<svg><use xlink:href="#vditor-icon-after"></use></svg>',name:"insert-after",tipPosition:"n"},{name:"|"},{icon:'<svg><use xlink:href="#vditor-icon-upload"></use></svg>',name:"upload",tipPosition:"n"},{icon:'<svg><use xlink:href="#vditor-icon-record"></use></svg>',name:"record",tipPosition:"n"},{hotkey:"\u2318M",icon:'<svg><use xlink:href="#vditor-icon-table"></use></svg>',name:"table",prefix:"| col1",suffix:` | col2 | col3 |
  213. | --- | --- | --- |
  214. | | | |
  215. | | | |`,tipPosition:"n"},{name:"|"},{hotkey:"\u2318Z",icon:'<svg><use xlink:href="#vditor-icon-undo"></use></svg>',name:"undo",tipPosition:"nw"},{hotkey:"\u2318Y",icon:'<svg><use xlink:href="#vditor-icon-redo"></use></svg>',name:"redo",tipPosition:"nw"},{name:"|"},{icon:'<svg><use xlink:href="#vditor-icon-more"></use></svg>',name:"more",tipPosition:"e"},{hotkey:"\u2318'",icon:'<svg><use xlink:href="#vditor-icon-fullscreen"></use></svg>',name:"fullscreen",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-edit"></use></svg>',name:"edit-mode",tipPosition:"nw"},{hotkey:"\u2318P",icon:'<svg><use xlink:href="#vditor-icon-both"></use></svg>',name:"both",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-preview"></use></svg>',name:"preview",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-align-center"></use></svg>',name:"outline",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-theme"></use></svg>',name:"content-theme",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-code-theme"></use></svg>',name:"code-theme",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-bug"></use></svg>',name:"devtools",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-info"></use></svg>',name:"info",tipPosition:"nw"},{icon:'<svg><use xlink:href="#vditor-icon-help"></use></svg>',name:"help",tipPosition:"nw"},{name:"br"}],r=[];return t.forEach(function(o){var s=o;i.forEach(function(f){typeof o=="string"&&f.name===o&&(s=f),typeof o=="object"&&f.name===o.name&&(s=Object.assign({},f,o))}),o.toolbar&&(s.toolbar=n.mergeToolbar(o.toolbar)),r.push(s)}),r},e}(),_i=function(){function e(t){var n=this;this.composingLock=!1,this.commentIds=[];var i=document.createElement("div");i.className="vditor-wysiwyg",i.innerHTML='<pre class="vditor-reset" placeholder="'+t.options.placeholder+`"
  216. contenteditable="true" spellcheck="false"></pre>
  217. <div class="vditor-panel vditor-panel--none"></div>
  218. <div class="vditor-panel vditor-panel--none">
  219. <button type="button" aria-label="`+window.VditorI18n.comment+`" class="vditor-icon vditor-tooltipped vditor-tooltipped__n">
  220. <svg><use xlink:href="#vditor-icon-comment"></use></svg>
  221. </button>
  222. </div>`,this.element=i.firstElementChild,this.popover=i.firstElementChild.nextElementSibling,this.selectPopover=i.lastElementChild,this.bindEvent(t),qt(t,this.element),ln(t,this.element),Bt(t,this.element),zt(t,this.element),Kt(t,this.element),Vt(t,this.element),Ut(t,this.element,this.copy),Wt(t,this.element,this.copy),t.options.comment.enable&&(this.selectPopover.querySelector("button").onclick=function(){var r,o,s=Lute.NewNodeID(),f=getSelection().getRangeAt(0),b=f.cloneRange(),w=f.extractContents(),y=!1,x=!1;w.childNodes.forEach(function(C,R){var K=!1;if(C.nodeType===3?K=!0:C.classList.contains("vditor-comment")?C.classList.contains("vditor-comment")&&C.setAttribute("data-cmtids",C.getAttribute("data-cmtids")+" "+s):K=!0,K)if(C.nodeType!==3&&C.getAttribute("data-block")==="0"&&R===0&&b.startOffset>0)C.innerHTML='<span class="vditor-comment" data-cmtids="'+s+'">'+C.innerHTML+"</span>",r=C;else if(C.nodeType!==3&&C.getAttribute("data-block")==="0"&&R===w.childNodes.length-1&&b.endOffset<b.endContainer.textContent.length)C.innerHTML='<span class="vditor-comment" data-cmtids="'+s+'">'+C.innerHTML+"</span>",o=C;else if(C.nodeType!==3&&C.getAttribute("data-block")==="0")R===0?y=!0:R===w.childNodes.length-1&&(x=!0),C.innerHTML='<span class="vditor-comment" data-cmtids="'+s+'">'+C.innerHTML+"</span>";else{var W=document.createElement("span");W.classList.add("vditor-comment"),W.setAttribute("data-cmtids",s),C.parentNode.insertBefore(W,C),W.appendChild(C)}});var j=(0,h.F9)(b.startContainer);j&&(r?(j.insertAdjacentHTML("beforeend",r.innerHTML),r.remove()):j.textContent.trim().replace(m.g.ZWSP,"")===""&&y&&j.remove());var B=(0,h.F9)(b.endContainer);B&&(o?(B.insertAdjacentHTML("afterbegin",o.innerHTML),o.remove()):B.textContent.trim().replace(m.g.ZWSP,"")===""&&x&&B.remove()),f.insertNode(w),t.options.comment.add(s,f.toString(),n.getComments(t,!0)),we(t,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),n.hideComment()})}return e.prototype.getComments=function(t,n){var i=this;if(n===void 0&&(n=!1),t.currentMode!=="wysiwyg"||!t.options.comment.enable)return[];this.commentIds=[],this.element.querySelectorAll(".vditor-comment").forEach(function(o){i.commentIds=i.commentIds.concat(o.getAttribute("data-cmtids").split(" "))}),this.commentIds=Array.from(new Set(this.commentIds));var r=[];return n?(this.commentIds.forEach(function(o){r.push({id:o,top:i.element.querySelector('.vditor-comment[data-cmtids="'+o+'"]').offsetTop})}),r):void 0},e.prototype.triggerRemoveComment=function(t){var n,i,r;if(t.currentMode==="wysiwyg"&&t.options.comment.enable&&t.wysiwyg.commentIds.length>0){var o=JSON.parse(JSON.stringify(this.commentIds));this.getComments(t);var s=(n=o,i=this.commentIds,r=new Set(i),n.filter(function(f){return!r.has(f)}));s.length>0&&t.options.comment.remove(s)}},e.prototype.showComment=function(){var t=(0,M.Ny)(this.element);this.selectPopover.setAttribute("style","left:"+t.left+"px;display:block;top:"+Math.max(-8,t.top-21)+"px")},e.prototype.hideComment=function(){this.selectPopover.setAttribute("style","display:none")},e.prototype.unbindListener=function(){window.removeEventListener("scroll",this.scrollListener)},e.prototype.copy=function(t,n){var i=getSelection().getRangeAt(0);if(i.toString()!==""){t.stopPropagation(),t.preventDefault();var r=(0,h.lG)(i.startContainer,"CODE"),o=(0,h.lG)(i.endContainer,"CODE");if(r&&o&&o.isSameNode(r)){var s="";return s=r.parentElement.tagName==="PRE"?i.toString():"`"+i.toString()+"`",t.clipboardData.setData("text/plain",s),void t.clipboardData.setData("text/html","")}var f=(0,h.lG)(i.startContainer,"A"),b=(0,h.lG)(i.endContainer,"A");if(f&&b&&b.isSameNode(f)){var w=f.getAttribute("title")||"";return w&&(w=' "'+w+'"'),t.clipboardData.setData("text/plain","["+i.toString()+"]("+f.getAttribute("href")+w+")"),void t.clipboardData.setData("text/html","")}var y=document.createElement("div");y.appendChild(i.cloneContents()),t.clipboardData.setData("text/plain",n.lute.VditorDOM2Md(y.innerHTML).trim()),t.clipboardData.setData("text/html","")}},e.prototype.bindEvent=function(t){var n=this;this.unbindListener(),window.addEventListener("scroll",this.scrollListener=function(){if(E(t,["hint"]),n.popover.style.display==="block"&&n.selectPopover.style.display==="block"){var i=parseInt(n.popover.getAttribute("data-top"),10);if(t.options.height==="auto"){if(t.options.toolbarConfig.pin){var r=Math.max(i,window.scrollY-t.element.offsetTop-8)+"px";n.popover.style.display==="block"&&(n.popover.style.top=r),n.selectPopover.style.display==="block"&&(n.selectPopover.style.top=r)}}else if(t.options.toolbarConfig.pin&&t.toolbar.element.getBoundingClientRect().top===0){var o=Math.max(window.scrollY-t.element.offsetTop-8,Math.min(i-t.wysiwyg.element.scrollTop,n.element.clientHeight-21))+"px";n.popover.style.display==="block"&&(n.popover.style.top=o),n.selectPopover.style.display==="block"&&(n.selectPopover.style.top=o)}}}),this.element.addEventListener("scroll",function(){if(E(t,["hint"]),t.options.comment&&t.options.comment.enable&&t.options.comment.scroll&&t.options.comment.scroll(t.wysiwyg.element.scrollTop),n.popover.style.display==="block"){var i=parseInt(n.popover.getAttribute("data-top"),10)-t.wysiwyg.element.scrollTop,r=-8;t.options.toolbarConfig.pin&&t.toolbar.element.getBoundingClientRect().top===0&&(r=window.scrollY-t.element.offsetTop+r);var o=Math.max(r,Math.min(i,n.element.clientHeight-21))+"px";n.popover.style.top=o,n.selectPopover.style.top=o}}),this.element.addEventListener("paste",function(i){Ht(t,i,{pasteCode:function(r){var o=(0,M.zh)(t),s=document.createElement("template");s.innerHTML=r,o.insertNode(s.content.cloneNode(!0));var f=(0,h.a1)(o.startContainer,"data-block","0");f?f.outerHTML=t.lute.SpinVditorDOM(f.outerHTML):t.wysiwyg.element.innerHTML=t.lute.SpinVditorDOM(t.wysiwyg.element.innerHTML),(0,M.ib)(t.wysiwyg.element,o)}})}),this.element.addEventListener("compositionstart",function(){n.composingLock=!0}),this.element.addEventListener("compositionend",function(i){var r=(0,N.W)(getSelection().getRangeAt(0).startContainer);r&&r.textContent===""?he(t):((0,a.vU)()||Mt(t,getSelection().getRangeAt(0).cloneRange(),i),n.composingLock=!1)}),this.element.addEventListener("input",function(i){if(i.inputType!=="deleteByDrag"&&i.inputType!=="insertFromDrop"){if(n.preventInput)return n.preventInput=!1,void we(t);if(n.composingLock||i.data==="\u2018"||i.data==="\u201C"||i.data==="\u300A")we(t);else{var r=getSelection().getRangeAt(0),o=(0,h.F9)(r.startContainer);if(o||(on(t,r),o=(0,h.F9)(r.startContainer)),o){for(var s=(0,M.im)(o,t.wysiwyg.element,r).start,f=!0,b=s-1;b>o.textContent.substr(0,s).lastIndexOf(`
  223. `);b--)if(o.textContent.charAt(b)!==" "&&o.textContent.charAt(b)!==" "){f=!1;break}s===0&&(f=!1);var w=!0;for(b=s-1;b<o.textContent.length;b++)if(o.textContent.charAt(b)!==" "&&o.textContent.charAt(b)!==`
  224. `){w=!1;break}var y=(0,N.W)(getSelection().getRangeAt(0).startContainer);y&&y.textContent===""&&(he(t),y.remove()),f&&o.getAttribute("data-type")!=="code-block"||w||Jt(o.innerHTML)||Xt(o.innerHTML)&&o.previousElementSibling?typeof t.options.input=="function"&&t.options.input(u(t)):Mt(t,r,i)}}}}),this.element.addEventListener("click",function(i){if(i.target.tagName==="INPUT"){var r=i.target;return r.checked?r.setAttribute("checked","checked"):r.removeAttribute("checked"),n.preventInput=!0,void we(t)}if(i.target.tagName!=="IMG"||i.target.parentElement.classList.contains("vditor-wysiwyg__preview")){if(i.target.tagName==="A")return t.options.link.click?t.options.link.click(i.target):t.options.link.isOpen&&window.open(i.target.getAttribute("href")),void i.preventDefault();var o=(0,M.zh)(t);if(i.target.isEqualNode(n.element)&&n.element.lastElementChild&&o.collapsed){var s=n.element.lastElementChild.getBoundingClientRect();i.y>s.top+s.height&&(n.element.lastElementChild.tagName==="P"&&n.element.lastElementChild.textContent.trim().replace(m.g.ZWSP,"")===""?(o.selectNodeContents(n.element.lastElementChild),o.collapse(!1)):(n.element.insertAdjacentHTML("beforeend",'<p data-block="0">'+m.g.ZWSP+"<wbr></p>"),(0,M.ib)(n.element,o)))}Ye(t);var f=(0,h.fb)(i.target,"vditor-wysiwyg__preview");f||(f=(0,h.fb)((0,M.zh)(t).startContainer,"vditor-wysiwyg__preview")),f&&ht(f,t),ee(i,t)}else i.target.getAttribute("data-type")==="link-ref"?an(t,i.target):function(b,w){var y=b.target;w.wysiwyg.popover.innerHTML="";var x=function(){y.setAttribute("src",B.value),y.setAttribute("alt",R.value),y.setAttribute("title",W.value)},j=document.createElement("span");j.setAttribute("aria-label",window.VditorI18n.imageURL),j.className="vditor-tooltipped vditor-tooltipped__n";var B=document.createElement("input");j.appendChild(B),B.className="vditor-input",B.setAttribute("placeholder",window.VditorI18n.imageURL),B.value=y.getAttribute("src")||"",B.oninput=function(){x()},B.onkeydown=function(z){Re(w,z)};var C=document.createElement("span");C.setAttribute("aria-label",window.VditorI18n.alternateText),C.className="vditor-tooltipped vditor-tooltipped__n";var R=document.createElement("input");C.appendChild(R),R.className="vditor-input",R.setAttribute("placeholder",window.VditorI18n.alternateText),R.style.width="52px",R.value=y.getAttribute("alt")||"",R.oninput=function(){x()},R.onkeydown=function(z){Re(w,z)};var K=document.createElement("span");K.setAttribute("aria-label",window.VditorI18n.title),K.className="vditor-tooltipped vditor-tooltipped__n";var W=document.createElement("input");K.appendChild(W),W.className="vditor-input",W.setAttribute("placeholder",window.VditorI18n.title),W.value=y.getAttribute("title")||"",W.oninput=function(){x()},W.onkeydown=function(z){Re(w,z)},Ue(y,w),w.wysiwyg.popover.insertAdjacentElement("beforeend",j),w.wysiwyg.popover.insertAdjacentElement("beforeend",C),w.wysiwyg.popover.insertAdjacentElement("beforeend",K),Ve(w,y)}(i,t)}),this.element.addEventListener("keyup",function(i){if(!i.isComposing&&!(0,a.yl)(i)){i.key==="Enter"&&Me(t),i.key!=="Backspace"&&i.key!=="Delete"||t.wysiwyg.element.innerHTML===""||t.wysiwyg.element.childNodes.length!==1||!t.wysiwyg.element.firstElementChild||t.wysiwyg.element.firstElementChild.tagName!=="P"||t.wysiwyg.element.firstElementChild.childElementCount!==0||t.wysiwyg.element.textContent!==""&&t.wysiwyg.element.textContent!==`
  225. `||(t.wysiwyg.element.innerHTML="");var r=(0,M.zh)(t);if(i.key==="Backspace"&&(0,a.vU)()&&r.startContainer.textContent===`
  226. `&&r.startOffset===1&&(r.startContainer.textContent=""),on(t,r),Ye(t),i.key==="ArrowDown"||i.key==="ArrowRight"||i.key==="Backspace"||i.key==="ArrowLeft"||i.key==="ArrowUp"){i.key!=="ArrowLeft"&&i.key!=="ArrowRight"||t.hint.render(t);var o=(0,h.fb)(r.startContainer,"vditor-wysiwyg__preview");if(!o&&r.startContainer.nodeType!==3&&r.startOffset>0&&(f=r.startContainer).classList.contains("vditor-wysiwyg__block")&&(o=f.lastElementChild),o)if(o.previousElementSibling.style.display!=="none"){var s=o.previousElementSibling;if(s.tagName==="PRE"&&(s=s.firstElementChild),i.key==="ArrowDown"||i.key==="ArrowRight"){var f,b=function(y){for(var x=y;x&&!x.nextSibling;)x=x.parentElement;return x.nextSibling}(f=o.parentElement);if(b&&b.nodeType!==3){var w=b.querySelector(".vditor-wysiwyg__preview");if(w)return void ht(w,t)}if(b.nodeType===3){for(;b.textContent.length===0&&b.nextSibling;)b=b.nextSibling;r.setStart(b,1)}else r.setStart(b.firstChild,0)}else r.selectNodeContents(s),r.collapse(!1)}else i.key==="ArrowDown"||i.key==="ArrowRight"?ht(o,t):ht(o,t,!1)}}})},e}(),Ci=function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,r){i.__proto__=r}||function(i,r){for(var o in r)r.hasOwnProperty(o)&&(i[o]=r[o])},e(t,n)};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=n===null?Object.create(n):(i.prototype=n.prototype,new i)}}();const xi=function(e){function t(n,i){var r=e.call(this)||this;r.version=m.H,typeof n=="string"&&(i?i.cache?i.cache.id||(i.cache.id="vditor"+n):i.cache={id:"vditor"+n}:i={cache:{id:"vditor"+n}},n=document.getElementById(n));var o=new Mi(i).merge();if(o.i18n)window.VditorI18n=o.i18n,r.init(n,o);else{if(!["en_US","fr_FR","pt_BR","ja_JP","ko_KR","ru_RU","sv_SE","zh_CN","zh_TW"].includes(o.lang))throw new Error("options.lang error, see https://ld246.com/article/1549638745630#options");var s="vditorI18nScript",f=s+o.lang;document.querySelectorAll('head script[id^="vditorI18nScript"]').forEach(function(b){b.id!==f&&document.head.removeChild(b)}),(0,l.G)(o.cdn+"/dist/js/i18n/"+o.lang+".js",f).then(function(){r.init(n,o)})}return r}return Ci(t,e),t.prototype.setTheme=function(n,i,r,o){this.vditor.options.theme=n,$(this.vditor),i&&(this.vditor.options.preview.theme.current=i,(0,te.Z)(i,o||this.vditor.options.preview.theme.path)),r&&(this.vditor.options.preview.hljs.style=r,(0,Rn.Y)(r,this.vditor.options.cdn))},t.prototype.getValue=function(){return u(this.vditor)},t.prototype.getCurrentMode=function(){return this.vditor.currentMode},t.prototype.focus=function(){this.vditor.currentMode==="sv"?this.vditor.sv.element.focus():this.vditor.currentMode==="wysiwyg"?this.vditor.wysiwyg.element.focus():this.vditor.currentMode==="ir"&&this.vditor.ir.element.focus()},t.prototype.blur=function(){this.vditor.currentMode==="sv"?this.vditor.sv.element.blur():this.vditor.currentMode==="wysiwyg"?this.vditor.wysiwyg.element.blur():this.vditor.currentMode==="ir"&&this.vditor.ir.element.blur()},t.prototype.disabled=function(){E(this.vditor,["subToolbar","hint","popover"]),L(this.vditor.toolbar.elements,m.g.EDIT_TOOLBARS.concat(["undo","redo","fullscreen","edit-mode"])),this.vditor[this.vditor.currentMode].element.setAttribute("contenteditable","false")},t.prototype.enable=function(){v(this.vditor.toolbar.elements,m.g.EDIT_TOOLBARS.concat(["undo","redo","fullscreen","edit-mode"])),this.vditor.undo.resetIcon(this.vditor),this.vditor[this.vditor.currentMode].element.setAttribute("contenteditable","true")},t.prototype.getSelection=function(){return this.vditor.currentMode==="wysiwyg"?gt(this.vditor.wysiwyg.element):this.vditor.currentMode==="sv"?gt(this.vditor.sv.element):this.vditor.currentMode==="ir"?gt(this.vditor.ir.element):void 0},t.prototype.renderPreview=function(n){this.vditor.preview.render(this.vditor,n)},t.prototype.getCursorPosition=function(){return(0,M.Ny)(this.vditor[this.vditor.currentMode].element)},t.prototype.isUploading=function(){return this.vditor.upload.isUploading},t.prototype.clearCache=function(){localStorage.removeItem(this.vditor.options.cache.id)},t.prototype.disabledCache=function(){this.vditor.options.cache.enable=!1},t.prototype.enableCache=function(){if(!this.vditor.options.cache.id)throw new Error("need options.cache.id, see https://ld246.com/article/1549638745630#options");this.vditor.options.cache.enable=!0},t.prototype.html2md=function(n){return this.vditor.lute.HTML2Md(n)},t.prototype.exportJSON=function(n){return this.vditor.lute.RenderJSON(n)},t.prototype.getHTML=function(){return Dn(this.vditor)},t.prototype.tip=function(n,i){this.vditor.tip.show(n,i)},t.prototype.setPreviewMode=function(n){Qt(n,this.vditor)},t.prototype.deleteValue=function(){window.getSelection().isCollapsed||document.execCommand("delete",!1)},t.prototype.updateValue=function(n){document.execCommand("insertHTML",!1,n)},t.prototype.insertValue=function(n,i){i===void 0&&(i=!0);var r=(0,M.zh)(this.vditor);r.collapse(!0);var o=document.createElement("template");o.innerHTML=n,r.insertNode(o.content.cloneNode(!0)),r.collapse(!1),this.vditor.currentMode==="sv"?(this.vditor.sv.preventInput=!0,i&&se(this.vditor)):this.vditor.currentMode==="wysiwyg"?(this.vditor.wysiwyg.preventInput=!0,i&&Mt(this.vditor,getSelection().getRangeAt(0))):this.vditor.currentMode==="ir"&&(this.vditor.ir.preventInput=!0,i&&q(this.vditor,getSelection().getRangeAt(0),!0))},t.prototype.setValue=function(n,i){var r=this;i===void 0&&(i=!1),this.vditor.currentMode==="sv"?(this.vditor.sv.element.innerHTML="<div data-block='0'>"+this.vditor.lute.SpinVditorSVDOM(n)+"</div>",Ce(this.vditor,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1})):this.vditor.currentMode==="wysiwyg"?sn(this.vditor,n,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}):(this.vditor.ir.element.innerHTML=this.vditor.lute.Md2VditorIRDOM(n),this.vditor.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function(o){ge(o,r.vditor)}),Xe(this.vditor,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1})),this.vditor.outline.render(this.vditor),n||(E(this.vditor,["emoji","headings","submenu","hint"]),this.vditor.wysiwyg.popover&&(this.vditor.wysiwyg.popover.style.display="none"),this.clearCache()),i&&this.clearStack()},t.prototype.clearStack=function(){this.vditor.undo.clearStack(this.vditor),this.vditor.undo.addToUndoStack(this.vditor)},t.prototype.destroy=function(){this.vditor.element.innerHTML=this.vditor.originalInnerHTML,this.vditor.element.classList.remove("vditor"),this.vditor.element.removeAttribute("style");var n=document.getElementById("vditorIconScript");n&&n.remove(),this.clearCache(),ce(),this.vditor.wysiwyg.unbindListener()},t.prototype.getCommentIds=function(){return this.vditor.currentMode!=="wysiwyg"?[]:this.vditor.wysiwyg.getComments(this.vditor,!0)},t.prototype.hlCommentIds=function(n){if(this.vditor.currentMode==="wysiwyg"){var i=function(r){r.classList.remove("vditor-comment--hover"),n.forEach(function(o){r.getAttribute("data-cmtids").indexOf(o)>-1&&r.classList.add("vditor-comment--hover")})};this.vditor.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(r){i(r)}),this.vditor.preview.element.style.display!=="none"&&this.vditor.preview.element.querySelectorAll(".vditor-comment").forEach(function(r){i(r)})}},t.prototype.unHlCommentIds=function(n){if(this.vditor.currentMode==="wysiwyg"){var i=function(r){n.forEach(function(o){r.getAttribute("data-cmtids").indexOf(o)>-1&&r.classList.remove("vditor-comment--hover")})};this.vditor.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(r){i(r)}),this.vditor.preview.element.style.display!=="none"&&this.vditor.preview.element.querySelectorAll(".vditor-comment").forEach(function(r){i(r)})}},t.prototype.removeCommentIds=function(n){var i=this;if(this.vditor.currentMode==="wysiwyg"){var r=function(o,s){var f=o.getAttribute("data-cmtids").split(" ");f.find(function(b,w){if(b===s)return f.splice(w,1),!0}),f.length===0?(o.outerHTML=o.innerHTML,(0,M.zh)(i.vditor).collapse(!0)):o.setAttribute("data-cmtids",f.join(" "))};n.forEach(function(o){i.vditor.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(s){r(s,o)}),i.vditor.preview.element.style.display!=="none"&&i.vditor.preview.element.querySelectorAll(".vditor-comment").forEach(function(s){r(s,o)})}),we(this.vditor,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1})}},t.prototype.init=function(n,i){var r=this;this.vditor={currentMode:i.mode,element:n,hint:new Er(i.hint.extend),lute:void 0,options:i,originalInnerHTML:n.innerHTML,outline:new Lr(window.VditorI18n.outline),tip:new xr},this.vditor.sv=new Cr(this.vditor),this.vditor.undo=new Li,this.vditor.wysiwyg=new _i(this.vditor),this.vditor.ir=new Sr(this.vditor),this.vditor.toolbar=new Si(this.vditor),i.resize.enable&&(this.vditor.resize=new _r(this.vditor)),this.vditor.toolbar.elements.devtools&&(this.vditor.devtools=new g),(i.upload.url||i.upload.handler)&&(this.vditor.upload=new pr),(0,l.G)(i._lutePath||i.cdn+"/dist/js/lute/lute.min.js","vditorLuteScript").then(function(){r.vditor.lute=(0,kr.X)({autoSpace:r.vditor.options.preview.markdown.autoSpace,gfmAutoLink:r.vditor.options.preview.markdown.gfmAutoLink,codeBlockPreview:r.vditor.options.preview.markdown.codeBlockPreview,emojiSite:r.vditor.options.hint.emojiPath,emojis:r.vditor.options.hint.emoji,fixTermTypo:r.vditor.options.preview.markdown.fixTermTypo,footnotes:r.vditor.options.preview.markdown.footnotes,headingAnchor:!1,inlineMathDigit:r.vditor.options.preview.math.inlineDigit,linkBase:r.vditor.options.preview.markdown.linkBase,linkPrefix:r.vditor.options.preview.markdown.linkPrefix,listStyle:r.vditor.options.preview.markdown.listStyle,mark:r.vditor.options.preview.markdown.mark,mathBlockPreview:r.vditor.options.preview.markdown.mathBlockPreview,paragraphBeginningSpace:r.vditor.options.preview.markdown.paragraphBeginningSpace,sanitize:r.vditor.options.preview.markdown.sanitize,toc:r.vditor.options.preview.markdown.toc}),r.vditor.preview=new Mr(r.vditor),function(o){o.element.innerHTML="",o.element.classList.add("vditor"),o.options.rtl&&o.element.setAttribute("dir","rtl"),$(o),(0,te.Z)(o.options.preview.theme.current,o.options.preview.theme.path),typeof o.options.height=="number"?o.element.style.height=o.options.height+"px":o.element.style.height=o.options.height,typeof o.options.minHeight=="number"&&(o.element.style.minHeight=o.options.minHeight+"px"),typeof o.options.width=="number"?o.element.style.width=o.options.width+"px":o.element.style.width=o.options.width,o.element.appendChild(o.toolbar.element);var s=document.createElement("div");if(s.className="vditor-content",o.options.outline.position==="left"&&s.appendChild(o.outline.element),s.appendChild(o.wysiwyg.element.parentElement),s.appendChild(o.sv.element),s.appendChild(o.ir.element.parentElement),s.appendChild(o.preview.element),o.toolbar.elements.devtools&&s.appendChild(o.devtools.element),o.options.outline.position==="right"&&(o.outline.element.classList.add("vditor-outline--right"),s.appendChild(o.outline.element)),o.upload&&s.appendChild(o.upload.element),o.options.resize.enable&&s.appendChild(o.resize.element),s.appendChild(o.hint.element),s.appendChild(o.tip.element),o.element.appendChild(s),s.addEventListener("click",function(){E(o,["subToolbar"])}),o.toolbar.elements.export&&o.element.insertAdjacentHTML("beforeend",'<iframe id="vditorExportIframe" style="width: 100%;height: 0;border: 0"></iframe>'),et(o,o.options.mode,ir(o)),document.execCommand("DefaultParagraphSeparator",!1,"p"),navigator.userAgent.indexOf("iPhone")>-1&&window.visualViewport!==void 0){var f=!1,b=function(w){f||(f=!0,requestAnimationFrame(function(){f=!1;var y=o.toolbar.element;y.style.transform="none",y.getBoundingClientRect().top<0&&(y.style.transform="translate(0, "+-y.getBoundingClientRect().top+"px)")}))};window.visualViewport.addEventListener("scroll",b),window.visualViewport.addEventListener("resize",b)}}(r.vditor),i.after&&i.after(),i.icon&&(0,l.J)(i.cdn+"/dist/js/icons/"+i.icon+".js","vditorIconScript")})},t}(T.default)})(),Oe=Oe.default})())})(xe);var De=xe.exports;const Ae=Gn(De),je=(Be,Ge="default")=>{const He=Be==="dark";switch(Ge){case"default":return He?"dark":"classic";case"content":return He?"dark":"light";case"code":return He?"dracula":"github"}},St=Xn({inheritAttrs:!1,props:{height:{type:Number,default:360},value:{type:String,default:""}},emits:["change","get","update:value"],setup(Be,{attrs:Ge,emit:He}){const Ne=dt(null),F=dt(null),Oe=dt(!1),I=Vi(),{getLocale:T}=Ri(),{getDarkMode:m}=Jn(),d=dt(Be.value||"");Ot([()=>m.value,()=>Oe.value],([c,p])=>{var v;p&&((v=g.getVditor())==null||v.setTheme(je(c),je(c,"content"),je(c,"code")))},{immediate:!0,flush:"post"}),Ot(()=>Be.value,c=>{var p;c!==d.value&&((p=g.getVditor())==null||p.setValue(c)),d.value=c});const u=Ii(()=>{let c;switch(ut(T)){case"en":c="en_US";break;case"ja":c="ja_JP";break;case"ko":c="ko_KR";break;default:c="zh_CN"}return c});function l(){const c=ut(Ne);if(!c)return;const p=Et(Et({},Ge),Be),v=new Ae(c,zn(Et({theme:je(m.value),lang:ut(u),mode:"sv",fullscreen:{index:520},preview:{theme:{current:je(m.value,"content")},hljs:{style:je(m.value,"code")},actions:[]},input:L=>{d.value=L,He("update:value",L),He("change",L)},after:()=>{ji(()=>{var L;(L=I==null?void 0:I.redoModalHeight)==null||L.call(I),v.setValue(d.value),F.value=v,Oe.value=!0,He("get",g)})},blur:()=>{}},p),{cache:{enable:!1}}))}const g={getVditor:()=>F.value};function a(){var p;const c=ut(F);if(c){try{(p=c==null?void 0:c.destroy)==null||p.call(c)}catch(v){}F.value=null,Oe.value=!1}}return tr(l),Zn(a),Qn(a),Et({wrapRef:Ne},g)}}),Rt={ref:"wrapRef"};function It(Be,Ge,He,Ne,F,Oe){return $n(),Yn("div",Rt,null,512)}const pt=Pi(St,[["render",It]]);var Ke={exports:{}};(function(Be,Ge){(function(He,Ne){Be.exports=Ne()})(Fn,()=>(()=>{var He={54:(I,T,m)=>{m.d(T,{g:()=>d});var d=function(){function u(){}return u.ZWSP="\u200B",u.DROP_EDITOR="application/editor",u.MOBILE_WIDTH=520,u.CLASS_MENU_DISABLED="vditor-menu--disabled",u.EDIT_TOOLBARS=["emoji","headings","bold","italic","strike","link","list","ordered-list","outdent","indent","check","line","quote","code","inline-code","insert-after","insert-before","upload","record","table"],u.CODE_THEME=["abap","algol","algol_nu","arduino","autumn","borland","bw","colorful","dracula","emacs","friendly","fruity","github","igor","lovelace","manni","monokai","monokailight","murphy","native","paraiso-dark","paraiso-light","pastie","perldoc","pygments","rainbow_dash","rrt","solarized-dark","solarized-dark256","solarized-light","swapoff","tango","trac","vim","vs","xcode","ant-design"],u.CODE_LANGUAGES=["mermaid","echarts","mindmap","plantuml","abc","graphviz","flowchart","apache","js","ts","html","markmap","properties","apache","bash","c","csharp","cpp","css","coffeescript","diff","go","xml","http","json","java","javascript","kotlin","less","lua","makefile","markdown","nginx","objectivec","php","php-template","perl","plaintext","python","python-repl","r","ruby","rust","scss","sql","shell","swift","ini","typescript","vbnet","yaml","ada","clojure","dart","erb","fortran","gradle","haskell","julia","julia-repl","lisp","matlab","pgsql","powershell","sql_more","stata","cmake","mathematica","solidity","yul"],u.CDN="https://unpkg.com/vditor@3.9.6",u.MARKDOWN_OPTIONS={autoSpace:!1,gfmAutoLink:!0,codeBlockPreview:!0,fixTermTypo:!1,footnotes:!0,linkBase:"",linkPrefix:"",listStyle:!1,mark:!1,mathBlockPreview:!0,paragraphBeginningSpace:!1,sanitize:!0,toc:!1},u.HLJS_OPTIONS={enable:!0,lineNumber:!1,defaultLang:"",style:"github"},u.MATH_OPTIONS={engine:"KaTeX",inlineDigit:!1,macros:{}},u.THEME_OPTIONS={current:"light",list:{"ant-design":"Ant Design",dark:"Dark",light:"Light",wechat:"WeChat"},path:u.CDN+"/dist/css/content-theme"},u}()},478:(I,T,m)=>{m.d(T,{Q:()=>g});var d=m(54),u=m(526),l=m(156),g=function(a,c){a===void 0&&(a=document),c===void 0&&(c=d.g.CDN);var p=l.abcRenderAdapter.getElements(a);p.length>0&&(0,u.G)(c+"/dist/js/abcjs/abcjs_basic.min.js","vditorAbcjsScript").then(function(){p.forEach(function(v){v.parentElement.classList.contains("vditor-wysiwyg__pre")||v.parentElement.classList.contains("vditor-ir__marker--pre")||v.getAttribute("data-processed")!=="true"&&(ABCJS.renderAbc(v,l.abcRenderAdapter.getCode(v).trim()),v.style.overflowX="auto",v.setAttribute("data-processed","true"))})})}},156:(I,T,m)=>{m.r(T),m.d(T,{abcRenderAdapter:()=>c,chartRenderAdapter:()=>a,flowchartRenderAdapter:()=>v,graphvizRenderAdapter:()=>p,markmapRenderAdapter:()=>l,mathRenderAdapter:()=>d,mermaidRenderAdapter:()=>u,mindmapRenderAdapter:()=>g,plantumlRenderAdapter:()=>L});var d={getCode:function(S){return S.textContent},getElements:function(S){return S.querySelectorAll(".language-math")}},u={getCode:function(S){return S.textContent},getElements:function(S){return S.querySelectorAll(".language-mermaid")}},l={getCode:function(S){return S.textContent},getElements:function(S){return S.querySelectorAll(".language-markmap")}},g={getCode:function(S){return S.getAttribute("data-code")},getElements:function(S){return S.querySelectorAll(".language-mindmap")}},a={getCode:function(S){return S.innerText},getElements:function(S){return S.querySelectorAll(".language-echarts")}},c={getCode:function(S){return S.textContent},getElements:function(S){return S.querySelectorAll(".language-abc")}},p={getCode:function(S){return S.textContent},getElements:function(S){return S.querySelectorAll(".language-graphviz")}},v={getCode:function(S){return S.textContent},getElements:function(S){return S.querySelectorAll(".language-flowchart")}},L={getCode:function(S){return S.textContent},getElements:function(S){return S.querySelectorAll(".language-plantuml")}}},314:(I,T,m)=>{m.d(T,{p:()=>g});var d=m(54),u=m(526),l=m(156),g=function(a,c,p){a===void 0&&(a=document),c===void 0&&(c=d.g.CDN);var v=l.chartRenderAdapter.getElements(a);v.length>0&&(0,u.G)(c+"/dist/js/echarts/echarts.min.js","vditorEchartsScript").then(function(){v.forEach(function(L){if(!L.parentElement.classList.contains("vditor-wysiwyg__pre")&&!L.parentElement.classList.contains("vditor-ir__marker--pre")){var S=l.chartRenderAdapter.getCode(L).trim();if(S)try{if(L.getAttribute("data-processed")==="true")return;var _=JSON.parse(S);echarts.init(L,p==="dark"?"dark":void 0).setOption(_),L.setAttribute("data-processed","true")}catch(E){L.className="vditor-reset--error",L.innerHTML="echarts render error: <br>"+E}}})})}},730:(I,T,m)=>{m.d(T,{O:()=>l});var d=m(51),u=m(54),l=function(g){g.querySelectorAll("pre > code").forEach(function(a,c){var p,v,L;if(!a.parentElement.classList.contains("vditor-wysiwyg__pre")&&!a.parentElement.classList.contains("vditor-ir__marker--pre")&&!(a.classList.contains("language-mermaid")||a.classList.contains("language-flowchart")||a.classList.contains("language-echarts")||a.classList.contains("language-mindmap")||a.classList.contains("language-plantuml")||a.classList.contains("language-markmap")||a.classList.contains("language-abc")||a.classList.contains("language-graphviz")||a.classList.contains("language-math")||a.style.maxHeight.indexOf("px")>-1||g.classList.contains("vditor-preview")&&c>5)){var S=a.innerText;if(a.classList.contains("highlight-chroma")){var _=document.createElement("code");_.innerHTML=a.innerHTML,_.querySelectorAll(".highlight-ln").forEach(function(N){N.remove()}),S=_.innerText}else S.endsWith(`
  227. `)&&(S=S.substr(0,S.length-1));var E='<svg><use xlink:href="#vditor-icon-copy"></use></svg>';document.getElementById("vditorIconScript")||(E='<svg viewBox="0 0 32 32"><path d="M22.545-0h-17.455c-1.6 0-2.909 1.309-2.909 2.909v20.364h2.909v-20.364h17.455v-2.909zM26.909 5.818h-16c-1.6 0-2.909 1.309-2.909 2.909v20.364c0 1.6 1.309 2.909 2.909 2.909h16c1.6 0 2.909-1.309 2.909-2.909v-20.364c0-1.6-1.309-2.909-2.909-2.909zM26.909 29.091h-16v-20.364h16v20.364z"></path></svg>');var k=document.createElement("div");k.className="vditor-copy",k.innerHTML='<span aria-label="'+(((p=window.VditorI18n)===null||p===void 0?void 0:p.copy)||"\u590D\u5236")+`"
  228. onmouseover="this.setAttribute('aria-label', '`+(((v=window.VditorI18n)===null||v===void 0?void 0:v.copy)||"\u590D\u5236")+`')"
  229. class="vditor-tooltipped vditor-tooltipped__w"
  230. onclick="this.previousElementSibling.select();document.execCommand('copy');this.setAttribute('aria-label', '`+(((L=window.VditorI18n)===null||L===void 0?void 0:L.copied)||"\u5DF2\u590D\u5236")+`')">`+E+"</span>";var h=document.createElement("textarea");h.value=(0,d.X)(S),k.insertAdjacentElement("afterbegin",h),a.before(k),a.style.maxHeight=window.outerHeight-40+"px",a.insertAdjacentHTML("afterend",'<span style="position: absolute">'+u.g.ZWSP+"</span>")}})}},66:(I,T,m)=>{m.d(T,{P:()=>g});var d=m(54),u=m(526),l=m(156),g=function(a,c){c===void 0&&(c=d.g.CDN);var p=l.flowchartRenderAdapter.getElements(a);p.length!==0&&(0,u.G)(c+"/dist/js/flowchart.js/flowchart.min.js","vditorFlowchartScript").then(function(){p.forEach(function(v){if(v.getAttribute("data-processed")!=="true"){var L=flowchart.parse(l.flowchartRenderAdapter.getCode(v));v.innerHTML="",L.drawSVG(v),v.setAttribute("data-processed","true")}})})}},218:(I,T,m)=>{m.d(T,{v:()=>g});var d=m(54),u=m(526),l=m(156),g=function(a,c){c===void 0&&(c=d.g.CDN);var p=l.graphvizRenderAdapter.getElements(a);p.length!==0&&(0,u.G)(c+"/dist/js/graphviz/viz.js","vditorGraphVizScript").then(function(){p.forEach(function(v){var L=l.graphvizRenderAdapter.getCode(v);if(!v.parentElement.classList.contains("vditor-wysiwyg__pre")&&!v.parentElement.classList.contains("vditor-ir__marker--pre")&&v.getAttribute("data-processed")!=="true"&&L.trim()!==""){try{var S=new Blob(["importScripts('"+document.getElementById("vditorGraphVizScript").src.replace("viz.js","full.render.js")+"');"],{type:"application/javascript"}),_=(window.URL||window.webkitURL).createObjectURL(S),E=new Worker(_);new Viz({worker:E}).renderSVGElement(L).then(function(k){v.innerHTML=k.outerHTML}).catch(function(k){v.innerHTML="graphviz render error: <br>"+k,v.className="vditor-reset--error"})}catch(k){}v.setAttribute("data-processed","true")}})})}},702:(I,T,m)=>{m.d(T,{s:()=>g});var d=m(54),u=m(526),l=m(578),g=function(a,c,p){c===void 0&&(c=document),p===void 0&&(p=d.g.CDN);var v=a.style;d.g.CODE_THEME.includes(v)||(v="github");var L=document.getElementById("vditorHljsStyle"),S=p+"/dist/js/highlight.js/styles/"+v+".css";L&&L.href!==S&&L.remove(),(0,l.c)(p+"/dist/js/highlight.js/styles/"+v+".css","vditorHljsStyle"),a.enable!==!1&&c.querySelectorAll("pre > code").length!==0&&(0,u.G)(p+"/dist/js/highlight.js/highlight.pack.js","vditorHljsScript").then(function(){(0,u.G)(p+"/dist/js/highlight.js/solidity.min.js","vditorHljsSolidityScript").then(function(){(0,u.G)(p+"/dist/js/highlight.js/yul.min.js","vditorHljsYulScript").then(function(){c.querySelectorAll("pre > code").forEach(function(_){if(!_.parentElement.classList.contains("vditor-ir__marker--pre")&&!_.parentElement.classList.contains("vditor-wysiwyg__pre")&&!(_.classList.contains("language-mermaid")||_.classList.contains("language-flowchart")||_.classList.contains("language-echarts")||_.classList.contains("language-mindmap")||_.classList.contains("language-plantuml")||_.classList.contains("language-abc")||_.classList.contains("language-graphviz")||_.classList.contains("language-math"))&&(a.defaultLang!==""&&_.className.indexOf("language-")===-1&&_.classList.add("language-"+a.defaultLang),hljs.highlightElement(_),a.lineNumber)){_.classList.add("vditor-linenumber");var E=_.querySelector(".vditor-linenumber__temp");E||((E=document.createElement("div")).className="vditor-linenumber__temp",_.insertAdjacentElement("beforeend",E));var k=getComputedStyle(_).whiteSpace,h=!1;k!=="pre-wrap"&&k!=="pre-line"||(h=!0);var N="",O=_.textContent.split(/\r\n|\r|\n/g);O.pop(),O.map(function(G){var Z="";h&&(E.textContent=G||`
  231. `,Z=' style="height:'+E.getBoundingClientRect().height+'px"'),N+="<span"+Z+"></span>"}),E.style.display="none",N='<span class="vditor-linenumber__rows">'+N+"</span>",_.insertAdjacentHTML("beforeend",N)}})})})})}},563:(I,T,m)=>{m.d(T,{K:()=>c});var d=m(54),u=m(526),l=m(156),g={},a=function(p,v){var L=window.markmap,S=L.Transformer,_=L.Markmap,E=L.deriveOptions,k=(L.globalCSS,new S);p.innerHTML='<svg style="width:100%"></svg>';var h=p.firstChild,N=_.create(h,null),O=function(ae,ve){var pe=ae.transform(ve),de=Object.keys(pe.features).filter(function(ge){return!g[ge]});de.forEach(function(ge){g[ge]=!0});var fe=ae.getAssets(de),ke=fe.styles,Se=fe.scripts,Pe=window.markmap;return ke&&Pe.loadCSS(ke),Se&&Pe.loadJS(Se),pe}(k,v),G=O.root,Z=O.frontmatter,oe=E(Z==null?void 0:Z.markmap);N.setData(G,oe),N.fit()},c=function(p,v,L){v===void 0&&(v=d.g.CDN);var S=l.markmapRenderAdapter.getElements(p);S.length!==0&&(0,u.G)(v+"/dist/js/markmap/markmap.min.js","vditorMermaidScript").then(function(){S.forEach(function(_){var E=l.markmapRenderAdapter.getCode(_);if(_.getAttribute("data-processed")!=="true"&&E.trim()!==""){var k=document.createElement("div");k.className="language-markmap",_.parentNode.appendChild(k),a(k,E),_.parentNode.childNodes[0].nodeName=="CODE"&&_.parentNode.removeChild(_.parentNode.childNodes[0])}})})}},466:(I,T,m)=>{m.d(T,{H:()=>c});var d=m(54),u=m(526),l=m(578),g=m(51),a=m(156),c=function(p,v){var L=a.mathRenderAdapter.getElements(p);if(L.length!==0){var S={cdn:d.g.CDN,math:{engine:"KaTeX",inlineDigit:!1,macros:{}}};if(v&&v.math&&(v.math=Object.assign({},S.math,v.math)),(v=Object.assign({},S,v)).math.engine==="KaTeX")(0,l.c)(v.cdn+"/dist/js/katex/katex.min.css","vditorKatexStyle"),(0,u.G)(v.cdn+"/dist/js/katex/katex.min.js","vditorKatexScript").then(function(){(0,u.G)(v.cdn+"/dist/js/katex/mhchem.min.js","vditorKatexChemScript").then(function(){L.forEach(function(E){if(!E.parentElement.classList.contains("vditor-wysiwyg__pre")&&!E.parentElement.classList.contains("vditor-ir__marker--pre")&&!E.getAttribute("data-math")){var k=(0,g.X)(a.mathRenderAdapter.getCode(E));E.setAttribute("data-math",k);try{E.innerHTML=katex.renderToString(k,{displayMode:E.tagName==="DIV",output:"html"})}catch(h){E.innerHTML=h.message,E.className="language-math vditor-reset--error"}E.addEventListener("copy",function(h){h.stopPropagation(),h.preventDefault();var N=h.currentTarget.closest(".language-math");h.clipboardData.setData("text/html",N.innerHTML),h.clipboardData.setData("text/plain",N.getAttribute("data-math"))})}})})});else if(v.math.engine==="MathJax"){window.MathJax||(window.MathJax={loader:{paths:{mathjax:v.cdn+"/dist/js/mathjax"}},startup:{typeset:!1},tex:{macros:v.math.macros}},Object.assign(window.MathJax,v.math.mathJaxOptions)),(0,u.J)(v.cdn+"/dist/js/mathjax/tex-svg-full.js","protyleMathJaxScript");var _=function(E,k){var h=(0,g.X)(E.textContent).trim(),N=window.MathJax.getMetricsFor(E);N.display=E.tagName==="DIV",window.MathJax.tex2svgPromise(h,N).then(function(O){E.innerHTML="",E.setAttribute("data-math",h),E.append(O),window.MathJax.startup.document.clear(),window.MathJax.startup.document.updateDocument();var G=O.querySelector('[data-mml-node="merror"]');G&&G.textContent.trim()!==""&&(E.innerHTML=G.textContent.trim(),E.className="vditor-reset--error"),k&&k()})};window.MathJax.startup.promise.then(function(){for(var E=[],k=function(N){var O=L[N];O.parentElement.classList.contains("vditor-wysiwyg__pre")||O.parentElement.classList.contains("vditor-ir__marker--pre")||O.getAttribute("data-math")||!(0,g.X)(O.textContent).trim()||E.push(function(G){N===L.length-1?_(O):_(O,G)})},h=0;h<L.length;h++)k(h);(function(N){if(N.length!==0){var O=0,G=N[N.length-1],Z=function(){var oe=N[O++];oe===G?oe():oe(Z)};Z()}})(E)})}}}},554:(I,T,m)=>{m.d(T,{Y:()=>d});var d=function(u){u&&u.querySelectorAll("a").forEach(function(l){var g=l.getAttribute("href");g&&(g.match(/^.+.(mp4|m4v|ogg|ogv|webm)$/)?function(a,c){a.insertAdjacentHTML("afterend",'<video controls="controls" src="'+c+'"></video>'),a.remove()}(l,g):g.match(/^.+.(mp3|wav|flac)$/)?function(a,c){a.insertAdjacentHTML("afterend",'<audio controls="controls" src="'+c+'"></audio>'),a.remove()}(l,g):function(a,c){var p=c.match(/\/\/(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))([\w|-]{11})(?:(?:[\?&]t=)(\S+))?/),v=c.match(/\/\/v\.youku\.com\/v_show\/id_(\w+)=*\.html/),L=c.match(/\/\/v\.qq\.com\/x\/cover\/.*\/([^\/]+)\.html\??.*/),S=c.match(/(?:www\.|\/\/)coub\.com\/view\/(\w+)/),_=c.match(/(?:www\.|\/\/)facebook\.com\/([^\/]+)\/videos\/([0-9]+)/),E=c.match(/.+dailymotion.com\/(video|hub)\/(\w+)\?/),k=c.match(/(?:www\.|\/\/)bilibili\.com\/video\/(\w+)/),h=c.match(/(?:www\.|\/\/)ted\.com\/talks\/(\w+)/);p&&p[1].length===11?(a.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//www.youtube.com/embed/'+p[1]+(p[2]?"?start="+p[2]:"")+'"></iframe>'),a.remove()):v&&v[1]?(a.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//player.youku.com/embed/'+v[1]+'"></iframe>'),a.remove()):L&&L[1]?(a.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="https://v.qq.com/txp/iframe/player.html?vid='+L[1]+'"></iframe>'),a.remove()):S&&S[1]?(a.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
  232. src="//coub.com/embed/`+S[1]+'?muted=false&autostart=false&originalSize=true&startWithHD=true"></iframe>'),a.remove()):_&&_[0]?(a.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
  233. src="https://www.facebook.com/plugins/video.php?href=`+encodeURIComponent(_[0])+'"></iframe>'),a.remove()):E&&E[2]?(a.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
  234. src="https://www.dailymotion.com/embed/video/`+E[2]+'"></iframe>'),a.remove()):k&&k[1]?(a.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
  235. src="//player.bilibili.com/player.html?bvid=`+k[1]+'"></iframe>'),a.remove()):h&&h[1]&&(a.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//embed.ted.com/talks/'+h[1]+'"></iframe>'),a.remove())}(l,g))})}},40:(I,T,m)=>{m.d(T,{i:()=>g});var d=m(54),u=m(526),l=m(156),g=function(a,c,p){c===void 0&&(c=d.g.CDN);var v=l.mermaidRenderAdapter.getElements(a);v.length!==0&&(0,u.G)(c+"/dist/js/mermaid/mermaid.min.js","vditorMermaidScript").then(function(){var L={securityLevel:"loose",altFontFamily:"sans-serif",fontFamily:"sans-serif",startOnLoad:!1,flowchart:{htmlLabels:!0,useMaxWidth:!0},sequence:{useMaxWidth:!0,diagramMarginX:8,diagramMarginY:8,boxMargin:8},gantt:{leftPadding:75,rightPadding:20}};p==="dark"&&(L.theme="dark"),mermaid.initialize(L),v.forEach(function(S){var _=l.mermaidRenderAdapter.getCode(S);S.getAttribute("data-processed")!=="true"&&_.trim()!==""&&(mermaid.init(void 0,S),S.setAttribute("data-processed","true"))})})}},749:(I,T,m)=>{m.d(T,{P:()=>g});var d=m(54),u=m(526),l=m(156),g=function(a,c,p){a===void 0&&(a=document),c===void 0&&(c=d.g.CDN);var v=l.mindmapRenderAdapter.getElements(a);v.length>0&&(0,u.G)(c+"/dist/js/echarts/echarts.min.js","vditorEchartsScript").then(function(){v.forEach(function(L){if(!L.parentElement.classList.contains("vditor-wysiwyg__pre")&&!L.parentElement.classList.contains("vditor-ir__marker--pre")){var S=l.mindmapRenderAdapter.getCode(L);if(S)try{if(L.getAttribute("data-processed")==="true")return;echarts.init(L,p==="dark"?"dark":void 0).setOption({series:[{data:[JSON.parse(decodeURIComponent(S))],initialTreeDepth:-1,itemStyle:{borderWidth:0,color:"#4285f4"},label:{backgroundColor:"#f6f8fa",borderColor:"#d1d5da",borderRadius:5,borderWidth:.5,color:"#586069",lineHeight:20,offset:[-5,0],padding:[0,5],position:"insideRight"},lineStyle:{color:"#d1d5da",width:1},roam:!0,symbol:function(_,E){var k;return!((k=E==null?void 0:E.data)===null||k===void 0)&&k.children?"circle":"path://"},type:"tree"}],tooltip:{trigger:"item",triggerOn:"mousemove"}}),L.setAttribute("data-processed","true")}catch(_){L.className="vditor-reset--error",L.innerHTML="mindmap render error: <br>"+_}}})})}},818:(I,T,m)=>{m.d(T,{k:()=>l});var d=m(64),u=m(466),l=function(g,a,c){var p="",v=[];if(Array.from(g.children).forEach(function(E,k){if((0,d.W)(E)){if(c){var h=E.id.lastIndexOf("_");E.id=E.id.substring(0,h===-1?void 0:h)+"_"+k}v.push(E.id),p+=E.outerHTML.replace("<wbr>","")}}),p==="")return a.innerHTML="","";var L=document.createElement("div");if(c)c.lute.SetToC(!0),c.currentMode!=="wysiwyg"||c.preview.element.contains(g)?c.currentMode!=="ir"||c.preview.element.contains(g)?L.innerHTML=c.lute.HTML2VditorDOM("<p>[ToC]</p>"+p):L.innerHTML=c.lute.SpinVditorIRDOM("<p>[ToC]</p>"+p):L.innerHTML=c.lute.SpinVditorDOM("<p>[ToC]</p>"+p),c.lute.SetToC(c.options.preview.markdown.toc);else{a.classList.add("vditor-outline");var S=Lute.New();S.SetToC(!0),L.innerHTML=S.HTML2VditorDOM("<p>[ToC]</p>"+p)}var _=L.firstElementChild.querySelectorAll("li > span[data-target-id]");return _.forEach(function(E,k){if(E.nextElementSibling&&E.nextElementSibling.tagName==="UL"){var h="<svg class='vditor-outline__action'><use xlink:href='#vditor-icon-down'></use></svg>";document.getElementById("vditorIconScript")||(h='<svg class="vditor-outline__action" viewBox="0 0 32 32"><path d="M3.76 6.12l12.24 12.213 12.24-12.213 3.76 3.76-16 16-16-16 3.76-3.76z"></path></svg>'),E.innerHTML=h+"<span>"+E.innerHTML+"</span>"}else E.innerHTML="<svg></svg><span>"+E.innerHTML+"</span>";E.setAttribute("data-target-id",v[k])}),p=L.firstElementChild.innerHTML,_.length===0?(a.innerHTML="",p):(a.innerHTML=p,c&&(0,u.H)(a,{cdn:c.options.cdn,math:c.options.preview.math}),a.firstElementChild.addEventListener("click",function(E){for(var k=E.target;k&&!k.isEqualNode(a);){if(k.classList.contains("vditor-outline__action")){k.classList.contains("vditor-outline__action--close")?(k.classList.remove("vditor-outline__action--close"),k.parentElement.nextElementSibling.setAttribute("style","display:block")):(k.classList.add("vditor-outline__action--close"),k.parentElement.nextElementSibling.setAttribute("style","display:none")),E.preventDefault(),E.stopPropagation();break}if(k.getAttribute("data-target-id")){E.preventDefault(),E.stopPropagation();var h=document.getElementById(k.getAttribute("data-target-id"));if(!h)return;if(c)if(c.options.height==="auto"){var N=h.offsetTop+c.element.offsetTop;c.options.toolbarConfig.pin||(N+=c.toolbar.element.offsetHeight),window.scrollTo(window.scrollX,N)}else c.element.offsetTop<window.scrollY&&window.scrollTo(window.scrollX,c.element.offsetTop),c.preview.element.contains(g)?g.parentElement.scrollTop=h.offsetTop:g.scrollTop=h.offsetTop;else window.scrollTo(window.scrollX,h.offsetTop);break}k=k.parentElement}}),p)}},408:(I,T,m)=>{m.d(T,{B:()=>g});var d=m(54),u=m(526),l=m(156),g=function(a,c){a===void 0&&(a=document),c===void 0&&(c=d.g.CDN);var p=l.plantumlRenderAdapter.getElements(a);p.length!==0&&(0,u.G)(c+"/dist/js/plantuml/plantuml-encoder.min.js","vditorPlantumlScript").then(function(){p.forEach(function(v){if(!v.parentElement.classList.contains("vditor-wysiwyg__pre")&&!v.parentElement.classList.contains("vditor-ir__marker--pre")){var L=l.plantumlRenderAdapter.getCode(v).trim();if(L)try{v.innerHTML='<img src="http://www.plantuml.com/plantuml/svg/~1'+plantumlEncoder.encode(L)+'">'}catch(S){v.className="vditor-reset--error",v.innerHTML="plantuml render error: <br>"+S}}})})}},895:(I,T,m)=>{m.d(T,{X:()=>d});var d=function(u){var l=Lute.New();return l.PutEmojis(u.emojis),l.SetEmojiSite(u.emojiSite),l.SetHeadingAnchor(u.headingAnchor),l.SetInlineMathAllowDigitAfterOpenMarker(u.inlineMathDigit),l.SetAutoSpace(u.autoSpace),l.SetToC(u.toc),l.SetFootnotes(u.footnotes),l.SetFixTermTypo(u.fixTermTypo),l.SetVditorCodeBlockPreview(u.codeBlockPreview),l.SetVditorMathBlockPreview(u.mathBlockPreview),l.SetSanitize(u.sanitize),l.SetChineseParagraphBeginningSpace(u.paragraphBeginningSpace),l.SetRenderListStyle(u.listStyle),l.SetLinkBase(u.linkBase),l.SetLinkPrefix(u.linkPrefix),l.SetMark(u.mark),l.SetGFMAutoLink(u.gfmAutoLink),u.lazyLoadImage&&l.SetImageLazyLoading(u.lazyLoadImage),l}},863:(I,T,m)=>{m.d(T,{E:()=>d});var d=function(u,l,g){g===void 0&&(g="classic");var a=u.getBoundingClientRect();document.body.insertAdjacentHTML("beforeend",'<div class="vditor vditor-img'+(g==="dark"?" vditor--dark":"")+`">
  236. <div class="vditor-img__bar">
  237. <span class="vditor-img__btn" data-deg="0">
  238. <svg><use xlink:href="#vditor-icon-redo"></use></svg>
  239. `+window.VditorI18n.spin+`
  240. </span>
  241. <span class="vditor-img__btn" onclick="this.parentElement.parentElement.outerHTML = '';document.body.style.overflow = ''">
  242. X &nbsp;`+window.VditorI18n.close+`
  243. </span>
  244. </div>
  245. <div class="vditor-img__img" onclick="this.parentElement.outerHTML = '';document.body.style.overflow = ''">
  246. <img style="width: `+u.width+"px;height:"+u.height+"px;transform: translate3d("+a.left+"px, "+(a.top-36)+'px, 0)" src="'+u.getAttribute("src")+`">
  247. </div>
  248. </div>`),document.body.style.overflow="hidden";var c=document.querySelector(".vditor-img img"),p="translate3d("+Math.max(0,window.innerWidth-u.naturalWidth)/2+"px, "+Math.max(0,window.innerHeight-36-u.naturalHeight)/2+"px, 0)";setTimeout(function(){c.setAttribute("style","transition: transform .3s ease-in-out;transform: "+p),setTimeout(function(){c.parentElement.scrollTo((c.parentElement.scrollWidth-c.parentElement.clientWidth)/2,(c.parentElement.scrollHeight-c.parentElement.clientHeight)/2)},400)});var v=document.querySelector(".vditor-img__btn");v.addEventListener("click",function(){var L=parseInt(v.getAttribute("data-deg"),10)+90;L/90%2==1&&u.naturalWidth>c.parentElement.clientHeight?c.style.transform="translate3d("+Math.max(0,window.innerWidth-u.naturalWidth)/2+"px, "+(u.naturalWidth/2-u.naturalHeight/2)+"px, 0) rotateZ("+L+"deg)":c.style.transform=p+" rotateZ("+L+"deg)",v.setAttribute("data-deg",L.toString()),setTimeout(function(){c.parentElement.scrollTo((c.parentElement.scrollWidth-c.parentElement.clientWidth)/2,(c.parentElement.scrollHeight-c.parentElement.clientHeight)/2)},400)})}},312:(I,T,m)=>{m.d(T,{Y:()=>l});var d=m(54),u=m(578),l=function(g,a){a===void 0&&(a=d.g.CDN),d.g.CODE_THEME.includes(g)||(g="github");var c=document.getElementById("vditorHljsStyle"),p=a+"/dist/js/highlight.js/styles/"+g+".css";c?c.href!==p&&(c.remove(),(0,u.c)(p,"vditorHljsStyle")):(0,u.c)(p,"vditorHljsStyle")}},227:(I,T,m)=>{m.d(T,{Z:()=>u});var d=m(578),u=function(l,g){if(l&&g){var a=document.getElementById("vditorContentTheme"),c=g+"/"+l+".css";a?a.getAttribute("href")!==c&&(a.remove(),(0,d.c)(c,"vditorContentTheme")):(0,d.c)(c,"vditorContentTheme")}}},526:(I,T,m)=>{m.d(T,{G:()=>u,J:()=>d});var d=function(l,g){if(document.getElementById(g))return!1;var a=new XMLHttpRequest;a.open("GET",l,!1),a.setRequestHeader("Accept","text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01"),a.send("");var c=document.createElement("script");c.type="text/javascript",c.text=a.responseText,c.id=g,document.head.appendChild(c)},u=function(l,g){return new Promise(function(a,c){if(document.getElementById(g))return a(),!1;var p=document.createElement("script");p.src=l,p.async=!0,document.head.appendChild(p),p.onload=function(){if(document.getElementById(g))return p.remove(),a(),!1;p.id=g,a()}})}},578:(I,T,m)=>{m.d(T,{c:()=>d});var d=function(u,l){if(!document.getElementById(l)){var g=document.createElement("link");g.id=l,g.rel="stylesheet",g.type="text/css",g.href=u,document.getElementsByTagName("head")[0].appendChild(g)}}},51:(I,T,m)=>{m.d(T,{X:()=>d});var d=function(u){return u.replace(/\u00a0/g," ")}},827:(I,T,m)=>{m.d(T,{fb:()=>u,lG:()=>d});var d=function(l,g){if(!l)return!1;l.nodeType===3&&(l=l.parentElement);for(var a=l,c=!1;a&&!c&&!a.classList.contains("vditor-reset");)a.nodeName===g?c=!0:a=a.parentElement;return c&&a},u=function(l,g){if(!l)return!1;l.nodeType===3&&(l=l.parentElement);for(var a=l,c=!1;a&&!c&&!a.classList.contains("vditor-reset");)a.classList.contains(g)?c=!0:a=a.parentElement;return c&&a}},64:(I,T,m)=>{m.d(T,{W:()=>d});var d=function(u){var l=function(g,a){if(!g)return!1;g.nodeType===3&&(g=g.parentElement);for(var c=g,p=!1;c&&!p&&!c.classList.contains("vditor-reset");)c.nodeName.indexOf(a)===0?p=!0:c=c.parentElement;return p&&c}(u,"H");return!(!l||l.tagName.length!==2||l.tagName==="HR")&&l}},640:(I,T,m)=>{m.d(T,{T:()=>d});var d=function(){for(var u=[],l=0;l<arguments.length;l++)u[l]=arguments[l];for(var g={},a=function(p){for(var v in p)p.hasOwnProperty(v)&&(Object.prototype.toString.call(p[v])==="[object Object]"?g[v]=d(g[v],p[v]):g[v]=p[v])},c=0;c<u.length;c++)a(u[c]);return g}},393:(I,T,m)=>{m.d(T,{Hc:()=>d}),m(54);var d=function(u){var l=window.getSelection();l.removeAllRanges(),l.addRange(u)}}},Ne={};function F(I){var T=Ne[I];if(T!==void 0)return T.exports;var m=Ne[I]={exports:{}};return He[I](m,m.exports,F),m.exports}F.d=(I,T)=>{for(var m in T)F.o(T,m)&&!F.o(I,m)&&Object.defineProperty(I,m,{enumerable:!0,get:T[m]})},F.o=(I,T)=>Object.prototype.hasOwnProperty.call(I,T),F.r=I=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(I,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(I,"__esModule",{value:!0})};var Oe={};return(()=>{F.d(Oe,{default:()=>ge});var I=F(478),T=F(156),m=F(314),d=F(730),u=F(66),l=F(218),g=F(702),a=function(M){M===void 0&&(M=document);var he=function(ee){var A=document.createElement("img");A.src=ee.getAttribute("data-src"),A.addEventListener("load",function(){ee.getAttribute("style")||ee.getAttribute("class")||ee.getAttribute("width")||ee.getAttribute("height")||A.naturalHeight>A.naturalWidth&&A.naturalWidth/A.naturalHeight<document.querySelector(".vditor-reset").clientWidth/(window.innerHeight-40)&&A.naturalHeight>window.innerHeight-40&&(ee.style.height=window.innerHeight-40+"px"),ee.src=A.src}),ee.removeAttribute("data-src")};if(!("IntersectionObserver"in window))return M.querySelectorAll("img").forEach(function(ee){ee.getAttribute("data-src")&&he(ee)}),!1;window.vditorImageIntersectionObserver?(window.vditorImageIntersectionObserver.disconnect(),M.querySelectorAll("img").forEach(function(ee){window.vditorImageIntersectionObserver.observe(ee)})):(window.vditorImageIntersectionObserver=new IntersectionObserver(function(ee){ee.forEach(function(A){(A.isIntersecting===void 0?A.intersectionRatio!==0:A.isIntersecting)&&A.target.getAttribute("data-src")&&he(A.target)})}),M.querySelectorAll("img").forEach(function(ee){window.vditorImageIntersectionObserver.observe(ee)}))},c=F(466),p=F(554),v=F(40),L=F(563),S=F(749),_=F(818),E=F(408),k=F(54),h=F(227),N=F(526),O=F(827),G=F(640),Z=F(895),oe=F(393),ae=function(M,he){if(he===void 0&&(he="zh_CN"),typeof speechSynthesis<"u"&&typeof SpeechSynthesisUtterance<"u"){var ee='<svg><use xlink:href="#vditor-icon-play"></use></svg>',A='<svg><use xlink:href="#vditor-icon-pause"></use></svg>';document.getElementById("vditorIconScript")||(ee='<svg viewBox="0 0 32 32"><path d="M3.436 0l25.128 16-25.128 16v-32z"></path></svg>',A='<svg viewBox="0 0 32 32"><path d="M20.617 0h9.128v32h-9.128v-32zM2.255 32v-32h9.128v32h-9.128z"></path></svg>');var q=document.querySelector(".vditor-speech");if(!q){(q=document.createElement("div")).className="vditor-speech",document.body.insertAdjacentElement("beforeend",q);var P=function(){var U,se;return speechSynthesis.getVoices().forEach(function(te){te.lang===he.replace("_","-")&&(U=te),te.default&&(se=te)}),U||(U=se),U};speechSynthesis.onvoiceschanged!==void 0&&(speechSynthesis.onvoiceschanged=P);var D=P();q.onclick=function(){if(q.className==="vditor-speech"){var U=new SpeechSynthesisUtterance(q.getAttribute("data-text"));U.voice=D,U.onend=function(){q.className="vditor-speech",speechSynthesis.cancel(),q.innerHTML=ee},speechSynthesis.speak(U),q.className="vditor-speech vditor-speech--current",q.innerHTML=A}else speechSynthesis.speaking&&(speechSynthesis.paused?(speechSynthesis.resume(),q.innerHTML=A):(speechSynthesis.pause(),q.innerHTML=ee));(0,oe.Hc)(window.vditorSpeechRange)},document.body.addEventListener("click",function(){getSelection().toString().trim()===""&&q.style.display==="block"&&(q.className="vditor-speech",speechSynthesis.cancel(),q.style.display="none")})}M.addEventListener("mouseup",function(U){var se=getSelection().toString().trim();if(speechSynthesis.cancel(),getSelection().toString().trim()!==""){window.vditorSpeechRange=getSelection().getRangeAt(0).cloneRange();var te=getSelection().getRangeAt(0).getBoundingClientRect();q.innerHTML=ee,q.style.display="block",q.style.top=te.top+te.height+document.querySelector("html").scrollTop-20+"px",q.style.left=U.clientX+2+"px",q.setAttribute("data-text",se)}else q.style.display==="block"&&(q.className="vditor-speech",q.style.display="none")})}},ve=function(M,he,ee,A){return new(ee||(ee=Promise))(function(q,P){function D(te){try{se(A.next(te))}catch($){P($)}}function U(te){try{se(A.throw(te))}catch($){P($)}}function se(te){var $;te.done?q(te.value):($=te.value,$ instanceof ee?$:new ee(function(me){me($)})).then(D,U)}se((A=A.apply(M,he||[])).next())})},pe=function(M,he){var ee,A,q,P,D={label:0,sent:function(){if(1&q[0])throw q[1];return q[1]},trys:[],ops:[]};return P={next:U(0),throw:U(1),return:U(2)},typeof Symbol=="function"&&(P[Symbol.iterator]=function(){return this}),P;function U(se){return function(te){return function($){if(ee)throw new TypeError("Generator is already executing.");for(;D;)try{if(ee=1,A&&(q=2&$[0]?A.return:$[0]?A.throw||((q=A.return)&&q.call(A),0):A.next)&&!(q=q.call(A,$[1])).done)return q;switch(A=0,q&&($=[2&$[0],q.value]),$[0]){case 0:case 1:q=$;break;case 4:return D.label++,{value:$[1],done:!1};case 5:D.label++,A=$[1],$=[0];continue;case 7:$=D.ops.pop(),D.trys.pop();continue;default:if(q=D.trys,!((q=q.length>0&&q[q.length-1])||$[0]!==6&&$[0]!==2)){D=0;continue}if($[0]===3&&(!q||$[1]>q[0]&&$[1]<q[3])){D.label=$[1];break}if($[0]===6&&D.label<q[1]){D.label=q[1],q=$;break}if(q&&D.label<q[2]){D.label=q[2],D.ops.push($);break}q[2]&&D.ops.pop(),D.trys.pop();continue}$=he.call(M,D)}catch(me){$=[6,me],A=0}finally{ee=q=0}if(5&$[0])throw $[1];return{value:$[0]?$[1]:void 0,done:!0}}([se,te])}}},de=function(M){var he={anchor:0,cdn:k.g.CDN,customEmoji:{},emojiPath:(M&&M.emojiPath||k.g.CDN)+"/dist/images/emoji",hljs:k.g.HLJS_OPTIONS,icon:"ant",lang:"zh_CN",markdown:k.g.MARKDOWN_OPTIONS,math:k.g.MATH_OPTIONS,mode:"light",speech:{enable:!1},theme:k.g.THEME_OPTIONS};return(0,G.T)(he,M)},fe=function(M,he){var ee=de(he);return(0,N.G)(ee.cdn+"/dist/js/lute/lute.min.js","vditorLuteScript").then(function(){var A=(0,Z.X)({autoSpace:ee.markdown.autoSpace,gfmAutoLink:ee.markdown.gfmAutoLink,codeBlockPreview:ee.markdown.codeBlockPreview,emojiSite:ee.emojiPath,emojis:ee.customEmoji,fixTermTypo:ee.markdown.fixTermTypo,footnotes:ee.markdown.footnotes,headingAnchor:ee.anchor!==0,inlineMathDigit:ee.math.inlineDigit,lazyLoadImage:ee.lazyLoadImage,linkBase:ee.markdown.linkBase,linkPrefix:ee.markdown.linkPrefix,listStyle:ee.markdown.listStyle,mark:ee.markdown.mark,mathBlockPreview:ee.markdown.mathBlockPreview,paragraphBeginningSpace:ee.markdown.paragraphBeginningSpace,sanitize:ee.markdown.sanitize,toc:ee.markdown.toc});return he!=null&&he.renderers&&A.SetJSRenderers({renderers:{Md2HTML:he.renderers}}),A.SetHeadingID(!0),A.Md2HTML(M)})},ke=function(M,he,ee){return ve(void 0,void 0,void 0,function(){var A,q,P;return pe(this,function(D){switch(D.label){case 0:return A=de(ee),[4,fe(he,A)];case 1:if(q=D.sent(),A.transform&&(q=A.transform(q)),M.innerHTML=q,M.classList.add("vditor-reset"),A.i18n)return[3,5];if(["en_US","fr_FR","pt_BR","ja_JP","ko_KR","ru_RU","sv_SE","zh_CN","zh_TW"].includes(A.lang))return[3,2];throw new Error("options.lang error, see https://ld246.com/article/1549638745630#options");case 2:return P="vditorI18nScript"+A.lang,document.querySelectorAll('head script[id^="vditorI18nScript"]').forEach(function(se){se.id!==P&&document.head.removeChild(se)}),[4,(0,N.G)(A.cdn+"/dist/js/i18n/"+A.lang+".js",P)];case 3:D.sent(),D.label=4;case 4:return[3,6];case 5:window.VditorI18n=A.i18n,D.label=6;case 6:return A.icon?[4,(0,N.G)(A.cdn+"/dist/js/icons/"+A.icon+".js","vditorIconScript")]:[3,8];case 7:D.sent(),D.label=8;case 8:return(0,h.Z)(A.theme.current,A.theme.path),A.anchor===1&&M.classList.add("vditor-reset--anchor"),(0,d.O)(M),(0,g.s)(A.hljs,M,A.cdn),(0,c.H)(M,{cdn:A.cdn,math:A.math}),(0,v.i)(M,A.cdn,A.mode),(0,L.K)(M,A.cdn,A.mode),(0,u.P)(M,A.cdn),(0,l.v)(M,A.cdn),(0,m.p)(M,A.cdn,A.mode),(0,S.P)(M,A.cdn,A.mode),(0,E.B)(M,A.cdn),(0,I.Q)(M,A.cdn),(0,p.Y)(M),A.speech.enable&&ae(M),A.anchor!==0&&(U=A.anchor,document.querySelectorAll(".vditor-anchor").forEach(function(se){U===1&&se.classList.add("vditor-anchor--left"),se.onclick=function(){var te=se.getAttribute("href").substr(1),$=document.getElementById("vditorAnchor-"+te).offsetTop;document.querySelector("html").scrollTop=$}}),window.onhashchange=function(){var se=document.getElementById("vditorAnchor-"+decodeURIComponent(window.location.hash.substr(1)));se&&(document.querySelector("html").scrollTop=se.offsetTop)}),A.after&&A.after(),A.lazyLoadImage&&a(M),M.addEventListener("click",function(se){var te=(0,O.lG)(se.target,"SPAN");if(te&&(0,O.fb)(te,"vditor-toc")){var $=M.querySelector("#"+te.getAttribute("data-target-id"));$&&window.scrollTo(window.scrollX,$.offsetTop)}}),[2]}var U})})},Se=F(863),Pe=F(312);const ge=function(){function M(){}return M.adapterRender=T,M.previewImage=Se.E,M.codeRender=d.O,M.graphvizRender=l.v,M.highlightRender=g.s,M.mathRender=c.H,M.mermaidRender=v.i,M.markmapRender=L.K,M.flowchartRender=u.P,M.chartRender=m.p,M.abcRender=I.Q,M.mindmapRender=S.P,M.plantumlRender=E.B,M.outlineRender=_.k,M.mediaRender=p.Y,M.speechRender=ae,M.lazyLoadImageRender=a,M.md2html=fe,M.preview=ke,M.setCodeTheme=Pe.Y,M.setContentTheme=h.Z,M}()})(),Oe=Oe.default})())})(Ke);var mt=Ke.exports;let kt,en;kt=Gn(mt),en=Xn({__name:"MarkdownViewer",props:{value:{type:String},class:{type:String}},setup(Be){const Ge=Be,He=dt(null),Ne=dt(null),{getDarkMode:F}=Jn();function Oe(){const T=ut(He);Ne.value=kt.preview(T,Ge.value,{mode:je(F.value,"content"),theme:{current:je(F.value,"content")},hljs:{style:je(F.value,"code")}})}Ot(()=>F.value,T=>{kt.setContentTheme(je(T,"content")),kt.setCodeTheme(je(T,"code")),Oe()}),Ot(()=>Ge.value,(T,m)=>{T!==m&&Oe()});function I(){var m;const T=ut(Ne);if(T){try{(m=T==null?void 0:T.destroy)==null||m.call(T)}catch(d){}Ne.value=null}}return tr(Oe),Zn(I),Qn(I),(T,m)=>($n(),Yn("div",{ref_key:"viewerRef",ref:He,id:"markdownViewer",class:qi(T.$props.class)},null,2))}}),nr=er(pt),rr=er(en)}));export{nr as M,zi as __tla,rr as a};