index-414a61a6.js
300 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
var wi=Object.defineProperty,Ei=Object.defineProperties;var ki=Object.getOwnPropertyDescriptors;var Nn=Object.getOwnPropertySymbols;var Si=Object.prototype.hasOwnProperty,Li=Object.prototype.propertyIsEnumerable;var Dn=(Ce,Ae,ge)=>Ae in Ce?wi(Ce,Ae,{enumerable:!0,configurable:!0,writable:!0,value:ge}):Ce[Ae]=ge,ht=(Ce,Ae)=>{for(var ge in Ae||(Ae={}))Si.call(Ae,ge)&&Dn(Ce,ge,Ae[ge]);if(Nn)for(var ge of Nn(Ae))Li.call(Ae,ge)&&Dn(Ce,ge,Ae[ge]);return Ce},On=(Ce,Ae)=>Ei(Ce,ki(Ae));import{Y as Ti,N as jn,_ as In,aj as Rn}from"./index.js";import{d as Pn,k as at,w as Mt,e as Mi,u as st,t as qn,L as Bn,q as Ci,_ as Vn,$ as Un,a2 as Ai}from"./vue-5a35c3f5.js";import{I as zn,J as Gn}from"./antd-6b087f69.js";import{a as _i}from"./index-c1c2669a.js";import{o as Wn}from"./onMountedOrActivated-52afb7a7.js";var Kn={exports:{}};(function(Ce,Ae){(function(ge,Ne){Ce.exports=Ne()})(zn,function(){return(()=>{var ge={14: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,v){v===void 0&&(v=this.Diff_Timeout<=0?Number.MAX_VALUE:new Date().getTime()+1e3*this.Diff_Timeout);var a=v;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),g=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 w=this.diff_compute_(d,u,c,a);return g&&w.unshift(new T.Diff(0,g)),L&&w.push(new T.Diff(0,L)),this.diff_cleanupMerge(w),w},T.prototype.diff_compute_=function(d,u,l,v){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,g=c.indexOf(p);if(g!=-1)return a=[new T.Diff(1,c.substring(0,g)),new T.Diff(0,p),new T.Diff(1,c.substring(g+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 w=L[0],C=L[1],k=L[2],S=L[3],f=L[4],N=this.diff_main(w,k,l,v),O=this.diff_main(C,S,l,v);return N.concat([new T.Diff(0,f)],O)}return l&&d.length>100&&u.length>100?this.diff_lineMode_(d,u,v):this.diff_bisect_(d,u,v)},T.prototype.diff_lineMode_=function(d,u,l){var v=this.diff_linesToChars_(d,u);d=v.chars1,u=v.chars2;var a=v.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,g=0,L=0,w="",C="";p<c.length;){switch(c[p][0]){case 1:L++,C+=c[p][1];break;case m:g++,w+=c[p][1];break;case 0:if(g>=1&&L>=1){c.splice(p-g-L,g+L),p=p-g-L;for(var k=this.diff_main(w,C,!1,l),S=k.length-1;S>=0;S--)c.splice(p,0,k[S]);p+=k.length}L=0,g=0,w="",C=""}p++}return c.pop(),c},T.prototype.diff_bisect_=function(d,u,l){for(var v=d.length,a=u.length,c=Math.ceil((v+a)/2),p=c,g=2*c,L=new Array(g),w=new Array(g),C=0;C<g;C++)L[C]=-1,w[C]=-1;L[p+1]=0,w[p+1]=0;for(var k=v-a,S=k%2!=0,f=0,N=0,O=0,F=0,Z=0;Z<c&&!(new Date().getTime()>l);Z++){for(var oe=-Z+f;oe<=Z-N;oe+=2){for(var ae=p+oe,he=(Se=oe==-Z||oe!=Z&&L[ae-1]<L[ae+1]?L[ae+1]:L[ae-1]+1)-oe;Se<v&&he<a&&d.charAt(Se)==u.charAt(he);)Se++,he++;if(L[ae]=Se,Se>v)N+=2;else if(he>a)f+=2;else if(S&&(fe=p+k-oe)>=0&&fe<g&&w[fe]!=-1&&Se>=(de=v-w[fe]))return this.diff_bisectSplit_(d,u,Se,he,l)}for(var pe=-Z+O;pe<=Z-F;pe+=2){for(var de,fe=p+pe,Le=(de=pe==-Z||pe!=Z&&w[fe-1]<w[fe+1]?w[fe+1]:w[fe-1]+1)-pe;de<v&&Le<a&&d.charAt(v-de-1)==u.charAt(a-Le-1);)de++,Le++;if(w[fe]=de,de>v)F+=2;else if(Le>a)O+=2;else if(!S&&(ae=p+k-pe)>=0&&ae<g&&L[ae]!=-1){var Se;if(he=p+(Se=L[ae])-ae,Se>=(de=v-de))return this.diff_bisectSplit_(d,u,Se,he,l)}}}return[new T.Diff(m,d),new T.Diff(1,u)]},T.prototype.diff_bisectSplit_=function(d,u,l,v,a){var c=d.substring(0,l),p=u.substring(0,v),g=d.substring(l),L=u.substring(v),w=this.diff_main(c,p,!1,a),C=this.diff_main(g,L,!1,a);return w.concat(C)},T.prototype.diff_linesToChars_=function(d,u){var l=[],v={};function a(g){for(var L="",w=0,C=-1,k=l.length;C<g.length-1;){(C=g.indexOf(`
`,w))==-1&&(C=g.length-1);var S=g.substring(w,C+1);(v.hasOwnProperty?v.hasOwnProperty(S):v[S]!==void 0)?L+=String.fromCharCode(v[S]):(k==c&&(S=g.substring(w),C=g.length),L+=String.fromCharCode(k),v[S]=k,l[k++]=S),w=C+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 v=d[l][1],a=[],c=0;c<v.length;c++)a[c]=u[v.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,v=Math.min(d.length,u.length),a=v,c=0;l<a;)d.substring(c,a)==u.substring(c,a)?c=l=a:v=a,a=Math.floor((v-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,v=Math.min(d.length,u.length),a=v,c=0;l<a;)d.substring(d.length-a,d.length-c)==u.substring(u.length-a,u.length-c)?c=l=a:v=a,a=Math.floor((v-l)/2+l);return a},T.prototype.diff_commonOverlap_=function(d,u){var l=d.length,v=u.length;if(l==0||v==0)return 0;l>v?d=d.substring(l-v):l<v&&(u=u.substring(0,l));var a=Math.min(l,v);if(d==u)return a;for(var c=0,p=1;;){var g=d.substring(a-p),L=u.indexOf(g);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,v=d.length>u.length?u:d;if(l.length<4||2*v.length<l.length)return null;var a=this;function c(f,N,O){for(var F,Z,oe,ae,he=f.substring(O,O+Math.floor(f.length/4)),pe=-1,de="";(pe=N.indexOf(he,pe+1))!=-1;){var fe=a.diff_commonPrefix(f.substring(O),N.substring(pe)),Le=a.diff_commonSuffix(f.substring(0,O),N.substring(0,pe));de.length<Le+fe&&(de=N.substring(pe-Le,pe)+N.substring(pe,pe+fe),F=f.substring(0,O-Le),Z=f.substring(O+fe),oe=N.substring(0,pe-Le),ae=N.substring(pe+fe))}return 2*de.length>=f.length?[F,Z,oe,ae,de]:null}var p,g,L,w,C,k=c(l,v,Math.ceil(l.length/4)),S=c(l,v,Math.ceil(l.length/2));return k||S?(p=S?k&&k[4].length>S[4].length?k:S:k,d.length>u.length?(g=p[0],L=p[1],w=p[2],C=p[3]):(w=p[0],C=p[1],g=p[2],L=p[3]),[g,L,w,C,p[4]]):null},T.prototype.diff_cleanupSemantic=function(d){for(var u=!1,l=[],v=0,a=null,c=0,p=0,g=0,L=0,w=0;c<d.length;)d[c][0]==0?(l[v++]=c,p=L,g=w,L=0,w=0,a=d[c][1]):(d[c][0]==1?L+=d[c][1].length:w+=d[c][1].length,a&&a.length<=Math.max(p,g)&&a.length<=Math.max(L,w)&&(d.splice(l[v-1],0,new T.Diff(m,a)),d[l[v-1]+1][0]=1,v--,c=--v>0?l[v-1]:-1,p=0,g=0,L=0,w=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 C=d[c-1][1],k=d[c][1],S=this.diff_commonOverlap_(C,k),f=this.diff_commonOverlap_(k,C);S>=f?(S>=C.length/2||S>=k.length/2)&&(d.splice(c,0,new T.Diff(0,k.substring(0,S))),d[c-1][1]=C.substring(0,C.length-S),d[c+1][1]=k.substring(S),c++):(f>=C.length/2||f>=k.length/2)&&(d.splice(c,0,new T.Diff(0,C.substring(0,f))),d[c-1][0]=1,d[c-1][1]=k.substring(0,k.length-f),d[c+1][0]=m,d[c+1][1]=C.substring(f),c++),c++}c++}},T.prototype.diff_cleanupSemanticLossless=function(d){function u(f,N){if(!f||!N)return 6;var O=f.charAt(f.length-1),F=N.charAt(0),Z=O.match(T.nonAlphaNumericRegex_),oe=F.match(T.nonAlphaNumericRegex_),ae=Z&&O.match(T.whitespaceRegex_),he=oe&&F.match(T.whitespaceRegex_),pe=ae&&O.match(T.linebreakRegex_),de=he&&F.match(T.linebreakRegex_),fe=pe&&f.match(T.blanklineEndRegex_),Le=de&&N.match(T.blanklineStartRegex_);return fe||Le?5:pe||de?4:Z&&!ae&&he?3:ae||he?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 v=d[l-1][1],a=d[l][1],c=d[l+1][1],p=this.diff_commonSuffix(v,a);if(p){var g=a.substring(a.length-p);v=v.substring(0,v.length-p),a=g+a.substring(0,a.length-p),c=g+c}for(var L=v,w=a,C=c,k=u(v,a)+u(a,c);a.charAt(0)===c.charAt(0);){v+=a.charAt(0),a=a.substring(1)+c.charAt(0),c=c.substring(1);var S=u(v,a)+u(a,c);S>=k&&(k=S,L=v,w=a,C=c)}d[l-1][1]!=L&&(L?d[l-1][1]=L:(d.splice(l-1,1),l--),d[l][1]=w,C?d[l+1][1]=C:(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=[],v=0,a=null,c=0,p=!1,g=!1,L=!1,w=!1;c<d.length;)d[c][0]==0?(d[c][1].length<this.Diff_EditCost&&(L||w)?(l[v++]=c,p=L,g=w,a=d[c][1]):(v=0,a=null),L=w=!1):(d[c][0]==m?w=!0:L=!0,a&&(p&&g&&L&&w||a.length<this.Diff_EditCost/2&&p+g+L+w==3)&&(d.splice(l[v-1],0,new T.Diff(m,a)),d[l[v-1]+1][0]=1,v--,a=null,p&&g?(L=w=!0,v=0):(c=--v>0?l[v-1]:-1,L=w=!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,v=0,a=0,c="",p="";l<d.length;)switch(d[l][0]){case 1:a++,p+=d[l][1],l++;break;case m:v++,c+=d[l][1],l++;break;case 0:v+a>1?(v!==0&&a!==0&&((u=this.diff_commonPrefix(p,c))!==0&&(l-v-a>0&&d[l-v-a-1][0]==0?d[l-v-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-=v+a,d.splice(l,v+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,v=0,c="",p=""}d[d.length-1][1]===""&&d.pop();var g=!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),g=!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),g=!0)),l++;g&&this.diff_cleanupMerge(d)},T.prototype.diff_xIndex=function(d,u){var l,v=0,a=0,c=0,p=0;for(l=0;l<d.length&&(d[l][0]!==1&&(v+=d[l][1].length),d[l][0]!==m&&(a+=d[l][1].length),!(v>u));l++)c=v,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,v=/</g,a=/>/g,c=/\n/g,p=0;p<d.length;p++){var g=d[p][0],L=d[p][1].replace(l,"&").replace(v,"<").replace(a,">").replace(c,"¶<br>");switch(g){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,v=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:v+=p.length;break;case 0:u+=Math.max(l,v),l=0,v=0}}return u+=Math.max(l,v)},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=[],v=0,a=0,c=u.split(/\t/g),p=0;p<c.length;p++){var g=c[p].substring(1);switch(c[p].charAt(0)){case"+":try{l[v++]=new T.Diff(1,decodeURI(g))}catch(C){throw new Error("Illegal escape in diff_fromDelta: "+g)}break;case"-":case"=":var L=parseInt(g,10);if(isNaN(L)||L<0)throw new Error("Invalid number in diff_fromDelta: "+g);var w=d.substring(a,a+=L);c[p].charAt(0)=="="?l[v++]=new T.Diff(0,w):l[v++]=new T.Diff(m,w);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 v=this.match_alphabet_(u),a=this;function c(he,pe){var de=he/u.length,fe=Math.abs(l-pe);return a.Match_Distance?de+fe/a.Match_Distance:fe?1:de}var p=this.Match_Threshold,g=d.indexOf(u,l);g!=-1&&(p=Math.min(c(0,g),p),(g=d.lastIndexOf(u,l+u.length))!=-1&&(p=Math.min(c(0,g),p)));var L,w,C=1<<u.length-1;g=-1;for(var k,S=u.length+d.length,f=0;f<u.length;f++){for(L=0,w=S;L<w;)c(f,l+w)<=p?L=w:S=w,w=Math.floor((S-L)/2+L);S=w;var N=Math.max(1,l-w+1),O=Math.min(l+w,d.length)+u.length,F=Array(O+2);F[O+1]=(1<<f)-1;for(var Z=O;Z>=N;Z--){var oe=v[d.charAt(Z-1)];if(F[Z]=f===0?(F[Z+1]<<1|1)&oe:(F[Z+1]<<1|1)&oe|(k[Z+1]|k[Z])<<1|1|k[Z+1],F[Z]&C){var ae=c(f,Z-1);if(ae<=p){if(p=ae,!((g=Z-1)>l))break;N=Math.max(1,2*l-g)}}}if(c(f+1,l)>p)break;k=F}return g},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),v=0;u.indexOf(l)!=u.lastIndexOf(l)&&l.length<this.Match_MaxBits-this.Patch_Margin-this.Patch_Margin;)v+=this.Patch_Margin,l=u.substring(d.start2-v,d.start2+d.length1+v);v+=this.Patch_Margin;var a=u.substring(d.start2-v,d.start2);a&&d.diffs.unshift(new T.Diff(0,a));var c=u.substring(d.start2+d.length1,d.start2+d.length1+v);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 v,a;if(typeof d=="string"&&typeof u=="string"&&l===void 0)v=d,(a=this.diff_main(v,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,v=this.diff_text1(a);else if(typeof d=="string"&&u&&typeof u=="object"&&l===void 0)v=d,a=u;else{if(typeof d!="string"||typeof u!="string"||!l||typeof l!="object")throw new Error("Unknown call format to patch_make.");v=d,a=l}if(a.length===0)return[];for(var c=[],p=new T.patch_obj,g=0,L=0,w=0,C=v,k=v,S=0;S<a.length;S++){var f=a[S][0],N=a[S][1];switch(g||f===0||(p.start1=L,p.start2=w),f){case 1:p.diffs[g++]=a[S],p.length2+=N.length,k=k.substring(0,w)+N+k.substring(w);break;case m:p.length1+=N.length,p.diffs[g++]=a[S],k=k.substring(0,w)+k.substring(w+N.length);break;case 0:N.length<=2*this.Patch_Margin&&g&&a.length!=S+1?(p.diffs[g++]=a[S],p.length1+=N.length,p.length2+=N.length):N.length>=2*this.Patch_Margin&&g&&(this.patch_addContext_(p,C),c.push(p),p=new T.patch_obj,g=0,C=k,L=w)}f!==1&&(L+=N.length),f!==m&&(w+=N.length)}return g&&(this.patch_addContext_(p,C),c.push(p)),c},T.prototype.patch_deepCopy=function(d){for(var u=[],l=0;l<d.length;l++){var v=d[l],a=new T.patch_obj;a.diffs=[];for(var c=0;c<v.diffs.length;c++)a.diffs[c]=new T.Diff(v.diffs[c][0],v.diffs[c][1]);a.start1=v.start1,a.start2=v.start2,a.length1=v.length1,a.length2=v.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 v=0,a=[],c=0;c<d.length;c++){var p,g,L=d[c].start2+v,w=this.diff_text1(d[c].diffs),C=-1;if(w.length>this.Match_MaxBits?(p=this.match_main(u,w.substring(0,this.Match_MaxBits),L))!=-1&&((C=this.match_main(u,w.substring(w.length-this.Match_MaxBits),L+w.length-this.Match_MaxBits))==-1||p>=C)&&(p=-1):p=this.match_main(u,w,L),p==-1)a[c]=!1,v-=d[c].length2-d[c].length1;else if(a[c]=!0,v=p-L,w==(g=C==-1?u.substring(p,p+w.length):u.substring(p,C+this.Match_MaxBits)))u=u.substring(0,p)+this.diff_text2(d[c].diffs)+u.substring(p+w.length);else{var k=this.diff_main(w,g,!1);if(w.length>this.Match_MaxBits&&this.diff_levenshtein(k)/w.length>this.Patch_DeleteThreshold)a[c]=!1;else{this.diff_cleanupSemanticLossless(k);for(var S,f=0,N=0;N<d[c].diffs.length;N++){var O=d[c].diffs[N];O[0]!==0&&(S=this.diff_xIndex(k,f)),O[0]===1?u=u.substring(0,p+S)+O[1]+u.substring(p+S):O[0]===m&&(u=u.substring(0,p+S)+u.substring(p+this.diff_xIndex(k,f+O[1].length))),O[0]!==m&&(f+=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="",v=1;v<=u;v++)l+=String.fromCharCode(v);for(v=0;v<d.length;v++)d[v].start1+=u,d[v].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 v=d[l];d.splice(l--,1);for(var a=v.start1,c=v.start2,p="";v.diffs.length!==0;){var g=new T.patch_obj,L=!0;for(g.start1=a-p.length,g.start2=c-p.length,p!==""&&(g.length1=g.length2=p.length,g.diffs.push(new T.Diff(0,p)));v.diffs.length!==0&&g.length1<u-this.Patch_Margin;){var w=v.diffs[0][0],C=v.diffs[0][1];w===1?(g.length2+=C.length,c+=C.length,g.diffs.push(v.diffs.shift()),L=!1):w===m&&g.diffs.length==1&&g.diffs[0][0]==0&&C.length>2*u?(g.length1+=C.length,a+=C.length,L=!1,g.diffs.push(new T.Diff(w,C)),v.diffs.shift()):(C=C.substring(0,u-g.length1-this.Patch_Margin),g.length1+=C.length,a+=C.length,w===0?(g.length2+=C.length,c+=C.length):L=!1,g.diffs.push(new T.Diff(w,C)),C==v.diffs[0][1]?v.diffs.shift():v.diffs[0][1]=v.diffs[0][1].substring(C.length))}p=(p=this.diff_text2(g.diffs)).substring(p.length-this.Patch_Margin);var k=this.diff_text1(v.diffs).substring(0,this.Patch_Margin);k!==""&&(g.length1+=k.length,g.length2+=k.length,g.diffs.length!==0&&g.diffs[g.diffs.length-1][0]===0?g.diffs[g.diffs.length-1][1]+=k:g.diffs.push(new T.Diff(0,k))),L||d.splice(++l,0,g)}}},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(`
`),v=0,a=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;v<l.length;){var c=l[v].match(a);if(!c)throw new Error("Invalid patch string: "+l[v]);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)),v++;v<l.length;){var g=l[v].charAt(0);try{var L=decodeURI(l[v].substring(1))}catch(w){throw new Error("Illegal escape in patch_fromText: "+L)}if(g=="-")p.diffs.push(new T.Diff(m,L));else if(g=="+")p.diffs.push(new T.Diff(1,L));else if(g==" ")p.diffs.push(new T.Diff(0,L));else{if(g=="@")break;if(g!=="")throw new Error('Invalid patch mode "'+g+'" in: '+L)}v++}}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)+` @@
`],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])+`
`}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),v=m(730),a=m(66),c=m(218),p=m(702),g=function(x){x===void 0&&(x=document);var B=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 x.querySelectorAll("img").forEach(function(P){P.getAttribute("data-src")&&B(P)}),!1;window.vditorImageIntersectionObserver?(window.vditorImageIntersectionObserver.disconnect(),x.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")&&B(D.target)})}),x.querySelectorAll("img").forEach(function(P){window.vditorImageIntersectionObserver.observe(P)}))},L=m(466),w=m(554),C=m(40),k=m(563),S=m(749),f=m(818),N=m(408),O=m(54),F=m(227),Z=m(526),oe=m(827),ae=m(640),he=m(895),pe=m(393),de=function(x,B){if(B===void 0&&(B="zh_CN"),typeof speechSynthesis!="undefined"&&typeof SpeechSynthesisUtterance!="undefined"){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(be){be.lang===B.replace("_","-")&&($=be),be.default&&(me=be)}),$||($=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")})}x.addEventListener("mouseup",function($){var me=getSelection().toString().trim();if(speechSynthesis.cancel(),getSelection().toString().trim()!==""){window.vditorSpeechRange=getSelection().getRangeAt(0).cloneRange();var be=getSelection().getRangeAt(0).getBoundingClientRect();U.innerHTML=P,U.style.display="block",U.style.top=be.top+be.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(x,B,P,D){return new(P||(P=Promise))(function(U,se){function te(be){try{me(D.next(be))}catch(ce){se(ce)}}function $(be){try{me(D.throw(be))}catch(ce){se(ce)}}function me(be){var ce;be.done?U(be.value):(ce=be.value,ce instanceof P?ce:new P(function(Fe){Fe(ce)})).then(te,$)}me((D=D.apply(x,B||[])).next())})},Le=function(x,B){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(be){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=B.call(x,te)}catch(Fe){ce=[6,Fe],D=0}finally{P=U=0}if(5&ce[0])throw ce[1];return{value:ce[0]?ce[1]:void 0,done:!0}}([me,be])}}},Se=function(x){var B={anchor:0,cdn:O.g.CDN,customEmoji:{},emojiPath:(x&&x.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)(B,x)},Ie=function(x,B){var P=Se(B);return(0,Z.G)(P.cdn+"/dist/js/lute/lute.min.js","vditorLuteScript").then(function(){var D=(0,he.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 B!=null&&B.renderers&&D.SetJSRenderers({renderers:{Md2HTML:B.renderers}}),D.SetHeadingID(!0),D.Md2HTML(x)})},ye=function(x,B,P){return fe(void 0,void 0,void 0,function(){var D,U,se;return Le(this,function(te){switch(te.label){case 0:return D=Se(P),[4,Ie(B,D)];case 1:if(U=te.sent(),D.transform&&(U=D.transform(U)),x.innerHTML=U,x.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,F.Z)(D.theme.current,D.theme.path),D.anchor===1&&x.classList.add("vditor-reset--anchor"),(0,v.O)(x),(0,p.s)(D.hljs,x,D.cdn),(0,L.H)(x,{cdn:D.cdn,math:D.math}),(0,C.i)(x,D.cdn,D.mode),(0,k.K)(x,D.cdn,D.mode),(0,a.P)(x,D.cdn),(0,c.v)(x,D.cdn),(0,l.p)(x,D.cdn,D.mode),(0,S.P)(x,D.cdn,D.mode),(0,N.B)(x,D.cdn),(0,d.Q)(x,D.cdn),(0,w.Y)(x),D.speech.enable&&de(x),D.anchor!==0&&($=D.anchor,document.querySelectorAll(".vditor-anchor").forEach(function(me){$===1&&me.classList.add("vditor-anchor--left"),me.onclick=function(){var be=me.getAttribute("href").substr(1),ce=document.getElementById("vditorAnchor-"+be).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&&g(x),x.addEventListener("click",function(me){var be=(0,oe.lG)(me.target,"SPAN");if(be&&(0,oe.fb)(be,"vditor-toc")){var ce=x.querySelector("#"+be.getAttribute("data-target-id"));ce&&window.scrollTo(window.scrollX,ce.offsetTop)}}),[2]}var $})})},M=m(863),ve=m(312);const ee=function(){function x(){}return x.adapterRender=u,x.previewImage=M.E,x.codeRender=v.O,x.graphvizRender=c.v,x.highlightRender=p.s,x.mathRender=L.H,x.mermaidRender=C.i,x.markmapRender=k.K,x.flowchartRender=a.P,x.chartRender=l.p,x.abcRender=d.Q,x.mindmapRender=S.P,x.plantumlRender=N.B,x.outlineRender=f.k,x.mediaRender=w.Y,x.speechRender=de,x.lazyLoadImageRender=g,x.md2html=Ie,x.preview=ye,x.setCodeTheme=ve.Y,x.setContentTheme=F.Z,x}()},54:(I,T,m)=>{m.d(T,{H:()=>d,g:()=>u});var d="3.9.4",u=function(){function l(){}return l.ZWSP="",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.4",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:()=>v});var d=m(54),u=m(526),l=m(156),v=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(g){g.parentElement.classList.contains("vditor-wysiwyg__pre")||g.parentElement.classList.contains("vditor-ir__marker--pre")||g.getAttribute("data-processed")!=="true"&&(ABCJS.renderAbc(g,l.abcRenderAdapter.getCode(g).trim()),g.style.overflowX="auto",g.setAttribute("data-processed","true"))})})}},156:(I,T,m)=>{m.r(T),m.d(T,{mathRenderAdapter:()=>d,mermaidRenderAdapter:()=>u,markmapRenderAdapter:()=>l,mindmapRenderAdapter:()=>v,chartRenderAdapter:()=>a,abcRenderAdapter:()=>c,graphvizRenderAdapter:()=>p,flowchartRenderAdapter:()=>g,plantumlRenderAdapter:()=>L});var d={getCode:function(w){return w.textContent},getElements:function(w){return w.querySelectorAll(".language-math")}},u={getCode:function(w){return w.textContent},getElements:function(w){return w.querySelectorAll(".language-mermaid")}},l={getCode:function(w){return w.textContent},getElements:function(w){return w.querySelectorAll(".language-markmap")}},v={getCode:function(w){return w.getAttribute("data-code")},getElements:function(w){return w.querySelectorAll(".language-mindmap")}},a={getCode:function(w){return w.innerText},getElements:function(w){return w.querySelectorAll(".language-echarts")}},c={getCode:function(w){return w.textContent},getElements:function(w){return w.querySelectorAll(".language-abc")}},p={getCode:function(w){return w.textContent},getElements:function(w){return w.querySelectorAll(".language-graphviz")}},g={getCode:function(w){return w.textContent},getElements:function(w){return w.querySelectorAll(".language-flowchart")}},L={getCode:function(w){return w.textContent},getElements:function(w){return w.querySelectorAll(".language-plantuml")}}},314:(I,T,m)=>{m.d(T,{p:()=>v});var d=m(54),u=m(526),l=m(156),v=function(a,c,p){a===void 0&&(a=document),c===void 0&&(c=d.g.CDN);var g=l.chartRenderAdapter.getElements(a);g.length>0&&(0,u.G)(c+"/dist/js/echarts/echarts.min.js","vditorEchartsScript").then(function(){g.forEach(function(L){if(!L.parentElement.classList.contains("vditor-wysiwyg__pre")&&!L.parentElement.classList.contains("vditor-ir__marker--pre")){var w=l.chartRenderAdapter.getCode(L).trim();if(w)try{if(L.getAttribute("data-processed")==="true")return;var C=JSON.parse(w);echarts.init(L,p==="dark"?"dark":void 0).setOption(C),L.setAttribute("data-processed","true")}catch(k){L.className="vditor-reset--error",L.innerHTML="echarts render error: <br>"+k}}})})}},730:(I,T,m)=>{m.d(T,{O:()=>l});var d=m(51),u=m(54),l=function(v){v.querySelectorAll("pre > code").forEach(function(a,c){var p,g,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||v.classList.contains("vditor-preview")&&c>5)){var w=a.innerText;if(a.classList.contains("highlight-chroma")){var C=document.createElement("code");C.innerHTML=a.innerHTML,C.querySelectorAll(".highlight-ln").forEach(function(N){N.remove()}),w=C.innerText}else w.endsWith(`
`)&&(w=w.substr(0,w.length-1));var k='<svg><use xlink:href="#vditor-icon-copy"></use></svg>';document.getElementById("vditorIconScript")||(k='<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 S=document.createElement("div");S.className="vditor-copy",S.innerHTML='<span aria-label="'+(((p=window.VditorI18n)===null||p===void 0?void 0:p.copy)||"复制")+`"
onmouseover="this.setAttribute('aria-label', '`+(((g=window.VditorI18n)===null||g===void 0?void 0:g.copy)||"复制")+`')"
class="vditor-tooltipped vditor-tooltipped__w"
onclick="this.previousElementSibling.select();document.execCommand('copy');this.setAttribute('aria-label', '`+(((L=window.VditorI18n)===null||L===void 0?void 0:L.copied)||"已复制")+`')">`+k+"</span>";var f=document.createElement("textarea");f.value=(0,d.X)(w),S.insertAdjacentElement("afterbegin",f),a.before(S),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:()=>v});var d=m(54),u=m(526),l=m(156),v=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(g){if(g.getAttribute("data-processed")!=="true"){var L=flowchart.parse(l.flowchartRenderAdapter.getCode(g));g.innerHTML="",L.drawSVG(g),g.setAttribute("data-processed","true")}})})}},218:(I,T,m)=>{m.d(T,{v:()=>v});var d=m(54),u=m(526),l=m(156),v=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(g){var L=l.graphvizRenderAdapter.getCode(g);if(!g.parentElement.classList.contains("vditor-wysiwyg__pre")&&!g.parentElement.classList.contains("vditor-ir__marker--pre")&&g.getAttribute("data-processed")!=="true"&&L.trim()!==""){try{var w=new Blob(["importScripts('"+document.getElementById("vditorGraphVizScript").src.replace("viz.js","full.render.js")+"');"],{type:"application/javascript"}),C=(window.URL||window.webkitURL).createObjectURL(w),k=new Worker(C);new Viz({worker:k}).renderSVGElement(L).then(function(S){g.innerHTML=S.outerHTML}).catch(function(S){g.innerHTML="graphviz render error: <br>"+S,g.className="vditor-reset--error"})}catch(S){console.error("graphviz error",S)}g.setAttribute("data-processed","true")}})})}},702:(I,T,m)=>{m.d(T,{s:()=>v});var d=m(54),u=m(526),l=m(578),v=function(a,c,p){c===void 0&&(c=document),p===void 0&&(p=d.g.CDN);var g=a.style;d.g.CODE_THEME.includes(g)||(g="github");var L=document.getElementById("vditorHljsStyle"),w=p+"/dist/js/highlight.js/styles/"+g+".css";L&&L.href!==w&&L.remove(),(0,l.c)(p+"/dist/js/highlight.js/styles/"+g+".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(C){if(!C.parentElement.classList.contains("vditor-ir__marker--pre")&&!C.parentElement.classList.contains("vditor-wysiwyg__pre")&&!(C.classList.contains("language-mermaid")||C.classList.contains("language-flowchart")||C.classList.contains("language-echarts")||C.classList.contains("language-mindmap")||C.classList.contains("language-plantuml")||C.classList.contains("language-abc")||C.classList.contains("language-graphviz")||C.classList.contains("language-math"))&&(a.defaultLang!==""&&C.className.indexOf("language-")===-1&&C.classList.add("language-"+a.defaultLang),hljs.highlightElement(C),a.lineNumber)){C.classList.add("vditor-linenumber");var k=C.querySelector(".vditor-linenumber__temp");k||((k=document.createElement("div")).className="vditor-linenumber__temp",C.insertAdjacentElement("beforeend",k));var S=getComputedStyle(C).whiteSpace,f=!1;S!=="pre-wrap"&&S!=="pre-line"||(f=!0);var N="",O=C.textContent.split(/\r\n|\r|\n/g);O.pop(),O.map(function(F){var Z="";f&&(k.textContent=F||`
`,Z=' style="height:'+k.getBoundingClientRect().height+'px"'),N+="<span"+Z+"></span>"}),k.style.display="none",N='<span class="vditor-linenumber__rows">'+N+"</span>",C.insertAdjacentHTML("beforeend",N)}})})})})}},563:(I,T,m)=>{m.d(T,{K:()=>c});var d=m(54),u=m(526),l=m(156),v={},a=function(p,g){var L=window.markmap,w=L.Transformer,C=L.Markmap,k=L.deriveOptions,S=(L.globalCSS,new w);p.innerHTML='<svg style="width:100%"></svg>';var f=p.firstChild,N=C.create(f,null),O=function(ae,he){var pe=ae.transform(he),de=Object.keys(pe.features).filter(function(ye){return!v[ye]});de.forEach(function(ye){v[ye]=!0});var fe=ae.getAssets(de),Le=fe.styles,Se=fe.scripts,Ie=window.markmap;return Le&&Ie.loadCSS(Le),Se&&Ie.loadJS(Se),pe}(S,g),F=O.root,Z=O.frontmatter,oe=k(Z==null?void 0:Z.markmap);N.setData(F,oe),N.fit()},c=function(p,g,L){g===void 0&&(g=d.g.CDN);var w=l.markmapRenderAdapter.getElements(p);w.length!==0&&(0,u.G)(g+"/src/js/markmap/markmap.min.js","vditorMermaidScript").then(function(){w.forEach(function(C){var k=l.markmapRenderAdapter.getCode(C);if(C.getAttribute("data-processed")!=="true"&&k.trim()!==""){var S=document.createElement("div");S.className="language-markmap",C.parentNode.appendChild(S),a(S,k),C.parentNode.childNodes[0].nodeName=="CODE"&&C.parentNode.removeChild(C.parentNode.childNodes[0])}})})}},466:(I,T,m)=>{m.d(T,{H:()=>c});var d=m(54),u=m(526),l=m(578),v=m(51),a=m(156),c=function(p,g){var L=a.mathRenderAdapter.getElements(p);if(L.length!==0){var w={cdn:d.g.CDN,math:{engine:"KaTeX",inlineDigit:!1,macros:{}}};if(g&&g.math&&(g.math=Object.assign({},w.math,g.math)),(g=Object.assign({},w,g)).math.engine==="KaTeX")(0,l.c)(g.cdn+"/dist/js/katex/katex.min.css","vditorKatexStyle"),(0,u.G)(g.cdn+"/dist/js/katex/katex.min.js","vditorKatexScript").then(function(){(0,u.G)(g.cdn+"/dist/js/katex/mhchem.min.js","vditorKatexChemScript").then(function(){L.forEach(function(k){if(!k.parentElement.classList.contains("vditor-wysiwyg__pre")&&!k.parentElement.classList.contains("vditor-ir__marker--pre")&&!k.getAttribute("data-math")){var S=(0,v.X)(a.mathRenderAdapter.getCode(k));k.setAttribute("data-math",S);try{k.innerHTML=katex.renderToString(S,{displayMode:k.tagName==="DIV",output:"html"})}catch(f){k.innerHTML=f.message,k.className="language-math vditor-reset--error"}k.addEventListener("copy",function(f){f.stopPropagation(),f.preventDefault();var N=f.currentTarget.closest(".language-math");f.clipboardData.setData("text/html",N.innerHTML),f.clipboardData.setData("text/plain",N.getAttribute("data-math"))})}})})});else if(g.math.engine==="MathJax"){window.MathJax||(window.MathJax={loader:{paths:{mathjax:g.cdn+"/dist/js/mathjax"}},startup:{typeset:!1},tex:{macros:g.math.macros}}),(0,u.J)(g.cdn+"/dist/js/mathjax/tex-svg-full.js","protyleMathJaxScript");var C=function(k,S){var f=(0,v.X)(k.textContent).trim(),N=window.MathJax.getMetricsFor(k);N.display=k.tagName==="DIV",window.MathJax.tex2svgPromise(f,N).then(function(O){k.innerHTML="",k.setAttribute("data-math",f),k.append(O),window.MathJax.startup.document.clear(),window.MathJax.startup.document.updateDocument();var F=O.querySelector('[data-mml-node="merror"]');F&&F.textContent.trim()!==""&&(k.innerHTML=F.textContent.trim(),k.className="vditor-reset--error"),S&&S()})};window.MathJax.startup.promise.then(function(){for(var k=[],S=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,v.X)(O.textContent).trim()||k.push(function(F){N===L.length-1?C(O):C(O,F)})},f=0;f<L.length;f++)S(f);(function(N){if(N.length!==0){var O=0,F=N[N.length-1],Z=function(){var oe=N[O++];oe===F?oe():oe(Z)};Z()}})(k)})}}}},554:(I,T,m)=>{m.d(T,{Y:()=>d});var d=function(u){u&&u.querySelectorAll("a").forEach(function(l){var v=l.getAttribute("href");v&&(v.match(/^.+.(mp4|m4v|ogg|ogv|webm)$/)?function(a,c){a.insertAdjacentHTML("afterend",'<video controls="controls" src="'+c+'"></video>'),a.remove()}(l,v):v.match(/^.+.(mp3|wav|flac)$/)?function(a,c){a.insertAdjacentHTML("afterend",'<audio controls="controls" src="'+c+'"></audio>'),a.remove()}(l,v):function(a,c){var p=c.match(/\/\/(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))([\w|-]{11})(?:(?:[\?&]t=)(\S+))?/),g=c.match(/\/\/v\.youku\.com\/v_show\/id_(\w+)=*\.html/),L=c.match(/\/\/v\.qq\.com\/x\/cover\/.*\/([^\/]+)\.html\??.*/),w=c.match(/(?:www\.|\/\/)coub\.com\/view\/(\w+)/),C=c.match(/(?:www\.|\/\/)facebook\.com\/([^\/]+)\/videos\/([0-9]+)/),k=c.match(/.+dailymotion.com\/(video|hub)\/(\w+)\?/),S=c.match(/(?:www\.|\/\/)bilibili\.com\/video\/(\w+)/),f=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()):g&&g[1]?(a.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//player.youku.com/embed/'+g[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()):w&&w[1]?(a.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
src="//coub.com/embed/`+w[1]+'?muted=false&autostart=false&originalSize=true&startWithHD=true"></iframe>'),a.remove()):C&&C[0]?(a.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
src="https://www.facebook.com/plugins/video.php?href=`+encodeURIComponent(C[0])+'"></iframe>'),a.remove()):k&&k[2]?(a.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
src="https://www.dailymotion.com/embed/video/`+k[2]+'"></iframe>'),a.remove()):S&&S[1]?(a.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
src="//player.bilibili.com/player.html?bvid=`+S[1]+'"></iframe>'),a.remove()):f&&f[1]&&(a.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//embed.ted.com/talks/'+f[1]+'"></iframe>'),a.remove())}(l,v))})}},40:(I,T,m)=>{m.d(T,{i:()=>v});var d=m(54),u=m(526),l=m(156),v=function(a,c,p){c===void 0&&(c=d.g.CDN);var g=l.mermaidRenderAdapter.getElements(a);g.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),g.forEach(function(w){var C=l.mermaidRenderAdapter.getCode(w);w.getAttribute("data-processed")!=="true"&&C.trim()!==""&&(mermaid.init(void 0,w),w.setAttribute("data-processed","true"))})})}},749:(I,T,m)=>{m.d(T,{P:()=>v});var d=m(54),u=m(526),l=m(156),v=function(a,c,p){a===void 0&&(a=document),c===void 0&&(c=d.g.CDN);var g=l.mindmapRenderAdapter.getElements(a);g.length>0&&(0,u.G)(c+"/dist/js/echarts/echarts.min.js","vditorEchartsScript").then(function(){g.forEach(function(L){if(!L.parentElement.classList.contains("vditor-wysiwyg__pre")&&!L.parentElement.classList.contains("vditor-ir__marker--pre")){var w=l.mindmapRenderAdapter.getCode(L);if(w)try{if(L.getAttribute("data-processed")==="true")return;echarts.init(L,p==="dark"?"dark":void 0).setOption({series:[{data:[JSON.parse(decodeURIComponent(w))],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(C,k){var S;return!((S=k==null?void 0:k.data)===null||S===void 0)&&S.children?"circle":"path://"},type:"tree"}],tooltip:{trigger:"item",triggerOn:"mousemove"}}),L.setAttribute("data-processed","true")}catch(C){L.className="vditor-reset--error",L.innerHTML="mindmap render error: <br>"+C}}})})}},818:(I,T,m)=>{m.d(T,{k:()=>l});var d=m(64),u=m(466),l=function(v,a,c){var p="",g=[];if(Array.from(v.children).forEach(function(k,S){if((0,d.W)(k)){if(c){var f=k.id.lastIndexOf("_");k.id=k.id.substring(0,f===-1?void 0:f)+"_"+S}g.push(k.id),p+=k.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(v)?c.currentMode!=="ir"||c.preview.element.contains(v)?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 w=Lute.New();w.SetToC(!0),L.innerHTML=w.HTML2VditorDOM("<p>[ToC]</p>"+p)}var C=L.firstElementChild.querySelectorAll("li > span[data-target-id]");return C.forEach(function(k,S){if(k.nextElementSibling&&k.nextElementSibling.tagName==="UL"){var f="<svg class='vditor-outline__action'><use xlink:href='#vditor-icon-down'></use></svg>";document.getElementById("vditorIconScript")||(f='<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>'),k.innerHTML=f+"<span>"+k.innerHTML+"</span>"}else k.innerHTML="<svg></svg><span>"+k.innerHTML+"</span>";k.setAttribute("data-target-id",g[S])}),p=L.firstElementChild.innerHTML,C.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(k){for(var S=k.target;S&&!S.isEqualNode(a);){if(S.classList.contains("vditor-outline__action")){S.classList.contains("vditor-outline__action--close")?(S.classList.remove("vditor-outline__action--close"),S.parentElement.nextElementSibling.setAttribute("style","display:block")):(S.classList.add("vditor-outline__action--close"),S.parentElement.nextElementSibling.setAttribute("style","display:none")),k.preventDefault(),k.stopPropagation();break}if(S.getAttribute("data-target-id")){k.preventDefault(),k.stopPropagation();var f=document.getElementById(S.getAttribute("data-target-id"));if(!f)return;if(c)if(c.options.height==="auto"){var N=f.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(v)?v.parentElement.scrollTop=f.offsetTop:v.scrollTop=f.offsetTop;else window.scrollTo(window.scrollX,f.offsetTop);break}S=S.parentElement}}),p)}},408:(I,T,m)=>{m.d(T,{B:()=>v});var d=m(54),u=m(526),l=m(156),v=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(g){if(!g.parentElement.classList.contains("vditor-wysiwyg__pre")&&!g.parentElement.classList.contains("vditor-ir__marker--pre")){var L=l.plantumlRenderAdapter.getCode(g).trim();if(L)try{g.innerHTML='<img src="http://www.plantuml.com/plantuml/svg/~1'+plantumlEncoder.encode(L)+'">'}catch(w){g.className="vditor-reset--error",g.innerHTML="plantuml render error: <br>"+w}}})})}},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,v){v===void 0&&(v="classic");var a=u.getBoundingClientRect();document.body.insertAdjacentHTML("beforeend",'<div class="vditor vditor-img'+(v==="dark"?" vditor--dark":"")+`">
<div class="vditor-img__bar">
<span class="vditor-img__btn" data-deg="0">
<svg><use xlink:href="#vditor-icon-redo"></use></svg>
`+window.VditorI18n.spin+`
</span>
<span class="vditor-img__btn" onclick="this.parentElement.parentElement.outerHTML = '';document.body.style.overflow = ''">
X `+window.VditorI18n.close+`
</span>
</div>
<div class="vditor-img__img" onclick="this.parentElement.outerHTML = '';document.body.style.overflow = ''">
<img style="width: `+u.width+"px;height:"+u.height+"px;transform: translate3d("+a.left+"px, "+(a.top-36)+'px, 0)" src="'+u.getAttribute("src")+`">
</div>
</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 g=document.querySelector(".vditor-img__btn");g.addEventListener("click",function(){var L=parseInt(g.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)",g.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(v,a){a===void 0&&(a=d.g.CDN),d.g.CODE_THEME.includes(v)||(v="github");var c=document.getElementById("vditorHljsStyle"),p=a+"/dist/js/highlight.js/styles/"+v+".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,v){if(l&&v){var a=document.getElementById("vditorContentTheme"),c=v+"/"+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,{J:()=>d,G:()=>u});var d=function(l,v){if(document.getElementById(v))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=v,document.head.appendChild(c)},u=function(l,v){return new Promise(function(a,c){if(document.getElementById(v))return a(),!1;var p=document.createElement("script");p.src=l,p.async=!0,document.head.appendChild(p),p.onload=function(){if(document.getElementById(v))return p.remove(),a(),!1;p.id=v,a()}})}},578:(I,T,m)=>{m.d(T,{c:()=>d});var d=function(u,l){if(!document.getElementById(l)){var v=document.createElement("link");v.id=l,v.rel="stylesheet",v.type="text/css",v.href=u,document.getElementsByTagName("head")[0].appendChild(v)}}},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,vU:()=>u,pK:()=>l,Le:()=>v,yl:()=>a,ns:()=>c,i7:()=>p});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!="undefined"}catch(g){return!1}},v=function(){return navigator.userAgent.indexOf("iPhone")>-1?"touchstart":"click"},a=function(g){return navigator.platform.toUpperCase().indexOf("MAC")>=0?!(!g.metaKey||g.ctrlKey):!(g.metaKey||!g.ctrlKey)},c=function(g){return/Mac/.test(navigator.platform)||navigator.platform==="iPhone"?g.indexOf("⇧")>-1&&u()&&(g=g.replace(";",":").replace("=","+").replace("-","_")):(g=(g=g.startsWith("⌘")?g.replace("⌘","⌘+"):g.startsWith("⌥")&&g.substr(1,1)!=="⌘"?g.replace("⌥","⌥+"):g.replace("⇧⌘","⌘+⇧+").replace("⌥⌘","⌥+⌘+")).replace("⌘","Ctrl").replace("⇧","Shift").replace("⌥","Alt")).indexOf("Shift")>-1&&(g=g.replace(";",":").replace("=","+").replace("-","_")),g},p=function(){return/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}},827:(I,T,m)=>{m.d(T,{JQ:()=>u,E2:()=>l,O9:()=>v,a1:()=>a,F9:()=>c,lG:()=>p,fb:()=>g,DX:()=>L});var d=m(64),u=function(w,C){for(var k=g(w,C),S=!1,f=!1;k&&!k.classList.contains("vditor-reset")&&!f;)(S=g(k.parentElement,C))?k=S:f=!0;return k||!1},l=function(w,C){for(var k=(0,d.S)(w,C),S=!1,f=!1;k&&!k.classList.contains("vditor-reset")&&!f;)(S=(0,d.S)(k.parentElement,C))?k=S:f=!0;return k||!1},v=function(w){var C=l(w,"UL"),k=l(w,"OL"),S=C;return k&&(!C||C&&k.contains(C))&&(S=k),S},a=function(w,C,k){if(!w)return!1;w.nodeType===3&&(w=w.parentElement);for(var S=w,f=!1;S&&!f&&!S.classList.contains("vditor-reset");)S.getAttribute(C)===k?f=!0:S=S.parentElement;return f&&S},c=function(w){if(!w)return!1;w.nodeType===3&&(w=w.parentElement);var C=w,k=!1,S=a(w,"data-block","0");if(S)return S;for(;C&&!k&&!C.classList.contains("vditor-reset");)C.tagName==="H1"||C.tagName==="H2"||C.tagName==="H3"||C.tagName==="H4"||C.tagName==="H5"||C.tagName==="H6"||C.tagName==="P"||C.tagName==="BLOCKQUOTE"||C.tagName==="OL"||C.tagName==="UL"?k=!0:C=C.parentElement;return k&&C},p=function(w,C){if(!w)return!1;w.nodeType===3&&(w=w.parentElement);for(var k=w,S=!1;k&&!S&&!k.classList.contains("vditor-reset");)k.nodeName===C?S=!0:k=k.parentElement;return S&&k},g=function(w,C){if(!w)return!1;w.nodeType===3&&(w=w.parentElement);for(var k=w,S=!1;k&&!S&&!k.classList.contains("vditor-reset");)k.classList.contains(C)?S=!0:k=k.parentElement;return S&&k},L=function(w){for(;w&&w.lastChild;)w=w.lastChild;return w}},64:(I,T,m)=>{m.d(T,{S:()=>d,W:()=>u});var d=function(l,v){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(v)===0?c=!0:a=a.parentElement;return c&&a},u=function(l){var v=d(l,"H");return!(!v||v.tagName.length!==2||v.tagName==="HR")&&v}},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 v={},a=function(p){for(var g in p)p.hasOwnProperty(g)&&(Object.prototype.toString.call(p[g])==="[object Object]"?v[g]=d(v[g],p[g]):v[g]=p[g])},c=0;c<u.length;c++)a(u[c]);return v}},393:(I,T,m)=>{m.d(T,{zh:()=>v,Ny:()=>a,Gb:()=>c,Hc:()=>p,im:()=>g,$j:()=>L,ib:()=>w,oC:()=>C});var d=m(54),u=m(794),l=m(827),v=function(k){var S,f=k[k.currentMode].element;return getSelection().rangeCount>0&&(S=getSelection().getRangeAt(0),f.isEqualNode(S.startContainer)||f.contains(S.startContainer))?S:k[k.currentMode].range?k[k.currentMode].range:(f.focus(),(S=f.ownerDocument.createRange()).setStart(f,0),S.collapse(!0),S)},a=function(k){var S=window.getSelection().getRangeAt(0);if(!k.contains(S.startContainer)&&!(0,l.fb)(S.startContainer,"vditor-panel--none"))return{left:0,top:0};var f,N=k.parentElement.getBoundingClientRect();if(S.getClientRects().length===0)if(S.startContainer.nodeType===3){var O=S.startContainer.parentElement;if(!(O&&O.getClientRects().length>0))return{left:0,top:0};f=O.getClientRects()[0]}else{var F=S.startContainer.children;if(F[S.startOffset]&&F[S.startOffset].getClientRects().length>0)f=F[S.startOffset].getClientRects()[0];else if(S.startContainer.childNodes.length>0){var Z=S.cloneRange();S.selectNode(S.startContainer.childNodes[Math.max(0,S.startOffset-1)]),f=S.getClientRects()[0],S.setEnd(Z.endContainer,Z.endOffset),S.setStart(Z.startContainer,Z.startOffset)}else f=S.startContainer.getClientRects()[0];if(!f){for(var oe=S.startContainer.childNodes[S.startOffset];!oe.getClientRects||oe.getClientRects&&oe.getClientRects().length===0;)oe=oe.parentElement;f=oe.getClientRects()[0]}}else f=S.getClientRects()[0];return{left:f.left-N.left,top:f.top-N.top}},c=function(k,S){if(!S){if(getSelection().rangeCount===0)return!1;S=getSelection().getRangeAt(0)}var f=S.commonAncestorContainer;return k.isEqualNode(f)||k.contains(f)},p=function(k){var S=window.getSelection();S.removeAllRanges(),S.addRange(k)},g=function(k,S,f){var N={end:0,start:0};if(!f){if(getSelection().rangeCount===0)return N;f=window.getSelection().getRangeAt(0)}if(c(S,f)){var O=f.cloneRange();k.childNodes[0]&&k.childNodes[0].childNodes[0]?O.setStart(k.childNodes[0].childNodes[0],0):O.selectNodeContents(k),O.setEnd(f.startContainer,f.startOffset),N.start=O.toString().length,N.end=N.start+f.toString().length}return N},L=function(k,S,f){var N=0,O=0,F=f.childNodes[O],Z=!1,oe=!1;k=Math.max(0,k),S=Math.max(0,S);var ae=f.ownerDocument.createRange();for(ae.setStart(F||f,0),ae.collapse(!0);!oe&&F;){var he=N+F.textContent.length;if(!Z&&k>=N&&k<=he&&(k===0?ae.setStart(F,0):F.childNodes[0].nodeType===3?ae.setStart(F.childNodes[0],k-N):F.nextSibling?ae.setStartBefore(F.nextSibling):ae.setStartAfter(F),Z=!0,k===S)){oe=!0;break}Z&&S>=N&&S<=he&&(S===0?ae.setEnd(F,0):F.childNodes[0].nodeType===3?ae.setEnd(F.childNodes[0],S-N):F.nextSibling?ae.setEndBefore(F.nextSibling):ae.setEndAfter(F),oe=!0),N=he,F=f.childNodes[++O]}return!oe&&f.childNodes[O-1]&&ae.setStartBefore(f.childNodes[O-1]),p(ae),ae},w=function(k,S){var f=k.querySelector("wbr");if(f){if(f.previousElementSibling)if(f.previousElementSibling.isSameNode(f.previousSibling)){if(f.previousElementSibling.lastChild)return S.setStartBefore(f),S.collapse(!0),p(S),!(0,u.i7)()||f.previousElementSibling.tagName!=="EM"&&f.previousElementSibling.tagName!=="STRONG"&&f.previousElementSibling.tagName!=="S"||(S.insertNode(document.createTextNode(d.g.ZWSP)),S.collapse(!1)),void f.remove();S.setStartAfter(f.previousElementSibling)}else S.setStart(f.previousSibling,f.previousSibling.textContent.length);else f.previousSibling?S.setStart(f.previousSibling,f.previousSibling.textContent.length):f.nextSibling?f.nextSibling.nodeType===3?S.setStart(f.nextSibling,0):S.setStartBefore(f.nextSibling):S.setStart(f.parentElement,0);S.collapse(!0),f.remove(),p(S)}},C=function(k,S){var f=document.createElement("div");f.innerHTML=k;var N=f.querySelectorAll("p");N.length===1&&!N[0].previousSibling&&!N[0].nextSibling&&S[S.currentMode].element.children.length>0&&f.firstElementChild.tagName==="P"&&(k=N[0].innerHTML.trim());var O=document.createElement("div");O.innerHTML=k;var F=v(S);if(F.toString()!==""&&(S[S.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)(F.startContainer);Z?Z.insertAdjacentHTML("afterend",O.innerHTML):S[S.currentMode].element.insertAdjacentHTML("beforeend",O.innerHTML),w(S[S.currentMode].element,F)}else{var oe=document.createElement("template");oe.innerHTML=k,F.insertNode(oe.content.cloneNode(!0)),F.collapse(!1),p(F)}}}},Ne={};function K(I){var T=Ne[I];if(T!==void 0)return T.exports;var m=Ne[I]={exports:{}};return ge[I](m,m.exports,K),m.exports}K.d=(I,T)=>{for(var m in T)K.o(T,m)&&!K.o(I,m)&&Object.defineProperty(I,m,{enumerable:!0,get:T[m]})},K.o=(I,T)=>Object.prototype.hasOwnProperty.call(I,T),K.r=I=>{typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(I,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(I,"__esModule",{value:!0})};var De={};return(()=>{K.d(De,{default:()=>bi});var I,T=K(872),m=K(54),d=K(51),u=function(e){return e.currentMode==="sv"?(0,d.X)((e.sv.element.textContent+`
`).replace(/\n\n$/,`
`)):e.currentMode==="wysiwyg"?e.lute.VditorDOM2Md(e.wysiwyg.element.innerHTML):e.currentMode==="ir"?e.lute.VditorIRDOM2Md(e.ir.element.innerHTML):""},l=K(526),v=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=K(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")}})},g=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)}})},w=function(e,t){t.forEach(function(n){e[n]&&e[n]&&(e[n].style.display="none")})},C=function(e,t){t.forEach(function(n){e[n]&&e[n]&&(e[n].style.display="block")})},k=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")},S=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":(k(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")))})},f=K(827),N=K(64),O=function(e,t,n,i){i&&console.log(e+" - "+n+": "+t)},F=K(478),Z=K(314),oe=K(730),ae=K(66),he=K(218),pe=K(702),de=K(466),fe=K(40),Le=K(563),Se=K(749),Ie=K(408),ye=function(e,t){if(e)if(e.parentElement.getAttribute("data-type")!=="html-block"){var n=e.firstElementChild.className.replace("language-","");n==="abc"?(0,F.Q)(e,t.options.cdn):n==="mermaid"?(0,fe.i)(e,t.options.cdn,t.options.theme):n==="markmap"?(0,Le.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,Ie.B)(e,t.options.cdn):n==="graphviz"?(0,he.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=K(393),ve=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,f.lG)(e.target,"SPAN");if(n&&(0,f.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}},x=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(tt(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(pt(t,n,i,e,e.nextElementSibling))return!0}if(n.key==="Backspace"||n.key==="Delete"){var r=(0,f.fb)(i.startContainer,"vditor-toc");if(r)return r.remove(),ue(t),!0}},B=function(e,t,n,i){n===void 0&&(n=!1);var r=(0,f.F9)(t.startContainer);if(r&&!n&&r.getAttribute("data-type")!=="code-block"){if(Pt(r.innerHTML)&&r.previousElementSibling||qt(r.innerHTML))return;for(var o=(0,M.im)(r,e.ir.element,t).start,s=!0,h=o-1;h>r.textContent.substr(0,o).lastIndexOf(`
`);h--)if(r.textContent.charAt(h)!==" "&&r.textContent.charAt(h)!==" "){s=!1;break}o===0&&(s=!1);var E=!0;for(h=o-1;h<r.textContent.length;h++)if(r.textContent.charAt(h)!==" "&&r.textContent.charAt(h)!==`
`){E=!1;break}if(s)return void(typeof e.options.input=="function"&&e.options.input(u(e)));if(E&&!(0,f.fb)(t.startContainer,"vditor-ir__marker")){var b=t.startContainer.previousSibling;return b&&b.nodeType!==3&&b.classList.contains("vditor-ir__node--expand")&&b.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(Y){Y.classList.remove("vditor-ir__node--expand")}),r||(r=e.ir.element),!r.querySelector("wbr")){var y=(0,f.fb)(t.startContainer,"vditor-ir__preview");y?y.previousElementSibling.insertAdjacentHTML("beforeend","<wbr>"):t.insertNode(document.createElement("wbr"))}r.querySelectorAll("[style]").forEach(function(Y){Y.removeAttribute("style")}),r.getAttribute("data-type")==="link-ref-defs-block"&&(r=e.ir.element);var _,R=r.isEqualNode(e.ir.element),q=(0,f.a1)(r,"data-type","footnotes-block"),A="";if(R)A=r.innerHTML;else{var j=(0,N.S)(t.startContainer,"BLOCKQUOTE"),W=(0,f.O9)(t.startContainer);if(W&&(r=W),j&&(!W||W&&!j.contains(W))&&(r=j),q&&(r=q),A=r.outerHTML,r.tagName==="UL"||r.tagName==="OL"){var z=r.previousElementSibling,G=r.nextElementSibling;!z||z.tagName!=="UL"&&z.tagName!=="OL"||(A=z.outerHTML+A,z.remove()),!G||G.tagName!=="UL"&&G.tagName!=="OL"||(A+=G.outerHTML,G.remove()),A=A.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"&&(A=r.previousElementSibling.outerHTML+A,r.previousElementSibling.remove());r.innerText.startsWith("```")||(e.ir.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(Y){Y&&!r.isEqualNode(Y)&&(A+=Y.outerHTML,Y.remove())}),e.ir.element.querySelectorAll("[data-type='footnotes-block']").forEach(function(Y){Y&&!r.isEqualNode(Y)&&(A+=Y.outerHTML,Y.remove())}))}if(O("SpinVditorIRDOM",A,"argument",e.options.debugger),A=e.lute.SpinVditorIRDOM(A),O("SpinVditorIRDOM",A,"result",e.options.debugger),R)r.innerHTML=A;else if(r.outerHTML=A,q){var V=(0,f.a1)(e.ir.element.querySelector("wbr"),"data-type","footnotes-def");if(V){var H=V.textContent,X=H.substring(1,H.indexOf("]:")),ie=e.ir.element.querySelector('sup[data-type="footnotes-ref"][data-footnotes-label="'+X+'"]');ie&&ie.setAttribute("aria-label",H.substr(X.length+3).trim().substr(0,24))}}var Q,re=e.ir.element.querySelectorAll("[data-type='link-ref-defs-block']");re.forEach(function(Y,le){le===0?_=Y:(_.insertAdjacentHTML("beforeend",Y.innerHTML),Y.remove())}),re.length>0&&e.ir.element.insertAdjacentElement("beforeend",re[0]);var ne=e.ir.element.querySelectorAll("[data-type='footnotes-block']");ne.forEach(function(Y,le){le===0?Q=Y:(Q.insertAdjacentHTML("beforeend",Y.innerHTML),Y.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(Y){ye(Y,e)}),ve(e),Ge(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})},P=function(e,t){if(e==="")return!1;if(e.indexOf("⇧")===-1&&e.indexOf("⌘")===-1&&e.indexOf("⌥")===-1)return!((0,a.yl)(t)||t.altKey||t.shiftKey||t.code!==e);if(e==="⇧Tab")return!((0,a.yl)(t)||t.altKey||!t.shiftKey||t.code!=="Tab");var n=e.split("");if(e.startsWith("⌥")){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==="⌘Enter"&&(n=["⌘","Enter"]);var r=n.length>2&&n[0]==="⇧",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,f.JQ)(e.startContainer,"vditor-ir__node"),i=!e.collapsed&&(0,f.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 h=s.startContainer;if(h.nodeType===3&&h.nodeValue.length!==s.startOffset)return!1;for(var E=h.nextSibling;E&&E.textContent==="";)E=E.nextSibling;if(!E){var b=(0,f.fb)(h,"vditor-ir__marker");if(b&&!b.nextSibling){var y=h.parentElement.parentElement.nextSibling;if(y&&y.nodeType!==3&&y.classList.contains("vditor-ir__node"))return y}return!1}return!(!E||E.nodeType===3||!E.classList.contains("vditor-ir__node")||E.getAttribute("data-block"))&&E}(e);if(r)return r.classList.add("vditor-ir__node--expand"),void r.classList.remove("vditor-ir__node--hidden");var o=function(s){var h=s.startContainer,E=h.previousSibling;return!(h.nodeType!==3||s.startOffset!==0||!E||E.nodeType===3||!E.classList.contains("vditor-ir__node")||E.getAttribute("data-block"))&&E}(e);return o?(o.classList.add("vditor-ir__node--expand"),void o.classList.remove("vditor-ir__node--hidden")):void 0}},U=K(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,f.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,h=!0,E=s-1;E>o.textContent.substr(0,s).lastIndexOf(`
`);E--)if(o.textContent.charAt(E)!==" "&&o.textContent.charAt(E)!==" "){h=!1;break}if(s===0&&(h=!1),h)return void He(e);if(t.inputType==="deleteContentBackward"){var b=(0,f.a1)(r,"data-type","code-block-open-marker")||(0,f.a1)(r,"data-type","code-block-close-marker");if(b){var y;if(b.getAttribute("data-type")==="code-block-close-marker"&&(y=gt(r,"code-block-open-marker"))||b.getAttribute("data-type")==="code-block-open-marker"&&(y=gt(r,"code-block-close-marker",!1)))return y.textContent=b.textContent,void He(e)}var _=(0,f.a1)(r,"data-type","math-block-open-marker");if(_){var R=_.nextElementSibling.nextElementSibling;return void(R&&R.getAttribute("data-type")==="math-block-close-marker"&&(R.remove(),He(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 q=(0,f.a1)(r,"data-type","heading-marker");if(q&&q.textContent.indexOf("#")===-1)return void He(e)}if((t.data===" "||t.inputType==="deleteContentBackward")&&((0,f.a1)(r,"data-type","padding")||(0,f.a1)(r,"data-type","li-marker")||(0,f.a1)(r,"data-type","task-marker")||(0,f.a1)(r,"data-type","blockquote-marker")))return void He(e)}if(o&&o.textContent.trimRight()==="$$")He(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,f.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 A,j=o.textContent,W=o.isEqualNode(e.sv.element);W?j=o.textContent:(o.previousElementSibling&&(j=o.previousElementSibling.textContent+j,o.previousElementSibling.remove()),o.previousElementSibling&&j.indexOf(`---
`)===0&&(j=o.previousElementSibling.textContent+j,o.previousElementSibling.remove()),o.innerText.startsWith("```")||(e.sv.element.querySelectorAll("[data-type='link-ref-defs-block']").forEach(function(H,X){X===0&&H&&!o.isEqualNode(H.parentElement)&&(j+=`
`+H.parentElement.textContent,H.parentElement.remove())}),e.sv.element.querySelectorAll("[data-type='footnotes-link']").forEach(function(H,X){X===0&&H&&!o.isEqualNode(H.parentElement)&&(j+=`
`+H.parentElement.textContent,H.parentElement.remove())}))),j=Qt(j,e),W?o.innerHTML=j:o.outerHTML=j;var z,G=e.sv.element.querySelectorAll("[data-type='link-ref-defs-block']");G.forEach(function(H,X){X===0?A=H.parentElement:(A.lastElementChild.remove(),A.insertAdjacentHTML("beforeend",""+H.parentElement.innerHTML),H.parentElement.remove())}),G.length>0&&e.sv.element.insertAdjacentElement("beforeend",A);var V=e.sv.element.querySelectorAll("[data-type='footnotes-link']");V.forEach(function(H,X){X===0?z=H.parentElement:(z.lastElementChild.remove(),z.insertAdjacentHTML("beforeend",""+H.parentElement.innerHTML),H.parentElement.remove())}),V.length>0&&e.sv.element.insertAdjacentElement("beforeend",z),(0,M.ib)(e.sv.element,i),_e(e),He(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})}},te=K(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"},be=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 Fe,Wt,Jn=function(e){be(e),ce(),window.addEventListener("resize",I=function(){me(e),be(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||""},lt=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),g(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,f.a1)(n,"data-type","heading"):(0,N.W)(n))&&p(e.toolbar.elements,["headings"]),(e.currentMode==="sv"?(0,f.a1)(n,"data-type","blockquote"):(0,f.lG)(n,"BLOCKQUOTE"))&&p(e.toolbar.elements,["quote"]),(0,f.a1)(n,"data-type","strong")&&p(e.toolbar.elements,["bold"]),(0,f.a1)(n,"data-type","em")&&p(e.toolbar.elements,["italic"]),(0,f.a1)(n,"data-type","s")&&p(e.toolbar.elements,["strike"]),(0,f.a1)(n,"data-type","a")&&p(e.toolbar.elements,["link"]);var i=(0,f.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"]),g(e.toolbar.elements,["outdent","indent"])):L(e.toolbar.elements,["outdent","indent"]),(0,f.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,f.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,f.a1)(n,"data-type","table")&&L(e.toolbar.elements,["headings","list","ordered-list","check","line","quote","code","table"])}},200)},Ee=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)},Kt=function(e){for(var t="",n=e.nextSibling;n;)n.nodeType===3?t+=n.textContent:t+=n.outerHTML,n=n.nextSibling;return t},Ft=function(e){for(var t="",n=e.previousSibling;n;)t=n.nodeType===3?n.textContent+t:n.outerHTML+t,n=n.previousSibling;return t},Jt=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})},vt=function(e,t){var n=(0,M.zh)(e),i=(0,f.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),ve(e))},Ct=function(e){var t=getSelection().getRangeAt(0),n=(0,f.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"},ct=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")||_e(t)},Oe=function(e,t){if(P("⇧⌘X",t)){var n=e.wysiwyg.popover.querySelector('[data-type="remove"]');return n&&n.click(),t.preventDefault(),!0}},Xe=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),g(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,f.a1)(n,"data-type","footnotes-block");if(i)return e.wysiwyg.popover.innerHTML="",qe(i,e),void Pe(e,i);var r=(0,f.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"]),g(e.toolbar.elements,["outdent","indent"])):L(e.toolbar.elements,["outdent","indent"]),(0,f.lG)(n,"BLOCKQUOTE")&&p(e.toolbar.elements,["quote"]),((0,f.lG)(n,"B")||(0,f.lG)(n,"STRONG"))&&p(e.toolbar.elements,["bold"]),((0,f.lG)(n,"I")||(0,f.lG)(n,"EM"))&&p(e.toolbar.elements,["italic"]),((0,f.lG)(n,"STRIKE")||(0,f.lG)(n,"S"))&&p(e.toolbar.elements,["strike"]),e.wysiwyg.element.querySelectorAll(".vditor-comment--focus").forEach(function(J){J.classList.remove("vditor-comment--focus")});var o=(0,f.fb)(n,"vditor-comment");if(o){var s=o.getAttribute("data-cmtids").split(" ");if(s.length>1&&o.nextSibling.isSameNode(o.nextElementSibling)){var h=o.nextElementSibling.getAttribute("data-cmtids").split(" ");s.find(function(J){if(h.includes(J))return s=[J],!0})}e.wysiwyg.element.querySelectorAll(".vditor-comment").forEach(function(J){J.getAttribute("data-cmtids").indexOf(s[0])>-1&&J.classList.add("vditor-comment--focus")})}var E=(0,f.lG)(n,"A");E&&p(e.toolbar.elements,["link"]);var b=(0,f.lG)(n,"TABLE"),y=(0,N.W)(n);(0,f.lG)(n,"CODE")?(0,f.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"])):b&&L(e.toolbar.elements,["table"]);var _=(0,f.fb)(n,"vditor-toc");if(_)return e.wysiwyg.popover.innerHTML="",qe(_,e),void Pe(e,_);var R=(0,N.S)(n,"BLOCKQUOTE");if(R&&(e.wysiwyg.popover.innerHTML="",$e(t,R,e),Qe(t,R,e),qe(R,e),Pe(e,R)),r&&(e.wysiwyg.popover.innerHTML="",$e(t,r,e),Qe(t,r,e),qe(r,e),Pe(e,r)),b){e.options.lang,e.options,e.wysiwyg.popover.innerHTML="";var q=function(){var J=b.rows.length,ke=b.rows[0].cells.length,Ye=parseInt(le.value,10)||J,Ke=parseInt(Me.value,10)||ke;if(Ye!==J||ke!==Ke){if(ke!==Ke)for(var An=Ke-ke,it=0;it<b.rows.length;it++)if(An>0)for(var _n=0;_n<An;_n++)it===0?b.rows[it].lastElementChild.insertAdjacentHTML("afterend","<th> </th>"):b.rows[it].lastElementChild.insertAdjacentHTML("afterend","<td> </td>");else for(var Ut=ke-1;Ut>=Ke;Ut--)b.rows[it].cells[Ut].remove();if(J!==Ye){var xn=Ye-J;if(xn>0){for(var zt="<tr>",ot=0;ot<Ke;ot++)zt+="<td> </td>";for(var Hn=0;Hn<xn;Hn++)b.querySelector("tbody")?b.querySelector("tbody").insertAdjacentHTML("beforeend",zt):b.querySelector("thead").insertAdjacentHTML("afterend",zt+"</tr>")}else for(ot=J-1;ot>=Ye;ot--)b.rows[ot].remove(),b.rows.length===1&&b.querySelector("tbody").remove()}}},A=function(J){Et(b,J),J==="right"?(G.classList.remove("vditor-icon--current"),V.classList.remove("vditor-icon--current"),H.classList.add("vditor-icon--current")):J==="center"?(G.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"),G.classList.add("vditor-icon--current")),(0,M.Hc)(t),Ee(e)},j=(0,f.lG)(n,"TD"),W=(0,f.lG)(n,"TH"),z="left";j?z=j.getAttribute("align")||"left":W&&(z=W.getAttribute("align")||"center");var G=document.createElement("button");G.setAttribute("type","button"),G.setAttribute("aria-label",window.VditorI18n.alignLeft+"<"+(0,a.ns)("⇧⌘L")+">"),G.setAttribute("data-type","left"),G.innerHTML='<svg><use xlink:href="#vditor-icon-align-left"></use></svg>',G.className="vditor-icon vditor-tooltipped vditor-tooltipped__n"+(z==="left"?" vditor-icon--current":""),G.onclick=function(){A("left")};var V=document.createElement("button");V.setAttribute("type","button"),V.setAttribute("aria-label",window.VditorI18n.alignCenter+"<"+(0,a.ns)("⇧⌘C")+">"),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"+(z==="center"?" vditor-icon--current":""),V.onclick=function(){A("center")};var H=document.createElement("button");H.setAttribute("type","button"),H.setAttribute("aria-label",window.VditorI18n.alignRight+"<"+(0,a.ns)("⇧⌘R")+">"),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"+(z==="right"?" vditor-icon--current":""),H.onclick=function(){A("right")};var X=document.createElement("button");X.setAttribute("type","button"),X.setAttribute("aria-label",window.VditorI18n.insertRowBelow+"<"+(0,a.ns)("⌘=")+">"),X.setAttribute("data-type","insertRow"),X.innerHTML='<svg><use xlink:href="#vditor-icon-insert-row"></use></svg>',X.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",X.onclick=function(){var J=getSelection().getRangeAt(0).startContainer,ke=(0,f.lG)(J,"TD")||(0,f.lG)(J,"TH");ke&&un(e,t,ke)};var ie=document.createElement("button");ie.setAttribute("type","button"),ie.setAttribute("aria-label",window.VditorI18n.insertRowAbove+"<"+(0,a.ns)("⇧⌘F")+">"),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 J=getSelection().getRangeAt(0).startContainer,ke=(0,f.lG)(J,"TD")||(0,f.lG)(J,"TH");ke&&pn(e,t,ke)};var Q=document.createElement("button");Q.setAttribute("type","button"),Q.setAttribute("aria-label",window.VditorI18n.insertColumnRight+"<"+(0,a.ns)("⇧⌘=")+">"),Q.setAttribute("data-type","insertColumn"),Q.innerHTML='<svg><use xlink:href="#vditor-icon-insert-column"></use></svg>',Q.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",Q.onclick=function(){var J=getSelection().getRangeAt(0).startContainer,ke=(0,f.lG)(J,"TD")||(0,f.lG)(J,"TH");ke&&kt(e,b,ke)};var re=document.createElement("button");re.setAttribute("type","button"),re.setAttribute("aria-label",window.VditorI18n.insertColumnLeft+"<"+(0,a.ns)("⇧⌘G")+">"),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 J=getSelection().getRangeAt(0).startContainer,ke=(0,f.lG)(J,"TD")||(0,f.lG)(J,"TH");ke&&kt(e,b,ke,"beforebegin")};var ne=document.createElement("button");ne.setAttribute("type","button"),ne.setAttribute("aria-label",window.VditorI18n["delete-row"]+"<"+(0,a.ns)("⌘-")+">"),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 J=getSelection().getRangeAt(0).startContainer,ke=(0,f.lG)(J,"TD")||(0,f.lG)(J,"TH");ke&&mn(e,t,ke)};var Y=document.createElement("button");Y.setAttribute("type","button"),Y.setAttribute("aria-label",window.VditorI18n["delete-column"]+"<"+(0,a.ns)("⇧⌘-")+">"),Y.setAttribute("data-type","deleteColumn"),Y.innerHTML='<svg><use xlink:href="#vditor-icon-delete-column"></use></svg>',Y.className="vditor-icon vditor-tooltipped vditor-tooltipped__n",Y.onclick=function(){var J=getSelection().getRangeAt(0).startContainer,ke=(0,f.lG)(J,"TD")||(0,f.lG)(J,"TH");ke&&fn(e,t,b,ke)},(Be=document.createElement("span")).setAttribute("aria-label",window.VditorI18n.row),Be.className="vditor-tooltipped vditor-tooltipped__n";var le=document.createElement("input");Be.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=b.rows.length.toString(),le.oninput=function(){q()},le.onkeydown=function(J){if(!J.isComposing)return J.key==="Tab"?(Me.focus(),Me.select(),void J.preventDefault()):void(Oe(e,J)||ze(J,t))};var we=document.createElement("span");we.setAttribute("aria-label",window.VditorI18n.column),we.className="vditor-tooltipped vditor-tooltipped__n";var Me=document.createElement("input");we.appendChild(Me),Me.type="number",Me.min="1",Me.className="vditor-input",Me.style.width="42px",Me.style.textAlign="center",Me.setAttribute("placeholder",window.VditorI18n.column),Me.value=b.rows[0].cells.length.toString(),Me.oninput=function(){q()},Me.onkeydown=function(J){if(!J.isComposing)return J.key==="Tab"?(le.focus(),le.select(),void J.preventDefault()):void(Oe(e,J)||ze(J,t))},$e(t,b,e),Qe(t,b,e),qe(b,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",G),e.wysiwyg.popover.insertAdjacentElement("beforeend",V),e.wysiwyg.popover.insertAdjacentElement("beforeend",H),e.wysiwyg.popover.insertAdjacentElement("beforeend",ie),e.wysiwyg.popover.insertAdjacentElement("beforeend",X),e.wysiwyg.popover.insertAdjacentElement("beforeend",re),e.wysiwyg.popover.insertAdjacentElement("beforeend",Q),e.wysiwyg.popover.insertAdjacentElement("beforeend",ne),e.wysiwyg.popover.insertAdjacentElement("beforeend",Y),e.wysiwyg.popover.insertAdjacentElement("beforeend",Be),e.wysiwyg.popover.insertAdjacentHTML("beforeend"," x "),e.wysiwyg.popover.insertAdjacentElement("beforeend",we),Pe(e,b)}var We=(0,f.a1)(n,"data-type","link-ref");We&&Xt(e,We,t);var je=(0,f.a1)(n,"data-type","footnotes-ref");if(je){e.options.lang,e.options,e.wysiwyg.popover.innerHTML="",(Be=document.createElement("span")).setAttribute("aria-label",window.VditorI18n.footnoteRef+"<"+(0,a.ns)("⌥Enter")+">"),Be.className="vditor-tooltipped vditor-tooltipped__n";var Re=document.createElement("input");Be.appendChild(Re),Re.className="vditor-input",Re.setAttribute("placeholder",window.VditorI18n.footnoteRef+"<"+(0,a.ns)("⌥Enter")+">"),Re.style.width="120px",Re.value=je.getAttribute("data-footnotes-label"),Re.oninput=function(){Re.value.trim()!==""&&je.setAttribute("data-footnotes-label",Re.value)},Re.onkeydown=function(J){J.isComposing||Oe(e,J)||ze(J,t)},qe(je,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",Be),Pe(e,je)}var xe=(0,f.fb)(n,"vditor-wysiwyg__block"),nt=!!xe&&xe.getAttribute("data-type").indexOf("block")>-1;if(e.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview").forEach(function(J){(!xe||xe&&nt&&!xe.contains(J))&&(J.previousElementSibling.style.display="none")}),xe&&nt){if(e.wysiwyg.popover.innerHTML="",$e(t,xe,e),Qe(t,xe,e),qe(xe,e),xe.getAttribute("data-type")==="code-block"){var Tt=document.createElement("span");Tt.setAttribute("aria-label",window.VditorI18n.language+"<"+(0,a.ns)("⌥Enter")+">"),Tt.className="vditor-tooltipped vditor-tooltipped__n";var Ve=document.createElement("input");Tt.appendChild(Ve);var ft=xe.firstElementChild.firstElementChild;Ve.className="vditor-input",Ve.setAttribute("placeholder",window.VditorI18n.language+"<"+(0,a.ns)("⌥Enter")+">"),Ve.value=ft.className.indexOf("language-")>-1?ft.className.split("-")[1].split(" ")[0]:"",Ve.oninput=function(J){Ve.value.trim()!==""?ft.className="language-"+Ve.value:(ft.className="",e.hint.recentLanguage=""),xe.lastElementChild.classList.contains("vditor-wysiwyg__preview")&&(xe.lastElementChild.innerHTML=xe.firstElementChild.innerHTML,ye(xe.lastElementChild,e)),Ee(e),J.detail===1&&(t.setStart(ft.firstChild,0),t.collapse(!0),(0,M.Hc)(t))},Ve.onkeydown=function(J){if(!J.isComposing&&!Oe(e,J)){if(J.key==="Escape"&&e.hint.element.style.display==="block")return e.hint.element.style.display="none",void J.preventDefault();e.hint.select(J,e),ze(J,t)}},Ve.onkeyup=function(J){if(!J.isComposing&&J.key!=="Enter"&&J.key!=="ArrowUp"&&J.key!=="Escape"&&J.key!=="ArrowDown"){var ke=[],Ye=Ve.value.substring(0,Ve.selectionStart);m.g.CODE_LANGUAGES.forEach(function(Ke){Ke.indexOf(Ye.toLowerCase())>-1&&ke.push({html:Ke,value:Ke})}),e.hint.genHTML(ke,Ye,e),J.preventDefault()}},e.wysiwyg.popover.insertAdjacentElement("beforeend",Tt)}Pe(e,xe)}else xe=void 0;if(y){var Be;e.wysiwyg.popover.innerHTML="",(Be=document.createElement("span")).setAttribute("aria-label","ID<"+(0,a.ns)("⌥Enter")+">"),Be.className="vditor-tooltipped vditor-tooltipped__n";var Je=document.createElement("input");Be.appendChild(Je),Je.className="vditor-input",Je.setAttribute("placeholder","ID<"+(0,a.ns)("⌥Enter")+">"),Je.style.width="120px",Je.value=y.getAttribute("data-id")||"",Je.oninput=function(){y.setAttribute("data-id",Je.value)},Je.onkeydown=function(J){J.isComposing||Oe(e,J)||ze(J,t)},$e(t,y,e),Qe(t,y,e),qe(y,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",Be),Pe(e,y)}if(E&&At(e,E,t),!(R||r||b||xe||E||We||je||y||_)){var rt=(0,f.a1)(n,"data-block","0");rt&&rt.parentElement.isEqualNode(e.wysiwyg.element)?(e.wysiwyg.popover.innerHTML="",$e(t,rt,e),Qe(t,rt,e),qe(rt,e),Pe(e,rt)):e.wysiwyg.popover.style.display="none"}e.wysiwyg.element.querySelectorAll('span[data-type="backslash"] > span').forEach(function(J){J.style.display="none"});var Cn=(0,f.a1)(t.startContainer,"data-type","backslash");Cn&&(Cn.querySelector("span").style.display="inline")}},200)},Pe=function(e,t){var n=t,i=(0,f.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())},Xt=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),h.value.trim()!==""&&t.setAttribute("data-link-label",h.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(E){Oe(e,E)||ze(E,n)||dt(e,t,E,h)};var s=document.createElement("span");s.setAttribute("aria-label",window.VditorI18n.linkRef),s.className="vditor-tooltipped vditor-tooltipped__n";var h=document.createElement("input");s.appendChild(h),h.className="vditor-input",h.setAttribute("placeholder",window.VditorI18n.linkRef),h.value=t.getAttribute("data-link-label"),h.oninput=function(){i()},h.onkeydown=function(E){Oe(e,E)||ze(E,n)||dt(e,t,E,o)},qe(t,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",r),e.wysiwyg.popover.insertAdjacentElement("beforeend",s),Pe(e,t)},$e=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)("⇧⌘U")+">"),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),Ee(n),Xe(n),_e(n)},n.wysiwyg.popover.insertAdjacentElement("beforeend",r)}},Qe=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)("⇧⌘D")+">"),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),Ee(n),Xe(n),_e(n)},n.wysiwyg.popover.insertAdjacentElement("beforeend",r)}},qe=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)("⇧⌘X")+">"),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(),Ee(t),Xe(t),["H1","H2","H3","H4","H5","H6"].includes(e.tagName)&&ve(t)},t.wysiwyg.popover.insertAdjacentElement("beforeend",n)},dt=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()}}},At=function(e,t,n){e.wysiwyg.popover.innerHTML="";var i=function(){o.value.trim()!==""&&(t.innerHTML=o.value),t.setAttribute("href",h.value),t.setAttribute("title",b.value),Ee(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){Oe(e,y)||ze(y,n)||dt(e,t,y,h)};var s=document.createElement("span");s.setAttribute("aria-label",window.VditorI18n.link),s.className="vditor-tooltipped vditor-tooltipped__n";var h=document.createElement("input");s.appendChild(h),h.className="vditor-input",h.setAttribute("placeholder",window.VditorI18n.link),h.value=t.getAttribute("href")||"",h.oninput=function(){i()},h.onkeydown=function(y){Oe(e,y)||ze(y,n)||dt(e,t,y,b)};var E=document.createElement("span");E.setAttribute("aria-label",window.VditorI18n.tooltipText),E.className="vditor-tooltipped vditor-tooltipped__n";var b=document.createElement("input");E.appendChild(b),b.className="vditor-input",b.setAttribute("placeholder",window.VditorI18n.tooltipText),b.style.width="60px",b.value=t.getAttribute("title")||"",b.oninput=function(){i()},b.onkeydown=function(y){Oe(e,y)||ze(y,n)||dt(e,t,y,o)},qe(t,e),e.wysiwyg.popover.insertAdjacentElement("beforeend",r),e.wysiwyg.popover.insertAdjacentElement("beforeend",s),e.wysiwyg.popover.insertAdjacentElement("beforeend",E),Pe(e,t)},ze=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},et=function(e){e.currentMode==="wysiwyg"?Xe(e):e.currentMode==="ir"&<(e)},Zt=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){ye(r,e),r.previousElementSibling.setAttribute("style","display:none")}),Ee(e,n)},Xn=function(e,t,n){for(var i=e.startContainer.parentElement,r=!1,o="",s="",h=function(A){var j=Ft(A.startContainer),W=Kt(A.startContainer),z=A.startContainer.textContent,G=A.startOffset,V="",H="";return(z.substr(0,G)!==""&&z.substr(0,G)!==m.g.ZWSP||j)&&(V=""+j+z.substr(0,G)),(z.substr(G)!==""&&z.substr(G)!==m.g.ZWSP||W)&&(H=""+z.substr(G)+W),{afterHTML:H,beforeHTML:V}}(e),E=h.beforeHTML,b=h.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 _="",R="",q="";i.parentElement.getAttribute("data-block")!=="0"&&(R=Ft(i),q=Kt(i)),(E||R)&&(E=_=R+"<"+y+">"+E+"</"+y+">"),(n==="bold"&&y==="STRONG"||n==="italic"&&y==="EM"||n==="strikeThrough"&&y==="S")&&(_+=""+o+m.g.ZWSP+"<wbr>"+s,r=!0),(b||q)&&(_+=b="<"+y+">"+b+"</"+y+">"+q),i.parentElement.getAttribute("data-block")!=="0"?(i=i.parentElement).innerHTML=_:(i.outerHTML=_,i=i.parentElement),o="<"+y+">"+o,s="</"+y+">"+s}else r=!0}(0,M.ib)(t.wysiwyg.element,e)},Te=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?" <"+(0,a.ns)(t.hotkey)+">":"");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 h=document.createElement(s);h.setAttribute("data-type",t.name),h.className="vditor-tooltipped vditor-tooltipped__"+t.tipPosition,h.setAttribute("aria-label",o),h.innerHTML=t.icon,this.element.appendChild(h)}t.prefix&&this.element.children[0].addEventListener((0,a.Le)(),function(E){E.preventDefault(),i.element.firstElementChild.classList.contains(m.g.CLASS_MENU_DISABLED)||(e.currentMode==="wysiwyg"?function(b,y,_){if(!(b.wysiwyg.composingLock&&_ instanceof CustomEvent)){var R=!0,q=!0;b.wysiwyg.element.querySelector("wbr")&&b.wysiwyg.element.querySelector("wbr").remove();var A=(0,M.zh)(b),j=y.getAttribute("data-type");if(y.classList.contains("vditor-menu--current"))if(j==="strike"&&(j="strikeThrough"),j==="quote"){var W=(0,f.lG)(A.startContainer,"BLOCKQUOTE");W||(W=A.startContainer.childNodes[A.startOffset]),W&&(R=!1,y.classList.remove("vditor-menu--current"),A.insertNode(document.createElement("wbr")),W.outerHTML=W.innerHTML.trim()===""?'<p data-block="0">'+W.innerHTML+"</p>":W.innerHTML,(0,M.ib)(b.wysiwyg.element,A))}else if(j==="inline-code"){var z=(0,f.lG)(A.startContainer,"CODE");z||(z=A.startContainer.childNodes[A.startOffset]),z&&(z.outerHTML=z.innerHTML.replace(m.g.ZWSP,"")+"<wbr>",(0,M.ib)(b.wysiwyg.element,A))}else j==="link"?(A.collapsed&&A.selectNode(A.startContainer.parentElement),document.execCommand("unlink",!1,"")):j==="check"||j==="list"||j==="ordered-list"?(wt(b,A,j),(0,M.ib)(b.wysiwyg.element,A),R=!1,y.classList.remove("vditor-menu--current")):(R=!1,y.classList.remove("vditor-menu--current"),A.toString()===""?Xn(A,b,j):document.execCommand(j,!1,""));else{b.wysiwyg.element.childNodes.length===0&&(b.wysiwyg.element.innerHTML='<p data-block="0"><wbr></p>',(0,M.ib)(b.wysiwyg.element,A));var G=(0,f.F9)(A.startContainer);if(j==="quote"){if(G||(G=A.startContainer.childNodes[A.startOffset]),G){R=!1,y.classList.add("vditor-menu--current"),A.insertNode(document.createElement("wbr"));var V=(0,f.lG)(A.startContainer,"LI");V&&G.contains(V)?V.innerHTML='<blockquote data-block="0">'+V.innerHTML+"</blockquote>":G.outerHTML='<blockquote data-block="0">'+G.outerHTML+"</blockquote>",(0,M.ib)(b.wysiwyg.element,A)}}else if(j==="check"||j==="list"||j==="ordered-list")wt(b,A,j,!1),(0,M.ib)(b.wysiwyg.element,A),R=!1,c(b.toolbar.elements,["check","list","ordered-list"]),y.classList.add("vditor-menu--current");else if(j==="inline-code"){if(A.toString()==="")(H=document.createElement("code")).textContent=m.g.ZWSP,A.insertNode(H),A.setStart(H.firstChild,1),A.collapse(!0),(0,M.Hc)(A);else if(A.startContainer.nodeType===3){var H=document.createElement("code");A.surroundContents(H),A.insertNode(H),(0,M.Hc)(A)}y.classList.add("vditor-menu--current")}else if(j==="code")(H=document.createElement("div")).className="vditor-wysiwyg__block",H.setAttribute("data-type","code-block"),H.setAttribute("data-block","0"),H.setAttribute("data-marker","```"),A.toString()===""?H.innerHTML=`<pre><code><wbr>
</code></pre>`:(H.innerHTML="<pre><code>"+A.toString()+"<wbr></code></pre>",A.deleteContents()),A.insertNode(H),G&&(G.outerHTML=b.lute.SpinVditorDOM(G.outerHTML)),(0,M.ib)(b.wysiwyg.element,A),b.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview[data-render='2']").forEach(function(Me){ye(Me,b)}),y.classList.add("vditor-menu--disabled");else if(j==="link"){if(A.toString()===""){var X=document.createElement("a");X.innerText=m.g.ZWSP,A.insertNode(X),A.setStart(X.firstChild,1),A.collapse(!0),At(b,X,A);var ie=b.wysiwyg.popover.querySelector("input");ie.value="",ie.focus(),q=!1}else{(H=document.createElement("a")).setAttribute("href",""),H.innerHTML=A.toString(),A.surroundContents(H),A.insertNode(H),(0,M.Hc)(A),At(b,H,A);var Q=b.wysiwyg.popover.querySelectorAll("input");Q[0].value=H.innerText,Q[1].focus()}R=!1,y.classList.add("vditor-menu--current")}else if(j==="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(A.toString().trim()==="")G&&G.innerHTML.trim().replace(m.g.ZWSP,"")===""?G.outerHTML=re:document.execCommand("insertHTML",!1,re),A.selectNode(b.wysiwyg.element.querySelector("wbr").previousSibling),b.wysiwyg.element.querySelector("wbr").remove(),(0,M.Hc)(A);else{re='<table data-block="0"><thead><tr>';var ne=A.toString().split(`
`),Y=ne[0].split(",").length>ne[0].split(" ").length?",":" ";ne.forEach(function(Me,We){We===0?(Me.split(Y).forEach(function(je,Re){re+=Re===0?"<th>"+je+"<wbr></th>":"<th>"+je+"</th>"}),re+="</tr></thead>"):(re+=We===1?"<tbody><tr>":"<tr>",Me.split(Y).forEach(function(je){re+="<td>"+je+"</td>"}),re+="</tr>")}),re+="</tbody></table>",document.execCommand("insertHTML",!1,re),(0,M.ib)(b.wysiwyg.element,A)}R=!1,y.classList.add("vditor-menu--disabled")}else if(j==="line"){if(G){var le=`<hr data-block="0"><p data-block="0"><wbr>
</p>`;G.innerHTML.trim()===""?G.outerHTML=le:G.insertAdjacentHTML("afterend",le),(0,M.ib)(b.wysiwyg.element,A)}}else if(R=!1,y.classList.add("vditor-menu--current"),j==="strike"&&(j="strikeThrough"),A.toString()!==""||j!=="bold"&&j!=="italic"&&j!=="strikeThrough")document.execCommand(j,!1,"");else{var we="strong";j==="italic"?we="em":j==="strikeThrough"&&(we="s"),(H=document.createElement(we)).textContent=m.g.ZWSP,A.insertNode(H),H.previousSibling&&H.previousSibling.textContent===m.g.ZWSP&&(H.previousSibling.textContent=""),A.setStart(H.firstChild,1),A.collapse(!0),(0,M.Hc)(A)}}R&&Xe(b),q&&Ee(b)}}(e,i.element.children[0],E):e.currentMode==="ir"?lr(e,i.element.children[0],t.prefix||"",t.suffix||""):Qn(e,i.element.children[0],t.prefix||"",t.suffix||""))})},Zn=(Fe=function(e,t){return Fe=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])},Fe(e,t)},function(e,t){function n(){this.constructor=e}Fe(e,t),e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}),Ze=function(e,t,n){var i;if(typeof n!="string"?(k(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",g(e.toolbar.elements,m.g.EDIT_TOOLBARS),c(e.toolbar.elements,m.g.EDIT_TOOLBARS),L(e.toolbar.elements,["outdent","indent"]),t==="ir")w(e.toolbar.elements,["both"]),C(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),Ge(e,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),me(e),e.ir.element.querySelectorAll(".vditor-ir__preview[data-render='2']").forEach(function(o){ye(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")w(e.toolbar.elements,["both"]),C(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),Zt(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"){C(e.toolbar.elements,["both"]),w(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=Qt(i,e);r==="<div data-block='0'></div>"&&(r=""),e.sv.element.innerHTML=r,He(e,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1}),me(e)}e.undo.resetIcon(e),typeof n!="string"&&(e[e.currentMode].element.focus(),et(e)),ve(e),be(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")}},Yn=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+" <"+(0,a.ns)("⌥⌘7")+`></button>
<button data-mode="ir">`+window.VditorI18n.instantRendering+" <"+(0,a.ns)("⌥⌘8")+`></button>
<button data-mode="sv">`+window.VditorI18n.splitView+" <"+(0,a.ns)("⌥⌘9")+"></button>",r.element.appendChild(o),r._bindEvent(n,o,i),r}return Zn(t,e),t.prototype._bindEvent=function(n,i,r){var o=this.element.children[0];S(n,i,o,r.level),i.children.item(0).addEventListener((0,a.Le)(),function(s){Ze(n,"wysiwyg",s),s.preventDefault(),s.stopPropagation()}),i.children.item(1).addEventListener((0,a.Le)(),function(s){Ze(n,"ir",s),s.preventDefault(),s.stopPropagation()}),i.children.item(2).addEventListener((0,a.Le)(),function(s){Ze(n,"sv",s),s.preventDefault(),s.stopPropagation()})},t}(Te),ut=function(e,t){return(0,M.Gb)(e,t)?getSelection().toString():""},_t=function(e,t){t.addEventListener("focus",function(){e.options.focus&&e.options.focus(u(e)),k(e,["subToolbar","hint"])})},Yt=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))})},xt=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))})},Ht=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"))&&St(e,n,{pasteCode:function(i){document.execCommand("insertHTML",!1,i)}})})},Nt=function(e,t,n){t.addEventListener("copy",function(i){return n(i,e)})},Dt=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")})},_e=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)}},Ot=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("⌘X",n))&&e.wysiwyg.getComments(e),e.currentMode==="sv"){if(function(r,o){var s,h,E,b,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 _=(0,M.zh)(r),R=_.startContainer;_.startContainer.nodeType!==3&&_.startContainer.tagName==="DIV"&&(R=_.startContainer.childNodes[_.startOffset-1]);var q=(0,f.a1)(R,"data-type","text"),A=(0,f.a1)(R,"data-type","blockquote-marker");if(!A&&_.startOffset===0&&q&&q.previousElementSibling&&q.previousElementSibling.getAttribute("data-type")==="blockquote-marker"&&(A=q.previousElementSibling),A&&o.key==="Enter"&&!(0,a.yl)(o)&&!o.altKey&&A.nextElementSibling.textContent.trim()===""&&(0,M.im)(A,r.sv.element,_).start===A.textContent.length)return((s=A.previousElementSibling)===null||s===void 0?void 0:s.getAttribute("data-type"))==="padding"&&A.previousElementSibling.setAttribute("data-action","enter-remove"),A.remove(),He(r),o.preventDefault(),!0;var j=(0,f.a1)(R,"data-type","li-marker"),W=(0,f.a1)(R,"data-type","task-marker"),z=j;if(z||W&&W.nextElementSibling.getAttribute("data-type")!=="task-marker"&&(z=W),z||_.startOffset!==0||!q||!q.previousElementSibling||q.previousElementSibling.getAttribute("data-type")!=="li-marker"&&q.previousElementSibling.getAttribute("data-type")!=="task-marker"||(z=q.previousElementSibling),z){var G=(0,M.im)(z,r.sv.element,_).start,V=z.getAttribute("data-type")==="task-marker",H=z;if(V&&(H=z.previousElementSibling.previousElementSibling.previousElementSibling),G===z.textContent.length){if(o.key==="Enter"&&!(0,a.yl)(o)&&!o.altKey&&!o.shiftKey&&z.nextElementSibling.textContent.trim()==="")return((h=H.previousElementSibling)===null||h===void 0?void 0:h.getAttribute("data-type"))==="padding"?(H.previousElementSibling.remove(),se(r)):(V&&(H.remove(),z.previousElementSibling.previousElementSibling.remove(),z.previousElementSibling.remove()),z.nextElementSibling.remove(),z.remove(),He(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"),_.selectNodeContents(z.firstChild),_.collapse(!1)),se(r),o.preventDefault(),!0}}if(Bt(r,_,o))return!0;var X=(0,f.a1)(R,"data-block","0"),ie=(0,N.S)(R,"SPAN");if(o.key==="Enter"&&!(0,a.yl)(o)&&!o.altKey&&!o.shiftKey&&X){var Q=!1,re=X.textContent.match(/^\n+/);(0,M.im)(X,r.sv.element).start<=(re?re[0].length:0)&&(Q=!0);var ne=`
`;if(ie){if(((E=ie.previousElementSibling)===null||E===void 0?void 0:E.getAttribute("data-action"))==="enter-remove")return ie.previousElementSibling.remove(),He(r),o.preventDefault(),!0;ne+=$n(ie)}return _.insertNode(document.createTextNode(ne)),_.collapse(!1),X&&X.textContent.trim()!==""&&!Q?se(r):He(r),o.preventDefault(),!0}if(o.key==="Backspace"&&!(0,a.yl)(o)&&!o.altKey&&!o.shiftKey){if(ie&&((b=ie.previousElementSibling)===null||b===void 0?void 0:b.getAttribute("data-type"))==="newline"&&(0,M.im)(ie,r.sv.element,_).start===1&&ie.getAttribute("data-type").indexOf("code-block-")===-1)return _.setStart(ie,0),_.extractContents(),ie.textContent.trim()!==""?se(r):He(r),o.preventDefault(),!0;if(X&&(0,M.im)(X,r.sv.element,_).start===0&&X.previousElementSibling){_.extractContents();var Y=X.previousElementSibling.lastElementChild;return Y.getAttribute("data-type")==="newline"&&(Y.remove(),Y=X.previousElementSibling.lastElementChild),Y.getAttribute("data-type")!=="newline"&&(Y.insertAdjacentHTML("afterend",X.innerHTML),X.remove()),X.textContent.trim()===""||!((y=X.previousElementSibling)===null||y===void 0)&&y.querySelector('[data-type="code-block-open-marker"]')?(Y.getAttribute("data-type")!=="newline"&&(_.selectNodeContents(Y.lastChild),_.collapse(!1)),He(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),h=s.startContainer;if(!rn(o,r,h)||(on(s,r,o),wn(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 E=(0,f.F9)(h),b=(0,f.lG)(h,"P");if(dn(o,r,b,s)||cn(s,r,b,o)||hn(r,o,s))return!0;var y=(0,f.fb)(h,"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 _=r.wysiwyg.popover.querySelector(".vditor-input");return _.focus(),_.select(),o.preventDefault(),!0}if(y.getAttribute("data-block")==="0"&&(vn(r,o,y.firstElementChild,s)||pt(r,o,s,y.firstElementChild,y)||y.getAttribute("data-type")!=="yaml-front-matter"&&tt(r,o,s,y.firstElementChild,y)))return!0}if(gn(r,s,o,b))return!0;var R=(0,f.E2)(h,"BLOCKQUOTE");if(R&&!o.shiftKey&&o.altKey&&o.key==="Enter"){(0,a.yl)(o)?s.setStartBefore(R):s.setStartAfter(R),(0,M.Hc)(s);var q=document.createElement("p");return q.setAttribute("data-block","0"),q.innerHTML=`
`,s.insertNode(q),s.collapse(!0),(0,M.Hc)(s),Ee(r),_e(r),o.preventDefault(),!0}var A,j=(0,N.W)(h);if(j){if(j.tagName==="H6"&&h.textContent.length===s.startOffset&&!(0,a.yl)(o)&&!o.shiftKey&&!o.altKey&&o.key==="Enter"){var W=document.createElement("p");return W.textContent=`
`,W.setAttribute("data-block","0"),h.parentElement.insertAdjacentElement("afterend",W),s.setStart(W,0),(0,M.Hc)(s),Ee(r),_e(r),o.preventDefault(),!0}var z;if(P("⌘=",o))return(z=parseInt(j.tagName.substr(1),10)-1)>0&&(vt(r,"h"+z),Ee(r)),o.preventDefault(),!0;if(P("⌘-",o))return(z=parseInt(j.tagName.substr(1),10)+1)<7&&(vt(r,"h"+z),Ee(r)),o.preventDefault(),!0;o.key!=="Backspace"||(0,a.yl)(o)||o.shiftKey||o.altKey||j.textContent.length!==1||Ct(r)}if(yn(r,s,o))return!0;if(o.altKey&&o.key==="Enter"&&!(0,a.yl)(o)&&!o.shiftKey){var G=(0,f.lG)(h,"A"),V=(0,f.a1)(h,"data-type","link-ref"),H=(0,f.a1)(h,"data-type","footnotes-ref");if(G||V||H||j&&j.tagName.length===2){var X=r.wysiwyg.popover.querySelector("input");X.focus(),X.select()}}if(Oe(r,o))return!0;if(P("⇧⌘U",o)&&(A=r.wysiwyg.popover.querySelector('[data-type="up"]'))||P("⇧⌘D",o)&&(A=r.wysiwyg.popover.querySelector('[data-type="down"]')))return A.click(),o.preventDefault(),!0;if(Bt(r,s,o))return!0;if(!(0,a.yl)(o)&&o.shiftKey&&!o.altKey&&o.key==="Enter"&&h.parentElement.tagName!=="LI"&&h.parentElement.tagName!=="P")return["STRONG","STRIKE","S","I","EM","B"].includes(h.parentElement.tagName)?s.insertNode(document.createTextNode(`
`+m.g.ZWSP)):s.insertNode(document.createTextNode(`
`)),s.collapse(!1),(0,M.Hc)(s),Ee(r),_e(r),o.preventDefault(),!0;if(o.key==="Backspace"&&!(0,a.yl)(o)&&!o.shiftKey&&!o.altKey&&s.toString()===""){if(bn(r,s,o,b))return!0;if(E){if(E.previousElementSibling&&E.previousElementSibling.classList.contains("vditor-wysiwyg__block")&&E.previousElementSibling.getAttribute("data-block")==="0"&&E.tagName!=="UL"&&E.tagName!=="OL"){var ie=(0,M.im)(E,r.wysiwyg.element,s).start;if(ie===0&&s.startOffset===0||ie===1&&E.innerText.startsWith(m.g.ZWSP))return ct(E.previousElementSibling.lastElementChild,r,!1),E.innerHTML.trim().replace(m.g.ZWSP,"")===""&&(E.remove(),Ee(r)),o.preventDefault(),!0}var Q=s.startOffset;if(s.toString()===""&&h.nodeType===3&&h.textContent.charAt(Q-2)===`
`&&h.textContent.charAt(Q-1)!==m.g.ZWSP&&["STRONG","STRIKE","S","I","EM","B"].includes(h.parentElement.tagName))return h.textContent=h.textContent.substring(0,Q-1)+m.g.ZWSP,s.setStart(h,Q),s.collapse(!0),Ee(r),o.preventDefault(),!0;h.textContent===m.g.ZWSP&&s.startOffset===1&&!h.previousSibling&&function(ne){for(var Y=ne.startContainer.nextSibling;Y&&Y.textContent==="";)Y=Y.nextSibling;return!(!Y||Y.nodeType===3||Y.tagName!=="CODE"&&Y.getAttribute("data-type")!=="math-inline"&&Y.getAttribute("data-type")!=="html-entity"&&Y.getAttribute("data-type")!=="html-inline")}(s)&&(h.textContent=""),E.querySelectorAll("span.vditor-wysiwyg__block[data-type='math-inline']").forEach(function(ne){ne.firstElementChild.style.display="inline",ne.lastElementChild.style.display="none"}),E.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&&h.textContent.indexOf(m.g.ZWSP)>-1&&h.previousSibling&&h.previousSibling.nodeType!==3&&h.previousSibling.tagName==="CODE"&&(o.key==="Backspace"||o.key==="ArrowLeft"))return s.selectNodeContents(h.previousSibling),s.collapse(!1),o.preventDefault(),!0;if(En(o,E,s))return o.preventDefault(),!0;if(an(s,o.key),o.key==="ArrowDown"){var re=h.nextSibling;re&&re.nodeType!==3&&re.getAttribute("data-type")==="math-inline"&&s.setStartAfter(re)}return!(!E||!x(E,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),h=s.startContainer;if(!rn(o,r,h)||(on(s,r,o),wn(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 E=(0,f.a1)(h,"data-newline","1");if(!(0,a.yl)(o)&&!o.altKey&&!o.shiftKey&&o.key==="Enter"&&E&&s.startOffset<E.textContent.length){var b=E.previousElementSibling;b&&(s.insertNode(document.createTextNode(b.textContent)),s.collapse(!1));var y=E.nextSibling;y&&(s.insertNode(document.createTextNode(y.textContent)),s.collapse(!0))}var _=(0,f.lG)(h,"P");if(dn(o,r,_,s)||cn(s,r,_,o)||gn(r,s,o,_))return!0;var R=(0,f.fb)(h,"vditor-ir__marker--pre");if(R&&R.tagName==="PRE"){var q=R.firstChild;if(vn(r,o,R,s)||(q.getAttribute("data-type")==="math-block"||q.getAttribute("data-type")==="html-block")&&tt(r,o,s,q,R.parentElement)||pt(r,o,s,q,R.parentElement))return!0}var A=(0,f.a1)(h,"data-type","code-block-info");if(A){if(o.key==="Enter"||o.key==="Tab")return s.selectNodeContents(A.nextElementSibling.firstChild),s.collapse(!0),o.preventDefault(),k(r,["hint"]),!0;if(o.key==="Backspace"){var j=(0,M.im)(A,r.ir.element).start;j===1&&s.setStart(h,0),j===2&&(r.hint.recentLanguage="")}if(tt(r,o,s,A,A.parentElement))return k(r,["hint"]),!0}var W=(0,f.lG)(h,"TD")||(0,f.lG)(h,"TH");if(o.key.indexOf("Arrow")>-1&&W){var z=ar(W);if(z&&tt(r,o,s,W,z))return!0;var G=sr(W);if(G&&pt(r,o,s,W,G))return!0}if(hn(r,o,s)||yn(r,s,o)||Bt(r,s,o))return!0;var V=(0,N.W)(h);if(V){var H;if(P("⌘=",o))return(H=V.querySelector(".vditor-ir__marker--heading"))&&H.textContent.trim().length>1&&mt(r,H.textContent.substr(1)),o.preventDefault(),!0;if(P("⌘-",o))return(H=V.querySelector(".vditor-ir__marker--heading"))&&H.textContent.trim().length<6&&mt(r,H.textContent.trim()+"# "),o.preventDefault(),!0}var X=(0,f.F9)(h);if(o.key==="Backspace"&&!(0,a.yl)(o)&&!o.shiftKey&&!o.altKey&&s.toString()===""){if(bn(r,s,o,_))return!0;if(X&&X.previousElementSibling&&X.tagName!=="UL"&&X.tagName!=="OL"&&(X.previousElementSibling.getAttribute("data-type")==="code-block"||X.previousElementSibling.getAttribute("data-type")==="math-block")){var ie=(0,M.im)(X,r.ir.element,s).start;if(ie===0||ie===1&&X.innerText.startsWith(m.g.ZWSP))return s.selectNodeContents(X.previousElementSibling.querySelector(".vditor-ir__marker--pre code")),s.collapse(!1),D(s,r),X.textContent.trim().replace(m.g.ZWSP,"")===""&&(X.remove(),Ge(r)),o.preventDefault(),!0}if(V){var Q=V.firstElementChild.textContent.length;(0,M.im)(V,r.ir.element).start===Q&&(s.setStart(V.firstElementChild.firstChild,Q-1),s.collapse(!0),(0,M.Hc)(s))}}return!((o.key!=="ArrowUp"&&o.key!=="ArrowDown"||!X||(X.querySelectorAll(".vditor-ir__node").forEach(function(re){re.contains(h)||re.classList.add("vditor-ir__node--hidden")}),!En(o,X,s)))&&(an(s,o.key),!X||!x(X,r,o,s)||(o.preventDefault(),0)))}(e,n))return;if(e.options.ctrlEnter&&P("⌘Enter",n))return e.options.ctrlEnter(u(e)),void n.preventDefault();if(P("⌘Z",n)&&!e.toolbar.elements.undo)return e.undo.undo(e),void n.preventDefault();if(P("⌘Y",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,f.lG)(getSelection().getRangeAt(0).startContainer,i)?Ct(e):vt(e,i),Ee(e)}else e.currentMode==="sv"?en(e,"#".repeat(parseInt(n.code.replace("Digit",""),10))+" "):e.currentMode==="ir"&&mt(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"?Ze(e,"wysiwyg",n):n.code==="Digit8"?Ze(e,"ir",n):n.code==="Digit9"&&Ze(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})}})},jt=function(e,t){t.addEventListener("selectstart",function(n){t.onmouseup=function(){setTimeout(function(){var i=ut(e[e.currentMode].element);i.trim()?(e.currentMode==="wysiwyg"&&e.options.comment.enable&&((0,f.a1)(n.target,"data-type","footnotes-block")||(0,f.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()})}})},$t=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,f.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">
</span></span><span data-type="newline"><br /><span style="display: none">
</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),_e(e)},gt=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},Qt=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">
</span></span><span data-type="newline"><br /><span style="display: none">
</span></span></div><div data-block="0"><`)+"</div>",O("SpinVditorSVDOM",e,"result",t.options.debugger),e},$n=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 h=gt(e,"code-block-open-marker");h&&h.previousElementSibling&&(n=h.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},He=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)},en=function(e,t){var n=(0,M.zh)(e),i=(0,N.S)(n.startContainer,"SPAN");i&&i.textContent.trim()!==""&&(t=`
`+t),n.collapse(!0),document.execCommand("insertHTML",!1,t)},Qn=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">
</span></span>`,(0,M.ib)(e.sv.element,r));var s=(0,f.F9)(r.startContainer),h=(0,N.S)(r.startContainer,"SPAN");if(s){if(o==="link"){var E=void 0;return E=r.toString()===""?""+n+Lute.Caret+i:""+n+r.toString()+i.replace(")",Lute.Caret+")"),void document.execCommand("insertHTML",!1,E)}if(o==="italic"||o==="bold"||o==="strike"||o==="inline-code"||o==="code"||o==="table"||o==="line")return E=void 0,E=r.toString()===""?""+n+Lute.Caret+(o==="code"?"":i):""+n+r.toString()+Lute.Caret+(o==="code"?"":i),o==="table"||o==="code"&&h&&h.textContent!==""?E=`
`+E:o==="line"&&(E=`
`+n+`
`+Lute.Caret),void document.execCommand("insertHTML",!1,E);if((o==="check"||o==="list"||o==="ordered-list"||o==="quote")&&h){var b="* ";o==="check"?b="* [ ] ":o==="ordered-list"?b="1. ":o==="quote"&&(b="> ");var y=gt(h,"newline");return y?y.insertAdjacentText("afterend",b):s.insertAdjacentText("afterbegin",b),void se(e)}(0,M.ib)(e.sv.element,r),He(e)}},tn=function(e){switch(e.currentMode){case"ir":return e.ir.element;case"wysiwyg":return e.wysiwyg.element;case"sv":return e.sv.element}},nn=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])})},er=function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function s(b){try{E(i.next(b))}catch(y){o(y)}}function h(b){try{E(i.throw(b))}catch(y){o(y)}}function E(b){var y;b.done?r(b.value):(y=b.value,y instanceof n?y:new n(function(_){_(y)})).then(s,h)}E((i=i.apply(e,t||[])).next())})},tr=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:h(0),throw:h(1),return:h(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function h(E){return function(b){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(_){y=[6,_],i=0}finally{n=r=0}if(5&y[0])throw y[1];return{value:y[0]?y[1]:void 0,done:!0}}([E,b])}}},nr=function(){this.isUploading=!1,this.element=document.createElement("div"),this.element.className="vditor-upload"},It=function(e,t,n){return er(void 0,void 0,void 0,function(){var i,r,o,s,h,E,b,y,_,R,q,A,j,W;return tr(this,function(z){switch(z.label){case 0:for(i=[],r=e.options.upload.multiple===!0?t.length:1,A=0;A<r;A++)(o=t[A])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=z.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=z.sent(),z.label=4;case 4:if(e.options.upload.validate&&typeof(s=e.options.upload.validate(i))=="string")return e.tip.show(s),[2];if(h=tn(e),e.upload.range=(0,M.zh)(e),E=function(G,V){G.tip.hide();for(var H=[],X="",ie="",Q=(G.options.lang,G.options,function(Y,le){var we=V[le],Me=!0;we.name||(X+="<li>"+window.VditorI18n.nameEmpty+"</li>",Me=!1),we.size>G.options.upload.max&&(X+="<li>"+we.name+" "+window.VditorI18n.over+" "+G.options.upload.max/1024/1024+"M</li>",Me=!1);var We=we.name.lastIndexOf("."),je=we.name.substr(We),Re=G.options.upload.filename(we.name.substr(0,We))+je;G.options.upload.accept&&(G.options.upload.accept.split(",").some(function(xe){var nt=xe.trim();if(nt.indexOf(".")===0){if(je.toLowerCase()===nt.toLowerCase())return!0}else if(we.type.split("/")[0]===nt.split("/")[0])return!0;return!1})||(X+="<li>"+we.name+" "+window.VditorI18n.fileTypeError+"</li>",Me=!1)),Me&&(H.push(we),ie+="<li>"+Re+" "+window.VditorI18n.uploading+"</li>")}),re=V.length,ne=0;ne<re;ne++)Q(0,ne);return G.tip.show("<ul>"+X+ie+"</ul>"),H}(e,i),E.length===0)return n&&(n.value=""),[2];for(b=new FormData,y=e.options.upload.extraData,_=0,R=Object.keys(y);_<R.length;_++)q=R[_],b.append(q,y[q]);for(A=0,j=E.length;A<j;A++)b.append(e.options.upload.fieldName,E[A]);return(W=new XMLHttpRequest).open("POST",e.options.upload.url),e.options.upload.token&&W.setRequestHeader("X-Upload-Token",e.options.upload.token),e.options.upload.withCredentials&&(W.withCredentials=!0),nn(e,W),e.upload.isUploading=!0,h.setAttribute("contenteditable","false"),W.onreadystatechange=function(){if(W.readyState===XMLHttpRequest.DONE){if(e.upload.isUploading=!1,h.setAttribute("contenteditable","true"),W.status>=200&&W.status<300)if(e.options.upload.success)e.options.upload.success(h,W.responseText);else{var G=W.responseText;e.options.upload.format&&(G=e.options.upload.format(t,W.responseText)),function(V,H){tn(H).focus();var X=JSON.parse(V),ie="";X.code===1&&(ie=""+X.msg),X.data.errFiles&&X.data.errFiles.length>0&&(ie="<ul><li>"+ie+"</li>",X.data.errFiles.forEach(function(re){var ne=re.lastIndexOf("."),Y=H.options.upload.filename(re.substr(0,ne))+re.substr(ne);ie+="<li>"+Y+" "+window.VditorI18n.uploadError+"</li>"}),ie+="</ul>"),ie?H.tip.show(ie):H.tip.hide();var Q="";Object.keys(X.data.succMap).forEach(function(re){var ne=X.data.succMap[re],Y=re.lastIndexOf("."),le=re.substr(Y),we=H.options.upload.filename(re.substr(0,Y))+le;(le=le.toLowerCase()).indexOf(".wav")===0||le.indexOf(".mp3")===0||le.indexOf(".ogg")===0?H.currentMode==="wysiwyg"?Q+=`<div class="vditor-wysiwyg__block" data-type="html-block"
data-block="0"><pre><code><audio controls="controls" src="`+ne+'"></audio></code></pre><pre class="vditor-wysiwyg__preview" data-render="1"><audio controls="controls" src="'+ne+`"></audio></pre></div>
`:H.currentMode==="ir"?Q+='<audio controls="controls" src="'+ne+`"></audio>
`:Q+="["+we+"]("+ne+`)
`: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"?Q+='<img alt="'+we+'" src="'+ne+`">
`:Q+="
`:H.currentMode==="wysiwyg"?Q+='<a href="'+ne+'">'+we+`</a>
`:Q+="["+we+"]("+ne+`)
`}),(0,M.Hc)(H.upload.range),document.execCommand("insertHTML",!1,Q),H.upload.range=getSelection().getRangeAt(0).cloneRange()}(G,e)}else e.options.upload.error?e.options.upload.error(W.responseText):e.tip.show(W.responseText);n&&(n.value=""),e.upload.element.style.display="none"}},W.upload.onprogress=function(G){if(G.lengthComputable){var V=G.loaded/G.total*100;e.upload.element.style.display="block",e.upload.element.style.width=V+"%"}},W.send(b),[2]}})})},yt=function(e,t,n){var i,r=(0,f.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 h,E=r.isEqualNode(e.wysiwyg.element),b=(0,f.a1)(r,"data-type","footnotes-block");if(E)s=r.innerHTML;else{var y=(0,f.O9)(t.startContainer);if(y&&!b){var _=(0,N.S)(t.startContainer,"BLOCKQUOTE");r=_?(0,f.F9)(t.startContainer)||r:y}if(b&&(r=b),s=r.outerHTML,r.tagName==="UL"||r.tagName==="OL"){var R=r.previousElementSibling,q=r.nextElementSibling;!R||R.tagName!=="UL"&&R.tagName!=="OL"||(s=R.outerHTML+s,R.remove()),!q||q.tagName!=="UL"&&q.tagName!=="OL"||(s+=q.outerHTML,q.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),E)r.innerHTML=s;else if(r.outerHTML=s,b){var A=(0,f.E2)(e.wysiwyg.element.querySelector("wbr"),"LI");if(A){var j=e.wysiwyg.element.querySelector('sup[data-type="footnotes-ref"][data-footnotes-label="'+A.getAttribute("data-marker")+'"]');j&&j.setAttribute("aria-label",A.textContent.trim().substr(0,24))}}var W,z=e.wysiwyg.element.querySelectorAll("[data-type='link-ref-defs-block']");z.forEach(function(V,H){H===0?h=V:(h.insertAdjacentHTML("beforeend",V.innerHTML),V.remove())}),z.length>0&&e.wysiwyg.element.insertAdjacentElement("beforeend",z[0]);var G=e.wysiwyg.element.querySelectorAll("[data-type='footnotes-block']");G.forEach(function(V,H){H===0?W=V:(W.insertAdjacentHTML("beforeend",V.innerHTML),V.remove())}),G.length>0&&e.wysiwyg.element.insertAdjacentElement("beforeend",G[0]),(0,M.ib)(e.wysiwyg.element,t),e.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__preview[data-render='2']").forEach(function(V){ye(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)))}ve(e),Ee(e,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})},rr=function(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e},ir=function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function s(b){try{E(i.next(b))}catch(y){o(y)}}function h(b){try{E(i.throw(b))}catch(y){o(y)}}function E(b){var y;b.done?r(b.value):(y=b.value,y instanceof n?y:new n(function(_){_(y)})).then(s,h)}E((i=i.apply(e,t||[])).next())})},or=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:h(0),throw:h(1),return:h(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function h(E){return function(b){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(_){y=[6,_],i=0}finally{n=r=0}if(5&y[0])throw y[1];return{value:y[0]?y[1]:void 0,done:!0}}([E,b])}}},rn=function(e,t,n){if(e.keyCode===229&&e.code===""&&e.key==="Unidentified"&&t.currentMode!=="sv"){var i=(0,f.F9)(n);if(i&&i.textContent.trim()==="")return t[t.currentMode].composingLock=!0,!1}return!0},on=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,f.lG)(e.startContainer,"P")||(0,f.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)}}},an=function(e,t){if(t==="ArrowDown"||t==="ArrowUp"){var n=(0,f.a1)(e.startContainer,"data-type","math-inline")||(0,f.a1)(e.startContainer,"data-type","html-entity")||(0,f.a1)(e.startContainer,"data-type","html-inline");n&&(t==="ArrowDown"&&e.setStartAfter(n.parentElement),t==="ArrowUp"&&e.setStartBefore(n.parentElement))}},bt=function(e,t){var n=(0,M.zh)(e),i=(0,f.F9)(n.startContainer);i&&(i.insertAdjacentHTML(t,'<p data-block="0">'+m.g.ZWSP+`<wbr>
</p>`),(0,M.ib)(e[e.currentMode].element,n),et(e),ue(e))},ar=function(e){var t=(0,f.lG)(e,"TABLE");return!(!t||!t.rows[0].cells[0].isSameNode(e))&&t},sr=function(e){var t=(0,f.lG)(e,"TABLE");return!(!t||!t.lastElementChild.lastElementChild.lastElementChild.isSameNode(e))&&t},sn=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},pt=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(`
`)===-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},tt=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(`
`)===-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},wt=function(e,t,n,i){i===void 0&&(i=!0);var r=(0,f.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 h=r.parentElement.children[s].querySelector("input");h&&h.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 E=void 0;n==="list"?(E=document.createElement("ul")).setAttribute("data-marker","*"):(E=document.createElement("ol")).setAttribute("data-marker","1."),E.setAttribute("data-block","0"),E.setAttribute("data-tight",r.parentElement.getAttribute("data-tight")),E.innerHTML=r.parentElement.innerHTML,r.parentElement.parentNode.replaceChild(E,r.parentElement)}else{var b=(0,f.a1)(t.startContainer,"data-block","0");b||(e[e.currentMode].element.querySelector("wbr").remove(),(b=e[e.currentMode].element.querySelector("p")).innerHTML="<wbr>"),n==="check"?(b.insertAdjacentHTML("beforebegin",'<ul data-block="0"><li class="vditor-task"><input type="checkbox" /> '+b.innerHTML+"</li></ul>"),b.remove()):n==="list"?(b.insertAdjacentHTML("beforebegin",'<ul data-block="0"><li>'+b.innerHTML+"</li></ul>"),b.remove()):n==="ordered-list"&&(b.insertAdjacentHTML("beforebegin",'<ol data-block="0"><li>'+b.innerHTML+"</li></ol>"),b.remove())}},ln=function(e,t,n){var i=t.previousElementSibling;if(t&&i){var r=[t];Array.from(n.cloneContents().children).forEach(function(E,b){E.nodeType!==3&&t&&E.textContent.trim()!==""&&t.getAttribute("data-node-id")===E.getAttribute("data-node-id")&&(b!==0&&r.push(t),t=t.nextElementSibling)}),e[e.currentMode].element.querySelectorAll("wbr").forEach(function(E){E.remove()}),n.insertNode(document.createElement("wbr"));var o=i.parentElement,s="";r.forEach(function(E){var b=E.getAttribute("data-marker");b.length!==1&&(b="1"+b.slice(-1)),s+='<li data-node-id="'+E.getAttribute("data-node-id")+'" data-marker="'+b+'">'+E.innerHTML+"</li>",E.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 h=(0,f.O9)(n.startContainer);h&&h.querySelectorAll(".vditor-"+e.currentMode+"__preview[data-render='2']").forEach(function(E){ye(E,e),e.currentMode==="wysiwyg"&&E.previousElementSibling.setAttribute("style","display:none")}),ue(e),et(e)}else e[e.currentMode].element.focus()},Rt=function(e,t,n,i){var r=(0,f.lG)(t.parentElement,"LI");if(r){e[e.currentMode].element.querySelectorAll("wbr").forEach(function(_){_.remove()}),n.insertNode(document.createElement("wbr"));var o=t.parentElement,s=o.cloneNode(),h=[t];Array.from(n.cloneContents().children).forEach(function(_,R){_.nodeType!==3&&t&&_.textContent.trim()!==""&&t.getAttribute("data-node-id")===_.getAttribute("data-node-id")&&(R!==0&&h.push(t),t=t.nextElementSibling)});var E=!1,b="";o.querySelectorAll("li").forEach(function(_){E&&(b+=_.outerHTML,_.nextElementSibling||_.previousElementSibling?_.remove():_.parentElement.remove()),_.isSameNode(h[h.length-1])&&(E=!0)}),h.reverse().forEach(function(_){r.insertAdjacentElement("afterend",_)}),b&&(s.innerHTML=b,h[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,f.O9)(n.startContainer);y&&y.querySelectorAll(".vditor-"+e.currentMode+"__preview[data-render='2']").forEach(function(_){ye(_,e),e.currentMode==="wysiwyg"&&_.previousElementSibling.setAttribute("style","display:none")}),ue(e),et(e)}else e[e.currentMode].element.focus()},Et=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 h=0;h<i;h++)if(e.rows[s].cells[h].isSameNode(n)){o=h;break}for(var E=0;E<r;E++)e.rows[E].cells[o].setAttribute("align",t)},Pt=function(e){var t=e.trimRight().split(`
`).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(`
`).length>1)&&t.indexOf(" ")!==0&&t.indexOf(" ")!==0},qt=function(e){var t=e.trimRight().split(`
`);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"?Ee(e,t):e.currentMode==="ir"?Ge(e,t):e.currentMode==="sv"&&He(e,t)},cn=function(e,t,n,i){var r,o=e.startContainer,s=(0,f.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(`
`)&&s.insertAdjacentText("beforeend",`
`),e.insertNode(document.createTextNode(`
`)),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",`
`),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 h=!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")&&(h=!0),h||e.toString()!=="")return i.shiftKey?Rt(t,s,e,s.parentElement):ln(t,s,e),i.preventDefault(),!0}}return!1},Bt=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},dn=function(e,t,n,i){if(n){if(!(0,a.yl)(e)&&!e.altKey&&e.key==="Enter"){var r=String.raw(Wt||(Wt=rr(["",""],["",""])),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+`
`+s.substring(3,s.length-3)+`
|<wbr>`,n.outerHTML=t.lute.SpinVditorDOM(s),(0,M.ib)(t[t.currentMode].element,i),ue(t),_e(t),e.preventDefault(),!0}if(Pt(n.innerHTML)&&n.previousElementSibling){var h="",E=n.innerHTML.trimRight().split(`
`);return E.length>1&&(E.pop(),h='<p data-block="0">'+E.join(`
`)+"</p>"),n.insertAdjacentHTML("afterend",h+`<hr data-block="0"><p data-block="0"><wbr>
</p>`),n.remove(),(0,M.ib)(t[t.currentMode].element,i),ue(t),_e(t),e.preventDefault(),!0}if(qt(n.innerHTML))return t.currentMode==="wysiwyg"?n.outerHTML=t.lute.SpinVditorDOM(n.innerHTML+`<p data-block="0"><wbr>
</p>`):n.outerHTML=t.lute.SpinVditorIRDOM(n.innerHTML+`<p data-block="0"><wbr>
</p>`),(0,M.ib)(t[t.currentMode].element,i),ue(t),_e(t),e.preventDefault(),!0}if(i.collapsed&&n.previousElementSibling&&e.key==="Backspace"&&!(0,a.yl)(e)&&!e.altKey&&!e.shiftKey&&n.textContent.trimRight().split(`
`).length>1&&(0,M.im)(n,t[t.currentMode].element,i).start===0){var b=(0,f.DX)(n.previousElementSibling);return b.textContent.endsWith(`
`)||(b.textContent=b.textContent+`
`),b.parentElement.insertAdjacentHTML("beforeend","<wbr>"+n.innerHTML),n.remove(),(0,M.ib)(t[t.currentMode].element,i),!1}return!1}},un=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)},pn=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)},kt=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)},mn=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)}},fn=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 h=n.rows[s].cells;if(h.length===1){n.remove(),et(e);break}h[r].remove()}(0,M.Hc)(t),ue(e)},hn=function(e,t,n){var i=n.startContainer,r=(0,f.lG)(i,"TD")||(0,f.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),_e(e),t.preventDefault(),!0}if(t.key==="Tab")return t.shiftKey?(sn(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)):bt(e,"beforebegin"),!0;for(var h=0,E=r.parentElement;h<E.cells.length&&!E.cells[h].isSameNode(r);h++);var b=E.previousElementSibling;return b||(b=E.parentElement.previousElementSibling.firstChild),n.selectNodeContents(b.cells[h]),n.collapse(!1),(0,M.Hc)(n),!0}if(t.key==="ArrowDown"){var y;if(t.preventDefault(),!(E=r.parentElement).nextElementSibling&&r.tagName==="TD")return s.nextElementSibling?(n.selectNodeContents(s.nextElementSibling),n.collapse(!0),(0,M.Hc)(n)):bt(e,"afterend"),!0;for(h=0;h<E.cells.length&&!E.cells[h].isSameNode(r);h++);return(y=E.nextElementSibling)||(y=E.parentElement.nextElementSibling.firstChild),n.selectNodeContents(y.cells[h]),n.collapse(!0),(0,M.Hc)(n),!0}if(e.currentMode==="wysiwyg"&&!(0,a.yl)(t)&&t.key==="Enter"&&!t.shiftKey&&t.altKey){var _=e.wysiwyg.popover.querySelector(".vditor-input");return _.focus(),_.select(),t.preventDefault(),!0}if(!(0,a.yl)(t)&&!t.shiftKey&&!t.altKey&&t.key==="Backspace"&&n.startOffset===0&&n.toString()==="")return!sn(r,n,!1)&&s&&(s.textContent.trim()===""?(s.outerHTML=`<p data-block="0"><wbr>
</p>`,(0,M.ib)(e[e.currentMode].element,n)):(n.setStartBefore(s),n.collapse(!0)),ue(e)),t.preventDefault(),!0;if(P("⇧⌘F",t))return pn(e,n,r),t.preventDefault(),!0;if(P("⌘=",t))return un(e,n,r),t.preventDefault(),!0;if(P("⇧⌘G",t))return kt(e,s,r,"beforebegin"),t.preventDefault(),!0;if(P("⇧⌘=",t))return kt(e,s,r),t.preventDefault(),!0;if(P("⌘-",t))return mn(e,n,r),t.preventDefault(),!0;if(P("⇧⌘-",t))return fn(e,n,s,r),t.preventDefault(),!0;if(P("⇧⌘L",t)){if(e.currentMode==="ir")return Et(s,"left"),ue(e),t.preventDefault(),!0;if(R=e.wysiwyg.popover.querySelector('[data-type="left"]'))return R.click(),t.preventDefault(),!0}if(P("⇧⌘C",t)){if(e.currentMode==="ir")return Et(s,"center"),ue(e),t.preventDefault(),!0;if(R=e.wysiwyg.popover.querySelector('[data-type="center"]'))return R.click(),t.preventDefault(),!0}if(P("⇧⌘R",t)){if(e.currentMode==="ir")return Et(s,"right"),ue(e),t.preventDefault(),!0;var R;if(R=e.wysiwyg.popover.querySelector('[data-type="right"]'))return R.click(),t.preventDefault(),!0}}return!1},vn=function(e,t,n,i){if(n.tagName==="PRE"&&P("⌘A",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===`
`)&&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(`
`)||n.firstElementChild.insertAdjacentText("beforeend",`
`),i.extractContents(),i.insertNode(document.createTextNode(`
`)),i.collapse(!1),(0,M.Hc)(i),(0,a.vU)()||(e.currentMode==="wysiwyg"?yt(e,i):B(e,i)),_e(e),t.preventDefault(),!0)},gn=function(e,t,n,i){var r=t.startContainer,o=(0,f.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,"")===`
`||i.innerHTML.replace(m.g.ZWSP,"")===""?(s=!0,i.remove()):i.innerHTML.endsWith(`
`)&&(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>
</p>`),(0,M.ib)(e[e.currentMode].element,t),ue(e),n.preventDefault(),!0}var h=(0,f.F9)(r);if(e.currentMode==="wysiwyg"&&h&&P("⇧⌘;",n))return t.insertNode(document.createElement("wbr")),h.outerHTML='<blockquote data-block="0">'+h.outerHTML+"</blockquote>",(0,M.ib)(e.wysiwyg.element,t),Ee(e),n.preventDefault(),!0;if(pt(e,n,t,o,o)||tt(e,n,t,o,o))return!0}return!1},yn=function(e,t,n){var i=t.startContainer,r=(0,f.fb)(i,"vditor-task");if(r){if(P("⇧⌘J",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,f.DX)(s).parentElement.insertAdjacentHTML("beforeend","<wbr>"+r.innerHTML.trim()),r.remove()):(r.parentElement.insertAdjacentHTML("beforebegin",'<p data-block="0"><wbr>'+(r.innerHTML.trim()||`
`)+"</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,f.fb)(r.parentElement,"vditor-task")){var h=(0,f.O9)(i);h&&Rt(e,r,t,h)}else if(r.nextElementSibling){var E="",b="",y=!1;Array.from(r.parentElement.children).forEach(function(A){r.isSameNode(A)?y=!0:y?E+=A.outerHTML:b+=A.outerHTML});var _=r.parentElement.tagName,R=r.parentElement.tagName==="OL"?"":' data-marker="'+r.parentElement.getAttribute("data-marker")+'"',q="";b&&(q=r.parentElement.tagName==="UL"?"":' start="1"',b="<"+_+' data-tight="true"'+R+' data-block="0">'+b+"</"+_+">"),r.parentElement.outerHTML=b+`<p data-block="0"><wbr>
</p><`+_+`
data-tight="true"`+R+' data-block="0"'+q+">"+E+"</"+_+">"}else r.parentElement.insertAdjacentHTML("afterend",`<p data-block="0"><wbr>
</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),_e(e),n.preventDefault(),!0}}return!1},bn=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},wn=function(e){(0,a.vU)()&&e.startContainer.nodeType!==3&&e.startContainer.tagName==="HR"&&e.setStartBefore(e.startContainer)},En=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)},St=function(e,t,n){return ir(void 0,void 0,void 0,function(){var i,r,o,s,h,E,b,y,_,R,q,A,j,W,z,G;return or(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={},h=function(H,X){if(!X)return["",Lute.WalkContinue];var ie=H.TokensStr();if(H.__internal_object__.Parent.Type===34&&ie&&ie.indexOf("file://")===-1&&e.options.upload.linkToImgUrl){var Q=new XMLHttpRequest;Q.open("POST",e.options.upload.linkToImgUrl),e.options.upload.token&&Q.setRequestHeader("X-Upload-Token",e.options.upload.token),e.options.upload.withCredentials&&(Q.withCredentials=!0),nn(e,Q),Q.setRequestHeader("Content-Type","application/json; charset=utf-8"),Q.onreadystatechange=function(){if(Q.readyState===XMLHttpRequest.DONE){if(Q.status===200){var re=Q.responseText;e.options.upload.linkToImgFormat&&(re=e.options.upload.linkToImgFormat(Q.responseText));var ne=JSON.parse(re);if(ne.code!==0)return void e.tip.show(ne.msg);var Y=ne.data.originalURL;if(e.currentMode==="sv")e.sv.element.querySelectorAll(".vditor-sv__marker--link").forEach(function(we){we.textContent===Y&&(we.textContent=ne.data.url)});else{var le=e[e.currentMode].element.querySelector('img[src="'+Y+'"]');le.src=ne.data.url,e.currentMode==="ir"&&(le.previousElementSibling.previousElementSibling.innerHTML=ne.data.url)}ue(e)}else e.tip.show(Q.responseText);e.options.upload.linkToImgCallback&&e.options.upload.linkToImgCallback(Q.responseText)}},Q.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(/&/g,"&").replace(/<(|\/)(html|body|meta)[^>]*?>/gi,"").trim()!=='<a href="'+r+'">'+r+"</a>"&&i.replace(/&/g,"&").replace(/<(|\/)(html|body|meta)[^>]*?>/gi,"").trim()!=='<!--StartFragment--><a href="'+r+'">'+r+"</a><!--EndFragment-->"||(i=""),(E=new DOMParser().parseFromString(i,"text/html")).body&&(i=E.body.innerHTML),i=Lute.Sanitize(i),e.wysiwyg.getComments(e),b=e[e.currentMode].element.scrollHeight,y=function(H,X,ie){ie===void 0&&(ie="sv");var Q=document.createElement("div");Q.innerHTML=H;var re=!1;Q.childElementCount===1&&Q.lastElementChild.style.fontFamily.indexOf("monospace")>-1&&(re=!0);var ne=Q.querySelectorAll("pre");if(Q.childElementCount===1&&ne.length===1&&ne[0].className!=="vditor-wysiwyg"&&ne[0].className!=="vditor-sv"&&(re=!0),H.indexOf(`
<p class="p1">`)===0&&(re=!0),Q.childElementCount===1&&Q.firstElementChild.tagName==="TABLE"&&Q.querySelector(".line-number")&&Q.querySelector(".line-content")&&(re=!0),re){var Y=X||H;return/\n/.test(Y)||ne.length===1?ie==="wysiwyg"?'<div class="vditor-wysiwyg__block" data-block="0" data-type="code-block"><pre><code>'+Y.replace(/&/g,"&").replace(/</g,"<")+"<wbr></code></pre></div>":"\n```\n"+Y.replace(/&/g,"&").replace(/</g,"<")+"\n```":ie==="wysiwyg"?"<code>"+Y.replace(/&/g,"&").replace(/</g,"<")+"</code><wbr>":"`"+Y+"`"}return!1}(i,r,e.currentMode),(_=e.currentMode==="sv"?(0,f.a1)(t.target,"data-type","code-block"):(0,f.lG)(t.target,"CODE"))?(e.currentMode==="sv"?document.execCommand("insertHTML",!1,r.replace(/&/g,"&").replace(/</g,"<")):(R=(0,M.im)(t.target,e[e.currentMode].element),_.parentElement.tagName!=="PRE"&&(r+=m.g.ZWSP),_.textContent=_.textContent.substring(0,R.start)+r+_.textContent.substring(R.end),(0,M.$j)(R.start+r.length,R.start+r.length,_.parentElement),!((G=_.parentElement)===null||G===void 0)&&G.nextElementSibling.classList.contains("vditor-"+e.currentMode+"__preview")&&(_.parentElement.nextElementSibling.innerHTML=_.outerHTML,ye(_.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]:((q=document.createElement("div")).innerHTML=i,q.querySelectorAll("[style]").forEach(function(H){H.removeAttribute("style")}),q.querySelectorAll(".vditor-copy").forEach(function(H){H.remove()}),e.currentMode==="ir"?(s.HTML2VditorIRDOM={renderLinkDest:h},e.lute.SetJSRenderers({renderers:s}),(0,M.oC)(e.lute.HTML2VditorIRDOM(q.innerHTML),e)):e.currentMode==="wysiwyg"?(s.HTML2VditorDOM={renderLinkDest:h},e.lute.SetJSRenderers({renderers:s}),(0,M.oC)(e.lute.HTML2VditorDOM(q.innerHTML),e)):(s.Md2VditorSVDOM={renderLinkDest:h},e.lute.SetJSRenderers({renderers:s}),$t(e,e.lute.HTML2Md(q.innerHTML).trimRight())),e.outline.render(e),[3,8]);case 3:return o.length>0?e.options.upload.url||e.options.upload.handler?[4,It(e,o)]:[3,5]:[3,7];case 4:return V.sent(),[3,6];case 5:A=new FileReader,"clipboardData"in t?(o=t.clipboardData.files,j=o[0]):t.dataTransfer.types.includes("Files")&&(o=t.dataTransfer.items,j=o[0].getAsFile()),j&&j.type.startsWith("image")&&(A.readAsDataURL(j),A.onload=function(){var H="";e.currentMode==="wysiwyg"?H+='<img alt="'+j.name+'" src="'+A.result.toString()+`">
`:H+="+`)
`,document.execCommand("insertHTML",!1,H)}),V.label=6;case 6:return[3,8];case 7:r.trim()!==""&&o.length===0&&((z=(0,M.zh)(e)).toString()!==""&&e.lute.IsValidLinkDest(r)&&(r="["+z.toString()+"]("+r+")"),e.currentMode==="ir"?(s.Md2VditorIRDOM={renderLinkDest:h},e.lute.SetJSRenderers({renderers:s}),(0,M.oC)(e.lute.Md2VditorIRDOM(r),e)):e.currentMode==="wysiwyg"?(s.Md2VditorDOM={renderLinkDest:h},e.lute.SetJSRenderers({renderers:s}),(0,M.oC)(e.lute.Md2VditorDOM(r),e)):(s.Md2VditorSVDOM={renderLinkDest:h},e.lute.SetJSRenderers({renderers:s}),$t(e,r)),e.outline.render(e)),V.label=8;case 8:return e.currentMode!=="sv"&&((W=(0,f.F9)((0,M.zh)(e).startContainer))&&(z=(0,M.zh)(e),e[e.currentMode].element.querySelectorAll("wbr").forEach(function(H){H.remove()}),z.insertNode(document.createElement("wbr")),e.currentMode==="wysiwyg"?W.outerHTML=e.lute.SpinVditorDOM(W.outerHTML):W.outerHTML=e.lute.SpinVditorIRDOM(W.outerHTML),(0,M.ib)(e[e.currentMode].element,z)),e[e.currentMode].element.querySelectorAll(".vditor-"+e.currentMode+"__preview[data-render='2']").forEach(function(H){ye(H,e)})),e.wysiwyg.triggerRemoveComment(e),ue(e),e[e.currentMode].element.scrollHeight-b>Math.min(e[e.currentMode].element.clientHeight,window.innerHeight)/2&&_e(e),[2]}})})},kn=function(e){e.hint.render(e);var t=(0,M.zh)(e).startContainer,n=(0,f.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,"");m.g.CODE_LANGUAGES.forEach(function(o){o.indexOf(r.toLowerCase())>-1&&i.push({html:o,value:o})}),e.hint.genHTML(i,r,e)}},Ge=function(e,t){t===void 0&&(t={enableAddUndoStack:!0,enableHint:!1,enableInput:!0}),t.enableHint&&kn(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)},mt=function(e,t){var n=(0,M.zh)(e),i=(0,f.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)),B(e,n.cloneRange()),lt(e)}},Lt=function(e,t,n){var i=(0,f.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()}},lr=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 h=!0;if(t.classList.contains("vditor-menu--current"))if(o==="quote"){var E=(0,f.lG)(s,"BLOCKQUOTE");E&&(r.insertNode(document.createElement("wbr")),E.outerHTML=E.innerHTML.trim()===""?'<p data-block="0">'+E.innerHTML+"</p>":E.innerHTML)}else if(o==="link"){var b=(0,f.a1)(r.startContainer,"data-type","a");if(b){var y=(0,f.fb)(r.startContainer,"vditor-ir__link");y?(r.insertNode(document.createElement("wbr")),b.outerHTML=y.innerHTML):b.outerHTML=b.querySelector(".vditor-ir__link").innerHTML+"<wbr>"}}else o==="italic"?Lt(r,e,"em"):o==="bold"?Lt(r,e,"strong"):o==="strike"?Lt(r,e,"s"):o==="inline-code"?Lt(r,e,"code"):o!=="check"&&o!=="list"&&o!=="ordered-list"||(wt(e,r,o),h=!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 _=(0,f.F9)(r.startContainer);if(o==="line"){if(_){var R=`<hr data-block="0"><p data-block="0"><wbr>
</p>`;_.innerHTML.trim()===""?_.outerHTML=R:_.insertAdjacentHTML("afterend",R)}}else if(o==="quote")_&&(r.insertNode(document.createElement("wbr")),_.outerHTML='<blockquote data-block="0">'+_.outerHTML+"</blockquote>",h=!1,t.classList.add("vditor-menu--current"));else if(o==="link"){var q=void 0;q=r.toString()===""?n+"<wbr>"+i:""+n+r.toString()+i.replace(")","<wbr>)"),document.execCommand("insertHTML",!1,q),h=!1,t.classList.add("vditor-menu--current")}else if(o==="italic"||o==="bold"||o==="strike"||o==="inline-code"||o==="code"||o==="table"){q=void 0,r.toString()===""?q=n+"<wbr>"+i:(q=o==="code"?n+`
`+r.toString()+"<wbr>"+i:o==="table"?""+n+r.toString()+"<wbr>"+i:""+n+r.toString()+i+"<wbr>",r.deleteContents()),o!=="table"&&o!=="code"||(q=`
`+q+`
`);var A=document.createElement("span");A.innerHTML=q,r.insertNode(A),B(e,r),o==="table"&&(r.selectNodeContents(getSelection().getRangeAt(0).startContainer.parentElement),(0,M.Hc)(r))}else o!=="check"&&o!=="list"&&o!=="ordered-list"||(wt(e,r,o,!1),h=!1,c(e.toolbar.elements,["check","list","ordered-list"]),t.classList.add("vditor-menu--current"))}(0,M.ib)(e.ir.element,r),Ge(e),h&<(e)},cr=function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function s(b){try{E(i.next(b))}catch(y){o(y)}}function h(b){try{E(i.throw(b))}catch(y){o(y)}}function E(b){var y;b.done?r(b.value):(y=b.value,y instanceof n?y:new n(function(_){_(y)})).then(s,h)}E((i=i.apply(e,t||[])).next())})},dr=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:h(0),throw:h(1),return:h(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function h(E){return function(b){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(_){y=[6,_],i=0}finally{n=r=0}if(5&y[0])throw y[1];return{value:y[0]?y[1]:void 0,done:!0}}([E,b])}}},ur=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 h=(0,f.a1)(s.startContainer,"data-type","code-block-info");if(h)return h.textContent=m.g.ZWSP+o.trimRight(),s.selectNodeContents(h),s.collapse(!1),Ge(r),h.parentElement.querySelectorAll("code").forEach(function(_){_.className="language-"+o.trimRight()}),ye(h.parentElement.querySelector(".vditor-ir__preview"),r),void(n.recentLanguage=o.trimRight())}if(r.currentMode==="wysiwyg"&&s.startContainer.nodeType!==3){var E=s.startContainer,b=void 0;if((b=E.classList.contains("vditor-input")?E:E.firstElementChild)&&b.classList.contains("vditor-input"))return b.value=o.trimRight(),s.selectNodeContents(b),s.collapse(!1),b.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,f.fb)(s.startContainer,"vditor-wysiwyg__block"))&&y.lastElementChild.classList.contains("vditor-wysiwyg__preview")&&(y.lastElementChild.innerHTML=y.firstElementChild.innerHTML,ye(y.lastElementChild,r));else if(r.currentMode==="ir"){var y;(y=(0,f.fb)(s.startContainer,"vditor-ir__marker--pre"))&&y.nextElementSibling.classList.contains("vditor-ir__preview")&&(y.nextElementSibling.innerHTML=y.innerHTML,ye(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(),h=[];Object.keys(s).forEach(function(E){E.indexOf(o.toLowerCase())===0&&(s[E].indexOf(".")>-1?h.push({html:'<img src="'+s[E]+'" title=":'+E+':"/> :'+E+":",value:":"+E+":"}):h.push({html:'<span class="vditor-hint__emoji">'+s[E]+"</span>"+E,value:s[E]}))}),this.genHTML(h,o,t)}else t.options.hint.extend.forEach(function(E){E.key===n.splitChar&&(clearTimeout(n.timeId),n.timeId=window.setTimeout(function(){return cr(n,void 0,void 0,function(){var b;return dr(this,function(y){switch(y.label){case 0:return b=this.genHTML,[4,E.hint(o)];case 1:return b.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),h=s.left+(i.options.outline.position==="left"?i.outline.element.offsetWidth:0),E=s.top,b="";t.forEach(function(_,R){if(!(R>7)){var q=_.html;if(n!==""){var A=q.lastIndexOf(">")+1,j=q.substr(A),W=j.toLowerCase().indexOf(n.toLowerCase());W>-1&&(j=j.substring(0,W)+"<b>"+j.substring(W,W+n.length)+"</b>"+j.substring(W+n.length),q=q.substr(0,A)+j)}b+='<button type="button" data-value="'+encodeURIComponent(_.value)+` "
`+(R===0?"class='vditor-hint--current'":"")+"> "+q+"</button>"}}),this.element.innerHTML=b;var y=parseInt(document.defaultView.getComputedStyle(o,null).getPropertyValue("line-height"),10);this.element.style.top=E+(y||22)+"px",this.element.style.left=h+"px",this.element.style.display="block",this.element.style.right="auto",this.element.querySelectorAll("button").forEach(function(_){_.addEventListener("click",function(R){r.fillEmoji(_,i),R.preventDefault()})}),this.element.getBoundingClientRect().bottom>window.innerHeight&&(this.element.style.top=E-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(E){var b=t.lastIndexOf(E.key);r.lastIndex<b&&(r.splitChar=E.key,r.lastIndex=b)}),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 h=o[o.length-2].slice(-1);(0,d.X)(h)===" "&&s.length<32&&(i=s)}return i},e}(),pr=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+`"
contenteditable="true" spellcheck="false"></pre>`,this.element=n.firstElementChild,this.bindEvent(t),_t(t,this.element),Yt(t,this.element),xt(t,this.element),Ot(t,this.element),jt(t,this.element),Ht(t,this.element),Nt(t,this.element,this.copy),Dt(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){St(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)()||B(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 Ge(t,{enableAddUndoStack:!0,enableHint:!0,enableInput:!0})):void(n.composingLock||i.data==="‘"||i.data==="“"||i.data==="《"||B(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 Ge(t);var r=(0,M.zh)(t),o=(0,f.fb)(i.target,"vditor-ir__preview");if(o||(o=(0,f.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),_e(t)),i.target.tagName==="IMG"){var s=i.target.parentElement.querySelector(".vditor-ir__marker--link");s&&(r.selectNode(s),(0,M.Hc)(r))}var h=(0,f.a1)(i.target,"data-type","a");if(!h||h.classList.contains("vditor-ir__node--expand")){if(i.target.isEqualNode(n.element)&&n.element.lastElementChild&&r.collapsed){var E=n.element.lastElementChild.getBoundingClientRect();i.y>E.top+E.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),lt(t)}else t.options.link.click?t.options.link.click(h.querySelector(":scope > .vditor-ir__marker--link")):t.options.link.isOpen&&window.open(h.querySelector(":scope > .vditor-ir__marker--link").textContent)}),this.element.addEventListener("keyup",function(i){if(!i.isComposing&&!(0,a.yl)(i))if(i.key==="Enter"&&_e(t),lt(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!==`
`){var r=(0,M.zh)(t);i.key==="Backspace"?((0,a.vU)()&&r.startContainer.textContent===`
`&&r.startOffset===1&&(r.startContainer.textContent="",D(r,t)),n.element.querySelectorAll(".language-math").forEach(function(s){var h=s.querySelector("br");h&&h.remove()})):i.key.indexOf("Arrow")>-1?(i.key!=="ArrowLeft"&&i.key!=="ArrowRight"||kn(t),D(r,t)):i.keyCode===229&&i.code===""&&i.key==="Unidentified"&&D(r,t);var o=(0,f.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}(),Sn=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},mr=K(895),Ln=K(818),fr=function(){function e(t){this.element=document.createElement("div"),this.element.className="vditor-outline",this.element.innerHTML='<div class="vditor-outline__title">'+t+`</div>
<div class="vditor-outline__content"></div>`}return e.prototype.render=function(t){return t.preview.element.style.display==="block"?(0,Ln.k)(t.preview.element.lastElementChild,this.element.lastElementChild,t):(0,Ln.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}(),hr=K(554),vr=function(){function e(t){var n=this;this.element=document.createElement("div"),this.element.className="vditor-preview";var i=document.createElement("div");i.className="vditor-reset",t.options.classes.preview&&i.classList.add(t.options.classes.preview),i.style.maxWidth=t.options.preview.maxWidth+"px",i.addEventListener("copy",function(b){if(b.target.tagName!=="TEXTAREA"){var y=document.createElement("div");y.className="vditor-reset",y.appendChild(getSelection().getRangeAt(0).cloneContents()),n.copyToX(t,y),b.preventDefault()}}),i.addEventListener("click",function(b){var y=(0,f.lG)(b.target,"SPAN");if(y&&(0,f.fb)(y,"vditor-toc")){var _=i.querySelector("#"+y.getAttribute("data-target-id"));_&&(n.element.scrollTop=_.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))}});var r=t.options.preview.actions,o=document.createElement("div");o.className="vditor-preview__action";for(var s=[],h=0;h<r.length;h++){var E=r[h];if(typeof E!="object")switch(E){case"desktop":s.push('<button type="button" class="vditor-preview__action--current" data-type="desktop">Desktop</button>');break;case"tablet":s.push('<button type="button" data-type="tablet">Tablet</button>');break;case"mobile":s.push('<button type="button" data-type="mobile">Mobile/Wechat</button>');break;case"mp-wechat":s.push('<button type="button" data-type="mp-wechat" class="vditor-tooltipped vditor-tooltipped__w" aria-label="复制到公众号"><svg><use xlink:href="#vditor-icon-mp-wechat"></use></svg></button>');break;case"zhihu":s.push('<button type="button" data-type="zhihu" class="vditor-tooltipped vditor-tooltipped__w" aria-label="复制到知乎"><svg><use xlink:href="#vditor-icon-zhihu"></use></svg></button>')}else s.push('<button type="button" data-type="'+E.key+'" class="'+E.className+'"'+(E.tooltip?' aria-label="'+E.tooltip+'"':"")+'">'+E.text+"</button>")}o.innerHTML=s.join(""),r.length===0&&(o.style.display="none"),this.element.appendChild(o),this.element.appendChild(i),o.addEventListener((0,a.Le)(),function(b){var y=(0,N.S)(b.target,"BUTTON");if(y){var _=y.getAttribute("data-type"),R=r.find(function(q){return(q==null?void 0:q.key)===_});R?R.click(_):_!=="mp-wechat"&&_!=="zhihu"?(i.style.width=_==="desktop"?"auto":_==="tablet"?"780px":"360px",i.scrollWidth>i.parentElement.clientWidth&&(i.style.width="auto"),n.render(t),o.querySelectorAll("button").forEach(function(q){q.classList.remove("vditor-preview__action--current")}),y.classList.add("vditor-preview__action--current")):n.copyToX(t,n.element.lastElementChild.cloneNode(!0),_)}})}return e.prototype.render=function(t,n){var i=this;if(clearTimeout(this.mdTimeoutId),this.element.style.display!=="none")if(n)this.element.lastElementChild.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 E=JSON.parse(s.responseText);if(E.code!==0)return void t.tip.show(E.msg);t.options.preview.transform&&(E.data=t.options.preview.transform(E.data)),i.element.lastElementChild.innerHTML=E.data,i.afterRender(t,r)}else{var b=t.lute.Md2HTML(o);t.options.preview.transform&&(b=t.options.preview.transform(b)),i.element.lastElementChild.innerHTML=b,i.afterRender(t,r)}},s.send(JSON.stringify({markdownText:o}))}else{var h=t.lute.Md2HTML(o);t.options.preview.transform&&(h=t.options.preview.transform(h)),i.element.lastElementChild.innerHTML=h,i.afterRender(t,r)}},t.options.preview.delay)}else this.element.lastElementChild.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.element.lastElementChild),(0,pe.s)(t.options.preview.hljs,t.preview.element.lastElementChild,t.options.cdn),(0,fe.i)(t.preview.element.lastElementChild,t.options.cdn,t.options.theme),(0,Le.K)(t.preview.element.lastElementChild,t.options.cdn,t.options.theme),(0,ae.P)(t.preview.element.lastElementChild,t.options.cdn),(0,he.v)(t.preview.element.lastElementChild,t.options.cdn),(0,Z.p)(t.preview.element.lastElementChild,t.options.cdn,t.options.theme),(0,Se.P)(t.preview.element.lastElementChild,t.options.cdn,t.options.theme),(0,Ie.B)(t.preview.element.lastElementChild,t.options.cdn),(0,F.Q)(t.preview.element.lastElementChild,t.options.cdn),(0,hr.Y)(t.preview.element.lastElementChild);var o=t.preview.element,s=t.outline.render(t);s===""&&(s="[ToC]"),o.querySelectorAll('[data-type="toc-block"]').forEach(function(h){h.innerHTML=s,(0,de.H)(h,{cdn:t.options.cdn,math:t.options.preview.math})}),(0,de.H)(t.preview.element.lastElementChild,{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"),this.element.lastElementChild.remove(),t.tip.show("已复制,可到"+(i==="zhihu"?"知乎":"微信公众号平台")+"进行粘贴")},e}(),gr=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,h=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(E){t.options.resize.position==="top"?t.element.style.height=Math.max(h,s+(o-E.clientY))+"px":t.element.style.height=Math.max(h,s+(E.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}(),yr=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),_t(t,this.element),xt(t,this.element),Ot(t,this.element),jt(t,this.element),Ht(t,this.element),Nt(t,this.element,this.copy),Dt(t,this.element,this.copy)}return e.prototype.copy=function(t,n){t.stopPropagation(),t.preventDefault(),t.clipboardData.setData("text/plain",ut(n[n.currentMode].element))},e.prototype.bindEvent=function(t){var n=this;this.element.addEventListener("paste",function(i){St(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!=="‘"&&i.data!=="“"&&i.data!=="《")return n.preventInput?(n.preventInput=!1,void He(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!==`
`?i.key==="Enter"&&_e(t):t.sv.element.innerHTML="")})},e}(),br=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+`
<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}(),Vt=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)}},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)}}(),Er=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"?Vt("editor",n):Vt("both",n)))}),r}return wr(t,e),t}(Te),kr=function(){this.element=document.createElement("div"),this.element.className="vditor-toolbar__br"},Tn=K(312),Sr=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)}}(),Lr=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 h="";return m.g.CODE_THEME.forEach(function(E){h+="<button>"+E+"</button>"}),s.innerHTML='<div style="overflow: auto;max-height:'+window.innerHeight/2+'px">'+h+"</div>",s.addEventListener((0,a.Le)(),function(E){E.target.tagName==="BUTTON"&&(k(n,["subToolbar"]),n.options.preview.hljs.style=E.target.textContent,(0,Tn.Y)(E.target.textContent,n.options.cdn),E.preventDefault(),E.stopPropagation())}),r.element.appendChild(s),S(n,s,o,i.level),r}return Sr(t,e),t}(Te),Tr=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)}}(),Mr=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 h="";return Object.keys(n.options.preview.theme.list).forEach(function(E){h+='<button data-type="'+E+'">'+n.options.preview.theme.list[E]+"</button>"}),s.innerHTML='<div style="overflow: auto;max-height:'+window.innerHeight/2+'px">'+h+"</div>",s.addEventListener((0,a.Le)(),function(E){E.target.tagName==="BUTTON"&&(k(n,["subToolbar"]),n.options.preview.theme.current=E.target.getAttribute("data-type"),(0,te.Z)(n.options.preview.theme.current,n.options.preview.theme.path),E.preventDefault(),E.stopPropagation())}),r.element.appendChild(s),S(n,s,o,i.level),r}return Tr(t,e),t}(Te),Cr=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(`
`)?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}(),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)}}(),_r=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 Ar(t,e),t}(Te),xr=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 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 xr(t,e),t}(Te),Nr=function(){this.element=document.createElement("div"),this.element.className="vditor-toolbar__divider"},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=document.createElement("div");o.className="vditor-panel vditor-panel--arrow";var s="";return Object.keys(n.options.hint.emoji).forEach(function(h){var E=n.options.hint.emoji[h];E.indexOf(".")>-1?s+='<button data-value=":'+h+': " data-key=":'+h+`:"><img
data-value=":`+h+': " data-key=":'+h+':" class="vditor-emojis__icon" src="'+E+'"/></button>':s+='<button data-value="'+E+` "
data-key="`+h+'"><span class="vditor-emojis__icon">'+E+"</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">
<span class="vditor-emojis__tip"></span><span>`+(n.options.hint.emojiTail||"")+`</span>
</div>`,r.element.appendChild(o),S(n,o,r.element.firstElementChild,i.level),r.bindEvent(n),r}return Dr(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"),h=(0,M.zh)(n),E=s;if(n.currentMode==="wysiwyg"?E=n.lute.SpinVditorDOM(s):n.currentMode==="ir"&&(E=n.lute.SpinVditorIRDOM(s)),s.indexOf(":")>-1&&n.currentMode!=="sv"){var b=document.createElement("div");b.innerHTML=E,E=b.firstElementChild.firstElementChild.outerHTML+" ",(0,M.oC)(E,n)}else h.extractContents(),h.insertNode(document.createTextNode(s));h.collapse(!1),(0,M.Hc)(h),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}(Te),Mn=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)},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)}}(),Ir=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>
<button data-type="pdf">PDF</button>
<button data-type="html">HTML</button>`,s.addEventListener((0,a.Le)(),function(h){var E=h.target;if(E.tagName==="BUTTON"){switch(E.getAttribute("data-type")){case"markdown":(function(b){var y=u(b);Mn(b,y,y.substr(0,10)+".md")})(n);break;case"pdf":(function(b){b.tip.show(window.VditorI18n.generate,3800);var y=document.querySelector("#vditorExportIframe");y.contentDocument.open(),y.contentDocument.write('<link rel="stylesheet" href="'+b.options.cdn+`/dist/index.css"/>
<script src="`+b.options.cdn+`/dist/method.min.js"><\/script>
<div id="preview" style="width: 800px"></div>
<script>
window.addEventListener("message", (e) => {
if(!e.data) {
return;
}
Vditor.preview(document.getElementById('preview'), e.data, {
markdown: {
theme: "`+b.options.preview.theme+`"
},
hljs: {
style: "`+b.options.preview.hljs.style+`"
}
});
setTimeout(() => {
window.print();
}, 3600);
}, false);
<\/script>`),y.contentDocument.close(),setTimeout(function(){y.contentWindow.postMessage(u(b),"*")},200)})(n);break;case"html":(function(b){var y=Sn(b),_='<html><head><link rel="stylesheet" type="text/css" href="'+b.options.cdn+`/dist/index.css"/>
<script src="`+b.options.cdn+"/dist/js/i18n/"+b.options.lang+`.js"><\/script>
<script src="`+b.options.cdn+`/dist/method.min.js"><\/script></head>
<body><div class="vditor-reset" id="preview">`+y+`</div>
<script>
const previewElement = document.getElementById('preview')
Vditor.setContentTheme('`+b.options.preview.theme.current+"', '"+b.options.preview.theme.path+`');
Vditor.codeRender(previewElement);
Vditor.highlightRender(`+JSON.stringify(b.options.preview.hljs)+", previewElement, '"+b.options.cdn+`');
Vditor.mathRender(previewElement, {
cdn: '`+b.options.cdn+`',
math: `+JSON.stringify(b.options.preview.math)+`,
});
Vditor.mermaidRender(previewElement, '`+b.options.cdn+"', '"+b.options.theme+`');
Vditor.markmapRender(previewElement, '`+b.options.cdn+"', '"+b.options.theme+`');
Vditor.flowchartRender(previewElement, '`+b.options.cdn+`');
Vditor.graphvizRender(previewElement, '`+b.options.cdn+`');
Vditor.chartRender(previewElement, '`+b.options.cdn+"', '"+b.options.theme+`');
Vditor.mindmapRender(previewElement, '`+b.options.cdn+"', '"+b.options.theme+`');
Vditor.abcRender(previewElement, '`+b.options.cdn+`');
Vditor.mediaRender(previewElement);
Vditor.speechRender(previewElement);
<\/script>
<script src="`+b.options.cdn+"/dist/js/icons/"+b.options.icon+'.js"><\/script></body></html>';Mn(b,_,y.substr(0,10)+".html")})(n)}k(n,["subToolbar"]),h.preventDefault(),h.stopPropagation()}}),r.element.appendChild(s),S(n,s,o,i.level),r}return jr(t,e),t}(Te),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)}}(),Pr=function(e){function t(n,i){var r=e.call(this,n,i)||this;return r._bindEvent(n,i),r}return Rr(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),be(n)})},t}(Te),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)}}(),Br=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)("<⌥⌘1>")+`</button>
<button data-tag="h2" data-value="## ">`+window.VditorI18n.heading2+" <"+(0,a.ns)("⌥⌘2")+`></button>
<button data-tag="h3" data-value="### ">`+window.VditorI18n.heading3+" <"+(0,a.ns)("⌥⌘3")+`></button>
<button data-tag="h4" data-value="#### ">`+window.VditorI18n.heading4+" <"+(0,a.ns)("⌥⌘4")+`></button>
<button data-tag="h5" data-value="##### ">`+window.VditorI18n.heading5+" <"+(0,a.ns)("⌥⌘5")+`></button>
<button data-tag="h6" data-value="###### ">`+window.VditorI18n.heading6+" <"+(0,a.ns)("⌥⌘6")+"></button>",r.element.appendChild(o),r._bindEvent(n,o),r}return qr(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"?(Ct(n),Ee(n)):n.currentMode==="ir"&&mt(n,""),r.classList.remove("vditor-menu--current")):(k(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"?(vt(n,s.target.getAttribute("data-tag")),Ee(n),r.classList.add("vditor-menu--current")):n.currentMode==="ir"?(mt(n,s.target.getAttribute("data-value")),r.classList.add("vditor-menu--current")):en(n,s.target.getAttribute("data-value")),i.style.display="none"})},t}(Te),Vr=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)}}(),Ur=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;">
<div style="margin-top: 14px;flex: 1">
<div>Markdown 使用指南</div>
<ul style="list-style: none">
<li><a href="https://ld246.com/article/1583308420519" target="_blank">语法速查手册</a></li>
<li><a href="https://ld246.com/article/1583129520165" target="_blank">基础语法</a></li>
<li><a href="https://ld246.com/article/1583305480675" target="_blank">扩展语法</a></li>
<li><a href="https://ld246.com/article/1582778815353" target="_blank">键盘快捷键</a></li>
</ul>
</div>
<div style="margin-top: 14px;flex: 1">
<div>Vditor 支持</div>
<ul style="list-style: none">
<li><a href="https://github.com/Vanessa219/vditor/issues" target="_blank">Issues</a></li>
<li><a href="https://ld246.com/tag/vditor" target="_blank">官方讨论区</a></li>
<li><a href="https://ld246.com/article/1549638745630" target="_blank">开发手册</a></li>
<li><a href="https://ld246.com/guide/markdown" target="_blank">演示地址</a></li>
</ul>
</div></div>`,0)}),r}return Vr(t,e),t}(Te),zr=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)}}(),Gr=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),h=(0,f.lG)(s.startContainer,"LI");h&&ln(n,h,s)}}),r}return zr(t,e),t}(Te),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)}}(),Kr=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;">
<p style="text-align: center;margin: 14px 0">
<em>下一代的 Markdown 编辑器,为未来而构建</em>
</p>
<div style="display: flex;margin-bottom: 14px;flex-wrap: wrap;align-items: center">
<img src="https://unpkg.com/vditor/dist/images/logo.png" style="margin: 0 auto;height: 68px"/>
<div> </div>
<div style="flex: 1;min-width: 250px">
Vditor 是一款浏览器端的 Markdown 编辑器,支持所见即所得、即时渲染(类似 Typora)和分屏预览模式。
它使用 TypeScript 实现,支持原生 JavaScript 以及 Vue、React、Angular 和 Svelte 等框架。
</div>
</div>
<div style="display: flex;flex-wrap: wrap;">
<ul style="list-style: none;flex: 1;min-width:148px">
<li>
项目地址:<a href="https://b3log.org/vditor" target="_blank">b3log.org/vditor</a>
</li>
<li>
开源协议:MIT
</li>
</ul>
<ul style="list-style: none;margin-right: 18px">
<li>
组件版本:Vditor v`+m.H+" / Lute v"+Lute.Version+`
</li>
<li>
赞助捐赠:<a href="https://ld246.com/sponsor" target="_blank">https://ld246.com/sponsor</a>
</li>
</ul>
</div>
</div>`,0)}),r}return Wr(t,e),t}(Te),Fr=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)}}(),Jr=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"||bt(n,"afterend")}),r}return Fr(t,e),t}(Te),Xr=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;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"||bt(n,"beforebegin")}),r}return Xr(t,e),t}(Te),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)}}(),$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){if(o.preventDefault(),!r.element.firstElementChild.classList.contains(m.g.CLASS_MENU_DISABLED)&&n.currentMode!=="sv"){var s=(0,M.zh)(n),h=(0,f.lG)(s.startContainer,"LI");h&&Rt(n,h,s,h.parentElement)}}),r}return Yr(t,e),t}(Te),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)}}(),ei=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 Qr(t,e),t}(Te),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._bindEvent(n),r}return ti(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"),g(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"),k(n,["subToolbar","hint","popover"]),setTimeout(function(){n.outline.render(n)},n.options.preview.delay+10)),me(n)}})},t}(Te),ri=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!="undefined")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),h=new DataView(s);this.writeUTFBytes(h,0,"RIFF"),h.setUint32(4,o,!0),this.writeUTFBytes(h,8,"WAVE"),this.writeUTFBytes(h,12,"fmt "),h.setUint32(16,16,!0),h.setUint16(20,1,!0),h.setUint16(22,1,!0),h.setUint32(24,this.SAMPLE_RATE,!0),h.setUint32(28,2*this.SAMPLE_RATE,!0),h.setUint16(32,2,!0),h.setUint16(34,16,!0);var E=2*i.length;this.writeUTFBytes(h,36,"data"),h.setUint32(40,E,!0);for(var b=i.length,y=44,_=0;_<b;_++)h.setInt16(y,32767*i[_],!0),y+=2;return new Blob([h],{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,h=0;s<o.length;){for(var E=Math.round((s+1)*i),b=0,y=0,_=h;_<E&&_<t.length;_++)b+=t[_],y++;o[s]=b/y,s++,h=E}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}(),ii=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)}}(),oi=function(e){function t(n,i){var r=e.call(this,n,i)||this;return r._bindEvent(n),r}return ii(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 h=new File([i.buildWavFileBlob()],"record"+new Date().getTime()+".wav",{type:"video/webm"});It(n,[h]),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(E){(i=new ri(E)).recorder.onaudioprocess=function(b){if(i.isRecording){var y=b.inputBuffer.getChannelData(0),_=b.inputBuffer.getChannelData(1);i.cloneChannelData(y,_)}},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}(Te),ai=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)}}(),si=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 ai(t,e),t}(Te),li=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)}}(),ci=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 li(t,e),t}(Te),di=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)}}(),ui=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 di(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&&It(n,r.target.files,r.target)})},t}(Te),pi=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 h=document.createElement("div");h.className="vditor-hint vditor-panel--arrow",h.addEventListener((0,a.Le)(),function(E){h.style.display="none"}),r.toolbar.forEach(function(E,b){E.level=2,h.appendChild(n.genItem(t,E,o+b))}),s.appendChild(h),S(t,h,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 Cr(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 Te(t,n);break;case"emoji":r=new Or(t,n);break;case"headings":r=new Br(t,n);break;case"|":r=new Nr;break;case"br":r=new kr;break;case"undo":r=new ci(t,n);break;case"redo":r=new si(t,n);break;case"help":r=new Ur(t,n);break;case"both":r=new Er(t,n);break;case"preview":r=new ni(t,n);break;case"fullscreen":r=new Pr(t,n);break;case"upload":r=new ui(t,n);break;case"record":r=new oi(t,n);break;case"info":r=new Kr(t,n);break;case"edit-mode":r=new Yn(t,n);break;case"devtools":r=new Hr(t,n);break;case"outdent":r=new $r(t,n);break;case"indent":r=new Gr(t,n);break;case"outline":r=new ei(t,n);break;case"insert-after":r=new Jr(t,n);break;case"insert-before":r=new Zr(t,n);break;case"code-theme":r=new Lr(t,n);break;case"content-theme":r=new Mr(t,n);break;case"export":r=new Ir(t,n);break;default:r=new _r(t,n)}if(r){var o=n.name;return o!=="br"&&o!=="|"||(o+=i),this.elements[o]=r.element,r.element}},e}(),mi=K(14),fi=function(){function e(){this.stackSize=50,this.resetStack(),this.dmp=new mi}return e.prototype.clearStack=function(t){this.resetStack(),this.resetIcon(t)},e.prototype.resetIcon=function(t){t.toolbar&&(this[t.currentMode].undoStack.length>1?g(t.toolbar.elements,["undo"]):L(t.toolbar.elements,["undo"]),this[t.currentMode].redoStack.length!==0?g(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,k(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&&g(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(h){h.diffs.forEach(function(E){E[0]=-E[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(h){ye(h,n)}),n[n.currentMode].element.querySelector("wbr"))(0,M.ib)(n[n.currentMode].element,n[n.currentMode].element.ownerDocument.createRange()),_e(n);else{var s=getSelection().getRangeAt(0);s.setEndBefore(n[n.currentMode].element),s.collapse(!1)}ve(n),ue(n,{enableAddUndoStack:!1,enableHint:!1,enableInput:!0}),et(n),n[n.currentMode].element.querySelectorAll(".vditor-"+n.currentMode+"__preview[data-render='2']").forEach(function(h){ye(h,n)}),this[n.currentMode].undoStack.length>1?g(n.toolbar.elements,["undo"]):L(n.toolbar.elements,["undo"]),this[n.currentMode].redoStack.length!==0?g(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(h){(h.firstElementChild.classList.contains("language-echarts")||h.firstElementChild.classList.contains("language-plantuml")||h.firstElementChild.classList.contains("language-mindmap"))&&(h.firstElementChild.removeAttribute("_echarts_instance_"),h.firstElementChild.removeAttribute("data-processed"),h.firstElementChild.innerHTML=h.previousElementSibling.firstElementChild.innerHTML,h.setAttribute("data-render","2")),h.firstElementChild.classList.contains("language-math")&&(h.setAttribute("data-render","2"),h.firstElementChild.textContent=h.firstElementChild.getAttribute("data-math"),h.firstElementChild.removeAttribute("data-math"))});var s=t[t.currentMode].element.innerHTML;return t[t.currentMode].element.querySelectorAll(".vditor-wbr").forEach(function(h){h.remove()}),n&&i&&(0,M.Hc)(i),s.replace('<span class="vditor-wbr"></span>',"<wbr>")},e}(),hi=K(640),vi=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":"👍","-1":"👎",confused:"😕",eyes:"👀️",heart:"❤️",rocket:"🚀️",smile:"😄",tada:"🎉️"},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,hi.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:"⌘E",icon:'<svg><use xlink:href="#vditor-icon-emoji"></use></svg>',name:"emoji",tipPosition:"ne"},{hotkey:"⌘H",icon:'<svg><use xlink:href="#vditor-icon-headings"></use></svg>',name:"headings",tipPosition:"ne"},{hotkey:"⌘B",icon:'<svg><use xlink:href="#vditor-icon-bold"></use></svg>',name:"bold",prefix:"**",suffix:"**",tipPosition:"ne"},{hotkey:"⌘I",icon:'<svg><use xlink:href="#vditor-icon-italic"></use></svg>',name:"italic",prefix:"*",suffix:"*",tipPosition:"ne"},{hotkey:"⌘D",icon:'<svg><use xlink:href="#vditor-icon-strike"></use></svg>',name:"strike",prefix:"~~",suffix:"~~",tipPosition:"ne"},{hotkey:"⌘K",icon:'<svg><use xlink:href="#vditor-icon-link"></use></svg>',name:"link",prefix:"[",suffix:"](https://)",tipPosition:"n"},{name:"|"},{hotkey:"⌘L",icon:'<svg><use xlink:href="#vditor-icon-list"></use></svg>',name:"list",prefix:"* ",tipPosition:"n"},{hotkey:"⌘O",icon:'<svg><use xlink:href="#vditor-icon-ordered-list"></use></svg>',name:"ordered-list",prefix:"1. ",tipPosition:"n"},{hotkey:"⌘J",icon:'<svg><use xlink:href="#vditor-icon-check"></use></svg>',name:"check",prefix:"* [ ] ",tipPosition:"n"},{hotkey:"⇧⌘I",icon:'<svg><use xlink:href="#vditor-icon-outdent"></use></svg>',name:"outdent",tipPosition:"n"},{hotkey:"⇧⌘O",icon:'<svg><use xlink:href="#vditor-icon-indent"></use></svg>',name:"indent",tipPosition:"n"},{name:"|"},{hotkey:"⌘;",icon:'<svg><use xlink:href="#vditor-icon-quote"></use></svg>',name:"quote",prefix:"> ",tipPosition:"n"},{hotkey:"⇧⌘H",icon:'<svg><use xlink:href="#vditor-icon-line"></use></svg>',name:"line",prefix:"---",tipPosition:"n"},{hotkey:"⌘U",icon:'<svg><use xlink:href="#vditor-icon-code"></use></svg>',name:"code",prefix:"```",suffix:"\n```",tipPosition:"n"},{hotkey:"⌘G",icon:'<svg><use xlink:href="#vditor-icon-inline-code"></use></svg>',name:"inline-code",prefix:"`",suffix:"`",tipPosition:"n"},{hotkey:"⇧⌘B",icon:'<svg><use xlink:href="#vditor-icon-before"></use></svg>',name:"insert-before",tipPosition:"n"},{hotkey:"⇧⌘E",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:"⌘M",icon:'<svg><use xlink:href="#vditor-icon-table"></use></svg>',name:"table",prefix:"| col1",suffix:` | col2 | col3 |
| --- | --- | --- |
| | | |
| | | |`,tipPosition:"n"},{name:"|"},{hotkey:"⌘Z",icon:'<svg><use xlink:href="#vditor-icon-undo"></use></svg>',name:"undo",tipPosition:"nw"},{hotkey:"⌘Y",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:"⌘'",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:"⌘P",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(h){typeof o=="string"&&h.name===o&&(s=h),typeof o=="object"&&h.name===o.name&&(s=Object.assign({},h,o))}),o.toolbar&&(s.toolbar=n.mergeToolbar(o.toolbar)),r.push(s)}),r},e}(),gi=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+`"
contenteditable="true" spellcheck="false"></pre>
<div class="vditor-panel vditor-panel--none"></div>
<div class="vditor-panel vditor-panel--none">
<button type="button" aria-label="`+window.VditorI18n.comment+`" class="vditor-icon vditor-tooltipped vditor-tooltipped__n">
<svg><use xlink:href="#vditor-icon-comment"></use></svg>
</button>
</div>`,this.element=i.firstElementChild,this.popover=i.firstElementChild.nextElementSibling,this.selectPopover=i.lastElementChild,this.bindEvent(t),_t(t,this.element),Yt(t,this.element),xt(t,this.element),Ot(t,this.element),jt(t,this.element),Ht(t,this.element),Nt(t,this.element,this.copy),Dt(t,this.element,this.copy),t.options.comment.enable&&(this.selectPopover.querySelector("button").onclick=function(){var r,o,s=Lute.NewNodeID(),h=getSelection().getRangeAt(0),E=h.cloneRange(),b=h.extractContents(),y=!1,_=!1;b.childNodes.forEach(function(A,j){var W=!1;if(A.nodeType===3?W=!0:A.classList.contains("vditor-comment")?A.classList.contains("vditor-comment")&&A.setAttribute("data-cmtids",A.getAttribute("data-cmtids")+" "+s):W=!0,W)if(A.nodeType!==3&&A.getAttribute("data-block")==="0"&&j===0&&E.startOffset>0)A.innerHTML='<span class="vditor-comment" data-cmtids="'+s+'">'+A.innerHTML+"</span>",r=A;else if(A.nodeType!==3&&A.getAttribute("data-block")==="0"&&j===b.childNodes.length-1&&E.endOffset<E.endContainer.textContent.length)A.innerHTML='<span class="vditor-comment" data-cmtids="'+s+'">'+A.innerHTML+"</span>",o=A;else if(A.nodeType!==3&&A.getAttribute("data-block")==="0")j===0?y=!0:j===b.childNodes.length-1&&(_=!0),A.innerHTML='<span class="vditor-comment" data-cmtids="'+s+'">'+A.innerHTML+"</span>";else{var z=document.createElement("span");z.classList.add("vditor-comment"),z.setAttribute("data-cmtids",s),A.parentNode.insertBefore(z,A),z.appendChild(A)}});var R=(0,f.F9)(E.startContainer);R&&(r?(R.insertAdjacentHTML("beforeend",r.innerHTML),r.remove()):R.textContent.trim().replace(m.g.ZWSP,"")===""&&y&&R.remove());var q=(0,f.F9)(E.endContainer);q&&(o?(q.insertAdjacentHTML("afterbegin",o.innerHTML),o.remove()):q.textContent.trim().replace(m.g.ZWSP,"")===""&&_&&q.remove()),h.insertNode(b),t.options.comment.add(s,h.toString(),n.getComments(t,!0)),Ee(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(h){return!r.has(h)}));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,f.lG)(i.startContainer,"CODE"),o=(0,f.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 h=(0,f.lG)(i.startContainer,"A"),E=(0,f.lG)(i.endContainer,"A");if(h&&E&&E.isSameNode(h)){var b=h.getAttribute("title")||"";return b&&(b=' "'+b+'"'),t.clipboardData.setData("text/plain","["+i.toString()+"]("+h.getAttribute("href")+b+")"),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(k(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(k(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){St(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 h=(0,f.a1)(o.startContainer,"data-block","0");h?h.outerHTML=t.lute.SpinVditorDOM(h.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===""?ve(t):((0,a.vU)()||yt(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 Ee(t);if(n.composingLock||i.data==="‘"||i.data==="“"||i.data==="《")Ee(t);else{var r=getSelection().getRangeAt(0),o=(0,f.F9)(r.startContainer);if(o||(Jt(t,r),o=(0,f.F9)(r.startContainer)),o){for(var s=(0,M.im)(o,t.wysiwyg.element,r).start,h=!0,E=s-1;E>o.textContent.substr(0,s).lastIndexOf(`
`);E--)if(o.textContent.charAt(E)!==" "&&o.textContent.charAt(E)!==" "){h=!1;break}s===0&&(h=!1);var b=!0;for(E=s-1;E<o.textContent.length;E++)if(o.textContent.charAt(E)!==" "&&o.textContent.charAt(E)!==`
`){b=!1;break}var y=(0,N.W)(getSelection().getRangeAt(0).startContainer);y&&y.textContent===""&&(ve(t),y.remove()),h&&o.getAttribute("data-type")!=="code-block"||b||qt(o.innerHTML)||Pt(o.innerHTML)&&o.previousElementSibling?typeof t.options.input=="function"&&t.options.input(u(t)):yt(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 Ee(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)))}Xe(t);var h=(0,f.fb)(i.target,"vditor-wysiwyg__preview");h||(h=(0,f.fb)((0,M.zh)(t).startContainer,"vditor-wysiwyg__preview")),h&&ct(h,t),ee(i,t)}else i.target.getAttribute("data-type")==="link-ref"?Xt(t,i.target):function(E,b){var y=E.target;b.wysiwyg.popover.innerHTML="";var _=function(){y.setAttribute("src",q.value),y.setAttribute("alt",j.value),y.setAttribute("title",z.value)},R=document.createElement("span");R.setAttribute("aria-label",window.VditorI18n.imageURL),R.className="vditor-tooltipped vditor-tooltipped__n";var q=document.createElement("input");R.appendChild(q),q.className="vditor-input",q.setAttribute("placeholder",window.VditorI18n.imageURL),q.value=y.getAttribute("src")||"",q.oninput=function(){_()},q.onkeydown=function(G){Oe(b,G)};var A=document.createElement("span");A.setAttribute("aria-label",window.VditorI18n.alternateText),A.className="vditor-tooltipped vditor-tooltipped__n";var j=document.createElement("input");A.appendChild(j),j.className="vditor-input",j.setAttribute("placeholder",window.VditorI18n.alternateText),j.style.width="52px",j.value=y.getAttribute("alt")||"",j.oninput=function(){_()},j.onkeydown=function(G){Oe(b,G)};var W=document.createElement("span");W.setAttribute("aria-label",window.VditorI18n.title),W.className="vditor-tooltipped vditor-tooltipped__n";var z=document.createElement("input");W.appendChild(z),z.className="vditor-input",z.setAttribute("placeholder",window.VditorI18n.title),z.value=y.getAttribute("title")||"",z.oninput=function(){_()},z.onkeydown=function(G){Oe(b,G)},qe(y,b),b.wysiwyg.popover.insertAdjacentElement("beforeend",R),b.wysiwyg.popover.insertAdjacentElement("beforeend",A),b.wysiwyg.popover.insertAdjacentElement("beforeend",W),Pe(b,y)}(i,t)}),this.element.addEventListener("keyup",function(i){if(!i.isComposing&&!(0,a.yl)(i)){i.key==="Enter"&&_e(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!==`
`||(t.wysiwyg.element.innerHTML="");var r=(0,M.zh)(t);if(i.key==="Backspace"&&(0,a.vU)()&&r.startContainer.textContent===`
`&&r.startOffset===1&&(r.startContainer.textContent=""),Jt(t,r),Xe(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,f.fb)(r.startContainer,"vditor-wysiwyg__preview");if(!o&&r.startContainer.nodeType!==3&&r.startOffset>0&&(h=r.startContainer).classList.contains("vditor-wysiwyg__block")&&(o=h.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 h,E=function(y){for(var _=y;_&&!_.nextSibling;)_=_.parentElement;return _.nextSibling}(h=o.parentElement);if(E&&E.nodeType!==3){var b=E.querySelector(".vditor-wysiwyg__preview");if(b)return void ct(b,t)}if(E.nodeType===3){for(;E.textContent.length===0&&E.nextSibling;)E=E.nextSibling;r.setStart(E,1)}else r.setStart(E.firstChild,0)}else r.selectNodeContents(s),r.collapse(!1)}else i.key==="ArrowDown"||i.key==="ArrowRight"?ct(o,t):ct(o,t,!1)}}})},e}(),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)}}();const bi=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 vi(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",h=s+o.lang;document.querySelectorAll('head script[id^="vditorI18nScript"]').forEach(function(E){E.id!==h&&document.head.removeChild(E)}),(0,l.G)(o.cdn+"/dist/js/i18n/"+o.lang+".js",h).then(function(){r.init(n,o)})}return r}return yi(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,Tn.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(){k(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(){g(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"?ut(this.vditor.wysiwyg.element):this.vditor.currentMode==="sv"?ut(this.vditor.sv.element):this.vditor.currentMode==="ir"?ut(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 Sn(this.vditor)},t.prototype.tip=function(n,i){this.vditor.tip.show(n,i)},t.prototype.setPreviewMode=function(n){Vt(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)),this.vditor.currentMode==="sv"?(this.vditor.sv.preventInput=!0,i&&se(this.vditor)):this.vditor.currentMode==="wysiwyg"?(this.vditor.wysiwyg.preventInput=!0,i&&yt(this.vditor,getSelection().getRangeAt(0))):this.vditor.currentMode==="ir"&&(this.vditor.ir.preventInput=!0,i&&B(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>",He(this.vditor,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1})):this.vditor.currentMode==="wysiwyg"?Zt(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){ye(o,r.vditor)}),Ge(this.vditor,{enableAddUndoStack:!0,enableHint:!1,enableInput:!1})),this.vditor.outline.render(this.vditor),n||(k(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 h=o.getAttribute("data-cmtids").split(" ");h.find(function(E,b){if(E===s)return h.splice(b,1),!0}),h.length===0?(o.outerHTML=o.innerHTML,(0,M.zh)(i.vditor).collapse(!0)):o.setAttribute("data-cmtids",h.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)})}),Ee(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 ur(i.hint.extend),lute:void 0,options:i,originalInnerHTML:n.innerHTML,outline:new fr(window.VditorI18n.outline),tip:new br},this.vditor.sv=new yr(this.vditor),this.vditor.undo=new fi,this.vditor.wysiwyg=new gi(this.vditor),this.vditor.ir=new pr(this.vditor),this.vditor.toolbar=new pi(this.vditor),i.resize.enable&&(this.vditor.resize=new gr(this.vditor)),this.vditor.toolbar.elements.devtools&&(this.vditor.devtools=new v),(i.upload.url||i.upload.handler)&&(this.vditor.upload=new nr),(0,l.G)(i._lutePath||i.cdn+"/dist/js/lute/lute.min.js","vditorLuteScript").then(function(){r.vditor.lute=(0,mr.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 vr(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(){k(o,["subToolbar"])}),o.toolbar.elements.export&&o.element.insertAdjacentHTML("beforeend",'<iframe id="vditorExportIframe" style="width: 100%;height: 0;border: 0"></iframe>'),Ze(o,o.options.mode,Jn(o)),document.execCommand("DefaultParagraphSeparator",!1,"p"),navigator.userAgent.indexOf("iPhone")>-1&&window.visualViewport!==void 0){var h=!1,E=function(b){h||(h=!0,requestAnimationFrame(function(){h=!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",E),window.visualViewport.addEventListener("resize",E)}}(r.vditor),i.after&&i.after(),i.icon&&(0,l.J)(i.cdn+"/dist/js/icons/"+i.icon+".js","vditorIconScript")})},t}(T.default)})(),De=De.default})()})})(Kn);var xi=Kn.exports;const Hi=Gn(xi);const Ue=(Ce,Ae="default")=>{const ge=Ce==="dark";switch(Ae){case"default":return ge?"dark":"classic";case"content":return ge?"dark":"light";case"code":return ge?"dracula":"github"}},Ni=Pn({inheritAttrs:!1,props:{height:{type:Number,default:360},value:{type:String,default:""}},emits:["change","get","update:value"],setup(Ce,{attrs:Ae,emit:ge}){const Ne=at(null),K=at(null),De=at(!1),I=_i(),{getLocale:T}=Ti(),{getDarkMode:m}=jn(),d=at(Ce.value||"");Mt([()=>m.value,()=>De.value],([c,p])=>{var g;p&&((g=v.getVditor())==null||g.setTheme(Ue(c),Ue(c,"content"),Ue(c,"code")))},{immediate:!0,flush:"post"}),Mt(()=>Ce.value,c=>{var p;c!==d.value&&((p=v.getVditor())==null||p.setValue(c)),d.value=c});const u=Mi(()=>{let c;switch(st(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=st(Ne);if(!c)return;const p=ht(ht({},Ae),Ce),g=new Hi(c,On(ht({theme:Ue(m.value),lang:st(u),mode:"sv",fullscreen:{index:520},preview:{theme:{current:Ue(m.value,"content")},hljs:{style:Ue(m.value,"code")},actions:[]},input:L=>{d.value=L,ge("update:value",L),ge("change",L)},after:()=>{Ci(()=>{var L;(L=I==null?void 0:I.redoModalHeight)==null||L.call(I),g.setValue(d.value),K.value=g,De.value=!0,ge("get",v)})},blur:()=>{}},p),{cache:{enable:!1}}))}const v={getVditor:()=>K.value};function a(){var p;const c=st(K);if(c){try{(p=c==null?void 0:c.destroy)==null||p.call(c)}catch(g){}K.value=null,De.value=!1}}return Wn(l),qn(a),Bn(a),ht({wrapRef:Ne},v)}}),Di={ref:"wrapRef"};function Oi(Ce,Ae,ge,Ne,K,De){return Vn(),Un("div",Di,null,512)}const ji=In(Ni,[["render",Oi],["__file","E:/allcode/erp/test7901/order-erp-front/src/components/Markdown/src/Markdown.vue"]]);var Fn={exports:{}};(function(Ce,Ae){(function(ge,Ne){Ce.exports=Ne()})(zn,function(){return(()=>{var ge={54:(I,T,m)=>{m.d(T,{g:()=>d});var d=function(){function u(){}return u.ZWSP="",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.4",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:()=>v});var d=m(54),u=m(526),l=m(156),v=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(g){g.parentElement.classList.contains("vditor-wysiwyg__pre")||g.parentElement.classList.contains("vditor-ir__marker--pre")||g.getAttribute("data-processed")!=="true"&&(ABCJS.renderAbc(g,l.abcRenderAdapter.getCode(g).trim()),g.style.overflowX="auto",g.setAttribute("data-processed","true"))})})}},156:(I,T,m)=>{m.r(T),m.d(T,{mathRenderAdapter:()=>d,mermaidRenderAdapter:()=>u,markmapRenderAdapter:()=>l,mindmapRenderAdapter:()=>v,chartRenderAdapter:()=>a,abcRenderAdapter:()=>c,graphvizRenderAdapter:()=>p,flowchartRenderAdapter:()=>g,plantumlRenderAdapter:()=>L});var d={getCode:function(w){return w.textContent},getElements:function(w){return w.querySelectorAll(".language-math")}},u={getCode:function(w){return w.textContent},getElements:function(w){return w.querySelectorAll(".language-mermaid")}},l={getCode:function(w){return w.textContent},getElements:function(w){return w.querySelectorAll(".language-markmap")}},v={getCode:function(w){return w.getAttribute("data-code")},getElements:function(w){return w.querySelectorAll(".language-mindmap")}},a={getCode:function(w){return w.innerText},getElements:function(w){return w.querySelectorAll(".language-echarts")}},c={getCode:function(w){return w.textContent},getElements:function(w){return w.querySelectorAll(".language-abc")}},p={getCode:function(w){return w.textContent},getElements:function(w){return w.querySelectorAll(".language-graphviz")}},g={getCode:function(w){return w.textContent},getElements:function(w){return w.querySelectorAll(".language-flowchart")}},L={getCode:function(w){return w.textContent},getElements:function(w){return w.querySelectorAll(".language-plantuml")}}},314:(I,T,m)=>{m.d(T,{p:()=>v});var d=m(54),u=m(526),l=m(156),v=function(a,c,p){a===void 0&&(a=document),c===void 0&&(c=d.g.CDN);var g=l.chartRenderAdapter.getElements(a);g.length>0&&(0,u.G)(c+"/dist/js/echarts/echarts.min.js","vditorEchartsScript").then(function(){g.forEach(function(L){if(!L.parentElement.classList.contains("vditor-wysiwyg__pre")&&!L.parentElement.classList.contains("vditor-ir__marker--pre")){var w=l.chartRenderAdapter.getCode(L).trim();if(w)try{if(L.getAttribute("data-processed")==="true")return;var C=JSON.parse(w);echarts.init(L,p==="dark"?"dark":void 0).setOption(C),L.setAttribute("data-processed","true")}catch(k){L.className="vditor-reset--error",L.innerHTML="echarts render error: <br>"+k}}})})}},730:(I,T,m)=>{m.d(T,{O:()=>l});var d=m(51),u=m(54),l=function(v){v.querySelectorAll("pre > code").forEach(function(a,c){var p,g,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||v.classList.contains("vditor-preview")&&c>5)){var w=a.innerText;if(a.classList.contains("highlight-chroma")){var C=document.createElement("code");C.innerHTML=a.innerHTML,C.querySelectorAll(".highlight-ln").forEach(function(N){N.remove()}),w=C.innerText}else w.endsWith(`
`)&&(w=w.substr(0,w.length-1));var k='<svg><use xlink:href="#vditor-icon-copy"></use></svg>';document.getElementById("vditorIconScript")||(k='<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 S=document.createElement("div");S.className="vditor-copy",S.innerHTML='<span aria-label="'+(((p=window.VditorI18n)===null||p===void 0?void 0:p.copy)||"复制")+`"
onmouseover="this.setAttribute('aria-label', '`+(((g=window.VditorI18n)===null||g===void 0?void 0:g.copy)||"复制")+`')"
class="vditor-tooltipped vditor-tooltipped__w"
onclick="this.previousElementSibling.select();document.execCommand('copy');this.setAttribute('aria-label', '`+(((L=window.VditorI18n)===null||L===void 0?void 0:L.copied)||"已复制")+`')">`+k+"</span>";var f=document.createElement("textarea");f.value=(0,d.X)(w),S.insertAdjacentElement("afterbegin",f),a.before(S),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:()=>v});var d=m(54),u=m(526),l=m(156),v=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(g){if(g.getAttribute("data-processed")!=="true"){var L=flowchart.parse(l.flowchartRenderAdapter.getCode(g));g.innerHTML="",L.drawSVG(g),g.setAttribute("data-processed","true")}})})}},218:(I,T,m)=>{m.d(T,{v:()=>v});var d=m(54),u=m(526),l=m(156),v=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(g){var L=l.graphvizRenderAdapter.getCode(g);if(!g.parentElement.classList.contains("vditor-wysiwyg__pre")&&!g.parentElement.classList.contains("vditor-ir__marker--pre")&&g.getAttribute("data-processed")!=="true"&&L.trim()!==""){try{var w=new Blob(["importScripts('"+document.getElementById("vditorGraphVizScript").src.replace("viz.js","full.render.js")+"');"],{type:"application/javascript"}),C=(window.URL||window.webkitURL).createObjectURL(w),k=new Worker(C);new Viz({worker:k}).renderSVGElement(L).then(function(S){g.innerHTML=S.outerHTML}).catch(function(S){g.innerHTML="graphviz render error: <br>"+S,g.className="vditor-reset--error"})}catch(S){console.error("graphviz error",S)}g.setAttribute("data-processed","true")}})})}},702:(I,T,m)=>{m.d(T,{s:()=>v});var d=m(54),u=m(526),l=m(578),v=function(a,c,p){c===void 0&&(c=document),p===void 0&&(p=d.g.CDN);var g=a.style;d.g.CODE_THEME.includes(g)||(g="github");var L=document.getElementById("vditorHljsStyle"),w=p+"/dist/js/highlight.js/styles/"+g+".css";L&&L.href!==w&&L.remove(),(0,l.c)(p+"/dist/js/highlight.js/styles/"+g+".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(C){if(!C.parentElement.classList.contains("vditor-ir__marker--pre")&&!C.parentElement.classList.contains("vditor-wysiwyg__pre")&&!(C.classList.contains("language-mermaid")||C.classList.contains("language-flowchart")||C.classList.contains("language-echarts")||C.classList.contains("language-mindmap")||C.classList.contains("language-plantuml")||C.classList.contains("language-abc")||C.classList.contains("language-graphviz")||C.classList.contains("language-math"))&&(a.defaultLang!==""&&C.className.indexOf("language-")===-1&&C.classList.add("language-"+a.defaultLang),hljs.highlightElement(C),a.lineNumber)){C.classList.add("vditor-linenumber");var k=C.querySelector(".vditor-linenumber__temp");k||((k=document.createElement("div")).className="vditor-linenumber__temp",C.insertAdjacentElement("beforeend",k));var S=getComputedStyle(C).whiteSpace,f=!1;S!=="pre-wrap"&&S!=="pre-line"||(f=!0);var N="",O=C.textContent.split(/\r\n|\r|\n/g);O.pop(),O.map(function(F){var Z="";f&&(k.textContent=F||`
`,Z=' style="height:'+k.getBoundingClientRect().height+'px"'),N+="<span"+Z+"></span>"}),k.style.display="none",N='<span class="vditor-linenumber__rows">'+N+"</span>",C.insertAdjacentHTML("beforeend",N)}})})})})}},563:(I,T,m)=>{m.d(T,{K:()=>c});var d=m(54),u=m(526),l=m(156),v={},a=function(p,g){var L=window.markmap,w=L.Transformer,C=L.Markmap,k=L.deriveOptions,S=(L.globalCSS,new w);p.innerHTML='<svg style="width:100%"></svg>';var f=p.firstChild,N=C.create(f,null),O=function(ae,he){var pe=ae.transform(he),de=Object.keys(pe.features).filter(function(ye){return!v[ye]});de.forEach(function(ye){v[ye]=!0});var fe=ae.getAssets(de),Le=fe.styles,Se=fe.scripts,Ie=window.markmap;return Le&&Ie.loadCSS(Le),Se&&Ie.loadJS(Se),pe}(S,g),F=O.root,Z=O.frontmatter,oe=k(Z==null?void 0:Z.markmap);N.setData(F,oe),N.fit()},c=function(p,g,L){g===void 0&&(g=d.g.CDN);var w=l.markmapRenderAdapter.getElements(p);w.length!==0&&(0,u.G)(g+"/src/js/markmap/markmap.min.js","vditorMermaidScript").then(function(){w.forEach(function(C){var k=l.markmapRenderAdapter.getCode(C);if(C.getAttribute("data-processed")!=="true"&&k.trim()!==""){var S=document.createElement("div");S.className="language-markmap",C.parentNode.appendChild(S),a(S,k),C.parentNode.childNodes[0].nodeName=="CODE"&&C.parentNode.removeChild(C.parentNode.childNodes[0])}})})}},466:(I,T,m)=>{m.d(T,{H:()=>c});var d=m(54),u=m(526),l=m(578),v=m(51),a=m(156),c=function(p,g){var L=a.mathRenderAdapter.getElements(p);if(L.length!==0){var w={cdn:d.g.CDN,math:{engine:"KaTeX",inlineDigit:!1,macros:{}}};if(g&&g.math&&(g.math=Object.assign({},w.math,g.math)),(g=Object.assign({},w,g)).math.engine==="KaTeX")(0,l.c)(g.cdn+"/dist/js/katex/katex.min.css","vditorKatexStyle"),(0,u.G)(g.cdn+"/dist/js/katex/katex.min.js","vditorKatexScript").then(function(){(0,u.G)(g.cdn+"/dist/js/katex/mhchem.min.js","vditorKatexChemScript").then(function(){L.forEach(function(k){if(!k.parentElement.classList.contains("vditor-wysiwyg__pre")&&!k.parentElement.classList.contains("vditor-ir__marker--pre")&&!k.getAttribute("data-math")){var S=(0,v.X)(a.mathRenderAdapter.getCode(k));k.setAttribute("data-math",S);try{k.innerHTML=katex.renderToString(S,{displayMode:k.tagName==="DIV",output:"html"})}catch(f){k.innerHTML=f.message,k.className="language-math vditor-reset--error"}k.addEventListener("copy",function(f){f.stopPropagation(),f.preventDefault();var N=f.currentTarget.closest(".language-math");f.clipboardData.setData("text/html",N.innerHTML),f.clipboardData.setData("text/plain",N.getAttribute("data-math"))})}})})});else if(g.math.engine==="MathJax"){window.MathJax||(window.MathJax={loader:{paths:{mathjax:g.cdn+"/dist/js/mathjax"}},startup:{typeset:!1},tex:{macros:g.math.macros}}),(0,u.J)(g.cdn+"/dist/js/mathjax/tex-svg-full.js","protyleMathJaxScript");var C=function(k,S){var f=(0,v.X)(k.textContent).trim(),N=window.MathJax.getMetricsFor(k);N.display=k.tagName==="DIV",window.MathJax.tex2svgPromise(f,N).then(function(O){k.innerHTML="",k.setAttribute("data-math",f),k.append(O),window.MathJax.startup.document.clear(),window.MathJax.startup.document.updateDocument();var F=O.querySelector('[data-mml-node="merror"]');F&&F.textContent.trim()!==""&&(k.innerHTML=F.textContent.trim(),k.className="vditor-reset--error"),S&&S()})};window.MathJax.startup.promise.then(function(){for(var k=[],S=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,v.X)(O.textContent).trim()||k.push(function(F){N===L.length-1?C(O):C(O,F)})},f=0;f<L.length;f++)S(f);(function(N){if(N.length!==0){var O=0,F=N[N.length-1],Z=function(){var oe=N[O++];oe===F?oe():oe(Z)};Z()}})(k)})}}}},554:(I,T,m)=>{m.d(T,{Y:()=>d});var d=function(u){u&&u.querySelectorAll("a").forEach(function(l){var v=l.getAttribute("href");v&&(v.match(/^.+.(mp4|m4v|ogg|ogv|webm)$/)?function(a,c){a.insertAdjacentHTML("afterend",'<video controls="controls" src="'+c+'"></video>'),a.remove()}(l,v):v.match(/^.+.(mp3|wav|flac)$/)?function(a,c){a.insertAdjacentHTML("afterend",'<audio controls="controls" src="'+c+'"></audio>'),a.remove()}(l,v):function(a,c){var p=c.match(/\/\/(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))([\w|-]{11})(?:(?:[\?&]t=)(\S+))?/),g=c.match(/\/\/v\.youku\.com\/v_show\/id_(\w+)=*\.html/),L=c.match(/\/\/v\.qq\.com\/x\/cover\/.*\/([^\/]+)\.html\??.*/),w=c.match(/(?:www\.|\/\/)coub\.com\/view\/(\w+)/),C=c.match(/(?:www\.|\/\/)facebook\.com\/([^\/]+)\/videos\/([0-9]+)/),k=c.match(/.+dailymotion.com\/(video|hub)\/(\w+)\?/),S=c.match(/(?:www\.|\/\/)bilibili\.com\/video\/(\w+)/),f=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()):g&&g[1]?(a.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//player.youku.com/embed/'+g[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()):w&&w[1]?(a.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
src="//coub.com/embed/`+w[1]+'?muted=false&autostart=false&originalSize=true&startWithHD=true"></iframe>'),a.remove()):C&&C[0]?(a.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
src="https://www.facebook.com/plugins/video.php?href=`+encodeURIComponent(C[0])+'"></iframe>'),a.remove()):k&&k[2]?(a.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
src="https://www.dailymotion.com/embed/video/`+k[2]+'"></iframe>'),a.remove()):S&&S[1]?(a.insertAdjacentHTML("afterend",`<iframe class="iframe__video"
src="//player.bilibili.com/player.html?bvid=`+S[1]+'"></iframe>'),a.remove()):f&&f[1]&&(a.insertAdjacentHTML("afterend",'<iframe class="iframe__video" src="//embed.ted.com/talks/'+f[1]+'"></iframe>'),a.remove())}(l,v))})}},40:(I,T,m)=>{m.d(T,{i:()=>v});var d=m(54),u=m(526),l=m(156),v=function(a,c,p){c===void 0&&(c=d.g.CDN);var g=l.mermaidRenderAdapter.getElements(a);g.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),g.forEach(function(w){var C=l.mermaidRenderAdapter.getCode(w);w.getAttribute("data-processed")!=="true"&&C.trim()!==""&&(mermaid.init(void 0,w),w.setAttribute("data-processed","true"))})})}},749:(I,T,m)=>{m.d(T,{P:()=>v});var d=m(54),u=m(526),l=m(156),v=function(a,c,p){a===void 0&&(a=document),c===void 0&&(c=d.g.CDN);var g=l.mindmapRenderAdapter.getElements(a);g.length>0&&(0,u.G)(c+"/dist/js/echarts/echarts.min.js","vditorEchartsScript").then(function(){g.forEach(function(L){if(!L.parentElement.classList.contains("vditor-wysiwyg__pre")&&!L.parentElement.classList.contains("vditor-ir__marker--pre")){var w=l.mindmapRenderAdapter.getCode(L);if(w)try{if(L.getAttribute("data-processed")==="true")return;echarts.init(L,p==="dark"?"dark":void 0).setOption({series:[{data:[JSON.parse(decodeURIComponent(w))],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(C,k){var S;return!((S=k==null?void 0:k.data)===null||S===void 0)&&S.children?"circle":"path://"},type:"tree"}],tooltip:{trigger:"item",triggerOn:"mousemove"}}),L.setAttribute("data-processed","true")}catch(C){L.className="vditor-reset--error",L.innerHTML="mindmap render error: <br>"+C}}})})}},818:(I,T,m)=>{m.d(T,{k:()=>l});var d=m(64),u=m(466),l=function(v,a,c){var p="",g=[];if(Array.from(v.children).forEach(function(k,S){if((0,d.W)(k)){if(c){var f=k.id.lastIndexOf("_");k.id=k.id.substring(0,f===-1?void 0:f)+"_"+S}g.push(k.id),p+=k.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(v)?c.currentMode!=="ir"||c.preview.element.contains(v)?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 w=Lute.New();w.SetToC(!0),L.innerHTML=w.HTML2VditorDOM("<p>[ToC]</p>"+p)}var C=L.firstElementChild.querySelectorAll("li > span[data-target-id]");return C.forEach(function(k,S){if(k.nextElementSibling&&k.nextElementSibling.tagName==="UL"){var f="<svg class='vditor-outline__action'><use xlink:href='#vditor-icon-down'></use></svg>";document.getElementById("vditorIconScript")||(f='<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>'),k.innerHTML=f+"<span>"+k.innerHTML+"</span>"}else k.innerHTML="<svg></svg><span>"+k.innerHTML+"</span>";k.setAttribute("data-target-id",g[S])}),p=L.firstElementChild.innerHTML,C.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(k){for(var S=k.target;S&&!S.isEqualNode(a);){if(S.classList.contains("vditor-outline__action")){S.classList.contains("vditor-outline__action--close")?(S.classList.remove("vditor-outline__action--close"),S.parentElement.nextElementSibling.setAttribute("style","display:block")):(S.classList.add("vditor-outline__action--close"),S.parentElement.nextElementSibling.setAttribute("style","display:none")),k.preventDefault(),k.stopPropagation();break}if(S.getAttribute("data-target-id")){k.preventDefault(),k.stopPropagation();var f=document.getElementById(S.getAttribute("data-target-id"));if(!f)return;if(c)if(c.options.height==="auto"){var N=f.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(v)?v.parentElement.scrollTop=f.offsetTop:v.scrollTop=f.offsetTop;else window.scrollTo(window.scrollX,f.offsetTop);break}S=S.parentElement}}),p)}},408:(I,T,m)=>{m.d(T,{B:()=>v});var d=m(54),u=m(526),l=m(156),v=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(g){if(!g.parentElement.classList.contains("vditor-wysiwyg__pre")&&!g.parentElement.classList.contains("vditor-ir__marker--pre")){var L=l.plantumlRenderAdapter.getCode(g).trim();if(L)try{g.innerHTML='<img src="http://www.plantuml.com/plantuml/svg/~1'+plantumlEncoder.encode(L)+'">'}catch(w){g.className="vditor-reset--error",g.innerHTML="plantuml render error: <br>"+w}}})})}},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,v){v===void 0&&(v="classic");var a=u.getBoundingClientRect();document.body.insertAdjacentHTML("beforeend",'<div class="vditor vditor-img'+(v==="dark"?" vditor--dark":"")+`">
<div class="vditor-img__bar">
<span class="vditor-img__btn" data-deg="0">
<svg><use xlink:href="#vditor-icon-redo"></use></svg>
`+window.VditorI18n.spin+`
</span>
<span class="vditor-img__btn" onclick="this.parentElement.parentElement.outerHTML = '';document.body.style.overflow = ''">
X `+window.VditorI18n.close+`
</span>
</div>
<div class="vditor-img__img" onclick="this.parentElement.outerHTML = '';document.body.style.overflow = ''">
<img style="width: `+u.width+"px;height:"+u.height+"px;transform: translate3d("+a.left+"px, "+(a.top-36)+'px, 0)" src="'+u.getAttribute("src")+`">
</div>
</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 g=document.querySelector(".vditor-img__btn");g.addEventListener("click",function(){var L=parseInt(g.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)",g.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(v,a){a===void 0&&(a=d.g.CDN),d.g.CODE_THEME.includes(v)||(v="github");var c=document.getElementById("vditorHljsStyle"),p=a+"/dist/js/highlight.js/styles/"+v+".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,v){if(l&&v){var a=document.getElementById("vditorContentTheme"),c=v+"/"+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,{J:()=>d,G:()=>u});var d=function(l,v){if(document.getElementById(v))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=v,document.head.appendChild(c)},u=function(l,v){return new Promise(function(a,c){if(document.getElementById(v))return a(),!1;var p=document.createElement("script");p.src=l,p.async=!0,document.head.appendChild(p),p.onload=function(){if(document.getElementById(v))return p.remove(),a(),!1;p.id=v,a()}})}},578:(I,T,m)=>{m.d(T,{c:()=>d});var d=function(u,l){if(!document.getElementById(l)){var v=document.createElement("link");v.id=l,v.rel="stylesheet",v.type="text/css",v.href=u,document.getElementsByTagName("head")[0].appendChild(v)}}},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,{lG:()=>d,fb:()=>u});var d=function(l,v){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===v?c=!0:a=a.parentElement;return c&&a},u=function(l,v){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(v)?c=!0:a=a.parentElement;return c&&a}},64:(I,T,m)=>{m.d(T,{W:()=>d});var d=function(u){var l=function(v,a){if(!v)return!1;v.nodeType===3&&(v=v.parentElement);for(var c=v,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 v={},a=function(p){for(var g in p)p.hasOwnProperty(g)&&(Object.prototype.toString.call(p[g])==="[object Object]"?v[g]=d(v[g],p[g]):v[g]=p[g])},c=0;c<u.length;c++)a(u[c]);return v}},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 K(I){var T=Ne[I];if(T!==void 0)return T.exports;var m=Ne[I]={exports:{}};return ge[I](m,m.exports,K),m.exports}K.d=(I,T)=>{for(var m in T)K.o(T,m)&&!K.o(I,m)&&Object.defineProperty(I,m,{enumerable:!0,get:T[m]})},K.o=(I,T)=>Object.prototype.hasOwnProperty.call(I,T),K.r=I=>{typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(I,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(I,"__esModule",{value:!0})};var De={};return(()=>{K.d(De,{default:()=>ye});var I=K(478),T=K(156),m=K(314),d=K(730),u=K(66),l=K(218),v=K(702),a=function(M){M===void 0&&(M=document);var ve=function(ee){var x=document.createElement("img");x.src=ee.getAttribute("data-src"),x.addEventListener("load",function(){ee.getAttribute("style")||ee.getAttribute("class")||ee.getAttribute("width")||ee.getAttribute("height")||x.naturalHeight>x.naturalWidth&&x.naturalWidth/x.naturalHeight<document.querySelector(".vditor-reset").clientWidth/(window.innerHeight-40)&&x.naturalHeight>window.innerHeight-40&&(ee.style.height=window.innerHeight-40+"px"),ee.src=x.src}),ee.removeAttribute("data-src")};if(!("IntersectionObserver"in window))return M.querySelectorAll("img").forEach(function(ee){ee.getAttribute("data-src")&&ve(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(x){(x.isIntersecting===void 0?x.intersectionRatio!==0:x.isIntersecting)&&x.target.getAttribute("data-src")&&ve(x.target)})}),M.querySelectorAll("img").forEach(function(ee){window.vditorImageIntersectionObserver.observe(ee)}))},c=K(466),p=K(554),g=K(40),L=K(563),w=K(749),C=K(818),k=K(408),S=K(54),f=K(227),N=K(526),O=K(827),F=K(640),Z=K(895),oe=K(393),ae=function(M,ve){if(ve===void 0&&(ve="zh_CN"),typeof speechSynthesis!="undefined"&&typeof SpeechSynthesisUtterance!="undefined"){var ee='<svg><use xlink:href="#vditor-icon-play"></use></svg>',x='<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>',x='<svg viewBox="0 0 32 32"><path d="M20.617 0h9.128v32h-9.128v-32zM2.255 32v-32h9.128v32h-9.128z"></path></svg>');var B=document.querySelector(".vditor-speech");if(!B){(B=document.createElement("div")).className="vditor-speech",document.body.insertAdjacentElement("beforeend",B);var P=function(){var U,se;return speechSynthesis.getVoices().forEach(function(te){te.lang===ve.replace("_","-")&&(U=te),te.default&&(se=te)}),U||(U=se),U};speechSynthesis.onvoiceschanged!==void 0&&(speechSynthesis.onvoiceschanged=P);var D=P();B.onclick=function(){if(B.className==="vditor-speech"){var U=new SpeechSynthesisUtterance(B.getAttribute("data-text"));U.voice=D,U.onend=function(){B.className="vditor-speech",speechSynthesis.cancel(),B.innerHTML=ee},speechSynthesis.speak(U),B.className="vditor-speech vditor-speech--current",B.innerHTML=x}else speechSynthesis.speaking&&(speechSynthesis.paused?(speechSynthesis.resume(),B.innerHTML=x):(speechSynthesis.pause(),B.innerHTML=ee));(0,oe.Hc)(window.vditorSpeechRange)},document.body.addEventListener("click",function(){getSelection().toString().trim()===""&&B.style.display==="block"&&(B.className="vditor-speech",speechSynthesis.cancel(),B.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();B.innerHTML=ee,B.style.display="block",B.style.top=te.top+te.height+document.querySelector("html").scrollTop-20+"px",B.style.left=U.clientX+2+"px",B.setAttribute("data-text",se)}else B.style.display==="block"&&(B.className="vditor-speech",B.style.display="none")})}},he=function(M,ve,ee,x){return new(ee||(ee=Promise))(function(B,P){function D(te){try{se(x.next(te))}catch($){P($)}}function U(te){try{se(x.throw(te))}catch($){P($)}}function se(te){var $;te.done?B(te.value):($=te.value,$ instanceof ee?$:new ee(function(me){me($)})).then(D,U)}se((x=x.apply(M,ve||[])).next())})},pe=function(M,ve){var ee,x,B,P,D={label:0,sent:function(){if(1&B[0])throw B[1];return B[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,x&&(B=2&$[0]?x.return:$[0]?x.throw||((B=x.return)&&B.call(x),0):x.next)&&!(B=B.call(x,$[1])).done)return B;switch(x=0,B&&($=[2&$[0],B.value]),$[0]){case 0:case 1:B=$;break;case 4:return D.label++,{value:$[1],done:!1};case 5:D.label++,x=$[1],$=[0];continue;case 7:$=D.ops.pop(),D.trys.pop();continue;default:if(B=D.trys,!((B=B.length>0&&B[B.length-1])||$[0]!==6&&$[0]!==2)){D=0;continue}if($[0]===3&&(!B||$[1]>B[0]&&$[1]<B[3])){D.label=$[1];break}if($[0]===6&&D.label<B[1]){D.label=B[1],B=$;break}if(B&&D.label<B[2]){D.label=B[2],D.ops.push($);break}B[2]&&D.ops.pop(),D.trys.pop();continue}$=ve.call(M,D)}catch(me){$=[6,me],x=0}finally{ee=B=0}if(5&$[0])throw $[1];return{value:$[0]?$[1]:void 0,done:!0}}([se,te])}}},de=function(M){var ve={anchor:0,cdn:S.g.CDN,customEmoji:{},emojiPath:(M&&M.emojiPath||S.g.CDN)+"/dist/images/emoji",hljs:S.g.HLJS_OPTIONS,icon:"ant",lang:"zh_CN",markdown:S.g.MARKDOWN_OPTIONS,math:S.g.MATH_OPTIONS,mode:"light",speech:{enable:!1},theme:S.g.THEME_OPTIONS};return(0,F.T)(ve,M)},fe=function(M,ve){var ee=de(ve);return(0,N.G)(ee.cdn+"/dist/js/lute/lute.min.js","vditorLuteScript").then(function(){var x=(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 ve!=null&&ve.renderers&&x.SetJSRenderers({renderers:{Md2HTML:ve.renderers}}),x.SetHeadingID(!0),x.Md2HTML(M)})},Le=function(M,ve,ee){return he(void 0,void 0,void 0,function(){var x,B,P;return pe(this,function(D){switch(D.label){case 0:return x=de(ee),[4,fe(ve,x)];case 1:if(B=D.sent(),x.transform&&(B=x.transform(B)),M.innerHTML=B,M.classList.add("vditor-reset"),x.i18n)return[3,5];if(["en_US","fr_FR","pt_BR","ja_JP","ko_KR","ru_RU","sv_SE","zh_CN","zh_TW"].includes(x.lang))return[3,2];throw new Error("options.lang error, see https://ld246.com/article/1549638745630#options");case 2:return P="vditorI18nScript"+x.lang,document.querySelectorAll('head script[id^="vditorI18nScript"]').forEach(function(se){se.id!==P&&document.head.removeChild(se)}),[4,(0,N.G)(x.cdn+"/dist/js/i18n/"+x.lang+".js",P)];case 3:D.sent(),D.label=4;case 4:return[3,6];case 5:window.VditorI18n=x.i18n,D.label=6;case 6:return x.icon?[4,(0,N.G)(x.cdn+"/dist/js/icons/"+x.icon+".js","vditorIconScript")]:[3,8];case 7:D.sent(),D.label=8;case 8:return(0,f.Z)(x.theme.current,x.theme.path),x.anchor===1&&M.classList.add("vditor-reset--anchor"),(0,d.O)(M),(0,v.s)(x.hljs,M,x.cdn),(0,c.H)(M,{cdn:x.cdn,math:x.math}),(0,g.i)(M,x.cdn,x.mode),(0,L.K)(M,x.cdn,x.mode),(0,u.P)(M,x.cdn),(0,l.v)(M,x.cdn),(0,m.p)(M,x.cdn,x.mode),(0,w.P)(M,x.cdn,x.mode),(0,k.B)(M,x.cdn),(0,I.Q)(M,x.cdn),(0,p.Y)(M),x.speech.enable&&ae(M),x.anchor!==0&&(U=x.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)}),x.after&&x.after(),x.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=K(863),Ie=K(312);const ye=function(){function M(){}return M.adapterRender=T,M.previewImage=Se.E,M.codeRender=d.O,M.graphvizRender=l.v,M.highlightRender=v.s,M.mathRender=c.H,M.mermaidRender=g.i,M.markmapRender=L.K,M.flowchartRender=u.P,M.chartRender=m.p,M.abcRender=I.Q,M.mindmapRender=w.P,M.plantumlRender=k.B,M.outlineRender=C.k,M.mediaRender=p.Y,M.speechRender=ae,M.lazyLoadImageRender=a,M.md2html=fe,M.preview=Le,M.setCodeTheme=Ie.Y,M.setContentTheme=f.Z,M}()})(),De=De.default})()})})(Fn);var Ii=Fn.exports;const Gt=Gn(Ii),Ri=Pn({__name:"MarkdownViewer",props:{value:{type:String},class:{type:String}},setup(Ce){const Ae=Ce,ge=at(null),Ne=at(null),{getDarkMode:K}=jn();function De(){const T=st(ge);Ne.value=Gt.preview(T,Ae.value,{mode:Ue(K.value,"content"),theme:{current:Ue(K.value,"content")},hljs:{style:Ue(K.value,"code")}})}Mt(()=>K.value,T=>{Gt.setContentTheme(Ue(T,"content")),Gt.setCodeTheme(Ue(T,"code")),De()}),Mt(()=>Ae.value,(T,m)=>{T!==m&&De()});function I(){var m;const T=st(Ne);if(T){try{(m=T==null?void 0:T.destroy)==null||m.call(T)}catch(d){}Ne.value=null}}return Wn(De),qn(I),Bn(I),(T,m)=>(Vn(),Un("div",{ref_key:"viewerRef",ref:ge,id:"markdownViewer",class:Ai(T.$props.class)},null,2))}}),Pi=In(Ri,[["__file","E:/allcode/erp/test7901/order-erp-front/src/components/Markdown/src/MarkdownViewer.vue"]]),Wi=Rn(ji),Ki=Rn(Pi);export{Wi as M,Ki as a};